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
5 changed files with 188 additions and 102 deletions
+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
+19 -11
View File
@@ -1,4 +1,5 @@
Imports EgtUILib Imports EgtUILib
Imports EgtWPFLib5
Public Class FiloTopUC Public Class FiloTopUC
@@ -38,7 +39,7 @@ 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) Parameter3TxBl.Text = EgtMsg(91138)
@@ -46,10 +47,10 @@ Public Class FiloTopUC
' 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
@@ -58,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
@@ -81,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
@@ -102,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
@@ -216,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
+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
+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)