Compare commits

...

10 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
Nicola Pievani a04e2cbe62 Gestione avanzata posizionamento pezzi VeinMatch 2023-05-18 14:43:03 +02:00
Nicola Pievani da980a649e Merge branch 'Features/Compo_Frames' into develop 2023-05-18 11:18:14 +02:00
Nicola Pievani 9c7d60d307 Aggiornati i messaggi 2023-05-15 14:57:25 +02:00
Nicola Pievani a7adcdcaca Correzione visualizzazione Pagine componenti 2023-05-15 12:14:54 +02:00
9 changed files with 247 additions and 132 deletions
+3 -1
View File
@@ -37,7 +37,7 @@ Public Class CompoDimensionUC
InternComponentBtn.Content = EgtMsg(MSG_COMPONENTPAGEUC + 47) ' Componenti interni InternComponentBtn.Content = EgtMsg(MSG_COMPONENTPAGEUC + 47) ' Componenti interni
If Not String.IsNullOrEmpty(sCompoDir) Then If Not String.IsNullOrEmpty(sCompoDir) Then
bEnableAlzFront = True bEnableAlzFront = True
AlzFrontBtn.Content = "Alzatine & Frontalini" AlzFrontBtn.Content = EgtMsg(91137)
Else Else
AlzFrontBtn.Visibility = Visibility.Collapsed AlzFrontBtn.Visibility = Visibility.Collapsed
End If End If
@@ -107,8 +107,10 @@ Public Class CompoDimensionUC
Friend Sub ShowAlzFrontBtn(ByVal value As Boolean) Friend Sub ShowAlzFrontBtn(ByVal value As Boolean)
If value Then If value Then
AlzFrontBtn.Visibility = Visibility.Visible AlzFrontBtn.Visibility = Visibility.Visible
m_MainWindow.m_DrawPageUC.MessageGrid.Visibility = Visibility.Hidden
Else Else
AlzFrontBtn.Visibility = Visibility.Hidden AlzFrontBtn.Visibility = Visibility.Hidden
m_MainWindow.m_DrawPageUC.MessageGrid.Visibility = Visibility.Visible
End If End If
End Sub End Sub
+6 -1
View File
@@ -618,6 +618,10 @@ Public Class DrawPageUC
MakePreview(sMsg) MakePreview(sMsg)
MessageTxBl.Text = sMsg MessageTxBl.Text = sMsg
MessageGrid.Background = If(m_bDrawOk, Brushes.Transparent, Application.Current.FindResource("OmagCut_Red")) MessageGrid.Background = If(m_bDrawOk, Brushes.Transparent, Application.Current.FindResource("OmagCut_Red"))
' EseguoUpdate del solido
Utility.CreateSolid3D(m_MainWindow.GetIniFile())
' aggiorno visualizzazione ' aggiorno visualizzazione
EgtSetView(VT.TOP, False) EgtSetView(VT.TOP, False)
EgtZoom(ZM.ALL) EgtZoom(ZM.ALL)
@@ -627,7 +631,8 @@ Public Class DrawPageUC
' Costruisco path completa del componente ' Costruisco path completa del componente
Dim sPath = m_sCompoDir & "\" & m_sCompoName Dim sPath = m_sCompoDir & "\" & m_sCompoName
' Carico il file ' Carico il file
Return EgtLuaExecFile(sPath) Dim bOk As Boolean = EgtLuaExecFile(sPath)
Return bOk
End Function End Function
Private Function ReadAndShowVariables() As Boolean Private Function ReadAndShowVariables() As Boolean
+21 -12
View File
@@ -1,4 +1,5 @@
Imports EgtUILib Imports EgtUILib
Imports EgtWPFLib5
Public Class FiloTopUC Public Class FiloTopUC
@@ -38,17 +39,18 @@ Public Class FiloTopUC
m_CallingPage = m_MainWindow.m_ActivePage m_CallingPage = m_MainWindow.m_ActivePage
' Imposto messaggi ' Imposto messaggi
ParameterTxBl.Text = EgtMsg( MSG_IMPORTPAGEUC + 10) ' Offset ParameterTxBl.Text = EgtMsg(MSG_IMPORTPAGEUC + 10) ' Offset
Parameter2TxBl.Text = EgtMsg( MSG_IMPORTPAGEUC + 11) ' Affondamento Parameter2TxBl.Text = EgtMsg(MSG_IMPORTPAGEUC + 11) ' Affondamento
Parameter3TxBl.Text = EgtMsg(91138)
If m_CallingPage = MainWindow.Pages.Draw Then If m_CallingPage = MainWindow.Pages.Draw Then
' Imposto questa come pagina correntemente visualizzata nella drawpage ' Imposto questa come pagina correntemente visualizzata nella drawpage
m_MainWindow.m_DrawPageUC.m_ActiveComponentPage = DrawPageUC.Pages.FiloTop m_MainWindow.m_DrawPageUC.m_ActiveComponentPage = DrawPageUC.Pages.FiloTop
' Imposto contesto corrente ' Imposto contesto corrente
EgtSetCurrentContext( m_MainWindow.m_DrawPageUC.DrawScene.GetCtx()) EgtSetCurrentContext(m_MainWindow.m_DrawPageUC.DrawScene.GetCtx())
ElseIf m_CallingPage = MainWindow.Pages.Import Then ElseIf m_CallingPage = MainWindow.Pages.Import Then
' Imposto contesto corrente ' Imposto contesto corrente
EgtSetCurrentContext( m_MainWindow.m_ImportPageUC.ImportScene.GetCtx()) EgtSetCurrentContext(m_MainWindow.m_ImportPageUC.ImportScene.GetCtx())
End If End If
' Gestisco visualizzazione dei parametri ' Gestisco visualizzazione dei parametri
@@ -57,9 +59,9 @@ Public Class FiloTopUC
Parameter3TxBl.Visibility = Windows.Visibility.Visible Parameter3TxBl.Visibility = Windows.Visibility.Visible
' Aggiorno valori ' Aggiorno valori
m_dFiloTopOffset = GetPrivateProfileDouble( S_SIDES, K_FILOTOPOFFSET, 5, m_MainWindow.GetIniFile()) m_dFiloTopOffset = GetPrivateProfileDouble(S_SIDES, K_FILOTOPOFFSET, 5, m_MainWindow.GetIniFile())
ParameterTxBx.Text = LenToString( m_dFiloTopOffset, 3) ParameterTxBx.Text = LenToString(m_dFiloTopOffset, 3)
m_dFiloTopDepth = GetPrivateProfileDouble( S_SIDES, K_FILOTOPDEPTH, 5, m_MainWindow.GetIniFile()) m_dFiloTopDepth = GetPrivateProfileDouble(S_SIDES, K_FILOTOPDEPTH, 5, m_MainWindow.GetIniFile())
Parameter2TxBx.Text = LenToString(m_dFiloTopDepth, 3) Parameter2TxBx.Text = LenToString(m_dFiloTopDepth, 3)
m_bCornerradius = GetPrivateProfileInt(S_SIDES, K_ROUNDOFF, 0, m_MainWindow.GetIniFile()) <> 0 m_bCornerradius = GetPrivateProfileInt(S_SIDES, K_ROUNDOFF, 0, m_MainWindow.GetIniFile()) <> 0
Parameter3ChBx.IsChecked = m_bCornerradius Parameter3ChBx.IsChecked = m_bCornerradius
@@ -80,8 +82,8 @@ Public Class FiloTopUC
Dim nLayId As Integer = EgtGetFirstLayer(nPartId) Dim nLayId As Integer = EgtGetFirstLayer(nPartId)
While nLayId <> GDB_ID.NULL While nLayId <> GDB_ID.NULL
Dim sLayName As String = "" Dim sLayName As String = ""
If EgtGetName( nLayId, sLayName) AndAlso sLayName = NAME_INLOOP AndAlso EgtExistsInfo( nLayId, INFO_FILOTOP) Then If EgtGetName(nLayId, sLayName) AndAlso sLayName = NAME_INLOOP AndAlso EgtExistsInfo(nLayId, INFO_FILOTOP) Then
EgtSetInfo( nLayId, INFO_OFFSET, m_dFiloTopOffset) EgtSetInfo(nLayId, INFO_OFFSET, m_dFiloTopOffset)
End If End If
nLayId = EgtGetNextLayer(nLayId) nLayId = EgtGetNextLayer(nLayId)
End While End While
@@ -101,13 +103,16 @@ Public Class FiloTopUC
Dim nLayId As Integer = EgtGetFirstLayer(nPartId) Dim nLayId As Integer = EgtGetFirstLayer(nPartId)
While nLayId <> GDB_ID.NULL While nLayId <> GDB_ID.NULL
Dim sLayName As String = "" Dim sLayName As String = ""
If EgtGetName( nLayId, sLayName) AndAlso sLayName = NAME_INLOOP AndAlso EgtExistsInfo( nLayId, INFO_FILOTOP) Then If EgtGetName(nLayId, sLayName) AndAlso sLayName = NAME_INLOOP AndAlso EgtExistsInfo(nLayId, INFO_FILOTOP) Then
EgtSetInfo( nLayId, INFO_DEPTH, m_dFiloTopDepth) EgtSetInfo(nLayId, INFO_DEPTH, m_dFiloTopDepth)
End If End If
nLayId = EgtGetNextLayer(nLayId) nLayId = EgtGetNextLayer(nLayId)
End While End While
nPartId = EgtGetNextPart(nPartId) nPartId = EgtGetNextPart(nPartId)
End While End While
Utility.CreateSolid3D(m_MainWindow.GetIniFile())
EgtDraw()
End Sub End Sub
Private Sub Parameter3ChBx_Checked() Handles Parameter3ChBx.Click Private Sub Parameter3ChBx_Checked() Handles Parameter3ChBx.Click
@@ -215,12 +220,16 @@ Public Class FiloTopUC
EgtRemoveInfo(nLayId, "FiloTopRef") EgtRemoveInfo(nLayId, "FiloTopRef")
EgtOutLog("Error in generation OffsetPreView in TopEgde ") EgtOutLog("Error in generation OffsetPreView in TopEgde ")
End If End If
If bOk Then Utility.CreateSolid3D(m_MainWindow.GetIniFile())
' ---------------------- Fine GESTIONE PREVIEW percorso ------------------------------- ' ---------------------- Fine GESTIONE PREVIEW percorso -------------------------------
End If End If
nLayId = EgtGetNextLayer(nLayId) nLayId = EgtGetNextLayer(nLayId)
End While End While
nPartId = EgtGetNextPart(nPartId) nPartId = EgtGetNextPart(nPartId)
End While End While
EgtDraw() EgtDraw()
End Sub End Sub
+1
View File
@@ -41,6 +41,7 @@ Public Class MainComponentPageUC
m_MainWindow.m_DrawPageUC.FiloTopBtn.IsEnabled = False m_MainWindow.m_DrawPageUC.FiloTopBtn.IsEnabled = False
m_MainWindow.m_DrawPageUC.EngraveBtn.IsEnabled = False m_MainWindow.m_DrawPageUC.EngraveBtn.IsEnabled = False
m_MainWindow.m_DrawPageUC.DripCutBtn.IsEnabled = False m_MainWindow.m_DrawPageUC.DripCutBtn.IsEnabled = False
m_MainWindow.m_DrawPageUC.m_bBackFromInternalCompo = False
End Sub End Sub
Private Function GetButton(ByVal nInd As Integer) As Button Private Function GetButton(ByVal nInd As Integer) As Button
+36 -32
View File
@@ -171,25 +171,25 @@ Public Class SideAngleUC
' Aggiorno valori ' Aggiorno valori
If m_Mode = ModeOpt.DRIP Then If m_Mode = ModeOpt.DRIP Then
m_dDripOffset = GetPrivateProfileDouble( S_SIDES, K_DRIPOFFSET, 20, m_MainWindow.GetIniFile()) m_dDripOffset = GetPrivateProfileDouble(S_SIDES, K_DRIPOFFSET, 20, m_MainWindow.GetIniFile())
m_dDripOffset2 = GetPrivateProfileDouble( S_SIDES, K_DRIPOFFSET2, 0, 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_dDripDepth = GetPrivateProfileDouble(S_SIDES, K_DRIPDEPTH, 10, m_MainWindow.GetIniFile())
m_dDripShort = GetPrivateProfileDouble( S_SIDES, K_DRIPSHORT, 0, m_MainWindow.GetIniFile()) m_dDripShort = GetPrivateProfileDouble(S_SIDES, K_DRIPSHORT, 0, m_MainWindow.GetIniFile())
Parameter1TxBx.Text = LenToString( m_dDripOffset, 3) Parameter1TxBx.Text = LenToString(m_dDripOffset, 3)
Parameter2TxBx.Text = LenToString( m_dDripOffset2, 3) Parameter2TxBx.Text = LenToString(m_dDripOffset2, 3)
Parameter3TxBx.Text = LenToString( m_dDripDepth, 3) Parameter3TxBx.Text = LenToString(m_dDripDepth, 3)
Parameter4TxBx.Text = LenToString( m_dDripShort, 3) Parameter4TxBx.Text = LenToString(m_dDripShort, 3)
ElseIf m_Mode = ModeOpt.ENGRAVE Then ElseIf m_Mode = ModeOpt.ENGRAVE Then
m_dDripOffset = GetPrivateProfileDouble( S_SIDES, K_ENGRAVEOFFSET, 20, 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_nEngrNbr2 = GetPrivateProfileInt(S_SIDES, K_ENGRAVENUMBER2, 1, m_MainWindow.GetIniFile())
m_dDripOffset2 = GetPrivateProfileDouble( S_SIDES, K_ENGRAVEOFFSET2, 0, 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_dDripDepth = GetPrivateProfileDouble(S_SIDES, K_ENGRAVEDEPTH, 10, m_MainWindow.GetIniFile())
m_dEngraveDepth2 = GetPrivateProfileDouble(S_SIDES, K_ENGRAVEDEPTH2, 0, 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()) m_dEngraveAngle = GetPrivateProfileDouble(S_SIDES, K_ENGRAVEANGLE, 0, m_MainWindow.GetIniFile())
Parameter1TxBx.Text = LenToString(m_dDripOffset, 3) Parameter1TxBx.Text = LenToString(m_dDripOffset, 3)
Parameter2aTxBx.Text = m_nEngrNbr2.ToString() Parameter2aTxBx.Text = m_nEngrNbr2.ToString()
Parameter2bTxBx.Text = LenToString( m_dDripOffset2, 3) Parameter2bTxBx.Text = LenToString(m_dDripOffset2, 3)
Parameter3TxBx.Text = LenToString( m_dDripDepth, 3) Parameter3TxBx.Text = LenToString(m_dDripDepth, 3)
Parameter4TxBx.Text = LenToString(m_dEngraveDepth2, 3) Parameter4TxBx.Text = LenToString(m_dEngraveDepth2, 3)
Parameter5TxBx.Text = DoubleToString(m_dEngraveAngle, 3) Parameter5TxBx.Text = DoubleToString(m_dEngraveAngle, 3)
End If End If
@@ -311,8 +311,8 @@ Public Class SideAngleUC
' Attualmente il vaore m_nCount è inizializzato ad "1".. ' Attualmente il vaore m_nCount è inizializzato ad "1"..
' Bottoni Prev Next ' Bottoni Prev Next
If m_nCount <= MAX_LINES Then If m_nCount <= MAX_LINES Then
PrevBtn.Visibility= Windows.Visibility.Hidden PrevBtn.Visibility = Windows.Visibility.Hidden
NextBtn.Visibility= Windows.Visibility.Hidden NextBtn.Visibility = Windows.Visibility.Hidden
Else Else
Grid.SetRow(PrevBtn, MAX_LINES - m_nShow) Grid.SetRow(PrevBtn, MAX_LINES - m_nShow)
PrevBtn.Visibility = Windows.Visibility.Visible 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()) GetHeelTxBxFromIndex(Index).Text = GetPrivateProfileDouble(S_SIDES, K_DRIPSHORT & "A" & nI.ToString & "_End", 0, m_MainWindow.GetIniFile())
End If End If
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, GetTxBlFromIndex(Index).Text = If(m_Mode = ModeOpt.SIDEANGLE,
m_SideAngleEntityList(TxBlIndex).sEntityName, m_SideAngleEntityList(TxBlIndex).sEntityName,
m_DripEntityList(TxBlIndex).sEntityName) m_DripEntityList(TxBlIndex).sEntityName)
@@ -495,15 +495,15 @@ Public Class SideAngleUC
'-------------> Restituisce gli oggetto della grafica assegnato l'indice '-------------> Restituisce gli oggetto della grafica assegnato l'indice
' quando esco salvo nel file l'ultima configurazione per le incisioni ' 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 If m_CallingPage = MainWindow.Pages.Draw Then
' Ricavo nome pezzo ' 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 ' Svuoto layer in cui sono presenti i testi con le inclinazioni dei lati
If m_Mode = ModeOpt.SIDEANGLE Then If m_Mode = ModeOpt.SIDEANGLE Then
EgtEmptyGroup( EgtGetFirstNameInGroup( PartId, SIDE_ANGLE_LAYER)) EgtEmptyGroup(EgtGetFirstNameInGroup(PartId, SIDE_ANGLE_LAYER))
Else Else
EgtEmptyGroup( EgtGetFirstNameInGroup( PartId, SIDE_ANGLE_LAYER)) EgtEmptyGroup(EgtGetFirstNameInGroup(PartId, SIDE_ANGLE_LAYER))
End If End If
ElseIf m_CallingPage = MainWindow.Pages.Import Then ElseIf m_CallingPage = MainWindow.Pages.Import Then
' Nessuna azione necessaria ' Nessuna azione necessaria
@@ -516,7 +516,7 @@ Public Class SideAngleUC
'WritePrivateProfileString( S_SIDES, K_DRIPSHORT, DoubleToString( m_dDripShort, 3), m_MainWindow.GetIniFile()) 'WritePrivateProfileString( S_SIDES, K_DRIPSHORT, DoubleToString( m_dDripShort, 3), m_MainWindow.GetIniFile())
ElseIf m_Mode = ModeOpt.ENGRAVE Then ElseIf m_Mode = ModeOpt.ENGRAVE Then
WritePrivateProfileString(S_SIDES, K_ENGRAVEOFFSET, LenToString(m_dDripOffset, 3), m_MainWindow.GetIniFile()) 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_ENGRAVEOFFSET2, LenToString(m_dDripOffset2, 3), m_MainWindow.GetIniFile())
WritePrivateProfileString(S_SIDES, K_ENGRAVEDEPTH, LenToString(m_dDripDepth, 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()) 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) 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 ' Recupero nome layer con geometria di contorno (esterno o interno) del pezzo
LoopId = m_MainWindow.m_DrawPageUC.SelectedLayer LoopId = m_MainWindow.m_DrawPageUC.SelectedLayer
ElseIf m_CallingPage = MainWindow.Pages.Import Then ElseIf m_CallingPage = MainWindow.Pages.Import Then
' Imposto contesto corrente ' Imposto contesto corrente
EgtSetCurrentContext(m_MainWindow.m_ImportPageUC.ImportScene.GetCtx()) EgtSetCurrentContext(m_MainWindow.m_ImportPageUC.ImportScene.GetCtx())
' Recupero nome pezzo ' Recupero nome pezzo
@@ -579,6 +579,10 @@ Public Class SideAngleUC
' Creo le geometrie dei gocciolatoi ' Creo le geometrie dei gocciolatoi
CreateDripGeom(PartId) CreateDripGeom(PartId)
End If End If
' se abilitato e dimensione solido da sotto: creo il solido
Utility.CreateSolid3D(m_MainWindow.GetIniFile())
' Aggiorno visualizzazione ' Aggiorno visualizzazione
EgtDraw() EgtDraw()
End Sub End Sub
@@ -600,7 +604,7 @@ Public Class SideAngleUC
For nIndex As Integer = 1 To m_nCount For nIndex As Integer = 1 To m_nCount
Dim Entity As DripEntity = m_DripEntityList(nIndex - 1) Dim Entity As DripEntity = m_DripEntityList(nIndex - 1)
' Imposto check box (se sono stati definiti il numero corretto di CheckBox ' 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 Dim nChIndex As Integer = nIndex - (m_nCurrPage - 1) * MAX_LINES + MAX_LINES - m_nShow
' verifico se l'entità ha un gocciolatoio ' verifico se l'entità ha un gocciolatoio
GetChBxFromIndex(nChIndex).IsChecked = Entity.bHaveDrip 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 Private Sub PrevBtn_Click(sender As Object, e As RoutedEventArgs) Handles PrevBtn.Click
If m_nCurrPage = 1 Then Return If m_nCurrPage = 1 Then Return
m_nCurrPage -= 1 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() TxBlChBxView()
RefreshCheckAndValue() RefreshCheckAndValue()
End Sub End Sub
Private Sub NextBtn_Click(sender As Object, e As RoutedEventArgs) Handles NextBtn.Click 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_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() TxBlChBxView()
RefreshCheckAndValue() RefreshCheckAndValue()
End Sub End Sub
@@ -993,7 +997,7 @@ Public Class SideAngleUC
Dim bVal As Boolean = CurrCheckBox.IsChecked() Dim bVal As Boolean = CurrCheckBox.IsChecked()
Dim SideIndex As Integer = CInt(CurrCheckBox.Name.Substring(1)) 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 ' 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 Dim sCurrSide As String = m_DripEntityList(nCurrSide - 1).sEntityName
' aggiorno l'entità con i valori scritti nel campo di testo ' aggiorno l'entità con i valori scritti nel campo di testo
Dim CurrEntity As DripEntity = DripEntity.FindEntity(sCurrSide) Dim CurrEntity As DripEntity = DripEntity.FindEntity(sCurrSide)
@@ -1192,7 +1196,7 @@ Public Class SideAngleUC
AngleTxBx.Text = DoubleToString(dSideAngle, 2) AngleTxBx.Text = DoubleToString(dSideAngle, 2)
End If End If
' Converto nome checkbox in nome elemento tenendo conto della pagina e dello slittamento verso il basso ' 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 Dim sCurrSide As String = m_SideAngleEntityList(nCurrSide - 1).sEntityName
' Lo modifico nella geometria e nella lista inclinazioni ' Lo modifico nella geometria e nella lista inclinazioni
ModifySideAngle(sCurrSide, dSideAngle) ModifySideAngle(sCurrSide, dSideAngle)
@@ -1262,7 +1266,7 @@ Public Class SideAngleUC
HeelTxBx.Text = "0" HeelTxBx.Text = "0"
End If End If
' Converto nome checkbox in nome elemento tenendo conto della pagina e dello slittamento verso il basso ' 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 Dim sCurrSide As String = m_SideAngleEntityList(nCurrSide - 1).sEntityName
' Lo modifico nella geometria e nella lista inclinazioni ' Lo modifico nella geometria e nella lista inclinazioni
ModifySideHeel(sCurrSide, dSideHeel) ModifySideHeel(sCurrSide, dSideHeel)
@@ -1303,7 +1307,7 @@ Public Class SideAngleUC
If dSideAngle <> 0 Then If dSideAngle <> 0 Then
EgtSetInfo(CurrEntity.nGeomId, INFO_SIDE_ANGLE, dSideAngle) EgtSetInfo(CurrEntity.nGeomId, INFO_SIDE_ANGLE, dSideAngle)
EgtSetInfo(CurrEntity.nGeomId, INFO_ORIG_SIDE_ANGLE, dSideAngle) EgtSetInfo(CurrEntity.nGeomId, INFO_ORIG_SIDE_ANGLE, dSideAngle)
' Cancello inclinazione nell'apposito campo info ' Cancello inclinazione nell'apposito campo info
Else Else
EgtRemoveInfo(CurrEntity.nGeomId, INFO_SIDE_ANGLE) EgtRemoveInfo(CurrEntity.nGeomId, INFO_SIDE_ANGLE)
EgtRemoveInfo(CurrEntity.nGeomId, INFO_ORIG_SIDE_ANGLE) EgtRemoveInfo(CurrEntity.nGeomId, INFO_ORIG_SIDE_ANGLE)
@@ -1324,7 +1328,7 @@ Public Class SideAngleUC
' Scrivo nuovo tallone nelle info ' Scrivo nuovo tallone nelle info
If dSideHeel > 10 * EPS_SMALL Then If dSideHeel > 10 * EPS_SMALL Then
EgtSetInfo(CurrEntity.nGeomId, INFO_HEEL, dSideHeel) EgtSetInfo(CurrEntity.nGeomId, INFO_HEEL, dSideHeel)
' Cancello inclinazione nell'apposito campo info ' Cancello inclinazione nell'apposito campo info
Else Else
EgtRemoveInfo(CurrEntity.nGeomId, INFO_HEEL) EgtRemoveInfo(CurrEntity.nGeomId, INFO_HEEL)
End If End If
+2 -2
View File
@@ -61,8 +61,8 @@ Public Class PolishingsPageUC
RepeatTxBl.Text = EgtMsg(91093) ' Ripetizioni RepeatTxBl.Text = EgtMsg(91093) ' Ripetizioni
StepTxBl.Text = EgtMsg(90787) ' Passo StepTxBl.Text = EgtMsg(90787) ' Passo
OffSetTxBl.Text = EgtMsg(91089) ' Offset OffSetTxBl.Text = EgtMsg(91089) ' Offset
RadiusTxBl.Text = "Raggio" RadiusTxBl.Text = EgtMsg(91139) ' Raggio
DistanceTxBl.Text = "Distanza" DistanceTxBl.Text = EgtMsg(91140) ' Distanza
LiLoGpBx.Header = EgtMsg(91094) ' Attacco/Uscita LiLoGpBx.Header = EgtMsg(91094) ' Attacco/Uscita
LiLenTxBl.Text = EgtMsg(91097) ' Lunghezza LiLenTxBl.Text = EgtMsg(91097) ' Lunghezza
LiHeightTxBl.Text = EgtMsg(91095) ' Altezza LiHeightTxBl.Text = EgtMsg(91095) ' Altezza
+44 -5
View File
@@ -567,16 +567,55 @@ Public Class SimulationPageUC
End Sub End Sub
Private Sub GenerateXPIUC_Click(sender As Object, e As RoutedEventArgs) 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 ' se il bottone Shift è premuto apro il file CadCut1 nel programma NotePad
Dim IsPressedShiftKey As Boolean = False Dim IsPressedShiftKey As Boolean = False
If Keyboard.Modifiers And ModifierKeys.Shift Then If Keyboard.Modifiers And ModifierKeys.Shift Then
IsPressedShiftKey = True IsPressedShiftKey = True
End If 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 Dim bOk As Boolean = True
EgtSetCurrentContext(m_CurrProjPage.CurrentProjectScene.GetCtx()) EgtSetCurrentContext(m_CurrProjPage.CurrentProjectScene.GetCtx())
' Elimino eventuale attrezzaggio da OmagOFFICE ' Elimino eventuale attrezzaggio da OmagOFFICE
+83 -53
View File
@@ -6,6 +6,36 @@ Imports EgtWPFLib
Imports EgtUILib Imports EgtUILib
Module Utility 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 Friend Function CompoColor(sIniFile As String) As Color3d
Dim InsertColor As New Color3d(89, 210, 210, 25) Dim InsertColor As New Color3d(89, 210, 210, 25)
Dim IndexColor As Integer = GetPrivateProfileInt(S_COMPO, K_LASTCOLOR, 1, sIniFile) Dim IndexColor As Integer = GetPrivateProfileInt(S_COMPO, K_LASTCOLOR, 1, sIniFile)
@@ -18,7 +48,7 @@ Module Utility
End Function End Function
Friend StopWatch As Stopwatch Friend StopWatch As Stopwatch
Friend Sub TimeSpanInit() Friend Sub TimeSpanInit()
StopWatch = New Stopwatch StopWatch = New Stopwatch
@@ -26,20 +56,20 @@ Module Utility
End Sub End Sub
Friend Function TimeSpanEnd() Friend Function TimeSpanEnd()
Dim sTime As String = "" Dim sTime As String = ""
If Not IsNothing(StopWatch) Then If Not IsNothing(StopWatch) Then
StopWatch.Stop() StopWatch.Stop()
Dim ts As TimeSpan = StopWatch.Elapsed 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) sTime = String.Format("{0:00}:{1:00}:{2:00}.{3:000}", ts.Hours, ts.Minutes, ts.Seconds, ts.Milliseconds)
End If End If
Return sTime Return sTime
End Function End Function
'-------------------------------------------------------------------------------------------------- '--------------------------------------------------------------------------------------------------
Friend Sub UpdateUI() Friend Sub UpdateUI()
' Costringo ad aggiornare UI ' Costringo ad aggiornare UI
Dim nDummy As Integer 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)) New Action(Function() nDummy = 0))
End Sub End Sub
@@ -366,20 +396,20 @@ Module Utility
If bOldEnMod Then EgtEnableModified() If bOldEnMod Then EgtEnableModified()
End Sub 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 ' 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 sTextColor As String = " "
Dim MainWindow As MainWindow = DirectCast(Application.Current.MainWindow, MainWindow) Dim MainWindow As MainWindow = DirectCast(Application.Current.MainWindow, MainWindow)
If GetPrivateProfileString(S_NEST, K_TEXTCOLOR, " ", sTextColor, MainWindow.GetIniFile()) <> 0 Then If GetPrivateProfileString(S_NEST, K_TEXTCOLOR, " ", sTextColor, MainWindow.GetIniFile()) <> 0 Then
Dim sTextColorArray() As String = sTextColor.Split(",") Dim sTextColorArray() As String = sTextColor.Split(",")
Dim nRed As Integer = 0 : Integer.TryParse( sTextColorArray(0), nRed) Dim nRed As Integer = 0 : Integer.TryParse(sTextColorArray(0), nRed)
Dim nGreen As Integer = 0 : Integer.TryParse( sTextColorArray(1), nGreen) Dim nGreen As Integer = 0 : Integer.TryParse(sTextColorArray(1), nGreen)
Dim nBlue As Integer = 0 : Integer.TryParse( sTextColorArray(2), nBlue) Dim nBlue As Integer = 0 : Integer.TryParse(sTextColorArray(2), nBlue)
colText.Setup( nRed, nGreen, nBlue) colText.Setup(nRed, nGreen, nBlue)
End If End If
' Assegno questo colore ai testi del layer indicato ' 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 While nId <> GDB_ID.NULL
If EgtGetType(nId) = GDB_TY.EXT_TEXT Then If EgtGetType(nId) = GDB_TY.EXT_TEXT Then
EgtSetColor(nId, colText) EgtSetColor(nId, colText)
@@ -389,62 +419,62 @@ Module Utility
Return True Return True
End Function End Function
Friend Function AddTopToPartRegion( nRegId As Integer) As Boolean Friend Function AddTopToPartRegion(nRegId As Integer) As Boolean
Dim frReg As New Frame3d : EgtGetGroupGlobFrame( nRegId, frReg) Dim frReg As New Frame3d : EgtGetGroupGlobFrame(nRegId, frReg)
Dim b3Reg As New BBox3d : EgtGetBBoxGlob( nRegId, GDB_BB.STANDARD, b3Reg) Dim b3Reg As New BBox3d : EgtGetBBoxGlob(nRegId, GDB_BB.STANDARD, b3Reg)
Dim dH As Double = Math.Min(0.1 * b3Reg.DimY(), 30) 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) Dim ptIns As New Point3d(b3Reg.Center().x, b3Reg.Max().y - dH, b3Reg.Max().z)
ptIns.ToLoc( frReg) ptIns.ToLoc(frReg)
Dim nSfrId As Integer = EgtGetFirstInGroup( nRegId) Dim nSfrId As Integer = EgtGetFirstInGroup(nRegId)
While nSfrId <> GDB_ID.NULL While nSfrId <> GDB_ID.NULL
If EgtGetType( nSfrId) = GDB_TY.SRF_FRGN Then Exit While If EgtGetType(nSfrId) = GDB_TY.SRF_FRGN Then Exit While
nSfrId = EgtGetNext( nSfrId) nSfrId = EgtGetNext(nSfrId)
End While End While
If nSfrId <> GDB_ID.NULL Then If nSfrId <> GDB_ID.NULL Then
Dim ptStart As New Point3d ( b3Reg.Min().x, b3Reg.Max().y - dH, b3Reg.Max().z) Dim ptStart As New Point3d(b3Reg.Min().x, b3Reg.Max().y - dH, b3Reg.Max().z)
ptStart.ToLoc( frReg) ptStart.ToLoc(frReg)
Dim ptEnd As New Point3d ( b3Reg.Max().x, b3Reg.Max().y - dH, b3Reg.Max().z) Dim ptEnd As New Point3d(b3Reg.Max().x, b3Reg.Max().y - dH, b3Reg.Max().z)
ptEnd.ToLoc( frReg) ptEnd.ToLoc(frReg)
Dim nLineId As Integer = EgtCreateLine( nRegId, ptStart, ptEnd) Dim nLineId As Integer = EgtCreateLine(nRegId, ptStart, ptEnd)
Dim nCount As Integer = 0 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 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 For nTmpId As Integer = nNewId To nNewId + nCount - 1
EgtErase( nTmpId) EgtErase(nTmpId)
Next Next
Else Else
EgtErase( nLineId) EgtErase(nLineId)
End If End If
End If End If
Dim vtDir As New Vector3d( 1, 0, 0) Dim vtDir As New Vector3d(1, 0, 0)
vtDir.ToLoc( frReg) vtDir.ToLoc(frReg)
Dim dLen, dAngV, dAngH As Double 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) 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 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() Dim nRawId As Integer = GetCurrentRaw()
If nRawId = GDB_ID.NULL Then Return False If nRawId = GDB_ID.NULL Then Return False
If String.IsNullOrWhiteSpace(sBlock) Then sSlabNbr = "" If String.IsNullOrWhiteSpace(sBlock) Then sSlabNbr = ""
' Assegno info ' Assegno info
EgtSetInfo( nRawId, INFO_RAW_BLOCK, sBlock) EgtSetInfo(nRawId, INFO_RAW_BLOCK, sBlock)
EgtSetInfo( nRawId, INFO_RAW_SLABNBR, sSlabNbr) EgtSetInfo(nRawId, INFO_RAW_SLABNBR, sSlabNbr)
' Cancello eventuale vecchio BarCode ' Cancello eventuale vecchio BarCode
EgtErase( EgtGetFirstNameInGroup( nRawId, NAME_BARCODE)) EgtErase(EgtGetFirstNameInGroup(nRawId, NAME_BARCODE))
' Se definito, inserisco nuovo BarCode ' Se definito, inserisco nuovo BarCode
Dim sBarCode As String = sBlock & " - " & sSlabNbr Dim sBarCode As String = sBlock & " - " & sSlabNbr
If sBarCode <> " - " Then If sBarCode <> " - " Then
Dim ptRawCen As Point3d Dim ptRawCen As Point3d
GetRawCenter( ptRawCen) GetRawCenter(ptRawCen)
Dim ptRawMin, ptRawMax As Point3d Dim ptRawMin, ptRawMax As Point3d
GetRawBox( ptRawMin, ptRawMax) GetRawBox(ptRawMin, ptRawMax)
Dim ptText As New Point3d( ptRawCen.x, ptRawCen.y, ptRawMax.z) 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) 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) EgtSetName(nText, NAME_BARCODE)
EgtSetColor( nText, New Color3d(255, 0, 0)) EgtSetColor(nText, New Color3d(255, 0, 0))
End If End If
Return True Return True
End Function End Function
@@ -480,7 +510,7 @@ Module Utility
End Class 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 Dim sVal As String = String.Empty
GetPrivateProfileString(lpAppName, lpKeyName, "", sVal, lpFileName) GetPrivateProfileString(lpAppName, lpKeyName, "", sVal, lpFileName)
Dim sItems() As String = sVal.Split(",".ToCharArray) Dim sItems() As String = sVal.Split(",".ToCharArray)
+51 -26
View File
@@ -4,6 +4,7 @@ Imports System.Collections.ObjectModel
Imports System.Runtime.InteropServices Imports System.Runtime.InteropServices
Imports EgtUILib Imports EgtUILib
Imports EgtWPFLib Imports EgtWPFLib
Imports OmagCUT.VeinMatchingWindow
Public Class VeinMatchingWindow Public Class VeinMatchingWindow
@@ -19,6 +20,11 @@ Public Class VeinMatchingWindow
Private m_nIdToSel As Integer = GDB_ID.NULL Private m_nIdToSel As Integer = GDB_ID.NULL
Private m_nIdToDesel As Integer = GDB_ID.NULL Private m_nIdToDesel As Integer = GDB_ID.NULL
Enum ALETTE
F = 2
A = 1
End Enum
Private Sub Window_Initialized(sender As Object, e As EventArgs) Private Sub Window_Initialized(sender As Object, e As EventArgs)
' Assegnazione scena all'host e posizionamento nella PlacePageGrid ' Assegnazione scena all'host e posizionamento nella PlacePageGrid
VeinMatchingSceneHost.Child = VeinMatchingScene VeinMatchingSceneHost.Child = VeinMatchingScene
@@ -267,7 +273,7 @@ Friend Module VeinMatching
Dim nRegId As Integer = EgtGetFirstInGroup(nRegLayId) Dim nRegId As Integer = EgtGetFirstInGroup(nRegLayId)
While nRegId <> GDB_ID.NULL While nRegId <> GDB_ID.NULL
If EgtGetType(nRegId) = GDB_TY.SRF_FRGN Then If EgtGetType(nRegId) = GDB_TY.SRF_FRGN Then
Exit While Exit While
End If End If
nRegId = EgtGetNext(nRegId) nRegId = EgtGetNext(nRegId)
End While End While
@@ -364,19 +370,21 @@ Friend Module VeinMatching
' Imposto il contesto del progetto ' Imposto il contesto del progetto
EgtSetCurrentContext(m_MainWindow.m_CurrentProjectPageUC.CurrentProjectScene.GetCtx()) EgtSetCurrentContext(m_MainWindow.m_CurrentProjectPageUC.CurrentProjectScene.GetCtx())
' Riattivo il gruppo di lavoro ' Riattivo il gruppo di lavoro
EgtSetCurrMachGroup( EgtGetFirstMachGroup()) EgtSetCurrMachGroup(EgtGetFirstMachGroup())
' Verifico quali pezzi sono nel grezzo, per dichiararlo al VM ' Verifico quali pezzi sono nel grezzo, per dichiararlo al VM
nId = EgtGetFirstPartInRawPart( CamAuto.GetCurrentRaw()) nId = EgtGetFirstPartInRawPart(CamAuto.GetCurrentRaw())
While nId <> GDB_ID.NULL While nId <> GDB_ID.NULL
' Dichiaro pezzo nel grezzo per VM ' Dichiaro pezzo nel grezzo per VM
VeinMatching.OnInsertPartInRaw( nId) VeinMatching.OnInsertPartInRaw(nId)
' Passo al pezzo successivo ' Passo al pezzo successivo
nId = EgtGetNextPartInRawPart(nId) nId = EgtGetNextPartInRawPart(nId)
End While End While
' Ripristino visualizzazione di eventuali pezzi in parcheggio ' Ripristino visualizzazione di eventuali pezzi in parcheggio
ShowParkedParts() ShowParkedParts()
' Ripristino il contesto corrente ' Ripristino il contesto corrente
EgtSetCurrentContext( nCurrCtx) EgtSetCurrentContext(nCurrCtx)
' EgtSaveFile("C:\EgtData\OmagCUT\Temp\MyVeinMatch.nge", NGE.TEXT)
Return True Return True
End Function End Function
@@ -422,11 +430,11 @@ Friend Module VeinMatching
nCurrId = EgtGetFirstNameInGroup(nVeinId2, NAME_PREVIEW) nCurrId = EgtGetFirstNameInGroup(nVeinId2, NAME_PREVIEW)
EgtSetStatus(nCurrId, GDB_ST.OFF) EgtSetStatus(nCurrId, GDB_ST.OFF)
' Se esiste OutLoop.orig OutLoop -> OutLoop.mach e OutLoop.orig -> OutLoop ' Se esiste OutLoop.orig OutLoop -> OutLoop.mach e OutLoop.orig -> OutLoop
Dim nOutLoopOrig As Integer = EgtGetFirstNameInGroup( nVeinId2, NAME_OUTLOOP & ".orig") Dim nOutLoopOrig As Integer = EgtGetFirstNameInGroup(nVeinId2, NAME_OUTLOOP & ".orig")
If nOutLoopOrig <> GDB_ID.NULL Then If nOutLoopOrig <> GDB_ID.NULL Then
Dim nOutLoop As Integer = EgtGetFirstNameInGroup( nVeinId2, NAME_OUTLOOP) Dim nOutLoop As Integer = EgtGetFirstNameInGroup(nVeinId2, NAME_OUTLOOP)
EgtSetName( nOutLoop, NAME_OUTLOOP & ".mach") EgtSetName(nOutLoop, NAME_OUTLOOP & ".mach")
EgtSetName( nOutLoopOrig, NAME_OUTLOOP) EgtSetName(nOutLoopOrig, NAME_OUTLOOP)
End If End If
' Se necessario, ripristino il contesto originale ' Se necessario, ripristino il contesto originale
If nCurrCtx > 0 Then EgtSetCurrentContext(nCurrCtx) If nCurrCtx > 0 Then EgtSetCurrentContext(nCurrCtx)
@@ -555,8 +563,8 @@ Friend Module VeinMatching
' Se richiesto, eseguo deselezione ' Se richiesto, eseguo deselezione
If bDeselect Then EgtDeselectObj(nId) If bDeselect Then EgtDeselectObj(nId)
End If End If
EgtDraw() EgtDraw()
EgtSetCurrentContext(nMainCtx) EgtSetCurrentContext(nMainCtx)
Return True Return True
End Function End Function
@@ -1039,37 +1047,44 @@ Friend Module VeinMatching
End Function End Function
Friend Function MoveAlettaSolid(ByRef Item As Aletta, ByRef ThicknessRaw As Double) As Boolean Friend Function MoveAlettaSolid(ByRef Item As Aletta, ByRef ThicknessRaw As Double) As Boolean
' A: alzatina, F: frontalino
Dim nType As Integer Dim nType As Integer
If Not EgtGetInfo(Item.IdSideRef, "AF", nType) Then Return False If Not EgtGetInfo(Item.IdSideRef, "AF", nType) Then Return False
Dim ptSRef, ptERef, ptE As Point3d Dim ptSRef, ptERef, ptS, ptE As Point3d
' Piano cucina
If Not EgtStartPoint(Item.IdSideRef, GDB_ID.ROOT, ptSRef) Then Return False If Not 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.IdSideRef, GDB_ID.ROOT, ptERef) Then Return False
' AlzFront
If Not EgtStartPoint(Item.SideId, GDB_ID.ROOT, ptS) Then Return False
If Not EgtEndPoint(Item.SideId, GDB_ID.ROOT, ptE) Then Return False If Not EgtEndPoint(Item.SideId, GDB_ID.ROOT, ptE) Then Return False
' vettore lato cucina
Dim vtRotRef As Vector3d = ptERef - ptSRef
' vettore lato AlzFront
Dim vtRot As Vector3d = ptE - ptS
' ruoto il solido intorno al lato di riferimento ' ruoto il solido intorno al lato di riferimento
Dim vtRot As Vector3d = ptERef - ptSRef If nType = ALETTE.A Then
If nType = 1 Then
EgtRotate(Item.PartId, ptE, vtRot, -90, GDB_RT.GLOB)
ElseIf nType = 2 Then
EgtRotate(Item.PartId, ptE, vtRot, 90, GDB_RT.GLOB) EgtRotate(Item.PartId, ptE, vtRot, 90, GDB_RT.GLOB)
ElseIf nType = ALETTE.F Then
EgtRotate(Item.PartId, ptE, vtRot, -90, GDB_RT.GLOB)
End If End If
' punto di riferimento per la traslazione sul solido ' punto di riferimento per la traslazione sul solido
Dim ptSolid As Point3d Dim ptSolid As Point3d
If nType = 1 Then If nType = ALETTE.A Then
' cerco id della curva che definisce la front face ' cerco id della curva che definisce la front face
Dim nSolidGrp As Integer = EgtGetFirstNameInGroup(Item.PartId, NAME_VM_SOLID) Dim nSolidGrp As Integer = EgtGetFirstNameInGroup(Item.PartId, NAME_VM_SOLID)
Dim nFrontCrvId As Integer = EgtGetFirstInGroup(nSolidGrp) Dim nFrontCrvId As Integer = EgtGetFirstInGroup(nSolidGrp)
EgtStartPoint(nFrontCrvId, ptSolid) EgtStartPoint(nFrontCrvId, GDB_ID.ROOT, ptSolid)
ElseIf nType = 2 Then ElseIf nType = ALETTE.F Then
EgtStartPoint(Item.SideId, ptSolid) EgtStartPoint(Item.SideId, GDB_ID.ROOT, ptSolid)
End If End If
Dim ItemFrame As New Frame3d ' Dim ItemFrame As New Frame3d
If Not EgtGetGroupGlobFrame(Item.PartId, ItemFrame) Then Return False ' If Not EgtGetGroupGlobFrame(Item.PartId, ItemFrame) Then Return False
ptSolid.ToGlob(ItemFrame) ' ptSolid.ToGlob(ItemFrame)
'punto di riferimento per la traslazione sul piano cucina 'punto di riferimento per la traslazione sul piano cucina
Dim ptKitchen As Point3d = ptERef Dim ptKitchen As Point3d = ptERef
@@ -1077,6 +1092,16 @@ Friend Module VeinMatching
Dim vtMove As Vector3d = ptKitchen - ptSolid Dim vtMove As Vector3d = ptKitchen - ptSolid
EgtMove(Item.PartId, vtMove, GDB_RT.GLOB) EgtMove(Item.PartId, vtMove, GDB_RT.GLOB)
' eventualmente ruoto per allineare l'alzatina al piano cucina
Dim dLRef, dAngVRef, dAngHRef As Double
vtRotRef.ToSpherical(dLRef, dAngVRef, dAngHRef)
Dim dL, dAngV, dAngH As Double
vtRot.Rotate(Vector3d.Z_AX, 180)
vtRot.ToSpherical(dL, dAngV, dAngH)
Dim dDelta As Double = dAngHRef - dAngH
If Math.Abs(dDelta) < EPS_ANG_SMALL Then Return True
EgtRotate(Item.PartId, ptKitchen, Vector3d.Z_AX, dDelta, GDB_RT.GLOB)
Return True Return True
End Function End Function
@@ -1206,7 +1231,7 @@ Friend Module VeinMatching
' Se necessario, cambio contesto ' Se necessario, cambio contesto
If m_nVeinCtx <> nCurrCtx Then If m_nVeinCtx <> nCurrCtx Then
If EgtSetCurrentContext(m_nVeinCtx) Then If EgtSetCurrentContext(m_nVeinCtx) Then
Return If( nCurrCtx > 0, nCurrCtx, -2) Return If(nCurrCtx > 0, nCurrCtx, -2)
Else Else
Return 0 Return 0
End If End If
@@ -1268,7 +1293,7 @@ Friend Module VeinMatching
While nId <> GDB_ID.NULL While nId <> GDB_ID.NULL
Dim nOriId As Integer Dim nOriId As Integer
If EgtGetInfo(nId, KEY_ORI_ID, nOriId) AndAlso nOriId = nPartId Then If EgtGetInfo(nId, KEY_ORI_ID, nOriId) AndAlso nOriId = nPartId Then
Exit While Exit While
End If End If
nId = EgtGetNextPart(nId) nId = EgtGetNextPart(nId)
End While End While