Compare commits

..

6 Commits

Author SHA1 Message Date
Nicola Pievani 97ec72e3e1 Costruzione solido in fase di definzione COMPO 2023-06-05 10:33:18 +02:00
Nicola Pievani ca3193b9a4 Correzione gestione apertura CN per Tagli Diretti 2023-05-31 12:27:08 +02:00
Nicola Pievani 93e7144753 Creata funzione condivisa per genrazione SOLIDO 2023-05-26 14:54:45 +02:00
Nicola Pievani 31e6bbaca7 Gestione script per creazione solido in FIloTop 2023-05-25 16:43:27 +02:00
Nicola Pievani 8935622888 Inizio gestione solido per FILOTOP 2023-05-25 12:22:18 +02:00
Nicola Pievani c47370405c Configurato Script per cereazione solido con lati smussati 2023-05-22 12:58:03 +02:00
22 changed files with 450 additions and 764 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 -305
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,53 +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()
EnableButtons()
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
@@ -1370,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
@@ -1381,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
@@ -1407,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
@@ -1423,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
@@ -1467,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
@@ -1485,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()
@@ -1513,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)
-1
View File
@@ -232,7 +232,6 @@
Public Const K_HOLES_OFFSETWJ As String = "HolesOffsetWJ"
Public Const K_MIN_RADIUSWJ As String = "MinRadiusWJ"
Public Const K_MACH_DRILLINGWJ_ON_CORNERS As String = "DrillingWJOnCorners"
Public Const K_MACH_RECTIFICATION_ON_SUBSQUARE As String = "RectificationSubSqWJ"
' DrillMillC90
' CutLongDxSx
' AngRotMultiCut
-35
View File
@@ -35,7 +35,6 @@ Public Class MachineButtonsUC
Private Const BTN_STATE_DOOR_OPENED As String = "DoorOpened"
Private Const BTN_STATE_DOOR_CLOSED As String = "DoorClosed"
Private Const BTN_STATE_PARKING As String = "Parking"
Private Const BTN_STATE_HOME As String = "Home"
Private Const BTN_ENABLE_ZONE_1 As String = "EnableZone1"
Private Const BTN_ENABLE_ZONE_2 As String = "EnableZone2"
Private Const BTN_ENABLE_PC As String = "EnablePC"
@@ -712,40 +711,6 @@ Public Class MachineButtonsUC
End If
End Sub
Friend Sub HomeStateChanged(HomeState As Boolean)
Dim nIndex As Integer = Array.IndexOf(StateFlagArray, BTN_STATE_HOME)
If nIndex = -1 Then Return
If HomeState Then
GetToggleButton(nIndex + 1).IsChecked = True
Try
Dim s As String
If (m_MainWindow.m_OptionsPageUC.ThemesCmBx.SelectedIndex = 0) Then
s = m_MainWindow.GetResourcesDir() & "\MachineButtonsImage\" & ImageArrayY(nIndex)
Else
s = m_MainWindow.GetResourcesDir() & "\MachineButtonsImage\NewIcons\" & ImageArrayY(nIndex)
End If
Dim sButtonImageSource As ImageSource = ImageConverter.ConvertFromString(s)
GetImage(nIndex + 1).Source = sButtonImageSource
Catch ex As Exception
EgtOutLog("Error loading image " & ImageArrayY(nIndex + 1))
End Try
Else
GetToggleButton(nIndex + 1).IsChecked = False
Try
Dim s As String
If (m_MainWindow.m_OptionsPageUC.ThemesCmBx.SelectedIndex = 0) Then
s = m_MainWindow.GetResourcesDir() & "\MachineButtonsImage\" & ImageArrayY(nIndex)
Else
s = m_MainWindow.GetResourcesDir() & "\MachineButtonsImage\NewIcons\" & ImageArrayY(nIndex)
End If
Dim sButtonImageSource As ImageSource = ImageConverter.ConvertFromString(s)
GetImage(nIndex + 1).Source = sButtonImageSource
Catch ex As Exception
EgtOutLog("Error loading image " & ImageArrayN(nIndex + 1))
End Try
End If
End Sub
Friend Sub EnableZoneStateChanged(ZoneState As Integer)
Dim sFlag As String = String.Empty
If ZoneState = 1 Then
+6 -1
View File
@@ -618,6 +618,10 @@ Public Class DrawPageUC
MakePreview(sMsg)
MessageTxBl.Text = sMsg
MessageGrid.Background = If(m_bDrawOk, Brushes.Transparent, Application.Current.FindResource("OmagCut_Red"))
' EseguoUpdate del solido
Utility.CreateSolid3D(m_MainWindow.GetIniFile())
' aggiorno visualizzazione
EgtSetView(VT.TOP, False)
EgtZoom(ZM.ALL)
@@ -627,7 +631,8 @@ Public Class DrawPageUC
' Costruisco path completa del componente
Dim sPath = m_sCompoDir & "\" & m_sCompoName
' Carico il file
Return EgtLuaExecFile(sPath)
Dim bOk As Boolean = EgtLuaExecFile(sPath)
Return bOk
End Function
Private Function ReadAndShowVariables() As Boolean
+19 -11
View File
@@ -1,4 +1,5 @@
Imports EgtUILib
Imports EgtWPFLib5
Public Class FiloTopUC
@@ -38,7 +39,7 @@ Public Class FiloTopUC
m_CallingPage = m_MainWindow.m_ActivePage
' Imposto messaggi
ParameterTxBl.Text = EgtMsg( MSG_IMPORTPAGEUC + 10) ' Offset
ParameterTxBl.Text = EgtMsg(MSG_IMPORTPAGEUC + 10) ' Offset
Parameter2TxBl.Text = EgtMsg(MSG_IMPORTPAGEUC + 11) ' Affondamento
Parameter3TxBl.Text = EgtMsg(91138)
@@ -46,10 +47,10 @@ Public Class FiloTopUC
' Imposto questa come pagina correntemente visualizzata nella drawpage
m_MainWindow.m_DrawPageUC.m_ActiveComponentPage = DrawPageUC.Pages.FiloTop
' Imposto contesto corrente
EgtSetCurrentContext( m_MainWindow.m_DrawPageUC.DrawScene.GetCtx())
EgtSetCurrentContext(m_MainWindow.m_DrawPageUC.DrawScene.GetCtx())
ElseIf m_CallingPage = MainWindow.Pages.Import Then
' Imposto contesto corrente
EgtSetCurrentContext( m_MainWindow.m_ImportPageUC.ImportScene.GetCtx())
EgtSetCurrentContext(m_MainWindow.m_ImportPageUC.ImportScene.GetCtx())
End If
' Gestisco visualizzazione dei parametri
@@ -58,9 +59,9 @@ Public Class FiloTopUC
Parameter3TxBl.Visibility = Windows.Visibility.Visible
' Aggiorno valori
m_dFiloTopOffset = GetPrivateProfileDouble( S_SIDES, K_FILOTOPOFFSET, 5, m_MainWindow.GetIniFile())
ParameterTxBx.Text = LenToString( m_dFiloTopOffset, 3)
m_dFiloTopDepth = GetPrivateProfileDouble( S_SIDES, K_FILOTOPDEPTH, 5, m_MainWindow.GetIniFile())
m_dFiloTopOffset = GetPrivateProfileDouble(S_SIDES, K_FILOTOPOFFSET, 5, m_MainWindow.GetIniFile())
ParameterTxBx.Text = LenToString(m_dFiloTopOffset, 3)
m_dFiloTopDepth = GetPrivateProfileDouble(S_SIDES, K_FILOTOPDEPTH, 5, m_MainWindow.GetIniFile())
Parameter2TxBx.Text = LenToString(m_dFiloTopDepth, 3)
m_bCornerradius = GetPrivateProfileInt(S_SIDES, K_ROUNDOFF, 0, m_MainWindow.GetIniFile()) <> 0
Parameter3ChBx.IsChecked = m_bCornerradius
@@ -81,8 +82,8 @@ Public Class FiloTopUC
Dim nLayId As Integer = EgtGetFirstLayer(nPartId)
While nLayId <> GDB_ID.NULL
Dim sLayName As String = ""
If EgtGetName( nLayId, sLayName) AndAlso sLayName = NAME_INLOOP AndAlso EgtExistsInfo( nLayId, INFO_FILOTOP) Then
EgtSetInfo( nLayId, INFO_OFFSET, m_dFiloTopOffset)
If EgtGetName(nLayId, sLayName) AndAlso sLayName = NAME_INLOOP AndAlso EgtExistsInfo(nLayId, INFO_FILOTOP) Then
EgtSetInfo(nLayId, INFO_OFFSET, m_dFiloTopOffset)
End If
nLayId = EgtGetNextLayer(nLayId)
End While
@@ -102,13 +103,16 @@ Public Class FiloTopUC
Dim nLayId As Integer = EgtGetFirstLayer(nPartId)
While nLayId <> GDB_ID.NULL
Dim sLayName As String = ""
If EgtGetName( nLayId, sLayName) AndAlso sLayName = NAME_INLOOP AndAlso EgtExistsInfo( nLayId, INFO_FILOTOP) Then
EgtSetInfo( nLayId, INFO_DEPTH, m_dFiloTopDepth)
If EgtGetName(nLayId, sLayName) AndAlso sLayName = NAME_INLOOP AndAlso EgtExistsInfo(nLayId, INFO_FILOTOP) Then
EgtSetInfo(nLayId, INFO_DEPTH, m_dFiloTopDepth)
End If
nLayId = EgtGetNextLayer(nLayId)
End While
nPartId = EgtGetNextPart(nPartId)
End While
Utility.CreateSolid3D(m_MainWindow.GetIniFile())
EgtDraw()
End Sub
Private Sub Parameter3ChBx_Checked() Handles Parameter3ChBx.Click
@@ -216,12 +220,16 @@ Public Class FiloTopUC
EgtRemoveInfo(nLayId, "FiloTopRef")
EgtOutLog("Error in generation OffsetPreView in TopEgde ")
End If
If bOk Then Utility.CreateSolid3D(m_MainWindow.GetIniFile())
' ---------------------- Fine GESTIONE PREVIEW percorso -------------------------------
End If
nLayId = EgtGetNextLayer(nLayId)
nLayId = EgtGetNextLayer(nLayId)
End While
nPartId = EgtGetNextPart(nPartId)
End While
EgtDraw()
End Sub
+36 -32
View File
@@ -171,25 +171,25 @@ Public Class SideAngleUC
' Aggiorno valori
If m_Mode = ModeOpt.DRIP Then
m_dDripOffset = GetPrivateProfileDouble( S_SIDES, K_DRIPOFFSET, 20, m_MainWindow.GetIniFile())
m_dDripOffset2 = GetPrivateProfileDouble( S_SIDES, K_DRIPOFFSET2, 0, m_MainWindow.GetIniFile())
m_dDripDepth = GetPrivateProfileDouble( S_SIDES, K_DRIPDEPTH, 10, m_MainWindow.GetIniFile())
m_dDripShort = GetPrivateProfileDouble( S_SIDES, K_DRIPSHORT, 0, m_MainWindow.GetIniFile())
Parameter1TxBx.Text = LenToString( m_dDripOffset, 3)
Parameter2TxBx.Text = LenToString( m_dDripOffset2, 3)
Parameter3TxBx.Text = LenToString( m_dDripDepth, 3)
Parameter4TxBx.Text = LenToString( m_dDripShort, 3)
m_dDripOffset = GetPrivateProfileDouble(S_SIDES, K_DRIPOFFSET, 20, m_MainWindow.GetIniFile())
m_dDripOffset2 = GetPrivateProfileDouble(S_SIDES, K_DRIPOFFSET2, 0, m_MainWindow.GetIniFile())
m_dDripDepth = GetPrivateProfileDouble(S_SIDES, K_DRIPDEPTH, 10, m_MainWindow.GetIniFile())
m_dDripShort = GetPrivateProfileDouble(S_SIDES, K_DRIPSHORT, 0, m_MainWindow.GetIniFile())
Parameter1TxBx.Text = LenToString(m_dDripOffset, 3)
Parameter2TxBx.Text = LenToString(m_dDripOffset2, 3)
Parameter3TxBx.Text = LenToString(m_dDripDepth, 3)
Parameter4TxBx.Text = LenToString(m_dDripShort, 3)
ElseIf m_Mode = ModeOpt.ENGRAVE Then
m_dDripOffset = GetPrivateProfileDouble( S_SIDES, K_ENGRAVEOFFSET, 20, m_MainWindow.GetIniFile())
m_nEngrNbr2 = GetPrivateProfileInt( S_SIDES, K_ENGRAVENUMBER2, 1, m_MainWindow.GetIniFile())
m_dDripOffset2 = GetPrivateProfileDouble( S_SIDES, K_ENGRAVEOFFSET2, 0, m_MainWindow.GetIniFile())
m_dDripDepth = GetPrivateProfileDouble( S_SIDES, K_ENGRAVEDEPTH, 10, m_MainWindow.GetIniFile())
m_dDripOffset = GetPrivateProfileDouble(S_SIDES, K_ENGRAVEOFFSET, 20, m_MainWindow.GetIniFile())
m_nEngrNbr2 = GetPrivateProfileInt(S_SIDES, K_ENGRAVENUMBER2, 1, m_MainWindow.GetIniFile())
m_dDripOffset2 = GetPrivateProfileDouble(S_SIDES, K_ENGRAVEOFFSET2, 0, m_MainWindow.GetIniFile())
m_dDripDepth = GetPrivateProfileDouble(S_SIDES, K_ENGRAVEDEPTH, 10, m_MainWindow.GetIniFile())
m_dEngraveDepth2 = GetPrivateProfileDouble(S_SIDES, K_ENGRAVEDEPTH2, 0, m_MainWindow.GetIniFile())
m_dEngraveAngle = GetPrivateProfileDouble(S_SIDES, K_ENGRAVEANGLE, 0, m_MainWindow.GetIniFile())
Parameter1TxBx.Text = LenToString(m_dDripOffset, 3)
Parameter2aTxBx.Text = m_nEngrNbr2.ToString()
Parameter2bTxBx.Text = LenToString( m_dDripOffset2, 3)
Parameter3TxBx.Text = LenToString( m_dDripDepth, 3)
Parameter2bTxBx.Text = LenToString(m_dDripOffset2, 3)
Parameter3TxBx.Text = LenToString(m_dDripDepth, 3)
Parameter4TxBx.Text = LenToString(m_dEngraveDepth2, 3)
Parameter5TxBx.Text = DoubleToString(m_dEngraveAngle, 3)
End If
@@ -311,8 +311,8 @@ Public Class SideAngleUC
' Attualmente il vaore m_nCount è inizializzato ad "1"..
' Bottoni Prev Next
If m_nCount <= MAX_LINES Then
PrevBtn.Visibility= Windows.Visibility.Hidden
NextBtn.Visibility= Windows.Visibility.Hidden
PrevBtn.Visibility = Windows.Visibility.Hidden
NextBtn.Visibility = Windows.Visibility.Hidden
Else
Grid.SetRow(PrevBtn, MAX_LINES - m_nShow)
PrevBtn.Visibility = Windows.Visibility.Visible
@@ -371,7 +371,7 @@ Public Class SideAngleUC
GetHeelTxBxFromIndex(Index).Text = GetPrivateProfileDouble(S_SIDES, K_DRIPSHORT & "A" & nI.ToString & "_End", 0, m_MainWindow.GetIniFile())
End If
End If
Dim TxBlIndex As Integer = (m_nCurrPage - 1) * MAX_LINES + nI - 1
Dim TxBlIndex As Integer = (m_nCurrPage - 1) * MAX_LINES + nI - 1
GetTxBlFromIndex(Index).Text = If(m_Mode = ModeOpt.SIDEANGLE,
m_SideAngleEntityList(TxBlIndex).sEntityName,
m_DripEntityList(TxBlIndex).sEntityName)
@@ -495,15 +495,15 @@ Public Class SideAngleUC
'-------------> Restituisce gli oggetto della grafica assegnato l'indice
' quando esco salvo nel file l'ultima configurazione per le incisioni
Private Sub SideAngleUC_Unloaded( sender As Object, e As RoutedEventArgs) Handles Me.Unloaded
Private Sub SideAngleUC_Unloaded(sender As Object, e As RoutedEventArgs) Handles Me.Unloaded
If m_CallingPage = MainWindow.Pages.Draw Then
' Ricavo nome pezzo
Dim PartId As Integer = EgtGetFirstInGroup( GDB_ID.ROOT)
Dim PartId As Integer = EgtGetFirstInGroup(GDB_ID.ROOT)
' Svuoto layer in cui sono presenti i testi con le inclinazioni dei lati
If m_Mode = ModeOpt.SIDEANGLE Then
EgtEmptyGroup( EgtGetFirstNameInGroup( PartId, SIDE_ANGLE_LAYER))
EgtEmptyGroup(EgtGetFirstNameInGroup(PartId, SIDE_ANGLE_LAYER))
Else
EgtEmptyGroup( EgtGetFirstNameInGroup( PartId, SIDE_ANGLE_LAYER))
EgtEmptyGroup(EgtGetFirstNameInGroup(PartId, SIDE_ANGLE_LAYER))
End If
ElseIf m_CallingPage = MainWindow.Pages.Import Then
' Nessuna azione necessaria
@@ -516,7 +516,7 @@ Public Class SideAngleUC
'WritePrivateProfileString( S_SIDES, K_DRIPSHORT, DoubleToString( m_dDripShort, 3), m_MainWindow.GetIniFile())
ElseIf m_Mode = ModeOpt.ENGRAVE Then
WritePrivateProfileString(S_SIDES, K_ENGRAVEOFFSET, LenToString(m_dDripOffset, 3), m_MainWindow.GetIniFile())
WritePrivateProfileString( S_SIDES, K_ENGRAVENUMBER2, m_nEngrNbr2.ToString(), m_MainWindow.GetIniFile())
WritePrivateProfileString(S_SIDES, K_ENGRAVENUMBER2, m_nEngrNbr2.ToString(), m_MainWindow.GetIniFile())
WritePrivateProfileString(S_SIDES, K_ENGRAVEOFFSET2, LenToString(m_dDripOffset2, 3), m_MainWindow.GetIniFile())
WritePrivateProfileString(S_SIDES, K_ENGRAVEDEPTH, LenToString(m_dDripDepth, 3), m_MainWindow.GetIniFile())
WritePrivateProfileString(S_SIDES, K_ENGRAVEDEPTH2, LenToString(m_dEngraveDepth2, 3), m_MainWindow.GetIniFile())
@@ -538,7 +538,7 @@ Public Class SideAngleUC
PartId = If(m_MainWindow.m_DrawPageUC.SelectedLayer <> GDB_ID.NULL, EgtGetFirstPart(), GDB_ID.NULL)
' Recupero nome layer con geometria di contorno (esterno o interno) del pezzo
LoopId = m_MainWindow.m_DrawPageUC.SelectedLayer
ElseIf m_CallingPage = MainWindow.Pages.Import Then
ElseIf m_CallingPage = MainWindow.Pages.Import Then
' Imposto contesto corrente
EgtSetCurrentContext(m_MainWindow.m_ImportPageUC.ImportScene.GetCtx())
' Recupero nome pezzo
@@ -579,6 +579,10 @@ Public Class SideAngleUC
' Creo le geometrie dei gocciolatoi
CreateDripGeom(PartId)
End If
' se abilitato e dimensione solido da sotto: creo il solido
Utility.CreateSolid3D(m_MainWindow.GetIniFile())
' Aggiorno visualizzazione
EgtDraw()
End Sub
@@ -600,7 +604,7 @@ Public Class SideAngleUC
For nIndex As Integer = 1 To m_nCount
Dim Entity As DripEntity = m_DripEntityList(nIndex - 1)
' Imposto check box (se sono stati definiti il numero corretto di CheckBox
If nIndex < ( m_nCurrPage - 1) * MAX_LINES Or nIndex > m_nCurrPage * MAX_LINES Then Continue For
If nIndex < (m_nCurrPage - 1) * MAX_LINES Or nIndex > m_nCurrPage * MAX_LINES Then Continue For
Dim nChIndex As Integer = nIndex - (m_nCurrPage - 1) * MAX_LINES + MAX_LINES - m_nShow
' verifico se l'entità ha un gocciolatoio
GetChBxFromIndex(nChIndex).IsChecked = Entity.bHaveDrip
@@ -973,15 +977,15 @@ Public Class SideAngleUC
Private Sub PrevBtn_Click(sender As Object, e As RoutedEventArgs) Handles PrevBtn.Click
If m_nCurrPage = 1 Then Return
m_nCurrPage -= 1
m_nShow = Math.Min( m_nCount - ( m_nCurrPage - 1) * MAX_LINES, MAX_LINES)
m_nShow = Math.Min(m_nCount - (m_nCurrPage - 1) * MAX_LINES, MAX_LINES)
TxBlChBxView()
RefreshCheckAndValue()
End Sub
Private Sub NextBtn_Click(sender As Object, e As RoutedEventArgs) Handles NextBtn.Click
If m_nCount <= ( m_nCurrPage - 1) * MAX_LINES Then Return
If m_nCount <= (m_nCurrPage - 1) * MAX_LINES Then Return
m_nCurrPage += 1
m_nShow = Math.Min( m_nCount - ( m_nCurrPage - 1) * MAX_LINES, MAX_LINES)
m_nShow = Math.Min(m_nCount - (m_nCurrPage - 1) * MAX_LINES, MAX_LINES)
TxBlChBxView()
RefreshCheckAndValue()
End Sub
@@ -993,7 +997,7 @@ Public Class SideAngleUC
Dim bVal As Boolean = CurrCheckBox.IsChecked()
Dim SideIndex As Integer = CInt(CurrCheckBox.Name.Substring(1))
' Converto nome checkbox in nome elemento tenendo conto della pagina e dello slittamento verso il basso
Dim nCurrSide As Integer = ( m_nCurrPage - 1) * MAX_LINES + SideIndex - ( MAX_LINES - m_nShow)
Dim nCurrSide As Integer = (m_nCurrPage - 1) * MAX_LINES + SideIndex - (MAX_LINES - m_nShow)
Dim sCurrSide As String = m_DripEntityList(nCurrSide - 1).sEntityName
' aggiorno l'entità con i valori scritti nel campo di testo
Dim CurrEntity As DripEntity = DripEntity.FindEntity(sCurrSide)
@@ -1192,7 +1196,7 @@ Public Class SideAngleUC
AngleTxBx.Text = DoubleToString(dSideAngle, 2)
End If
' Converto nome checkbox in nome elemento tenendo conto della pagina e dello slittamento verso il basso
Dim nCurrSide As Integer = ( m_nCurrPage - 1) * MAX_LINES + SideIndex - ( MAX_LINES - m_nShow)
Dim nCurrSide As Integer = (m_nCurrPage - 1) * MAX_LINES + SideIndex - (MAX_LINES - m_nShow)
Dim sCurrSide As String = m_SideAngleEntityList(nCurrSide - 1).sEntityName
' Lo modifico nella geometria e nella lista inclinazioni
ModifySideAngle(sCurrSide, dSideAngle)
@@ -1262,7 +1266,7 @@ Public Class SideAngleUC
HeelTxBx.Text = "0"
End If
' Converto nome checkbox in nome elemento tenendo conto della pagina e dello slittamento verso il basso
Dim nCurrSide As Integer = ( m_nCurrPage - 1) * MAX_LINES + SideIndex - ( MAX_LINES - m_nShow)
Dim nCurrSide As Integer = (m_nCurrPage - 1) * MAX_LINES + SideIndex - (MAX_LINES - m_nShow)
Dim sCurrSide As String = m_SideAngleEntityList(nCurrSide - 1).sEntityName
' Lo modifico nella geometria e nella lista inclinazioni
ModifySideHeel(sCurrSide, dSideHeel)
@@ -1303,7 +1307,7 @@ Public Class SideAngleUC
If dSideAngle <> 0 Then
EgtSetInfo(CurrEntity.nGeomId, INFO_SIDE_ANGLE, dSideAngle)
EgtSetInfo(CurrEntity.nGeomId, INFO_ORIG_SIDE_ANGLE, dSideAngle)
' Cancello inclinazione nell'apposito campo info
' Cancello inclinazione nell'apposito campo info
Else
EgtRemoveInfo(CurrEntity.nGeomId, INFO_SIDE_ANGLE)
EgtRemoveInfo(CurrEntity.nGeomId, INFO_ORIG_SIDE_ANGLE)
@@ -1324,7 +1328,7 @@ Public Class SideAngleUC
' Scrivo nuovo tallone nelle info
If dSideHeel > 10 * EPS_SMALL Then
EgtSetInfo(CurrEntity.nGeomId, INFO_HEEL, dSideHeel)
' Cancello inclinazione nell'apposito campo info
' Cancello inclinazione nell'apposito campo info
Else
EgtRemoveInfo(CurrEntity.nGeomId, INFO_HEEL)
End If
-25
View File
@@ -184,31 +184,6 @@
</GroupBox>
<!--Parametri rettifica tagli sottosquadra: 1 Parametro -->
<GroupBox Name="RectificationWJParamGpBx" Style="{DynamicResource OmagCut_GroupBox}" Grid.Column="0" Grid.Row="4" Grid.ColumnSpan="2" >
<Grid Grid.Column="3" Grid.Row="2">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="2*"/>
<ColumnDefinition Width="2*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<TextBlock Name="EnableRectificationTxBl" Grid.Row="0" Grid.ColumnSpan="2"
Style="{DynamicResource OmagCut_ToolsDBTextBlock}" />
<CheckBox Name="EnableRectificationChBx" Grid.Row="0" Grid.ColumnSpan="2" Style="{StaticResource OmagCut_CheckBox_Single}"
HorizontalAlignment="Right" Margin="0,0,10,0"/>
<!--<TextBlock Name="OffsetRectificationTxBl" Grid.Row="1" Grid.Column="0"
Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>
<EgtWPFLib:EgtTextBox Name="OffsetRectificationTxBx" Grid.Row="1" Grid.Column="1" Margin="10,0,10,0"
Style="{DynamicResource OmagCut_CalculatorTextBox}"/>-->
</Grid>
</GroupBox>
<!--Parametri WaterJet: 5 Parametro (se questo GroupBox attivo allora nascondo Fori/Fresatura)-->
<GroupBox Name="WjsParamGpBx" Grid.Column="0" Grid.Row="0" Grid.ColumnSpan="2" Grid.RowSpan="4"
Style="{DynamicResource OmagCut_GroupBox}">
+3 -18
View File
@@ -97,10 +97,7 @@ Public Class AlarmsPageUC
HolesOffsetWJTxBl.Text = "Offset"
MinRadiusWJTxBl.Text = "Min Radius"
OneHoleInCornerWJTxBl.Text = EgtMsg(MSG_ALARMSPAGEUC + 26)
'-- INIZIO -- nuovi parametro Rettifica tagli sottosquadra WJ
REctificationWJParamGpBx.Header = "Rectification"
EnableRectificationTxBl.Text = "Enable (on subsquare angle)"
'-- FINE -- nuovi parametro Rettifica tagli sottosquadra WJ
'-- FINE -- nuovi parametri per preforo lavello
NestingParamGpBx.Header = EgtMsg(MSG_ALARMSPAGEUC + 31) ' Nesting
AlignTxBl.Text = EgtMsg(90932) ' Allineato
GhigliottinaTxBl.Text = EgtMsg(91066) ' Ghigliottina
@@ -178,7 +175,6 @@ Public Class AlarmsPageUC
' Se non previsti tagli waterjet, disabilito relativo box
If Not m_CurrentMachine.bWaterJetting Then
WjsParamGpBx.Visibility = Visibility.Hidden
RectificationWJParamGpBx.Visibility = Visibility.Hidden
End If
' Abilitazione box per contorni grezzo da foto
@@ -358,9 +354,7 @@ Public Class AlarmsPageUC
MinRadiusWJTxBx.Text = LenToString(dVal, 2)
OneHoleInCornerWJChBx.IsChecked =
(GetPrivateProfileInt(S_MACH_NEST, K_MACH_DRILLINGWJ_ON_CORNERS, 1, m_MainWindow.GetMachIniFile()) <> 0)
' leggo se attiva la rettifica degli angoli per WaterJet
EnableRectificationChBx.IsChecked =
(GetPrivateProfileInt(S_MACH_NEST, K_MACH_RECTIFICATION_ON_SUBSQUARE, 0, m_MainWindow.GetMachIniFile()) <> 0)
' Leggo accorciamento angoli con fresa
dVal = GetPrivateProfileDouble(S_MACH_NEST, K_MACH_MILLING_SHORTENING, 0, m_MainWindow.GetMachIniFile())
ShortTxBx.Text = LenToString(dVal, 2)
@@ -976,17 +970,8 @@ Public Class AlarmsPageUC
WritePrivateProfileString(S_MACH_NEST, K_MACH_DRILLINGWJ_ON_CORNERS, "0", m_MainWindow.GetMachIniFile())
End If
End Sub
' -- FINE -- nuovi parametri per prefori WaterJet
' -- INIZIO -- nuovi parametri per Rettifica angoli in sottosquadra WaterJet
Private Sub EnableRectificationChBx_Click(sender As Object, e As EventArgs) Handles EnableRectificationChBx.Click
If EnableRectificationChBx.IsChecked() Then
WritePrivateProfileString(S_MACH_NEST, K_MACH_RECTIFICATION_ON_SUBSQUARE, "1", m_MainWindow.GetMachIniFile)
Else
WritePrivateProfileString(S_MACH_NEST, K_MACH_RECTIFICATION_ON_SUBSQUARE, "0", m_MainWindow.GetMachIniFile)
End If
End Sub
' -- FINE -- nuovi parametri per Rettifica angoli in sottosquadra WaterJet
' -- FINE -- nuovi parametri per prefori WaterJet
Private Sub TmEnableChBx_Click(sender As Object, e As RoutedEventArgs) Handles TmEnableChBx.Click
If TmEnableChBx.IsChecked() Then
-6
View File
@@ -279,12 +279,6 @@ Public Class MachineStatusUC
Sub DisplayFeed()
Dim dRealFeed As Double = m_CN.d_DInterpo_Prog_Feed * m_CN.d_DInterpo_Feed_override / 100
' modifica richiesta 26/05/2023 da Rosario per cliente Lanzetta
If m_MainWindow.m_CNCommunication.m_nNCType = 4 Then
dRealFeed = m_CN.d_DInterpo_Prog_Feed
Else
dRealFeed = m_CN.d_DInterpo_Prog_Feed * m_CN.d_DInterpo_Feed_override / 100
End If
'Feed = DoubleToString(dRealFeed, 0)
FeedTxBx.Text = LenToString(dRealFeed, 0, True)
'FeedOverride = DoubleToString(m_CN.d_DInterpo_Feed_override, 0) & "%"
+1 -2
View File
@@ -1226,8 +1226,7 @@ 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.5.2")>
<Assembly: AssemblyFileVersion("2.5.5.2")>
<Assembly: AssemblyVersion("2.5.5.1")>
<Assembly: AssemblyFileVersion("2.5.5.1")>
-1
View File
@@ -654,7 +654,6 @@ Public Class CNCommunication
End If
m_MainWindow.m_DirectCutPageUC.m_MachineButtons.DoorStateChanged(m_CN.nDoorClosedState)
m_MainWindow.m_DirectCutPageUC.m_MachineButtons.ParkingStateChanged(m_CN.bParkingState)
m_MainWindow.m_DirectCutPageUC.m_MachineButtons.HomeStateChanged(m_CN.bHomeState)
m_MainWindow.m_DirectCutPageUC.m_MachineButtons.EnableZoneStateChanged(m_CN.nEnableZone)
m_MainWindow.m_DirectCutPageUC.m_MachineButtons.EnablePcStateChanged(m_CN.nEnablePc)
m_MainWindow.m_DirectCutPageUC.m_MachineButtons.TableUpChanged(m_CN.bTableUpState)
+3 -1
View File
@@ -650,7 +650,9 @@ Namespace Fanuc
' ...
Case CnData.Feed ' (2)
d_DInterpo_Prog_Feed = CDbl(n_temp) ' d_DInterpo_Prog_Feed
Dim qq As Short = n_temp
'd_DInterpo_Prog_Feed = CDbl(CLng(values(n))) ' d_DInterpo_Prog_Feed
Case CnData.FeedOvr ' (3) Potenziom. Feed = * 0.47059
d_DInterpo_Feed_override = CDbl(n_temp)
+1 -13
View File
@@ -491,19 +491,7 @@ 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)
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
m_MainWindow.MainWindowGrid.Children.Add(m_MainWindow.m_CurrentProjectPageUC)
' 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)
-1
View File
@@ -2060,7 +2060,6 @@ Public Class RawPartPageUC
End Sub
Public Sub RefTabModeChange()
If Not m_bOtherRefTab Then Return
MoveRawToMaiRefTab()
MoveRawToOtherRefTab()
UpdateRefTabDraw()
+44 -5
View File
@@ -567,16 +567,55 @@ 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
IsPressedShiftKey = True
End If
' Se nella pagina di tagli diretti
If m_MainWindow.DirectCutBtn.IsChecked And Not m_MainWindow.CadCutBtn.IsChecked Then
' Genero file CNC (lancio anche se errore in precedenza)
Dim sCncPathDirect As String = m_MainWindow.GetCncDir() & "\DirectCut" & m_MainWindow.m_CurrentMachine.sIsoFileExt
Dim bOkDirect As Boolean = EgtGenerate(sCncPathDirect, "OmagCut ver." & m_MainWindow.GetVersion())
' Costringo ad aggiornare UI
UpdateUI()
' Ripristino come fase corrente quella iniziale
EgtSetCurrPhase(1)
If bOkDirect Then
m_CurrProjPage.SetInfoMessage("Genarato file " & "DirectCut" & m_MainWindow.m_CurrentMachine.sIsoFileExt)
Else
m_CurrProjPage.SetErrorMessage(EgtMsg(90314)) 'Errore nella generazione del programma CN
End If
' procedo all'apertura del file CadCut1 apenna generato (solo se generazione corretta)
If bOkDirect And IsPressedShiftKey Then
Try
Process.Start("Notepad.exe", sCncPathDirect)
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()
' esco
Return
End If
' eventualmente fermo la simulazione
m_nStatus = MCH_SIM_ST.UI_STOP
m_bPlay = False
PlayPauseBtn_Click(Nothing, Nothing)
Dim bOk As Boolean = True
EgtSetCurrentContext(m_CurrProjPage.CurrentProjectScene.GetCtx())
' Elimino eventuale attrezzaggio da OmagOFFICE
+83 -53
View File
@@ -6,6 +6,36 @@ Imports EgtWPFLib
Imports EgtUILib
Module Utility
'--------------------------------------------------------------------------------------------------
#Region "COMPO SOLID3d"
Friend Function CreateSolid3D(sIniFile As String) As Boolean
EgtSaveFile("C:\EgtData\OmagCUT\Temp\Ribasso.nge", NGE.TEXT)
Dim bOk As Boolean = False
Dim dRawHeight As Double = GetPrivateProfileDouble(S_RAWPART, K_RAWHEIGHT, 30, sIniFile)
' se abilitato e dimensione solido da sotto: creo il solido
Dim sPathSOLID As String = String.Empty
If GetPrivateProfileString(S_SIDES, "CreateSOLID", "", sPathSOLID, sIniFile) <> 0 And
GetPrivateProfileInt(S_SIDES, K_SIZEALWAYSONTOP, 0, sIniFile) = 0 Then
' Recupero file LUA
EgtLuaExecFile(sPathSOLID)
Dim dThick As Double = dRawHeight
EgtLuaSetGlobNumVar("CMP.THICK", dThick)
bOk = EgtLuaExecLine("CMP_Draw(false)")
Dim nErr As Integer = 0
EgtLuaGetGlobIntVar("CMP.ERR", nErr)
' Reset lua
EgtLuaResetGlobVar("CMP")
Else
EgtOutLog("CreateSolid3d Failed: file '" & sPathSOLID & "' not found or parameter 'SizeAlwaysOnTop' is TRUE")
End If
Return bOk
End Function
#End Region ' Compo Solid3d
'--------------------------------------------------------------------------------------------------
Friend Function CompoColor(sIniFile As String) As Color3d
Dim InsertColor As New Color3d(89, 210, 210, 25)
Dim IndexColor As Integer = GetPrivateProfileInt(S_COMPO, K_LASTCOLOR, 1, sIniFile)
@@ -18,7 +48,7 @@ Module Utility
End Function
Friend StopWatch As Stopwatch
Friend StopWatch As Stopwatch
Friend Sub TimeSpanInit()
StopWatch = New Stopwatch
@@ -26,20 +56,20 @@ Module Utility
End Sub
Friend Function TimeSpanEnd()
Dim sTime As String = ""
If Not IsNothing(StopWatch) Then
StopWatch.Stop()
Dim ts As TimeSpan = StopWatch.Elapsed
sTime = String.Format("{0:00}:{1:00}:{2:00}.{3:000}", ts.Hours, ts.Minutes, ts.Seconds, ts.Milliseconds)
End If
Return sTime
End Function
Dim sTime As String = ""
If Not IsNothing(StopWatch) Then
StopWatch.Stop()
Dim ts As TimeSpan = StopWatch.Elapsed
sTime = String.Format("{0:00}:{1:00}:{2:00}.{3:000}", ts.Hours, ts.Minutes, ts.Seconds, ts.Milliseconds)
End If
Return sTime
End Function
'--------------------------------------------------------------------------------------------------
Friend Sub UpdateUI()
'--------------------------------------------------------------------------------------------------
Friend Sub UpdateUI()
' Costringo ad aggiornare UI
Dim nDummy As Integer
Application.Current.Dispatcher.Invoke(Windows.Threading.DispatcherPriority.Background, _
Application.Current.Dispatcher.Invoke(Windows.Threading.DispatcherPriority.Background,
New Action(Function() nDummy = 0))
End Sub
@@ -366,20 +396,20 @@ Module Utility
If bOldEnMod Then EgtEnableModified()
End Sub
Friend Function SetTextColor( nGroup As Integer) As Boolean
Friend Function SetTextColor(nGroup As Integer) As Boolean
' Recupero il colore da assegnare ai testi
Dim colText As New Color3d( 0, 0, 0)
Dim colText As New Color3d(0, 0, 0)
Dim sTextColor As String = " "
Dim MainWindow As MainWindow = DirectCast(Application.Current.MainWindow, MainWindow)
If GetPrivateProfileString(S_NEST, K_TEXTCOLOR, " ", sTextColor, MainWindow.GetIniFile()) <> 0 Then
Dim sTextColorArray() As String = sTextColor.Split(",")
Dim nRed As Integer = 0 : Integer.TryParse( sTextColorArray(0), nRed)
Dim nGreen As Integer = 0 : Integer.TryParse( sTextColorArray(1), nGreen)
Dim nBlue As Integer = 0 : Integer.TryParse( sTextColorArray(2), nBlue)
colText.Setup( nRed, nGreen, nBlue)
Dim nRed As Integer = 0 : Integer.TryParse(sTextColorArray(0), nRed)
Dim nGreen As Integer = 0 : Integer.TryParse(sTextColorArray(1), nGreen)
Dim nBlue As Integer = 0 : Integer.TryParse(sTextColorArray(2), nBlue)
colText.Setup(nRed, nGreen, nBlue)
End If
' Assegno questo colore ai testi del layer indicato
Dim nId As Integer = EgtGetFirstInGroup( nGroup)
Dim nId As Integer = EgtGetFirstInGroup(nGroup)
While nId <> GDB_ID.NULL
If EgtGetType(nId) = GDB_TY.EXT_TEXT Then
EgtSetColor(nId, colText)
@@ -389,62 +419,62 @@ Module Utility
Return True
End Function
Friend Function AddTopToPartRegion( nRegId As Integer) As Boolean
Dim frReg As New Frame3d : EgtGetGroupGlobFrame( nRegId, frReg)
Dim b3Reg As New BBox3d : EgtGetBBoxGlob( nRegId, GDB_BB.STANDARD, b3Reg)
Friend Function AddTopToPartRegion(nRegId As Integer) As Boolean
Dim frReg As New Frame3d : EgtGetGroupGlobFrame(nRegId, frReg)
Dim b3Reg As New BBox3d : EgtGetBBoxGlob(nRegId, GDB_BB.STANDARD, b3Reg)
Dim dH As Double = Math.Min(0.1 * b3Reg.DimY(), 30)
Dim ptIns As New Point3d( b3Reg.Center().x, b3Reg.Max().y - dH, b3Reg.Max().z)
ptIns.ToLoc( frReg)
Dim nSfrId As Integer = EgtGetFirstInGroup( nRegId)
While nSfrId <> GDB_ID.NULL
If EgtGetType( nSfrId) = GDB_TY.SRF_FRGN Then Exit While
nSfrId = EgtGetNext( nSfrId)
Dim ptIns As New Point3d(b3Reg.Center().x, b3Reg.Max().y - dH, b3Reg.Max().z)
ptIns.ToLoc(frReg)
Dim nSfrId As Integer = EgtGetFirstInGroup(nRegId)
While nSfrId <> GDB_ID.NULL
If EgtGetType(nSfrId) = GDB_TY.SRF_FRGN Then Exit While
nSfrId = EgtGetNext(nSfrId)
End While
If nSfrId <> GDB_ID.NULL Then
Dim ptStart As New Point3d ( b3Reg.Min().x, b3Reg.Max().y - dH, b3Reg.Max().z)
ptStart.ToLoc( frReg)
Dim ptEnd As New Point3d ( b3Reg.Max().x, b3Reg.Max().y - dH, b3Reg.Max().z)
ptEnd.ToLoc( frReg)
Dim nLineId As Integer = EgtCreateLine( nRegId, ptStart, ptEnd)
Dim ptStart As New Point3d(b3Reg.Min().x, b3Reg.Max().y - dH, b3Reg.Max().z)
ptStart.ToLoc(frReg)
Dim ptEnd As New Point3d(b3Reg.Max().x, b3Reg.Max().y - dH, b3Reg.Max().z)
ptEnd.ToLoc(frReg)
Dim nLineId As Integer = EgtCreateLine(nRegId, ptStart, ptEnd)
Dim nCount As Integer = 0
Dim nNewId As Integer = EgtTrimCurveWithRegion( nLineId, nSfrId, True, False, nCount)
Dim nNewId As Integer = EgtTrimCurveWithRegion(nLineId, nSfrId, True, False, nCount)
If nNewId <> GDB_ID.NULL Then
If nCount > 0 Then EgtMidPoint( nNewId, ptIns)
If nCount > 0 Then EgtMidPoint(nNewId, ptIns)
For nTmpId As Integer = nNewId To nNewId + nCount - 1
EgtErase( nTmpId)
Next
EgtErase(nTmpId)
Next
Else
EgtErase( nLineId)
EgtErase(nLineId)
End If
End If
Dim vtDir As New Vector3d( 1, 0, 0)
vtDir.ToLoc( frReg)
Dim vtDir As New Vector3d(1, 0, 0)
vtDir.ToLoc(frReg)
Dim dLen, dAngV, dAngH As Double
vtDir.ToSpherical( dLen, dAngV, dAngH)
vtDir.ToSpherical(dLen, dAngV, dAngH)
Dim nText As Integer = EgtCreateTextAdv(nRegId, ptIns, dAngH, "*TOP*", "", 500, False, dH, 1, 0, INS_POS.MC)
Return ( nText <> GDB_ID.NULL)
Return (nText <> GDB_ID.NULL)
End Function
Friend Function SetBlockAndSlabNbr( sBlock As String, sSlabNbr As String) As Boolean
Friend Function SetBlockAndSlabNbr(sBlock As String, sSlabNbr As String) As Boolean
Dim nRawId As Integer = GetCurrentRaw()
If nRawId = GDB_ID.NULL Then Return False
If String.IsNullOrWhiteSpace(sBlock) Then sSlabNbr = ""
' Assegno info
EgtSetInfo( nRawId, INFO_RAW_BLOCK, sBlock)
EgtSetInfo( nRawId, INFO_RAW_SLABNBR, sSlabNbr)
EgtSetInfo(nRawId, INFO_RAW_BLOCK, sBlock)
EgtSetInfo(nRawId, INFO_RAW_SLABNBR, sSlabNbr)
' Cancello eventuale vecchio BarCode
EgtErase( EgtGetFirstNameInGroup( nRawId, NAME_BARCODE))
EgtErase(EgtGetFirstNameInGroup(nRawId, NAME_BARCODE))
' Se definito, inserisco nuovo BarCode
Dim sBarCode As String = sBlock & " - " & sSlabNbr
If sBarCode <> " - " Then
Dim ptRawCen As Point3d
GetRawCenter( ptRawCen)
GetRawCenter(ptRawCen)
Dim ptRawMin, ptRawMax As Point3d
GetRawBox( ptRawMin, ptRawMax)
Dim ptText As New Point3d( ptRawCen.x, ptRawCen.y, ptRawMax.z)
Dim nText As Integer = EgtCreateTextAdv( nRawId, ptText, 0, sBarCode, "", 500, False, 50.0, 1, 0, INS_POS.MC, GDB_RT.GLOB)
EgtSetName( nText, NAME_BARCODE)
EgtSetColor( nText, New Color3d(255, 0, 0))
GetRawBox(ptRawMin, ptRawMax)
Dim ptText As New Point3d(ptRawCen.x, ptRawCen.y, ptRawMax.z)
Dim nText As Integer = EgtCreateTextAdv(nRawId, ptText, 0, sBarCode, "", 500, False, 50.0, 1, 0, INS_POS.MC, GDB_RT.GLOB)
EgtSetName(nText, NAME_BARCODE)
EgtSetColor(nText, New Color3d(255, 0, 0))
End If
Return True
End Function
@@ -480,7 +510,7 @@ Module Utility
End Class
Public Function GetPrivateProfileLanguage( lpAppName As String, lpKeyName As String, lpFileName As String) As Language
Public Function GetPrivateProfileLanguage(lpAppName As String, lpKeyName As String, lpFileName As String) As Language
Dim sVal As String = String.Empty
GetPrivateProfileString(lpAppName, lpKeyName, "", sVal, lpFileName)
Dim sItems() As String = sVal.Split(",".ToCharArray)