Compare commits
23 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 5ce753e4b7 | |||
| d7445f828a | |||
| 3d44bbaa5c | |||
| fc68efd4f4 | |||
| 191a973ee3 | |||
| e3f628a07d | |||
| 2035c83062 | |||
| 3aa9129acc | |||
| 8ccfda96f8 | |||
| 8a67feab0f | |||
| f76d91fc20 | |||
| 372b084d53 | |||
| 00f30c943c | |||
| 4418d53557 | |||
| 0fe95e4ccc | |||
| c2d150b402 | |||
| 80857bb4e1 | |||
| 584a635ff4 | |||
| f1ddce36d8 | |||
| 8aae4ff8d0 | |||
| 01e0fa3a9c | |||
| 27bfef3fc1 | |||
| 6db4dd995f |
+28
-14
@@ -132,9 +132,6 @@ Public Class NestPageUC
|
||||
Not m_CurrProjPage.m_bSelectCurv Then
|
||||
Return
|
||||
End If
|
||||
|
||||
'------------------- NUOVA DEFINIZIONE -------------------------
|
||||
|
||||
' provo a riconoscere il valore medio del segmento
|
||||
' Verifico se selezionato indicativo di pezzo
|
||||
EgtSetObjFilterForSelWin(False, True, False, False, False)
|
||||
@@ -176,13 +173,9 @@ Public Class NestPageUC
|
||||
End If
|
||||
nIdMy = EgtGetNextObjInSelWin()
|
||||
End While
|
||||
|
||||
Return
|
||||
|
||||
'------------------- NUOVA DEFINIZIONE -------------------------
|
||||
End Sub
|
||||
|
||||
|
||||
Private Sub OnMyMouseDownScene(sender As Object, e As System.Windows.Forms.MouseEventArgs) Handles m_CurrProjPage.OnMouseDownScene
|
||||
' Verifico di essere il gestore attivo e non in modalità registrazione
|
||||
If Not m_bActive Or m_bRegister Then Return
|
||||
@@ -219,16 +212,37 @@ Public Class NestPageUC
|
||||
m_bDrag = True
|
||||
Exit While
|
||||
Else
|
||||
' verifico che tra gli elemnti selezionati ci sia un testo
|
||||
' verifico se l'elemento selezionato è il nome della tavola
|
||||
If EgtGetType(nId) = GDB_TY.EXT_TEXT AndAlso (sNamePartId = MAIN_TAB Or sNamePartId = SECOND_TAB) Then
|
||||
Dim nTab As Integer = m_MainWindow.m_CadCutPageUC.m_ProjectMgr.ChangeTable()
|
||||
' se non è stata eseguita nessuna selezione esco dal ciclo
|
||||
' se non è stata eseguita nessuna scelta esco dal ciclo
|
||||
If nTab = 0 Then Exit While
|
||||
'' Creo nuovo progetto
|
||||
'm_CurrProjPage.NewProject(nTabInd, bRetainParkedParts)
|
||||
'' Gestione stato FastGrid
|
||||
'm_MainWindow.m_CadCutPageUC.m_FastGridSlabManager.OnPostNewProject()
|
||||
'EgtZoom(ZM.ALL)
|
||||
' imposto l'altra tavola
|
||||
Dim sOtherTab = If( sNamePartId = MAIN_TAB, SECOND_TAB, MAIN_TAB)
|
||||
EgtChangeTable( sOtherTab, True)
|
||||
m_CurrProjPage.AdjustAdditionalTable( True)
|
||||
EgtSetMachineLook(MCH_LOOK.TAB)
|
||||
' aggiorno le lavorazioni
|
||||
UpdateAllMachiningsToolpaths()
|
||||
' aggiorno i movimenti pezzi tra disposizioni
|
||||
For nI As Integer = 1 To EgtGetPhaseCount()
|
||||
EgtSetCurrPhase( nI)
|
||||
Dim nDispId As Integer = EgtGetPhaseDisposition(nI)
|
||||
SpecialApplyDisposition(nDispId, True)
|
||||
Next
|
||||
' aggiorno posizionamento ventose per lavorazioni da sotto
|
||||
UpdateVacuumsForDrip()
|
||||
' dichiaro tutto aggiornato
|
||||
m_CurrProjPage.SetOrderMachiningFlag()
|
||||
EgtSetCurrPhase(1)
|
||||
' aggiorno posizione pezzi in parcheggio
|
||||
Dim nPPId As Integer = EgtGetFirstPart()
|
||||
While nPPId <> GDB_ID.NULL
|
||||
PackPartInStore(nPPId)
|
||||
nPPId = EgtGetNextPart( nPPId)
|
||||
End While
|
||||
' visualizzazione
|
||||
EgtZoom(ZM.ALL)
|
||||
Exit While
|
||||
End If
|
||||
End If
|
||||
|
||||
@@ -107,6 +107,7 @@
|
||||
Public Const K_ZBJOG As String = "ZBJog"
|
||||
Public Const K_POWERON As String = "PowerON"
|
||||
Public Const K_POWEROFF As String = "PowerOFF"
|
||||
Public Const K_REMOTE As String = "Remote"
|
||||
|
||||
Public Const S_PRODUCTIONLINE As String = "ProductionLine"
|
||||
Public Const K_ACTIVE As String = "Active"
|
||||
|
||||
@@ -164,7 +164,8 @@
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="5*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="4*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
@@ -191,13 +192,18 @@
|
||||
<!--<Image Source="{DynamicResource VacuumImg}" Style="{StaticResource OmagCut_ScaleButtonIcon}"/>-->
|
||||
</ToggleButton>
|
||||
|
||||
<!--Comando asse Z-B-->
|
||||
<ToggleButton Name="ZBBtn" Grid.Column="4"
|
||||
<!--Comando asse Z-B-->
|
||||
<ToggleButton Name="ZBBtn" Grid.Column="4"
|
||||
Style="{DynamicResource OmagCut_GradientYellowIconToggleButton}">
|
||||
<!--<Image Source="{DynamicResource VacuumImg}" Style="{StaticResource OmagCut_ScaleButtonIcon}"/>-->
|
||||
</ToggleButton>
|
||||
<!--<Image Source="{DynamicResource VacuumImg}" Style="{StaticResource OmagCut_ScaleButtonIcon}"/>-->
|
||||
</ToggleButton>
|
||||
|
||||
<Button Name="ManualModeBtn" Grid.Column="7"
|
||||
<!--Comando Remote-->
|
||||
<ToggleButton Name="RemoteBtn" Grid.Column="5"
|
||||
Style="{DynamicResource OmagCut_GradientYellowIconToggleButton}">
|
||||
<!--<Image Source="{DynamicResource VacuumImg}" Style="{StaticResource OmagCut_ScaleButtonIcon}"/>-->
|
||||
</ToggleButton>
|
||||
<Button Name="ManualModeBtn" Grid.Column="8"
|
||||
Style="{DynamicResource OmagCut_YellowGradientYellowIconButton}">
|
||||
<Image Source="{DynamicResource ManualImg}" Style="{StaticResource OmagCut_ScaleButtonIcon}"/>
|
||||
</Button>
|
||||
|
||||
@@ -73,7 +73,7 @@ Public Class DirectCutPageUC
|
||||
|
||||
'Posizionemento nella griglia delle Page UserControl
|
||||
m_MachineButtons.SetValue(Grid.RowProperty, 2)
|
||||
m_MachineButtons.SetValue(Grid.ColumnSpanProperty, 6)
|
||||
m_MachineButtons.SetValue(Grid.ColumnSpanProperty, 7)
|
||||
m_ManualAxesMove.SetValue(Grid.RowProperty, 1)
|
||||
If m_bManulaCut Then
|
||||
m_SingleCutAuto.SetValue(Grid.RowProperty, 1)
|
||||
@@ -89,15 +89,14 @@ Public Class DirectCutPageUC
|
||||
m_ControlsMachineButton.SetValue(Grid.RowProperty, 1)
|
||||
m_VacuumMachineButton.SetValue(Grid.RowProperty, 1)
|
||||
|
||||
Dim bCollapsedNewBottonsConsole As Boolean = False
|
||||
' verifico che sia presente almeno uno dei bottoni della nuova console (SOLO PER MACCHINA CON paragrafo [ControlMachButtons])
|
||||
Dim bCollapsedNewBottonsConsole As Boolean = Not m_ControlsMachineButton.GetPrivateProfileMachineButtons("JogButtons", "Button1", Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, m_MainWindow.GetMachIniFile())
|
||||
m_NewMachineButtonsType = m_ControlsMachineButton.GetPrivateProfileMachineButtons(S_CONTROLMACHBUTTONS, "Button1", Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, m_MainWindow.GetMachIniFile())
|
||||
If Not m_NewMachineButtonsType Then
|
||||
'Assegno MachineButtons alla pagina
|
||||
LowerButtonGrid.Children.Add(m_MachineButtons)
|
||||
ControlsMachineBtn.Visibility = Windows.Visibility.Collapsed
|
||||
VacuumMachineBtn.Visibility = Windows.Visibility.Collapsed
|
||||
' per le configurazioni diverse dalla Digitale5
|
||||
bCollapsedNewBottonsConsole = True
|
||||
End If
|
||||
|
||||
If GetPrivateProfileInt(S_NUMERICALCONTROL, K_TYPE, 0, m_MainWindow.GetMachIniFile()) = 0 Then
|
||||
@@ -121,20 +120,27 @@ Public Class DirectCutPageUC
|
||||
SawTestBtn.Content = EgtMsg(90207)
|
||||
|
||||
' nuovi bottoni 20/05/2021 - modifica specifiche 04/08/2021
|
||||
' leggo il numero di assi attivi nella macchina
|
||||
Dim AxesNumber = GetPrivateProfileInt(S_AXES, K_AXESNUM, 5, m_MainWindow.GetMachIniFile())
|
||||
Dim x As Integer = GetPrivateProfileInt(S_NCDATA, K_NEWCONSOLE, 0, m_MainWindow.GetMachIniFile())
|
||||
If GetPrivateProfileInt(S_NCDATA, K_NEWCONSOLE, 0, m_MainWindow.GetMachIniFile()) = 1 And Not bCollapsedNewBottonsConsole Then
|
||||
XYBtn.Content = "X - Y"
|
||||
ZCBtn.Content = "Z - C"
|
||||
If AxesNumber < 5 Then
|
||||
ZBBtn.Visibility = Windows.Visibility.Collapsed
|
||||
End If
|
||||
ZBBtn.Content = "Z - B"
|
||||
Else
|
||||
XYBtn.Visibility = Windows.Visibility.Collapsed
|
||||
ZCBtn.Visibility = Windows.Visibility.Collapsed
|
||||
ZBBtn.Visibility = Windows.Visibility.Collapsed
|
||||
End If
|
||||
|
||||
'' leggo se è stata configurata la nuova conole
|
||||
'If GetPrivateProfileInt(S_NCDATA, K_NEWCONSOLE, 0, m_MainWindow.GetMachIniFile()) = 1 And Not bCollapsedNewBottonsConsole Then
|
||||
' XYBtn.Content = "X - Y"
|
||||
' XYBtn.Foreground = Brushes.White
|
||||
' ZCBtn.Content = "Z - C"
|
||||
' ZCBtn.Foreground = Brushes.White
|
||||
' If AxesNumber < 5 Then
|
||||
' ZBBtn.Visibility = Windows.Visibility.Collapsed
|
||||
' End If
|
||||
' ZBBtn.Content = "Z - B"
|
||||
' ZBBtn.Foreground = Brushes.White
|
||||
' RemoteBtn.Content = "Remote"
|
||||
' RemoteBtn.Foreground = Brushes.White
|
||||
'Else
|
||||
' XYBtn.Visibility = Windows.Visibility.Collapsed
|
||||
' ZCBtn.Visibility = Windows.Visibility.Collapsed
|
||||
' ZBBtn.Visibility = Windows.Visibility.Collapsed
|
||||
'End If
|
||||
|
||||
End Sub
|
||||
|
||||
@@ -174,6 +180,8 @@ Public Class DirectCutPageUC
|
||||
End If
|
||||
End If
|
||||
End While
|
||||
' attivo la visualizzazione dei comandi
|
||||
SetVisibilityJogButtuns()
|
||||
' lo stato di questi comandi vieni carico dalla lettura del PLC (refresh)
|
||||
'----------- FINE NUOVI BOTTONI------------
|
||||
|
||||
@@ -227,6 +235,35 @@ Public Class DirectCutPageUC
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub SetVisibilityJogButtuns()
|
||||
XYBtn.Visibility = Visibility.Collapsed
|
||||
ZCBtn.Visibility = Visibility.Collapsed
|
||||
ZBBtn.Visibility = Visibility.Collapsed
|
||||
RemoteBtn.Visibility = Visibility.Collapsed
|
||||
|
||||
Dim Item As MachineButton = Nothing
|
||||
For Each Item In m_ButtonJogList
|
||||
Select Case Item.StateFlag.Trim
|
||||
Case K_XYJOG
|
||||
XYBtn.Visibility = Visibility.Visible
|
||||
XYBtn.Foreground = Brushes.White
|
||||
XYBtn.Content = "X - Y"
|
||||
Case K_ZCJOG
|
||||
ZCBtn.Visibility = Visibility.Visible
|
||||
ZCBtn.Foreground = Brushes.White
|
||||
ZCBtn.Content = "Z - C"
|
||||
Case K_ZBJOG
|
||||
ZBBtn.Visibility = Visibility.Visible
|
||||
ZBBtn.Foreground = Brushes.White
|
||||
ZBBtn.Content = "Z - B"
|
||||
Case K_REMOTE
|
||||
RemoteBtn.Visibility = Visibility.Visible
|
||||
RemoteBtn.Foreground = Brushes.White
|
||||
RemoteBtn.Content = "Remote"
|
||||
End Select
|
||||
Next
|
||||
End Sub
|
||||
|
||||
Private Sub PhotoBtn_Click(sender As Object, e As RoutedEventArgs) Handles PhotoBtn.Click
|
||||
EgtSetCurrentContext(m_MainWindow.m_CurrentProjectPageUC.CurrentProjectScene.GetCtx())
|
||||
' Se macchina fotografica collegata, faccio una foto
|
||||
@@ -326,7 +363,16 @@ Public Class DirectCutPageUC
|
||||
|
||||
'------------------NUOVI BOTTONI PER GESTIONE JOYSTICK-------------------------------------------------
|
||||
Private Sub XYBtn_Click(sender As Object, e As RoutedEventArgs) Handles XYBtn.Click
|
||||
Dim XYJogButton As MachineButton = m_ButtonJogList(0)
|
||||
' riverco in elenco il bottone XYJog
|
||||
Dim XYJogButton As MachineButton = Nothing
|
||||
Dim ItemButton As MachineButton = Nothing
|
||||
For Each ItemButton In m_ButtonJogList
|
||||
If ItemButton.StateFlag = K_XYJOG Then
|
||||
XYJogButton = ItemButton
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
If IsNothing(XYJogButton) Then Return
|
||||
' eseguo lo script lua associato
|
||||
XYJogButton.ExecuteMDICommand(XYJogButton.TLuaScriptName)
|
||||
' che comunica al PLC di cambiare lo stato, la modifica dello stato è intercettata dalla funzione Refresh che avvia il metodo Changed
|
||||
@@ -349,7 +395,16 @@ Public Class DirectCutPageUC
|
||||
End Sub
|
||||
|
||||
Private Sub ZCBtn_Click(sender As Object, e As RoutedEventArgs) Handles ZCBtn.Click
|
||||
Dim ZJogButton As MachineButton = m_ButtonJogList(1)
|
||||
' riverco in elenco il bottone ZCYJog
|
||||
Dim ZJogButton As MachineButton = Nothing
|
||||
Dim ItemButton As MachineButton = Nothing
|
||||
For Each ItemButton In m_ButtonJogList
|
||||
If ItemButton.StateFlag = K_ZCJOG Then
|
||||
ZJogButton = ItemButton
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
If IsNothing(ZJogButton) Then Return
|
||||
' eseguo lo script lua associato
|
||||
ZJogButton.ExecuteMDICommand(ZJogButton.TLuaScriptName)
|
||||
End Sub
|
||||
@@ -370,9 +425,18 @@ Public Class DirectCutPageUC
|
||||
End Sub
|
||||
|
||||
Private Sub ZBBtn_Click(sender As Object, e As RoutedEventArgs) Handles ZBBtn.Click
|
||||
Dim BCJogButton As MachineButton = m_ButtonJogList(2)
|
||||
' riverco in elenco il bottone ZCYJog
|
||||
Dim ZBJogButton As MachineButton = Nothing
|
||||
Dim ItemButton As MachineButton = Nothing
|
||||
For Each ItemButton In m_ButtonJogList
|
||||
If ItemButton.StateFlag = K_ZBJOG Then
|
||||
ZBJogButton = ItemButton
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
If IsNothing(ZBJogButton) Then Return
|
||||
' eseguo lo script lua associato
|
||||
BCJogButton.ExecuteMDICommand(BCJogButton.TLuaScriptName)
|
||||
ZBJogButton.ExecuteMDICommand(ZBJogButton.TLuaScriptName)
|
||||
End Sub
|
||||
|
||||
Friend Sub ZBJogChanged(bBCAxes As Boolean)
|
||||
@@ -389,6 +453,44 @@ Public Class DirectCutPageUC
|
||||
ZBBtn.IsChecked = bBCAxes
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub RemoteBtn_Click(sender As Object, e As RoutedEventArgs) Handles RemoteBtn.Click
|
||||
Dim RemoteButton As MachineButton = Nothing
|
||||
Dim ItemButton As MachineButton = Nothing
|
||||
For Each ItemButton In m_ButtonJogList
|
||||
If ItemButton.StateFlag = K_REMOTE Then
|
||||
RemoteButton = ItemButton
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
If IsNothing(RemoteButton) Then Return
|
||||
' eseguo lo script lua associato
|
||||
Dim CurrentBtn As Primitives.ToggleButton = e.Source
|
||||
Dim sLuaFileName As String = String.Empty
|
||||
' verifico lo stato del bottone per avviare il giusto script
|
||||
If CurrentBtn.IsChecked() Then
|
||||
sLuaFileName = RemoteButton.TLuaScriptName
|
||||
Else
|
||||
sLuaFileName = RemoteButton.FLuaScriptName
|
||||
End If
|
||||
RemoteButton.ExecuteMDICommand(sLuaFileName)
|
||||
End Sub
|
||||
|
||||
Friend Sub RemoteChanged(bRemote As Boolean)
|
||||
' devo decodificare il tipo di pulsante, quindi eseguire la conversione...
|
||||
Dim RemoteButton As TwoStateButton = Nothing
|
||||
For Each MachineButton As MachineButton In m_ButtonJogList
|
||||
If MachineButton.StateFlag.Trim = K_REMOTE Then
|
||||
RemoteButton = MachineButton
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
If Not IsNothing(RemoteButton) Then
|
||||
RemoteButton.SetIsChecked(bRemote)
|
||||
RemoteBtn.IsChecked = bRemote
|
||||
End If
|
||||
End Sub
|
||||
|
||||
'------------------NUOVI BOTTONI PER GESTIONE JOYSTICK-------------------------------------------------
|
||||
Private Sub MachViewModeBtn_Click(sender As Object, e As RoutedEventArgs) Handles MachViewModeBtn.Click
|
||||
If m_bShowMachine Then
|
||||
|
||||
@@ -121,6 +121,8 @@ Public Class MachineButtonsUC
|
||||
CurrToggleBtn.Content = "Z - C"
|
||||
ElseIf StateFlagArray(nIndex) = K_ZBJOG Then
|
||||
CurrToggleBtn.Content = "Z - B"
|
||||
ElseIf StateFlagArray(nIndex) = K_REMOTE Then
|
||||
CurrToggleBtn.Content = "Remote"
|
||||
End If
|
||||
Catch ex As Exception
|
||||
EgtOutLog("Error loading content " & StateFlagArray(nIndex))
|
||||
@@ -602,6 +604,15 @@ Public Class MachineButtonsUC
|
||||
' selezoiono lo stato del bottone
|
||||
GetToggleButton(nIndex + 1).IsChecked = bBCAxes
|
||||
End Sub
|
||||
|
||||
Friend Sub RemoteChanged(ByVal bRemote As Boolean)
|
||||
' recupero le asscociazioni con i bottoni
|
||||
Dim nIndex As Integer = Array.IndexOf(StateFlagArray, K_REMOTE)
|
||||
If nIndex = -1 Then Return
|
||||
' selezoiono lo stato del bottone
|
||||
GetToggleButton(nIndex + 1).IsChecked = bRemote
|
||||
End Sub
|
||||
|
||||
'-----------------------------------------------------------------------------------------------------------------
|
||||
|
||||
Private Function GetToggleButton(ByVal nIndex As Integer) As Primitives.ToggleButton
|
||||
|
||||
@@ -201,11 +201,12 @@ Public Class ManualAxesMoveUC
|
||||
EgtOutLog("CmdString=" & CmdString)
|
||||
' Eseguo in MDI
|
||||
m_CN.DGeneralFunctions_WriteCncMode(2) ' Modalità MDI
|
||||
System.Threading.Thread.Sleep(m_MainWindow.m_CurrentMachine.nThreadSleep)
|
||||
System.Threading.Thread.Sleep(150)
|
||||
m_CN.sz_ManualDataInput = CmdString
|
||||
m_CN.MDI_command()
|
||||
System.Threading.Thread.Sleep(m_MainWindow.m_CurrentMachine.nThreadSleep)
|
||||
System.Threading.Thread.Sleep(150)
|
||||
m_CN.DGeneralFunctions_CycleStart()
|
||||
System.Threading.Thread.Sleep(m_MainWindow.m_CurrentMachine.nThreadSleep)
|
||||
m_CN.DGeneralFunctions_WriteCncMode(7) ' Modalità manuale
|
||||
m_MoveClicked = False
|
||||
End Sub
|
||||
|
||||
@@ -157,6 +157,13 @@ Public Class AlzFrontUC
|
||||
Else
|
||||
AlzFrontEntityList.Add(New AlzFrontEntity(sNameCurrLine, CurrLine))
|
||||
End If
|
||||
' inserisco riferimento univoco al lato (solo se non esiste)
|
||||
Dim sInfoRef As String = String.Empty
|
||||
EgtGetInfo(CurrLine, "RefAF", sInfoRef)
|
||||
If String.IsNullOrEmpty(sInfoRef) Then
|
||||
Dim sRefGUID As String = System.Guid.NewGuid().ToString()
|
||||
EgtSetInfo(CurrLine, "RefAF", sRefGUID)
|
||||
End If
|
||||
nEntityIndex += 1
|
||||
Else
|
||||
EgtSetName(CurrLine, "B" & nOtherIndex.ToString)
|
||||
|
||||
@@ -1043,6 +1043,9 @@ Public Class DrawPageUC
|
||||
dNewArea += GeomCalc.GetPartArea(nId2)
|
||||
' Inserisco in parcheggio
|
||||
m_MainWindow.m_CadCutPageUC.m_NestPage.StoreOnePart(nId2, True)
|
||||
' Aggiungo riferimento e lo inserisco in VeinMatching
|
||||
VeinMatching.SetRefOnPart(nId2)
|
||||
VeinMatching.AddPartFromDraw(nId2, True)
|
||||
' Se richiesto posizionamento diretto, lo eseguo
|
||||
If bDirect Then
|
||||
If m_MainWindow.m_CadCutPageUC.m_NestPage.InsertOnePart(nId2) Then
|
||||
|
||||
@@ -62,5 +62,5 @@ Imports System.Windows
|
||||
' by using the '*' as shown below:
|
||||
' <Assembly: AssemblyVersion("1.0.*")>
|
||||
|
||||
<Assembly: AssemblyVersion("2.3.9.1")>
|
||||
<Assembly: AssemblyFileVersion("2.3.9.1")>
|
||||
<Assembly: AssemblyVersion("2.3.9.3")>
|
||||
<Assembly: AssemblyFileVersion("2.3.9.3")>
|
||||
|
||||
@@ -326,20 +326,23 @@ Public Class CNCommunication
|
||||
m_CN.SetCnDataVar(CN_generico.CnData.BypassState, sVal)
|
||||
|
||||
' nuove variabili: stato dei nuovi pulsanti
|
||||
m_IsNewConsole = GetPrivateProfileString(S_NCDATA, K_NEWCONSOLE, "", sVal, m_MainWindow.GetMachIniFile())
|
||||
GetPrivateProfileString(S_NCDATA, K_NEWCONSOLE, "", sVal, m_MainWindow.GetMachIniFile())
|
||||
m_IsNewConsole = (sVal = 1)
|
||||
If m_IsNewConsole Then
|
||||
GetPrivateProfileString(S_NCDATA, K_XYJOG, "", sVal, m_MainWindow.GetMachIniFile())
|
||||
m_CN.SetCnDataVar(CN_generico.CnData.XYJog, sVal)
|
||||
If Not String.IsNullOrEmpty(sVal) Then m_CN.SetCnDataVar(CN_generico.CnData.XYJog, sVal)
|
||||
GetPrivateProfileString(S_NCDATA, K_ZCJOG, "", sVal, m_MainWindow.GetMachIniFile())
|
||||
m_CN.SetCnDataVar(CN_generico.CnData.ZCJog, sVal)
|
||||
If Not String.IsNullOrEmpty(sVal) Then m_CN.SetCnDataVar(CN_generico.CnData.ZCJog, sVal)
|
||||
GetPrivateProfileString(S_NCDATA, K_ZBJOG, "", sVal, m_MainWindow.GetMachIniFile())
|
||||
m_CN.SetCnDataVar(CN_generico.CnData.ZBJog, sVal)
|
||||
If Not String.IsNullOrEmpty(sVal) Then m_CN.SetCnDataVar(CN_generico.CnData.ZBJog, sVal)
|
||||
GetPrivateProfileString(S_NCDATA, K_POWERON, "", sVal, m_MainWindow.GetMachIniFile())
|
||||
m_CN.SetCnDataVar(CN_generico.CnData.PowerON, sVal)
|
||||
If Not String.IsNullOrEmpty(sVal) Then m_CN.SetCnDataVar(CN_generico.CnData.PowerON, sVal)
|
||||
GetPrivateProfileString(S_NCDATA, K_REMOTE, "", sVal, m_MainWindow.GetMachIniFile())
|
||||
If Not String.IsNullOrEmpty(sVal) Then m_CN.SetCnDataVar(CN_generico.CnData.Remote, sVal)
|
||||
End If
|
||||
|
||||
' Inizializzo la comunicazione
|
||||
m_CN.Init()
|
||||
' Inizializzo la comunicazione
|
||||
m_CN.Init()
|
||||
|
||||
Catch ex As Exception
|
||||
' set status to statusbar
|
||||
@@ -558,6 +561,7 @@ Public Class CNCommunication
|
||||
m_MainWindow.m_DirectCutPageUC.XYJogChanged(m_CN.bXYJog)
|
||||
m_MainWindow.m_DirectCutPageUC.ZCJogChanged(m_CN.bZCJog)
|
||||
m_MainWindow.m_DirectCutPageUC.ZBJogChanged(m_CN.bZBCJog)
|
||||
m_MainWindow.m_DirectCutPageUC.RemoteChanged(m_CN.bRemote)
|
||||
End If
|
||||
Else
|
||||
m_MainWindow.m_DirectCutPageUC.m_MachineButtons.SpindleStateChanged(m_CN.bSpindleState)
|
||||
@@ -578,6 +582,7 @@ Public Class CNCommunication
|
||||
m_MainWindow.m_DirectCutPageUC.m_MachineButtons.XYJogChanged(m_CN.bXYJog)
|
||||
m_MainWindow.m_DirectCutPageUC.m_MachineButtons.ZJogChanged(m_CN.bZCJog)
|
||||
m_MainWindow.m_DirectCutPageUC.m_MachineButtons.BCJogChanged(m_CN.bZBCJog)
|
||||
m_MainWindow.m_DirectCutPageUC.m_MachineButtons.RemoteChanged(m_CN.bRemote)
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
@@ -8,7 +8,7 @@ Public MustInherit Class CN_generico
|
||||
Public Const MAX_VAR As Short = 100
|
||||
Public Const MAX_VALUES As Short = 9 ' Max. index to read the data from the FXServer array
|
||||
Public Const MAX_TOOLS As Short = 100
|
||||
Public Const NUM_DATA = 51 ' Numero di dati del CN (Speed,Feed,...)
|
||||
Public Const NUM_DATA = 52 ' Numero di dati del CN (Speed,Feed,...)
|
||||
|
||||
Public m_NewVariable As Boolean = False ' per scrittura delle vairbaili Apllication del PLC
|
||||
|
||||
@@ -65,6 +65,7 @@ Public MustInherit Class CN_generico
|
||||
ZCJog = 48
|
||||
ZBJog = 49
|
||||
PowerON = 50
|
||||
Remote = 51
|
||||
End Enum
|
||||
|
||||
#End Region
|
||||
@@ -205,6 +206,7 @@ Public MustInherit Class CN_generico
|
||||
Public bZBCJog As Boolean
|
||||
|
||||
Public bPowerON As Boolean
|
||||
Public bRemote As Boolean
|
||||
' Nuovi di bottoni -------------------------------------------
|
||||
|
||||
Public nMachineMode As Integer
|
||||
|
||||
+3
-1
@@ -236,7 +236,7 @@ Namespace Num
|
||||
' Detect and identify the Flexium CNC type
|
||||
sz_CncFxIdentifier = objDMainCncData.GetCncIdentifier()
|
||||
' _txtGetCncIdentification.Invoke(DirectCast(Sub() _txtGetCncIdentification.Text = CncFxIdentifier, MethodInvoker))
|
||||
|
||||
EgtOutLog("Modello Flexium: " & sz_CncFxIdentifier)
|
||||
If sz_CncFxIdentifier = "Flexium 6" OrElse sz_CncFxIdentifier = "Flexium 8" OrElse sz_CncFxIdentifier = "Flexium 68" Then
|
||||
IsFlexiumPlus = False
|
||||
Else
|
||||
@@ -1085,6 +1085,8 @@ Namespace Num
|
||||
bZBCJog = CBool(values(n))
|
||||
Case CnData.PowerON ' (49)
|
||||
bPowerON = CBool(values(n))
|
||||
Case CnData.Remote ' (50)
|
||||
bRemote = CBool(values(n))
|
||||
|
||||
End Select
|
||||
Next
|
||||
|
||||
@@ -735,7 +735,6 @@
|
||||
<ItemGroup>
|
||||
<Resource Include="Resources\AvantiVeloce.png" />
|
||||
<Resource Include="Resources\IndietroVeloce.png" />
|
||||
<Resource Include="Resources\NewIcons\ZCJog.png" />
|
||||
<Resource Include="Resources\Pause.png" />
|
||||
<Resource Include="Resources\Play.png" />
|
||||
</ItemGroup>
|
||||
@@ -1034,10 +1033,6 @@
|
||||
<ItemGroup>
|
||||
<Resource Include="Resources\NewIcons\SlabId.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Resource Include="Resources\NewIcons\XYJog.png" />
|
||||
<Resource Include="Resources\NewIcons\ZBJog.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Resource Include="Resources\NewIcons\Nuovo.png" />
|
||||
</ItemGroup>
|
||||
|
||||
@@ -458,7 +458,7 @@ Public Class CurrentProjectPageUC
|
||||
Return True
|
||||
End Function
|
||||
|
||||
Friend Function AdjustAdditionalTable() As Boolean
|
||||
Friend Function AdjustAdditionalTable( Optional bForced As Boolean = False) As Boolean
|
||||
' Recupero altezza sottotavola corrente
|
||||
Dim nFixtId As Integer = EgtGetFirstNameInGroup(EgtGetFirstMachGroup(), MACH_FIXT_GROUP)
|
||||
Dim nAddTabId As Integer = EgtGetFirstNameInGroup(nFixtId, MACH_ADD_TABLE)
|
||||
@@ -470,7 +470,7 @@ Public Class CurrentProjectPageUC
|
||||
End If
|
||||
' Se valore cambiato, aggiorno...
|
||||
Dim dDeltaZ As Double = m_MainWindow.m_CurrentMachine.dAdditionalTable - dCurrAddTab
|
||||
If Math.Abs(dDeltaZ) > EPS_SMALL Then
|
||||
If Math.Abs(dDeltaZ) > EPS_SMALL Or bForced Then
|
||||
AddAdditionalTable()
|
||||
UpdateAllRawsZ(dDeltaZ)
|
||||
If GetPhoto() <> GDB_ID.NULL Then
|
||||
|
||||
@@ -1562,7 +1562,7 @@ Public Class RawPartPageUC
|
||||
StringToLen(WidthTxBx.Text, m_RawWidth)
|
||||
StringToLen(OffsetXTxBx.Text, m_RawOffsX)
|
||||
StringToLen(OffsetYTxBx.Text, m_RawOffsY)
|
||||
UpdateRawPart()
|
||||
' UpdateRawPart()
|
||||
UpdateRawPartKerf()
|
||||
' Recupero id contorno kerf
|
||||
Dim nKerfId As Integer = EgtGetFirstNameInGroup(m_CurrProjPage.m_nRawId, NAME_KERF)
|
||||
@@ -1587,7 +1587,7 @@ Public Class RawPartPageUC
|
||||
m_RawOffsX = m_RawOffsX - m_RawKerf
|
||||
StringToLen(OffsetYTxBx.Text, m_RawOffsY)
|
||||
m_RawOffsY = m_RawOffsY - m_RawKerf
|
||||
UpdateRawPart()
|
||||
' UpdateRawPart()
|
||||
m_RawKerf = -m_RawKerf
|
||||
UpdateRawPartKerf()
|
||||
' Recupero id contorno kerf
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 46 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 39 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 41 KiB |
@@ -17,7 +17,10 @@
|
||||
<Button Name="ExportBtn" Height="64"
|
||||
Style="{DynamicResource OmagCut_YellowTextButton}"
|
||||
Content="Export"/>
|
||||
</StackPanel>
|
||||
<Button Name="AssemblyBtn" Height="64"
|
||||
Style="{DynamicResource OmagCut_YellowTextButton}"
|
||||
Content="3D"/>
|
||||
</StackPanel>
|
||||
|
||||
</Grid>
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
Imports System.IO
|
||||
Imports System.Windows.Interop
|
||||
Imports System.Collections.ObjectModel
|
||||
Imports System.Runtime.InteropServices
|
||||
Imports EgtUILib
|
||||
Imports EgtWPFLib
|
||||
@@ -86,6 +87,7 @@ Public Class VeinMatchingWindow
|
||||
End If
|
||||
End Sub
|
||||
|
||||
' imposto le dimensioni e la posizione della pagina corrente
|
||||
Friend Sub AdjustPosition()
|
||||
' Se già pozizionata, esco subito
|
||||
If m_bPositioned Then Return
|
||||
@@ -164,7 +166,7 @@ Public Class VeinMatchingWindow
|
||||
EgtSetCurrentContext(VeinMatchingScene.GetCtx())
|
||||
' Se selezione riuscita, la eseguo anche in VME
|
||||
If bSelected Then EgtSelectObj(m_nIdToSel)
|
||||
' Se deselezione da eseguire
|
||||
' Se deselezione da eseguire
|
||||
ElseIf m_nIdToDesel <> GDB_ID.NULL Then
|
||||
' Eseguo la deselezione in Nesting
|
||||
Dim bDeselected As Boolean = False
|
||||
@@ -193,9 +195,16 @@ Public Class VeinMatchingWindow
|
||||
VeinMatching.Export(m_MainWindow.GetVeinMatchingDir() & "\Image.jpg")
|
||||
End Sub
|
||||
|
||||
Private Sub AssemblyBtn_Click(sender As Object, e As RoutedEventArgs) Handles AssemblyBtn.Click
|
||||
Dim ThicknessRaw As Double = m_MainWindow.m_CurrentProjectPageUC.m_dRawHeight
|
||||
VeinMatching.AssemblyParts(ThicknessRAw)
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
|
||||
Friend Module VeinMatching
|
||||
' creo la lista delle alzatine, ad ogni alzatina associo anche il lato del piano cucina (e non solo) a cui si riferisce
|
||||
Private m_ListALZFront As New ObservableCollection(Of Aletta)
|
||||
|
||||
' Riferimento alla MainWindow
|
||||
Private m_MainWindow As MainWindow = DirectCast(Application.Current.MainWindow, MainWindow)
|
||||
@@ -243,6 +252,93 @@ Friend Module VeinMatching
|
||||
Return True
|
||||
End Function
|
||||
|
||||
' aggiungo il disegno nel VeinMatch
|
||||
Friend Function SetRefOnPart(nId As Integer) As Boolean
|
||||
' Si opera nel contesto corrente (CurrentProjectScene.GetCtx())
|
||||
' Verifico validità identificativo oggetto
|
||||
If nId = GDB_ID.NULL Then Return False
|
||||
' Recupero gruppo regione
|
||||
Dim nRegLayId As Integer = EgtGetFirstNameInGroup(nId, NAME_REGION)
|
||||
' Se c'è già il riferimento, esco
|
||||
If EgtGetFirstNameInGroup(nRegLayId, REF_NAME) <> GDB_ID.NULL Then Return True
|
||||
' Entità superficie regione piatta
|
||||
Dim nRegId As Integer = EgtGetFirstInGroup(nRegLayId)
|
||||
While nRegId <> GDB_ID.NULL
|
||||
If EgtGetType(nRegId) = GDB_TY.SRF_FRGN Then
|
||||
Exit While
|
||||
End If
|
||||
nRegId = EgtGetNext(nRegId)
|
||||
End While
|
||||
' Ne recupero il centroide
|
||||
Dim ptCen As Point3d
|
||||
EgtCentroid(nRegId, GDB_ID.ROOT, ptCen)
|
||||
' Inserisco il riferimento
|
||||
Dim frRef As New Frame3d(ptCen)
|
||||
Dim nRefId As Integer = EgtCreateGeoFrame(nRegLayId, frRef, GDB_RT.GLOB)
|
||||
EgtSetName(nRefId, REF_NAME)
|
||||
' salvo nelle info il riferimento originale
|
||||
EgtSetInfo(nRefId, KEY_ORI_REF, frRef)
|
||||
' nascondo l'oggetto appena inserito
|
||||
EgtSetMode(nRefId, GDB_MD.HIDDEN)
|
||||
Return True
|
||||
End Function
|
||||
|
||||
' ------------------- ELENCO FUNZIONI PER GESTIONE ALZATINE E FRONTALINI -------------------
|
||||
' genero la lista delle alzatine dei frontalini
|
||||
Friend Function CreateListAlzAndFront() As Boolean
|
||||
EgtSetCurrentContext(m_nVeinCtx)
|
||||
Dim nId As Integer = EgtGetFirstPart()
|
||||
While nId <> GDB_ID.NULL
|
||||
' verifico che il pezzo sia una alzatina
|
||||
Dim sInfoName As String = String.Empty
|
||||
EgtGetInfo(nId, "CMP", sInfoName)
|
||||
If sInfoName = "AlzFront" Then
|
||||
Dim AlzFront As New Aletta(nId)
|
||||
m_ListALZFront.Add(AlzFront)
|
||||
End If
|
||||
' Passo al pezzo successivo
|
||||
nId = EgtGetNextPart(nId)
|
||||
End While
|
||||
Return True
|
||||
End Function
|
||||
|
||||
' genero la lista dei piani cucina
|
||||
Friend Function LinkReferencesOnAlette() As Boolean
|
||||
Dim nId As Integer = EgtGetFirstPart()
|
||||
While nId <> GDB_ID.NULL
|
||||
' escludo dalla ricerca le alette
|
||||
Dim sCMP As String = String.Empty
|
||||
EgtGetInfo(nId, "CMP", sCMP)
|
||||
If sCMP = "AlzFront" Then
|
||||
' Passo al pezzo successivo
|
||||
nId = EgtGetNextPart(nId)
|
||||
Continue While
|
||||
End If
|
||||
' Recupero gruppo regione
|
||||
Dim nOutLoopLayId As Integer = EgtGetFirstNameInGroup(nId, NAME_OUTLOOP)
|
||||
' Entità lato
|
||||
Dim nSideId As Integer = EgtGetFirstInGroup(nOutLoopLayId)
|
||||
While nSideId <> GDB_ID.NULL
|
||||
Dim sInfoGUID As String = String.Empty
|
||||
EgtGetInfo(nSideId, "RefAF", sInfoGUID)
|
||||
If Not String.IsNullOrEmpty(sInfoGUID) Then
|
||||
Dim Item As Aletta
|
||||
For Each Item In m_ListALZFront
|
||||
If Item.RefGUID = sInfoGUID Then
|
||||
Item.IdSideRef = nSideId
|
||||
End If
|
||||
Next
|
||||
' ricerco nella lista delle alette il suo
|
||||
End If
|
||||
nSideId = EgtGetNext(nSideId)
|
||||
End While
|
||||
' Passo al pezzo successivo
|
||||
nId = EgtGetNextPart(nId)
|
||||
End While
|
||||
Return True
|
||||
End Function
|
||||
' ------------------- ELENCO FUNZIONI PER GESTIONE ALZATINE E FRONTALINI -------------------
|
||||
|
||||
Friend Function Clear() As Boolean
|
||||
' Verifico esista il contesto del VeinMatching
|
||||
If m_nVeinCtx = 0 Then Return True
|
||||
@@ -319,6 +415,31 @@ Friend Module VeinMatching
|
||||
Return True
|
||||
End Function
|
||||
|
||||
' Questa funzione gestisce l'insermento dei pezzi disgenatoi direttamente in DrawPage
|
||||
Friend Function AddPartFromDraw(nPartId As Integer, Optional bPack As Boolean = False) As Boolean
|
||||
' Verifico esista il contesto del VeinMatching
|
||||
If m_nVeinCtx = 0 Then Return True
|
||||
' Se esiste già il pezzo nel VM, esco
|
||||
If GetVeinPartId(nPartId) <> GDB_ID.NULL Then Return True
|
||||
' Verifico validità pezzo
|
||||
If nPartId = GDB_ID.NULL Then Return False
|
||||
' Salvo il pezzo su file temporaneo
|
||||
Dim sTmpDir As String = String.Empty
|
||||
If Not EgtGetTempDir(sTmpDir) Then Return False
|
||||
Dim sTmpFile As String = sTmpDir & "\FlatPartVme.Nge"
|
||||
EgtSaveObjToFile(nPartId, sTmpFile, NGE.BIN)
|
||||
' Carico il file nel VM
|
||||
Dim bOk As Boolean = My.Computer.FileSystem.FileExists(sTmpFile)
|
||||
If bOk Then
|
||||
bOk = AddPart(sTmpFile, nPartId)
|
||||
' Ne aggiorno la visualizzazione
|
||||
ZoomAll()
|
||||
' Cancello il file
|
||||
My.Computer.FileSystem.DeleteFile(sTmpFile)
|
||||
End If
|
||||
Return bOk
|
||||
End Function
|
||||
|
||||
Friend Function UpdatePart(nPartId As Integer) As Boolean
|
||||
' Verifico esista il contesto del VeinMatching
|
||||
If m_nVeinCtx = 0 Then Return True
|
||||
@@ -478,7 +599,257 @@ Friend Module VeinMatching
|
||||
Return bFound
|
||||
End Function
|
||||
|
||||
Friend Function OnSelectAll() As Boolean
|
||||
Friend Function AssemblyParts(ByVal ThicknessRaw As Double) As Boolean
|
||||
|
||||
CreateListAlzAndFront()
|
||||
LinkReferencesOnAlette()
|
||||
EgtSetCurrentContext(m_nVeinCtx)
|
||||
|
||||
Dim Item As Aletta
|
||||
For Each Item In m_ListALZFront
|
||||
|
||||
Dim nType As Integer
|
||||
EgtGetInfo(Item.IdSideRef, "AF", nType)
|
||||
If nType = 1 Then
|
||||
If Not CreateAlzatina(Item, ThicknessRaw) Then Return False
|
||||
ElseIf nType = 2 Then
|
||||
If Not CreateFrontalino(Item, ThicknessRaw) Then Return False
|
||||
Else
|
||||
Return False
|
||||
End If
|
||||
|
||||
Next
|
||||
Draw()
|
||||
|
||||
Return True
|
||||
End Function
|
||||
|
||||
Friend Function CreateAlzatina(ByRef Item As Aletta, ByRef ThicknessRaw As Double) As Boolean
|
||||
|
||||
' inizio a posizionare i pezzi nel piano nella posizione corretta pronti per essere ruotati
|
||||
Dim ptSRef As Point3d
|
||||
Dim ptERef As Point3d
|
||||
Dim ptE As Point3d
|
||||
|
||||
If Not EgtStartPoint(Item.IdSideRef, GDB_ID.ROOT, ptSRef) Then Return False
|
||||
If Not EgtEndPoint(Item.IdSideRef, GDB_ID.ROOT, ptERef) Then Return False
|
||||
If Not EgtEndPoint(Item.SideId, GDB_ID.ROOT, ptE) Then Return False
|
||||
Dim vtMove As Vector3d = ptSRef - ptE
|
||||
|
||||
EgtMove(Item.PartId, vtMove, GDB_RT.GLOB)
|
||||
|
||||
' ruoto i pezzi
|
||||
Dim vtRot As Vector3d = ptERef - ptSRef
|
||||
EgtRotate(Item.PartId, ptSRef, vtRot, -90, GDB_RT.GLOB)
|
||||
|
||||
' costruisco il solido
|
||||
Dim ptForPos As Point3d
|
||||
If Not CreateSolid(Item, ThicknessRaw, ptForPos) Then Return False
|
||||
|
||||
' posiziono il solido
|
||||
Dim vtMove2 As Vector3d = ptERef - ptForPos
|
||||
EgtMove(Item.PartId, vtMove2, GDB_RT.GLOB)
|
||||
|
||||
Return True
|
||||
|
||||
End Function
|
||||
|
||||
Friend Function CreateFrontalino(ByRef Item As Aletta, ByRef ThicknessRaw As Double) As Boolean
|
||||
|
||||
' inizio a posizionare i pezzi nel piano nella posizione corretta pronti per essere ruotati
|
||||
Dim ptSRef As Point3d
|
||||
Dim ptERef As Point3d
|
||||
Dim ptE As Point3d
|
||||
|
||||
If Not EgtStartPoint(Item.IdSideRef, GDB_ID.ROOT, ptSRef) Then Return False
|
||||
If Not EgtEndPoint(Item.IdSideRef, GDB_ID.ROOT, ptERef) Then Return False
|
||||
If Not EgtEndPoint(Item.SideId, GDB_ID.ROOT, ptE) Then Return False
|
||||
Dim vtMove As Vector3d = ptSRef - ptE
|
||||
|
||||
EgtMove(Item.PartId, vtMove, GDB_RT.GLOB)
|
||||
|
||||
' ruoto i pezzi
|
||||
Dim vtRot As Vector3d = ptERef - ptSRef
|
||||
EgtRotate(Item.PartId, ptSRef, vtRot, 90, GDB_RT.GLOB)
|
||||
|
||||
' costruisco il solido
|
||||
Dim ptForPos As Point3d
|
||||
If Not CreateSolid2(Item, ThicknessRaw, ptForPos) Then Return False
|
||||
|
||||
Return True
|
||||
|
||||
End Function
|
||||
|
||||
Friend Function CreateSolid(ByRef Item As Aletta, ByRef ThicknessRaw As Double, ByRef ptForPos As Point3d) As Boolean
|
||||
|
||||
Dim bInvertAngle As Boolean = False
|
||||
|
||||
' punti che delimitano front face
|
||||
Dim pt1, pt2, pt3, pt4 As Point3d
|
||||
EgtStartPoint(Item.SideId + 2, pt4)
|
||||
EgtEndPoint(Item.SideId + 2, pt3)
|
||||
pt2 = pt3 - ThicknessRaw * Vector3d.Z_AX()
|
||||
pt1 = pt4 - ThicknessRaw * Vector3d.Z_AX()
|
||||
|
||||
Dim dAngL, dAngR As Double
|
||||
EgtGetInfo(Item.SideId + 1, "SideAng", dAngL)
|
||||
EgtGetInfo(Item.SideId + 3, "SideAng", dAngR)
|
||||
|
||||
If bInvertAngle Then
|
||||
dAngL *= -1
|
||||
dAngR *= -1
|
||||
End If
|
||||
|
||||
If Math.Abs(dAngL - 90) < EPS_SMALL Or Math.Abs(dAngL + 90) < EPS_SMALL Then dAngL = 0
|
||||
If Math.Abs(dAngR - 90) < EPS_SMALL Or Math.Abs(dAngR + 90) < EPS_SMALL Then dAngR = 0
|
||||
|
||||
' aggiungo tagli inclinati
|
||||
pt3 = pt3 + ThicknessRaw * Math.Tan(dAngR * Math.PI / 180) * Vector3d.X_AX()
|
||||
pt4 = pt4 - ThicknessRaw * Math.Tan(dAngL * Math.PI / 180) * Vector3d.X_AX()
|
||||
|
||||
' punti che delimitano back face
|
||||
Dim HeightRaw As Double
|
||||
EgtCurveLength(Item.SideId + 1, HeightRaw)
|
||||
Dim ptB1 As Point3d = pt1 - HeightRaw * Vector3d.Y_AX()
|
||||
Dim ptB2 As Point3d = pt2 - HeightRaw * Vector3d.Y_AX()
|
||||
Dim ptB3 As Point3d = pt3 - HeightRaw * Vector3d.Y_AX()
|
||||
Dim ptB4 As Point3d = pt4 - HeightRaw * Vector3d.Y_AX()
|
||||
|
||||
' info aux per disegnare solido
|
||||
Dim nOutloopGrp As Integer = EgtGetFirstGroupInGroup(Item.PartId)
|
||||
Dim nRegionGrp As Integer = EgtGetNextGroup(nOutloopGrp)
|
||||
Dim cCol As New Color3d
|
||||
EgtGetColor(EgtGetFirstInGroup(nRegionGrp), cCol)
|
||||
EgtSetColor(nRegionGrp, cCol)
|
||||
|
||||
'nascondo oggetti dalla visualizzazione
|
||||
EgtSetStatus(Item.SideId, 0)
|
||||
EgtSetStatus(Item.SideId + 1, 0)
|
||||
EgtSetStatus(Item.SideId + 2, 0)
|
||||
EgtSetStatus(Item.SideId + 3, 0)
|
||||
EgtSetStatus(EgtGetFirstInGroup(nRegionGrp), 0)
|
||||
|
||||
' Front Face
|
||||
If Not CreateSolidFace(nOutloopGrp, nRegionGrp, {pt1, pt2, pt3, pt4}) Then Return False
|
||||
' Back Face
|
||||
If Not CreateSolidFace(nOutloopGrp, nRegionGrp, {ptB1, ptB4, ptB3, ptB2}) Then Return False
|
||||
'Front face
|
||||
If Not CreateSolidFace(nOutloopGrp, nRegionGrp, {ptB1, ptB2, pt2, pt1}) Then Return False
|
||||
'Bottom face
|
||||
If Not CreateSolidFace(nOutloopGrp, nRegionGrp, {ptB3, ptB4, pt4, pt3}) Then Return False
|
||||
' Right face
|
||||
If Not CreateSolidFace(nOutloopGrp, nRegionGrp, {ptB1, pt1, pt4, ptB4}) Then Return False
|
||||
' Left face
|
||||
If Not CreateSolidFace(nOutloopGrp, nRegionGrp, {ptB2, ptB3, pt3, pt2}) Then Return False
|
||||
|
||||
' punto da utilizzare come riferimento per posizionare il solido ( espresso nel sistema di riferimento globale)
|
||||
ptForPos = ptB2
|
||||
Dim ItemFrame As New Frame3d
|
||||
If Not EgtGetGroupGlobFrame(nOutloopGrp, ItemFrame) Then Return False
|
||||
ptForPos.ToGlob(ItemFrame)
|
||||
|
||||
Return True
|
||||
|
||||
End Function
|
||||
|
||||
|
||||
Friend Function CreateSolid2(ByRef Item As Aletta, ByRef ThicknessRaw As Double, ByRef ptForPos As Point3d) As Boolean
|
||||
|
||||
Dim bInvertAngle As Boolean = False
|
||||
|
||||
' punti che delimitano front face
|
||||
Dim pt1, pt2, pt3, pt4 As Point3d
|
||||
EgtStartPoint(Item.SideId, pt4)
|
||||
EgtEndPoint(Item.SideId, pt3)
|
||||
pt2 = pt3 - ThicknessRaw * Vector3d.Z_AX()
|
||||
pt1 = pt4 - ThicknessRaw * Vector3d.Z_AX()
|
||||
|
||||
Dim dAngL, dAngR, dAng As Double
|
||||
EgtGetInfo(Item.SideId + 1, "SideAng", dAngR)
|
||||
EgtGetInfo(Item.SideId + 3, "SideAng", dAngL)
|
||||
EgtGetInfo(Item.SideId, "SideAng", dAng)
|
||||
|
||||
If bInvertAngle Then
|
||||
dAngL *= -1
|
||||
dAngR *= -1
|
||||
End If
|
||||
|
||||
If Math.Abs(dAngL - 90) < EPS_SMALL Or Math.Abs(dAngL + 90) < EPS_SMALL Then dAngL = 0
|
||||
If Math.Abs(dAngR - 90) < EPS_SMALL Or Math.Abs(dAngR + 90) < EPS_SMALL Then dAngR = 0
|
||||
|
||||
' aggiungo tagli inclinati
|
||||
pt2 = pt2 + ThicknessRaw * Math.Tan(dAngR * Math.PI / 180) * Vector3d.X_AX()
|
||||
pt1 = pt1 - ThicknessRaw * Math.Tan(dAngL * Math.PI / 180) * Vector3d.X_AX()
|
||||
|
||||
|
||||
' aggiungo taglio
|
||||
pt2 = pt2 - ThicknessRaw * Math.Tan(dAng * Math.PI / 180) * Vector3d.Y_AX()
|
||||
pt1 = pt1 - ThicknessRaw * Math.Tan(dAng * Math.PI / 180) * Vector3d.Y_AX()
|
||||
|
||||
' punti che delimitano back face
|
||||
Dim HeightRaw As Double
|
||||
EgtCurveLength(Item.SideId + 1, HeightRaw)
|
||||
Dim ptB3 As Point3d = pt3 + HeightRaw * Vector3d.Y_AX()
|
||||
Dim ptB4 As Point3d = pt4 + HeightRaw * Vector3d.Y_AX()
|
||||
Dim ptB1 As Point3d = pt1 + HeightRaw * Vector3d.Y_AX()
|
||||
Dim ptB2 As Point3d = pt2 + HeightRaw * Vector3d.Y_AX()
|
||||
ptB1.y = ptB4.y
|
||||
ptB2.y = ptB4.y
|
||||
|
||||
' info aux per disegnare solido
|
||||
Dim nOutloopGrp As Integer = EgtGetFirstGroupInGroup(Item.PartId)
|
||||
Dim nRegionGrp As Integer = EgtGetNextGroup(nOutloopGrp)
|
||||
Dim cCol As New Color3d
|
||||
EgtGetColor(EgtGetFirstInGroup(nRegionGrp), cCol)
|
||||
EgtSetColor(nRegionGrp, cCol)
|
||||
|
||||
'nascondo oggetti dalla visualizzazione
|
||||
EgtSetStatus(Item.SideId, 0)
|
||||
EgtSetStatus(Item.SideId + 1, 0)
|
||||
EgtSetStatus(Item.SideId + 2, 0)
|
||||
EgtSetStatus(Item.SideId + 3, 0)
|
||||
EgtSetStatus(EgtGetFirstInGroup(nRegionGrp), 0)
|
||||
|
||||
' Front Face
|
||||
If Not CreateSolidFace(nOutloopGrp, nRegionGrp, {pt1, pt2, pt3, pt4}) Then Return False
|
||||
' Back Face
|
||||
If Not CreateSolidFace(nOutloopGrp, nRegionGrp, {ptB1, ptB4, ptB3, ptB2}) Then Return False
|
||||
'Front face
|
||||
If Not CreateSolidFace(nOutloopGrp, nRegionGrp, {ptB1, ptB2, pt2, pt1}) Then Return False
|
||||
'Bottom face
|
||||
If Not CreateSolidFace(nOutloopGrp, nRegionGrp, {ptB3, ptB4, pt4, pt3}) Then Return False
|
||||
' Right face
|
||||
If Not CreateSolidFace(nOutloopGrp, nRegionGrp, {ptB1, pt1, pt4, ptB4}) Then Return False
|
||||
' Left face
|
||||
If Not CreateSolidFace(nOutloopGrp, nRegionGrp, {ptB2, ptB3, pt3, pt2}) Then Return False
|
||||
|
||||
' punto da utilizzare come riferimento per posizionare il solido ( espresso nel sistema di riferimento globale)
|
||||
ptForPos = ptB2
|
||||
Dim ItemFrame As New Frame3d
|
||||
If Not EgtGetGroupGlobFrame(nOutloopGrp, ItemFrame) Then Return False
|
||||
ptForPos.ToGlob(ItemFrame)
|
||||
|
||||
Return True
|
||||
|
||||
End Function
|
||||
|
||||
|
||||
|
||||
Friend Function CreateSolidFace(ByRef nCrvGrp As Integer, ByRef nSrfGrp As Integer, ByRef Points As Point3d()) As Boolean
|
||||
|
||||
If Points.Count() <> 4 Then Return False
|
||||
|
||||
Dim nCrvId As Integer = EgtCreateCurveCompo(nCrvGrp, {EgtCreateLine(nCrvGrp, Points(0), Points(1)),
|
||||
EgtCreateLine(nCrvGrp, Points(1), Points(2)),
|
||||
EgtCreateLine(nCrvGrp, Points(2), Points(3)),
|
||||
EgtCreateLine(nCrvGrp, Points(3), Points(0))}, True)
|
||||
If nCrvId = GDB_ID.NULL Then Return False
|
||||
|
||||
Dim nSrfId As Integer = EgtCreateSurfFlatRegion(nSrfGrp, nCrvId)
|
||||
Return nSrfId <> GDB_ID.NULL
|
||||
|
||||
End Function
|
||||
Friend Function OnSelectAll() As Boolean
|
||||
' Verifico esista il contesto del VeinMatching
|
||||
If m_nVeinCtx = 0 Then Return True
|
||||
' Imposto VeinMatching context
|
||||
@@ -723,3 +1094,58 @@ Friend Module VeinMatching
|
||||
End Function
|
||||
|
||||
End Module
|
||||
|
||||
|
||||
Public Class Aletta
|
||||
|
||||
Private m_PartId As Integer = -1
|
||||
Public ReadOnly Property PartId As Integer
|
||||
Get
|
||||
Return m_PartId
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_SideId As Integer = -1
|
||||
Public ReadOnly Property SideId As Integer
|
||||
Get
|
||||
Return m_SideId
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_RefGUID As String = String.Empty
|
||||
Public ReadOnly Property RefGUID As String
|
||||
Get
|
||||
Return m_RefGUID
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_IdSideRef As Integer = -1
|
||||
Public Property IdSideRef As Integer
|
||||
Get
|
||||
Return m_IdSideRef
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
m_IdSideRef = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Sub New(nId As Integer)
|
||||
m_PartId = nId
|
||||
|
||||
' Recupero l'info legata al lato che contiene iil riferiemnto
|
||||
Dim nOutLoopLayId As Integer = EgtGetFirstNameInGroup(nId, NAME_OUTLOOP)
|
||||
' Entità lato
|
||||
Dim nSideId As Integer = EgtGetFirstInGroup(nOutLoopLayId)
|
||||
While nSideId <> GDB_ID.NULL
|
||||
Dim sInfoGUID As String = String.Empty
|
||||
EgtGetInfo(nSideId, "RefAF", sInfoGUID)
|
||||
If Not String.IsNullOrEmpty(sInfoGUID) Then
|
||||
m_RefGUID = sInfoGUID
|
||||
m_SideId = nSideId
|
||||
Exit While
|
||||
End If
|
||||
nSideId = EgtGetNext(nSideId)
|
||||
End While
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
|
||||
Reference in New Issue
Block a user