Compare commits

...

14 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 4c282d7531 Abilito visualizzazione pulsante per inserimento FrameCompo 2023-05-18 11:13:40 +02:00
Nicola Pievani a941f963c2 Disabilito i comandi dei compo piani 2023-05-16 10:31:58 +02:00
Nicola Pievani eab341d7fe Importazione FrameCompo 2023-05-15 19:37:31 +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
Nicola Pievani acb8ceed4d Merge branch 'Features/Other_Ref_On_Table' into develop 2023-05-09 17:15:22 +02:00
12 changed files with 495 additions and 240 deletions
+2
View File
@@ -116,6 +116,8 @@ Module ConstIni
Public Const K_LASTCOLOR As String = "LastColor"
Public Const K_COLOR As String = "Color"
Public Const S_FRAMECOMPO As String = "FrameCompo"
Public Const S_EXTCOMPO As String = "Compo"
Public Const S_INTCOMPO As String = "InternalCompo"
+3 -1
View File
@@ -37,7 +37,7 @@ Public Class CompoDimensionUC
InternComponentBtn.Content = EgtMsg(MSG_COMPONENTPAGEUC + 47) ' Componenti interni
If Not String.IsNullOrEmpty(sCompoDir) Then
bEnableAlzFront = True
AlzFrontBtn.Content = "Alzatine & Frontalini"
AlzFrontBtn.Content = EgtMsg(91137)
Else
AlzFrontBtn.Visibility = Visibility.Collapsed
End If
@@ -107,8 +107,10 @@ Public Class CompoDimensionUC
Friend Sub ShowAlzFrontBtn(ByVal value As Boolean)
If value Then
AlzFrontBtn.Visibility = Visibility.Visible
m_MainWindow.m_DrawPageUC.MessageGrid.Visibility = Visibility.Hidden
Else
AlzFrontBtn.Visibility = Visibility.Hidden
m_MainWindow.m_DrawPageUC.MessageGrid.Visibility = Visibility.Visible
End If
End Sub
+52 -4
View File
@@ -283,6 +283,19 @@ Public Class DrawPageUC
m_sCsvOrder = ""
m_sCsvList = ""
m_sCsvName = ""
' Visuliazzazione dei bottoni per modifica dei componenti
If m_MainWindow.FrameCutBtn.IsChecked Then
SideAngleBtn.Visibility = Visibility.Hidden
FiloTopBtn.Visibility = Visibility.Hidden
EngraveBtn.Visibility = Visibility.Hidden
DripCutBtn.Visibility = Visibility.Hidden
Else
SideAngleBtn.Visibility = Visibility.Visible
FiloTopBtn.Visibility = Visibility.Visible
EngraveBtn.Visibility = Visibility.Visible
DripCutBtn.Visibility = Visibility.Visible
End If
End Sub
' recupero il click sulla scena ed assegno il metodo a secondo della pagina aperta
@@ -553,6 +566,7 @@ Public Class DrawPageUC
OkBtn.IsEnabled = True
End Sub
' Navigazione nelle due pagine per la selezione dei componenti da disegnare
Friend Sub BackBtn_Click(sender As Object, e As RoutedEventArgs) Handles BackBtn.Click
m_SceneButtons.MeasureBtn.IsChecked = False
DrawPage_Unloaded(sender, e)
@@ -604,6 +618,10 @@ Public Class DrawPageUC
MakePreview(sMsg)
MessageTxBl.Text = sMsg
MessageGrid.Background = If(m_bDrawOk, Brushes.Transparent, Application.Current.FindResource("OmagCut_Red"))
' EseguoUpdate del solido
Utility.CreateSolid3D(m_MainWindow.GetIniFile())
' aggiorno visualizzazione
EgtSetView(VT.TOP, False)
EgtZoom(ZM.ALL)
@@ -613,7 +631,8 @@ Public Class DrawPageUC
' Costruisco path completa del componente
Dim sPath = m_sCompoDir & "\" & m_sCompoName
' Carico il file
Return EgtLuaExecFile(sPath)
Dim bOk As Boolean = EgtLuaExecFile(sPath)
Return bOk
End Function
Private Function ReadAndShowVariables() As Boolean
@@ -1124,6 +1143,30 @@ Public Class DrawPageUC
Return True
End Function
Private Function MakeSectionFrameInsert() As Boolean
' m_MainWindow.m_ImportPageUC.LoadFrame()
' recupero il primo layer del primo pezzo
Dim nLayerId As Integer = EgtGetFirstLayer(EgtGetFirstPart())
If nLayerId = GDB_ID.NULL Then Return False
' percorso in cui salvare tempora
Dim sTmpFile As String = m_MainWindow.GetTempDir() & "\Frame.Nge"
If Not EgtSaveObjToFile(nLayerId, sTmpFile, NGE.BIN) Then Return False
' Passo al contesto principale
EgtSetCurrentContext(m_MainWindow.m_CurrentProjectPageUC.CurrentProjectScene.GetCtx())
' Inserisco il pezzo
If Not My.Computer.FileSystem.FileExists(sTmpFile) Then Return False
EgtInsertFile(sTmpFile)
' Ne recupero l'Id
Dim nPartId As Integer = EgtGetLastPart()
' Creo la cornice
m_MainWindow.m_FrameCutPageUC.CreateFrame(nPartId)
' Ricalcolo lavorazioni
AddFrameMachinings(m_MainWindow.m_FrameCutPageUC.m_FrameMachiningUC.m_dStartTrim, m_MainWindow.m_FrameCutPageUC.m_FrameMachiningUC.m_dEndTrim)
' Cancello il file
My.Computer.FileSystem.DeleteFile(sTmpFile)
Return True
End Function
Private Sub OkBtn_Click(sender As Object, e As RoutedEventArgs) Handles OkBtn.Click
m_bBackFromInternalCompo = False
m_bInternalCompo = False
@@ -1139,7 +1182,12 @@ Public Class DrawPageUC
Dim InsNbr As Integer = Int32.Parse(PartNumTxBx.Text)
' Passo al contesto principale
'MakeInsert(InsNbr, sPartName)
MakeMultipleInsert(InsNbr, sPartName)
If m_MainWindow.FrameCutBtn.IsChecked Then
MakeSectionFrameInsert()
Else
MakeMultipleInsert(InsNbr, sPartName)
End If
' Aggiorno ambiente principale
EgtZoom(ZM.ALL)
' Elimino nome del componente precedente
@@ -1153,7 +1201,7 @@ Public Class DrawPageUC
' Istruzioni per chiudere ImportPageUC e aprire CadCutPageUC
m_MainWindow.MainWindowGrid.Children.Remove(m_MainWindow.m_DrawPageUC)
m_MainWindow.MainWindowGrid.Children.Add(m_MainWindow.m_CurrentProjectPageUC)
m_MainWindow.m_ActivePage = MainWindow.Pages.CadCut
m_MainWindow.m_ActivePage = If(m_MainWindow.FrameCutBtn.IsChecked, MainWindow.Pages.FrameCut, MainWindow.Pages.CadCut)
End Sub
@@ -1174,7 +1222,7 @@ Public Class DrawPageUC
' Istruzioni per chiudere ImportPageUC e aprire CadCutPageUC
m_MainWindow.MainWindowGrid.Children.Remove(m_MainWindow.m_DrawPageUC)
m_MainWindow.MainWindowGrid.Children.Add(m_MainWindow.m_CurrentProjectPageUC)
m_MainWindow.m_ActivePage = MainWindow.Pages.CadCut
m_MainWindow.m_ActivePage = If(m_MainWindow.FrameCutBtn.IsChecked, MainWindow.Pages.FrameCut, MainWindow.Pages.CadCut)
End Sub
Private Sub TrfDataBtn_Click(sender As Object, e As RoutedEventArgs) Handles TrfDataBtn.Click
+21 -12
View File
@@ -1,4 +1,5 @@
Imports EgtUILib
Imports EgtWPFLib5
Public Class FiloTopUC
@@ -38,17 +39,18 @@ Public Class FiloTopUC
m_CallingPage = m_MainWindow.m_ActivePage
' Imposto messaggi
ParameterTxBl.Text = EgtMsg( MSG_IMPORTPAGEUC + 10) ' Offset
Parameter2TxBl.Text = EgtMsg( MSG_IMPORTPAGEUC + 11) ' Affondamento
ParameterTxBl.Text = EgtMsg(MSG_IMPORTPAGEUC + 10) ' Offset
Parameter2TxBl.Text = EgtMsg(MSG_IMPORTPAGEUC + 11) ' Affondamento
Parameter3TxBl.Text = EgtMsg(91138)
If m_CallingPage = MainWindow.Pages.Draw Then
' Imposto questa come pagina correntemente visualizzata nella drawpage
m_MainWindow.m_DrawPageUC.m_ActiveComponentPage = DrawPageUC.Pages.FiloTop
' Imposto contesto corrente
EgtSetCurrentContext( m_MainWindow.m_DrawPageUC.DrawScene.GetCtx())
EgtSetCurrentContext(m_MainWindow.m_DrawPageUC.DrawScene.GetCtx())
ElseIf m_CallingPage = MainWindow.Pages.Import Then
' Imposto contesto corrente
EgtSetCurrentContext( m_MainWindow.m_ImportPageUC.ImportScene.GetCtx())
EgtSetCurrentContext(m_MainWindow.m_ImportPageUC.ImportScene.GetCtx())
End If
' Gestisco visualizzazione dei parametri
@@ -57,9 +59,9 @@ Public Class FiloTopUC
Parameter3TxBl.Visibility = Windows.Visibility.Visible
' Aggiorno valori
m_dFiloTopOffset = GetPrivateProfileDouble( S_SIDES, K_FILOTOPOFFSET, 5, m_MainWindow.GetIniFile())
ParameterTxBx.Text = LenToString( m_dFiloTopOffset, 3)
m_dFiloTopDepth = GetPrivateProfileDouble( S_SIDES, K_FILOTOPDEPTH, 5, m_MainWindow.GetIniFile())
m_dFiloTopOffset = GetPrivateProfileDouble(S_SIDES, K_FILOTOPOFFSET, 5, m_MainWindow.GetIniFile())
ParameterTxBx.Text = LenToString(m_dFiloTopOffset, 3)
m_dFiloTopDepth = GetPrivateProfileDouble(S_SIDES, K_FILOTOPDEPTH, 5, m_MainWindow.GetIniFile())
Parameter2TxBx.Text = LenToString(m_dFiloTopDepth, 3)
m_bCornerradius = GetPrivateProfileInt(S_SIDES, K_ROUNDOFF, 0, m_MainWindow.GetIniFile()) <> 0
Parameter3ChBx.IsChecked = m_bCornerradius
@@ -80,8 +82,8 @@ Public Class FiloTopUC
Dim nLayId As Integer = EgtGetFirstLayer(nPartId)
While nLayId <> GDB_ID.NULL
Dim sLayName As String = ""
If EgtGetName( nLayId, sLayName) AndAlso sLayName = NAME_INLOOP AndAlso EgtExistsInfo( nLayId, INFO_FILOTOP) Then
EgtSetInfo( nLayId, INFO_OFFSET, m_dFiloTopOffset)
If EgtGetName(nLayId, sLayName) AndAlso sLayName = NAME_INLOOP AndAlso EgtExistsInfo(nLayId, INFO_FILOTOP) Then
EgtSetInfo(nLayId, INFO_OFFSET, m_dFiloTopOffset)
End If
nLayId = EgtGetNextLayer(nLayId)
End While
@@ -101,13 +103,16 @@ Public Class FiloTopUC
Dim nLayId As Integer = EgtGetFirstLayer(nPartId)
While nLayId <> GDB_ID.NULL
Dim sLayName As String = ""
If EgtGetName( nLayId, sLayName) AndAlso sLayName = NAME_INLOOP AndAlso EgtExistsInfo( nLayId, INFO_FILOTOP) Then
EgtSetInfo( nLayId, INFO_DEPTH, m_dFiloTopDepth)
If EgtGetName(nLayId, sLayName) AndAlso sLayName = NAME_INLOOP AndAlso EgtExistsInfo(nLayId, INFO_FILOTOP) Then
EgtSetInfo(nLayId, INFO_DEPTH, m_dFiloTopDepth)
End If
nLayId = EgtGetNextLayer(nLayId)
End While
nPartId = EgtGetNextPart(nPartId)
End While
Utility.CreateSolid3D(m_MainWindow.GetIniFile())
EgtDraw()
End Sub
Private Sub Parameter3ChBx_Checked() Handles Parameter3ChBx.Click
@@ -215,12 +220,16 @@ Public Class FiloTopUC
EgtRemoveInfo(nLayId, "FiloTopRef")
EgtOutLog("Error in generation OffsetPreView in TopEgde ")
End If
If bOk Then Utility.CreateSolid3D(m_MainWindow.GetIniFile())
' ---------------------- Fine GESTIONE PREVIEW percorso -------------------------------
End If
nLayId = EgtGetNextLayer(nLayId)
nLayId = EgtGetNextLayer(nLayId)
End While
nPartId = EgtGetNextPart(nPartId)
End While
EgtDraw()
End Sub
+83 -7
View File
@@ -41,6 +41,7 @@ Public Class MainComponentPageUC
m_MainWindow.m_DrawPageUC.FiloTopBtn.IsEnabled = False
m_MainWindow.m_DrawPageUC.EngraveBtn.IsEnabled = False
m_MainWindow.m_DrawPageUC.DripCutBtn.IsEnabled = False
m_MainWindow.m_DrawPageUC.m_bBackFromInternalCompo = False
End Sub
Private Function GetButton(ByVal nInd As Integer) As Button
@@ -167,7 +168,7 @@ Public Class MainComponentPageUC
Private Sub Compo_Click(sender As Object, e As RoutedEventArgs) Handles Compo1.Click, Compo2.Click, Compo3.Click, Compo4.Click, Compo5.Click, Compo6.Click, Compo7.Click, Compo8.Click
CurrentBtn = DirectCast(e.Source, Button)
Dim CompoName As String = S_COMPO & GetIndexFromButton(CurrentBtn).ToString
Dim CompoName As String = If(m_MainWindow.FrameCutBtn.IsChecked, S_FRAMECOMPO, S_COMPO) & GetIndexFromButton(CurrentBtn).ToString
m_sCurrCompoFam = CompoName
m_SecondaryComponentPage.m_sCurrCompo = String.Empty
Dim nCount As Integer = GetPrivateProfileInt(CompoName, K_CMP_COUNT, 0, m_MainWindow.GetIniFile())
@@ -251,13 +252,18 @@ Public Class MainComponentPageUC
End Sub
Private Sub LoadPage()
If m_MainWindow.FrameCutBtn.IsChecked Then
LoadFramePage()
Return
End If
Dim nDeltaSecondPage As Integer = 8
' Leggo numero di componenti presenti
Dim nCompoNumber As Integer = GetPrivateProfileInt(S_COMPO, K_CMP_COUNT, 0, m_MainWindow.GetIniFile())
' Calcolo indici a seconda della pagina in cui sono
If m_bIsFirstPage Then
ClearButton(nCompoNumber)
nDeltaSecondPage = 0
nDeltaSecondPage = 0
Else
ClearButton(nCompoNumber)
nDeltaSecondPage = 8
@@ -325,16 +331,86 @@ Public Class MainComponentPageUC
End Sub
Private Sub LoadFramePage()
Dim nDeltaSecondPage As Integer = 8
' Leggo numero di componenti presenti
Dim nCompoNumber As Integer = GetPrivateProfileInt(S_FRAMECOMPO, K_CMP_COUNT, 0, m_MainWindow.GetIniFile())
' Calcolo indici a seconda della pagina in cui sono
If m_bIsFirstPage Then
ClearButton(nCompoNumber)
nDeltaSecondPage = 0
Else
ClearButton(nCompoNumber)
nDeltaSecondPage = 8
End If
' Creazione converter da String a ImageSource
Dim ImageConverter As New ImageSourceConverter
Dim ThicknessConverter As New ThicknessConverter
'Assegnazione immagine e testo ai Button
For index As Integer = 1 To 8
Dim CustomThickness As New Thickness(0)
Dim nCompoName As Integer = GetPrivateProfileInt(S_FRAMECOMPO & index + nDeltaSecondPage, "Name", 0, m_MainWindow.GetIniFile())
Dim sCompoImage As String = ""
Dim sCompoImageSource As ImageSource
'verifico presenza immagine e la aggiungo
If GetPrivateProfileString(S_FRAMECOMPO & index + nDeltaSecondPage, "Image", "", sCompoImage, m_MainWindow.GetIniFile()) <> 0 Then
Try
sCompoImageSource = ImageConverter.ConvertFromString(m_MainWindow.GetResourcesDir() & "\" & sCompoImage)
GetImage(index).Height = 65
GetImage(index).Width = 65
GetImage(index).Source = sCompoImageSource
Catch ex As Exception
EgtOutLog("Error loading image " & sCompoImage)
sCompoImage = String.Empty
GetImage(index).Height = 0
GetImage(index).Width = 0
CustomThickness.Right = 0
GetImage(index).Margin = CustomThickness
End Try
Else
'Se non c'è l'immagine azzero la distanza tra testo e immagine
CustomThickness.Right = 0
GetImage(index).Margin = CustomThickness
End If
'verifico presenza testo
If nCompoName > 0 Then
Dim sCompoName As String = EgtMsg(MSG_COMPONENTPAGEUC + nCompoName)
'verifico presenza immagine
If sCompoImage.Length > 0 Then
'se la lunghezza del testo è maggiore di 15 lo taglio
If sCompoName.Length > 15 Then
sCompoName = sCompoName.Substring(0, 15)
End If
GetLabel(index).Text = sCompoName
'Se ci sono sia testo che immagine imposto un margine di 10
CustomThickness.Right = 10
GetImage(index).Margin = CustomThickness
Else
'se l'immagine non c'è e il testo è maggiore di 20 lo taglio
If sCompoName.Length > 20 Then
sCompoName = sCompoName.Substring(0, 20)
End If
GetLabel(index).Text = sCompoName
End If
Else
'Se non c'è testo azzero la distanza tra testo e immagine
CustomThickness.Right = 0
GetImage(index).Margin = CustomThickness
End If
Next
End Sub
' Gestione bottone altri componenti
Private Sub Compo9_Click(sender As Object, e As RoutedEventArgs) Handles Compo9.Click
If m_bIsFirstPage Then
m_bIsFirstPage = False
LoadPage()
'Compo9.SetValue(Grid.ColumnProperty, 1)
'Compo9.SetValue(Grid.ColumnSpanProperty, 1)
'ImageCompo9.Source = New System.Windows.Media.Imaging.BitmapImage(New Uri("/Resources/NumericKeyboardArrow.png", UriKind.Relative))
'ImageCompo9.Visibility = Windows.Visibility.Visible
'LabelCompo9.Visibility = Windows.Visibility.Hidden
Compo9.SetValue(Grid.ColumnProperty, 0)
Compo9.SetValue(Grid.ColumnSpanProperty, 2)
ImageCompo9.Visibility = Windows.Visibility.Hidden
+36 -32
View File
@@ -171,25 +171,25 @@ Public Class SideAngleUC
' Aggiorno valori
If m_Mode = ModeOpt.DRIP Then
m_dDripOffset = GetPrivateProfileDouble( S_SIDES, K_DRIPOFFSET, 20, m_MainWindow.GetIniFile())
m_dDripOffset2 = GetPrivateProfileDouble( S_SIDES, K_DRIPOFFSET2, 0, m_MainWindow.GetIniFile())
m_dDripDepth = GetPrivateProfileDouble( S_SIDES, K_DRIPDEPTH, 10, m_MainWindow.GetIniFile())
m_dDripShort = GetPrivateProfileDouble( S_SIDES, K_DRIPSHORT, 0, m_MainWindow.GetIniFile())
Parameter1TxBx.Text = LenToString( m_dDripOffset, 3)
Parameter2TxBx.Text = LenToString( m_dDripOffset2, 3)
Parameter3TxBx.Text = LenToString( m_dDripDepth, 3)
Parameter4TxBx.Text = LenToString( m_dDripShort, 3)
m_dDripOffset = GetPrivateProfileDouble(S_SIDES, K_DRIPOFFSET, 20, m_MainWindow.GetIniFile())
m_dDripOffset2 = GetPrivateProfileDouble(S_SIDES, K_DRIPOFFSET2, 0, m_MainWindow.GetIniFile())
m_dDripDepth = GetPrivateProfileDouble(S_SIDES, K_DRIPDEPTH, 10, m_MainWindow.GetIniFile())
m_dDripShort = GetPrivateProfileDouble(S_SIDES, K_DRIPSHORT, 0, m_MainWindow.GetIniFile())
Parameter1TxBx.Text = LenToString(m_dDripOffset, 3)
Parameter2TxBx.Text = LenToString(m_dDripOffset2, 3)
Parameter3TxBx.Text = LenToString(m_dDripDepth, 3)
Parameter4TxBx.Text = LenToString(m_dDripShort, 3)
ElseIf m_Mode = ModeOpt.ENGRAVE Then
m_dDripOffset = GetPrivateProfileDouble( S_SIDES, K_ENGRAVEOFFSET, 20, m_MainWindow.GetIniFile())
m_nEngrNbr2 = GetPrivateProfileInt( S_SIDES, K_ENGRAVENUMBER2, 1, m_MainWindow.GetIniFile())
m_dDripOffset2 = GetPrivateProfileDouble( S_SIDES, K_ENGRAVEOFFSET2, 0, m_MainWindow.GetIniFile())
m_dDripDepth = GetPrivateProfileDouble( S_SIDES, K_ENGRAVEDEPTH, 10, m_MainWindow.GetIniFile())
m_dDripOffset = GetPrivateProfileDouble(S_SIDES, K_ENGRAVEOFFSET, 20, m_MainWindow.GetIniFile())
m_nEngrNbr2 = GetPrivateProfileInt(S_SIDES, K_ENGRAVENUMBER2, 1, m_MainWindow.GetIniFile())
m_dDripOffset2 = GetPrivateProfileDouble(S_SIDES, K_ENGRAVEOFFSET2, 0, m_MainWindow.GetIniFile())
m_dDripDepth = GetPrivateProfileDouble(S_SIDES, K_ENGRAVEDEPTH, 10, m_MainWindow.GetIniFile())
m_dEngraveDepth2 = GetPrivateProfileDouble(S_SIDES, K_ENGRAVEDEPTH2, 0, m_MainWindow.GetIniFile())
m_dEngraveAngle = GetPrivateProfileDouble(S_SIDES, K_ENGRAVEANGLE, 0, m_MainWindow.GetIniFile())
Parameter1TxBx.Text = LenToString(m_dDripOffset, 3)
Parameter2aTxBx.Text = m_nEngrNbr2.ToString()
Parameter2bTxBx.Text = LenToString( m_dDripOffset2, 3)
Parameter3TxBx.Text = LenToString( m_dDripDepth, 3)
Parameter2bTxBx.Text = LenToString(m_dDripOffset2, 3)
Parameter3TxBx.Text = LenToString(m_dDripDepth, 3)
Parameter4TxBx.Text = LenToString(m_dEngraveDepth2, 3)
Parameter5TxBx.Text = DoubleToString(m_dEngraveAngle, 3)
End If
@@ -311,8 +311,8 @@ Public Class SideAngleUC
' Attualmente il vaore m_nCount è inizializzato ad "1"..
' Bottoni Prev Next
If m_nCount <= MAX_LINES Then
PrevBtn.Visibility= Windows.Visibility.Hidden
NextBtn.Visibility= Windows.Visibility.Hidden
PrevBtn.Visibility = Windows.Visibility.Hidden
NextBtn.Visibility = Windows.Visibility.Hidden
Else
Grid.SetRow(PrevBtn, MAX_LINES - m_nShow)
PrevBtn.Visibility = Windows.Visibility.Visible
@@ -371,7 +371,7 @@ Public Class SideAngleUC
GetHeelTxBxFromIndex(Index).Text = GetPrivateProfileDouble(S_SIDES, K_DRIPSHORT & "A" & nI.ToString & "_End", 0, m_MainWindow.GetIniFile())
End If
End If
Dim TxBlIndex As Integer = (m_nCurrPage - 1) * MAX_LINES + nI - 1
Dim TxBlIndex As Integer = (m_nCurrPage - 1) * MAX_LINES + nI - 1
GetTxBlFromIndex(Index).Text = If(m_Mode = ModeOpt.SIDEANGLE,
m_SideAngleEntityList(TxBlIndex).sEntityName,
m_DripEntityList(TxBlIndex).sEntityName)
@@ -495,15 +495,15 @@ Public Class SideAngleUC
'-------------> Restituisce gli oggetto della grafica assegnato l'indice
' quando esco salvo nel file l'ultima configurazione per le incisioni
Private Sub SideAngleUC_Unloaded( sender As Object, e As RoutedEventArgs) Handles Me.Unloaded
Private Sub SideAngleUC_Unloaded(sender As Object, e As RoutedEventArgs) Handles Me.Unloaded
If m_CallingPage = MainWindow.Pages.Draw Then
' Ricavo nome pezzo
Dim PartId As Integer = EgtGetFirstInGroup( GDB_ID.ROOT)
Dim PartId As Integer = EgtGetFirstInGroup(GDB_ID.ROOT)
' Svuoto layer in cui sono presenti i testi con le inclinazioni dei lati
If m_Mode = ModeOpt.SIDEANGLE Then
EgtEmptyGroup( EgtGetFirstNameInGroup( PartId, SIDE_ANGLE_LAYER))
EgtEmptyGroup(EgtGetFirstNameInGroup(PartId, SIDE_ANGLE_LAYER))
Else
EgtEmptyGroup( EgtGetFirstNameInGroup( PartId, SIDE_ANGLE_LAYER))
EgtEmptyGroup(EgtGetFirstNameInGroup(PartId, SIDE_ANGLE_LAYER))
End If
ElseIf m_CallingPage = MainWindow.Pages.Import Then
' Nessuna azione necessaria
@@ -516,7 +516,7 @@ Public Class SideAngleUC
'WritePrivateProfileString( S_SIDES, K_DRIPSHORT, DoubleToString( m_dDripShort, 3), m_MainWindow.GetIniFile())
ElseIf m_Mode = ModeOpt.ENGRAVE Then
WritePrivateProfileString(S_SIDES, K_ENGRAVEOFFSET, LenToString(m_dDripOffset, 3), m_MainWindow.GetIniFile())
WritePrivateProfileString( S_SIDES, K_ENGRAVENUMBER2, m_nEngrNbr2.ToString(), m_MainWindow.GetIniFile())
WritePrivateProfileString(S_SIDES, K_ENGRAVENUMBER2, m_nEngrNbr2.ToString(), m_MainWindow.GetIniFile())
WritePrivateProfileString(S_SIDES, K_ENGRAVEOFFSET2, LenToString(m_dDripOffset2, 3), m_MainWindow.GetIniFile())
WritePrivateProfileString(S_SIDES, K_ENGRAVEDEPTH, LenToString(m_dDripDepth, 3), m_MainWindow.GetIniFile())
WritePrivateProfileString(S_SIDES, K_ENGRAVEDEPTH2, LenToString(m_dEngraveDepth2, 3), m_MainWindow.GetIniFile())
@@ -538,7 +538,7 @@ Public Class SideAngleUC
PartId = If(m_MainWindow.m_DrawPageUC.SelectedLayer <> GDB_ID.NULL, EgtGetFirstPart(), GDB_ID.NULL)
' Recupero nome layer con geometria di contorno (esterno o interno) del pezzo
LoopId = m_MainWindow.m_DrawPageUC.SelectedLayer
ElseIf m_CallingPage = MainWindow.Pages.Import Then
ElseIf m_CallingPage = MainWindow.Pages.Import Then
' Imposto contesto corrente
EgtSetCurrentContext(m_MainWindow.m_ImportPageUC.ImportScene.GetCtx())
' Recupero nome pezzo
@@ -579,6 +579,10 @@ Public Class SideAngleUC
' Creo le geometrie dei gocciolatoi
CreateDripGeom(PartId)
End If
' se abilitato e dimensione solido da sotto: creo il solido
Utility.CreateSolid3D(m_MainWindow.GetIniFile())
' Aggiorno visualizzazione
EgtDraw()
End Sub
@@ -600,7 +604,7 @@ Public Class SideAngleUC
For nIndex As Integer = 1 To m_nCount
Dim Entity As DripEntity = m_DripEntityList(nIndex - 1)
' Imposto check box (se sono stati definiti il numero corretto di CheckBox
If nIndex < ( m_nCurrPage - 1) * MAX_LINES Or nIndex > m_nCurrPage * MAX_LINES Then Continue For
If nIndex < (m_nCurrPage - 1) * MAX_LINES Or nIndex > m_nCurrPage * MAX_LINES Then Continue For
Dim nChIndex As Integer = nIndex - (m_nCurrPage - 1) * MAX_LINES + MAX_LINES - m_nShow
' verifico se l'entità ha un gocciolatoio
GetChBxFromIndex(nChIndex).IsChecked = Entity.bHaveDrip
@@ -973,15 +977,15 @@ Public Class SideAngleUC
Private Sub PrevBtn_Click(sender As Object, e As RoutedEventArgs) Handles PrevBtn.Click
If m_nCurrPage = 1 Then Return
m_nCurrPage -= 1
m_nShow = Math.Min( m_nCount - ( m_nCurrPage - 1) * MAX_LINES, MAX_LINES)
m_nShow = Math.Min(m_nCount - (m_nCurrPage - 1) * MAX_LINES, MAX_LINES)
TxBlChBxView()
RefreshCheckAndValue()
End Sub
Private Sub NextBtn_Click(sender As Object, e As RoutedEventArgs) Handles NextBtn.Click
If m_nCount <= ( m_nCurrPage - 1) * MAX_LINES Then Return
If m_nCount <= (m_nCurrPage - 1) * MAX_LINES Then Return
m_nCurrPage += 1
m_nShow = Math.Min( m_nCount - ( m_nCurrPage - 1) * MAX_LINES, MAX_LINES)
m_nShow = Math.Min(m_nCount - (m_nCurrPage - 1) * MAX_LINES, MAX_LINES)
TxBlChBxView()
RefreshCheckAndValue()
End Sub
@@ -993,7 +997,7 @@ Public Class SideAngleUC
Dim bVal As Boolean = CurrCheckBox.IsChecked()
Dim SideIndex As Integer = CInt(CurrCheckBox.Name.Substring(1))
' Converto nome checkbox in nome elemento tenendo conto della pagina e dello slittamento verso il basso
Dim nCurrSide As Integer = ( m_nCurrPage - 1) * MAX_LINES + SideIndex - ( MAX_LINES - m_nShow)
Dim nCurrSide As Integer = (m_nCurrPage - 1) * MAX_LINES + SideIndex - (MAX_LINES - m_nShow)
Dim sCurrSide As String = m_DripEntityList(nCurrSide - 1).sEntityName
' aggiorno l'entità con i valori scritti nel campo di testo
Dim CurrEntity As DripEntity = DripEntity.FindEntity(sCurrSide)
@@ -1192,7 +1196,7 @@ Public Class SideAngleUC
AngleTxBx.Text = DoubleToString(dSideAngle, 2)
End If
' Converto nome checkbox in nome elemento tenendo conto della pagina e dello slittamento verso il basso
Dim nCurrSide As Integer = ( m_nCurrPage - 1) * MAX_LINES + SideIndex - ( MAX_LINES - m_nShow)
Dim nCurrSide As Integer = (m_nCurrPage - 1) * MAX_LINES + SideIndex - (MAX_LINES - m_nShow)
Dim sCurrSide As String = m_SideAngleEntityList(nCurrSide - 1).sEntityName
' Lo modifico nella geometria e nella lista inclinazioni
ModifySideAngle(sCurrSide, dSideAngle)
@@ -1262,7 +1266,7 @@ Public Class SideAngleUC
HeelTxBx.Text = "0"
End If
' Converto nome checkbox in nome elemento tenendo conto della pagina e dello slittamento verso il basso
Dim nCurrSide As Integer = ( m_nCurrPage - 1) * MAX_LINES + SideIndex - ( MAX_LINES - m_nShow)
Dim nCurrSide As Integer = (m_nCurrPage - 1) * MAX_LINES + SideIndex - (MAX_LINES - m_nShow)
Dim sCurrSide As String = m_SideAngleEntityList(nCurrSide - 1).sEntityName
' Lo modifico nella geometria e nella lista inclinazioni
ModifySideHeel(sCurrSide, dSideHeel)
@@ -1303,7 +1307,7 @@ Public Class SideAngleUC
If dSideAngle <> 0 Then
EgtSetInfo(CurrEntity.nGeomId, INFO_SIDE_ANGLE, dSideAngle)
EgtSetInfo(CurrEntity.nGeomId, INFO_ORIG_SIDE_ANGLE, dSideAngle)
' Cancello inclinazione nell'apposito campo info
' Cancello inclinazione nell'apposito campo info
Else
EgtRemoveInfo(CurrEntity.nGeomId, INFO_SIDE_ANGLE)
EgtRemoveInfo(CurrEntity.nGeomId, INFO_ORIG_SIDE_ANGLE)
@@ -1324,7 +1328,7 @@ Public Class SideAngleUC
' Scrivo nuovo tallone nelle info
If dSideHeel > 10 * EPS_SMALL Then
EgtSetInfo(CurrEntity.nGeomId, INFO_HEEL, dSideHeel)
' Cancello inclinazione nell'apposito campo info
' Cancello inclinazione nell'apposito campo info
Else
EgtRemoveInfo(CurrEntity.nGeomId, INFO_HEEL)
End If
+106 -98
View File
@@ -7,124 +7,132 @@
mc:Ignorable="d"
d:DesignHeight="853.3" d:DesignWidth="1280">
<!-- Definizione della FrameCutPage -->
<Grid Name="FrameCutPageGrid" >
<Grid.ColumnDefinitions>
<ColumnDefinition Width="3*"/>
<ColumnDefinition Width="12*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="1*"/>
<RowDefinition Height="8*"/>
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
<!-- Definizione della Grid superiore -->
<Grid Grid.Column="1" Grid.Row="0" >
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="4*"/>
</Grid.ColumnDefinitions>
<Button Name="PhotoBtn" Grid.Column="0" Style="{DynamicResource OmagCut_RightGrayGradientYellowButton}">
<Image Source="{DynamicResource PhotoImg}" Style="{StaticResource OmagCut_ButtonIcon}"/>
</Button>
<Button Name="RawPartBtn" Grid.Column="1" Style="{DynamicResource OmagCut_RightGrayGradientYellowButton}">
<Image Source="{DynamicResource RawPartImg}" Style="{StaticResource OmagCut_ButtonIcon}"/>
</Button>
<ToggleButton Name="MachiningBtn" Grid.Column="4" Style="{DynamicResource OmagCut_RightGrayYellowIconToggleButton}">
<Image Source="{DynamicResource FrameMachiningImg}" Style="{StaticResource OmagCut_ButtonIcon}"/>
</ToggleButton>
</Grid>
<Grid Name="LeftGrid" Grid.Row="1">
<Grid.RowDefinitions>
<!-- Definizione della FrameCutPage -->
<Grid Name="FrameCutPageGrid" >
<Grid.ColumnDefinitions>
<ColumnDefinition Width="3*"/>
<ColumnDefinition Width="12*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="1*"/>
<RowDefinition Height="7*"/>
</Grid.RowDefinitions>
<Grid Grid.Row="1">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="0.6*"/>
<RowDefinition Height="0.8*"/>
<RowDefinition Height="0.5*"/>
<RowDefinition Height="0.5*"/>
<RowDefinition Height="0.5*"/>
<RowDefinition Height="0.8*"/>
<RowDefinition Height="2.5*"/>
</Grid.RowDefinitions>
<RowDefinition Height="8*"/>
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
<ComboBox Name="AlongAxCmBx" Grid.Row="0" Grid.ColumnSpan="3" Style="{StaticResource OmagCut_ComboBox}"
Width="200" MaxDropDownHeight="300">
<ComboBox.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding}" Style="{StaticResource OmagCut_LowerCaseCharacterTextBlock}"/>
</DataTemplate>
</ComboBox.ItemTemplate>
</ComboBox>
<!-- Definizione della Grid superiore -->
<Grid Grid.Column="1" Grid.Row="0" >
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="4*"/>
</Grid.ColumnDefinitions>
<UniformGrid Grid.Column="0" Grid.Row="1" Grid.ColumnSpan="3" Columns="2" >
<Button Name="SelSectionBtn"
Style="{DynamicResource OmagCut_YellowGradientYellowIconButton}">
<Image Source="{DynamicResource Sezione-corniceImg}" Style="{DynamicResource OmagCut_ButtonIcon}"/>
<Button Name="PhotoBtn" Grid.Column="0" Style="{DynamicResource OmagCut_RightGrayGradientYellowButton}">
<Image Source="{DynamicResource PhotoImg}" Style="{StaticResource OmagCut_ButtonIcon}"/>
</Button>
<Grid>
<Button Name="SelGuideBtn"
<Button Name="RawPartBtn" Grid.Column="1" Style="{DynamicResource OmagCut_RightGrayGradientYellowButton}">
<Image Source="{DynamicResource RawPartImg}" Style="{StaticResource OmagCut_ButtonIcon}"/>
</Button>
<ToggleButton Name="MachiningBtn" Grid.Column="4" Style="{DynamicResource OmagCut_RightGrayYellowIconToggleButton}">
<Image Source="{DynamicResource FrameMachiningImg}" Style="{StaticResource OmagCut_ButtonIcon}"/>
</ToggleButton>
</Grid>
<Grid Name="LeftGrid" Grid.Row="1">
<Grid.RowDefinitions>
<RowDefinition Height="1*"/>
<RowDefinition Height="7*"/>
</Grid.RowDefinitions>
<Grid Grid.Row="1">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="0.6*"/>
<RowDefinition Height="0.8*"/>
<RowDefinition Height="0.5*"/>
<RowDefinition Height="0.5*"/>
<RowDefinition Height="0.5*"/>
<RowDefinition Height="0.8*"/>
<RowDefinition Height="0.8*"/>
<RowDefinition Height="1.7*"/>
</Grid.RowDefinitions>
<ComboBox Name="AlongAxCmBx" Grid.Row="0" Grid.ColumnSpan="3" Style="{StaticResource OmagCut_ComboBox}"
Width="200" MaxDropDownHeight="300">
<ComboBox.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding}" Style="{StaticResource OmagCut_LowerCaseCharacterTextBlock}"/>
</DataTemplate>
</ComboBox.ItemTemplate>
</ComboBox>
<UniformGrid Grid.Column="0" Grid.Row="1" Grid.ColumnSpan="3" Columns="2" >
<Button Name="SelSectionBtn"
Style="{DynamicResource OmagCut_YellowGradientYellowIconButton}">
<Image Source="{DynamicResource Sezione-corniceImg}" Style="{DynamicResource OmagCut_ButtonIcon}"/>
</Button>
<Grid>
<Button Name="SelGuideBtn"
Style="{DynamicResource OmagCut_YellowTextButton}"/>
<UniformGrid Name="ArcGrid" Grid.Column="0" Grid.Row="1" Grid.ColumnSpan="3" Columns="2" >
<TextBlock Name="ArcRadTxBl" Grid.Row="2" Grid.ColumnSpan="2"
<UniformGrid Name="ArcGrid" Grid.Column="0" Grid.Row="1" Grid.ColumnSpan="3" Columns="2" >
<TextBlock Name="ArcRadTxBl" Grid.Row="2" Grid.ColumnSpan="2"
Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>
<EgtWPFLib:EgtTextBox Name="ArcRadTxBx" Grid.Column="2" Grid.Row="2" Width="50"
<EgtWPFLib:EgtTextBox Name="ArcRadTxBx" Grid.Column="2" Grid.Row="2" Width="50"
Style="{DynamicResource OmagCut_CalculatorTextBox}"/>
<TextBlock Name="ArcAngTxBl" Grid.Row="3" Grid.ColumnSpan="2"
<TextBlock Name="ArcAngTxBl" Grid.Row="3" Grid.ColumnSpan="2"
Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>
<EgtWPFLib:EgtTextBox Name="ArcAngTxBx" Grid.Column="2" Grid.Row="3" Width="50"
<EgtWPFLib:EgtTextBox Name="ArcAngTxBx" Grid.Column="2" Grid.Row="3" Width="50"
Style="{DynamicResource OmagCut_CalculatorTextBox}"/>
</UniformGrid>
</Grid>
</UniformGrid>
</UniformGrid>
</Grid>
</UniformGrid>
<TextBlock Name="OffsZTxBl" Grid.Row="2" Grid.ColumnSpan="2"
<TextBlock Name="OffsZTxBl" Grid.Row="2" Grid.ColumnSpan="2"
Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>
<EgtWPFLib:EgtTextBox Name="OffsZTxBx" Grid.Column="2" Grid.Row="2" Width="50"
<EgtWPFLib:EgtTextBox Name="OffsZTxBx" Grid.Column="2" Grid.Row="2" Width="50"
Style="{DynamicResource OmagCut_CalculatorTextBox}"/>
<TextBlock Name="OffsXyTxBl" Grid.Row="3" Grid.ColumnSpan="2"
<TextBlock Name="OffsXyTxBl" Grid.Row="3" Grid.ColumnSpan="2"
Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>
<EgtWPFLib:EgtTextBox Name="OffsXyTxBx" Grid.Column="2" Grid.Row="3" Width="50"
<EgtWPFLib:EgtTextBox Name="OffsXyTxBx" Grid.Column="2" Grid.Row="3" Width="50"
Style="{DynamicResource OmagCut_CalculatorTextBox}"/>
<TextBlock Name="OffsYyTxBl" Grid.Row="4" Grid.ColumnSpan="2"
<TextBlock Name="OffsYyTxBl" Grid.Row="4" Grid.ColumnSpan="2"
Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>
<EgtWPFLib:EgtTextBox Name="OffsYyTxBx" Grid.Column="2" Grid.Row="4" Width="50"
<EgtWPFLib:EgtTextBox Name="OffsYyTxBx" Grid.Column="2" Grid.Row="4" Width="50"
Style="{DynamicResource OmagCut_CalculatorTextBox}"/>
<UniformGrid Grid.Column="0" Grid.Row="5" Grid.ColumnSpan="3" Columns="2" >
<Button Name="MirrorPartBtn"
<UniformGrid Grid.Column="0" Grid.Row="5" Grid.ColumnSpan="3" Columns="2" >
<Button Name="MirrorPartBtn"
Style="{DynamicResource OmagCut_RightGrayGradientYellowButton}">
<Image Source="{DynamicResource SpecchiaImg}" Style="{DynamicResource OmagCut_ButtonIcon}"/>
</Button>
<Button Name="RemovePartBtn"
</Button>
<Button Name="RemovePartBtn"
Style="{DynamicResource OmagCut_RightGrayGradientYellowButton}">
<Image Source="{DynamicResource Rimuovi_eliminaImg}" Style="{DynamicResource OmagCut_ButtonIcon}"/>
</Button>
</UniformGrid>
</Button>
</UniformGrid>
<!--<TextBlock Name="SawRoughingTxBl" Grid.Row="4" Grid.ColumnSpan="3"
<UniformGrid Grid.Column="0" Grid.Row="6" Grid.ColumnSpan="3" Columns="2" >
<Button Name="CompoBtn"
Style="{DynamicResource OmagCut_RightGrayGradientYellowButton}">
<Image Source="{DynamicResource DrawImg}" Style="{DynamicResource OmagCut_ButtonIcon}"/>
</Button>
</UniformGrid>
<!--<TextBlock Name="SawRoughingTxBl" Grid.Row="4" Grid.ColumnSpan="3"
Style="{StaticResource OmagCut_CenteredLowerCaseCharacterTextBlock}"/>
<ComboBox Name="SawRoughingCmBx" Grid.Row="5" Grid.ColumnSpan="3" Style="{StaticResource OmagCut_ComboBox}"
@@ -182,10 +190,10 @@
</ComboBox.ItemTemplate>
</ComboBox>-->
</Grid>
</Grid>
</Grid>
</Grid>
</Grid>
</Grid>
</UserControl>
+12
View File
@@ -81,6 +81,8 @@ Public Class FrameCutPageUC
m_ProjectMgr.CSVBtn.Visibility = Windows.Visibility.Hidden
m_ProjectMgr.VeinMatchingBtn.Visibility = Windows.Visibility.Hidden
m_ProjectMgr.RegisterBtn.Visibility = Windows.Visibility.Hidden
' Visualizzo il bottone per l'importazione dei compo frame
CompoBtn.Visibility = If(GetPrivateProfileInt(S_FRAMECOMPO, K_CMP_COUNT, 0, m_MainWindow.GetIniFile()) > 0, Visibility.Visible, Visibility.Hidden)
' Recupero dimensioni e kerf del grezzo
m_nRawId = EgtGetFirstRawPart()
GetRawBox(m_RawBox)
@@ -436,6 +438,16 @@ Public Class FrameCutPageUC
End If
End Sub
Private Sub CompoBtn_Click(sender As Object, e As RoutedEventArgs) Handles CompoBtn.Click
m_MainWindow.TestOff()
m_MainWindow.DragRettangleOff()
m_MainWindow.SplitCurvWJOff()
m_MainWindow.StartCurvWJOff()
m_MainWindow.MainWindowGrid.Children.Remove(m_MainWindow.m_CurrentProjectPageUC)
m_MainWindow.MainWindowGrid.Children.Add(m_MainWindow.m_DrawPageUC)
m_MainWindow.m_ActivePage = MainWindow.Pages.Draw
End Sub
Friend Function CreateFrame(nPartId As Integer) As Boolean
If Not MyCreateFrame( nPartId) Then
EgtErase( nPartId)
+2 -2
View File
@@ -61,8 +61,8 @@ Public Class PolishingsPageUC
RepeatTxBl.Text = EgtMsg(91093) ' Ripetizioni
StepTxBl.Text = EgtMsg(90787) ' Passo
OffSetTxBl.Text = EgtMsg(91089) ' Offset
RadiusTxBl.Text = "Raggio"
DistanceTxBl.Text = "Distanza"
RadiusTxBl.Text = EgtMsg(91139) ' Raggio
DistanceTxBl.Text = EgtMsg(91140) ' Distanza
LiLoGpBx.Header = EgtMsg(91094) ' Attacco/Uscita
LiLenTxBl.Text = EgtMsg(91097) ' Lunghezza
LiHeightTxBl.Text = EgtMsg(91095) ' Altezza
+44 -5
View File
@@ -567,16 +567,55 @@ Public Class SimulationPageUC
End Sub
Private Sub GenerateXPIUC_Click(sender As Object, e As RoutedEventArgs)
' eventualmente fermo la simulazione
m_nStatus = MCH_SIM_ST.UI_STOP
m_bPlay = False
PlayPauseBtn_Click(Nothing, Nothing)
' se il bottone Shift è premuto apro il file CadCut1 nel programma NotePad
Dim IsPressedShiftKey As Boolean = False
If Keyboard.Modifiers And ModifierKeys.Shift Then
IsPressedShiftKey = True
End If
' Se nella pagina di tagli diretti
If m_MainWindow.DirectCutBtn.IsChecked And Not m_MainWindow.CadCutBtn.IsChecked Then
' Genero file CNC (lancio anche se errore in precedenza)
Dim sCncPathDirect As String = m_MainWindow.GetCncDir() & "\DirectCut" & m_MainWindow.m_CurrentMachine.sIsoFileExt
Dim bOkDirect As Boolean = EgtGenerate(sCncPathDirect, "OmagCut ver." & m_MainWindow.GetVersion())
' Costringo ad aggiornare UI
UpdateUI()
' Ripristino come fase corrente quella iniziale
EgtSetCurrPhase(1)
If bOkDirect Then
m_CurrProjPage.SetInfoMessage("Genarato file " & "DirectCut" & m_MainWindow.m_CurrentMachine.sIsoFileExt)
Else
m_CurrProjPage.SetErrorMessage(EgtMsg(90314)) 'Errore nella generazione del programma CN
End If
' procedo all'apertura del file CadCut1 apenna generato (solo se generazione corretta)
If bOkDirect And IsPressedShiftKey Then
Try
Process.Start("Notepad.exe", sCncPathDirect)
Catch ex As Exception
EgtOutLog(ex.ToString)
End Try
End If
' ricarico la pagina di simulazione
EgtSetCurrPhase(1)
' nascondo i pezzi in parcheggio
HideParkedParts(True)
' Avvio ambiente di simulazione
EgtSimInit()
EgtSimStart()
' Imposto stato corrente
SetStatus(MCH_SIM_ST.UI_STOP)
m_bPlay = True
' Costringo ad aggiornare UI
UpdateUI()
' esco
Return
End If
' eventualmente fermo la simulazione
m_nStatus = MCH_SIM_ST.UI_STOP
m_bPlay = False
PlayPauseBtn_Click(Nothing, Nothing)
Dim bOk As Boolean = True
EgtSetCurrentContext(m_CurrProjPage.CurrentProjectScene.GetCtx())
' Elimino eventuale attrezzaggio da OmagOFFICE
+83 -53
View File
@@ -6,6 +6,36 @@ Imports EgtWPFLib
Imports EgtUILib
Module Utility
'--------------------------------------------------------------------------------------------------
#Region "COMPO SOLID3d"
Friend Function CreateSolid3D(sIniFile As String) As Boolean
EgtSaveFile("C:\EgtData\OmagCUT\Temp\Ribasso.nge", NGE.TEXT)
Dim bOk As Boolean = False
Dim dRawHeight As Double = GetPrivateProfileDouble(S_RAWPART, K_RAWHEIGHT, 30, sIniFile)
' se abilitato e dimensione solido da sotto: creo il solido
Dim sPathSOLID As String = String.Empty
If GetPrivateProfileString(S_SIDES, "CreateSOLID", "", sPathSOLID, sIniFile) <> 0 And
GetPrivateProfileInt(S_SIDES, K_SIZEALWAYSONTOP, 0, sIniFile) = 0 Then
' Recupero file LUA
EgtLuaExecFile(sPathSOLID)
Dim dThick As Double = dRawHeight
EgtLuaSetGlobNumVar("CMP.THICK", dThick)
bOk = EgtLuaExecLine("CMP_Draw(false)")
Dim nErr As Integer = 0
EgtLuaGetGlobIntVar("CMP.ERR", nErr)
' Reset lua
EgtLuaResetGlobVar("CMP")
Else
EgtOutLog("CreateSolid3d Failed: file '" & sPathSOLID & "' not found or parameter 'SizeAlwaysOnTop' is TRUE")
End If
Return bOk
End Function
#End Region ' Compo Solid3d
'--------------------------------------------------------------------------------------------------
Friend Function CompoColor(sIniFile As String) As Color3d
Dim InsertColor As New Color3d(89, 210, 210, 25)
Dim IndexColor As Integer = GetPrivateProfileInt(S_COMPO, K_LASTCOLOR, 1, sIniFile)
@@ -18,7 +48,7 @@ Module Utility
End Function
Friend StopWatch As Stopwatch
Friend StopWatch As Stopwatch
Friend Sub TimeSpanInit()
StopWatch = New Stopwatch
@@ -26,20 +56,20 @@ Module Utility
End Sub
Friend Function TimeSpanEnd()
Dim sTime As String = ""
If Not IsNothing(StopWatch) Then
StopWatch.Stop()
Dim ts As TimeSpan = StopWatch.Elapsed
sTime = String.Format("{0:00}:{1:00}:{2:00}.{3:000}", ts.Hours, ts.Minutes, ts.Seconds, ts.Milliseconds)
End If
Return sTime
End Function
Dim sTime As String = ""
If Not IsNothing(StopWatch) Then
StopWatch.Stop()
Dim ts As TimeSpan = StopWatch.Elapsed
sTime = String.Format("{0:00}:{1:00}:{2:00}.{3:000}", ts.Hours, ts.Minutes, ts.Seconds, ts.Milliseconds)
End If
Return sTime
End Function
'--------------------------------------------------------------------------------------------------
Friend Sub UpdateUI()
'--------------------------------------------------------------------------------------------------
Friend Sub UpdateUI()
' Costringo ad aggiornare UI
Dim nDummy As Integer
Application.Current.Dispatcher.Invoke(Windows.Threading.DispatcherPriority.Background, _
Application.Current.Dispatcher.Invoke(Windows.Threading.DispatcherPriority.Background,
New Action(Function() nDummy = 0))
End Sub
@@ -366,20 +396,20 @@ Module Utility
If bOldEnMod Then EgtEnableModified()
End Sub
Friend Function SetTextColor( nGroup As Integer) As Boolean
Friend Function SetTextColor(nGroup As Integer) As Boolean
' Recupero il colore da assegnare ai testi
Dim colText As New Color3d( 0, 0, 0)
Dim colText As New Color3d(0, 0, 0)
Dim sTextColor As String = " "
Dim MainWindow As MainWindow = DirectCast(Application.Current.MainWindow, MainWindow)
If GetPrivateProfileString(S_NEST, K_TEXTCOLOR, " ", sTextColor, MainWindow.GetIniFile()) <> 0 Then
Dim sTextColorArray() As String = sTextColor.Split(",")
Dim nRed As Integer = 0 : Integer.TryParse( sTextColorArray(0), nRed)
Dim nGreen As Integer = 0 : Integer.TryParse( sTextColorArray(1), nGreen)
Dim nBlue As Integer = 0 : Integer.TryParse( sTextColorArray(2), nBlue)
colText.Setup( nRed, nGreen, nBlue)
Dim nRed As Integer = 0 : Integer.TryParse(sTextColorArray(0), nRed)
Dim nGreen As Integer = 0 : Integer.TryParse(sTextColorArray(1), nGreen)
Dim nBlue As Integer = 0 : Integer.TryParse(sTextColorArray(2), nBlue)
colText.Setup(nRed, nGreen, nBlue)
End If
' Assegno questo colore ai testi del layer indicato
Dim nId As Integer = EgtGetFirstInGroup( nGroup)
Dim nId As Integer = EgtGetFirstInGroup(nGroup)
While nId <> GDB_ID.NULL
If EgtGetType(nId) = GDB_TY.EXT_TEXT Then
EgtSetColor(nId, colText)
@@ -389,62 +419,62 @@ Module Utility
Return True
End Function
Friend Function AddTopToPartRegion( nRegId As Integer) As Boolean
Dim frReg As New Frame3d : EgtGetGroupGlobFrame( nRegId, frReg)
Dim b3Reg As New BBox3d : EgtGetBBoxGlob( nRegId, GDB_BB.STANDARD, b3Reg)
Friend Function AddTopToPartRegion(nRegId As Integer) As Boolean
Dim frReg As New Frame3d : EgtGetGroupGlobFrame(nRegId, frReg)
Dim b3Reg As New BBox3d : EgtGetBBoxGlob(nRegId, GDB_BB.STANDARD, b3Reg)
Dim dH As Double = Math.Min(0.1 * b3Reg.DimY(), 30)
Dim ptIns As New Point3d( b3Reg.Center().x, b3Reg.Max().y - dH, b3Reg.Max().z)
ptIns.ToLoc( frReg)
Dim nSfrId As Integer = EgtGetFirstInGroup( nRegId)
While nSfrId <> GDB_ID.NULL
If EgtGetType( nSfrId) = GDB_TY.SRF_FRGN Then Exit While
nSfrId = EgtGetNext( nSfrId)
Dim ptIns As New Point3d(b3Reg.Center().x, b3Reg.Max().y - dH, b3Reg.Max().z)
ptIns.ToLoc(frReg)
Dim nSfrId As Integer = EgtGetFirstInGroup(nRegId)
While nSfrId <> GDB_ID.NULL
If EgtGetType(nSfrId) = GDB_TY.SRF_FRGN Then Exit While
nSfrId = EgtGetNext(nSfrId)
End While
If nSfrId <> GDB_ID.NULL Then
Dim ptStart As New Point3d ( b3Reg.Min().x, b3Reg.Max().y - dH, b3Reg.Max().z)
ptStart.ToLoc( frReg)
Dim ptEnd As New Point3d ( b3Reg.Max().x, b3Reg.Max().y - dH, b3Reg.Max().z)
ptEnd.ToLoc( frReg)
Dim nLineId As Integer = EgtCreateLine( nRegId, ptStart, ptEnd)
Dim ptStart As New Point3d(b3Reg.Min().x, b3Reg.Max().y - dH, b3Reg.Max().z)
ptStart.ToLoc(frReg)
Dim ptEnd As New Point3d(b3Reg.Max().x, b3Reg.Max().y - dH, b3Reg.Max().z)
ptEnd.ToLoc(frReg)
Dim nLineId As Integer = EgtCreateLine(nRegId, ptStart, ptEnd)
Dim nCount As Integer = 0
Dim nNewId As Integer = EgtTrimCurveWithRegion( nLineId, nSfrId, True, False, nCount)
Dim nNewId As Integer = EgtTrimCurveWithRegion(nLineId, nSfrId, True, False, nCount)
If nNewId <> GDB_ID.NULL Then
If nCount > 0 Then EgtMidPoint( nNewId, ptIns)
If nCount > 0 Then EgtMidPoint(nNewId, ptIns)
For nTmpId As Integer = nNewId To nNewId + nCount - 1
EgtErase( nTmpId)
Next
EgtErase(nTmpId)
Next
Else
EgtErase( nLineId)
EgtErase(nLineId)
End If
End If
Dim vtDir As New Vector3d( 1, 0, 0)
vtDir.ToLoc( frReg)
Dim vtDir As New Vector3d(1, 0, 0)
vtDir.ToLoc(frReg)
Dim dLen, dAngV, dAngH As Double
vtDir.ToSpherical( dLen, dAngV, dAngH)
vtDir.ToSpherical(dLen, dAngV, dAngH)
Dim nText As Integer = EgtCreateTextAdv(nRegId, ptIns, dAngH, "*TOP*", "", 500, False, dH, 1, 0, INS_POS.MC)
Return ( nText <> GDB_ID.NULL)
Return (nText <> GDB_ID.NULL)
End Function
Friend Function SetBlockAndSlabNbr( sBlock As String, sSlabNbr As String) As Boolean
Friend Function SetBlockAndSlabNbr(sBlock As String, sSlabNbr As String) As Boolean
Dim nRawId As Integer = GetCurrentRaw()
If nRawId = GDB_ID.NULL Then Return False
If String.IsNullOrWhiteSpace(sBlock) Then sSlabNbr = ""
' Assegno info
EgtSetInfo( nRawId, INFO_RAW_BLOCK, sBlock)
EgtSetInfo( nRawId, INFO_RAW_SLABNBR, sSlabNbr)
EgtSetInfo(nRawId, INFO_RAW_BLOCK, sBlock)
EgtSetInfo(nRawId, INFO_RAW_SLABNBR, sSlabNbr)
' Cancello eventuale vecchio BarCode
EgtErase( EgtGetFirstNameInGroup( nRawId, NAME_BARCODE))
EgtErase(EgtGetFirstNameInGroup(nRawId, NAME_BARCODE))
' Se definito, inserisco nuovo BarCode
Dim sBarCode As String = sBlock & " - " & sSlabNbr
If sBarCode <> " - " Then
Dim ptRawCen As Point3d
GetRawCenter( ptRawCen)
GetRawCenter(ptRawCen)
Dim ptRawMin, ptRawMax As Point3d
GetRawBox( ptRawMin, ptRawMax)
Dim ptText As New Point3d( ptRawCen.x, ptRawCen.y, ptRawMax.z)
Dim nText As Integer = EgtCreateTextAdv( nRawId, ptText, 0, sBarCode, "", 500, False, 50.0, 1, 0, INS_POS.MC, GDB_RT.GLOB)
EgtSetName( nText, NAME_BARCODE)
EgtSetColor( nText, New Color3d(255, 0, 0))
GetRawBox(ptRawMin, ptRawMax)
Dim ptText As New Point3d(ptRawCen.x, ptRawCen.y, ptRawMax.z)
Dim nText As Integer = EgtCreateTextAdv(nRawId, ptText, 0, sBarCode, "", 500, False, 50.0, 1, 0, INS_POS.MC, GDB_RT.GLOB)
EgtSetName(nText, NAME_BARCODE)
EgtSetColor(nText, New Color3d(255, 0, 0))
End If
Return True
End Function
@@ -480,7 +510,7 @@ Module Utility
End Class
Public Function GetPrivateProfileLanguage( lpAppName As String, lpKeyName As String, lpFileName As String) As Language
Public Function GetPrivateProfileLanguage(lpAppName As String, lpKeyName As String, lpFileName As String) As Language
Dim sVal As String = String.Empty
GetPrivateProfileString(lpAppName, lpKeyName, "", sVal, lpFileName)
Dim sItems() As String = sVal.Split(",".ToCharArray)
+51 -26
View File
@@ -4,6 +4,7 @@ Imports System.Collections.ObjectModel
Imports System.Runtime.InteropServices
Imports EgtUILib
Imports EgtWPFLib
Imports OmagCUT.VeinMatchingWindow
Public Class VeinMatchingWindow
@@ -19,6 +20,11 @@ Public Class VeinMatchingWindow
Private m_nIdToSel 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)
' Assegnazione scena all'host e posizionamento nella PlacePageGrid
VeinMatchingSceneHost.Child = VeinMatchingScene
@@ -267,7 +273,7 @@ Friend Module VeinMatching
Dim nRegId As Integer = EgtGetFirstInGroup(nRegLayId)
While nRegId <> GDB_ID.NULL
If EgtGetType(nRegId) = GDB_TY.SRF_FRGN Then
Exit While
Exit While
End If
nRegId = EgtGetNext(nRegId)
End While
@@ -364,19 +370,21 @@ Friend Module VeinMatching
' Imposto il contesto del progetto
EgtSetCurrentContext(m_MainWindow.m_CurrentProjectPageUC.CurrentProjectScene.GetCtx())
' Riattivo il gruppo di lavoro
EgtSetCurrMachGroup( EgtGetFirstMachGroup())
EgtSetCurrMachGroup(EgtGetFirstMachGroup())
' Verifico quali pezzi sono nel grezzo, per dichiararlo al VM
nId = EgtGetFirstPartInRawPart( CamAuto.GetCurrentRaw())
nId = EgtGetFirstPartInRawPart(CamAuto.GetCurrentRaw())
While nId <> GDB_ID.NULL
' Dichiaro pezzo nel grezzo per VM
VeinMatching.OnInsertPartInRaw( nId)
VeinMatching.OnInsertPartInRaw(nId)
' Passo al pezzo successivo
nId = EgtGetNextPartInRawPart(nId)
End While
' Ripristino visualizzazione di eventuali pezzi in parcheggio
ShowParkedParts()
' Ripristino il contesto corrente
EgtSetCurrentContext( nCurrCtx)
EgtSetCurrentContext(nCurrCtx)
' EgtSaveFile("C:\EgtData\OmagCUT\Temp\MyVeinMatch.nge", NGE.TEXT)
Return True
End Function
@@ -422,11 +430,11 @@ Friend Module VeinMatching
nCurrId = EgtGetFirstNameInGroup(nVeinId2, NAME_PREVIEW)
EgtSetStatus(nCurrId, GDB_ST.OFF)
' 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
Dim nOutLoop As Integer = EgtGetFirstNameInGroup( nVeinId2, NAME_OUTLOOP)
EgtSetName( nOutLoop, NAME_OUTLOOP & ".mach")
EgtSetName( nOutLoopOrig, NAME_OUTLOOP)
Dim nOutLoop As Integer = EgtGetFirstNameInGroup(nVeinId2, NAME_OUTLOOP)
EgtSetName(nOutLoop, NAME_OUTLOOP & ".mach")
EgtSetName(nOutLoopOrig, NAME_OUTLOOP)
End If
' Se necessario, ripristino il contesto originale
If nCurrCtx > 0 Then EgtSetCurrentContext(nCurrCtx)
@@ -555,8 +563,8 @@ Friend Module VeinMatching
' Se richiesto, eseguo deselezione
If bDeselect Then EgtDeselectObj(nId)
End If
EgtDraw()
End If
EgtDraw()
EgtSetCurrentContext(nMainCtx)
Return True
End Function
@@ -1039,37 +1047,44 @@ Friend Module VeinMatching
End Function
Friend Function MoveAlettaSolid(ByRef Item As Aletta, ByRef ThicknessRaw As Double) As Boolean
' A: alzatina, F: frontalino
Dim nType As Integer
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 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
' 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
Dim vtRot As Vector3d = ptERef - ptSRef
If nType = 1 Then
EgtRotate(Item.PartId, ptE, vtRot, -90, GDB_RT.GLOB)
ElseIf nType = 2 Then
If nType = ALETTE.A Then
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
' punto di riferimento per la traslazione sul solido
Dim ptSolid As Point3d
If nType = 1 Then
If nType = ALETTE.A Then
' cerco id della curva che definisce la front face
Dim nSolidGrp As Integer = EgtGetFirstNameInGroup(Item.PartId, NAME_VM_SOLID)
Dim nFrontCrvId As Integer = EgtGetFirstInGroup(nSolidGrp)
EgtStartPoint(nFrontCrvId, ptSolid)
ElseIf nType = 2 Then
EgtStartPoint(Item.SideId, ptSolid)
EgtStartPoint(nFrontCrvId, GDB_ID.ROOT, ptSolid)
ElseIf nType = ALETTE.F Then
EgtStartPoint(Item.SideId, GDB_ID.ROOT, ptSolid)
End If
Dim ItemFrame As New Frame3d
If Not EgtGetGroupGlobFrame(Item.PartId, ItemFrame) Then Return False
ptSolid.ToGlob(ItemFrame)
' Dim ItemFrame As New Frame3d
' If Not EgtGetGroupGlobFrame(Item.PartId, ItemFrame) Then Return False
' ptSolid.ToGlob(ItemFrame)
'punto di riferimento per la traslazione sul piano cucina
Dim ptKitchen As Point3d = ptERef
@@ -1077,6 +1092,16 @@ Friend Module VeinMatching
Dim vtMove As Vector3d = ptKitchen - ptSolid
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
End Function
@@ -1206,7 +1231,7 @@ Friend Module VeinMatching
' Se necessario, cambio contesto
If m_nVeinCtx <> nCurrCtx Then
If EgtSetCurrentContext(m_nVeinCtx) Then
Return If( nCurrCtx > 0, nCurrCtx, -2)
Return If(nCurrCtx > 0, nCurrCtx, -2)
Else
Return 0
End If
@@ -1268,7 +1293,7 @@ Friend Module VeinMatching
While nId <> GDB_ID.NULL
Dim nOriId As Integer
If EgtGetInfo(nId, KEY_ORI_ID, nOriId) AndAlso nOriId = nPartId Then
Exit While
Exit While
End If
nId = EgtGetNextPart(nId)
End While