Compare commits

..

22 Commits

Author SHA1 Message Date
Nicola Pievani c475f7dc12 Miglioramento gestione scarico frontale 2023-05-23 15:13:41 +02:00
Nicola Pievani 0151cd8f9e Eliminazio grezzi non appartenetent alla fase 1 comando Reset 2023-05-03 10:02:17 +02:00
Nicola Pievani 75e3729216 Merge branch 'develop' into Features/New_Front_Unloading 2023-05-02 17:57:33 +02:00
Nicola Pievani 959fb2e44f Aggiornamento versione 2.5d3 2023-04-28 12:43:13 +02:00
Nicola Pievani 59e3ae5841 Aggiornamento versione 2.5d3 2023-04-28 12:41:44 +02:00
Nicola Pievani 941e7837be Aggiunta variabile DripFeed al CN_generico per NumOld 2023-04-28 12:16:28 +02:00
Nicola Pievani 58de5d4077 Gestione scarico+movimento/movimento+scarico 2023-04-28 11:01:12 +02:00
Nicola Pievani b6beef668d Unificato fase di Moviment e Scarico (deve essere gestito l'inverso) 2023-04-27 17:42:08 +02:00
Nicola Pievani 680505af10 Merge branch 'Features/CN_Fanuc' into develop 2023-04-19 16:44:38 +02:00
Nicola Pievani b0bfa67d2a Aggiornamento assi macchina in taglio singolo 2023-04-19 16:44:04 +02:00
Nicola Pievani 29d8c1e29b Nascondo pezzi in parcheggio dopo ripristino fase 1 2023-04-19 13:20:45 +02:00
Nicola Pievani e5d4f223f8 Gestione generazione CN durante simulazione 2023-04-18 18:08:03 +02:00
Nicola Pievani 3cfc7276c9 Gestione scrittura valore FeedHold letto da configurazione 2023-04-18 15:53:28 +02:00
Nicola Pievani 0c0233b27e Correzione generazione CN in simulazione 2023-04-18 15:12:07 +02:00
Nicola Pievani 4e8925515d Corretto il valore di ritorno di alcune funzioni 2023-04-18 12:37:42 +02:00
Nicola Pievani 3b552b2f4e Disabilito inversione tagli diretti 2023-04-17 18:27:38 +02:00
Nicola Pievani 3fae33404b Gestione navigazione Split Phase 2023-04-17 15:58:52 +02:00
Nicola Pievani 0d4d853834 Salvataggio nelle info progetto C axes home 2023-04-13 15:13:08 +02:00
Nicola Pievani 37fcbe8240 Aggiornato disegno ToolChangerPos 2023-04-13 11:14:27 +02:00
Nicola Pievani 07d8145d57 Iniziata gestione navigazione all'interno delle fasi 2023-03-20 20:15:31 +01:00
Nicola Pievani 8d363b8b06 Inizio creazione nuova fase scarico durante lavorazioni 2023-03-17 18:20:27 +01:00
Nicola Pievani 0eaebd5aad Inserito comando per passare alla pagina di scarico frontale 2023-03-08 11:49:52 +01:00
24 changed files with 703 additions and 299 deletions
+19 -2
View File
@@ -1,4 +1,5 @@
Imports EgtUILib
Imports System.Windows.Forms.Integration
Imports EgtUILib
Friend Module CamAuto
@@ -29,7 +30,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)
@@ -163,6 +164,22 @@ 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)
+123 -120
View File
@@ -7,164 +7,167 @@
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">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="4*"/>
<ColumnDefinition Width="8*"/>
</Grid.ColumnDefinitions>
<!--Griglia per oscurare i bottoni della pagina sottostante-->
<Grid Background="{DynamicResource OmagCut_Gray}">
<!--Upper button grid-->
<Grid Grid.Column="1">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="4*"/>
<ColumnDefinition Width="8*"/>
</Grid.ColumnDefinitions>
<Button Name="PrevBtn" Grid.Column="0" Style="{DynamicResource OmagCut_YellowIconButton}">
<Image Source="{DynamicResource NumericKeyboardArrowImg}" Style="{StaticResource OmagCut_ButtonIcon}"/>
<!--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>
<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 Name="UpBtn" Grid.Column="1" Grid.Row="1"
Style="{DynamicResource OmagCut_TopGrayGradientYellowButton}">
<Image Source="{DynamicResource UpArrowImg}" Style="{StaticResource OmagCut_ArrowButtonIcon}"/>
</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"
<Button Name="TopRBtn" Grid.Column="2" Grid.Row="1"
Style="{DynamicResource OmagCut_TopGrayGradientYellowButton}">
<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"
<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>
<Button Name="RemovePartBtn" Grid.ColumnSpan="2" Grid.Row="6"
<!--Gestione sfridi-->
<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="0.5*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="0.5*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="10*"/>
</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>
+304 -72
View File
@@ -1,4 +1,5 @@
Imports EgtUILib
Imports System.Windows.Forms.Integration
Imports EgtUILib
Public Class MoveRawPartPage
' Riferimento alla MainWindow
@@ -35,12 +36,16 @@ 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
@@ -60,7 +65,12 @@ Public Class MoveRawPartPage
End If
' Deseleziono tutto
EgtDeselectAll()
' Recupero i tagli allungati prima definiti
' resetto variabili di navigazione nelle fasi
m_bPrev = False
m_bToNext = False
'---------------------------- CREATE NEW PHASE ----------------------------
' Recupero i tagli ABILITATI prima definiti
Dim Cuts(0) As Integer
m_SplitPage.GetEnabledCuts(Cuts)
' Fase precedente
@@ -69,11 +79,19 @@ 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
EgtSetCurrPhase(nPrevPhase + 1)
nPrevPhase = nPrevPhase + 1
EgtSetCurrPhase(nPrevPhase)
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"
@@ -101,14 +119,19 @@ Public Class MoveRawPartPage
End If
'---------------------------- SCRAPS ----------------------------
'---------------------------- AUX TABLE ----------------------------
' Se movimento pezzi finale, sistemazioni per tavolo ausiliario
If m_SplitPage.m_bOnAuxTab Then
' assegnazione delle info tavola ausiliaria alla dispozione corrente
If m_SplitPage.m_bOnAuxTab And m_SplitPage.m_bEnableOnAuxTab Then
' assegnazione delle info tavola ausiliaria alla dispozione corrente (Spostato nella funzione Refresh)
SetAuxTabInCurrDisposition()
UnloadPartsBtn.Content = "Go to MOVE part"
' altrimenti, aggiorno visualizzazione
Else
ElseIf Not m_SplitPage.m_bOnAuxTab And m_SplitPage.m_bEnableOnAuxTab Then
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
@@ -167,6 +190,30 @@ 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
@@ -222,12 +269,6 @@ 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()
@@ -292,12 +333,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
@@ -445,7 +486,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)
@@ -488,7 +529,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)
@@ -780,6 +821,33 @@ 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
@@ -821,16 +889,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 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 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
End Select
' Recupero il centro del grezzo
Dim ptRawCen As Point3d
@@ -1007,8 +1075,44 @@ 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
If m_RawMoveDataList.Count = 0 Then Return False
' 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
@@ -1017,8 +1121,9 @@ Public Class MoveRawPartPage
End If
Next
' verifico che la lista non sia vuota
If m_RawMoveDataList.Count = 0 Then Return
If m_RawMoveDataList.Count = 0 Then
Return False
End If
' recupero disposizione fase corrente
Dim nDispId As Integer = EgtGetPhaseDisposition(m_nCurrPhase)
' imposto la pausa nella disposizione corrente
@@ -1026,30 +1131,22 @@ 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_SplitPage.m_bOnAuxTab)
SaveMovePartsOnAuxTable(nDispId, m_IsCurrPhaseUnloaded)
' 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()
' 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
' Carico i grezzi rimasti sulla tavola nella nuova fase
ChangePhaseRawPart(nNewPhase)
' Sposto le lavorazioni rimaste nella nuova fase
ChangeOperationPhase(nNewPhase)
Dim nCurrDisposition As Integer = EgtGetPhaseDisposition(nNewPhase)
'SetPause(nCurrDisposition)
@@ -1060,8 +1157,43 @@ 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
@@ -1077,6 +1209,8 @@ 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)
@@ -1109,6 +1243,14 @@ 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
@@ -1139,18 +1281,52 @@ Public Class MoveRawPartPage
Return
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
' ------- 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
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
@@ -1193,7 +1369,7 @@ Public Class MoveRawPartPage
' disabilito bottone
ModifyBtn.IsEnabled = False
' gestione abilitazione altri bottoni
EnableButtons()
EnableButtons(MachiningList.Count > 0)
End Sub
' verifica se la disposizione indicata è uno scarico sulla tavola ausiliaria
@@ -1204,6 +1380,20 @@ 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
@@ -1216,7 +1406,7 @@ Public Class MoveRawPartPage
Return GDB_ID.NULL
End Function
Private Sub EnableButtons()
Private Sub EnableButtons(Optional bExistsMachining As Boolean = False)
UpBtn.IsEnabled = Not m_SplitPage.m_bShow
LeftBtn.IsEnabled = Not m_SplitPage.m_bShow
RightBtn.IsEnabled = Not m_SplitPage.m_bShow
@@ -1232,19 +1422,35 @@ 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
NextBtn.IsEnabled = Not m_SplitPage.m_bOnAuxTab
' 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
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)
If EgtIsOperationEmpty(nLastDispId) And m_SplitPage.m_bOnAuxTab And m_RawMoveDataList.Count = 0 Then
EgtErase(nLastDispId)
End If
'' 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
' Se movimento con ventose
If Not m_bByHand Then
@@ -1260,8 +1466,9 @@ Public Class MoveRawPartPage
SaveMoveInfoInDisposition(nDispId, m_RawMoveDataList)
' imposto eventuale presenza rimozioni manuali
SaveRemoveByHandInDisposition(nDispId, m_bRemovedRaw)
' imposto eventuale movimento pezzi su tavola ausiliaria
SaveMovePartsOnAuxTable(nDispId, m_SplitPage.m_bOnAuxTab)
' imposto eventuale movimento pezzi su tavola ausiliaria (se è realmente avvenuto)
'SaveMovePartsOnAuxTable(nDispId, m_SplitPage.m_bOnAuxTab)
SaveMovePartsOnAuxTable(nDispId, m_IsCurrPhaseUnloaded)
' Eseguo calcolo speciale dei movimenti
SpecialApplyDisposition(nDispId, True, Not m_SplitPage.m_bOnAuxTab)
End If
@@ -1277,13 +1484,18 @@ 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()
EgtZoom(ZM.ALL, False)
If Not m_bPrev Then
' 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))
' Cancello eventuale manipolatore pezzi
EgtDisableModified()
RemoveVacuumCups()
@@ -1300,10 +1512,30 @@ 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
+63 -11
View File
@@ -1,4 +1,5 @@
Imports EgtUILib
Imports System.Windows.Forms.Integration
Imports EgtUILib
Public Module SplitAuto
@@ -132,7 +133,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
@@ -141,7 +142,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
@@ -156,7 +157,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
@@ -194,7 +195,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
@@ -219,11 +220,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
@@ -342,6 +343,7 @@ 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
@@ -393,10 +395,19 @@ 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
@@ -417,9 +428,50 @@ Public Module SplitAuto
End If
nId = nNextId
End While
Return True
End Function
End Sub
' 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
+45 -47
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
Private m_bEnableOnAuxTab As Boolean = False
Friend m_bEnableOnAuxTab As Boolean = False
' Stato
Private m_nCurrPhase As Integer = 0
Private m_MachiningList As New List(Of SplitMach)
@@ -49,6 +49,7 @@ 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
@@ -167,6 +168,7 @@ 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
@@ -180,7 +182,8 @@ Public Class SplitPageUC
End If
End Sub
Private Sub ShowMachiningList()
' preparo la lista delle lavorazioni da mostrare in interfaccia
Public Sub ShowMachiningList()
m_ItemList.Clear()
For i As Integer = 1 To m_MachiningList.Count()
Dim Mach As SplitMach = m_MachiningList(i - 1)
@@ -710,30 +713,8 @@ 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
@@ -827,6 +808,8 @@ 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
@@ -1780,15 +1763,26 @@ 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
EgtSetCurrPhase(EgtGetCurrPhase() - 1)
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
' Reimposto la precedente
SplitPageUC_Loaded(Nothing, Nothing)
'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
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
@@ -1910,7 +1904,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)
ExitSplit(Not m_bToNext And Not m_bToPrev)
EgtDraw()
End Sub
@@ -1929,22 +1923,7 @@ Public Class SplitPageUC
EgtEnableModified()
' se modificato salvo ordine e stato delle lavorazioni
If m_bModified Then
' 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()
SaveOrderMachinig(m_nCurrPhase)
End If
' Affondamento ridotto
Dim dReducedDepth As Double = GetPrivateProfileDouble(S_MACH_NEST, K_MACH_REDUCEDDEPTH, 1, m_MainWindow.GetMachIniFile())
@@ -1968,6 +1947,25 @@ 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
@@ -2032,7 +2030,7 @@ Public Class SplitPageUC
NextBtn.IsEnabled = (GetDisabledCutsCount() > 0 And GetSplitCutsCount() = 1)
' Altrimenti
Else
' movimento standard sulla tavola (almeno un taglio disabilitato)
' movimento standard sulla tavola (almeno un taglio disabilitato allora False)
Dim bStdTab As Boolean = (GetDisabledCutsCount() > 0)
' movimento su tavola di scarico
m_bOnAuxTab = Not bStdTab AndAlso (m_nCurrPhase = EgtGetPhaseCount() And m_bEnableOnAuxTab)
+2
View File
@@ -189,6 +189,8 @@ Module ConstGen
Public Const INFO_TOPRODAREA As String = "ToProdArea"
' Info per nome progetti
Public Const INFO_PROJNAME As String = "ProjName"
' Info per parcheggio asse C
Public Const INFO_CAXESHOME As String = "CAxesHome"
' Nome layer delle regioni
Public Const NAME_REGION As String = "Region"
+1
View File
@@ -332,6 +332,7 @@ Module ConstIni
Public Const K_DC_TEST_OFFSET As String = "TestOffset"
Public Const K_DC_OFFSET_SQUARING As String = "OffsetSquaring"
Public Const K_DC_EXTRA_LEN_SQUARING As String = "ExtraLenSquaring"
Public Const K_ENABLEINVERT As String = "EnableInvert"
Public Const S_STATDATA As String = "StatData"
Public Const K_SD_DAY As String = "Day"
+8 -6
View File
@@ -425,12 +425,14 @@ Public Class DirectCutPageUC
If m_bShowMachine Then
' aggiorno lo stato
Select Case m_nMachLook
Case MCH_LOOK.ALL
m_nMachLook = MCH_LOOK.TAB_HEAD
Case MCH_LOOK.TAB_HEAD
m_nMachLook = MCH_LOOK.TAB_TOOL
Case Else
m_nMachLook = MCH_LOOK.ALL
Case MCH_LOOK.ALL
m_nMachLook = MCH_LOOK.TAB_HEAD
Case MCH_LOOK.TAB_HEAD
m_nMachLook = MCH_LOOK.TAB_TOOL
Case MCH_LOOK.TAB_TOOL
m_nMachLook = MCH_LOOK.TAB
Case Else
m_nMachLook = MCH_LOOK.ALL
End Select
' aggiorno lo stato della macchina e la sua visualizzazione
EgtSetMachineLook(m_nMachLook)
+53 -20
View File
@@ -1,4 +1,5 @@
Imports EgtUILib
Imports System.Windows.Threading
Imports EgtUILib
Public Class SingleCutUC
@@ -43,6 +44,10 @@ Public Class SingleCutUC
Private Const MIN_CUT_LEN As Double = 10.0
Private Const MAX_SIDE_ANG As Double = 60.0
' Costanti che indicano la modalità di acquisizione dei punti
' Utilizzato per aggiornare la posizione della macchina
Private m_RefreshTimer As New DispatcherTimer
Private Enum PT_MODE As Integer
SAW = 0
LASER = 1
@@ -68,14 +73,14 @@ Public Class SingleCutUC
SimulBtn.ToolTip = EgtMsg(MSG_CADCUTPAGEUC + 1)
OkBtn.ToolTip = EgtMsg(MSG_DIRECTCUTPAGEUC + 30)
' Carico i dati dell'ultimo taglio
m_dDepth = GetPrivateProfileDouble( S_DIRECTCUTS, K_DC_SING_DEPTH, m_dDepth, m_MainWindow.GetIniFile())
m_dLen = GetPrivateProfileDouble( S_DIRECTCUTS, K_DC_SING_LENGTH, m_dLen, m_MainWindow.GetIniFile())
m_dAngO = GetPrivateProfileDouble( S_DIRECTCUTS, K_DC_SING_ANGH, m_dAngO, m_MainWindow.GetIniFile())
m_dAngV = GetPrivateProfileDouble( S_DIRECTCUTS, K_DC_SING_ANGV, m_dAngV, m_MainWindow.GetIniFile())
m_dDepth = GetPrivateProfileDouble(S_DIRECTCUTS, K_DC_SING_DEPTH, m_dDepth, m_MainWindow.GetIniFile())
m_dLen = GetPrivateProfileDouble(S_DIRECTCUTS, K_DC_SING_LENGTH, m_dLen, m_MainWindow.GetIniFile())
m_dAngO = GetPrivateProfileDouble(S_DIRECTCUTS, K_DC_SING_ANGH, m_dAngO, m_MainWindow.GetIniFile())
m_dAngV = GetPrivateProfileDouble(S_DIRECTCUTS, K_DC_SING_ANGV, m_dAngV, m_MainWindow.GetIniFile())
m_dOffset = GetPrivateProfileDouble(S_DIRECTCUTS, K_DC_SING_OFFSET, m_dOffset, m_MainWindow.GetIniFile())
m_bSawTh = (GetPrivateProfileInt(S_DIRECTCUTS, K_DC_SING_SAWTH, 0, m_MainWindow.GetIniFile()) <> 0)
m_ptTipP1.x = GetPrivateProfileDouble( S_DIRECTCUTS, K_DC_SING_POSX, m_ptTipP1.x, m_MainWindow.GetIniFile())
m_ptTipP1.y = GetPrivateProfileDouble( S_DIRECTCUTS, K_DC_SING_POSY, m_ptTipP1.y, m_MainWindow.GetIniFile())
m_ptTipP1.x = GetPrivateProfileDouble(S_DIRECTCUTS, K_DC_SING_POSX, m_ptTipP1.x, m_MainWindow.GetIniFile())
m_ptTipP1.y = GetPrivateProfileDouble(S_DIRECTCUTS, K_DC_SING_POSY, m_ptTipP1.y, m_MainWindow.GetIniFile())
End Sub
Private Sub SingleCut_Loaded(sender As Object, e As RoutedEventArgs) Handles Me.Loaded
@@ -92,6 +97,10 @@ Public Class SingleCutUC
m_MainWindow.m_DirectCutPageUC.m_bShowMachine = True
EgtSetMachineLook(m_MainWindow.m_DirectCutPageUC.m_nMachLook)
EgtDraw()
' riavvio il timer per visualizzare la poszione della macchina
If Not IsNothing(m_RefreshTimer) Then
m_RefreshTimer.Start()
End If
Return
End If
' Disabilito registrazione progetto modificato
@@ -114,7 +123,7 @@ Public Class SingleCutUC
m_bPointP1Ok = False
m_bPointP2Ok = False
' Inizializzo primo punto acquisito dal disegno
m_ptPrev = m_ptTipP1 + ( m_ptTabOri - Point3d.ORIG())
m_ptPrev = m_ptTipP1 + (m_ptTabOri - Point3d.ORIG())
m_ptPrev.z = m_ptRawMax.z
' Disegno crocetta che indica il punto acquisito
CreateCross(m_nTempLay, m_ptPrev)
@@ -138,21 +147,40 @@ Public Class SingleCutUC
' Deseleziono bottone primo punto
Point1Btn.IsChecked = False
' la visualizzazione dei comandi è gestira dalla DirectCutPageUC richiamando la funzione ReloadParam
' la visualizzazione dei comandi è gestita dalla DirectCutPageUC richiamando la funzione ReloadParam
' forzo la macchina ad essere visibile fin da subito
m_MainWindow.m_DirectCutPageUC.m_bShowMachine = True
m_MainWindow.m_DirectCutPageUC.m_nMachLook = MCH_LOOK.TAB
' Creo il timer il timer per aggiornare il posizionamento della macchina
AddHandler m_RefreshTimer.Tick, AddressOf RefreshTimer_tick
m_RefreshTimer.Interval = TimeSpan.FromMilliseconds(1000)
' Aggiorno visualizzazione
EgtDraw()
' Avvi il timer
m_RefreshTimer.Start()
End Sub
Private Sub RefreshTimer_tick()
' se è impostata la visualizzazione della sola tavola allora non aggiorno il disegno
If m_MainWindow.m_DirectCutPageUC.m_nMachLook = MCH_LOOK.TAB Then Return
' Aggiorno visualizzazione
SetMachineInCurrPos()
' Aggiorno il disegno
EgtDraw()
End Sub
Friend Sub SingleCut_Unloaded(sender As Object, e As RoutedEventArgs) Handles Me.Unloaded
' Salvo i dati correnti
WritePrivateProfileString( S_DIRECTCUTS, K_DC_SING_DEPTH, DoubleToString( m_dDepth, 2), m_MainWindow.GetIniFile())
WritePrivateProfileString( S_DIRECTCUTS, K_DC_SING_LENGTH, DoubleToString( m_dLen, 2), m_MainWindow.GetIniFile())
WritePrivateProfileString( S_DIRECTCUTS, K_DC_SING_ANGH, DoubleToString( m_dAngO, 2), m_MainWindow.GetIniFile())
WritePrivateProfileString( S_DIRECTCUTS, K_DC_SING_ANGV, DoubleToString( m_dAngV, 2), m_MainWindow.GetIniFile())
WritePrivateProfileString(S_DIRECTCUTS, K_DC_SING_DEPTH, DoubleToString(m_dDepth, 2), m_MainWindow.GetIniFile())
WritePrivateProfileString(S_DIRECTCUTS, K_DC_SING_LENGTH, DoubleToString(m_dLen, 2), m_MainWindow.GetIniFile())
WritePrivateProfileString(S_DIRECTCUTS, K_DC_SING_ANGH, DoubleToString(m_dAngO, 2), m_MainWindow.GetIniFile())
WritePrivateProfileString(S_DIRECTCUTS, K_DC_SING_ANGV, DoubleToString(m_dAngV, 2), m_MainWindow.GetIniFile())
WritePrivateProfileString(S_DIRECTCUTS, K_DC_SING_OFFSET, DoubleToString(m_dOffset, 2), m_MainWindow.GetIniFile())
WritePrivateProfileString(S_DIRECTCUTS, K_DC_SING_SAWTH, If(m_bSawTh, "1", "0"), m_MainWindow.GetIniFile())
WritePrivateProfileString( S_DIRECTCUTS, K_DC_SING_POSX, DoubleToString( m_ptTipP1.x, 2), m_MainWindow.GetIniFile())
WritePrivateProfileString(S_DIRECTCUTS, K_DC_SING_POSX, DoubleToString(m_ptTipP1.x, 2), m_MainWindow.GetIniFile())
WritePrivateProfileString(S_DIRECTCUTS, K_DC_SING_POSY, DoubleToString(m_ptTipP1.y, 2), m_MainWindow.GetIniFile())
' Se non vado in simulazione
If Not m_bSimul Then
@@ -171,6 +199,8 @@ Public Class SingleCutUC
EgtSetMachineLook(MCH_LOOK.TAB)
EgtDraw()
End If
' interrompo il Timer per aggiornare la visualizzazione del posizionamento macchina
m_RefreshTimer.Stop()
' Dichiaro pagina non attiva
m_bActive = False
End Sub
@@ -279,7 +309,7 @@ Public Class SingleCutUC
DirectionTxBx.Text = DoubleToString(m_dAngO - m_MainWindow.m_CurrentMachine.dDeltaC, 2)
SideAngleTxBx.Text = DoubleToString(m_dAngV, 2)
' Altrimenti punto da click di mouse
' Altrimenti punto da click di mouse
Else
' Assegno punto selezionato nel disegno a m_ptTipP1
m_ptTipP1 = m_ptPrev
@@ -298,6 +328,7 @@ Public Class SingleCutUC
m_MainWindow.m_DirectCutPageUC.m_bShowMachine = True
EgtSetMachineLook(m_MainWindow.m_DirectCutPageUC.m_nMachLook)
EgtDraw()
' Seleziono il bottone per indicare che il primo punto è stato acquisito
Point1Btn.IsChecked = True
' Abilito e deseleziono secondo punto
@@ -358,7 +389,7 @@ Public Class SingleCutUC
m_dAngV = 90 - dTAngV
SideAngleTxBx.Text = DoubleToString(m_dAngV, 2)
' Altrimenti punto da click di mouse
' Altrimenti punto da click di mouse
Else
' Assegno punto selezionato nel disegno a m_ptTipP2
m_ptTipP2 = m_ptPrev
@@ -476,7 +507,7 @@ Public Class SingleCutUC
EgtDraw()
End Sub
Private Sub SawThick_Click( sender As Object, e As RoutedEventArgs) Handles SawThChBx.Click
Private Sub SawThick_Click(sender As Object, e As RoutedEventArgs) Handles SawThChBx.Click
' Recupero lo stato di check
m_bSawTh = SawThChBx.IsChecked()
' Disegno il taglio
@@ -536,9 +567,9 @@ Public Class SingleCutUC
m_CurrProjPage.SetWarningMessage( "Trial Version")
#Else
' Verifico non sia versione Ufficio
If m_MainWindow.GetKeyOption( MainWindow.KEY_OPT.OFFICE_TYPE) Then
m_CurrProjPage.SetWarningMessage( "Office Version")
Return
If m_MainWindow.GetKeyOption(MainWindow.KEY_OPT.OFFICE_TYPE) Then
m_CurrProjPage.SetWarningMessage("Office Version")
Return
End If
' Verifico ci sia un taglio valido
If Not m_bCutOk Then Return
@@ -610,6 +641,8 @@ Public Class SingleCutUC
' Imposto affondamento e angolo di fianco sul taglio
EgtSetInfo(nCutId, INFO_DEPTH, m_dDepth)
EgtSetInfo(nCutId, INFO_SIDE_ANGLE, m_dAngV)
' Imposto se disabilitare l'inversine di direzione del taglio
If Not m_MainWindow.m_CurrentMachine.bEnableInvert Then EgtSetInfo(nCutId, INFO_ENABLE_INVERT, 0)
' Creo layer per crocetta di riferimento
Dim nCrossLayerId = EgtCreateGroup(nPartId)
' Aggiungo crocetta/e
+13
View File
@@ -77,6 +77,9 @@ Public Class CurrentMachine
Private m_bPolishingWheel As Boolean = False
Private m_bWaterJet As Boolean = False
' Flag che indica se gesire l'inversione del taglio nei tagli singoli
Private m_bEnableInvetrt As Boolean = True
' Abilitazione DB WaterJet
Private m_bFromDBWaterJet As Boolean = False
@@ -752,6 +755,12 @@ Public Class CurrentMachine
End Get
End Property
Friend ReadOnly Property bEnableInvert As Boolean
Get
Return m_bEnableInvetrt
End Get
End Property
Friend Property dAdditionalTable As Double
Get
Select Case GetCurrentTable()
@@ -1200,6 +1209,8 @@ Public Class CurrentMachine
m_MainWindow.GetKeyOption(MainWindow.KEY_OPT.ENABLE_WJ)
' possibilità di definire attacco speciale per materiali ceramici
m_bSawingSpecialLeadIn = (GetPrivateProfileInt(S_MACHININGS, K_SAWINGSPECIALLEADIN, 0, sMachIniFile) > 0)
' mantengo la direzione del taglio definita nel taglio diretto
m_bEnableInvetrt = (GetPrivateProfileInt(S_DIRECTCUTS, K_ENABLEINVERT, 1, sMachIniFile) <> 0)
' Leggo utensili correnti
' lama
@@ -1370,6 +1381,8 @@ Public Class CurrentMachine
CN.n_num_var_int_to_read = CShort(GetPrivateProfileInt(S_NCFANUC, K_NUMVARINT, CInt(CN.n_num_var_int_to_read), sMachIniFile))
' Leggo numero di varibili di tipo bit
CN.n_num_var_byte_for_bits_to_read = CShort(GetPrivateProfileInt(S_NCFANUC, K_NUMVARBIT, CInt(CN.n_num_var_byte_for_bits_to_read), sMachIniFile))
' Leggo variabile abilitata alla gestione di FeedHold
GetPrivateProfileString(S_NCFANUC, K_SETNCMODE, CN.s_addr_feedhold, CN.s_addr_feedhold, sMachIniFile)
End Sub
Public Sub LoadWJMaterial(Optional bIsStart As Boolean = False)
+1 -1
View File
@@ -62,7 +62,7 @@
<ColumnDefinition Width="2*"/>
</Grid.ColumnDefinitions>
<Button Name="StartBtn" Style="{DynamicResource OmagCut_RightGrayGradientYellowTextButton}"/>
<Button Name="StartBtn" Style="{DynamicResource OmagCut_RightGrayGradientYellowTextButton}"/>
<Button Name="StopBtn" Grid.Column="1"
Style="{DynamicResource OmagCut_RightGrayGradientYellowTextButton}"/>
<Button Name="ResetBtn" Grid.Column="2"
+2 -2
View File
@@ -9,7 +9,7 @@
<!-- Definizione del ToolHolderUc -->
<Grid>
<Image Source="/Resources/ToolChangerPos.png"/>
<ToggleButton Name="Tool" Width="50" Height="50" Margin="22,40,26,8" Background="#7FB4B4B4">
<ToggleButton Name="Tool" Width="50" Height="50" Margin="62,10,16,10" Background="#7FB4B4B4">
<ToggleButton.Template>
<ControlTemplate TargetType="{x:Type ToggleButton}">
<Grid>
@@ -25,7 +25,7 @@
</ToggleButton.Template>
</ToggleButton>
<TextBlock Name="PositionNameTxBl" Height="22" Width="68" FontSize="16" Margin="12,16,41,61"/>
<TextBlock Name="PositionNameTxBl" Height="22" Width="50" FontSize="16" Margin="20,40,70,53"/>
</Grid>
</UserControl>
+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.2")>
<Assembly: AssemblyFileVersion("2.5.4.2")>
<Assembly: AssemblyVersion("2.5.4.3")>
<Assembly: AssemblyFileVersion("2.5.4.3")>
+1 -2
View File
@@ -2,7 +2,6 @@
Imports System.Globalization
Imports System.Collections.ObjectModel
Imports EgtUILib
Imports OmagCUT.Num
Imports System.IO
Imports System.Text
@@ -1194,7 +1193,7 @@ Public Class CNCommunication
End If
EgtOutLog("Nc Type : " & m_nNCType.ToString)
' AXIUM (NUM OLD): se DripFeed non esegluo attivazione programma)
If m_nNCType = 1 AndAlso TypeOf m_CN Is NumNCOld AndAlso DirectCast(m_CN, NumNCOld).bIsDripFeed Then
If m_nNCType = 1 AndAlso m_CN.bIsDripFeed Then
' eventauli cambi di stato sono trattati all'interno della funzione DownLoad_NC_prog
Return True
End If
+4
View File
@@ -228,6 +228,9 @@ Public MustInherit Class CN_generico
Public bRemote As Boolean
' Nuovi di bottoni -------------------------------------------
' solo per NumOld
Public bIsDripFeed As Boolean = False
' usato nel FANUC per leggere lo stato macchina se 5 assi attivo
Public b5AxesActive As Boolean
@@ -242,6 +245,7 @@ Public MustInherit Class CN_generico
Public n_num_var_int_to_read As Short = 10
Public n_num_var_byte_for_bits_to_read As Short = 30
Public s_addr_set_nc_mode As String = "D59825"
Public s_addr_feedhold As String = "D59850.6"
'
' Eventi
'
+9 -1
View File
@@ -225,8 +225,11 @@ Namespace Fanuc
Dim nret As Int16 = -1
If NC_pulse_bit(s_addr_feedhold) Then
nret = 0
End If
'nret = StopNC(n_portNC)
Return nret
End Function
@@ -947,6 +950,8 @@ Namespace Fanuc
MyBase.OnNewPosDeltaData()
End If
Return 0
End Function
#End Region
@@ -1275,6 +1280,9 @@ Namespace Fanuc
Case "D"
Return PMCAreaType.D_AREA
Case Else
Return -1
End Select
End Function
+1 -4
View File
@@ -12,16 +12,13 @@ Imports EgtUILib
Imports System.IO
Imports System.Threading
Imports System.Windows.Threading
Imports System.Reflection.Emit
Imports System.Drawing.Text
Imports OmagCUT.CN_Siemens
Namespace Num
Public Class NumNCOld
Inherits CN_generico
Public bIsDripFeed As Boolean = False
'Public bIsDripFeed As Boolean = False
' costruisco il riferimento alla pagina principale
Private m_MainWindow As MainWindow = DirectCast(Application.Current.MainWindow, MainWindow)
' costruisco il riferimento alla barra ProjectMng
+4 -1
View File
@@ -901,7 +901,7 @@
<Resource Include="Resources\MachineStatusImage\Single.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\ToolChangerPos.png" />
<Resource Include="Resources\ToolChangerPos_OLD.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\Manual.png" />
@@ -1327,6 +1327,9 @@
<ItemGroup>
<Resource Include="Resources\NewIcons\Quality.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\ToolChangerPos.png" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />
<PropertyGroup>
<PostBuildEvent>IF "$(PlatformName)"=="x86" IF "$(ConfigurationName)" == "Release" copy $(TargetPath) c:\EgtProg\OmagCUT\OmagCUTR32.exe
+20 -1
View File
@@ -412,6 +412,11 @@ Public Class CurrentProjectPageUC
SetTotalArea(dTotArea)
UpdateToProduceArea()
ShowAreas()
' Salvo info di C home
Dim dCHome As Double
EgtGetAxisHomePos("C", dCHome)
EgtSetInfo(EgtGetFirstNameInGroup(GDB_ID.ROOT, NAME_PROJMARK), INFO_CAXESHOME, DoubleToString(dCHome, 0))
EgtZoom(ZM.ALL)
' Dichiaro progetto non modificato
EgtResetModified()
Return True
@@ -522,7 +527,21 @@ Public Class CurrentProjectPageUC
m_MainWindow.m_CurrentMachine.dAdditionalTable = dValue
End If
' forzo visualizzazione eventuali dati su aree
SetAreasStatus( True)
SetAreasStatus(True)
' Recupero info C Home
Dim dCHomeCurrMach As Double
Dim dCHomeCurrproj As Double
EgtGetAxisHomePos("C", dCHomeCurrMach)
' Verifico che esista l'info del progetto
If EgtExistsInfo(EgtGetFirstNameInGroup(GDB_ID.ROOT, NAME_PROJMARK), INFO_CAXESHOME) Then
EgtGetInfo(EgtGetFirstNameInGroup(GDB_ID.ROOT, NAME_PROJMARK), INFO_CAXESHOME, dCHomeCurrproj)
' Se la macchina indicata ha C Home differente allora comunico un errore del progetto
If Math.Abs(dCHomeCurrproj - dCHomeCurrMach) > EPS_ANG_SMALL Then
EgtOutLog(" WARNING -> C axes home project is different from current machine, delta ang C home:" & DoubleToString(dCHomeCurrproj - dCHomeCurrMach, 2))
End If
Else
EgtSetInfo(EgtGetFirstNameInGroup(GDB_ID.ROOT, NAME_PROJMARK), INFO_CAXESHOME, DoubleToString(dCHomeCurrMach, 0))
End If
' Dichiaro progetto non modificato
EgtResetModified()
Return True
+6 -1
View File
@@ -101,7 +101,6 @@ Public Class ProjectMgrUC
m_CurrProjPage.NewProject(nTabInd, bRetainParkedParts)
' Gestione stato FastGrid
m_MainWindow.m_CadCutPageUC.m_FastGridSlabManager.OnPostNewProject()
EgtZoom(ZM.ALL)
End Sub
Friend Function ChooseTable() As Integer
@@ -264,6 +263,12 @@ 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)
EgtSetInfo(EgtGetFirstNameInGroup(GDB_ID.ROOT, NAME_PROJMARK), INFO_CAXESHOME, DoubleToString(dCHome, 0))
' Aggiorno visualizzazione
EgtDraw()
End Sub
Binary file not shown.

Before

Width:  |  Height:  |  Size: 857 B

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 857 B

+17 -1
View File
@@ -567,6 +567,11 @@ Public Class SimulationPageUC
End Sub
Private Sub GenerateXPIUC_Click(sender As Object, e As RoutedEventArgs)
' eventualmente fermo la simulazione
m_nStatus = MCH_SIM_ST.UI_STOP
m_bPlay = False
PlayPauseBtn_Click(Nothing, Nothing)
' se il bottone Shift è premuto apro il file CadCut1 nel programma NotePad
Dim IsPressedShiftKey As Boolean = False
If Keyboard.Modifiers And ModifierKeys.Shift Then
@@ -681,8 +686,19 @@ Public Class SimulationPageUC
Catch ex As Exception
EgtOutLog(ex.ToString)
End Try
End If
' ricarico la pagina di simulazione
EgtSetCurrPhase(1)
' nascondo i pezzi in parcheggio
HideParkedParts(True)
' Avvio ambiente di simulazione
EgtSimInit()
EgtSimStart()
' Imposto stato corrente
SetStatus(MCH_SIM_ST.UI_STOP)
m_bPlay = True
' Costringo ad aggiornare UI
UpdateUI()
End Sub
Private Function ProcessEvents(nProg As Integer, nPause As Integer) As Integer
+5 -5
View File
@@ -20,12 +20,12 @@ Module Utility
Friend StopWatch As Stopwatch
Friend Sub TimeSpanInit()
StopWatch = New Stopwatch
StopWatch.Start()
End Sub
Friend Sub TimeSpanInit()
StopWatch = New Stopwatch
StopWatch.Start()
End Sub
Friend Function TimeSpanEnd()
Friend Function TimeSpanEnd()
Dim sTime As String = ""
If Not IsNothing(StopWatch) Then
StopWatch.Stop()