Compare commits

..

22 Commits

Author SHA1 Message Date
Nicola Pievani aefc037cd9 Correzione apertura programma da progetto 2023-05-23 16:18:13 +02:00
Nicola Pievani c5f3d4fcfb Merge branch 'develop' 2023-05-18 15:33:23 +02:00
Nicola Pievani a04e2cbe62 Gestione avanzata posizionamento pezzi VeinMatch 2023-05-18 14:43:03 +02:00
Nicola Pievani da980a649e Merge branch 'Features/Compo_Frames' into develop 2023-05-18 11:18:14 +02:00
Nicola Pievani 4c282d7531 Abilito visualizzazione pulsante per inserimento FrameCompo 2023-05-18 11:13:40 +02:00
Nicola Pievani a941f963c2 Disabilito i comandi dei compo piani 2023-05-16 10:31:58 +02:00
Nicola Pievani eab341d7fe Importazione FrameCompo 2023-05-15 19:37:31 +02:00
Nicola Pievani 9c7d60d307 Aggiornati i messaggi 2023-05-15 14:57:25 +02:00
Nicola Pievani a7adcdcaca Correzione visualizzazione Pagine componenti 2023-05-15 12:14:54 +02:00
Nicola Pievani acb8ceed4d Merge branch 'Features/Other_Ref_On_Table' into develop 2023-05-09 17:15:22 +02:00
Nicola Pievani 65d8f58b45 Migliorata impaginazione dati e disegno RefTab 2023-05-09 17:15:10 +02:00
Nicola Pievani 07cf7ced42 Definizione nuovp roferimento su stavola 2023-05-08 20:04:56 +02:00
Nicola Pievani b1410ca11c Aggiunti parametri TCPOS e DIAM per comandi diretti 2023-05-05 13:12:15 +02:00
Nicola Pievani 1975f46995 Merge branch 'Features/Probing_Polishing_Tool' into develop 2023-05-04 14:55:56 +02:00
Nicola Pievani 6863186e07 Aggiunto nuovo parametro per tastatura 2023-05-04 14:37:17 +02:00
Nicola Pievani b434f80030 Correzione gestione Z safe, cambio versione 2.5e1 2023-05-03 18:09:58 +02:00
Nicola Pievani ef1aef12ed Merge branch 'develop' 2023-04-28 13:24:04 +02:00
Nicola Pievani efafacf6ca Merge branch 'develop' 2023-04-07 10:01:54 +02:00
Nicola Pievani 652c396933 Merge branch 'develop' 2023-03-20 15:37:52 +01:00
Nicola Pievani 7ecad4c218 Merge branch 'develop' 2023-03-13 10:45:46 +01:00
Nicola Pievani 36a1ecb509 Merge branch 'develop' 2023-03-09 12:53:18 +01:00
NicolaP b48d4900ea Merge branch 'develop' 2023-02-10 13:20:23 +01:00
30 changed files with 1244 additions and 845 deletions
+2 -19
View File
@@ -1,5 +1,4 @@
Imports System.Windows.Forms.Integration
Imports EgtUILib
Imports EgtUILib
Friend Module CamAuto
@@ -30,7 +29,7 @@ Friend Module CamAuto
Return bOk
End Function
Friend Function AddWaterJetMachining(nOperId As Integer, ByRef nWarn As Integer) As Boolean
Friend Function AddWaterJetMachining( nOperId As Integer, ByRef nWarn As Integer) As Boolean
EgtLuaCreateGlobTable("CAM")
SetLuaStandardCamParams()
EgtLuaSetGlobIntVar("CAM.OPERID", nOperId)
@@ -164,22 +163,6 @@ Friend Module CamAuto
Return bOk
End Function
Friend Function ResetAllRawPart() As Boolean
Dim nPhase As Integer = 1
Dim nOtherRaw As Integer = EgtGetFirstRawPart()
While nOtherRaw <> GDB_ID.NULL
' se il pezzo non appartiene alla prima fase allora viene eliminato
If Not EgtVerifyRawPartPhase(nOtherRaw, nPhase) Then
Dim NextRaw As Integer = EgtGetNextRawPart(nOtherRaw)
EgtRemoveRawPart(nOtherRaw)
nOtherRaw = NextRaw
Else
nOtherRaw = EgtGetNextRawPart(nOtherRaw)
End If
End While
Return True
End Function
' verifico che il contorno passato non sia stato separato
Friend Function VerifyOutLoopIsClosed(nIdLayerOutLoop As Integer)
Dim nIdMy As Integer = EgtGetFirstInGroup(nIdLayerOutLoop)
+120 -123
View File
@@ -7,167 +7,164 @@
mc:Ignorable="d"
d:DesignHeight="853.3" d:DesignWidth="1280">
<!-- Definizione della SplitPage -->
<Grid Name="SplitPageGrid" >
<Grid.ColumnDefinitions>
<ColumnDefinition Width="3*"/>
<ColumnDefinition Width="12*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="1*"/>
<RowDefinition Height="8*"/>
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
<!-- Definizione della SplitPage -->
<Grid Name="SplitPageGrid" >
<Grid.ColumnDefinitions>
<ColumnDefinition Width="3*"/>
<ColumnDefinition Width="12*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="1*"/>
<RowDefinition Height="8*"/>
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
<!--Upper button grid-->
<Grid Grid.Column="1">
<!--Upper button grid-->
<Grid Grid.Column="1">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="4*"/>
<ColumnDefinition Width="8*"/>
</Grid.ColumnDefinitions>
<!--Griglia per oscurare i bottoni della pagina sottostante-->
<Grid Background="{DynamicResource OmagCut_Gray}">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="4*"/>
<ColumnDefinition Width="8*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<!--Griglia per oscurare i bottoni della pagina sottostante-->
<Grid Background="{DynamicResource OmagCut_Gray}">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<Button Name="PrevBtn" Grid.Column="0" Style="{DynamicResource OmagCut_YellowIconButton}">
<Image Source="{DynamicResource NumericKeyboardArrowImg}" Style="{StaticResource OmagCut_ButtonIcon}"/>
</Button>
<Button Name="NextBtn" Grid.Column="1" Style="{DynamicResource OmagCut_YellowIconButton}">
<Image Source="{DynamicResource NumericKeyboardArrowImg}" Style="{StaticResource OmagCut_ButtonIcon}" RenderTransformOrigin="0.5,0.5">
<Image.RenderTransform>
<TransformGroup>
<RotateTransform Angle="180"/>
</TransformGroup>
</Image.RenderTransform>
</Image>
</Button>
<Button Name="ModifyBtn" Grid.Column="2" Style="{DynamicResource OmagCut_YellowTextButton}"/>
</Grid>
</Grid>
<!--Left Button Grid-->
<Grid Grid.RowSpan="3">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
</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="1*"/>
</Grid.RowDefinitions>
<Button Name="TopLBtn" Grid.Column="0" Grid.Row="1"
Style="{DynamicResource OmagCut_TopGrayGradientYellowButton}">
<Image Source="{DynamicResource TopLeftImg}" Style="{StaticResource OmagCut_ArrowButtonIcon}"/>
<Button Name="PrevBtn" Grid.Column="0" Style="{DynamicResource OmagCut_YellowIconButton}">
<Image Source="{DynamicResource NumericKeyboardArrowImg}" Style="{StaticResource OmagCut_ButtonIcon}"/>
</Button>
<Button Name="UpBtn" Grid.Column="1" Grid.Row="1"
Style="{DynamicResource OmagCut_TopGrayGradientYellowButton}">
<Image Source="{DynamicResource UpArrowImg}" Style="{StaticResource OmagCut_ArrowButtonIcon}"/>
<Button Name="NextBtn" Grid.Column="1" Style="{DynamicResource OmagCut_YellowIconButton}">
<Image Source="{DynamicResource NumericKeyboardArrowImg}" Style="{StaticResource OmagCut_ButtonIcon}" RenderTransformOrigin="0.5,0.5">
<Image.RenderTransform>
<TransformGroup>
<RotateTransform Angle="180"/>
</TransformGroup>
</Image.RenderTransform>
</Image>
</Button>
<Button Name="TopRBtn" Grid.Column="2" Grid.Row="1"
<Button Name="ModifyBtn" Grid.Column="2" Style="{DynamicResource OmagCut_YellowTextButton}"/>
</Grid>
</Grid>
<!--Left Button Grid-->
<Grid Grid.RowSpan="3">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
</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="1*"/>
</Grid.RowDefinitions>
<Button Name="TopLBtn" Grid.Column="0" Grid.Row="1"
Style="{DynamicResource OmagCut_TopGrayGradientYellowButton}">
<Image Source="{DynamicResource TopRightImg}" Style="{StaticResource OmagCut_ArrowButtonIcon}"/>
</Button>
<Button Name="LeftBtn" Grid.Column="0" Grid.Row="2"
<Image Source="{DynamicResource TopLeftImg}" Style="{StaticResource OmagCut_ArrowButtonIcon}"/>
</Button>
<Button Name="UpBtn" Grid.Column="1" Grid.Row="1"
Style="{DynamicResource OmagCut_TopGrayGradientYellowButton}">
<Image Source="{DynamicResource UpArrowImg}" Style="{StaticResource OmagCut_ArrowButtonIcon}"/>
</Button>
<Button Name="TopRBtn" Grid.Column="2" Grid.Row="1"
Style="{DynamicResource OmagCut_TopGrayGradientYellowButton}">
<Image Source="{DynamicResource TopRightImg}" Style="{StaticResource OmagCut_ArrowButtonIcon}"/>
</Button>
<Button Name="LeftBtn" Grid.Column="0" Grid.Row="2"
Style="{DynamicResource OmagCut_LeftGrayGradientYellowButton}">
<Image Source="{DynamicResource LeftArrowImg}" Style="{StaticResource OmagCut_ArrowButtonIcon}"/>
</Button>
<EgtWPFLib:EgtTextBox Name="StepMoveTxBx" Grid.Column="1" Grid.Row="2" Width="50"
<Image Source="{DynamicResource LeftArrowImg}" Style="{StaticResource OmagCut_ArrowButtonIcon}"/>
</Button>
<EgtWPFLib:EgtTextBox Name="StepMoveTxBx" Grid.Column="1" Grid.Row="2" Width="50"
Style="{DynamicResource OmagCut_CalculatorTextBox}"/>
<Button Name="ResetBtn" Grid.Column="1" Grid.Row="2"
<Button Name="ResetBtn" Grid.Column="1" Grid.Row="2"
Style="{DynamicResource OmagCut_YellowTextButton}">
</Button>
<Button Name="RightBtn" Grid.Column="2" Grid.Row="2"
</Button>
<Button Name="RightBtn" Grid.Column="2" Grid.Row="2"
Style="{DynamicResource OmagCut_RightGrayGradientYellowButton}">
<Image Source="{DynamicResource RightArrowImg}" Style="{StaticResource OmagCut_ArrowButtonIcon}"/>
</Button>
<Button Name="BottomLBtn" Grid.Column="0" Grid.Row="3"
<Image Source="{DynamicResource RightArrowImg}" Style="{StaticResource OmagCut_ArrowButtonIcon}"/>
</Button>
<Button Name="BottomLBtn" Grid.Column="0" Grid.Row="3"
Style="{DynamicResource OmagCut_BottomGrayGradientYellowButton}">
<Image Source="{DynamicResource BottomLeftImg}" Style="{StaticResource OmagCut_ArrowButtonIcon}"/>
</Button>
<Button Name="DownBtn" Grid.Column="1" Grid.Row="3"
<Image Source="{DynamicResource BottomLeftImg}" Style="{StaticResource OmagCut_ArrowButtonIcon}"/>
</Button>
<Button Name="DownBtn" Grid.Column="1" Grid.Row="3"
Style="{DynamicResource OmagCut_BottomGrayGradientYellowButton}">
<Image Source="{DynamicResource DownArrowImg}" Style="{StaticResource OmagCut_ArrowButtonIcon}"/>
</Button>
<Button Name="BottomRBtn" Grid.Column="2" Grid.Row="3"
<Image Source="{DynamicResource DownArrowImg}" Style="{StaticResource OmagCut_ArrowButtonIcon}"/>
</Button>
<Button Name="BottomRBtn" Grid.Column="2" Grid.Row="3"
Style="{DynamicResource OmagCut_BottomGrayGradientYellowButton}">
<Image Source="{DynamicResource BottomRightImg}" Style="{StaticResource OmagCut_ArrowButtonIcon}"/>
</Button>
<Image Source="{DynamicResource BottomRightImg}" Style="{StaticResource OmagCut_ArrowButtonIcon}"/>
</Button>
<Button Name="RotateCounterClockwiseBtn" Grid.Column="0" Grid.Row="4"
<Button Name="RotateCounterClockwiseBtn" Grid.Column="0" Grid.Row="4"
Style="{DynamicResource OmagCut_RightGrayGradientYellowButton}">
<Image Source="{DynamicResource CounterClockwiseRotateImg}" Width="64" Height="65" HorizontalAlignment="Center"
VerticalAlignment="Center" />
</Button>
</Button>
<Grid Name="RotationAngle" Grid.Column="1" Grid.Row="4" HorizontalAlignment="Center" VerticalAlignment="Center">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<EgtWPFLib:EgtTextBox Name="RotationAngleTxBx" Width="50" IsLength="False"
<Grid Name="RotationAngle" Grid.Column="1" Grid.Row="4" HorizontalAlignment="Center" VerticalAlignment="Center">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<EgtWPFLib:EgtTextBox Name="RotationAngleTxBx" Width="50" IsLength="False"
Style="{DynamicResource OmagCut_CalculatorTextBox}"/>
<TextBlock Grid.Column="1" FontSize="30" Margin="2,-5,0,0"
<TextBlock Grid.Column="1" FontSize="30" Margin="2,-5,0,0"
Text="°"/>
</Grid>
</Grid>
<Button Name="RotateClockwiseBtn" Grid.Column="2" Grid.Row="4"
<Button Name="RotateClockwiseBtn" Grid.Column="2" Grid.Row="4"
Style="{DynamicResource OmagCut_RightGrayGradientYellowButton}">
<Image Source="{DynamicResource ClockwiseRotateImg}" Width="65" Height="65" HorizontalAlignment="Center"
<Image Source="{DynamicResource ClockwiseRotateImg}" Width="65" Height="65" HorizontalAlignment="Center"
VerticalAlignment="Center" />
</Button>
</Button>
<!--Gestione sfridi-->
<Button Name="RemovePartBtn" Grid.ColumnSpan="2" Grid.Row="6"
<Button Name="RemovePartBtn" Grid.ColumnSpan="2" Grid.Row="6"
Style="{DynamicResource OmagCut_YellowTextButton}"/>
<Button Name="ScrapsBtn" Grid.Column="3" Grid.Row="6"
<Button Name="ScrapsBtn" Grid.Column="3" Grid.Row="6"
Style="{DynamicResource OmagCut_YellowTextButton}"/>
<!--Gestione scarico pezzi-->
<Button Name="UnloadPartsBtn" Grid.ColumnSpan="2" Grid.Row="7"
Style="{DynamicResource OmagCut_YellowTextButton}"/>
<Grid Grid.Row="7" Grid.ColumnSpan="3">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="0.5*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="0.5*"/>
</Grid.ColumnDefinitions>
</Grid>
</Grid>
<!--Lower button grid, sfondo grigio per coprire i bottoni della pagina sottostante-->
<Grid Grid.Column="1" Grid.Row="2" Background="{DynamicResource OmagCut_Gray}">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="10*"/>
<ColumnDefinition Width="0.5*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="0.5*"/>
</Grid.ColumnDefinitions>
</Grid>
</Grid>
<!--Lower button grid, sfondo grigio per coprire i bottoni della pagina sottostante-->
<Grid Grid.Column="1" Grid.Row="2" Background="{DynamicResource OmagCut_Gray}">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="10*"/>
</Grid.ColumnDefinitions>
<!-- Inserimento della pausa durante il movimento sulla tavola di scarico-->
<Button Name="PauseBtn" Grid.Column="1" Style="{DynamicResource OmagCut_YellowIconButton}">
<Image Source="{DynamicResource Pausa-ON_OFFImg}" Style="{StaticResource OmagCut_ArrowButtonIcon}"/>
</Button>
</Grid>
</Grid>
</Grid>
</UserControl>
+72 -304
View File
@@ -1,5 +1,4 @@
Imports System.Windows.Forms.Integration
Imports EgtUILib
Imports EgtUILib
Public Class MoveRawPartPage
' Riferimento alla MainWindow
@@ -36,16 +35,12 @@ Public Class MoveRawPartPage
Private m_ScrapsVisibility As Visibility = Visibility.Visible
Private m_CurrRawOnVacuum As Integer = GDB_ID.NULL
' definisce se è stata inserito uno scarico
Private m_IsCurrPhaseUnloaded As Boolean = False
Private Sub MoveRawPartPage_Initialized(sender As Object, e As EventArgs) Handles Me.Initialized
' Assegno testi
RemovePartBtn.Content = EgtMsg(MSG_MOVERAWPAGEUC + 1) 'Rimuovi
ModifyBtn.Content = EgtMsg(MSG_SPLITPAGEUC + 17) 'Modifica
ResetBtn.Content = EgtMsg(MSG_NESTPAGEUC + 6) 'Reset
ScrapsBtn.Content = "Add Scraps"
UnloadPartsBtn.Content = "Move part"
End Sub
Private Sub MoveRawPartPage_Loaded(sender As Object, e As EventArgs) Handles Me.Loaded
@@ -65,12 +60,7 @@ Public Class MoveRawPartPage
End If
' Deseleziono tutto
EgtDeselectAll()
' resetto variabili di navigazione nelle fasi
m_bPrev = False
m_bToNext = False
'---------------------------- CREATE NEW PHASE ----------------------------
' Recupero i tagli ABILITATI prima definiti
' Recupero i tagli allungati prima definiti
Dim Cuts(0) As Integer
m_SplitPage.GetEnabledCuts(Cuts)
' Fase precedente
@@ -79,19 +69,11 @@ Public Class MoveRawPartPage
Dim vNewRaws As New List(Of Integer)
If Not m_SplitPage.m_bShow Then
SplitRawParts(nPrevPhase, Cuts, vNewRaws)
m_IsCurrPhaseUnloaded = False
Else
nPrevPhase = nPrevPhase + 1
EgtSetCurrPhase(nPrevPhase)
EgtSetCurrPhase(nPrevPhase + 1)
HideAllMachinings()
' verifico se la fase corrente è di tipo scarico frontale
m_nCurrDisposition = EgtGetPhaseDisposition(nPrevPhase)
If IsDispUnloadOnAuxTab(m_nCurrDisposition) Then
m_SplitPage.m_bOnAuxTab = True
End If
End If
m_nCurrPhase = EgtGetCurrPhase()
'---------------------------- CREATE NEW PHASE ----------------------------
'---------------------------- SCRAPS ----------------------------
' gestione visualizzazione del comando "Scraps"
@@ -119,19 +101,14 @@ Public Class MoveRawPartPage
End If
'---------------------------- SCRAPS ----------------------------
'---------------------------- AUX TABLE ----------------------------
' Se movimento pezzi finale, sistemazioni per tavolo ausiliario
If m_SplitPage.m_bOnAuxTab And m_SplitPage.m_bEnableOnAuxTab Then
' assegnazione delle info tavola ausiliaria alla dispozione corrente (Spostato nella funzione Refresh)
If m_SplitPage.m_bOnAuxTab Then
' assegnazione delle info tavola ausiliaria alla dispozione corrente
SetAuxTabInCurrDisposition()
UnloadPartsBtn.Content = "Go to MOVE part"
' altrimenti, aggiorno visualizzazione
ElseIf Not m_SplitPage.m_bOnAuxTab And m_SplitPage.m_bEnableOnAuxTab Then
Else
EgtDraw()
UnloadPartsBtn.Content = "Go to UNLOAD part"
End If
'---------------------------- AUX TABLE ----------------------------
' Carico i parametri di movimento
m_dStep = GetPrivateProfileDouble(S_RAWMOVE, K_RAWSTEP, 50, m_MainWindow.GetIniFile())
' Ricavo la lunghezza del baffo di taglio
@@ -190,30 +167,6 @@ Public Class MoveRawPartPage
' aggiorno il messaggio del comando per gestire gli sfridi
VerifyIsNewScrap(m_CurrRawOnVacuum)
' aggiorno la visibilità dei comandi
RefreshVisibility()
' salvo l'idice della fase corrente
m_nCurrDisposition = EgtGetPhaseDisposition(m_nCurrPhase)
' Abilitazione bottone modifica
ModifyBtn.IsEnabled = m_SplitPage.m_bShow
' gestione abilitazione altri bottoni
EnableButtons()
End Sub
' Gestione di visualizzazione dei comandi per il movimento dei pezzi
Private Sub RefreshVisibility()
' Aggiorno visulizzazione comando per passare alla pagina di scarico
If Not m_SplitPage.m_bEnableOnAuxTab Then
UnloadPartsBtn.Visibility = Visibility.Hidden
Else
UnloadPartsBtn.Visibility = Visibility.Visible
If m_SplitPage.m_bOnAuxTab Then
UnloadPartsBtn.Content = "Go to MOVE part"
' altrimenti, aggiorno visualizzazione
Else
UnloadPartsBtn.Content = "Go to UNLOAD part"
End If
End If
' Aggiorno interfaccia per taglio perpendicolare
If m_bByHand Then
UpBtn.Visibility = Windows.Visibility.Visible
@@ -269,6 +222,12 @@ Public Class MoveRawPartPage
ResetBtn.Visibility = Windows.Visibility.Visible
ScrapsBtn.Visibility = Windows.Visibility.Hidden
End If
' salvo l'idice della fase corrente
m_nCurrDisposition = EgtGetPhaseDisposition(m_nCurrPhase)
' Abilitazione bottone modifica
ModifyBtn.IsEnabled = m_SplitPage.m_bShow
' gestione abilitazione altri bottoni
EnableButtons()
End Sub
Private Sub SetAuxTabInCurrDisposition()
@@ -333,12 +292,12 @@ Public Class MoveRawPartPage
EgtSetStatus(nId, GDB_ST.ON_)
' prima di rilasciare il pezzo verifico che non vada in collisione con altri pezzi sulla tavola (evito il controllo se ultima fase)
If VerifyCollisionWithOtherRawPart(nId) Then
' mantengo la selezione del pezzo
EgtSetStatus(nId, GDB_ST.SEL)
m_CurrProjPage.SetErrorMessage("Collisione pezzi")
Else
' Se con ventose, le nascondo
If Not m_bByHand Then EgtSetStatus(GetVacuumId(), GDB_ST.OFF)
' mantengo la selezione del pezzo
EgtSetStatus(nId, GDB_ST.SEL)
m_CurrProjPage.SetErrorMessage("Collisione pezzi")
Else
' Se con ventose, le nascondo
If Not m_bByHand Then EgtSetStatus(GetVacuumId(), GDB_ST.OFF)
End If
Else
@@ -486,7 +445,7 @@ Public Class MoveRawPartPage
If EgtMoveRawPart(nRawId, dMove * m_vtDir) Then
m_dCurrDist += Math.Abs(dMove)
End If
' Altrimenti movimento Y +
' Altrimenti movimento Y +
Else
If m_bRawWithCups Then
Dim vtMove As New Vector3d(0, m_dStep, 0)
@@ -529,7 +488,7 @@ Public Class MoveRawPartPage
If EgtMoveRawPart(nRawId, dMove * m_vtDir) Then
m_dCurrDist -= Math.Abs(dMove)
End If
' Altrimenti movimento Y -
' Altrimenti movimento Y -
Else
If m_bRawWithCups Then
Dim vtMove As New Vector3d(0, -m_dStep, 0)
@@ -821,33 +780,6 @@ Public Class MoveRawPartPage
End While
End Sub
' Passo dalla pagina di movimento dei pezzi alla pagina di scarico
Private Sub UnloadPartBtn_Click() Handles UnloadPartsBtn.Click
' forzo lo stato di scarico frontale oppure di movimento
m_SplitPage.m_bOnAuxTab = Not m_SplitPage.m_bOnAuxTab
' se rientro nella fase di spostamenti allora nascondo la tavola di scarico
If Not m_SplitPage.m_bOnAuxTab Then
' se ci sono pezzi sulla tavola di scarico non posso nasconderla
Dim LclLstOfUnldPart As New List(Of Integer)
If Not PartOnAuxTab(LclLstOfUnldPart, m_nCurrPhase) Then
EgtDisableModified()
' nascondo la tavola di scarico
EgtSetStatus(m_nAuxTabId, GDB_ST.OFF)
' Nascondo eventuali pezzi in parcheggio
HideParkedParts()
EgtEnableModified()
End If
Else
' Assegnazione delle info tavola ausiliaria alla dispozione corrente
SetAuxTabInCurrDisposition()
End If
' Mantengo la fase che è stata creata e passo a gestire solo la visualizzazione dei bottoni
RefreshVisibility()
EgtZoom(ZM.ALL, True)
End Sub
Private Sub StepMoveTxBx_EgtClosed(sender As Object, e As EventArgs) Handles StepMoveTxBx.EgtClosed
Dim dStep As Double
If StringToLen(StepMoveTxBx.Text, dStep) Then
@@ -889,16 +821,16 @@ Public Class MoveRawPartPage
Dim ptRef As Point3d
If Not EgtGetInfo(nRefId, "Pos", ptRef) Then Return
Dim sCorn As String = ""
EgtGetInfo(nRefId, "COR", sCorn)
Select Case sCorn
Case "TL"
nCorn = MCH_CR.TL
Case "TR"
nCorn = MCH_CR.TR
Case "BL"
nCorn = MCH_CR.BL
Case "BR"
nCorn = MCH_CR.BR
EgtGetInfo( nRefId, "COR", sCorn)
Select sCorn
Case "TL"
nCorn = MCH_CR.TL
Case "TR"
nCorn = MCH_CR.TR
Case "BL"
nCorn = MCH_CR.BL
Case "BR"
nCorn = MCH_CR.BR
End Select
' Recupero il centro del grezzo
Dim ptRawCen As Point3d
@@ -1075,44 +1007,8 @@ Public Class MoveRawPartPage
End Function
Private Sub PauseBtn_Click(sender As Object, e As RoutedEventArgs) Handles PauseBtn.Click
' verifico la presenza di eventuali pezzi sulla tavola di scarico
Dim LclLstOfUnldPart As New List(Of Integer)
PartOnAuxTab(LclLstOfUnldPart, m_nCurrPhase)
If Not InsertPauseInCurrPhase() Then Return
AddNewPhase()
End Sub
' restituisce la lista dei pezzi che sono sulla tavola di scarico nella fase indicata
Private Function PartOnAuxTab(ByRef ListOfUnloadedPatr As List(Of Integer), nPhase As Integer) As Boolean
m_IsCurrPhaseUnloaded = False
' Area tavolo ausiliario
Dim b3AuxTab As New BBox3d
EgtGetBBoxGlob(EgtGetFirstNameInGroup(m_nAuxTabId, "A1"), GDB_BB.STANDARD, b3AuxTab)
' Area pezzi
Dim nOtherRaw As Integer = EgtGetFirstRawPart()
While nOtherRaw <> GDB_ID.NULL
If EgtVerifyRawPartPhase(nOtherRaw, nPhase) Then
Dim b3OtherRaw As New BBox3d
' EgtGetRawPartBBox(nOtherRaw, b3OtherRaw)
EgtGetBBoxGlob(nOtherRaw, GDB_BB.STANDARD, b3OtherRaw)
' se il centro del pezzo è sulla tavola di scarico
If b3OtherRaw.Center.y < b3AuxTab.Max().y Then
m_IsCurrPhaseUnloaded = True
ListOfUnloadedPatr.Add(nOtherRaw)
' salvo l'info che indica che il pezzo deve essere scaricato
EgtSetInfo(nOtherRaw, "Unloaded", 1)
'Exit While
End If
End If
nOtherRaw = EgtGetNextRawPart(nOtherRaw)
End While
Return m_IsCurrPhaseUnloaded
End Function
' inserisce una pausa nella fase corrente
Private Function InsertPauseInCurrPhase() As Boolean
' verifico che ci sia almeno un elemto selezionato (dati di aggancio pezzo)
If m_RawMoveDataList.Count = 0 Then Return False
If m_RawMoveDataList.Count = 0 Then Return
' verifico che sia stato inseito almeno uno spostamento, altrimenti lo rimuovo
Dim Index As Integer = 0
For Index = m_RawMoveDataList.Count - 1 To 0 Step -1
@@ -1121,9 +1017,8 @@ Public Class MoveRawPartPage
End If
Next
' verifico che la lista non sia vuota
If m_RawMoveDataList.Count = 0 Then
Return False
End If
If m_RawMoveDataList.Count = 0 Then Return
' recupero disposizione fase corrente
Dim nDispId As Integer = EgtGetPhaseDisposition(m_nCurrPhase)
' imposto la pausa nella disposizione corrente
@@ -1131,22 +1026,30 @@ Public Class MoveRawPartPage
' aggiungo al gruppo disposizione dei sottogruppi con i dati di movimento dei grezzi spostati
SaveMoveInfoInDisposition(nDispId, m_RawMoveDataList)
' imposto eventuale movimento pezzi su tavola ausiliaria
SaveMovePartsOnAuxTable(nDispId, m_IsCurrPhaseUnloaded)
' SaveMovePartsOnAuxTable(nDispId, m_SplitPage.m_bOnAuxTab)
SaveMovePartsOnAuxTable(nDispId, m_SplitPage.m_bOnAuxTab)
'' Eseguo calcolo speciale dei movimenti: per tavola multicut
'SpecialApplyDisposition(nDispId, True, Not m_SplitPage.m_bOnAuxTab)
SaveRemoveByHandInDisposition(nDispId, False)
Return True
End Function
' crea una nuvoa fase/disposizione, la rende corrente, ricalcolo i grezzi e le lavorazioni della nuova fase
Private Function AddNewPhase() As Boolean
' Creo nuova fase
Dim nNewPhase As Integer = EgtAddPhase()
' Carico i grezzi rimasti sulla tavola nella nuova fase
ChangePhaseRawPart(nNewPhase)
' Sposto le lavorazioni rimaste nella nuova fase
ChangeOperationPhase(nNewPhase)
' Eseguo eventuali spezzature dei grezzi e vi sposto i pezzi (i grezzi devono essere sempre copiati per Registrazione con rotazione)
Dim nRawId As Integer = EgtGetFirstRawPart()
While nRawId <> GDB_ID.NULL
' se il grezzo è presente nella fase precedente e non è quello selezionato allora procedo a creare una copia nella nuova fase
If EgtVerifyRawPartPhase(nRawId, nNewPhase - 1) Then
Dim bKeepRawPart As Boolean = True
For Each RawOnAuxTabData As RawMoveData In m_RawMoveDataList
If nRawId = RawOnAuxTabData.m_nId Then
bKeepRawPart = False
Exit For
End If
Next
If bKeepRawPart Then EgtKeepRawPart(nRawId, nNewPhase - 1)
End If
' passo al successivo grezzo
nRawId = EgtGetNextRawPart(nRawId)
End While
Dim nCurrDisposition As Integer = EgtGetPhaseDisposition(nNewPhase)
'SetPause(nCurrDisposition)
@@ -1157,43 +1060,8 @@ Public Class MoveRawPartPage
SetAuxTabInCurrDisposition()
' ripulisco la lista degli spostamenti
m_RawMoveDataList.Clear()
m_IsCurrPhaseUnloaded = False
' aggiorno la fase corrente
m_nCurrPhase = EgtGetCurrPhase()
Return True
End Function
' Copio i grezzi rimasti sulla tavola nella fase successiva
Private Sub ChangePhaseRawPart(ByVal nNewPhase As Integer)
' recupero l'elenco dei pezzi che sono stati scaricati sulla tavola
Dim LocalLstOfUnldPart As New List(Of Integer)
PartOnAuxTab(LocalLstOfUnldPart, nNewPhase - 1)
' Eseguo eventuali spezzature dei grezzi e vi sposto i pezzi (i grezzi devono essere sempre copiati per Registrazione con rotazione)
Dim nRawId As Integer = EgtGetFirstRawPart()
While nRawId <> GDB_ID.NULL
' se il grezzo è presente nella fase precedente e non è quello selezionato allora procedo a creare una copia nella nuova fase
If EgtVerifyRawPartPhase(nRawId, nNewPhase - 1) Then
Dim bKeepRawPart As Boolean = True
For Each RawOnAuxTabData As RawMoveData In m_RawMoveDataList
If nRawId = RawOnAuxTabData.m_nId Then
' se il pezzo è stato scaricato allora non deve essere riportato nella fase successiva
For Each UnloadPart As Integer In LocalLstOfUnldPart
If nRawId = UnloadPart Then
' salvo l'info che indica che il pezzo deve essere scaricato
EgtSetInfo(nRawId, "Unloaded", 1)
bKeepRawPart = False
Exit For
End If
Next
'bKeepRawPart = False
Exit For
End If
Next
If bKeepRawPart Then EgtKeepRawPart(nRawId, nNewPhase - 1)
End If
' passo al successivo grezzo
nRawId = EgtGetNextRawPart(nRawId)
End While
End Sub
Private Sub ResetBtn_Click(sender As Object, e As RoutedEventArgs) Handles ResetBtn.Click
@@ -1209,8 +1077,6 @@ Public Class MoveRawPartPage
EgtRotateRawPart(nRawId, Vector3d.Z_AX(), dAngRaw)
AddRawMoveData(nRawId, vtMove, m_RawMoveDataList)
RemoveRawMoveData(nRawId, m_RawMoveDataList)
' elimino l'info che indica che il pezzo è scaricato sulla tavola
EgtRemoveInfo(nRawId, "Unloaded")
' Disabilito pezzo e nascondo le ventose
EgtSetStatus(nRawId, GDB_ST.ON_)
EgtSetStatus(GetVacuumId(), GDB_ST.OFF)
@@ -1243,14 +1109,6 @@ Public Class MoveRawPartPage
m_nCurrPhase -= 1
m_bPrev = False
m_SplitPage.m_bShow = True
m_SplitPage.m_bOnAuxTab = True
' imposto la visibilità della tavola ausiliaria
SetAuxTabInCurrDisposition()
' carico le info di disposizione dei pezzi
m_RawMoveDataList.Clear()
m_bRemovedRaw = GetRemoveByHandInDisposition(m_nCurrDisposition)
GetMoveInfoInDisposition(m_nCurrDisposition, m_RawMoveDataList)
RefreshVisibility()
EgtDraw()
Return
End If
@@ -1281,52 +1139,18 @@ Public Class MoveRawPartPage
Return
End If
' ------- VISUALIZZAZIONE -------
If m_SplitPage.m_bShow Then
' verifico se la fase successiva è uno scarico frontale
If NextOperationIsUnloading(m_nCurrDisposition) Then
' imposto la nuova fase (che è stata modificata all'interno della funzione di controllo)
EgtSetCurrPhase(m_nCurrPhase)
' carico i dati di movimento dei pezzi nella fase corrente
m_RawMoveDataList.Clear()
m_bRemovedRaw = GetRemoveByHandInDisposition(m_nCurrDisposition)
GetMoveInfoInDisposition(m_nCurrDisposition, m_RawMoveDataList)
EgtDraw()
Return
ElseIf IsDispUnloadOnAuxTab(m_nCurrDisposition) <> 0 AndAlso Not NextOperationIsUnloading(m_nCurrDisposition) Then
' imposto la nuova fase, al termine della Sub verrà caricata la pagina Split nella fase indicata ora
m_bToNext = True
m_nCurrPhase += 1
EgtSetCurrPhase(m_nCurrPhase)
EgtDraw()
End If
' se la disposizione corrente è sulla tavola ausiliaria allora lo sarà anche quella successiva
If IsDispUnloadOnAuxTab(m_nCurrDisposition) <> 0 Then
EgtSetCurrPhase(m_nCurrPhase + 1)
m_nCurrDisposition = EgtGetNextOperation(m_nCurrDisposition)
m_nCurrPhase += 1
m_bToNext = False
m_SplitPage.m_bShow = True
EgtDraw()
EnableButtons()
Return
End If
' ------- MODIFICA -------
If Not m_SplitPage.m_bShow Then
' se la tavola di scarico presente oppure ci sono pezzi sulla tavola di scarico
Dim LclLstOfUnldPart As New List(Of Integer)
If m_SplitPage.m_bOnAuxTab Or PartOnAuxTab(LclLstOfUnldPart, m_nCurrPhase) Then
' se ci sono pezzi sulla tavola di scarico prima di procedere inserisco una pausa e creo una nuoava fase
If m_IsCurrPhaseUnloaded AndAlso InsertPauseInCurrPhase() Then AddNewPhase()
' nascondo la tavola di scarico
EgtDisableModified()
EgtSetStatus(m_nAuxTabId, GDB_ST.OFF)
EgtEnableModified()
End If
m_bToNext = True
'' se la disposizione corrente è sulla tavola ausiliaria allora lo sarà anche quella successiva
'If IsDispUnloadOnAuxTab(m_nCurrDisposition) <> 0 Then
' EgtSetCurrPhase(m_nCurrPhase + 1)
' m_nCurrDisposition = EgtGetNextOperation(m_nCurrDisposition)
' m_nCurrPhase += 1
' m_bToNext = False
' m_SplitPage.m_bShow = True
' EgtDraw()
' EnableButtons()
' Return
'End If
End If
' resetto l'inidice del pezzo da mnovimentare
m_CurrRawOnVacuum = GDB_ID.NULL
' Deseleziono tutto
@@ -1369,7 +1193,7 @@ Public Class MoveRawPartPage
' disabilito bottone
ModifyBtn.IsEnabled = False
' gestione abilitazione altri bottoni
EnableButtons(MachiningList.Count > 0)
EnableButtons()
End Sub
' verifica se la disposizione indicata è uno scarico sulla tavola ausiliaria
@@ -1380,20 +1204,6 @@ Public Class MoveRawPartPage
Return bVal
End Function
' restituisce e attiva la successiva disposizione se è uno scarico frontale
Public Function NextOperationIsUnloading(nCurrDispId As Integer) As Boolean
' recupero la primo operazione successiva
Dim nNextIdOperation As Integer = EgtGetNextOperation(nCurrDispId)
' a partire da questa cerco la prima disposizione disponibile
Dim nNextIdDips As Integer = GetNextDisposition(nNextIdOperation)
If nNextIdDips = nNextIdOperation And IsDispUnloadOnAuxTab(nNextIdOperation) Then
m_nCurrPhase += 1
m_nCurrDisposition = nNextIdOperation
Return True
End If
Return False
End Function
' recupero la prima disposizione disponibile tra l'elenco delle operazioni presenti
Public Function GetNextDisposition(nCurrDisposId As Integer) As Integer
Dim nDispId As Integer = nCurrDisposId
@@ -1406,7 +1216,7 @@ Public Class MoveRawPartPage
Return GDB_ID.NULL
End Function
Private Sub EnableButtons(Optional bExistsMachining As Boolean = False)
Private Sub EnableButtons()
UpBtn.IsEnabled = Not m_SplitPage.m_bShow
LeftBtn.IsEnabled = Not m_SplitPage.m_bShow
RightBtn.IsEnabled = Not m_SplitPage.m_bShow
@@ -1422,35 +1232,19 @@ Public Class MoveRawPartPage
BottomRBtn.IsEnabled = Not m_SplitPage.m_bShow
PauseBtn.IsEnabled = Not m_SplitPage.m_bShow
ResetBtn.IsEnabled = Not m_SplitPage.m_bShow
UnloadPartsBtn.IsEnabled = Not m_SplitPage.m_bShow
If m_SplitPage.m_bShow Then
NextBtn.IsEnabled = (m_nCurrPhase < EgtGetPhaseCount())
Else
' Se esistono delle lavorazioni allora abilito il pulsante per procedere
If Not bExistsMachining Then
NextBtn.IsEnabled = Not m_SplitPage.m_bOnAuxTab
Else
NextBtn.IsEnabled = True
End If
NextBtn.IsEnabled = Not m_SplitPage.m_bOnAuxTab
End If
End Sub
' esco dalla pagina di scarico
Private Sub MoveRawPartPage_Unloaded(sender As Object, e As EventArgs) Handles Me.Unloaded
' verifico che la fase corrente non sia vuota
Dim nLastDispId As Integer = EgtGetPhaseDisposition(m_nCurrPhase)
'' se sono in visualizzazione allora non elimino essuna operazione
'If Not m_SplitPage.m_bShow Then
' If EgtIsOperationEmpty(nLastDispId) And Not m_SplitPage.m_bOnAuxTab And m_RawMoveDataList.Count = 0 Then
' EgtErase(nLastDispId)
' ElseIf EgtIsOperationEmpty(nLastDispId) And m_SplitPage.m_bOnAuxTab And m_RawMoveDataList.Count = 0 Then
' ' Dichiaro pagina non attiva
' m_bActive = False
' Return
' End If
'End If
If EgtIsOperationEmpty(nLastDispId) And m_SplitPage.m_bOnAuxTab And m_RawMoveDataList.Count = 0 Then
EgtErase(nLastDispId)
End If
' Se movimento con ventose
If Not m_bByHand Then
@@ -1466,9 +1260,8 @@ Public Class MoveRawPartPage
SaveMoveInfoInDisposition(nDispId, m_RawMoveDataList)
' imposto eventuale presenza rimozioni manuali
SaveRemoveByHandInDisposition(nDispId, m_bRemovedRaw)
' imposto eventuale movimento pezzi su tavola ausiliaria (se è realmente avvenuto)
'SaveMovePartsOnAuxTable(nDispId, m_SplitPage.m_bOnAuxTab)
SaveMovePartsOnAuxTable(nDispId, m_IsCurrPhaseUnloaded)
' imposto eventuale movimento pezzi su tavola ausiliaria
SaveMovePartsOnAuxTable(nDispId, m_SplitPage.m_bOnAuxTab)
' Eseguo calcolo speciale dei movimenti
SpecialApplyDisposition(nDispId, True, Not m_SplitPage.m_bOnAuxTab)
End If
@@ -1484,18 +1277,13 @@ Public Class MoveRawPartPage
SpecialApplyDisposition(nDispId, True)
End If
End If
' Nascondo eventuale tavola ausiliaria
If m_SplitPage.m_bOnAuxTab Then
EgtDisableModified()
EgtSetStatus(m_nAuxTabId, GDB_ST.OFF)
EgtEnableModified()
' se sto uscendo dalla pagina delle spezzature
If Not m_bPrev And Not m_bToNext Then
Dim nDispId As Integer = EgtGetPhaseDisposition(m_nCurrPhase)
' se sto uscendo dalla pagina split (senza passare dal comando next)
Dim lclLstUnlPart As New List(Of Integer)
SaveMovePartsOnAuxTable(nDispId, PartOnAuxTab(lclLstUnlPart, m_nCurrPhase))
EgtZoom(ZM.ALL, False)
If Not m_bPrev Then
' Cancello eventuale manipolatore pezzi
EgtDisableModified()
RemoveVacuumCups()
@@ -1512,30 +1300,10 @@ Public Class MoveRawPartPage
m_bPrev = False
m_SplitPage.m_bShow = True
End If
Dim Ph As Integer = EgtGetCurrPhase()
' aggiorno il disegno
EgtZoom(ZM.ALL, False)
' Dichiaro pagina non attiva
m_bActive = False
End Sub
' ----------------- TEST funzione per debug operazioni -----------------
Private Sub SaveMyFileTest(sFilename As String)
LoadCurrPhaseMachining()
' salvo il file corrente per poterlo studiare e capire cosa è successo nella rappresentazione dei grezzi
EgtSaveFile("C:\EgtData\OmagCUT\MyProjects\" & sFilename & ".nge", NGE.BIN)
End Sub
Private Sub LoadCurrPhaseMachining()
Dim m_MachiningList As New List(Of SplitMach)
'm_SplitPage.ShowMachiningList()
'm_SplitPage.SaveOrderMachinig(m_nCurrPhase)
' Preparo la lista delle lavorazioni
CalculateSplitMachList(m_nCurrPhase, m_MachiningList)
Dim b As Boolean = False
End Sub
End Class
+11 -63
View File
@@ -1,5 +1,4 @@
Imports System.Windows.Forms.Integration
Imports EgtUILib
Imports EgtUILib
Public Module SplitAuto
@@ -133,7 +132,7 @@ Public Module SplitAuto
Mach.m_bStartAll = False
Mach.m_bEndAll = False
End If
' Waterjet
' Waterjet
ElseIf Mach.m_nType = MCH_OY.WATERJETTING Then
Mach.m_nInterf = FMI_TYPE.NONE
' recupero l'angolo di fianco
@@ -142,7 +141,7 @@ Public Module SplitAuto
Mach.m_bCanEndAll = False
Mach.m_bStartAll = False
Mach.m_bEndAll = False
' Forature e fresature
' Forature e fresature
Else
Mach.m_nInterf = FMI_TYPE.NONE
Mach.m_dSideAng = 0
@@ -157,7 +156,7 @@ Public Module SplitAuto
Mach.m_bPause = GetPause(nOperId)
' inserisco in lista
MachSplitList.Add(Mach)
' altrimenti la disattivo
' altrimenti la disattivo
Else
EgtSetOperationMode(nOperId, False)
End If
@@ -195,7 +194,7 @@ Public Module SplitAuto
Private Sub ColorSingleMachining(nOperId As Integer, sLay As String, dSideAng As Double, bEnabled As Boolean, nInterf As Integer)
' Verifico se è un taglio da sopra o da sotto
Dim bOnMach As Boolean = (sLay = NAME_ONPATH Or (sLay = NAME_INLOOP AndAlso EgtExistsInfo(nOperId, INFO_FILOTOP)))
Dim bOnMach As Boolean = (sLay = NAME_ONPATH Or ( sLay = NAME_INLOOP AndAlso EgtExistsInfo( nOperId, INFO_FILOTOP)))
Dim bDrip As Boolean = (sLay = NAME_DRIPCUT Or sLay = NAME_UNDERDRILL)
' Recupero il preview della lavorazione
Dim nPvId As Integer = GDB_ID.NULL
@@ -220,11 +219,11 @@ Public Module SplitAuto
Next
EgtSetColor(nDwnCutId, COL_MCH_DISABLED)
Dim bFreeStart As Boolean = (nInterf And FMI_TYPE.LI) <> FMI_TYPE.LI
EgtSetColor(nPrcId, If(bFreeStart, COL_MCH_DISABLED(), COL_MCH_DIS_INTERF()))
EgtSetColor(nDwnPrcId, If(bFreeStart, COL_MCH_DISABLED(), COL_MCH_DIS_INTERF()))
EgtSetColor(nPrcId, If(bFreeStart, COL_MCH_DISABLED, COL_MCH_DIS_INTERF))
EgtSetColor(nDwnPrcId, If(bFreeStart, COL_MCH_DISABLED, COL_MCH_DIS_INTERF))
Dim bFreeEnd As Boolean = (nInterf And FMI_TYPE.LO) <> FMI_TYPE.LO
EgtSetColor(nPocId, If(bFreeEnd, COL_MCH_DISABLED(), COL_MCH_DIS_INTERF()))
EgtSetColor(nDwnPocId, If(bFreeEnd, COL_MCH_DISABLED(), COL_MCH_DIS_INTERF()))
EgtSetColor(nPocId, If(bFreeEnd, COL_MCH_DISABLED, COL_MCH_DIS_INTERF))
EgtSetColor(nDwnPocId, If(bFreeEnd, COL_MCH_DISABLED, COL_MCH_DIS_INTERF))
Else
Dim colCut As Color3d
If bOnMach Then
@@ -343,7 +342,6 @@ Public Module SplitAuto
Dim ptOri As Point3d
EgtGetTableRef(1, ptOri)
Dim vtOri As New Vector3d(ptOri.x, ptOri.y, ptOri.z)
' ---------------------------------- GREZZI ----------------------------------
' Eseguo eventuali spezzature dei grezzi e vi sposto i pezzi (i grezzi devono essere sempre copiati per Registrazione con rotazione)
Dim nRawId As Integer = EgtGetFirstRawPart()
While nRawId <> GDB_ID.NULL
@@ -395,19 +393,10 @@ Public Module SplitAuto
' passo al successivo grezzo
nRawId = EgtGetNextRawPart(nRawId)
End While
' ---------------------------------- GREZZI ----------------------------------
' Cancello preview dei tagli allungati dalla lavorazione
For Each nCut As Integer In vCuts
RemoveMachiningPreview(nCut)
Next
' ---------------------------------- LAVORAZIONI ----------------------------------
ChangeOperationPhase(nNewPhase)
' ---------------------------------- LAVORAZIONI ----------------------------------
Return True
End Function
' Sposta le lavorzioni della fase precedente a quella indicata
Friend Sub ChangeOperationPhase_ERR(nNewPhase As Integer)
' Sposto tutte le lavorazioni disabilitate e le eventuali inglobate nella nuova fase
Dim nId = EgtGetFirstOperation()
While nId <> GDB_ID.NULL
@@ -428,50 +417,9 @@ Public Module SplitAuto
End If
nId = nNextId
End While
End Sub
Return True
End Function
' Miglioramento della gestione delle lavorazioni
Friend Sub ChangeOperationPhase(nNewPhase As Integer)
' creo l'elenco delle lavorazioni che devono essere sposate
Dim MchList As New List(Of Integer)
' Recupero le lavorazioni disabilitate e le eventuali inglobate nella nuova fase
Dim nId = EgtGetFirstOperation()
While nId <> GDB_ID.NULL
Dim nNextId = EgtGetNextOperation(nId)
If IsValidMachining(nId) And EgtGetOperationPhase(nId) = nNewPhase - 1 And EgtExistsInfo(nId, INFO_MCH_USER_OFF) Then
' Provo ad inserire la lavorazione nell'elenco
AddMach(MchList, nId)
' sposto le inglobate
Dim sInfo As String = String.Empty
If EgtGetInfo(nId, INFO_MCH_OTHMID, sInfo) Then
Dim sItems() As String = sInfo.Split(",".ToCharArray)
For Each sId2 As String In sItems
Dim nId2 As Integer = 0
StringToInt(sId2, nId2)
If nId2 > 0 Then
' Provo ad inserire la lavorazione nell'elenco
AddMach(MchList, nId2)
End If
Next
End If
End If
nId = nNextId
End While
' Procedo ora a spostare le lavorazioni nella nuova disposizione
For Each ItemMchId As Integer In MchList
EgtChangeOperationPhase(ItemMchId, nNewPhase)
Next
End Sub
' Inserisce gli inidici delle lavorazioni evitando di inserire dei doppioni
Private Sub AddMach(MchList As List(Of Integer), IdMch As Integer)
For Each Item As Integer In MchList
If IdMch = Item Then
Return
End If
Next
MchList.Add(IdMch)
End Sub
'-----------------------------------------------------------------------------------------------
Friend Function CalculateSplitAuto() As Boolean
' Fase iniziale
+47 -45
View File
@@ -13,7 +13,7 @@ Public Class SplitPageUC
' Tipo movimento dei grezzi (manuale o con testa ventosa)
Private m_bByHand As Boolean = True
' Abilitazione movimento finale pezzi su tavola ausiliaria
Friend m_bEnableOnAuxTab As Boolean = False
Private m_bEnableOnAuxTab As Boolean = False
' Stato
Private m_nCurrPhase As Integer = 0
Private m_MachiningList As New List(Of SplitMach)
@@ -49,7 +49,6 @@ Public Class SplitPageUC
Private m_bModified As Boolean = False
Private m_nNbrGrpId As Integer = GDB_ID.NULL
Private m_bToNext As Boolean = False
Private m_bToPrev As Boolean = False
Friend m_bOnAuxTab As Boolean = False
' Drag
Private m_nDragInd As Integer = -1
@@ -168,7 +167,6 @@ Public Class SplitPageUC
m_bModified = False
' Reset flag tipo uscita
m_bToNext = False
m_bToPrev = False
' Abilitazione bottoni
EnableButtons()
' Se sola visualizzazione, segnalazione di eventuale fase di restart
@@ -182,8 +180,7 @@ Public Class SplitPageUC
End If
End Sub
' preparo la lista delle lavorazioni da mostrare in interfaccia
Public Sub ShowMachiningList()
Private Sub ShowMachiningList()
m_ItemList.Clear()
For i As Integer = 1 To m_MachiningList.Count()
Dim Mach As SplitMach = m_MachiningList(i - 1)
@@ -713,8 +710,30 @@ Public Class SplitPageUC
MoveUpBtn.IsEnabled = False
MoveDownBtn.IsEnabled = False
End If
' Recupero la selezione dei tagli correnti
GetCurrSelection()
'' verifico che siano contigui
'Dim bContigus As Boolean = False
'Dim OrdIndex = 0
'OrdIndex = MachiningLsBx.SelectedItems(MachiningLsBx.SelectedItems.Count - 1).Ind
'' recupero l'indice dell'ultimo elemento selezionato
'Dim LastSel As NameIdLsBxItem = MachiningLsBx.SelectedItems(MachiningLsBx.SelectedItems.Count - 1)
'If MachiningLsBx.SelectedItems.Count = 1 Then
' bContigus = True
'Else
' For Each Item As NameIdLsBxItem In ItemList
' If Item.Ind = LastSel.Ind + 1 Or Item.Ind = LastSel.Ind - 1 Then
' bContigus = True
' End If
' Next
'End If
'' se non contiguo, elimino dai selezionati il primo(che è l'ultimo ad essere stato selezionato)
'If Not bContigus Then
' ItemList.Remove(LastSel)
' MachiningLsBx.SelectedItems.RemoveAt(MachiningLsBx.SelectedItems.Count - 1)
'End If
' resetto marcatura lavorazioni
If m_CurrFirstInd > -1 Then
For Index As Integer = m_CurrFirstInd To m_CurrLastInd
@@ -808,8 +827,6 @@ Public Class SplitPageUC
Next
VerifyHomogenousMachining(ItemList)
' Abilitazione bottone Next
EnableButtons()
End Sub
Private Sub AllOnBtn_Click(sender As Object, e As RoutedEventArgs) Handles AllOnBtn.Click
@@ -1763,26 +1780,15 @@ Public Class SplitPageUC
Private Sub PrevBtn_Click(sender As Object, e As RoutedEventArgs) Handles PrevBtn.Click
' Dichiaro solo visualizzazione
m_bShow = True
'' Esco
'ExitSplit(False)
' Esco
ExitSplit(False)
' Torno alla fase precedente
Dim nCurrPhase As Integer = EgtGetCurrPhase()
' se questa è la prima fase, non possono tornare più indietro di così
If nCurrPhase = 1 Then
Return
End If
EgtSetCurrPhase(nCurrPhase - 1)
m_bToPrev = True
EgtSetCurrPhase(EgtGetCurrPhase() - 1)
' Reimposto la precedente
'SplitPageUC_Loaded(Nothing, Nothing)
' torno alla disposizione della fase corrente
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_CadCutMode = CadCutPageUC.CadCutModes.MoveRawPart
SplitPageUC_Loaded(Nothing, Nothing)
End Sub
Private Sub NextBtn_Click(sender As Object, e As RoutedEventArgs) Handles NextBtn.Click
' ------- VISUALIZZAZIONE -------
If m_bShow Then
Dim CurrDisposition As Integer = EgtGetPhaseDisposition(m_nCurrPhase)
' recupero l'operazione successiva
@@ -1904,7 +1910,7 @@ Public Class SplitPageUC
Private Sub SplitPageUC_Unloaded(sender As Object, e As EventArgs) Handles Me.Unloaded
m_bActive = False
m_MainWindow.m_CurrentProjectPageUC.ClearMessage()
ExitSplit(Not m_bToNext And Not m_bToPrev)
ExitSplit(Not m_bToNext)
EgtDraw()
End Sub
@@ -1923,7 +1929,22 @@ Public Class SplitPageUC
EgtEnableModified()
' se modificato salvo ordine e stato delle lavorazioni
If m_bModified Then
SaveOrderMachinig(m_nCurrPhase)
' Al primo posto deve rimanere la disposizione della fase
Dim nFirstOperId As Integer = EgtGetPhaseDisposition(m_nCurrPhase)
For i As Integer = 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, True)
End If
Next
' dichiaro ordine salvato
m_MainWindow.m_CurrentProjectPageUC.SetOrderMachiningFlag()
End If
' Affondamento ridotto
Dim dReducedDepth As Double = GetPrivateProfileDouble(S_MACH_NEST, K_MACH_REDUCEDDEPTH, 1, m_MainWindow.GetMachIniFile())
@@ -1947,25 +1968,6 @@ Public Class SplitPageUC
End If
End Sub
Friend Sub SaveOrderMachinig(CurrPhase As Integer)
' Al primo posto deve rimanere la disposizione della fase
Dim nFirstOperId As Integer = EgtGetPhaseDisposition(CurrPhase)
For i As Integer = 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, True)
End If
Next
' dichiaro ordine salvato
m_MainWindow.m_CurrentProjectPageUC.SetOrderMachiningFlag()
End Sub
Friend Function GetDisabledCutsCount() As Integer
' Determino il numero di tagli disabilitati
Dim nCount As Integer = 0
@@ -2030,7 +2032,7 @@ Public Class SplitPageUC
NextBtn.IsEnabled = (GetDisabledCutsCount() > 0 And GetSplitCutsCount() = 1)
' Altrimenti
Else
' movimento standard sulla tavola (almeno un taglio disabilitato allora False)
' movimento standard sulla tavola (almeno un taglio disabilitato)
Dim bStdTab As Boolean = (GetDisabledCutsCount() > 0)
' movimento su tavola di scarico
m_bOnAuxTab = Not bStdTab AndAlso (m_nCurrPhase = EgtGetPhaseCount() And m_bEnableOnAuxTab)
+8
View File
@@ -116,6 +116,8 @@ Module ConstIni
Public Const K_LASTCOLOR As String = "LastColor"
Public Const K_COLOR As String = "Color"
Public Const S_FRAMECOMPO As String = "FrameCompo"
Public Const S_EXTCOMPO As String = "Compo"
Public Const S_INTCOMPO As String = "InternalCompo"
@@ -223,6 +225,12 @@ Module ConstIni
Public Const K_RAWOFFSX As String = "OffsX"
Public Const K_RAWOFFSY As String = "OffsY"
Public Const K_RAWKERF As String = "Kerf"
Public Const K_ENABLEOTHERREFTAB As String = "EnableOtherRefTab"
Public Const K_OTHERREFTAB As String = "OtherRefTab"
Public Const K_OTHERREFTABX As String = "OtherRefTabX"
Public Const K_OTHERREFTABY As String = "OtherRefTabY"
Public Const K_OTHERREFTABPOS As String = "OtherRefTabPos"
Public Const S_RAWMOVE As String = "RawMove"
Public Const K_RAWSTEP As String = "Step"
@@ -683,6 +683,17 @@ Public MustInherit Class MachineButton
End If
EgtLuaSetGlobNumVar("CMD.S", dSpeed)
' versione 2.5e1
EgtTdbSetCurrTool(m_MainWindow.m_CurrentProjectPageUC.ToolTxBx.Text)
Dim sToolPos As String = String.Empty
If EgtTdbGetCurrToolParam(MCH_TP.TCPOS, sToolPos) Then
EgtLuaGetGlobStringVar("CMD.TCPOS", sToolPos)
End If
Dim dToolDiam As Double = 0
If EgtTdbGetCurrToolParam(MCH_TP.DIAM, dToolDiam) Then
EgtLuaSetGlobNumVar("CMD.DIAM", dToolDiam * 1000)
End If
Dim dL1, dL2, dL3, dR1, dR2 As Double
m_MainWindow.m_CNCommunication.GetAxesPositions(dL1, dL2, dL3, dR1, dR2)
EgtLuaSetGlobNumVar("CMD.L1", dL1)
+4 -1
View File
@@ -186,7 +186,10 @@ Public Class FlatteningCut
WritePrivateProfileString( S_DIRECTCUTS, K_DC_FLATT_MACHTYPE, m_nMachType.ToString(), m_MainWindow.GetIniFile())
WritePrivateProfileString( S_DIRECTCUTS, K_DC_FLATT_ROTLOCK, If( m_bRotLock, "1", "0"), m_MainWindow.GetIniFile())
WritePrivateProfileString( S_DIRECTCUTS, K_DC_FLATT_POSX, DoubleToString( m_ptTipP1.x, 2), m_MainWindow.GetIniFile())
WritePrivateProfileString( S_DIRECTCUTS, K_DC_FLATT_POSY, DoubleToString( m_ptTipP1.y, 2), m_MainWindow.GetIniFile())
WritePrivateProfileString(S_DIRECTCUTS, K_DC_FLATT_POSY, DoubleToString(m_ptTipP1.y, 2), m_MainWindow.GetIniFile())
' imposto la Z di sicurezza corretta
EgtMdbSetGeneralParam(MCH_GP.SAFEZ, DirectCutPageUC.m_dZSafe)
EgtMdbSave()
' Se non vado in simulazione
If Not m_bSimul Then
' Dichiaro sottopagina da non riattivare
+11
View File
@@ -380,6 +380,17 @@ Public Class MachineButtonsUC
EgtTdbGetCurrToolParam(MCH_TP.SPEED, dSpeed)
End If
EgtLuaSetGlobNumVar("CMD.S", dSpeed)
' versione 2.5e1
EgtTdbSetCurrTool(m_MainWindow.m_CurrentProjectPageUC.ToolTxBx.Text)
Dim sToolPos As String = String.Empty
If EgtTdbGetCurrToolParam(MCH_TP.TCPOS, sToolPos) Then
EgtLuaGetGlobStringVar("CMD.TCPOS", sToolPos)
End If
Dim dToolDiam As Double = 0
If EgtTdbGetCurrToolParam(MCH_TP.DIAM, dToolDiam) Then
EgtLuaSetGlobNumVar("CMD.DIAM", dToolDiam * 1000)
End If
Dim dL1, dL2, dL3, dR1, dR2 As Double
m_MainWindow.m_CNCommunication.GetAxesPositions(dL1, dL2, dL3, dR1, dR2)
EgtLuaSetGlobNumVar("CMD.L1", dL1)
+3 -1
View File
@@ -37,7 +37,7 @@ Public Class CompoDimensionUC
InternComponentBtn.Content = EgtMsg(MSG_COMPONENTPAGEUC + 47) ' Componenti interni
If Not String.IsNullOrEmpty(sCompoDir) Then
bEnableAlzFront = True
AlzFrontBtn.Content = "Alzatine & Frontalini"
AlzFrontBtn.Content = EgtMsg(91137)
Else
AlzFrontBtn.Visibility = Visibility.Collapsed
End If
@@ -107,8 +107,10 @@ Public Class CompoDimensionUC
Friend Sub ShowAlzFrontBtn(ByVal value As Boolean)
If value Then
AlzFrontBtn.Visibility = Visibility.Visible
m_MainWindow.m_DrawPageUC.MessageGrid.Visibility = Visibility.Hidden
Else
AlzFrontBtn.Visibility = Visibility.Hidden
m_MainWindow.m_DrawPageUC.MessageGrid.Visibility = Visibility.Visible
End If
End Sub
+46 -3
View File
@@ -283,6 +283,19 @@ Public Class DrawPageUC
m_sCsvOrder = ""
m_sCsvList = ""
m_sCsvName = ""
' Visuliazzazione dei bottoni per modifica dei componenti
If m_MainWindow.FrameCutBtn.IsChecked Then
SideAngleBtn.Visibility = Visibility.Hidden
FiloTopBtn.Visibility = Visibility.Hidden
EngraveBtn.Visibility = Visibility.Hidden
DripCutBtn.Visibility = Visibility.Hidden
Else
SideAngleBtn.Visibility = Visibility.Visible
FiloTopBtn.Visibility = Visibility.Visible
EngraveBtn.Visibility = Visibility.Visible
DripCutBtn.Visibility = Visibility.Visible
End If
End Sub
' recupero il click sulla scena ed assegno il metodo a secondo della pagina aperta
@@ -553,6 +566,7 @@ Public Class DrawPageUC
OkBtn.IsEnabled = True
End Sub
' Navigazione nelle due pagine per la selezione dei componenti da disegnare
Friend Sub BackBtn_Click(sender As Object, e As RoutedEventArgs) Handles BackBtn.Click
m_SceneButtons.MeasureBtn.IsChecked = False
DrawPage_Unloaded(sender, e)
@@ -1124,6 +1138,30 @@ Public Class DrawPageUC
Return True
End Function
Private Function MakeSectionFrameInsert() As Boolean
' m_MainWindow.m_ImportPageUC.LoadFrame()
' recupero il primo layer del primo pezzo
Dim nLayerId As Integer = EgtGetFirstLayer(EgtGetFirstPart())
If nLayerId = GDB_ID.NULL Then Return False
' percorso in cui salvare tempora
Dim sTmpFile As String = m_MainWindow.GetTempDir() & "\Frame.Nge"
If Not EgtSaveObjToFile(nLayerId, sTmpFile, NGE.BIN) Then Return False
' Passo al contesto principale
EgtSetCurrentContext(m_MainWindow.m_CurrentProjectPageUC.CurrentProjectScene.GetCtx())
' Inserisco il pezzo
If Not My.Computer.FileSystem.FileExists(sTmpFile) Then Return False
EgtInsertFile(sTmpFile)
' Ne recupero l'Id
Dim nPartId As Integer = EgtGetLastPart()
' Creo la cornice
m_MainWindow.m_FrameCutPageUC.CreateFrame(nPartId)
' Ricalcolo lavorazioni
AddFrameMachinings(m_MainWindow.m_FrameCutPageUC.m_FrameMachiningUC.m_dStartTrim, m_MainWindow.m_FrameCutPageUC.m_FrameMachiningUC.m_dEndTrim)
' Cancello il file
My.Computer.FileSystem.DeleteFile(sTmpFile)
Return True
End Function
Private Sub OkBtn_Click(sender As Object, e As RoutedEventArgs) Handles OkBtn.Click
m_bBackFromInternalCompo = False
m_bInternalCompo = False
@@ -1139,7 +1177,12 @@ Public Class DrawPageUC
Dim InsNbr As Integer = Int32.Parse(PartNumTxBx.Text)
' Passo al contesto principale
'MakeInsert(InsNbr, sPartName)
MakeMultipleInsert(InsNbr, sPartName)
If m_MainWindow.FrameCutBtn.IsChecked Then
MakeSectionFrameInsert()
Else
MakeMultipleInsert(InsNbr, sPartName)
End If
' Aggiorno ambiente principale
EgtZoom(ZM.ALL)
' Elimino nome del componente precedente
@@ -1153,7 +1196,7 @@ Public Class DrawPageUC
' Istruzioni per chiudere ImportPageUC e aprire CadCutPageUC
m_MainWindow.MainWindowGrid.Children.Remove(m_MainWindow.m_DrawPageUC)
m_MainWindow.MainWindowGrid.Children.Add(m_MainWindow.m_CurrentProjectPageUC)
m_MainWindow.m_ActivePage = MainWindow.Pages.CadCut
m_MainWindow.m_ActivePage = If(m_MainWindow.FrameCutBtn.IsChecked, MainWindow.Pages.FrameCut, MainWindow.Pages.CadCut)
End Sub
@@ -1174,7 +1217,7 @@ Public Class DrawPageUC
' Istruzioni per chiudere ImportPageUC e aprire CadCutPageUC
m_MainWindow.MainWindowGrid.Children.Remove(m_MainWindow.m_DrawPageUC)
m_MainWindow.MainWindowGrid.Children.Add(m_MainWindow.m_CurrentProjectPageUC)
m_MainWindow.m_ActivePage = MainWindow.Pages.CadCut
m_MainWindow.m_ActivePage = If(m_MainWindow.FrameCutBtn.IsChecked, MainWindow.Pages.FrameCut, MainWindow.Pages.CadCut)
End Sub
Private Sub TrfDataBtn_Click(sender As Object, e As RoutedEventArgs) Handles TrfDataBtn.Click
+2 -1
View File
@@ -39,7 +39,8 @@ Public Class FiloTopUC
' Imposto messaggi
ParameterTxBl.Text = EgtMsg( MSG_IMPORTPAGEUC + 10) ' Offset
Parameter2TxBl.Text = EgtMsg( MSG_IMPORTPAGEUC + 11) ' Affondamento
Parameter2TxBl.Text = EgtMsg(MSG_IMPORTPAGEUC + 11) ' Affondamento
Parameter3TxBl.Text = EgtMsg(91138)
If m_CallingPage = MainWindow.Pages.Draw Then
' Imposto questa come pagina correntemente visualizzata nella drawpage
+83 -7
View File
@@ -41,6 +41,7 @@ Public Class MainComponentPageUC
m_MainWindow.m_DrawPageUC.FiloTopBtn.IsEnabled = False
m_MainWindow.m_DrawPageUC.EngraveBtn.IsEnabled = False
m_MainWindow.m_DrawPageUC.DripCutBtn.IsEnabled = False
m_MainWindow.m_DrawPageUC.m_bBackFromInternalCompo = False
End Sub
Private Function GetButton(ByVal nInd As Integer) As Button
@@ -167,7 +168,7 @@ Public Class MainComponentPageUC
Private Sub Compo_Click(sender As Object, e As RoutedEventArgs) Handles Compo1.Click, Compo2.Click, Compo3.Click, Compo4.Click, Compo5.Click, Compo6.Click, Compo7.Click, Compo8.Click
CurrentBtn = DirectCast(e.Source, Button)
Dim CompoName As String = S_COMPO & GetIndexFromButton(CurrentBtn).ToString
Dim CompoName As String = If(m_MainWindow.FrameCutBtn.IsChecked, S_FRAMECOMPO, S_COMPO) & GetIndexFromButton(CurrentBtn).ToString
m_sCurrCompoFam = CompoName
m_SecondaryComponentPage.m_sCurrCompo = String.Empty
Dim nCount As Integer = GetPrivateProfileInt(CompoName, K_CMP_COUNT, 0, m_MainWindow.GetIniFile())
@@ -251,13 +252,18 @@ Public Class MainComponentPageUC
End Sub
Private Sub LoadPage()
If m_MainWindow.FrameCutBtn.IsChecked Then
LoadFramePage()
Return
End If
Dim nDeltaSecondPage As Integer = 8
' Leggo numero di componenti presenti
Dim nCompoNumber As Integer = GetPrivateProfileInt(S_COMPO, K_CMP_COUNT, 0, m_MainWindow.GetIniFile())
' Calcolo indici a seconda della pagina in cui sono
If m_bIsFirstPage Then
ClearButton(nCompoNumber)
nDeltaSecondPage = 0
nDeltaSecondPage = 0
Else
ClearButton(nCompoNumber)
nDeltaSecondPage = 8
@@ -325,16 +331,86 @@ Public Class MainComponentPageUC
End Sub
Private Sub LoadFramePage()
Dim nDeltaSecondPage As Integer = 8
' Leggo numero di componenti presenti
Dim nCompoNumber As Integer = GetPrivateProfileInt(S_FRAMECOMPO, K_CMP_COUNT, 0, m_MainWindow.GetIniFile())
' Calcolo indici a seconda della pagina in cui sono
If m_bIsFirstPage Then
ClearButton(nCompoNumber)
nDeltaSecondPage = 0
Else
ClearButton(nCompoNumber)
nDeltaSecondPage = 8
End If
' Creazione converter da String a ImageSource
Dim ImageConverter As New ImageSourceConverter
Dim ThicknessConverter As New ThicknessConverter
'Assegnazione immagine e testo ai Button
For index As Integer = 1 To 8
Dim CustomThickness As New Thickness(0)
Dim nCompoName As Integer = GetPrivateProfileInt(S_FRAMECOMPO & index + nDeltaSecondPage, "Name", 0, m_MainWindow.GetIniFile())
Dim sCompoImage As String = ""
Dim sCompoImageSource As ImageSource
'verifico presenza immagine e la aggiungo
If GetPrivateProfileString(S_FRAMECOMPO & index + nDeltaSecondPage, "Image", "", sCompoImage, m_MainWindow.GetIniFile()) <> 0 Then
Try
sCompoImageSource = ImageConverter.ConvertFromString(m_MainWindow.GetResourcesDir() & "\" & sCompoImage)
GetImage(index).Height = 65
GetImage(index).Width = 65
GetImage(index).Source = sCompoImageSource
Catch ex As Exception
EgtOutLog("Error loading image " & sCompoImage)
sCompoImage = String.Empty
GetImage(index).Height = 0
GetImage(index).Width = 0
CustomThickness.Right = 0
GetImage(index).Margin = CustomThickness
End Try
Else
'Se non c'è l'immagine azzero la distanza tra testo e immagine
CustomThickness.Right = 0
GetImage(index).Margin = CustomThickness
End If
'verifico presenza testo
If nCompoName > 0 Then
Dim sCompoName As String = EgtMsg(MSG_COMPONENTPAGEUC + nCompoName)
'verifico presenza immagine
If sCompoImage.Length > 0 Then
'se la lunghezza del testo è maggiore di 15 lo taglio
If sCompoName.Length > 15 Then
sCompoName = sCompoName.Substring(0, 15)
End If
GetLabel(index).Text = sCompoName
'Se ci sono sia testo che immagine imposto un margine di 10
CustomThickness.Right = 10
GetImage(index).Margin = CustomThickness
Else
'se l'immagine non c'è e il testo è maggiore di 20 lo taglio
If sCompoName.Length > 20 Then
sCompoName = sCompoName.Substring(0, 20)
End If
GetLabel(index).Text = sCompoName
End If
Else
'Se non c'è testo azzero la distanza tra testo e immagine
CustomThickness.Right = 0
GetImage(index).Margin = CustomThickness
End If
Next
End Sub
' Gestione bottone altri componenti
Private Sub Compo9_Click(sender As Object, e As RoutedEventArgs) Handles Compo9.Click
If m_bIsFirstPage Then
m_bIsFirstPage = False
LoadPage()
'Compo9.SetValue(Grid.ColumnProperty, 1)
'Compo9.SetValue(Grid.ColumnSpanProperty, 1)
'ImageCompo9.Source = New System.Windows.Media.Imaging.BitmapImage(New Uri("/Resources/NumericKeyboardArrow.png", UriKind.Relative))
'ImageCompo9.Visibility = Windows.Visibility.Visible
'LabelCompo9.Visibility = Windows.Visibility.Hidden
Compo9.SetValue(Grid.ColumnProperty, 0)
Compo9.SetValue(Grid.ColumnSpanProperty, 2)
ImageCompo9.Visibility = Windows.Visibility.Hidden
+106 -98
View File
@@ -7,124 +7,132 @@
mc:Ignorable="d"
d:DesignHeight="853.3" d:DesignWidth="1280">
<!-- Definizione della FrameCutPage -->
<Grid Name="FrameCutPageGrid" >
<Grid.ColumnDefinitions>
<ColumnDefinition Width="3*"/>
<ColumnDefinition Width="12*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="1*"/>
<RowDefinition Height="8*"/>
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
<!-- Definizione della Grid superiore -->
<Grid Grid.Column="1" Grid.Row="0" >
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="4*"/>
</Grid.ColumnDefinitions>
<Button Name="PhotoBtn" Grid.Column="0" Style="{DynamicResource OmagCut_RightGrayGradientYellowButton}">
<Image Source="{DynamicResource PhotoImg}" Style="{StaticResource OmagCut_ButtonIcon}"/>
</Button>
<Button Name="RawPartBtn" Grid.Column="1" Style="{DynamicResource OmagCut_RightGrayGradientYellowButton}">
<Image Source="{DynamicResource RawPartImg}" Style="{StaticResource OmagCut_ButtonIcon}"/>
</Button>
<ToggleButton Name="MachiningBtn" Grid.Column="4" Style="{DynamicResource OmagCut_RightGrayYellowIconToggleButton}">
<Image Source="{DynamicResource FrameMachiningImg}" Style="{StaticResource OmagCut_ButtonIcon}"/>
</ToggleButton>
</Grid>
<Grid Name="LeftGrid" Grid.Row="1">
<Grid.RowDefinitions>
<!-- Definizione della FrameCutPage -->
<Grid Name="FrameCutPageGrid" >
<Grid.ColumnDefinitions>
<ColumnDefinition Width="3*"/>
<ColumnDefinition Width="12*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="1*"/>
<RowDefinition Height="7*"/>
</Grid.RowDefinitions>
<Grid Grid.Row="1">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="0.6*"/>
<RowDefinition Height="0.8*"/>
<RowDefinition Height="0.5*"/>
<RowDefinition Height="0.5*"/>
<RowDefinition Height="0.5*"/>
<RowDefinition Height="0.8*"/>
<RowDefinition Height="2.5*"/>
</Grid.RowDefinitions>
<RowDefinition Height="8*"/>
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
<ComboBox Name="AlongAxCmBx" Grid.Row="0" Grid.ColumnSpan="3" Style="{StaticResource OmagCut_ComboBox}"
Width="200" MaxDropDownHeight="300">
<ComboBox.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding}" Style="{StaticResource OmagCut_LowerCaseCharacterTextBlock}"/>
</DataTemplate>
</ComboBox.ItemTemplate>
</ComboBox>
<!-- Definizione della Grid superiore -->
<Grid Grid.Column="1" Grid.Row="0" >
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="4*"/>
</Grid.ColumnDefinitions>
<UniformGrid Grid.Column="0" Grid.Row="1" Grid.ColumnSpan="3" Columns="2" >
<Button Name="SelSectionBtn"
Style="{DynamicResource OmagCut_YellowGradientYellowIconButton}">
<Image Source="{DynamicResource Sezione-corniceImg}" Style="{DynamicResource OmagCut_ButtonIcon}"/>
<Button Name="PhotoBtn" Grid.Column="0" Style="{DynamicResource OmagCut_RightGrayGradientYellowButton}">
<Image Source="{DynamicResource PhotoImg}" Style="{StaticResource OmagCut_ButtonIcon}"/>
</Button>
<Grid>
<Button Name="SelGuideBtn"
<Button Name="RawPartBtn" Grid.Column="1" Style="{DynamicResource OmagCut_RightGrayGradientYellowButton}">
<Image Source="{DynamicResource RawPartImg}" Style="{StaticResource OmagCut_ButtonIcon}"/>
</Button>
<ToggleButton Name="MachiningBtn" Grid.Column="4" Style="{DynamicResource OmagCut_RightGrayYellowIconToggleButton}">
<Image Source="{DynamicResource FrameMachiningImg}" Style="{StaticResource OmagCut_ButtonIcon}"/>
</ToggleButton>
</Grid>
<Grid Name="LeftGrid" Grid.Row="1">
<Grid.RowDefinitions>
<RowDefinition Height="1*"/>
<RowDefinition Height="7*"/>
</Grid.RowDefinitions>
<Grid Grid.Row="1">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="0.6*"/>
<RowDefinition Height="0.8*"/>
<RowDefinition Height="0.5*"/>
<RowDefinition Height="0.5*"/>
<RowDefinition Height="0.5*"/>
<RowDefinition Height="0.8*"/>
<RowDefinition Height="0.8*"/>
<RowDefinition Height="1.7*"/>
</Grid.RowDefinitions>
<ComboBox Name="AlongAxCmBx" Grid.Row="0" Grid.ColumnSpan="3" Style="{StaticResource OmagCut_ComboBox}"
Width="200" MaxDropDownHeight="300">
<ComboBox.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding}" Style="{StaticResource OmagCut_LowerCaseCharacterTextBlock}"/>
</DataTemplate>
</ComboBox.ItemTemplate>
</ComboBox>
<UniformGrid Grid.Column="0" Grid.Row="1" Grid.ColumnSpan="3" Columns="2" >
<Button Name="SelSectionBtn"
Style="{DynamicResource OmagCut_YellowGradientYellowIconButton}">
<Image Source="{DynamicResource Sezione-corniceImg}" Style="{DynamicResource OmagCut_ButtonIcon}"/>
</Button>
<Grid>
<Button Name="SelGuideBtn"
Style="{DynamicResource OmagCut_YellowTextButton}"/>
<UniformGrid Name="ArcGrid" Grid.Column="0" Grid.Row="1" Grid.ColumnSpan="3" Columns="2" >
<TextBlock Name="ArcRadTxBl" Grid.Row="2" Grid.ColumnSpan="2"
<UniformGrid Name="ArcGrid" Grid.Column="0" Grid.Row="1" Grid.ColumnSpan="3" Columns="2" >
<TextBlock Name="ArcRadTxBl" Grid.Row="2" Grid.ColumnSpan="2"
Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>
<EgtWPFLib:EgtTextBox Name="ArcRadTxBx" Grid.Column="2" Grid.Row="2" Width="50"
<EgtWPFLib:EgtTextBox Name="ArcRadTxBx" Grid.Column="2" Grid.Row="2" Width="50"
Style="{DynamicResource OmagCut_CalculatorTextBox}"/>
<TextBlock Name="ArcAngTxBl" Grid.Row="3" Grid.ColumnSpan="2"
<TextBlock Name="ArcAngTxBl" Grid.Row="3" Grid.ColumnSpan="2"
Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>
<EgtWPFLib:EgtTextBox Name="ArcAngTxBx" Grid.Column="2" Grid.Row="3" Width="50"
<EgtWPFLib:EgtTextBox Name="ArcAngTxBx" Grid.Column="2" Grid.Row="3" Width="50"
Style="{DynamicResource OmagCut_CalculatorTextBox}"/>
</UniformGrid>
</Grid>
</UniformGrid>
</UniformGrid>
</Grid>
</UniformGrid>
<TextBlock Name="OffsZTxBl" Grid.Row="2" Grid.ColumnSpan="2"
<TextBlock Name="OffsZTxBl" Grid.Row="2" Grid.ColumnSpan="2"
Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>
<EgtWPFLib:EgtTextBox Name="OffsZTxBx" Grid.Column="2" Grid.Row="2" Width="50"
<EgtWPFLib:EgtTextBox Name="OffsZTxBx" Grid.Column="2" Grid.Row="2" Width="50"
Style="{DynamicResource OmagCut_CalculatorTextBox}"/>
<TextBlock Name="OffsXyTxBl" Grid.Row="3" Grid.ColumnSpan="2"
<TextBlock Name="OffsXyTxBl" Grid.Row="3" Grid.ColumnSpan="2"
Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>
<EgtWPFLib:EgtTextBox Name="OffsXyTxBx" Grid.Column="2" Grid.Row="3" Width="50"
<EgtWPFLib:EgtTextBox Name="OffsXyTxBx" Grid.Column="2" Grid.Row="3" Width="50"
Style="{DynamicResource OmagCut_CalculatorTextBox}"/>
<TextBlock Name="OffsYyTxBl" Grid.Row="4" Grid.ColumnSpan="2"
<TextBlock Name="OffsYyTxBl" Grid.Row="4" Grid.ColumnSpan="2"
Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>
<EgtWPFLib:EgtTextBox Name="OffsYyTxBx" Grid.Column="2" Grid.Row="4" Width="50"
<EgtWPFLib:EgtTextBox Name="OffsYyTxBx" Grid.Column="2" Grid.Row="4" Width="50"
Style="{DynamicResource OmagCut_CalculatorTextBox}"/>
<UniformGrid Grid.Column="0" Grid.Row="5" Grid.ColumnSpan="3" Columns="2" >
<Button Name="MirrorPartBtn"
<UniformGrid Grid.Column="0" Grid.Row="5" Grid.ColumnSpan="3" Columns="2" >
<Button Name="MirrorPartBtn"
Style="{DynamicResource OmagCut_RightGrayGradientYellowButton}">
<Image Source="{DynamicResource SpecchiaImg}" Style="{DynamicResource OmagCut_ButtonIcon}"/>
</Button>
<Button Name="RemovePartBtn"
</Button>
<Button Name="RemovePartBtn"
Style="{DynamicResource OmagCut_RightGrayGradientYellowButton}">
<Image Source="{DynamicResource Rimuovi_eliminaImg}" Style="{DynamicResource OmagCut_ButtonIcon}"/>
</Button>
</UniformGrid>
</Button>
</UniformGrid>
<!--<TextBlock Name="SawRoughingTxBl" Grid.Row="4" Grid.ColumnSpan="3"
<UniformGrid Grid.Column="0" Grid.Row="6" Grid.ColumnSpan="3" Columns="2" >
<Button Name="CompoBtn"
Style="{DynamicResource OmagCut_RightGrayGradientYellowButton}">
<Image Source="{DynamicResource DrawImg}" Style="{DynamicResource OmagCut_ButtonIcon}"/>
</Button>
</UniformGrid>
<!--<TextBlock Name="SawRoughingTxBl" Grid.Row="4" Grid.ColumnSpan="3"
Style="{StaticResource OmagCut_CenteredLowerCaseCharacterTextBlock}"/>
<ComboBox Name="SawRoughingCmBx" Grid.Row="5" Grid.ColumnSpan="3" Style="{StaticResource OmagCut_ComboBox}"
@@ -182,10 +190,10 @@
</ComboBox.ItemTemplate>
</ComboBox>-->
</Grid>
</Grid>
</Grid>
</Grid>
</Grid>
</Grid>
</UserControl>
+12
View File
@@ -81,6 +81,8 @@ Public Class FrameCutPageUC
m_ProjectMgr.CSVBtn.Visibility = Windows.Visibility.Hidden
m_ProjectMgr.VeinMatchingBtn.Visibility = Windows.Visibility.Hidden
m_ProjectMgr.RegisterBtn.Visibility = Windows.Visibility.Hidden
' Visualizzo il bottone per l'importazione dei compo frame
CompoBtn.Visibility = If(GetPrivateProfileInt(S_FRAMECOMPO, K_CMP_COUNT, 0, m_MainWindow.GetIniFile()) > 0, Visibility.Visible, Visibility.Hidden)
' Recupero dimensioni e kerf del grezzo
m_nRawId = EgtGetFirstRawPart()
GetRawBox(m_RawBox)
@@ -436,6 +438,16 @@ Public Class FrameCutPageUC
End If
End Sub
Private Sub CompoBtn_Click(sender As Object, e As RoutedEventArgs) Handles CompoBtn.Click
m_MainWindow.TestOff()
m_MainWindow.DragRettangleOff()
m_MainWindow.SplitCurvWJOff()
m_MainWindow.StartCurvWJOff()
m_MainWindow.MainWindowGrid.Children.Remove(m_MainWindow.m_CurrentProjectPageUC)
m_MainWindow.MainWindowGrid.Children.Add(m_MainWindow.m_DrawPageUC)
m_MainWindow.m_ActivePage = MainWindow.Pages.Draw
End Sub
Friend Function CreateFrame(nPartId As Integer) As Boolean
If Not MyCreateFrame( nPartId) Then
EgtErase( nPartId)
+6
View File
@@ -1189,6 +1189,12 @@ Public Class AlarmsPageUC
EgtLuaSetGlobNumVar("CMD.THICK", dToolThick * 1000)
EgtTdbGetCurrToolParam(MCH_TP.LEN, dToolLen)
EgtLuaSetGlobNumVar("CMD.LENGTH", dToolLen * 1000)
' Nuova varibile per gestione tastatura utensili Frankfurt (Polishing)
Dim nType As Integer
EgtTdbGetCurrToolParam(MCH_TP.TYPE, nType)
If m_CurrentMachine.bPolishingWheel AndAlso nType = MCH_TY.MILL_POLISHING Then
EgtLuaSetGlobStringVar("CMD.POLISHING", "1")
End If
EgtLuaSetGlobBoolVar("CMD.INCHES", m_MainWindow.m_CNCommunication.GetMachineInInches())
EgtLuaCallFunction("CMD.CmdString")
' Leggo variabili
+2 -2
View File
@@ -61,8 +61,8 @@ Public Class PolishingsPageUC
RepeatTxBl.Text = EgtMsg(91093) ' Ripetizioni
StepTxBl.Text = EgtMsg(90787) ' Passo
OffSetTxBl.Text = EgtMsg(91089) ' Offset
RadiusTxBl.Text = "Raggio"
DistanceTxBl.Text = "Distanza"
RadiusTxBl.Text = EgtMsg(91139) ' Raggio
DistanceTxBl.Text = EgtMsg(91140) ' Distanza
LiLoGpBx.Header = EgtMsg(91094) ' Attacco/Uscita
LiLenTxBl.Text = EgtMsg(91097) ' Lunghezza
LiHeightTxBl.Text = EgtMsg(91095) ' Altezza
+4 -3
View File
@@ -328,8 +328,8 @@ Class MainWindow
' Verifico abilitazione nesting automatico
m_bAutoNest = Not String.IsNullOrWhiteSpace(sNestKey)
' Recupero opzioni della chiave
Dim bKey As Boolean = EgtGetKeyLevel(9423, 2504, 1, m_nKeyLevel) And
EgtGetKeyOptions(9423, 2504, 1, m_nKeyOptions)
Dim bKey As Boolean = EgtGetKeyLevel(9423, 2505, 1, m_nKeyLevel) And
EgtGetKeyOptions(9423, 2505, 1, m_nKeyOptions)
' Verifico abilitazione prodotto
Dim bProd As Boolean = GetKeyOption(KEY_OPT.CUT_BASE)
' Inizializzazione generale di EgtInterface
@@ -1226,7 +1226,8 @@ Class MainWindow
m_ProdLineTimer.Interval = TimeSpan.FromMilliseconds(2000)
m_ProdLineTimer.Start()
End If
' di default attivo la pagina CadCut
m_ActivePage = MainWindow.Pages.CadCut
' seleziono il tipo di avvio
m_CurrentProjectPageUC.StartProgram()
' aggiorno la grafica
+2 -2
View File
@@ -62,5 +62,5 @@ Imports System.Windows
' by using the '*' as shown below:
' <Assembly: AssemblyVersion("1.0.*")>
<Assembly: AssemblyVersion("2.5.4.3")>
<Assembly: AssemblyFileVersion("2.5.4.3")>
<Assembly: AssemblyVersion("2.5.5.2")>
<Assembly: AssemblyFileVersion("2.5.5.2")>
+10
View File
@@ -245,6 +245,9 @@
<Compile Include="Project\CicloStartWD.xaml.vb">
<DependentUpon>CicloStartWD.xaml</DependentUpon>
</Compile>
<Compile Include="RawPhoto\OtherRefTabWD.xaml.vb">
<DependentUpon>OtherRefTabWD.xaml</DependentUpon>
</Compile>
<Compile Include="RawPhoto\SlabIdWD.xaml.vb">
<DependentUpon>SlabIdWD.xaml</DependentUpon>
</Compile>
@@ -519,6 +522,10 @@
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="RawPhoto\OtherRefTabWD.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="RawPhoto\SlabIdWD.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
@@ -1330,6 +1337,9 @@
<ItemGroup>
<Resource Include="Resources\ToolChangerPos.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\NewIcons\RefTab.png" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />
<PropertyGroup>
<PostBuildEvent>IF "$(PlatformName)"=="x86" IF "$(ConfigurationName)" == "Release" copy $(TargetPath) c:\EgtProg\OmagCUT\OmagCUTR32.exe
+1
View File
@@ -32,6 +32,7 @@
<BitmapImage x:Key="AlignPiecesImg" UriSource="Resources/NewIcons/ruota-oggetto-inclinato.png"></BitmapImage>
<BitmapImage x:Key="BarCodeImg" UriSource="Resources/NewIcons/BarCode.png"></BitmapImage>
<BitmapImage x:Key="SlabIdImg" UriSource="Resources/NewIcons/SlabId.png"></BitmapImage>
<BitmapImage x:Key="RefTabImg" UriSource="Resources/NewIcons/RefTab.png"></BitmapImage>
<BitmapImage x:Key="BottomLeftImg" UriSource="Resources/NewIcons/1-BottomLeft.png"></BitmapImage>
<BitmapImage x:Key="BottomRightImg" UriSource="Resources/NewIcons/2-BottomRight.png"></BitmapImage>
<BitmapImage x:Key="PartRotOnImg" UriSource="Resources/NewIcons/PartRotOn.png"></BitmapImage>
+1
View File
@@ -102,6 +102,7 @@
<BitmapImage x:Key="AlignPiecesImg" UriSource="Resources/AlignPieces.png"></BitmapImage>
<BitmapImage x:Key="BarCodeImg" UriSource="Resources/BarCode.png"></BitmapImage>
<BitmapImage x:Key="SlabIdImg" UriSource="Resources/SlabId.png"></BitmapImage>
<BitmapImage x:Key="RefTabImg" UriSource="Resources/NewIcons/RefTab.png"></BitmapImage>
<BitmapImage x:Key="BottomLeftImg" UriSource="Resources/BottomLeft.png"></BitmapImage>
<BitmapImage x:Key="BottomRightImg" UriSource="Resources/BottomRight.png"></BitmapImage>
<BitmapImage x:Key="PartRotOnImg" UriSource="Resources/PartRotOn.png"></BitmapImage>
+13 -1
View File
@@ -491,7 +491,19 @@ Public Class OpenPageUC
m_SceneButtons.MeasureBtn.IsChecked = False
' Istruzioni per chiudere OpenPageUC e aprire currentproject e cadcut page
m_MainWindow.MainWindowGrid.Children.Remove(m_MainWindow.m_OpenPage)
m_MainWindow.MainWindowGrid.Children.Add(m_MainWindow.m_CurrentProjectPageUC)
If m_MainWindow.m_PrevActivePage = MainWindow.Pages.CadCut Then
m_MainWindow.MainWindowGrid.Children.Add(m_MainWindow.m_CurrentProjectPageUC)
If Not m_MainWindow.CadCutBtn.IsChecked Then
m_MainWindow.m_CurrentProjectPageUC.CurrentProjectPageGrid.Children.Add(m_MainWindow.m_CadCutPageUC)
m_MainWindow.CadCutBtn.IsChecked = True
End If
ElseIf m_MainWindow.m_PrevActivePage = MainWindow.Pages.FrameCut Then
m_MainWindow.MainWindowGrid.Children.Add(m_MainWindow.m_CurrentProjectPageUC)
If Not m_MainWindow.FrameCutBtn.IsChecked Then
m_MainWindow.m_CurrentProjectPageUC.CurrentProjectPageGrid.Children.Add(m_MainWindow.m_FrameCutPageUC)
m_MainWindow.FrameCutBtn.IsChecked = True
End If
End If
' Non modifico progetto corrente
m_MainWindow.m_ActivePage = m_MainWindow.m_PrevActivePage
End Sub
-2
View File
@@ -263,8 +263,6 @@ Public Class ProjectMgrUC
Dim nWarn As Integer = 0
ResetAllMachinings(nWarn)
If nWarn = 1 Then m_CurrProjPage.SetWarningMessage(EgtMsg(MSG_SPLITPAGEUC + 11)) ' Lama troppo grande per utilizzo ventosa
' Se eistono elimino i grezzi delle fasi che non contengono lavorazioni
ResetAllRawPart()
' Aggiorno Info C Home
Dim dCHome As Double
EgtGetAxisHomePos("C", dCHome)
+82
View File
@@ -0,0 +1,82 @@
<Window x:Class="OtherRefTabWD"
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="{DynamicResource OmagCut_Font}"
ResizeMode="NoResize" WindowStyle="None" AllowsTransparency="True" Background="Transparent"
Title="ModifStartEndWD" Height="250" Width="320" ShowInTaskbar="False">
<!--Definizione della pagina di scelta del nome con cui salvare il progetto-->
<Border Style="{DynamicResource OmagCut_Border}">
<Grid x:Name="SaveNameGrid">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="0.2*"/>
<ColumnDefinition Width="2*"/>
<ColumnDefinition Width="2*"/>
<ColumnDefinition Width="0.2*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<!--<RowDefinition Height="0.5*"/>
<RowDefinition Height="0.5*"/>
<RowDefinition Height="0.5*"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="0.5*"/>-->
<RowDefinition Height="0.2*"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="0.2*"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="0.2*"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="0.2*"/>
<RowDefinition Height="1.5*"/>
<RowDefinition Height="0.2*"/>
</Grid.RowDefinitions>
<TextBlock Name="RefRawTxbl" Grid.Column="1" Grid.Row="1"
Style="{DynamicResource OmagCut_CenteredLowerCaseCharacterTextBlock}"/>
<ComboBox Name="RefTabModeCmBx" Grid.Column="2" Grid.Row="1" Style="{StaticResource OmagCut_ComboBox}"
MaxDropDownHeight="300" Margin="0,0,0,0">
<ComboBox.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding}" Style="{StaticResource OmagCut_LowerCaseCharacterTextBlock}"/>
</DataTemplate>
</ComboBox.ItemTemplate>
</ComboBox>
<TextBlock Name="RefTabXTxbl" Grid.Column="1" Grid.Row="3"
Style="{DynamicResource OmagCut_CenteredLowerCaseCharacterTextBlock}"/>
<EgtWPFLib:EgtTextBox Name="RefTabXTxBx" Grid.Column="2" Grid.Row="3"
Style="{DynamicResource OmagCut_CalculatorTextBox}"/>
<TextBlock Name="RefTabYTxbl" Grid.Column="1" Grid.Row="5"
Style="{DynamicResource OmagCut_CenteredLowerCaseCharacterTextBlock}"/>
<EgtWPFLib:EgtTextBox Name="RefTabYTxBx" Grid.Column="2" Grid.Row="5"
Style="{DynamicResource OmagCut_CalculatorTextBox}"/>
<Grid Name="ButtonsGrid" Grid.Column="1" Grid.ColumnSpan="2" Grid.Row="7" Grid.RowSpan="1">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="0.5*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="0.5*"/>
</Grid.ColumnDefinitions>
<Button Name="OkBtn" Grid.Column="1"
Style="{DynamicResource OmagCut_GradientBlueIconButton}">
<Image Source="{DynamicResource VImg}" Style="{StaticResource OmagCut_ButtonIcon}"/>
</Button>
<Button Name="ExitBtn" Grid.Column="3"
IsCancel="True"
Style="{DynamicResource OmagCut_GradientBlueIconButton}">
<Image Source="{DynamicResource XImg}" Style="{StaticResource OmagCut_ButtonIcon}"/>
</Button>
</Grid>
</Grid>
</Border>
</Window>
+108
View File
@@ -0,0 +1,108 @@
Imports System.IO
Imports EgtUILib
Imports EgtWPFLib
Public Class OtherRefTabWD
Dim m_MainWindow As MainWindow = DirectCast(Application.Current.MainWindow, MainWindow)
Dim m_RawPartPage As RawPartPageUC
Private m_sPosX As String = "0"
Private m_sPosY As String = "0"
Private m_dPrevOffsetX As Double = 0
Private m_dPrevOffsetY As Double = 0
Private m_SelIndex As Integer = 0
Sub New(Owner As Window, PosX As String, PosY As String, OffsetX As Double, OffsetY As Double, OtherRefMode As Integer)
Me.Owner = Owner
' La chiamata è richiesta dalla finestra di progettazione.
InitializeComponent()
' Aggiungere le eventuali istruzioni di inizializzazione dopo la chiamata a InitializeComponent().
m_sPosX = PosX
m_sPosY = PosY
m_dPrevOffsetX = OffsetX
m_dPrevOffsetY = OffsetY
m_SelIndex = OtherRefMode
End Sub
Private Sub OtherRrefTabWD_Initialized(sender As Object, e As EventArgs) Handles Me.Initialized
' costruisco il riferimento alla pagina Raw
m_RawPartPage = m_MainWindow.m_RawPartPage
' posiziono la finestra
Me.Top = Owner.Top + Owner.Height / 4 - Me.Height / 2
Me.Left = Owner.Left + Owner.Width / 6 - Me.Width / 2
RefRawTxbl.Text = "Raw reference"
RefTabXTxbl.Text = "Position X"
RefTabYTxbl.Text = "Position Y"
RefTabModeCmBx.ItemsSource = m_RawPartPage.m_OtherRefTabList
RefTabModeCmBx.SelectedIndex = m_RawPartPage.m_OtherRefTabPos
End Sub
Private Sub OtherRrefTabWD_Load(sender As Object, e As EventArgs) Handles Me.Loaded
RefTabXTxBx.Text = m_sPosX
RefTabYTxBx.Text = m_sPosY
End Sub
Private Sub RefTabModeCmBx_SelectionChanged(sender As Object, e As SelectionChangedEventArgs) Handles RefTabModeCmBx.SelectionChanged
m_RawPartPage.m_OtherRefTabPos = RefTabModeCmBx.SelectedIndex
WritePrivateProfileString(S_RAWPART, K_OTHERREFTABPOS, m_RawPartPage.m_OtherRefTabPos.ToString, m_MainWindow.GetIniFile())
m_RawPartPage.RefTabModeChange()
End Sub
Private Sub RefTabXTxBx_EgtClosed(sender As Object, e As EventArgs) Handles RefTabXTxBx.EgtClosed
Dim ptMin, ptMax As Point3d
If EgtGetTableArea(1, ptMin, ptMax) Then
Dim dX As Double = 0
StringToLen(RefTabXTxBx.Text, dX)
If Not (dX > 0 And dX < ptMax.x - ptMin.x) Then
If dX > 0 Then
dX = ptMax.x - ptMin.x
Else
dX = 0
End If
RefTabXTxBx.Text = LenToString(dX, 2)
' errore, posizione fuori dalla tavola
End If
m_RawPartPage.m_OtherRefTabX = dX
m_RawPartPage.RefTabModeChange()
End If
End Sub
Private Sub RefTabYTxBx_EgtClosed(sender As Object, e As EventArgs) Handles RefTabYTxBx.EgtClosed
Dim ptMin, ptMax As Point3d
If EgtGetTableArea(1, ptMin, ptMax) Then
Dim dY As Double = 0
StringToLen(RefTabYTxBx.Text, dY)
If Not (dY > 0 And dY < ptMax.y - ptMin.y) Then
If dY > 0 Then
dY = ptMax.y - ptMin.y
Else
dY = 0
End If
RefTabYTxBx.Text = LenToString(dY, 2)
' errore, posizione fuori dalla tavola
End If
m_RawPartPage.m_OtherRefTabY = dY
m_RawPartPage.RefTabModeChange()
End If
End Sub
Private Sub OkBtn_Click() Handles OkBtn.Click
WritePrivateProfileString(S_RAWPART, K_OTHERREFTABX, DoubleToString(RefTabXTxBx.Text, 2), m_MainWindow.GetIniFile())
WritePrivateProfileString(S_RAWPART, K_OTHERREFTABY, DoubleToString(RefTabYTxBx.Text, 2), m_MainWindow.GetIniFile())
WritePrivateProfileString(S_RAWPART, K_OTHERREFTABPOS, m_RawPartPage.m_OtherRefTabPos.ToString, m_MainWindow.GetIniFile())
Me.Close()
End Sub
Private Sub ExitBtn_Click() Handles ExitBtn.Click
' riposiziono l'origine
m_RawPartPage.m_OtherRefTabX = m_sPosX
m_RawPartPage.m_OtherRefTabY = m_sPosY
' ripristino il valore della combobox
m_RawPartPage.m_OtherRefTabPos = m_SelIndex
m_RawPartPage.RefTabModeChange()
End Sub
End Class
+153 -144
View File
@@ -6,76 +6,76 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
mc:Ignorable="d"
d:DesignHeight="853.3" d:DesignWidth="1280" Loaded="RawPartPage_Loaded" Initialized="RawPartPage_Initialized" Unloaded="RawPartPage_Unloaded">
<!-- Definizione della RowPartPage -->
<Grid Name="RowPartPageGrid" >
<Grid.ColumnDefinitions>
<ColumnDefinition Width="3*"/>
<ColumnDefinition Width="12*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="1*"/>
<RowDefinition Height="8*"/>
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
<!-- Definizione della Grid superiore -->
<Grid Name="UpperButtonGrid" Grid.Column="1" Grid.Row="0" >
<Grid.ColumnDefinitions>
<ColumnDefinition Width="5*"/>
<ColumnDefinition Width="7*"/>
</Grid.ColumnDefinitions>
</Grid>
<!-- Definizione della Grid Laterale -->
<Grid Name="LeftButtonGrid" Grid.RowSpan="3">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1.5*"/>
<ColumnDefinition Width="1.5*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="1*"/>
<RowDefinition Height="4*"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="1.5*"/>
<RowDefinition Height="1.*"/>
<RowDefinition Height="0.5*"/>
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
<RadioButton Name="OutlineBtn" Style="{DynamicResource OmagCut_YellowToggleButton}"
GroupName="DefinitionMethod_GrezzoUC"/>
<RadioButton Name="DamagedBtn" Style="{DynamicResource OmagCut_YellowToggleButton}"
Grid.Column="1" GroupName="DefinitionMethod_GrezzoUC"/>
<!-- Definizione della RowPartPage -->
<Grid Name="RowPartPageGrid" >
<Grid.ColumnDefinitions>
<ColumnDefinition Width="3*"/>
<ColumnDefinition Width="12*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="1*"/>
<RowDefinition Height="8*"/>
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
<!-- Definizione della Grid per definizione grezzo -->
<Grid Name="RawMeasureGrd" Grid.Row="1" Grid.ColumnSpan="2">
<!-- Definizione della Grid superiore -->
<Grid Name="UpperButtonGrid" Grid.Column="1" Grid.Row="0" >
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="5*"/>
<ColumnDefinition Width="7*"/>
</Grid.ColumnDefinitions>
</Grid>
<!-- Definizione della Grid Laterale -->
<Grid Name="LeftButtonGrid" Grid.RowSpan="3">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1.5*"/>
<ColumnDefinition Width="1.5*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="1*"/>
<RowDefinition Height="0.5*"/>
<RowDefinition Height="0.5*"/>
<RowDefinition Height="0.5*"/>
<RowDefinition Height="0.5*"/>
<RowDefinition Height="0.5*"/>
<RowDefinition Height="0.5*"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="4*"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="1.5*"/>
<RowDefinition Height="1.*"/>
<RowDefinition Height="0.5*"/>
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
<ComboBox Name="RawModeCmBx" Grid.Row="0" Grid.ColumnSpan="2" Style="{StaticResource OmagCut_ComboBox}"
MaxDropDownHeight="300" Margin="6,0,6,0">
<ComboBox.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding}" Style="{StaticResource OmagCut_LowerCaseCharacterTextBlock}"/>
</DataTemplate>
</ComboBox.ItemTemplate>
</ComboBox>
<RadioButton Name="OutlineBtn" Style="{DynamicResource OmagCut_YellowToggleButton}"
GroupName="DefinitionMethod_GrezzoUC"/>
<RadioButton Name="DamagedBtn" Style="{DynamicResource OmagCut_YellowToggleButton}"
Grid.Column="1" GroupName="DefinitionMethod_GrezzoUC"/>
<ComboBox Name="RawModeDamagedCmBx" Grid.Row="0" Grid.ColumnSpan="2" Style="{StaticResource OmagCut_ComboBox}"
<!-- Definizione della Grid per definizione grezzo -->
<Grid Name="RawMeasureGrd" Grid.Row="1" Grid.ColumnSpan="2">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="1*"/>
<RowDefinition Height="0.5*"/>
<RowDefinition Height="0.5*"/>
<RowDefinition Height="0.5*"/>
<RowDefinition Height="0.5*"/>
<RowDefinition Height="0.5*"/>
<RowDefinition Height="0.5*"/>
</Grid.RowDefinitions>
<ComboBox Name="RawModeCmBx" Grid.Row="0" Grid.ColumnSpan="2" Style="{StaticResource OmagCut_ComboBox}"
MaxDropDownHeight="300" Margin="6,0,6,0">
<ComboBox.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding}" Style="{StaticResource OmagCut_LowerCaseCharacterTextBlock}"/>
</DataTemplate>
</ComboBox.ItemTemplate>
</ComboBox>
<ComboBox Name="RawModeDamagedCmBx" Grid.Row="0" Grid.ColumnSpan="2" Style="{StaticResource OmagCut_ComboBox}"
MaxDropDownHeight="300" Margin="6,0,6,0">
<ComboBox.ItemTemplate>
<DataTemplate>
@@ -85,114 +85,123 @@
</ComboBox>
<TextBlock Name="LengthTxBl" Grid.Row="1" Style="{DynamicResource OmagCut_CurrProjSummeryTextBlock}"/>
<EgtWPFLib:EgtTextBox Name="LengthTxBx" Grid.Column="1" Grid.Row="1" Margin="13,0,6,0"
<EgtWPFLib:EgtTextBox Name="LengthTxBx" Grid.Column="1" Grid.Row="1" Margin="13,0,6,0"
Style="{DynamicResource OmagCut_CalculatorTextBox}"/>
<TextBlock Name="WidthTxBl" Grid.Row="2" Style="{DynamicResource OmagCut_CurrProjSummeryTextBlock}"/>
<EgtWPFLib:EgtTextBox Name="WidthTxBx" Grid.Column="1" Grid.Row="2" Margin="13,0,6,0"
<TextBlock Name="WidthTxBl" Grid.Row="2" Style="{DynamicResource OmagCut_CurrProjSummeryTextBlock}"/>
<EgtWPFLib:EgtTextBox Name="WidthTxBx" Grid.Column="1" Grid.Row="2" Margin="13,0,6,0"
Style="{DynamicResource OmagCut_CalculatorTextBox}"/>
<TextBlock Name="HeightTxBl" Grid.Row="3" Style="{DynamicResource OmagCut_CurrProjSummeryTextBlock}"/>
<EgtWPFLib:EgtTextBox Name="HeightTxBx" Grid.Column="1" Grid.Row="3" Margin="13,0,6,0"
<TextBlock Name="HeightTxBl" Grid.Row="3" Style="{DynamicResource OmagCut_CurrProjSummeryTextBlock}"/>
<EgtWPFLib:EgtTextBox Name="HeightTxBx" Grid.Column="1" Grid.Row="3" Margin="13,0,6,0"
Style="{DynamicResource OmagCut_CalculatorTextBox}"/>
<TextBlock Name="OffsetXTxBl" Grid.Row="4" Style="{DynamicResource OmagCut_CurrProjSummeryTextBlock}"/>
<EgtWPFLib:EgtTextBox Name="OffsetXTxBx" Grid.Column="1" Grid.Row="4" Margin="13,0,6,0"
<TextBlock Name="OffsetXTxBl" Grid.Row="4" Style="{DynamicResource OmagCut_CurrProjSummeryTextBlock}"/>
<EgtWPFLib:EgtTextBox Name="OffsetXTxBx" Grid.Column="1" Grid.Row="4" Margin="13,0,6,0"
Style="{DynamicResource OmagCut_CalculatorTextBox}"/>
<TextBlock Name="OffsetYTxBl" Grid.Row="5" Style="{DynamicResource OmagCut_CurrProjSummeryTextBlock}"/>
<EgtWPFLib:EgtTextBox Name="OffsetYTxBx" Grid.Column="1" Grid.Row="5" Margin="13,0,6,0"
<TextBlock Name="OffsetYTxBl" Grid.Row="5" Style="{DynamicResource OmagCut_CurrProjSummeryTextBlock}"/>
<EgtWPFLib:EgtTextBox Name="OffsetYTxBx" Grid.Column="1" Grid.Row="5" Margin="13,0,6,0"
Style="{DynamicResource OmagCut_CalculatorTextBox}"/>
<TextBlock Name="KerfTxBl" Grid.Row="6" Style="{DynamicResource OmagCut_CurrProjSummeryTextBlock}"/>
<EgtWPFLib:EgtTextBox Name="KerfTxBx" Grid.Column="1" Grid.Row="6" Margin="13,0,6,0"
<TextBlock Name="KerfTxBl" Grid.Row="6" Style="{DynamicResource OmagCut_CurrProjSummeryTextBlock}"/>
<EgtWPFLib:EgtTextBox Name="KerfTxBx" Grid.Column="1" Grid.Row="6" Margin="13,0,6,0"
Style="{DynamicResource OmagCut_CalculatorTextBox}"/>
</Grid>
<!-- Definizione della Grid per il materiale -->
<GroupBox Name="MaterialGpBx" Grid.Row="2" Grid.ColumnSpan="2" Style="{DynamicResource OmagCut_GroupBox}">
</Grid>
<ComboBox Name="MaterialsCmbx" Style="{StaticResource OmagCut_ComboBox}"
<!-- Definizione della Grid per il materiale -->
<GroupBox Name="MaterialGpBx" Grid.Row="2" Grid.ColumnSpan="2" Style="{DynamicResource OmagCut_GroupBox}">
<ComboBox Name="MaterialsCmbx" Style="{StaticResource OmagCut_ComboBox}"
MaxDropDownHeight="600">
<ComboBox.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding sName}" Style="{StaticResource OmagCut_LowerCaseCharacterTextBlock}"/>
</DataTemplate>
</ComboBox.ItemTemplate>
</ComboBox>
<ComboBox.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding sName}" Style="{StaticResource OmagCut_LowerCaseCharacterTextBlock}"/>
</DataTemplate>
</ComboBox.ItemTemplate>
</ComboBox>
</GroupBox>
</GroupBox>
<!-- Definizione della Grid per Punti -->
<GroupBox Name="PointsGpBx" Grid.Row="3" Grid.ColumnSpan="2" Style="{DynamicResource OmagCut_GroupBox}" >
<!-- Definizione della Grid per Punti -->
<GroupBox Name="PointsGpBx" Grid.Row="3" Grid.ColumnSpan="2" Style="{DynamicResource OmagCut_GroupBox}" >
<Grid >
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1.5*"/>
<ColumnDefinition Width="1.5*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="1*"/>
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
<Grid >
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1.5*"/>
<ColumnDefinition Width="1.5*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="1*"/>
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
<ToggleButton Name="AddBtn"
<ToggleButton Name="AddBtn"
Style="{DynamicResource OmagCut_YellowToggleButton}"/>
<ToggleButton Name="RemoveBtn" Grid.Column="1"
<ToggleButton Name="RemoveBtn" Grid.Column="1"
Style="{DynamicResource OmagCut_YellowToggleButton}"/>
<Button Name="CloseBtn" Grid.Row="1" Grid.ColumnSpan="2"
<Button Name="CloseBtn" Grid.Row="1" Grid.ColumnSpan="2"
Style="{DynamicResource OmagCut_YellowTextButton}"/>
</Grid>
</GroupBox>
</Grid>
<!-- Definizione della Grid per Zona rovinata -->
<GroupBox Name="DamagedAreaGpBx" Grid.Row="4" Grid.ColumnSpan="2" Grid.RowSpan="2" Style="{DynamicResource OmagCut_GroupBox}">
</GroupBox>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<!-- Definizione della Grid per Zona rovinata -->
<GroupBox Name="DamagedAreaGpBx" Grid.Row="4" Grid.ColumnSpan="2" Grid.RowSpan="2" Style="{DynamicResource OmagCut_GroupBox}">
<ToggleButton Name="NewBtn" Style="{DynamicResource OmagCut_YellowToggleButton}"/>
<ToggleButton Name="DeleteBtn" Grid.Column="1" Style="{DynamicResource OmagCut_YellowToggleButton}"/>
</Grid>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
</GroupBox>
<ToggleButton Name="NewBtn" Style="{DynamicResource OmagCut_YellowToggleButton}"/>
<ToggleButton Name="DeleteBtn" Grid.Column="1" Style="{DynamicResource OmagCut_YellowToggleButton}"/>
</Grid>
<Button Name="ConfirmPhotoBtn" Grid.Row="4" Grid.ColumnSpan="2" Visibility="Hidden"
</GroupBox>
<TextBlock Name="OtherRefTabTxBl" Grid.Row="5" Grid.ColumnSpan="2" Style="{DynamicResource OmagCut_CurrProjSummeryTextBlock}"/>
<CheckBox Name="OtherRefTabChBx" Grid.Row="5" Grid.Column="1" Style="{StaticResource OmagCut_CheckBox}"
HorizontalAlignment="Right" Margin="0,0,6,0"/>
<Button Name="ConfirmPhotoBtn" Grid.Row="4" Grid.ColumnSpan="2" Visibility="Hidden"
Style="{DynamicResource OmagCut_YellowTextButton}"/>
</Grid>
<!-- Definizione della Grid Inferiore per i Button V e X -->
<Grid Name="LowerButtonGrid" Grid.Column="1" Grid.Row="3">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="6*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
</Grid>
<Button Name="RawProbingBtn" Style="{DynamicResource OmagCut_YellowGradientYellowIconButton}">
<Image Source="{DynamicResource RawProbeImg}" Style="{StaticResource OmagCut_ButtonIcon}"/>
</Button>
<!-- Definizione della Grid Inferiore per i Button V e X -->
<Grid Name="LowerButtonGrid" Grid.Column="1" Grid.Row="3">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="5*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<Button Name="BarCodeBtn" Grid.Column="2" Style="{DynamicResource OmagCut_YellowGradientYellowIconButton}">
<Image Source="{DynamicResource BarCodeImg}" Style="{StaticResource OmagCut_ButtonIcon}"/>
</Button>
<Button Name="RawProbingBtn" Style="{DynamicResource OmagCut_YellowGradientYellowIconButton}">
<Image Source="{DynamicResource RawProbeImg}" Style="{StaticResource OmagCut_ButtonIcon}"/>
</Button>
<Button Name="SlabIdBtn" Grid.Column="3" Style="{DynamicResource OmagCut_YellowGradientYellowIconButton}">
<Image Source="{DynamicResource SlabIdImg}" Style="{StaticResource OmagCut_ButtonIcon}"/>
</Button>
<Button Name="BarCodeBtn" Grid.Column="2" Style="{DynamicResource OmagCut_YellowGradientYellowIconButton}">
<Image Source="{DynamicResource BarCodeImg}" Style="{StaticResource OmagCut_ButtonIcon}"/>
</Button>
<Button Name="OkBtn" Grid.Column="5" Style="{DynamicResource OmagCut_GradientBlueIconButton}">
<Image Source="{DynamicResource VImg}" Width="65" Height="65" HorizontalAlignment="Center"
<Button Name="SlabIdBtn" Grid.Column="3" Style="{DynamicResource OmagCut_YellowGradientYellowIconButton}">
<Image Source="{DynamicResource SlabIdImg}" Style="{StaticResource OmagCut_ButtonIcon}"/>
</Button>
<Button Name="OtherRefTabBtn" Grid.Column="4" Style="{DynamicResource OmagCut_YellowGradientYellowIconButton}">
<Image Source="{DynamicResource RefTabImg}" Style="{StaticResource OmagCut_ButtonIcon}"/>
</Button>
<Button Name="OkBtn" Grid.Column="6" Style="{DynamicResource OmagCut_GradientBlueIconButton}">
<Image Source="{DynamicResource VImg}" Width="65" Height="65" HorizontalAlignment="Center"
VerticalAlignment="Center" />
</Button>
</Grid>
</Grid>
</Button>
</Grid>
</Grid>
</UserControl>
+273
View File
@@ -1,6 +1,9 @@
Imports System.Globalization
Imports System.IO
Imports System.Windows.Media.Animation
Imports EgtUILib
Imports EgtWPFLib
Imports Microsoft.VisualBasic.Devices
Public Class RawPartPageUC
@@ -78,6 +81,16 @@ Public Class RawPartPageUC
' Costante raggio cerchietto
Private Const RAD_CIRCLE As Double = 30
' Riferimento grezzo
Private m_bEnableOtherRefTab As Boolean = False
Private m_bOtherRefTab As Boolean
Public m_OtherRefTabX As Double = 0
Public m_OtherRefTabY As Double = 0
Public m_OtherRefTabList(3) As String
Public m_OtherRefTabPos As Integer = 0
Private m_nOtherRefTabLay As Integer = GDB_ID.NULL
Private m_OtherRefTabPoint As Point3d
' mostra la pagina delle lavorazioni
Private m_SmartMachiningPage As Boolean = False
@@ -105,6 +118,13 @@ Public Class RawPartPageUC
FROM_SAW = 7
End Enum
Private Enum OTHERREFMODE As Integer
BL = 0
BR = 1
TR = 2
TL = 3
End Enum
Private Sub RawPartPage_Initialized(sender As Object, e As EventArgs)
'Creazione della Page UserControl e relative impostazioni
@@ -145,6 +165,13 @@ Public Class RawPartPageUC
ReDim Preserve m_RawModeListEx(3)
End If
RawModeCmBx.ItemsSource = m_RawModeList
' Creo la lista dei riferimenti tavola
m_OtherRefTabList(OTHERREFMODE.BL) = "Bottom left"
m_OtherRefTabList(OTHERREFMODE.BR) = "Bottom right"
m_OtherRefTabList(OTHERREFMODE.TR) = "Top right"
m_OtherRefTabList(OTHERREFMODE.TL) = "Top left"
' lista per selezione RawModeDamaged
m_RawModeDamagedList(0) = EgtMsg(MSG_RAWPARTPAGEUC + 2) 'Per Punti
m_RawModeDamagedList(1) = EgtMsg(MSG_RAWPARTPAGEUC + 30) 'Da Laser
@@ -184,6 +211,8 @@ Public Class RawPartPageUC
RemoveBtn.Content = EgtMsg(MSG_RAWPARTPAGEUC + 15) 'Remove - Rimuovi
CloseBtn.Content = EgtMsg(MSG_RAWPARTPAGEUC + 31) 'Close - Chiudi
ConfirmPhotoBtn.Content = EgtMsg(MSG_RAWPARTPAGEUC + 24) 'Conferma
OtherRefTabTxBl.Text = "New Ref On Tab"
End Sub
Private Sub RawPartPage_Loaded(sender As Object, e As RoutedEventArgs)
@@ -277,6 +306,12 @@ Public Class RawPartPageUC
Utility.SetBlockAndSlabNbr(sBlock, sSlabNbr)
End If
End If
' Carico le info del riferimento alternativo della tavola
m_nOtherRefTabLay = EgtCreateGroup(GDB_ID.ROOT)
EgtSetLevel(m_nTempLay, GDB_LV.TEMP)
LoadOtherRefTab()
' Assegno dati grezzo rettangolare ai textbox
LengthTxBx.Text = LenToString(m_RawLength, 2)
WidthTxBx.Text = LenToString(m_RawWidth, 2)
@@ -320,6 +355,36 @@ Public Class RawPartPageUC
Next
End Sub
Private Sub LoadOtherRefTab()
m_bEnableOtherRefTab = (GetPrivateProfileInt(S_RAWPART, K_ENABLEOTHERREFTAB, 0, m_MainWindow.GetIniFile()) <> 0)
If Not m_bEnableOtherRefTab Then
OtherRefTabBtn.Visibility = Visibility.Collapsed
OtherRefTabChBx.Visibility = Visibility.Collapsed
OtherRefTabTxBl.Visibility = Visibility.Collapsed
Return
End If
m_bOtherRefTab = (GetPrivateProfileInt(S_RAWPART, K_OTHERREFTAB, 0, m_MainWindow.GetIniFile()) <> 0)
m_OtherRefTabX = GetPrivateProfileDouble(S_RAWPART, K_OTHERREFTABX, 0, m_MainWindow.GetIniFile())
m_OtherRefTabY = GetPrivateProfileDouble(S_RAWPART, K_OTHERREFTABY, 0, m_MainWindow.GetIniFile())
m_OtherRefTabPos = GetPrivateProfileInt(S_RAWPART, K_OTHERREFTABPOS, 0, m_MainWindow.GetIniFile())
' RefTabPosCmbx.SelectedIndex = m_OtherRefTabPos
OtherRefTabChBx.IsChecked = m_bOtherRefTab
' se riferimento tavola differente da quello atteso
If m_bOtherRefTab Then
' dasibilito la modifica dei parametri di Offset
OffsetXTxBx.IsEnabled = False
OffsetYTxBx.IsEnabled = False
UpdateOffsetText()
End If
' Rimuovo eventuali crocette create acquisendo i punti nel disegno
EgtEmptyGroup(m_nOtherRefTabLay)
' Acquisisco punto da disegno
m_OtherRefTabPoint = New Point3d(m_ptTableMin.x + m_OtherRefTabX, m_ptTableMin.y + m_OtherRefTabY, m_ptTableMin.z + 0.15 + m_CurrentMachine.dAdditionalTable)
CreateOtherRefTab(m_nOtherRefTabLay, m_OtherRefTabPoint)
' EgtDraw()
End Sub
Private Sub OnMyMouseDownScene(sender As Object, e As System.Windows.Forms.MouseEventArgs) Handles m_CurrProjPage.OnMouseDownScene
' Verifico di essere il gestore attivo
If Not m_bActive Then Return
@@ -930,6 +995,13 @@ Public Class RawPartPageUC
' Disattivo bottoni zone rovinate
DamagedAreaGpBx.Visibility = Windows.Visibility.Hidden
ConfirmPhotoBtn.Visibility = Windows.Visibility.Hidden
If m_bEnableOtherRefTab Then
OtherRefTabChBx.IsEnabled = True
OtherRefTabBtn.IsEnabled = True
' disegno il riferimento
m_OtherRefTabPoint = New Point3d(m_ptTableMin.x + m_OtherRefTabX, m_ptTableMin.y + m_OtherRefTabY, m_ptTableMin.z + 0.15 + m_CurrentMachine.dAdditionalTable)
CreateOtherRefTab(m_nOtherRefTabLay, m_OtherRefTabPoint)
End If
Case RAWMODE.BY_POINTS
RawModeCmBx.IsEnabled = True
RawModeDamagedCmBx.Visibility = Visibility.Collapsed
@@ -946,6 +1018,12 @@ Public Class RawPartPageUC
' Disattivo bottoni zone rovinate e foto
DamagedAreaGpBx.Visibility = Windows.Visibility.Hidden
ConfirmPhotoBtn.Visibility = Windows.Visibility.Hidden
' disettivo la possibilità di modificare il riferimento
If m_bEnableOtherRefTab Then
OtherRefTabChBx.IsEnabled = False
OtherRefTabBtn.IsEnabled = False
EgtEmptyGroup(m_nOtherRefTabLay)
End If
Case RAWMODE.FROM_LASER
RawModeCmBx.IsEnabled = True
RawModeDamagedCmBx.Visibility = Visibility.Collapsed
@@ -962,6 +1040,11 @@ Public Class RawPartPageUC
' Disattivo bottoni zone rovinate e foto
DamagedAreaGpBx.Visibility = Windows.Visibility.Hidden
ConfirmPhotoBtn.Visibility = Windows.Visibility.Hidden
If m_bEnableOtherRefTab Then
OtherRefTabChBx.IsEnabled = False
OtherRefTabBtn.IsEnabled = False
EgtEmptyGroup(m_nOtherRefTabLay)
End If
Case RAWMODE.DAMAGED
RawModeCmBx.IsEnabled = False
RawModeDamagedCmBx.Visibility = Visibility.Visible
@@ -980,6 +1063,11 @@ Public Class RawPartPageUC
DamagedAreaGpBx.Visibility = Windows.Visibility.Visible
' Disattivo bottoni foto
ConfirmPhotoBtn.Visibility = Windows.Visibility.Hidden
If m_bEnableOtherRefTab Then
OtherRefTabChBx.IsEnabled = False
OtherRefTabBtn.IsEnabled = False
EgtEmptyGroup(m_nOtherRefTabLay)
End If
Case RAWMODE.FROM_PHOTO
RawModeCmBx.IsEnabled = True
RawModeDamagedCmBx.Visibility = Visibility.Collapsed
@@ -992,6 +1080,11 @@ Public Class RawPartPageUC
DamagedAreaGpBx.Visibility = Windows.Visibility.Hidden
' Visualizzo bottoni foto
ConfirmPhotoBtn.Visibility = Windows.Visibility.Visible
If m_bEnableOtherRefTab Then
OtherRefTabChBx.IsEnabled = False
OtherRefTabBtn.IsEnabled = False
EgtEmptyGroup(m_nOtherRefTabLay)
End If
Case RAWMODE.DAMAGED_BY_LASER
RawModeCmBx.IsEnabled = True
RawModeDamagedCmBx.Visibility = Visibility.Visible
@@ -1008,6 +1101,11 @@ Public Class RawPartPageUC
' Disattivo bottoni zone rovinate e foto
DamagedAreaGpBx.Visibility = Windows.Visibility.Hidden
ConfirmPhotoBtn.Visibility = Windows.Visibility.Hidden
If m_bEnableOtherRefTab Then
OtherRefTabChBx.IsEnabled = False
OtherRefTabBtn.IsEnabled = False
EgtEmptyGroup(m_nOtherRefTabLay)
End If
Case RAWMODE.DAMAGED_BY_SAW
RawModeCmBx.IsEnabled = True
RawModeDamagedCmBx.Visibility = Visibility.Visible
@@ -1024,6 +1122,11 @@ Public Class RawPartPageUC
' Disattivo bottoni zone rovinate e foto
DamagedAreaGpBx.Visibility = Windows.Visibility.Hidden
ConfirmPhotoBtn.Visibility = Windows.Visibility.Hidden
If m_bEnableOtherRefTab Then
OtherRefTabChBx.IsEnabled = False
OtherRefTabBtn.IsEnabled = False
EgtEmptyGroup(m_nOtherRefTabLay)
End If
Case RAWMODE.FROM_SAW
RawModeCmBx.IsEnabled = True
RawModeDamagedCmBx.Visibility = Visibility.Collapsed
@@ -1040,11 +1143,26 @@ Public Class RawPartPageUC
' Disattivo bottoni zone rovinate e foto
DamagedAreaGpBx.Visibility = Windows.Visibility.Hidden
ConfirmPhotoBtn.Visibility = Windows.Visibility.Hidden
If m_bEnableOtherRefTab Then
OtherRefTabChBx.IsEnabled = False
OtherRefTabBtn.IsEnabled = False
EgtEmptyGroup(m_nOtherRefTabLay)
End If
End Select
' se abilitato nuovo riferimento del grezzo disabilito le text per offset
If OtherRefTabChBx.IsChecked Then
OffsetXTxBx.IsEnabled = False
OffsetYTxBx.IsEnabled = False
End If
End Sub
Private Sub OutlineBtn_Click(sender As Object, e As RoutedEventArgs) Handles OutlineBtn.Click
If m_ActiveRawMode = RAWMODE.DAMAGED Or m_ActiveRawMode = RAWMODE.DAMAGED_BY_LASER Or m_ActiveRawMode = RAWMODE.DAMAGED_BY_SAW Then
If m_bEnableOtherRefTab Then
OtherRefTabTxBl.Visibility = Visibility.Visible
OtherRefTabBtn.Visibility = Visibility.Visible
OtherRefTabChBx.Visibility = Visibility.Visible
End If
' m_ActiveRawMode = RAWMODE.BY_POINTS
m_ActiveRawMode = m_PrecActiveRawMode
RawModeCmBx.SelectedIndex = m_ActiveRawMode
@@ -1055,6 +1173,12 @@ Public Class RawPartPageUC
End Sub
Private Sub DamagedBtn_Click(sender As Object, e As RoutedEventArgs) Handles DamagedBtn.Click
If m_bEnableOtherRefTab Then
OtherRefTabTxBl.Visibility = Visibility.Hidden
OtherRefTabBtn.Visibility = Visibility.Hidden
OtherRefTabChBx.Visibility = Visibility.Hidden
OtherRefTabBtn.IsEnabled = False
End If
m_PrecActiveRawMode = m_ActiveRawMode
If m_PrecActiveRawMode = RAWMODE.FROM_LASER Then
m_ActiveRawMode = RAWMODE.DAMAGED_BY_LASER
@@ -1843,6 +1967,7 @@ Public Class RawPartPageUC
WidthTxBx.Text = LenToString(m_RawWidth, 2)
m_CurrProjPage.SetErrorMessage(EgtMsg(MSG_RAWPARTPAGEUC + 17) & " " & LenToString(dMaxWidth, 2)) 'Massima larghezza =
End If
RefTabModeChange()
End Sub
Private Sub HeightTxBx_EgtClosed(sender As Object, e As EventArgs) Handles HeightTxBx.EgtClosed
@@ -1872,6 +1997,7 @@ Public Class RawPartPageUC
HeightTxBx.Text = LenToString(m_RawHeight, 3)
m_CurrProjPage.SetErrorMessage(EgtMsg(MSG_RAWPARTPAGEUC + 18)) 'Non sono ammessi spessori negativi
End If
RefTabModeChange()
End Sub
Private Sub OffsetXTxBx_EgtClosed(sender As Object, e As EventArgs) Handles OffsetXTxBx.EgtClosed
@@ -1918,6 +2044,108 @@ Public Class RawPartPageUC
End If
End Sub
#Region "OTHERREFTAB"
Private Sub OtherRefTabChBx_Click(sender As Object, e As EventArgs) Handles OtherRefTabChBx.Click
If OtherRefTabChBx.IsChecked Then
m_bOtherRefTab = True
MoveRawToOtherRefTab()
Else
m_bOtherRefTab = False
'MoveRawToMaiRefTab()
End If
UpdateOffsetText()
RawModeView()
WritePrivateProfileString(S_RAWPART, K_OTHERREFTAB, If(m_bOtherRefTab, "1", "0"), m_MainWindow.GetIniFile())
End Sub
Public Sub RefTabModeChange()
MoveRawToMaiRefTab()
MoveRawToOtherRefTab()
UpdateRefTabDraw()
UpdateOffsetText()
End Sub
Public Sub UpdateRefTabDraw()
' Rimuovo eventuali crocette create acquisendo i punti nel disegno
EgtEmptyGroup(m_nOtherRefTabLay)
' Acquisisco punto da disegno
m_OtherRefTabPoint = New Point3d(m_ptTableMin.x + m_OtherRefTabX, m_ptTableMin.y + m_OtherRefTabY, m_ptTableMin.z + 0.15)
CreateOtherRefTab(m_nOtherRefTabLay, m_OtherRefTabPoint)
EgtDraw()
End Sub
Private Sub UpdateOffsetText()
Dim ptRawMin, ptRawMax As Point3d
Dim dInvertKerf As Double = 1
If GetRawBox(ptRawMin, ptRawMax) Then
' kerf
EgtGetInfo(EgtGetFirstRawPart(), KEY_KERF, m_RawKerf)
' verifico se il kerf è negativo
EgtGetInfo(EgtGetFirstRawPart(), KEY_INVERT_KERF, dInvertKerf)
' aggiorno dati grezzo
If dInvertKerf < 0 Then
m_RawOffsX = ptRawMin.x - m_ptTableMin.x
m_RawOffsY = ptRawMin.y - m_ptTableMin.y
Else
m_RawOffsX = ptRawMin.x - m_ptTableMin.x + m_RawKerf * dInvertKerf
m_RawOffsY = ptRawMin.y - m_ptTableMin.y + m_RawKerf * dInvertKerf
End If
OffsetXTxBx.Text = LenToString(m_RawOffsX, 2)
OffsetYTxBx.Text = LenToString(m_RawOffsY, 2)
End If
End Sub
Private Sub MoveRawToOtherRefTab()
Dim dKerf As Double = 0
StringToLen(KerfTxBx.Text, dKerf)
Select Case m_OtherRefTabPos
Case OTHERREFMODE.BL
m_RawOffsX = m_OtherRefTabX + If((dKerf < 0), -dKerf, dKerf)
m_RawOffsY = m_OtherRefTabY + If((dKerf < 0), -dKerf, dKerf)
Case OTHERREFMODE.BR
m_RawOffsX = m_OtherRefTabX - m_RawLength - If((dKerf < 0), -dKerf, dKerf)
m_RawOffsY = m_OtherRefTabY + If((dKerf < 0), -dKerf, dKerf)
Case OTHERREFMODE.TR
m_RawOffsX = m_OtherRefTabX - m_RawLength - If((dKerf < 0), -dKerf, dKerf)
m_RawOffsY = m_OtherRefTabY - m_RawWidth - If((dKerf < 0), -dKerf, dKerf)
Case OTHERREFMODE.TL
m_RawOffsX = m_OtherRefTabX + If((dKerf < 0), -dKerf, dKerf)
m_RawOffsY = m_OtherRefTabY - m_RawWidth - If((dKerf < 0), -dKerf, dKerf)
Case Else
End Select
UpdateRawPart()
End Sub
Private Sub MoveRawToMaiRefTab()
Dim dKerf As Double = 0
StringToLen(KerfTxBx.Text, dKerf)
Select Case m_OtherRefTabPos
Case OTHERREFMODE.BR
m_RawOffsX = If((dKerf < 0), 0, dKerf)
m_RawOffsY = If((dKerf < 0), 0, dKerf)
Case OTHERREFMODE.BL
m_RawOffsX = If((dKerf < 0), 0, dKerf)
m_RawOffsY = If((dKerf < 0), 0, dKerf)
Case OTHERREFMODE.TL
m_RawOffsX = If((dKerf < 0), 0, dKerf)
m_RawOffsY = If((dKerf < 0), 0, dKerf)
Case OTHERREFMODE.TR
m_RawOffsX = If((dKerf < 0), 0, dKerf)
m_RawOffsY = If((dKerf < 0), 0, dKerf)
Case Else
End Select
UpdateRawPart()
End Sub
Private Sub OtherRefTabBtn_Click(sender As Object, e As EventArgs) Handles OtherRefTabBtn.Click
' apro la finestra per gestire il riferimento
Dim OthWD As New OtherRefTabWD(m_MainWindow, LenToString(m_OtherRefTabX, 2), LenToString(m_OtherRefTabY, 2), m_RawOffsX, m_RawOffsY, m_OtherRefTabPos)
OthWD.ShowDialog()
End Sub
#End Region ' OtherRefTab
Private Sub KerfTxBx_EgtClosed(sender As Object, e As EventArgs) Handles KerfTxBx.EgtClosed
Dim dKerf As Double
If Not StringToLen(KerfTxBx.Text, dKerf) Then
@@ -1960,6 +2188,8 @@ Public Class RawPartPageUC
Else
CreateRawFromPhotoContour()
End If
' Forzo il riposizionamento del grezzo
RefTabModeChange()
' Ridisegno
EgtDraw()
ElseIf dKerf >= dMinKerf And dKerf < 0 Then
@@ -2022,6 +2252,8 @@ Public Class RawPartPageUC
Else
CreateRawFromPhotoContour()
End If
' Forzo il riposizionamento del grezzo
RefTabModeChange()
' Ridisegno
EgtDraw()
ElseIf dKerf < dMinKerf Then
@@ -2267,6 +2499,7 @@ Public Class RawPartPageUC
Private Sub RawPartPage_Unloaded(sender As Object, e As RoutedEventArgs)
' Rimuovo layer temporaneo per crocette
EgtErase(m_nTempLay)
EgtErase(m_nOtherRefTabLay)
' Dichiaro pagina non attiva
m_bActive = False
End Sub
@@ -2582,4 +2815,44 @@ Public Class RawPartPageUC
Return True
End Function
Private Function CreateOtherRefTab(nLayerId As Integer, ptP As Point3d) As Boolean
EgtEmptyGroup(m_nOtherRefTabLay)
If Not m_bOtherRefTab Or Not OtherRefTabChBx.IsEnabled Then
EgtDraw()
Return False
End If
If File.Exists(m_MainWindow.GetResourcesDir() & "\" & "RefTabBL.nge") Then
' Aggiungo disegno staffa fermo pezzo
EgtInsertFile(m_MainWindow.GetResourcesDir() & "\" & "RefTabBL.nge")
Dim nLastPart As Integer = EgtGetLastPart()
Dim Lay As Integer = EgtGetFirstInGroup(nLastPart)
Dim Ent As Integer = EgtGetFirstInGroup(Lay)
While Ent <> -1
Dim NextEnt As Integer = EgtGetNext(Ent)
EgtRelocate(Ent, nLayerId)
EgtMove(Ent, ptP - Point3d.ORIG)
EgtRotate(Ent, ptP, Vector3d.Z_AX, 90 * m_OtherRefTabPos)
Ent = NextEnt
End While
EgtErase(nLastPart)
Else
' Aggiungo crocette
ptP += New Vector3d(0, 0, 0.15)
Dim vtCrossX As New Vector3d(100, 0, 0)
Dim vtCrossY As New Vector3d(0, 100, 0)
Dim vtCrossZ As New Vector3d(0, 0, 100)
Dim nCrossId1 = EgtCreateLine(nLayerId, ptP, ptP + vtCrossX)
EgtSetColor(nCrossId1, New Color3d(245, 0, 0))
Dim nCrossId2 = EgtCreateLine(nLayerId, ptP, ptP + vtCrossY)
EgtSetColor(nCrossId2, New Color3d(0, 245, 0))
Dim nCrossId3 = EgtCreateLine(nLayerId, ptP, ptP + vtCrossZ)
EgtSetColor(nCrossId3, New Color3d(0, 0, 245))
End If
EgtDraw()
'EgtSaveFile("C:\EgtData\OmagCUT\Temp\MyTest.nge", NGE.BIN)
Return True
End Function
End Class
Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

+51 -26
View File
@@ -4,6 +4,7 @@ Imports System.Collections.ObjectModel
Imports System.Runtime.InteropServices
Imports EgtUILib
Imports EgtWPFLib
Imports OmagCUT.VeinMatchingWindow
Public Class VeinMatchingWindow
@@ -19,6 +20,11 @@ Public Class VeinMatchingWindow
Private m_nIdToSel As Integer = GDB_ID.NULL
Private m_nIdToDesel As Integer = GDB_ID.NULL
Enum ALETTE
F = 2
A = 1
End Enum
Private Sub Window_Initialized(sender As Object, e As EventArgs)
' Assegnazione scena all'host e posizionamento nella PlacePageGrid
VeinMatchingSceneHost.Child = VeinMatchingScene
@@ -267,7 +273,7 @@ Friend Module VeinMatching
Dim nRegId As Integer = EgtGetFirstInGroup(nRegLayId)
While nRegId <> GDB_ID.NULL
If EgtGetType(nRegId) = GDB_TY.SRF_FRGN Then
Exit While
Exit While
End If
nRegId = EgtGetNext(nRegId)
End While
@@ -364,19 +370,21 @@ Friend Module VeinMatching
' Imposto il contesto del progetto
EgtSetCurrentContext(m_MainWindow.m_CurrentProjectPageUC.CurrentProjectScene.GetCtx())
' Riattivo il gruppo di lavoro
EgtSetCurrMachGroup( EgtGetFirstMachGroup())
EgtSetCurrMachGroup(EgtGetFirstMachGroup())
' Verifico quali pezzi sono nel grezzo, per dichiararlo al VM
nId = EgtGetFirstPartInRawPart( CamAuto.GetCurrentRaw())
nId = EgtGetFirstPartInRawPart(CamAuto.GetCurrentRaw())
While nId <> GDB_ID.NULL
' Dichiaro pezzo nel grezzo per VM
VeinMatching.OnInsertPartInRaw( nId)
VeinMatching.OnInsertPartInRaw(nId)
' Passo al pezzo successivo
nId = EgtGetNextPartInRawPart(nId)
End While
' Ripristino visualizzazione di eventuali pezzi in parcheggio
ShowParkedParts()
' Ripristino il contesto corrente
EgtSetCurrentContext( nCurrCtx)
EgtSetCurrentContext(nCurrCtx)
' EgtSaveFile("C:\EgtData\OmagCUT\Temp\MyVeinMatch.nge", NGE.TEXT)
Return True
End Function
@@ -422,11 +430,11 @@ Friend Module VeinMatching
nCurrId = EgtGetFirstNameInGroup(nVeinId2, NAME_PREVIEW)
EgtSetStatus(nCurrId, GDB_ST.OFF)
' Se esiste OutLoop.orig OutLoop -> OutLoop.mach e OutLoop.orig -> OutLoop
Dim nOutLoopOrig As Integer = EgtGetFirstNameInGroup( nVeinId2, NAME_OUTLOOP & ".orig")
Dim nOutLoopOrig As Integer = EgtGetFirstNameInGroup(nVeinId2, NAME_OUTLOOP & ".orig")
If nOutLoopOrig <> GDB_ID.NULL Then
Dim nOutLoop As Integer = EgtGetFirstNameInGroup( nVeinId2, NAME_OUTLOOP)
EgtSetName( nOutLoop, NAME_OUTLOOP & ".mach")
EgtSetName( nOutLoopOrig, NAME_OUTLOOP)
Dim nOutLoop As Integer = EgtGetFirstNameInGroup(nVeinId2, NAME_OUTLOOP)
EgtSetName(nOutLoop, NAME_OUTLOOP & ".mach")
EgtSetName(nOutLoopOrig, NAME_OUTLOOP)
End If
' Se necessario, ripristino il contesto originale
If nCurrCtx > 0 Then EgtSetCurrentContext(nCurrCtx)
@@ -555,8 +563,8 @@ Friend Module VeinMatching
' Se richiesto, eseguo deselezione
If bDeselect Then EgtDeselectObj(nId)
End If
EgtDraw()
End If
EgtDraw()
EgtSetCurrentContext(nMainCtx)
Return True
End Function
@@ -1039,37 +1047,44 @@ Friend Module VeinMatching
End Function
Friend Function MoveAlettaSolid(ByRef Item As Aletta, ByRef ThicknessRaw As Double) As Boolean
' A: alzatina, F: frontalino
Dim nType As Integer
If Not EgtGetInfo(Item.IdSideRef, "AF", nType) Then Return False
Dim ptSRef, ptERef, ptE As Point3d
Dim ptSRef, ptERef, ptS, ptE As Point3d
' Piano cucina
If Not EgtStartPoint(Item.IdSideRef, GDB_ID.ROOT, ptSRef) Then Return False
If Not EgtEndPoint(Item.IdSideRef, GDB_ID.ROOT, ptERef) Then Return False
' AlzFront
If Not EgtStartPoint(Item.SideId, GDB_ID.ROOT, ptS) Then Return False
If Not EgtEndPoint(Item.SideId, GDB_ID.ROOT, ptE) Then Return False
' vettore lato cucina
Dim vtRotRef As Vector3d = ptERef - ptSRef
' vettore lato AlzFront
Dim vtRot As Vector3d = ptE - ptS
' ruoto il solido intorno al lato di riferimento
Dim vtRot As Vector3d = ptERef - ptSRef
If nType = 1 Then
EgtRotate(Item.PartId, ptE, vtRot, -90, GDB_RT.GLOB)
ElseIf nType = 2 Then
If nType = ALETTE.A Then
EgtRotate(Item.PartId, ptE, vtRot, 90, GDB_RT.GLOB)
ElseIf nType = ALETTE.F Then
EgtRotate(Item.PartId, ptE, vtRot, -90, GDB_RT.GLOB)
End If
' punto di riferimento per la traslazione sul solido
Dim ptSolid As Point3d
If nType = 1 Then
If nType = ALETTE.A Then
' cerco id della curva che definisce la front face
Dim nSolidGrp As Integer = EgtGetFirstNameInGroup(Item.PartId, NAME_VM_SOLID)
Dim nFrontCrvId As Integer = EgtGetFirstInGroup(nSolidGrp)
EgtStartPoint(nFrontCrvId, ptSolid)
ElseIf nType = 2 Then
EgtStartPoint(Item.SideId, ptSolid)
EgtStartPoint(nFrontCrvId, GDB_ID.ROOT, ptSolid)
ElseIf nType = ALETTE.F Then
EgtStartPoint(Item.SideId, GDB_ID.ROOT, ptSolid)
End If
Dim ItemFrame As New Frame3d
If Not EgtGetGroupGlobFrame(Item.PartId, ItemFrame) Then Return False
ptSolid.ToGlob(ItemFrame)
' Dim ItemFrame As New Frame3d
' If Not EgtGetGroupGlobFrame(Item.PartId, ItemFrame) Then Return False
' ptSolid.ToGlob(ItemFrame)
'punto di riferimento per la traslazione sul piano cucina
Dim ptKitchen As Point3d = ptERef
@@ -1077,6 +1092,16 @@ Friend Module VeinMatching
Dim vtMove As Vector3d = ptKitchen - ptSolid
EgtMove(Item.PartId, vtMove, GDB_RT.GLOB)
' eventualmente ruoto per allineare l'alzatina al piano cucina
Dim dLRef, dAngVRef, dAngHRef As Double
vtRotRef.ToSpherical(dLRef, dAngVRef, dAngHRef)
Dim dL, dAngV, dAngH As Double
vtRot.Rotate(Vector3d.Z_AX, 180)
vtRot.ToSpherical(dL, dAngV, dAngH)
Dim dDelta As Double = dAngHRef - dAngH
If Math.Abs(dDelta) < EPS_ANG_SMALL Then Return True
EgtRotate(Item.PartId, ptKitchen, Vector3d.Z_AX, dDelta, GDB_RT.GLOB)
Return True
End Function
@@ -1206,7 +1231,7 @@ Friend Module VeinMatching
' Se necessario, cambio contesto
If m_nVeinCtx <> nCurrCtx Then
If EgtSetCurrentContext(m_nVeinCtx) Then
Return If( nCurrCtx > 0, nCurrCtx, -2)
Return If(nCurrCtx > 0, nCurrCtx, -2)
Else
Return 0
End If
@@ -1268,7 +1293,7 @@ Friend Module VeinMatching
While nId <> GDB_ID.NULL
Dim nOriId As Integer
If EgtGetInfo(nId, KEY_ORI_ID, nOriId) AndAlso nOriId = nPartId Then
Exit While
Exit While
End If
nId = EgtGetNextPart(nId)
End While