Compare commits
27 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| f3f9db7bb7 | |||
| 2900aa98f8 | |||
| 153374cd5d | |||
| 1076abd8de | |||
| 0e260a570e | |||
| 59176a1269 | |||
| 2e2de2ade4 | |||
| b6f19b04cb | |||
| 7289e84d7b | |||
| c5757cb3c7 | |||
| 311f6fca99 | |||
| 0efe5b51e4 | |||
| 38bf52893b | |||
| d4b49699c8 | |||
| 09e8c0f6b4 | |||
| 03fdc33be0 | |||
| 50c3eac8fe | |||
| 004258a469 | |||
| ce83d8ee49 | |||
| 9db1f5085c | |||
| 49435ba828 | |||
| 6e963ad6a2 | |||
| 4d12d4a129 | |||
| c46b7d1aa0 | |||
| 08d71ecec2 | |||
| 9f4448220e | |||
| 6117963ac1 |
@@ -94,7 +94,9 @@ Public Class MoveRawPartPage
|
||||
End If
|
||||
' Carico i parametri di movimento
|
||||
m_dStep = GetPrivateProfileDouble(S_RAWMOVE, K_RAWSTEP, 50, m_MainWindow.GetIniFile())
|
||||
StepMoveTxBx.Text = LenToString(m_dStep, 3)
|
||||
' Ricavo la lunghezza del baffo di taglio
|
||||
m_dStep = SplitAuto.MaxCuttingMustache(m_dStep)
|
||||
StepMoveTxBx.Text = LenToString(m_dStep, 1) & "+1"
|
||||
m_dRotation = GetPrivateProfileDouble(S_RAWMOVE, K_RAWROTATION, 30, m_MainWindow.GetIniFile())
|
||||
RotationAngleTxBx.Text = DoubleToString(m_dRotation, 3)
|
||||
' Se movimento manuale perpendicolare
|
||||
|
||||
@@ -214,9 +214,9 @@ Public Class NestPageUC
|
||||
Else
|
||||
' verifico se l'elemento selezionato è il nome della tavola
|
||||
If EgtGetType(nId) = GDB_TY.EXT_TEXT AndAlso (sNamePartId = MAIN_TAB Or sNamePartId = SECOND_TAB) Then
|
||||
Dim nTab As Integer = m_MainWindow.m_CadCutPageUC.m_ProjectMgr.ChangeTable()
|
||||
Dim nRes As Integer = m_MainWindow.m_CadCutPageUC.m_ProjectMgr.ChangeTable()
|
||||
' se non è stata eseguita nessuna scelta esco dal ciclo
|
||||
If nTab = 0 Then Exit While
|
||||
If nRes = 0 Then Exit While
|
||||
' imposto l'altra tavola
|
||||
Dim sOtherTab = If( sNamePartId = MAIN_TAB, SECOND_TAB, MAIN_TAB)
|
||||
EgtChangeTable( sOtherTab, True)
|
||||
@@ -241,6 +241,49 @@ Public Class NestPageUC
|
||||
PackPartInStore(nPPId)
|
||||
nPPId = EgtGetNextPart( nPPId)
|
||||
End While
|
||||
' se prevista rotazione
|
||||
If GetPrivateProfileInt(S_TABLE, K_CHANGETABWD, 0, m_MainWindow.GetMachIniFile()) = 2 Then
|
||||
' Dati tavola
|
||||
Dim b3Tab As New BBox3d
|
||||
EgtGetTableArea( 1, b3Tab)
|
||||
' Box lastra
|
||||
Dim b3OrigRaw As New BBox3d
|
||||
GetRawBox( b3OrigRaw)
|
||||
' Allargo i limiti della tavola in tutte le fasi
|
||||
Const TAB_OFFS As Double = 3000
|
||||
For nI As Integer = 1 To EgtGetPhaseCount()
|
||||
EgtSetCurrPhase(nI)
|
||||
EgtSetTableAreaOffset( TAB_OFFS, TAB_OFFS, TAB_OFFS, TAB_OFFS)
|
||||
Next
|
||||
EgtSetCurrPhase(1)
|
||||
' Rotazione
|
||||
Dim dAngRot As Double = If(sOtherTab = SECOND_TAB, 180, -180)
|
||||
if Not RotateAllRawParts(dAngRot, False) Then
|
||||
m_CurrProjPage.SetWarningMessage(EgtMsg(90339)) 'Rotazione impossibile
|
||||
End If
|
||||
' Traslazione per riportare la lastra nella stessa posizione rispetto all'angolo BL che diveta TR e viceversa
|
||||
Dim b3Raw As New BBox3d
|
||||
GetRawBox( b3Raw)
|
||||
Dim vtMove As Vector3d
|
||||
If sOtherTab = SECOND_TAB Then
|
||||
Dim vtDiffIni As Vector3d = b3OrigRaw.Min() - b3Tab.Min()
|
||||
Dim vtDiffFin As Vector3d = b3Tab.Max() - b3Raw.Max()
|
||||
vtMove = vtDiffFin - vtDiffIni
|
||||
Else
|
||||
Dim vtDiffIni As Vector3d = b3Tab.Max() - b3OrigRaw.Max()
|
||||
Dim vtDiffFin As Vector3d = b3Raw.Min() - b3Tab.Min()
|
||||
vtMove = -( vtDiffFin - vtDiffIni)
|
||||
End If
|
||||
vtMove.z = 0
|
||||
MoveAllRawParts(vtMove)
|
||||
' Ripristino i limiti della tavola in tutte le fasi
|
||||
For nI As Integer = 1 To EgtGetPhaseCount()
|
||||
EgtSetCurrPhase(nI)
|
||||
EgtSetTableAreaOffset( 0, 0, 0, 0)
|
||||
Next
|
||||
EgtSetCurrPhase(1)
|
||||
HideAllMachinings()
|
||||
End If
|
||||
' visualizzazione
|
||||
EgtZoom(ZM.ALL)
|
||||
Exit While
|
||||
@@ -669,7 +712,7 @@ Public Class NestPageUC
|
||||
nId = EgtGetNextSelectedObj()
|
||||
End While
|
||||
Else
|
||||
RotateAllRawParts(m_dRegAngStep)
|
||||
UserRotateAllRawParts(m_dRegAngStep)
|
||||
EgtDraw()
|
||||
End If
|
||||
End Sub
|
||||
@@ -687,7 +730,7 @@ Public Class NestPageUC
|
||||
nId = EgtGetNextSelectedObj()
|
||||
End While
|
||||
Else
|
||||
RotateAllRawParts(-m_dRegAngStep)
|
||||
UserRotateAllRawParts(-m_dRegAngStep)
|
||||
EgtDraw()
|
||||
End If
|
||||
End Sub
|
||||
@@ -739,7 +782,7 @@ Public Class NestPageUC
|
||||
End If
|
||||
End Function
|
||||
|
||||
Private Sub RotateAllRawParts(dAngDeg As Double)
|
||||
Private Sub UserRotateAllRawParts(dAngDeg As Double)
|
||||
' Recupero rotazione totale
|
||||
Dim dRegRot As Double = GetRegistrationRotation()
|
||||
' Verifico se nuova rotazione totale ammissibile
|
||||
@@ -748,6 +791,13 @@ Public Class NestPageUC
|
||||
m_CurrProjPage.SetWarningMessage(EgtMsg(90338)) 'Angolo di registrazione oltre i limiti
|
||||
Return
|
||||
End If
|
||||
Dim bMoveOk As Boolean = RotateAllRawParts( dAngDeg)
|
||||
If Not bMoveOk Then m_CurrProjPage.SetWarningMessage(EgtMsg(90339)) 'Rotazione impossibile
|
||||
End Sub
|
||||
|
||||
Friend Function RotateAllRawParts(dAngDeg As Double, Optional bIsReg As Boolean = True) As Boolean
|
||||
' Recupero rotazione totale
|
||||
Dim dRegRot As Double = GetRegistrationRotation()
|
||||
' Recupero il centro del grezzo iniziale per usarlo come centro della rotazione
|
||||
Dim ptCen As New Point3d
|
||||
GetRawCenter(ptCen)
|
||||
@@ -782,7 +832,6 @@ Public Class NestPageUC
|
||||
End While
|
||||
' Se rotazione impossibile, ripristino posizione dei grezzi già spostati
|
||||
If Not bMoveOk Then
|
||||
m_CurrProjPage.SetWarningMessage(EgtMsg(90339)) 'Rotazione impossibile
|
||||
Dim nRevPhase As Integer = 1
|
||||
Dim nRevRawId As Integer = GDB_ID.NULL
|
||||
While nRevPhase <= nPhase
|
||||
@@ -865,15 +914,25 @@ Public Class NestPageUC
|
||||
End If
|
||||
nOpeId = EgtGetNextActiveOperation(nOpeId)
|
||||
End While
|
||||
' Se non è registrazione, ruoto anche l'eventuale foto della lastra
|
||||
'If Not bIsReg Then
|
||||
' Dim nPhotoId = m_CurrProjPage.GetPhoto()
|
||||
' If nPhotoId <> GDB_ID.NULL then EgtRotatePhoto(nPhotoId, ptCen, Vector3d.Z_AX(), dAngDeg)
|
||||
'End If
|
||||
' Aggiorno rotazione totale
|
||||
SetRegistrationRotation(dRegRot + dAngDeg)
|
||||
If bIsReg Then
|
||||
SetRegistrationRotation(dRegRot + dAngDeg)
|
||||
Else
|
||||
SetRegistrationRotation(0)
|
||||
End If
|
||||
' Dichiaro grezzo per punti
|
||||
EgtSetInfo(GetCurrentRaw(), KEY_RAWBYPOINTS, 1)
|
||||
End If
|
||||
' Ripristino lo stato iniziale
|
||||
EgtSetCurrPhase(1)
|
||||
HideAllMachinings()
|
||||
End Sub
|
||||
Return bMoveOk
|
||||
End Function
|
||||
|
||||
Private Sub InsertPartBtn_Click(sender As Object, e As RoutedEventArgs) Handles InsertPartBtn.Click
|
||||
' Se inserimento automatico
|
||||
|
||||
+63
-12
@@ -5,6 +5,11 @@ Public Module SplitAuto
|
||||
Private m_MainWindow As MainWindow = DirectCast(Application.Current.MainWindow, MainWindow)
|
||||
|
||||
Private m_dLastDT As Double = 0
|
||||
Public ReadOnly Property dLastDT As Double
|
||||
Get
|
||||
Return m_dLastDT
|
||||
End Get
|
||||
End Property
|
||||
|
||||
'-----------------------------------------------------------------------------------------------
|
||||
Friend Class SplitMach
|
||||
@@ -737,35 +742,55 @@ Public Module SplitAuto
|
||||
End Function
|
||||
|
||||
Private Function SafeMoveRawPart(nRawId As Integer, ByRef vtMove As Vector3d, dMindist As Double) As Boolean
|
||||
' Spostamento originale
|
||||
Dim vtOriMove As New Vector3d( vtMove)
|
||||
' Livello di movimento
|
||||
Dim nMoveLevel As Integer = GetPrivateProfileInt( S_SPLIT, K_MOVE_LEV, 5, m_MainWindow.GetIniFile())
|
||||
Dim nMove As Integer = 1
|
||||
' Se esce dalla tavola, movimento già annullato ed esco con errore
|
||||
If Not EgtMoveRawPart(nRawId, vtMove) Then Return False
|
||||
If Not EgtMoveRawPart(nRawId, vtOriMove) Then Return False
|
||||
' Se interferisce con altri grezzi, annullo movimento ed esco con errore
|
||||
If Not VerifyRawWithOtherRaws(nRawId, dMindist) Then
|
||||
EgtMoveRawPart(nRawId, -vtMove)
|
||||
EgtMoveRawPart(nRawId, -vtOriMove)
|
||||
Return False
|
||||
End If
|
||||
If nMoveLevel < 2 Then Return True
|
||||
' Provo ad aggiungere un altro movimento
|
||||
If EgtMoveRawPart(nRawId, vtMove) Then
|
||||
If EgtMoveRawPart(nRawId, vtOriMove) Then
|
||||
If VerifyRawWithOtherRaws(nRawId, dMindist) Then
|
||||
vtMove += vtMove
|
||||
vtMove += vtOriMove
|
||||
nMove += 1
|
||||
If nMoveLevel = nMove Then Return True
|
||||
Else
|
||||
EgtMoveRawPart(nRawId, -vtMove)
|
||||
EgtMoveRawPart(nRawId, -vtOriMove)
|
||||
End If
|
||||
End If
|
||||
' Provo ad aggiungere un altro movimento
|
||||
If EgtMoveRawPart(nRawId, vtOriMove) Then
|
||||
If VerifyRawWithOtherRaws(nRawId, dMindist) Then
|
||||
vtMove += vtOriMove
|
||||
nMove += 1
|
||||
If nMoveLevel = nMove Then Return True
|
||||
Else
|
||||
EgtMoveRawPart(nRawId, -vtOriMove)
|
||||
End If
|
||||
End If
|
||||
' Provo ad aggiungere un movimento dimezzato
|
||||
If EgtMoveRawPart(nRawId, 0.5 * vtMove) Then
|
||||
If EgtMoveRawPart(nRawId, 0.5 * vtOriMove) Then
|
||||
If VerifyRawWithOtherRaws(nRawId, dMindist) Then
|
||||
vtMove += 0.5 * vtMove
|
||||
vtMove += 0.5 * vtOriMove
|
||||
nMove += 1
|
||||
If nMoveLevel = nMove Then return True
|
||||
Else
|
||||
EgtMoveRawPart(nRawId, -0.5 * vtMove)
|
||||
EgtMoveRawPart(nRawId, -0.5 * vtOriMove)
|
||||
End If
|
||||
End If
|
||||
' Provo ad aggiunger un movimento 1/4
|
||||
If EgtMoveRawPart(nRawId, 0.25 * vtMove) Then
|
||||
' Provo ad aggiungere un movimento 1/4
|
||||
If EgtMoveRawPart(nRawId, 0.25 * vtOriMove) Then
|
||||
If VerifyRawWithOtherRaws(nRawId, dMindist) Then
|
||||
vtMove += 0.25 * vtMove
|
||||
vtMove += 0.25 * vtOriMove
|
||||
Else
|
||||
EgtMoveRawPart(nRawId, -0.25 * vtMove)
|
||||
EgtMoveRawPart(nRawId, -0.25 * vtOriMove)
|
||||
End If
|
||||
End If
|
||||
Return True
|
||||
@@ -817,4 +842,30 @@ Public Module SplitAuto
|
||||
Return (Not bInterf)
|
||||
End Function
|
||||
|
||||
Public Function MaxCuttingMustache(dMustache As Double) As Double
|
||||
Dim MachSplitList As New List(Of SplitMach)
|
||||
' Recupero l'indice della fase corrente
|
||||
Dim nCurrPhase As Integer = EgtGetCurrPhase()
|
||||
' se non è stata creata nessuna lista allora restituisco il valore di Default
|
||||
If Not CalculateSplitMachList(nCurrPhase, MachSplitList) Then Return dMustache
|
||||
Dim NewMustache As Double = 0
|
||||
Dim ItemMachSplit As SplitMach
|
||||
For Each ItemMachSplit In MachSplitList
|
||||
' Recupero lunghezza baffo secondo taglio
|
||||
Dim nPvId As Integer = GDB_ID.NULL
|
||||
EgtGetInfo(EgtGetFirstNameInGroup(ItemMachSplit.m_nId, NAME_PREVIEW), INFO_PV_ONPART_ID, nPvId)
|
||||
Dim dDT As Double
|
||||
If EgtGetInfo(EgtGetFirstGroupInGroup(nPvId), "DT", dDT) Then
|
||||
If NewMustache < dDT Then NewMustache = dDT
|
||||
End If
|
||||
Next
|
||||
Dim dExtraL As Double = 0
|
||||
EgtMdbGetGeneralParam(MCH_GP.EXTRALONCUTREG, dExtraL)
|
||||
' se esiste il valore di un baffo allora sovrascrivo il valore di default
|
||||
If NewMustache > 0 Then
|
||||
dMustache = Math.Ceiling(NewMustache)
|
||||
End If
|
||||
Return dMustache + dExtraL
|
||||
End Function
|
||||
|
||||
End Module
|
||||
@@ -105,6 +105,15 @@ Module ConstIni
|
||||
Public Const K_TRFDATA As String = "TrfData"
|
||||
Public Const K_CSVDATA As String = "CsvData"
|
||||
Public Const K_COMPODIR As String = "CompoDir"
|
||||
Public Const K_CMP_COUNT As String = "Count"
|
||||
Public Const K_LASTCOLOR As String = "LastColor"
|
||||
Public Const K_COLOR As String = "Color"
|
||||
|
||||
Public Const S_EXTCOMPO As String = "Compo"
|
||||
|
||||
Public Const S_INTCOMPO As String = "InternalCompo"
|
||||
Public Const K_INT_COMPODIR As String = "CompoDir"
|
||||
Public Const K_INT_COUNT As String = "Count"
|
||||
|
||||
Public Const S_FLATPARTS As String = "FlatParts"
|
||||
Public Const K_FLPCURRDIR As String = "CurrDir"
|
||||
@@ -140,6 +149,9 @@ Module ConstIni
|
||||
Public Const K_AUTOMATICOPTIMIZE As String = "AutomaticOptimize"
|
||||
Public Const K_AUTOMATICMAXTIME As String = "AutomaticMaxTime"
|
||||
|
||||
Public Const S_SPLIT As String = "Split"
|
||||
Public Const K_MOVE_LEV As String = "MoveLevel"
|
||||
|
||||
Public Const S_CSV As String = "Csv"
|
||||
Public Const K_FULL As String = "Full"
|
||||
Public Const K_MAXDIMONX As String = "MaxDimOnX"
|
||||
|
||||
@@ -38,6 +38,7 @@
|
||||
Public Const K_USENEWMDI As String = "UseNewMDI"
|
||||
Public Const K_ISSIEMENSONE As String = "IsSiemensOne"
|
||||
Public Const K_DBVARPATH As String = "DBVarPath"
|
||||
Public Const K_NEWWRITECNCMODE As String = "NewWriteCNCMode"
|
||||
|
||||
Public Const S_NCNUM As String = "NcNUM"
|
||||
Public Const K_RESETSENDDELAY As String = "ResetSendDelay"
|
||||
@@ -46,6 +47,7 @@
|
||||
Public Const S_NCDATA As String = "NcData"
|
||||
Public Const K_NEWVARIABLE As String = "NewVariable"
|
||||
Public Const K_NEWCONSOLE As String = "NewConsole"
|
||||
Public Const K_WRITECNCMODEVAR As String = "WriteCNCModeVar"
|
||||
Public Const K_COMM As String = "Comm"
|
||||
Public Const K_REFRESH As String = "Refresh"
|
||||
Public Const K_MODE As String = "Mode"
|
||||
|
||||
@@ -475,7 +475,7 @@ Public MustInherit Class MachineButton
|
||||
If m_CN.m_NewVariable And m_MainWindow.m_CNCommunication.m_nNCType = 2 Then
|
||||
' solo per Flexium
|
||||
m_CN.DPlcVariables_WriteVariables(ENumber, EValue)
|
||||
If Not IsNothing(ENumber2) And Not IsNothing(EValue2) Then
|
||||
If Not String.IsNullOrEmpty(ENumber2) And Not String.IsNullOrEmpty(EValue2) Then
|
||||
m_CN.DPlcVariables_WriteVariables(ENumber2, EValue2)
|
||||
End If
|
||||
' altrimenti scrittura delle variabili E
|
||||
|
||||
@@ -567,124 +567,4 @@ Public Class DirectCutPageUC
|
||||
|
||||
End Sub
|
||||
|
||||
'' ------------------------ GESTIONE SECONDA PAGINA ------------------------
|
||||
'Private Sub ClearButton(nCount As Integer)
|
||||
' Dim nEndIndex As Integer
|
||||
' If m_bIsFirstPage Then
|
||||
' nEndIndex = If(nCount < 8, nCount, 8)
|
||||
' Else
|
||||
' nEndIndex = If(nCount < 16, nCount - 8, 8)
|
||||
' End If
|
||||
' For index As Integer = 1 To nEndIndex
|
||||
' GetLabel(index).Text = String.Empty
|
||||
' GetImage(index).Source = Nothing
|
||||
' GetButton(index).Visibility = Windows.Visibility.Visible
|
||||
' Next
|
||||
' For index As Integer = nEndIndex + 1 To 8
|
||||
' GetLabel(index).Text = String.Empty
|
||||
' GetImage(index).Source = Nothing
|
||||
' GetButton(index).Visibility = Windows.Visibility.Hidden
|
||||
' Next
|
||||
'End Sub
|
||||
|
||||
'Private Sub LoadPage()
|
||||
' Dim nDeltaSecondPage As Integer = 8
|
||||
' ' Leggo numero di componenti presenti
|
||||
' Dim nCompoNumber As Integer = GetPrivateProfileInt("Compo", "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("Compo" & index + nDeltaSecondPage, "Name", 0, m_MainWindow.GetIniFile())
|
||||
' Dim sCompoImage As String = ""
|
||||
' Dim sCompoImageSource As ImageSource
|
||||
|
||||
' 'verifico presenza immagine e la aggiungo
|
||||
' If GetPrivateProfileString("Compo" & 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
|
||||
' LabelCompo9.Visibility = Windows.Visibility.Visible
|
||||
' Else
|
||||
' m_bIsFirstPage = True
|
||||
' LoadPage()
|
||||
' Compo9.SetValue(Grid.ColumnProperty, 0)
|
||||
' Compo9.SetValue(Grid.ColumnSpanProperty, 2)
|
||||
' ImageCompo9.Visibility = Windows.Visibility.Hidden
|
||||
' LabelCompo9.Visibility = Windows.Visibility.Visible
|
||||
' End If
|
||||
'End Sub
|
||||
|
||||
|
||||
End Class
|
||||
|
||||
@@ -550,7 +550,11 @@ Public Class MachineButtonsUC
|
||||
End Sub
|
||||
|
||||
Friend Sub DoorStateChanged(DoorState As Integer)
|
||||
' recupero le asscociazioni con i bottoni
|
||||
If IsNothing(DoorState) Then
|
||||
EgtOutLog("Error: door state null!")
|
||||
Return
|
||||
End If
|
||||
' recupero le associazioni con i bottoni
|
||||
Dim nIndex As Integer = Array.IndexOf(StateFlagArray, BTN_STATE_DOOR_OPENED)
|
||||
If nIndex = -1 Then Return
|
||||
' bottone di apertura porte
|
||||
@@ -560,7 +564,7 @@ Public Class MachineButtonsUC
|
||||
' bottone di chiusura porte
|
||||
Dim DoorClosedButton As Primitives.ToggleButton = GetToggleButton(nIndex + 1)
|
||||
' modifico il colore dei bottoni
|
||||
If Not IsNothing(DoorState) Then
|
||||
If Not IsNothing(DoorState) AndAlso Not IsNothing(DoorClosedButton) Then
|
||||
Select Case DoorState
|
||||
Case 0
|
||||
DoorClosedButton.Background = Application.Current.FindResource("OmagCut_Red")
|
||||
@@ -568,7 +572,7 @@ Public Class MachineButtonsUC
|
||||
DoorClosedButton.Background = Application.Current.FindResource("OmagCut_LightGray")
|
||||
End Select
|
||||
End If
|
||||
If Not IsNothing(DoorState) Then
|
||||
If Not IsNothing(DoorState) AndAlso Not IsNothing(DoorOpenedButton) Then
|
||||
Select Case DoorState
|
||||
Case 0
|
||||
DoorOpenedButton.Background = Application.Current.FindResource("OmagCut_LightGray")
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
Imports EgtUILib
|
||||
Imports System.Collections.ObjectModel
|
||||
Public Class SingleDrillUC
|
||||
' Riferimenti a pagine
|
||||
Private m_MainWindow As MainWindow = DirectCast(Application.Current.MainWindow, MainWindow)
|
||||
@@ -37,6 +38,8 @@ Public Class SingleDrillUC
|
||||
|
||||
Private m_dDiameter As Double = 0
|
||||
|
||||
Private m_sCurrDrill As String = String.Empty
|
||||
|
||||
' Costanti
|
||||
Private Const MAX_TAB_DEPTH As Double = 10.0
|
||||
Private Const MIN_CUT_LEN As Double = 10.0
|
||||
@@ -67,8 +70,11 @@ Public Class SingleDrillUC
|
||||
End Sub
|
||||
|
||||
Private Sub SingleDrill_Loaded(sender As Object, e As RoutedEventArgs) Handles Me.Loaded
|
||||
m_sCurrDrill = m_CurrentMachine.sCurrDrill
|
||||
GetDrillFromDrilling(m_sCurrDrill)
|
||||
|
||||
' recupero informazioni del foretto usato
|
||||
EgtTdbSetCurrTool(m_CurrentMachine.sCurrDrill)
|
||||
EgtTdbSetCurrTool(m_sCurrDrill)
|
||||
EgtTdbGetCurrToolParam(MCH_TP.DIAM, m_dDiameter)
|
||||
|
||||
' Attivo la pagina
|
||||
@@ -215,7 +221,7 @@ Public Class SingleDrillUC
|
||||
If Not m_MainWindow.m_CNCommunication.GetAxesPositions(dL1, dL2, dL3, dR1, dR2) Then Return
|
||||
|
||||
' Ricavo dati Foretto corrente
|
||||
Dim sDrill As String = m_MainWindow.m_CurrentMachine.sCurrDrill
|
||||
Dim sDrill As String = m_sCurrDrill
|
||||
' Se punto da laser
|
||||
If PointModeCmBx.SelectedIndex = PT_MODE.LASER Then
|
||||
' Imposto come testa corrente il laser (senza utensile ovviamente)
|
||||
@@ -245,9 +251,9 @@ Public Class SingleDrillUC
|
||||
m_ptTipP1.ToLoc(New Frame3d(m_ptTabOri))
|
||||
m_bPointP1Ok = True
|
||||
' Ricavo dati lama corrente
|
||||
Dim sSaw As String = m_MainWindow.m_CurrentMachine.sCurrDrill
|
||||
Dim sDrill As String = m_sCurrDrill
|
||||
' Imposto la lama corrente
|
||||
If Not EgtSetCalcTool(sSaw, "H1", 1) Then Return
|
||||
If Not EgtSetCalcTool(sDrill, "H1", 1) Then Return
|
||||
End If
|
||||
|
||||
' Disegno il taglio
|
||||
@@ -261,6 +267,42 @@ Public Class SingleDrillUC
|
||||
Point1Btn.IsChecked = True
|
||||
End Sub
|
||||
|
||||
Private Function GetDrillFromDrilling(ByRef sCurrDrill As String)
|
||||
If String.IsNullOrEmpty(sCurrDrill) Or String.IsNullOrWhiteSpace(sCurrDrill) Then
|
||||
' creo l'elenco degli utensili di foratura
|
||||
Dim sToolName As String = String.Empty
|
||||
Dim nType As Integer = MCH_TY.NONE
|
||||
Dim DrillToolList As New ObservableCollection(Of String)
|
||||
DrillToolList.Clear()
|
||||
If EgtTdbGetFirstTool(MCH_TF.DRILLBIT, sToolName, nType) Then
|
||||
DrillToolList.Add(sToolName)
|
||||
While EgtTdbGetNextTool(MCH_TF.DRILLBIT, sToolName, nType)
|
||||
DrillToolList.Add(sToolName)
|
||||
End While
|
||||
End If
|
||||
' recupero l'utensile associato alla lavorazione
|
||||
Dim sCurrDrilling As String = m_MainWindow.m_CurrentMachine.sCurrDrilling
|
||||
Dim ToolString As String = String.Empty
|
||||
EgtMdbSetCurrMachining(sCurrDrilling)
|
||||
' Recupero nome utensile tramite TUUID
|
||||
Dim sTuuid As String = String.Empty
|
||||
EgtMdbGetCurrMachiningParam(MCH_MP.TUUID, sTuuid)
|
||||
EgtTdbGetToolFromUUID(sTuuid, ToolString)
|
||||
Dim bToolExist As Boolean = False
|
||||
For Each CurrTool As IEnumerable In DrillToolList
|
||||
If CurrTool.ToString() = ToolString Then
|
||||
bToolExist = True
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
If bToolExist Then
|
||||
sCurrDrill = ToolString
|
||||
Else
|
||||
sCurrDrill = String.Empty
|
||||
End If
|
||||
End If
|
||||
End Function
|
||||
|
||||
Private Sub XcoordTxBx_EgtClosed(sender As Object, e As EventArgs) Handles XcoordTxBx.EgtClosed
|
||||
' Recupero il valore della coordinata (in 0 Tab)
|
||||
Dim dXcoord As Double = 0
|
||||
@@ -354,10 +396,11 @@ Public Class SingleDrillUC
|
||||
' Spessore grezzo
|
||||
Dim dRawHeight As Double = m_ptRawMax.z - m_ptRawMin.z
|
||||
' Recupero spessore lama corrente
|
||||
Dim sDrill As String = m_MainWindow.m_CurrentMachine.sCurrDrill
|
||||
Dim sDrill As String = m_sCurrDrill
|
||||
GetDrillFromDrilling(sDrill)
|
||||
EgtTdbSetCurrTool(sDrill)
|
||||
Dim dThick As Double = 0
|
||||
EgtTdbGetCurrToolParam(MCH_TP.THICK, dThick)
|
||||
Dim dDiam As Double = 0
|
||||
EgtTdbGetCurrToolParam(MCH_TP.DIAM, dDiam)
|
||||
' Rimuovo eventuale vecchio pezzo per taglio diretto
|
||||
EraseDirectCutPart()
|
||||
' Disattivo eventuali lavorazioni presenti
|
||||
|
||||
@@ -20,6 +20,7 @@ Public Class AlzFrontUC
|
||||
|
||||
' nome della info riferita alle alzatine e ai frontalini (1=Alz, 2=Front, 0=niente)
|
||||
Private Const INFO_ALZFRONT As String = "AF"
|
||||
Private Const INFO_ENABLE As String = "EnableAF"
|
||||
|
||||
' Properties
|
||||
Private m_sCompoDir As String = String.Empty
|
||||
@@ -140,38 +141,41 @@ Public Class AlzFrontUC
|
||||
|
||||
' inserisco il lato nella lista
|
||||
While CurrLine <> GDB_ID.NULL
|
||||
' escludo tutte le forme che non sono delle linee
|
||||
If EgtGetType(CurrLine) = GDB_TY.CRV_LINE Then
|
||||
' Aggiungo il lato alla lista di quelli su cui è possibile mettere una alzatina o un frontalino
|
||||
Dim sNameCurrLine As String = String.Empty
|
||||
Dim nInfo As Integer = 0
|
||||
Dim dSideAng As Integer = 0
|
||||
EgtSetName(CurrLine, "A" & nEntityIndex.ToString)
|
||||
EgtGetName(CurrLine, sNameCurrLine)
|
||||
' inserisco la numerazione dei lati della figura
|
||||
AddTextToLine(sNameCurrLine, LabelId, CurrLine, 20, m_dBBoxRad, True)
|
||||
' recupero l'informazione
|
||||
EgtGetInfo(CurrLine, INFO_ALZFRONT, nInfo)
|
||||
If nInfo = 1 Then
|
||||
AlzFrontEntityList.Add(New AlzFrontEntity(sNameCurrLine, CurrLine, AlzFrontEntity.AlzFront.ALZATINA))
|
||||
ElseIf nInfo = 2 Then
|
||||
AlzFrontEntityList.Add(New AlzFrontEntity(sNameCurrLine, CurrLine, AlzFrontEntity.AlzFront.FRONTALINO))
|
||||
Else
|
||||
AlzFrontEntityList.Add(New AlzFrontEntity(sNameCurrLine, CurrLine))
|
||||
End If
|
||||
' inserisco riferimento univoco al lato (solo se non esiste)
|
||||
Dim sInfoRef As String = String.Empty
|
||||
EgtGetInfo(CurrLine, "RefAF", sInfoRef)
|
||||
If String.IsNullOrEmpty(sInfoRef) Then
|
||||
Dim sRefGUID As String = System.Guid.NewGuid().ToString()
|
||||
EgtSetInfo(CurrLine, "RefAF", sRefGUID)
|
||||
End If
|
||||
nEntityIndex += 1
|
||||
Else
|
||||
EgtSetName(CurrLine, "B" & nOtherIndex.ToString)
|
||||
nOtherIndex = nOtherIndex + 1
|
||||
End If
|
||||
Dim NextId As Integer = EgtGetNext(CurrLine)
|
||||
If NextId = GDB_ID.NULL Then NextId = EgtGetFirstInGroup(LoopId)
|
||||
If VerifySideAnglePossible(PrevLine, CurrLine, NextId, bOutLoop) Then
|
||||
|
||||
If ApprovedSideToAlzFront(CurrLine) Then
|
||||
' Aggiungo il lato alla lista di quelli su cui è possibile mettere una alzatina o un frontalino
|
||||
Dim sNameCurrLine As String = String.Empty
|
||||
Dim nInfo As Integer = 0
|
||||
Dim dSideAng As Integer = 0
|
||||
EgtSetName(CurrLine, "A" & nEntityIndex.ToString)
|
||||
EgtGetName(CurrLine, sNameCurrLine)
|
||||
' inserisco la numerazione dei lati della figura
|
||||
AddTextToLine(sNameCurrLine, LabelId, CurrLine, 20, m_dBBoxRad, True)
|
||||
' recupero l'informazione
|
||||
EgtGetInfo(CurrLine, INFO_ALZFRONT, nInfo)
|
||||
If nInfo = 1 Then
|
||||
AlzFrontEntityList.Add(New AlzFrontEntity(sNameCurrLine, CurrLine, AlzFrontEntity.AlzFront.ALZATINA))
|
||||
ElseIf nInfo = 2 Then
|
||||
AlzFrontEntityList.Add(New AlzFrontEntity(sNameCurrLine, CurrLine, AlzFrontEntity.AlzFront.FRONTALINO))
|
||||
Else
|
||||
AlzFrontEntityList.Add(New AlzFrontEntity(sNameCurrLine, CurrLine))
|
||||
End If
|
||||
' inserisco riferimento univoco al lato (solo se non esiste)
|
||||
Dim sInfoRef As String = String.Empty
|
||||
EgtGetInfo(CurrLine, "RefAF", sInfoRef)
|
||||
If String.IsNullOrEmpty(sInfoRef) Then
|
||||
Dim sRefGUID As String = System.Guid.NewGuid().ToString()
|
||||
EgtSetInfo(CurrLine, "RefAF", sRefGUID)
|
||||
End If
|
||||
nEntityIndex += 1
|
||||
Else
|
||||
EgtSetName(CurrLine, "B" & nOtherIndex.ToString)
|
||||
nOtherIndex = nOtherIndex + 1
|
||||
End If
|
||||
End If
|
||||
PrevLine = CurrLine
|
||||
CurrLine = EgtGetNext(CurrLine)
|
||||
End While
|
||||
@@ -275,6 +279,44 @@ Public Class AlzFrontUC
|
||||
bInternalSelection = False
|
||||
End Sub
|
||||
|
||||
' restituisce vero se il lato possiede delle info legate al sideangle
|
||||
Private Function VerifyIsThereSideAngle(nCurrLine As Integer) As Boolean
|
||||
Dim sInfoSideAngle As String = String.Empty
|
||||
EgtGetInfo(nCurrLine, INFO_SIDE_ANGLE, sInfoSideAngle)
|
||||
If Not String.IsNullOrWhiteSpace(sInfoSideAngle) Or Not String.IsNullOrEmpty(sInfoSideAngle) Then
|
||||
' verifico che il dato salvato sia un double
|
||||
Try
|
||||
Dim dSideAngle As Double = 0
|
||||
StringToDouble(sInfoSideAngle, dSideAngle)
|
||||
If dSideAngle <> 0 Then
|
||||
Return True
|
||||
End If
|
||||
Catch ex As Exception
|
||||
End Try
|
||||
End If
|
||||
Return False
|
||||
End Function
|
||||
|
||||
' restituisce vero se il lato possiede delle info legate alle alette
|
||||
Private Function VerifyIsThereAlzFront(nCurrLine As Integer) As Boolean
|
||||
Dim sInfoAlzFront As String = String.Empty
|
||||
EgtGetInfo(nCurrLine, INFO_ALZFRONT, sInfoAlzFront)
|
||||
If Not String.IsNullOrWhiteSpace(sInfoAlzFront) Or Not String.IsNullOrEmpty(sInfoAlzFront) Then
|
||||
If sInfoAlzFront.Trim <> "0" Then
|
||||
Return True
|
||||
End If
|
||||
End If
|
||||
Return False
|
||||
End Function
|
||||
|
||||
' approvo la costruzione dell'aletta sul lato indicato
|
||||
Private Function ApprovedSideToAlzFront(nCurrLine As Integer) As Boolean
|
||||
If VerifyIsThereSideAngle(nCurrLine) And Not VerifyIsThereAlzFront(nCurrLine) Then
|
||||
' se esiste SideAngle e un'aletta allora NON approvo
|
||||
Return False
|
||||
End If
|
||||
Return True
|
||||
End Function
|
||||
|
||||
' Permette di aggiugere accanto alla linea passata
|
||||
Friend Function AddTextToLine(sText As String, TextLayer As Integer, CurrLine As Integer, dDistance As Double,
|
||||
|
||||
@@ -105,6 +105,9 @@ Public Class DrawPageUC
|
||||
Return m_nSelectedLayer
|
||||
End Get
|
||||
End Property
|
||||
Public Sub SetCurrLayer(ByVal nCurrLayer As Integer)
|
||||
m_nSelectedLayer = nCurrLayer
|
||||
End Sub
|
||||
|
||||
Enum Pages
|
||||
MainComponent
|
||||
@@ -879,8 +882,8 @@ Public Class DrawPageUC
|
||||
|
||||
' permette di inserire più di un part
|
||||
Private Function MakeMultipleInsert(ByVal nNbr As Integer, sName As String) As Boolean
|
||||
Dim InsertColor As Color3d = New Color3d(89, 210, 210)
|
||||
CompoColor(InsertColor, m_MainWindow.GetIniFile())
|
||||
|
||||
Dim InsertColor As Color3d = CompoColor(m_MainWindow.GetIniFile())
|
||||
|
||||
' Imposto il contesto corrente
|
||||
EgtSetCurrentContext(DrawScene.GetCtx())
|
||||
@@ -893,8 +896,6 @@ Public Class DrawPageUC
|
||||
While Pz <> -1
|
||||
' imposto il contesto corrente
|
||||
EgtSetCurrentContext(DrawScene.GetCtx())
|
||||
' salvo il file temporaneo per studio delle alzatine
|
||||
EgtSaveFile("c:\EgtData\OmagCUT\Temp\TempAlzatine.nge", NGE.CMPTEXT)
|
||||
' cerco un altro pezzo nell'elenco
|
||||
NxtPz = EgtGetNextPart(Pz)
|
||||
|
||||
@@ -1018,8 +1019,12 @@ Public Class DrawPageUC
|
||||
' Imposto colore testi
|
||||
Utility.SetTextColor(nRegLayId)
|
||||
' Imposto il colore del pezzo inserito nel progetto
|
||||
Dim nPartInRegion As Integer = EgtGetFirstInGroup(nRegLayId)
|
||||
EgtSetColor(nPartInRegion, InsertColor)
|
||||
EgtSetColor(nRegLayId, InsertColor)
|
||||
Dim EntId As Integer = EgtGetFirstInGroup(nRegLayId)
|
||||
While EntId <> GDB_ID.NULL
|
||||
If EgtGetType( EntId) = GDB_TY.SRF_FRGN Then EgtSetColor(EntId, InsertColor)
|
||||
EntId = EgtGetNext(EntId)
|
||||
End While
|
||||
|
||||
' Esporto il pezzo in un file temporaneo
|
||||
Dim sTmpFile As String = m_MainWindow.GetTempDir() & "\FlatPartCompo.Nge"
|
||||
|
||||
@@ -578,23 +578,23 @@ Public Class ImportPageUC
|
||||
|
||||
' metodo utilizzato per definire il colore dei pezzi DXF importati
|
||||
Private Sub ColorRegion(nCtx As Integer)
|
||||
|
||||
' Leggo dati corrispondenza colore
|
||||
Dim InsertColor As Color3d = New Color3d(89, 210, 210)
|
||||
CompoColor(InsertColor, m_MainWindow.GetIniFile())
|
||||
Dim InsertColor As Color3d = CompoColor(m_MainWindow.GetIniFile())
|
||||
|
||||
' Imposto contesto corrente
|
||||
EgtSetCurrentContext(nCtx)
|
||||
' Ciclo sui pezzi
|
||||
Dim PartId As Integer = EgtGetFirstPart()
|
||||
While PartId <> GDB_ID.NULL
|
||||
' Ciclo sui layer di contorno
|
||||
Dim bOutLoop As Boolean = True
|
||||
' Ciclo sui layer delle regioni
|
||||
Dim RegionId As Integer = EgtGetFirstNameInGroup(PartId, NAME_REGION)
|
||||
While RegionId <> GDB_ID.NULL
|
||||
EgtSetColor(RegionId, InsertColor)
|
||||
' Ciclo sulle regioni
|
||||
Dim EntId As Integer = EgtGetFirstInGroup(RegionId)
|
||||
While EntId <> GDB_ID.NULL
|
||||
EgtSetColor(EntId, InsertColor)
|
||||
If EgtGetType( EntId) = GDB_TY.SRF_FRGN Then EgtSetColor(EntId, InsertColor)
|
||||
EntId = EgtGetNext(EntId)
|
||||
End While
|
||||
RegionId = EgtGetNextName(PartId, NAME_REGION)
|
||||
|
||||
@@ -24,7 +24,7 @@ Public Class InternalComponentPageUC
|
||||
ImageCompo9.Visibility = Windows.Visibility.Hidden
|
||||
LabelCompo9.Visibility = Windows.Visibility.Visible
|
||||
' Se i componenti interni sono più di 8 viene visualizzato il bottone "Altri" altrimenti no
|
||||
Dim nCount As Integer = GetPrivateProfileInt("InternalCompo", "Count", 0, m_MainWindow.GetIniFile())
|
||||
Dim nCount As Integer = GetPrivateProfileInt(S_INTCOMPO, K_INT_COUNT, 0, m_MainWindow.GetIniFile())
|
||||
If nCount > 8 Then
|
||||
Compo9.Visibility = Windows.Visibility.Visible
|
||||
Else
|
||||
@@ -163,10 +163,10 @@ Public Class InternalComponentPageUC
|
||||
|
||||
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 = e.Source
|
||||
Dim CompoName As String = "InternalCompo" & GetIndexFromButton(CurrentBtn).ToString
|
||||
Dim CompoName As String = S_INTCOMPO & GetIndexFromButton(CurrentBtn).ToString
|
||||
m_sCurrCompoFam = CompoName
|
||||
' m_SecondaryComponentPage.m_sCurrCompo = String.Empty
|
||||
Dim nCount As Integer = GetPrivateProfileInt(CompoName, "Count", 0, m_MainWindow.GetIniFile())
|
||||
Dim nCount As Integer = GetPrivateProfileInt(CompoName, K_CMP_COUNT, 0, m_MainWindow.GetIniFile())
|
||||
If nCount > 1 Then
|
||||
m_MainWindow.m_DrawPageUC.LeftButtonGrd.Children.Remove(Me)
|
||||
m_MainWindow.m_DrawPageUC.m_ActiveComponentPage = DrawPageUC.Pages.SecondaryComponent
|
||||
@@ -252,7 +252,7 @@ Public Class InternalComponentPageUC
|
||||
Private Sub LoadPage()
|
||||
Dim nDeltaSecondPage As Integer = 8
|
||||
' Leggo numero di componenti presenti
|
||||
Dim nCompoNumber As Integer = GetPrivateProfileInt("InternalCompo", "Count", 0, m_MainWindow.GetIniFile())
|
||||
Dim nCompoNumber As Integer = GetPrivateProfileInt(S_INTCOMPO, K_INT_COUNT, 0, m_MainWindow.GetIniFile())
|
||||
' Calcolo indici a seconda della pagina in cui sono
|
||||
If m_bIsFirstPage Then
|
||||
ClearButton(nCompoNumber)
|
||||
|
||||
@@ -167,10 +167,10 @@ 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 = "Compo" & GetIndexFromButton(CurrentBtn).ToString
|
||||
Dim CompoName As String = S_COMPO & GetIndexFromButton(CurrentBtn).ToString
|
||||
m_sCurrCompoFam = CompoName
|
||||
m_SecondaryComponentPage.m_sCurrCompo = String.Empty
|
||||
Dim nCount As Integer = GetPrivateProfileInt(CompoName, "Count", 0, m_MainWindow.GetIniFile())
|
||||
Dim nCount As Integer = GetPrivateProfileInt(CompoName, K_CMP_COUNT, 0, m_MainWindow.GetIniFile())
|
||||
If nCount > 1 Then
|
||||
m_MainWindow.m_DrawPageUC.LeftButtonGrd.Children.Remove(Me)
|
||||
m_MainWindow.m_DrawPageUC.m_ActiveComponentPage = DrawPageUC.Pages.SecondaryComponent
|
||||
@@ -253,7 +253,7 @@ Public Class MainComponentPageUC
|
||||
Private Sub LoadPage()
|
||||
Dim nDeltaSecondPage As Integer = 8
|
||||
' Leggo numero di componenti presenti
|
||||
Dim nCompoNumber As Integer = GetPrivateProfileInt("Compo", "Count", 0, m_MainWindow.GetIniFile())
|
||||
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)
|
||||
|
||||
@@ -26,17 +26,17 @@ Public Class SecondaryComponentPageUC
|
||||
Dim ImageConverter As New ImageSourceConverter
|
||||
Dim ThicknessConverter As New ThicknessConverter
|
||||
|
||||
m_sMainCompoName = m_MainComponentPage.m_sCurrCompoFam '"Compo" & m_MainComponentPage.GetIndexFromButton(CurrentMainBtn)
|
||||
m_sMainCompoName = m_MainComponentPage.m_sCurrCompoFam
|
||||
|
||||
'Assegnazione immagine e testo ai Button
|
||||
Dim nCount As Integer = GetPrivateProfileInt(m_sMainCompoName, "Count", 0, m_MainWindow.GetIniFile())
|
||||
Dim nCount As Integer = GetPrivateProfileInt(m_sMainCompoName, K_CMP_COUNT, 0, m_MainWindow.GetIniFile())
|
||||
ClearButton(nCount)
|
||||
For index As Integer = 1 To nCount
|
||||
Dim CustomThickness As Thickness = ThicknessConverter.ConvertFromString("0")
|
||||
Dim nCompoName As Integer = GetPrivateProfileInt(m_sMainCompoName, "Compo" & index, 0, m_MainWindow.GetIniFile())
|
||||
Dim nCompoName As Integer = GetPrivateProfileInt(m_sMainCompoName, S_EXTCOMPO & index, 0, m_MainWindow.GetIniFile())
|
||||
Dim sCompo As String = ""
|
||||
Dim sCompoImage As String = ""
|
||||
m_MainComponentPage.GetPrivateProfileCompo(m_sMainCompoName, "Compo" & index, nCompoName, sCompo, sCompoImage, m_MainWindow.GetIniFile())
|
||||
m_MainComponentPage.GetPrivateProfileCompo(m_sMainCompoName, S_EXTCOMPO & index, nCompoName, sCompo, sCompoImage, m_MainWindow.GetIniFile())
|
||||
Dim sCompoImageSource As ImageSource
|
||||
|
||||
'verifico presenza immagine e la aggiungo
|
||||
|
||||
@@ -75,10 +75,12 @@ Public Class SideAngleUC
|
||||
|
||||
' Inizializzo lati per angoli e per gocciolatoi (ne compilo la lista e aggiungo la scritta nel disegno)
|
||||
InitSides()
|
||||
' Aggiorno testi nel disegno e creo i gocciolatoi
|
||||
RefreshSideAngleText()
|
||||
'' Aggiorno testi nel disegno e creo i gocciolatoi
|
||||
'RefreshSideAngleText()
|
||||
' Aggiorno check e valori
|
||||
RefreshCheckAndValue()
|
||||
' Aggiorno testi nel disegno e creo i gocciolatoi
|
||||
RefreshSideAngleText()
|
||||
|
||||
' Gestisco visualizzazione di tutti i parametri
|
||||
If m_Mode = ModeOpt.SIDEANGLE Then
|
||||
@@ -179,6 +181,10 @@ Public Class SideAngleUC
|
||||
' Imposto contesto corrente
|
||||
EgtSetCurrentContext(m_MainWindow.m_DrawPageUC.DrawScene.GetCtx())
|
||||
' Ricavo nome primo pezzo e lo sistemo
|
||||
If m_Mode = ModeOpt.ENGRAVE And m_MainWindow.m_DrawPageUC.SelectedLayer = GDB_ID.NULL Then
|
||||
PartId = EgtGetFirstPart()
|
||||
m_MainWindow.m_DrawPageUC.SetCurrLayer(EgtGetFirstNameInGroup(PartId, NAME_OUTLOOP))
|
||||
End If
|
||||
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
|
||||
@@ -275,8 +281,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
|
||||
@@ -497,11 +503,10 @@ Public Class SideAngleUC
|
||||
If m_CallingPage = MainWindow.Pages.Draw Then
|
||||
' Imposto contesto corrente
|
||||
EgtSetCurrentContext(m_MainWindow.m_DrawPageUC.DrawScene.GetCtx())
|
||||
' Ricavo nome primo pezzo
|
||||
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
|
||||
@@ -568,8 +573,20 @@ Public Class SideAngleUC
|
||||
' verifico se l'entità ha un gocciolatoio
|
||||
GetChBxFromIndex(nChIndex).IsChecked = Entity.bHaveDrip
|
||||
' aggiorno i valore delle caselle di testo per le entità caricate (Start/End)
|
||||
GetAngleTxBxFromIndex(nChIndex).Text = DoubleToString(Entity.dShortStart, 1)
|
||||
GetHeelTxBxFromIndex(nChIndex).Text = LenToString(Entity.dShortStart, 1)
|
||||
If m_Mode = ModeOpt.ENGRAVE Then
|
||||
Dim dVal As Double = 0
|
||||
If StringToLen(GetPrivateProfileDouble(S_SIDES, K_ENGRAVESHORT & "A" & nIndex.ToString & "_Start", 0, m_MainWindow.GetIniFile()), dVal) Then
|
||||
Entity.dShortStart = dVal
|
||||
End If
|
||||
If StringToLen(GetPrivateProfileDouble(S_SIDES, K_ENGRAVESHORT & "A" & nIndex.ToString & "_End", 0, m_MainWindow.GetIniFile()), dVal) Then
|
||||
Entity.dShortEnd = dVal
|
||||
End If
|
||||
Else
|
||||
'GetAngleTxBxFromIndex(Index).Text = GetPrivateProfileDouble(S_SIDES, K_DRIPSHORT & "A" & nI.ToString & "_Start", 0, m_MainWindow.GetIniFile())
|
||||
'GetHeelTxBxFromIndex(Index).Text = GetPrivateProfileDouble(S_SIDES, K_DRIPSHORT & "A" & nI.ToString & "_End", 0, m_MainWindow.GetIniFile())
|
||||
End If
|
||||
GetAngleTxBxFromIndex(nChIndex).Text = LenToString(Entity.dShortStart, 1)
|
||||
GetHeelTxBxFromIndex(nChIndex).Text = LenToString(Entity.dShortEnd, 1)
|
||||
Next
|
||||
End If
|
||||
End Sub
|
||||
|
||||
@@ -1026,6 +1026,14 @@ Public Class AlarmsPageUC
|
||||
End Sub
|
||||
|
||||
Private Sub SawProbingBtn_Click(sender As Object, e As RoutedEventArgs) Handles SawProbingBtn.Click
|
||||
' imposto modo automatico
|
||||
Select Case m_MainWindow.m_CNCommunication.m_nNCType
|
||||
Case 1, 2
|
||||
' in attesa di verifica
|
||||
Case 3
|
||||
Dim nResult As Short = m_CN.DGeneralFunctions_WriteCncMode(0)
|
||||
EgtOutLog("Impostata modalità automatica: esito " & nResult.ToString)
|
||||
End Select
|
||||
' Recupero file LUA
|
||||
EgtLuaExecFile(m_MainWindow.m_CurrentMachine.sMachDir() & "\DirectCmd\SawProbing.lua")
|
||||
' Recupero utensile da tastare
|
||||
|
||||
@@ -423,8 +423,8 @@
|
||||
|
||||
<TextBlock Grid.Column="0" Name="ConsumptionNameTxBx" Text="A"
|
||||
Style="{StaticResource OmagCut_LowerBarTitleTextBlock}"/>
|
||||
<TextBlock Grid.Column="1" Name="ConsumptionTxBx" Text="25"
|
||||
Style="{StaticResource OmagCut_LowerBarValueTextBlock}"/>
|
||||
<TextBlock Grid.Column="1" Name="ConsumptionTxBx" Text="25.00"
|
||||
Style="{StaticResource OmagCut_LowerBarValueTextBlock}" FontSize="22"/>
|
||||
|
||||
</Grid>
|
||||
|
||||
|
||||
@@ -62,5 +62,5 @@ Imports System.Windows
|
||||
' by using the '*' as shown below:
|
||||
' <Assembly: AssemblyVersion("1.0.*")>
|
||||
|
||||
<Assembly: AssemblyVersion("2.3.10.1")>
|
||||
<Assembly: AssemblyFileVersion("2.3.10.1")>
|
||||
<Assembly: AssemblyVersion("2.3.12.1")>
|
||||
<Assembly: AssemblyFileVersion("2.3.12.1")>
|
||||
|
||||
@@ -225,8 +225,11 @@ Public Class CNCommunication
|
||||
|
||||
' definisco il tipo di varibili che devono essere scritte nl plc
|
||||
Dim sVal As String = String.Empty
|
||||
GetPrivateProfileString(S_NCDATA, K_NEWVARIABLE, "0", sVal, m_MainWindow.GetMachIniFile())
|
||||
m_CN.m_NewVariable = sVal <> 0
|
||||
Dim nVal As Integer = 0
|
||||
'GetPrivateProfileString(S_NCDATA, K_NEWVARIABLE, "0", sVal, m_MainWindow.GetMachIniFile())
|
||||
nVal = GetPrivateProfileInt(S_NCDATA, K_NEWVARIABLE, nVal, m_MainWindow.GetMachIniFile())
|
||||
'm_CN.m_NewVariable = sVal <> "0"
|
||||
m_CN.m_NewVariable = (nVal <> 0)
|
||||
EgtOutLog("NewVariable=" & If(m_CN.m_NewVariable, "1", "0"))
|
||||
|
||||
' Recupero e imposto le variabili per i dati del CN (feed, speed,...)
|
||||
@@ -326,8 +329,8 @@ Public Class CNCommunication
|
||||
m_CN.SetCnDataVar(CN_generico.CnData.BypassState, sVal)
|
||||
|
||||
' nuove variabili: stato dei nuovi pulsanti
|
||||
GetPrivateProfileString(S_NCDATA, K_NEWCONSOLE, "", sVal, m_MainWindow.GetMachIniFile())
|
||||
m_IsNewConsole = (sVal = 1)
|
||||
nVal = GetPrivateProfileInt(S_NCDATA, K_NEWCONSOLE, 0, m_MainWindow.GetMachIniFile())
|
||||
m_IsNewConsole = (nVal = 1)
|
||||
If m_IsNewConsole Then
|
||||
GetPrivateProfileString(S_NCDATA, K_XYJOG, "", sVal, m_MainWindow.GetMachIniFile())
|
||||
If Not String.IsNullOrEmpty(sVal) Then m_CN.SetCnDataVar(CN_generico.CnData.XYJog, sVal)
|
||||
|
||||
@@ -131,7 +131,6 @@ Public Class CN_Siemens
|
||||
|
||||
Public Overrides Function read_active_mode() As Short
|
||||
'EgtOutLog("Modo attivo: " & M_MMFiles.SiemensRet.n_param2)
|
||||
'Return M_MMFiles.read_active_mode()
|
||||
If m_IsSiemensOne Then
|
||||
Select Case n_data(3)
|
||||
Case 1
|
||||
@@ -144,7 +143,10 @@ Public Class CN_Siemens
|
||||
Return 0
|
||||
End Select
|
||||
Else
|
||||
Return CShort(M_MMFiles.SiemensRet.n_param2)
|
||||
' per verificare che la comunicazione funzioni correttamente
|
||||
'EgtOutLog("Modo -read_active_mode-: " & M_MMFiles.SiemensRet.n_param2.ToString)
|
||||
Return M_MMFiles.read_active_mode()
|
||||
'Return CShort(M_MMFiles.SiemensRet.n_param2)
|
||||
End If
|
||||
End Function
|
||||
|
||||
|
||||
+31
-8
@@ -398,13 +398,35 @@ Module M_MMFiles
|
||||
End Function
|
||||
|
||||
Function WriteCncMode(ByVal nmode As Short) As Short
|
||||
'EgtOutLog("WriteCncMode start dell'm_mmFiles")
|
||||
SiemensSend.n_Command = CMD.CMD_WriteCncMode
|
||||
SiemensSend.n_param1 = nmode
|
||||
|
||||
execute_command()
|
||||
'EgtOutLog("WriteCncMode end dell'm_mmFiles")
|
||||
Return SiemensRet.n_result
|
||||
Dim nNewWriteCNCMode As Integer = 0
|
||||
If GetPrivateProfileInt(S_NCSIEMENS, K_NEWWRITECNCMODE, nNewWriteCNCMode, m_MainWindow.GetMachIniFile()) <> 0 Then
|
||||
Dim s_var As String = String.Empty
|
||||
GetPrivateProfileString(S_NCDATA, K_WRITECNCMODEVAR, "db11.dbx0", s_var, m_MainWindow.GetMachIniFile())
|
||||
Select Case nmode
|
||||
Case 0
|
||||
' Auto
|
||||
s_var &= ".0"
|
||||
Case 2
|
||||
' MDI
|
||||
s_var &= ".1"
|
||||
Case 7
|
||||
' manuale
|
||||
s_var &= ".2"
|
||||
Case Else
|
||||
' manuale
|
||||
s_var &= ".2"
|
||||
End Select
|
||||
EgtOutLog("Nuova scrittura modo: case(" & nmode.ToString & ") -> " & s_var)
|
||||
Return Write_var(s_var, CShort(1), CInt(1), 0, 0, "")
|
||||
Else
|
||||
'EgtOutLog("WriteCncMode start dell'm_mmFiles")
|
||||
SiemensSend.n_Command = CMD.CMD_WriteCncMode
|
||||
SiemensSend.n_param1 = nmode
|
||||
EgtOutLog("Attivata modalità: " & SiemensSend.n_param1.ToString)
|
||||
execute_command()
|
||||
'EgtOutLog("WriteCncMode end dell'm_mmFiles")
|
||||
Return SiemensRet.n_result
|
||||
End If
|
||||
|
||||
End Function
|
||||
|
||||
@@ -723,7 +745,8 @@ Module M_MMFiles
|
||||
CurrCN.d_Dvariable_values(n) = SiemensRet.d_interf_variable_values(n)
|
||||
Next
|
||||
|
||||
' copy spindle current
|
||||
' copy spindle current: per debuggare errore di comunicazione
|
||||
'EgtOutLog("Spindle -d_interf_spindle_power-: " & SiemensRet.d_interf_spindle_power.ToString)
|
||||
CurrCN.d_spindle_power = SiemensRet.d_interf_spindle_power
|
||||
|
||||
CurrCN.n_spindle_override(0) = SiemensRet.n_interf_spindle_override
|
||||
|
||||
+10
-1
@@ -1578,7 +1578,16 @@ Namespace Num
|
||||
End Sub
|
||||
|
||||
Public Overrides Sub DPlcVariables_WriteVariables(sz_var_names As String, sz_values As String)
|
||||
Dim _ret As Short = objDPlcVariables.WriteVariables(sz_var_names, CShort(sz_values))
|
||||
Dim value As Short = 0
|
||||
If Not Short.TryParse(sz_values, value) Then
|
||||
If Not IsNothing( sz_values) then
|
||||
EgtOutLog("Write variable: " & sz_var_names & ", value:" & sz_values & " failed!")
|
||||
Else
|
||||
EgtOutLog("Write variable: " & sz_var_names & ", value:nothing failed!")
|
||||
End If
|
||||
Return
|
||||
End If
|
||||
Dim _ret As Short = objDPlcVariables.WriteVariables(sz_var_names, value)
|
||||
If _ret <> 0 Then
|
||||
EgtOutLog("Scrittura " & sz_var_names & " fallita")
|
||||
Else
|
||||
|
||||
@@ -118,6 +118,7 @@
|
||||
<BitmapImage x:Key="Taglio-grigliaImg" UriSource="Resources/NewIcons/Taglio-griglia.png"></BitmapImage>
|
||||
<BitmapImage x:Key="Taglio-multiploImg" UriSource="Resources/NewIcons/Taglio-multiplo.png"></BitmapImage>
|
||||
<BitmapImage x:Key="Taglio-singoloImg" UriSource="Resources/NewIcons/Taglio-singolo.png"></BitmapImage>
|
||||
<BitmapImage x:Key="Foro-singoloImg" UriSource="Resources/NewIcons/Foro-singolo.png"></BitmapImage>
|
||||
<BitmapImage x:Key="SpianaturaImg" UriSource="Resources/NewIcons/Spianatura.png"></BitmapImage>
|
||||
<BitmapImage x:Key="Movimento-manualeImg" UriSource="Resources/NewIcons/Movimento-manuale.png"></BitmapImage>
|
||||
<BitmapImage x:Key="Copia-dimaImg" UriSource="Resources/NewIcons/Copia-dima.png"></BitmapImage>
|
||||
|
||||
@@ -186,6 +186,7 @@
|
||||
<BitmapImage x:Key="Taglio-grigliaImg" UriSource="Resources/NewIcons/Taglio-griglia.png"></BitmapImage>
|
||||
<BitmapImage x:Key="Taglio-multiploImg" UriSource="Resources/NewIcons/Taglio-multiplo.png"></BitmapImage>
|
||||
<BitmapImage x:Key="Taglio-singoloImg" UriSource="Resources/NewIcons/Taglio-singolo.png"></BitmapImage>
|
||||
<BitmapImage x:Key="Foro-singoloImg" UriSource="Resources/NewIcons/Foro-singolo.png"></BitmapImage>
|
||||
<BitmapImage x:Key="SpianaturaImg" UriSource="Resources/NewIcons/Spianatura.png"></BitmapImage>
|
||||
<BitmapImage x:Key="Movimento-manualeImg" UriSource="Resources/NewIcons/Movimento-manuale.png"></BitmapImage>
|
||||
<BitmapImage x:Key="Copia-dimaImg" UriSource="Resources/NewIcons/Copia-dima.png"></BitmapImage>
|
||||
|
||||
@@ -9,7 +9,8 @@ Public Class OptionsPageUC
|
||||
Private UnitsList() As String = {"inch", "mm"}
|
||||
Private ThemesList() As String = {"Classic", "Dark"}
|
||||
|
||||
Private StartLauncherList() As String = {"Last Project", "New Project", "Open Folder", "Show Window"}
|
||||
' "Last Project", "New Project", "Open Folder", "Show Window"
|
||||
Private StartLauncherList() As String = {EgtMsg(91013), EgtMsg(91014), EgtMsg(91015), EgtMsg(91016)}
|
||||
|
||||
Private Sub OptionsPageUC_Initialized(sender As Object, e As EventArgs) Handles Me.Initialized
|
||||
|
||||
@@ -109,7 +110,7 @@ Public Class OptionsPageUC
|
||||
ToleranceEMsgTxBl.Text = EgtMsg(MSG_OPTIONSPAGEUC + 21)
|
||||
AffondamentoMsgTxBl.Text = EgtMsg(MSG_OPTIONSPAGEUC + 27)
|
||||
LarghezzaMsgTxBl.Text = EgtMsg(MSG_OPTIONSPAGEUC + 28)
|
||||
StartLauncherGpBx.Header = "Avvio Programma"
|
||||
StartLauncherGpBx.Header = EgtMsg(91009)
|
||||
End Sub
|
||||
|
||||
Private Sub UpdateSlabDxf()
|
||||
|
||||
@@ -276,7 +276,7 @@ Public Class CurrentProjectPageUC
|
||||
m_MainWindow.MainWindowGrid.Children.Add(m_MainWindow.m_OpenPage)
|
||||
m_MainWindow.m_ActivePage = MainWindow.Pages.Open
|
||||
|
||||
' seleziono il file dalla lista della finestra (= 4)
|
||||
' seleziono il file dalla lista della finestra (= 4)
|
||||
ElseIf MyStartLancherWD.CurrSelection = MODE_LAUNCHER.SelectedProject Then
|
||||
NewProject()
|
||||
Dim sCurrDir As String = Path.GetDirectoryName(MyStartLancherWD.SelPath)
|
||||
@@ -303,29 +303,8 @@ Public Class CurrentProjectPageUC
|
||||
End If
|
||||
m_MruFiles.Add(sCurrDir & "\" & sCurrFile)
|
||||
End If
|
||||
|
||||
'If Not LoadProject(MyStartLancherWD.SelPath, False) Then
|
||||
' ' altrimenti apro un nuovo progetto
|
||||
' NewProject()
|
||||
'Else
|
||||
' ' salvo il nome del file caricato
|
||||
' m_MruFiles.Add(MyStartLancherWD.SelPath)
|
||||
'End If
|
||||
'EgtResetModified()
|
||||
End If
|
||||
|
||||
'' Nascondo progress per fotografia
|
||||
'PhotoProgress.Visibility = Windows.Visibility.Hidden
|
||||
'' Carico sottopagina opportuna
|
||||
'If GetProjectType() <> PRJ_TYPE.FRAMES Then
|
||||
' CurrentProjectPageGrid.Children.Add(m_MainWindow.m_CadCutPageUC)
|
||||
' m_MainWindow.m_ActivePage = MainWindow.Pages.CadCut
|
||||
' m_MainWindow.CadCutBtn.IsChecked = True
|
||||
'Else
|
||||
' CurrentProjectPageGrid.Children.Add(m_MainWindow.m_FrameCutPageUC)
|
||||
' m_MainWindow.m_ActivePage = MainWindow.Pages.FrameCut
|
||||
' m_MainWindow.FrameCutBtn.IsChecked = True
|
||||
'End If
|
||||
End Sub
|
||||
|
||||
' questo metodo è direttamente richiamato in caso di selezione della regione sinistra della pagina
|
||||
@@ -478,6 +457,12 @@ Public Class CurrentProjectPageUC
|
||||
UpdateContour()
|
||||
If EgtGetRawPartCount() > 0 Then
|
||||
ShowPhoto(False)
|
||||
Dim nRawGrpId As Integer = EgtGetFirstRawPart()
|
||||
While nRawGrpId <> GDB_ID.NULL
|
||||
Dim nRawSolidId As Integer = EgtGetFirstNameInGroup( nRawGrpId, NAME_RAW_SOLID)
|
||||
If nRawSolidId <> GDB_ID.NULL Then EgtSetTextureName( nRawSolidId, PHOTO_NAME)
|
||||
nRawGrpId = EgtGetNextRawPart( nRawGrpId)
|
||||
End While
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
@@ -568,7 +553,7 @@ Public Class CurrentProjectPageUC
|
||||
End If
|
||||
' Se la macchina del file è quella impostata
|
||||
If String.Compare(sFileMachine, m_MainWindow.GetCurrMachine(), True) = 0 Then
|
||||
AdjustAdditionalTable()
|
||||
AdjustAdditionalTable( True)
|
||||
' altrimenti avverto, porto i pezzi in parcheggio e cancello il grezzo
|
||||
Else
|
||||
' Emetto messaggio
|
||||
|
||||
@@ -128,25 +128,20 @@ Public Class ProjectMgrUC
|
||||
End Function
|
||||
|
||||
Friend Function ChangeTable() As Integer
|
||||
Dim nTabInd As Integer = 0
|
||||
Dim nRes As Integer = 0
|
||||
' se non abilitato esco dalla pagina
|
||||
If GetPrivateProfileInt(S_TABLE, K_CHANGETABWD, 0, m_MainWindow.GetMachIniFile()) = 0 Then
|
||||
Return nTabInd
|
||||
Return nRes
|
||||
End If
|
||||
Select Case GetTableCount()
|
||||
Case 2
|
||||
' Tavolo da usare ?
|
||||
' Vuoi cambiare tavola?
|
||||
Dim TableToUse As New EgtMsgBox(m_MainWindow, "", String.Format(EgtMsg(90968)), EgtMsgBox.Buttons.OK_CANCEL, EgtMsgBox.Icons.NULL)
|
||||
Select Case TableToUse.m_nPressedBtn
|
||||
Case 1 ' 1
|
||||
nTabInd = 1
|
||||
Case 0 ' 2
|
||||
nTabInd = 2
|
||||
End Select
|
||||
nRes = TableToUse.m_nPressedBtn
|
||||
Case Else
|
||||
' negli altri casi (3 tavole o una tavola non fare nulla)
|
||||
End Select
|
||||
Return nTabInd
|
||||
Return nRes
|
||||
End Function
|
||||
|
||||
Private Sub LoadBtn_Click(sender As Object, e As RoutedEventArgs) Handles LoadBtn.Click
|
||||
@@ -462,7 +457,7 @@ Public Class ProjectMgrUC
|
||||
' Costringo ad aggiornare UI
|
||||
UpdateUI()
|
||||
' Se macchina normale
|
||||
If Not m_CurrMachine.bProdLine Or Not m_CurrMachine.bDemo Then
|
||||
If Not (m_CurrMachine.bProdLine Or m_CurrMachine.bDemo) Then
|
||||
' Download programma (eventuali errori sono segnalati dalla funzione)
|
||||
If m_CurrNcComm.SendProgram(sCncPath, 900) Then
|
||||
' copio il progetto corrente come progetto in lavorazione
|
||||
|
||||
@@ -111,9 +111,12 @@ Public Class StartLauncherWD
|
||||
Me.Left = Owner.Left + Owner.Width / 2 - Me.Width / 2
|
||||
|
||||
' imopposto il messaggio di avvio
|
||||
SlectLauncherTxbl.Text = "Seleziona modalità di avvio"
|
||||
FileName.Text = "Progetti recenti"
|
||||
DataFile.Text = "Ultima apertura"
|
||||
SlectLauncherTxbl.Text = EgtMsg(91010) ' Seleziona modalità di avvio
|
||||
FileName.Text = EgtMsg(91011) ' Progetti recenti
|
||||
DataFile.Text = EgtMsg(91012) ' Ultima apertura
|
||||
LastProject.ToolTip = EgtMsg(91013)
|
||||
NewProject.ToolTip = EgtMsg(91014)
|
||||
OpenFolder.ToolTip = EgtMsg(91015)
|
||||
End Sub
|
||||
|
||||
' lancio l'apertura della pagina dei progetti
|
||||
|
||||
+112
-12
@@ -41,6 +41,7 @@ Public Class RawPartPageUC
|
||||
Private m_RawOffsX As Double = 0
|
||||
Private m_RawOffsY As Double = 0
|
||||
Private m_RawKerf As Double = 0
|
||||
Private m_PrecKerf As Double = 0
|
||||
' Layer per crocette temporanee
|
||||
Private m_nTempLay As Integer = GDB_ID.NULL
|
||||
' Definizione lista modalità di definizione grezzo per ComboBox
|
||||
@@ -234,6 +235,7 @@ Public Class RawPartPageUC
|
||||
m_RawOffsX = GetPrivateProfileDouble(S_RAWPART, K_RAWOFFSX, 100, m_MainWindow.GetIniFile())
|
||||
m_RawOffsY = GetPrivateProfileDouble(S_RAWPART, K_RAWOFFSY, 100, m_MainWindow.GetIniFile())
|
||||
m_RawKerf = GetPrivateProfileDouble(S_RAWPART, K_RAWKERF, 50, m_MainWindow.GetIniFile())
|
||||
m_PrecKerf = m_RawKerf
|
||||
' Richiedo ricalcolo quota eventuale foto
|
||||
UpdateRawPart(True)
|
||||
' Eventuale gestione dati lastra
|
||||
@@ -270,7 +272,14 @@ Public Class RawPartPageUC
|
||||
m_ActiveRawMode = RAWMODE.RECTANGLE
|
||||
RawModeCmBx.SelectedIndex = RAWMODE.RECTANGLE
|
||||
PointsGpBx.Visibility = Windows.Visibility.Hidden
|
||||
AdjustRawPartPosition()
|
||||
If dInvertKerf < 1 Then
|
||||
AdjustRawPartPositionNegativeKerf()
|
||||
' assegno il giosto colore al kerf
|
||||
Dim nKerfId As Integer = EgtGetFirstNameInGroup(m_CurrProjPage.m_nRawId, NAME_KERF)
|
||||
EgtSetColor(nKerfId, m_KerfCol)
|
||||
Else
|
||||
AdjustRawPartPosition()
|
||||
End If
|
||||
EgtZoom(ZM.ALL)
|
||||
End If
|
||||
' Imposto il materiale corrente nella combobox
|
||||
@@ -1171,6 +1180,8 @@ Public Class RawPartPageUC
|
||||
' box grezzo
|
||||
Dim ptMin, ptMax As Point3d
|
||||
GetRawBox(ptMin, ptMax)
|
||||
Dim Lenght As Double = ptMax.x - ptMin.x
|
||||
Dim Width As Double = ptMax.y - ptMin.y
|
||||
ptMin.x += m_RawKerf
|
||||
ptMin.y += m_RawKerf
|
||||
ptMin.z = ptMax.z
|
||||
@@ -1185,6 +1196,41 @@ Public Class RawPartPageUC
|
||||
Return True
|
||||
End Function
|
||||
|
||||
#Region "Negative Kerf"
|
||||
|
||||
Private Function AdjustRawPartNegativeKerf(Optional NegativeOffset As Boolean = True) As Boolean
|
||||
' Se non c'è il grezzo, esco
|
||||
If m_CurrProjPage.m_nRawId = GDB_ID.NULL Then Return False
|
||||
' Cancello eventuale vecchio contorno di kerf
|
||||
Dim nKerfId As Integer = EgtGetFirstNameInGroup(m_CurrProjPage.m_nRawId, NAME_KERF)
|
||||
Dim nInvert As Double = 1
|
||||
If Not NegativeOffset Then
|
||||
nInvert = -1
|
||||
End If
|
||||
EgtOffsetCurve(nKerfId, (-m_RawKerf - m_PrecKerf) * nInvert, OFF_TYPE.EXTEND)
|
||||
EgtSetColor(nKerfId, m_KerfCol)
|
||||
' Salvo il valore del kerf (sempre in mm)
|
||||
EgtSetInfo(m_CurrProjPage.m_nRawId, KEY_KERF, m_RawKerf)
|
||||
Return True
|
||||
End Function
|
||||
|
||||
Private Function AdjustRawPartPositionNegativeKerf() As Boolean
|
||||
' Sistemo la posizione
|
||||
Dim ptRef As New Point3d(m_RawOffsX, m_RawOffsY, m_CurrentMachine.dAdditionalTable)
|
||||
If EgtMoveToCornerRawPart(m_CurrProjPage.m_nRawId, ptRef, MCH_CR.BL) Then
|
||||
OkBtn.IsEnabled = True
|
||||
m_CurrProjPage.ClearMessage()
|
||||
Else
|
||||
OkBtn.IsEnabled = False
|
||||
m_CurrProjPage.SetErrorMessage(EgtMsg(MSG_RAWPARTPAGEUC + 47)) ' Errore nella posizione o dimensione del grezzo
|
||||
End If
|
||||
' Aggiorno visualizzazione
|
||||
EgtZoom(ZM.ALL)
|
||||
Return True
|
||||
End Function
|
||||
|
||||
#End Region ' Negative Kerf
|
||||
|
||||
Private Sub UpdateRawPartHeight()
|
||||
' Se da creare
|
||||
If m_CurrProjPage.m_nRawId = GDB_ID.NULL Then
|
||||
@@ -1514,8 +1560,10 @@ Public Class RawPartPageUC
|
||||
End If
|
||||
Dim dMinOffsetX = m_RawKerf
|
||||
If dKerf < 0 And dOffsetX >= 0 Then
|
||||
m_RawOffsX = dOffsetX + m_RawKerf
|
||||
UpdateRawPart()
|
||||
'm_RawOffsX = dOffsetX + m_RawKerf
|
||||
'UpdateRawPart()
|
||||
m_RawOffsX = dOffsetX
|
||||
AdjustRawPartPositionNegativeKerf()
|
||||
ElseIf dKerf >= 0 And dOffsetX >= dMinOffsetX Then
|
||||
m_RawOffsX = dOffsetX
|
||||
UpdateRawPart()
|
||||
@@ -1534,8 +1582,10 @@ Public Class RawPartPageUC
|
||||
End If
|
||||
Dim dMinOffsetY = m_RawKerf
|
||||
If dKerf < 0 And dOffsetY >= 0 Then
|
||||
m_RawOffsY = dOffsetY + m_RawKerf
|
||||
UpdateRawPart()
|
||||
'm_RawOffsY = dOffsetY + m_RawKerf
|
||||
'UpdateRawPart()
|
||||
m_RawOffsY = dOffsetY
|
||||
AdjustRawPartPositionNegativeKerf()
|
||||
ElseIf dKerf >= 0 And dOffsetY >= dMinOffsetY Then
|
||||
m_RawOffsY = dOffsetY
|
||||
UpdateRawPart()
|
||||
@@ -1554,9 +1604,23 @@ Public Class RawPartPageUC
|
||||
Dim dMaxKerf = Math.Min(Math.Min(m_RawOffsX, m_RawOffsY),
|
||||
Math.Min(m_dTableLength - m_RawLength - m_RawOffsX, m_dTableWidth - m_RawWidth - m_RawOffsY))
|
||||
Dim dMinKerf = -Math.Min(m_RawLength, m_RawWidth) / 2
|
||||
' recuper il segno del valore del Kerf precedente
|
||||
Dim dInvertKerf As Double = 1
|
||||
EgtGetInfo(EgtGetFirstRawPart(), KEY_INVERT_KERF, dInvertKerf)
|
||||
m_PrecKerf = Math.Abs(m_RawKerf)
|
||||
m_PrecKerf = m_PrecKerf * dInvertKerf
|
||||
' Sostituisco: dKerf >= dMinKerf And dKerf <= dMaxKerf
|
||||
If dKerf >= 0 And dKerf <= dMaxKerf Then
|
||||
m_RawKerf = dKerf
|
||||
If m_PrecKerf < 0 Then
|
||||
' definsco la dimensione del grezzo pari a quella del kerf
|
||||
m_RawKerf = 0
|
||||
AdjustRawPartNegativeKerf()
|
||||
UpdateCircles()
|
||||
UpdateRawPartKerf()
|
||||
m_RawKerf = dKerf
|
||||
m_PrecKerf = 0
|
||||
End If
|
||||
If m_ActiveRawMode <> RAWMODE.FROM_PHOTO Then
|
||||
StringToLen(LengthTxBx.Text, m_RawLength)
|
||||
StringToLen(WidthTxBx.Text, m_RawWidth)
|
||||
@@ -1576,20 +1640,56 @@ Public Class RawPartPageUC
|
||||
' Ridisegno
|
||||
EgtDraw()
|
||||
ElseIf dKerf >= dMinKerf And dKerf < 0 Then
|
||||
' aggiorno il valore del Kerf corrente
|
||||
m_RawKerf = dKerf
|
||||
If m_ActiveRawMode <> RAWMODE.FROM_PHOTO Then
|
||||
' aggiorno dati grezzo
|
||||
' recupero dati grezzo
|
||||
StringToLen(LengthTxBx.Text, m_RawLength)
|
||||
m_RawLength = m_RawLength + 2 * m_RawKerf
|
||||
StringToLen(WidthTxBx.Text, m_RawWidth)
|
||||
m_RawWidth = m_RawWidth + 2 * m_RawKerf
|
||||
StringToLen(OffsetXTxBx.Text, m_RawOffsX)
|
||||
m_RawOffsX = m_RawOffsX - m_RawKerf
|
||||
StringToLen(OffsetYTxBx.Text, m_RawOffsY)
|
||||
m_RawOffsY = m_RawOffsY - m_RawKerf
|
||||
' UpdateRawPart()
|
||||
|
||||
If m_PrecKerf >= 0 Then
|
||||
m_RawLength = m_RawLength + 2 * m_RawKerf
|
||||
m_RawWidth = m_RawWidth + 2 * m_RawKerf
|
||||
m_RawOffsX = m_RawOffsX - m_RawKerf
|
||||
m_RawOffsY = m_RawOffsY - m_RawKerf
|
||||
End If
|
||||
m_RawKerf = -m_RawKerf
|
||||
UpdateRawPartKerf()
|
||||
' esegue l'aggiornamento della dimensione del grezzo solo quando passo dal kerf positivo a quello negativo
|
||||
|
||||
If m_PrecKerf >= 0 Then
|
||||
' definsco la dimensione del grezzo pari a quella del kerf
|
||||
m_RawKerf = 0
|
||||
AdjustRawPartNegativeKerf(False)
|
||||
UpdateCircles()
|
||||
UpdateRawPartKerf()
|
||||
m_RawKerf = -dKerf
|
||||
m_PrecKerf = 0
|
||||
End If
|
||||
AdjustRawPartNegativeKerf()
|
||||
UpdateCircles()
|
||||
'If m_PrecKerf > 0 And m_RawKerf < 0 Then
|
||||
' m_RawLength = m_RawLength + 2 * m_RawKerf
|
||||
' m_RawWidth = m_RawWidth + 2 * m_RawKerf
|
||||
' m_RawOffsX = m_RawOffsX - m_RawKerf - m_PrecKerf
|
||||
' m_RawOffsY = m_RawOffsY - m_RawKerf - m_PrecKerf
|
||||
' m_RawKerf = -m_RawKerf
|
||||
' UpdateRawPartKerf()
|
||||
'If m_PrecKerf >=0 And m_RawKerf < 0 Then
|
||||
' m_RawOffsX = m_RawOffsX - m_PrecKerf
|
||||
' m_RawOffsY = m_RawOffsY - m_PrecKerf
|
||||
' UpdateNegativeRawPart()
|
||||
'Else
|
||||
' UpdateNegativeRawPart()
|
||||
'End If
|
||||
|
||||
'UpdateRawPart()
|
||||
'UpdateNegativeRawPart()
|
||||
|
||||
'm_RawKerf = -m_RawKerf
|
||||
'UpdateRawPartKerf()
|
||||
|
||||
' Recupero id contorno kerf
|
||||
Dim nKerfId As Integer = EgtGetFirstNameInGroup(m_CurrProjPage.m_nRawId, NAME_KERF)
|
||||
' Modifico il colore
|
||||
|
||||
+14
-13
@@ -2,15 +2,16 @@
|
||||
Imports EgtUILib
|
||||
|
||||
Module Utility
|
||||
Friend Sub CompoColor(ByRef InsertColor As Color3d, sIniFile As String)
|
||||
InsertColor = New Color3d(89, 210, 210)
|
||||
Dim IndexColor As Integer = GetPrivateProfileInt(S_COMPO, "LastColor", "1", sIniFile)
|
||||
If Not GetPrivateProfileColor(S_COMPO, "Color" & IndexColor.ToString, InsertColor, sIniFile) Then
|
||||
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)
|
||||
If Not GetPrivateProfileColor(S_COMPO, K_COLOR & IndexColor.ToString, InsertColor, sIniFile) Then
|
||||
IndexColor = 1
|
||||
GetPrivateProfileColor(S_COMPO, "Color" & IndexColor.ToString, InsertColor, sIniFile)
|
||||
GetPrivateProfileColor(S_COMPO, K_COLOR & IndexColor.ToString, InsertColor, sIniFile)
|
||||
End If
|
||||
WritePrivateProfileString(S_COMPO, "LastColor", (IndexColor + 1).ToString, sIniFile)
|
||||
End Sub
|
||||
WritePrivateProfileString(S_COMPO, K_LASTCOLOR, (IndexColor + 1).ToString, sIniFile)
|
||||
Return InsertColor
|
||||
End Function
|
||||
|
||||
|
||||
'--------------------------------------------------------------------------------------------------
|
||||
@@ -22,7 +23,7 @@ Module Utility
|
||||
End Sub
|
||||
|
||||
'--------------------------------------------------------------------------------------------------
|
||||
Friend Function DoubleToString(ByVal dVal As Double, ByVal nNumDec As Integer) As String
|
||||
Friend Function DoubleToString(dVal As Double, nNumDec As Integer) As String
|
||||
Dim sFormat As String = "F" + Math.Abs(nNumDec).ToString()
|
||||
Dim sVal As String = dVal.ToString(sFormat, CultureInfo.InvariantCulture)
|
||||
If nNumDec > 0 Then
|
||||
@@ -32,7 +33,7 @@ Module Utility
|
||||
End If
|
||||
End Function
|
||||
|
||||
Friend Function StringToDouble(ByVal sVal As String, ByRef dVal As Double) As Boolean
|
||||
Friend Function StringToDouble(sVal As String, ByRef dVal As Double) As Boolean
|
||||
If String.IsNullOrEmpty(sVal) Then Return False
|
||||
Return EgtLuaEvalNumExpr(sVal, dVal)
|
||||
End Function
|
||||
@@ -44,11 +45,11 @@ Module Utility
|
||||
Return True
|
||||
End Function
|
||||
|
||||
Friend Function LenToString(ByVal dVal As Double, ByVal nNumDec As Integer) As String
|
||||
Friend Function LenToString(dVal As Double, nNumDec As Integer) As String
|
||||
Return DoubleToString(EgtToUiUnits(dVal), nNumDec)
|
||||
End Function
|
||||
|
||||
Friend Function StringToLen(ByVal sVal As String, ByRef dVal As Double) As Boolean
|
||||
Friend Function StringToLen(sVal As String, ByRef dVal As Double) As Boolean
|
||||
If String.IsNullOrEmpty(sVal) Then Return False
|
||||
If EgtLuaEvalNumExpr(sVal, dVal) Then
|
||||
dVal = EgtFromUiUnits(dVal)
|
||||
@@ -58,14 +59,14 @@ Module Utility
|
||||
End If
|
||||
End Function
|
||||
|
||||
Friend Function UIExprToExpr(ByVal sUIExpr As String) As String
|
||||
Friend Function UIExprToExpr(sUIExpr As String) As String
|
||||
If String.IsNullOrWhiteSpace(sUIExpr) Then
|
||||
Return ""
|
||||
End If
|
||||
Return sUIExpr.Replace("""", "*GEO.ONE_INCH")
|
||||
End Function
|
||||
|
||||
Friend Function ExprToUIExpr(ByVal sExpr As String) As String
|
||||
Friend Function ExprToUIExpr(sExpr As String) As String
|
||||
If String.IsNullOrWhiteSpace(sExpr) Then
|
||||
Return ""
|
||||
End If
|
||||
|
||||
@@ -544,10 +544,19 @@ Friend Module VeinMatching
|
||||
' Sistemo il colore
|
||||
Dim colWhite As New Color3d(255, 255, 255, 100)
|
||||
EgtSetColor(nRegId, colWhite)
|
||||
|
||||
' Ripeto le stesse operazioni con il solido del pezzo, se esiste
|
||||
Dim nSolidId As Integer = GetVeinPartSolidId(nId)
|
||||
If nSolidId <> GDB_ID.NULL Then
|
||||
EgtSetTextureName(nSolidId, GetPhotoName())
|
||||
EgtSetTextureFrame(nSolidId, refTxr, GDB_RT.GLOB)
|
||||
EgtSetColor(nSolidId, colWhite)
|
||||
End If
|
||||
|
||||
' Se richiesto, eseguo deselezione
|
||||
If bDeselect Then EgtDeselectObj(nId)
|
||||
End If
|
||||
EgtDraw()
|
||||
End If
|
||||
EgtDraw()
|
||||
EgtSetCurrentContext(nMainCtx)
|
||||
Return True
|
||||
End Function
|
||||
@@ -567,12 +576,16 @@ Friend Module VeinMatching
|
||||
EgtSetCurrentContext(m_nVeinCtx)
|
||||
Dim nId = GetVeinPartId(nOriId)
|
||||
If nId <> GDB_ID.NULL Then
|
||||
' Recupero la regione del pezzo
|
||||
' Recupero la regione e il solido del pezzo
|
||||
Dim nRegId As Integer = GetVeinPartRegionId(nId)
|
||||
Dim nSolidId As Integer = GetVeinPartSolidId(nId)
|
||||
' Sistemo il riferimento della texture
|
||||
Dim refTxr As New Frame3d
|
||||
GetVeinRefPhoto(nMainCtx, nPartId, nId, refTxr)
|
||||
EgtSetTextureFrame(nRegId, refTxr, GDB_RT.GLOB)
|
||||
If nSolidId <> GDB_ID.NULL Then
|
||||
EgtSetTextureFrame(nSolidId, refTxr, GDB_RT.GLOB)
|
||||
End If
|
||||
End If
|
||||
EgtDraw()
|
||||
EgtSetCurrentContext(nMainCtx)
|
||||
@@ -601,6 +614,14 @@ Friend Module VeinMatching
|
||||
' Sistemo il colore
|
||||
Dim colAqua As New Color3d(0, 255, 255, 25)
|
||||
EgtSetColor(nRegId, colAqua)
|
||||
|
||||
' ripeto per il solido
|
||||
Dim nSolidId As Integer = GetVeinPartSolidId(nId)
|
||||
EgtRemoveTextureData(nSolidId)
|
||||
Dim colSolid As Color3d
|
||||
EgtGetColor(EgtGetParent(nRegId), colSolid)
|
||||
EgtSetColor(nSolidId, colSolid)
|
||||
|
||||
' Se richiesto, eseguo deselezione
|
||||
If bDeselect Then EgtDeselectObj(nId)
|
||||
End If
|
||||
@@ -685,6 +706,21 @@ Friend Module VeinMatching
|
||||
LinkReferencesOnAlette()
|
||||
|
||||
EgtSetCurrentContext(m_nVeinCtx)
|
||||
|
||||
' costruisco tutti i piani cucina
|
||||
Dim nId As Integer = EgtGetFirstPart()
|
||||
While nId <> GDB_ID.NULL
|
||||
Dim sInfoName As String = String.Empty
|
||||
EgtGetInfo(nId, "CMP", sInfoName)
|
||||
' verifico che il pezzo sia una piano cucina
|
||||
If sInfoName.Contains("PCucina") Then
|
||||
If Not CreateKitchenTop(nId, ThicknessRaw) Then Return False
|
||||
End If
|
||||
' altrimenti passo al pezzo successivo
|
||||
nId = EgtGetNextPart(nId)
|
||||
End While
|
||||
|
||||
' costruisco alzatine e frontalini
|
||||
Dim Item As Aletta
|
||||
For Each Item In m_ListAlzFront
|
||||
' verifico che il disegno 3D non sia già stato fatto
|
||||
@@ -693,16 +729,207 @@ Friend Module VeinMatching
|
||||
If nInfo3D <> 1 Then
|
||||
EgtSetInfo(Item.SideId, "Info3D", 1)
|
||||
' creo il solido
|
||||
If Not CreateSolid(Item, ThicknessRaw) Then Return False
|
||||
If Not CreateAlettaSolid(Item, ThicknessRaw) Then Return False
|
||||
' posiziono il solido
|
||||
If Not MoveSolid(Item, ThicknessRaw) Then Return False
|
||||
If Not MoveAlettaSolid(Item, ThicknessRaw) Then Return False
|
||||
End If
|
||||
Next
|
||||
Draw()
|
||||
Return True
|
||||
End Function
|
||||
|
||||
Friend Function CreateSolid(ByRef Item As Aletta, ByRef ThicknessRaw As Double) As Boolean
|
||||
Friend Function CreateKitchenTop(ByRef nId As Integer, ByRef ThicknessRaw As Double) As Boolean
|
||||
|
||||
' creo o svuoto layer per facce del solido
|
||||
Dim nSolidGrp As Integer = EgtGetFirstNameInGroup(nId, NAME_VM_SOLID)
|
||||
If nSolidGrp <> GDB_ID.NULL Then
|
||||
EgtEmptyGroup(nSolidGrp)
|
||||
Else
|
||||
nSolidGrp = EgtCreateGroup(nId)
|
||||
EgtSetName(nSolidGrp, NAME_VM_SOLID)
|
||||
End If
|
||||
|
||||
' recupero faccia top
|
||||
Dim nRegGrp As Integer = EgtGetFirstNameInGroup(nId, NAME_REGION)
|
||||
Dim nTopFr As Integer = EgtGetFirstInGroup(nRegGrp)
|
||||
While nTopFr <> GDB_ID.NULL
|
||||
If EgtGetType(nTopFr) = GDB_TY.SRF_FRGN Then Exit While
|
||||
nTopFr = EgtGetNext(nTopFr)
|
||||
End While
|
||||
If nTopFr = GDB_ID.NULL Then Return False
|
||||
EgtSetStatus(nTopFr, 0)
|
||||
|
||||
' setto colore per il solido
|
||||
Dim cCol As New Color3d
|
||||
EgtGetColor(nTopFr, cCol)
|
||||
EgtSetColor(nSolidGrp, cCol)
|
||||
|
||||
' creo il solido
|
||||
Dim bSameLoopsNbr As Boolean
|
||||
Dim nSolidId As Integer
|
||||
If Not CreateKitchenBaseSolid(nTopFr, nSolidGrp, ThicknessRaw, nSolidId, bSameLoopsNbr) Then Return False
|
||||
|
||||
' aggiungo componenti interni
|
||||
If Not AddInternalComponents(nSolidId, nTopFr, bSameLoopsNbr, ThicknessRaw) Then Return False
|
||||
|
||||
' setto eventuale texture
|
||||
Dim sTextName As String = String.Empty
|
||||
EgtGetTextureName(nTopFr, sTextName)
|
||||
If sTextName <> String.Empty Then
|
||||
Dim frText As New Frame3d
|
||||
EgtGetTextureFrame(nTopFr, nRegGrp, frText)
|
||||
EgtSetTextureName(nSolidId, sTextName)
|
||||
EgtSetTextureFrame(nSolidId, frText)
|
||||
End If
|
||||
|
||||
' elimino curve ausiliarie
|
||||
Dim nIdx As Integer = EgtGetFirstInGroup(nSolidGrp)
|
||||
While nIdx <> GDB_ID.NULL
|
||||
Dim newId As Integer = EgtGetNext(nIdx)
|
||||
If EgtGetType(nIdx) <> GDB_TY.SRF_MESH Then
|
||||
EgtErase(nIdx)
|
||||
End If
|
||||
nIdx = newId
|
||||
End While
|
||||
|
||||
Dim nOutloopGrpOrig As Integer = EgtGetFirstNameInGroup(nId, NAME_OUTLOOP & ".orig")
|
||||
If nOutloopGrpOrig <> GDB_ID.NULL Then
|
||||
EgtSetStatus(nOutloopGrpOrig, 1)
|
||||
Dim nOutloopGrp As Integer = EgtGetFirstNameInGroup(nId, NAME_OUTLOOP)
|
||||
EgtSetStatus(nOutloopGrp, 0)
|
||||
End If
|
||||
|
||||
Return True
|
||||
|
||||
End Function
|
||||
|
||||
Friend Function CreateKitchenBaseSolid(ByRef nTopFr As Integer, ByRef nSolidGrp As Integer, ByRef ThicknessRaw As Double,
|
||||
ByRef nSolidStm As Integer, ByRef bSameLoopsNbr As Boolean) As Boolean
|
||||
|
||||
' creo la faccia bottom
|
||||
Dim nBottomFr As Integer
|
||||
Dim nPartId As Integer = EgtGetParent(EgtGetParent(nTopFr))
|
||||
If Not EgtCalcFlatPartDownRegion(nPartId, ThicknessRaw) Then Return False
|
||||
Dim nDwnRegGrp As Integer = EgtGetFirstNameInGroup(nPartId, "DwnReg")
|
||||
If nDwnRegGrp <> GDB_ID.NULL Then
|
||||
EgtSetStatus(nDwnRegGrp, 0)
|
||||
nBottomFr = EgtGetFirstInGroup(nDwnRegGrp)
|
||||
If nBottomFr = GDB_ID.NULL Then Return False
|
||||
Else
|
||||
nBottomFr = EgtCopy(nTopFr, nSolidGrp)
|
||||
End If
|
||||
Dim vtMove As Vector3d = -ThicknessRaw * Vector3d.Z_AX()
|
||||
EgtMove(nBottomFr, vtMove)
|
||||
EgtSetStatus(nBottomFr, 0)
|
||||
|
||||
' superficie laterale
|
||||
Dim nTopCrvCount, nBottomCrvCount As Integer
|
||||
Dim nTopCrv, nBottomCrv As Integer
|
||||
nTopCrv = EgtExtractSurfFrChunkLoops(nTopFr, 0, nSolidGrp, nTopCrvCount)
|
||||
nBottomCrv = EgtExtractSurfFrChunkLoops(nBottomFr, 0, nSolidGrp, nBottomCrvCount)
|
||||
' modifico il punto iniziale della curva bottom per ottenere una buona superficie rigata
|
||||
Dim ptStartTop As Point3d
|
||||
EgtStartPoint(nTopCrv, ptStartTop)
|
||||
EgtChangeClosedCurveStartPoint(nBottomCrv, ptStartTop - vtMove)
|
||||
Dim nLateralStm As Integer = EgtCreateSurfTmRuled(nSolidGrp, nBottomCrv, nTopCrv, 0, EPS_STM)
|
||||
|
||||
' superfici trimesh per faccia top e bottom
|
||||
Dim nTopStm, nBottomStm As Integer
|
||||
bSameLoopsNbr = (nTopCrvCount = nBottomCrvCount)
|
||||
If bSameLoopsNbr Then
|
||||
If Not GetSrfTmFromFlatRegion(nTopFr, nSolidGrp, nTopStm) Then Return False
|
||||
If Not GetSrfTmFromFlatRegion(nBottomFr, nSolidGrp, nBottomStm) Then Return False
|
||||
Else
|
||||
' creo le facce top e bottom dimenticando eventuali aperture
|
||||
nTopStm = EgtCreateSurfTmByFlatContour(nSolidGrp, nTopCrv, EPS_STM)
|
||||
nBottomStm = EgtCreateSurfTmByFlatContour(nSolidGrp, nBottomCrv, EPS_STM)
|
||||
End If
|
||||
EgtInvertSurface(nBottomStm)
|
||||
|
||||
nSolidStm = EgtCreateSurfTmBySewing(nSolidGrp, 3, {nTopStm, nBottomStm, nLateralStm}, True)
|
||||
Return nSolidStm <> GDB_ID.NULL
|
||||
|
||||
End Function
|
||||
|
||||
Friend Function AddInternalComponents(ByRef nSolidStm As Integer, ByRef nTopFr As Integer, ByRef bSameLoopsNbr As Boolean,
|
||||
ByRef ThicknessRaw As Double) As Boolean
|
||||
|
||||
Dim nSolidGrp = EgtGetParent(nSolidStm)
|
||||
|
||||
' aperture interne
|
||||
Dim nTopCrvCount As Integer
|
||||
Dim nTopCrv As Integer = EgtExtractSurfFrChunkLoops(nTopFr, 0, nSolidGrp, nTopCrvCount)
|
||||
If bSameLoopsNbr Then
|
||||
Dim FacesStm(nTopCrvCount - 1) As Integer
|
||||
FacesStm(0) = nSolidStm
|
||||
' creo le superfici laterali definite dalle aperture
|
||||
For i As Integer = 1 To nTopCrvCount - 1
|
||||
FacesStm(i) = EgtCreateSurfTmByExtrusion(nSolidGrp, 1, {nTopCrv + i}, -ThicknessRaw * Vector3d.Z_AX(), EPS_STM)
|
||||
EgtInvertSurface(FacesStm(i))
|
||||
Next
|
||||
nSolidStm = EgtCreateSurfTmBySewing(nSolidGrp, nTopCrvCount, FacesStm, True)
|
||||
Else
|
||||
' creo le aperture per sottrazione di solidi
|
||||
For i As Integer = 1 To nTopCrvCount - 1
|
||||
Dim nComponentSrf As Integer = EgtCreateSurfTmByRegionExtrusion(nSolidGrp, 1, {nTopCrv + i}, -(ThicknessRaw + 10) * Vector3d.Z_AX(), EPS_STM)
|
||||
EgtSurfTmSubtract(nSolidStm, nComponentSrf)
|
||||
EgtErase(nComponentSrf)
|
||||
Next
|
||||
End If
|
||||
|
||||
' ribassi
|
||||
Dim nId As Integer = EgtGetFirstGroupInGroup(EgtGetParent(nSolidGrp))
|
||||
While nId <> GDB_ID.NULL
|
||||
Dim sName As String = ""
|
||||
EgtGetName(nId, sName)
|
||||
If sName <> "Pocket" Then
|
||||
nId = EgtGetNextGroup(nId)
|
||||
Continue While
|
||||
End If
|
||||
' cerco curva composita che definisce il ribasso
|
||||
Dim nCrvCompoId As Integer = EgtGetFirstInGroup(nId)
|
||||
While nCrvCompoId <> GDB_ID.NULL
|
||||
If EgtGetType(nCrvCompoId) = GDB_TY.CRV_COMPO Then Exit While
|
||||
nCrvCompoId = EgtGetNext(nCrvCompoId)
|
||||
End While
|
||||
|
||||
Dim dThick As Double
|
||||
EgtCurveThickness(nCrvCompoId, dThick)
|
||||
Dim vtExtr As Vector3d
|
||||
EgtCurveExtrusion(nCrvCompoId, vtExtr)
|
||||
Dim nRecessSrf As Integer = EgtCreateSurfTmByRegionExtrusion(nId, 1, {nCrvCompoId}, (dThick + 100) * vtExtr, EPS_STM)
|
||||
EgtSurfTmSubtract(nSolidStm, nRecessSrf)
|
||||
EgtErase(nRecessSrf)
|
||||
|
||||
' Passo al pezzo successivo
|
||||
nId = EgtGetNextGroup(nId)
|
||||
End While
|
||||
|
||||
Return True
|
||||
End Function
|
||||
Friend Function GetSrfTmFromFlatRegion(ByRef nFlatRegion As Integer, ByRef nSolidGrp As Integer, ByRef nSrfTmId As Integer) As Boolean
|
||||
|
||||
If nFlatRegion = GDB_ID.NULL Then Return False
|
||||
' curve che delimitano la superficie
|
||||
Dim nCrvCount As Integer
|
||||
Dim nCrv As Integer = EgtExtractSurfFrChunkLoops(nFlatRegion, 0, nSolidGrp, nCrvCount)
|
||||
If nCrv = GDB_ID.NULL Then Return False
|
||||
' creo array con gli indici delle curve
|
||||
Dim CrvList(nCrvCount - 1) As Integer
|
||||
For i As Integer = 0 To nCrvCount - 1
|
||||
CrvList(i) = nCrv + i
|
||||
Next
|
||||
nSrfTmId = EgtCreateSurfTmByRegion(nSolidGrp, CrvList, EPS_STM)
|
||||
' cancello le curve create
|
||||
For i As Integer = 0 To nCrvCount - 1
|
||||
EgtErase(CrvList(i))
|
||||
Next
|
||||
|
||||
Return nSrfTmId <> GDB_ID.NULL
|
||||
|
||||
End Function
|
||||
|
||||
Friend Function CreateAlettaSolid(ByRef Item As Aletta, ByRef ThicknessRaw As Double) As Boolean
|
||||
|
||||
' angoli per i tagli
|
||||
Dim dAngL, dAngR, dAng As Double
|
||||
@@ -739,33 +966,60 @@ Friend Module VeinMatching
|
||||
Dim ptB4 As Point3d = pt4 + HeightTop * Vector3d.Y_AX()
|
||||
|
||||
' Creo o svuoto layer per facce del solido
|
||||
Dim nSolidGrp As Integer = EgtGetFirstNameInGroup( Item.PartId, NAME_VM_SOLID)
|
||||
Dim nSolidGrp As Integer = EgtGetFirstNameInGroup(Item.PartId, NAME_VM_SOLID)
|
||||
If nSolidGrp <> GDB_ID.NULL Then
|
||||
EgtEmptyGroup( nSolidGrp)
|
||||
EgtEmptyGroup(nSolidGrp)
|
||||
Else
|
||||
nSolidGrp = EgtCreateGroup( Item.PartId)
|
||||
EgtSetName( nSolidGrp, NAME_VM_SOLID)
|
||||
nSolidGrp = EgtCreateGroup(Item.PartId)
|
||||
EgtSetName(nSolidGrp, NAME_VM_SOLID)
|
||||
End If
|
||||
Dim nRegionGrp As Integer = EgtGetFirstNameInGroup( Item.PartId, NAME_REGION)
|
||||
Dim nRegionGrp As Integer = EgtGetFirstNameInGroup(Item.PartId, NAME_REGION)
|
||||
Dim cCol As New Color3d
|
||||
EgtGetColor(EgtGetFirstInGroup(nRegionGrp), cCol)
|
||||
EgtSetColor(nSolidGrp, cCol)
|
||||
|
||||
' Top Face
|
||||
Dim nTopSrfFR As Integer = EgtGetFirstInGroup(nRegionGrp)
|
||||
Dim tmp As Integer
|
||||
Dim nTopCrv As Integer = EgtExtractSurfFrChunkLoops(nTopSrfFR, 0, nRegionGrp, tmp)
|
||||
If nTopCrv = GDB_ID.NULL Then Return False
|
||||
Dim nTopSrf As Integer = EgtCreateSurfTmByRegion(nSolidGrp, {nTopCrv}, EPS_SMALL)
|
||||
EgtErase(nTopCrv)
|
||||
EgtSetStatus(nTopSrfFR, 0)
|
||||
|
||||
Dim nFrontSrf, nBackSrf, nBottomSrf, nRightSrf, nLeftSrf As Integer
|
||||
' Front Face
|
||||
If Not CreateSolidFace(nSolidGrp, {pt1, pt2, pt3, pt4}) Then Return False
|
||||
If Not CreateSolidFace(nSolidGrp, {pt1, pt2, pt3, pt4}, nFrontSrf, False) Then Return False
|
||||
' Back Face
|
||||
If Not CreateSolidFace(nSolidGrp, {ptB1, ptB4, ptB3, ptB2}) Then Return False
|
||||
If Not CreateSolidFace(nSolidGrp, {ptB1, ptB4, ptB3, ptB2}, nBackSrf) Then Return False
|
||||
' Bottom face
|
||||
If Not CreateSolidFace(nSolidGrp, {pt2, pt1, ptB1, ptB2}) Then Return False
|
||||
If Not CreateSolidFace(nSolidGrp, {pt2, pt1, ptB1, ptB2}, nBottomSrf) Then Return False
|
||||
' Right face
|
||||
If Not CreateSolidFace(nSolidGrp, {ptB1, pt1, pt4, ptB4}) Then Return False
|
||||
If Not CreateSolidFace(nSolidGrp, {ptB1, pt1, pt4, ptB4}, nRightSrf) Then Return False
|
||||
' Left face
|
||||
If Not CreateSolidFace(nSolidGrp, {ptB2, ptB3, pt3, pt2}) Then Return False
|
||||
If Not CreateSolidFace(nSolidGrp, {ptB2, ptB3, pt3, pt2}, nLeftSrf) Then Return False
|
||||
|
||||
' creo il solido
|
||||
Dim nSolidSrf As Integer = EgtCreateSurfTmBySewing(nSolidGrp, 6, {nTopSrf, nFrontSrf, nBackSrf, nBottomSrf, nRightSrf, nLeftSrf}, True)
|
||||
|
||||
' setto eventuale texture
|
||||
Dim sTextName As String = String.Empty
|
||||
EgtGetTextureName(nTopSrfFR, sTextName)
|
||||
If sTextName <> String.Empty Then
|
||||
Dim frText As New Frame3d
|
||||
EgtGetTextureFrame(nTopSrfFR, nRegionGrp, frText)
|
||||
EgtSetTextureName(nSolidSrf, sTextName)
|
||||
EgtSetTextureFrame(nSolidSrf, frText)
|
||||
End If
|
||||
|
||||
Dim nOutloopGrp As Integer = EgtGetParent(Item.SideId)
|
||||
EgtSetStatus(nOutloopGrp, 0)
|
||||
|
||||
Return True
|
||||
End Function
|
||||
|
||||
Friend Function CreateSolidFace(ByRef nSrfGrp As Integer, ByRef Points As Point3d()) As Boolean
|
||||
Friend Function CreateSolidFace(ByRef nSrfGrp As Integer, ByRef Points As Point3d(), ByRef nSrfId As Integer,
|
||||
Optional ByRef bDeleteCrv As Boolean = True) As Boolean
|
||||
|
||||
If Points.Count() <> 4 Then Return False
|
||||
|
||||
@@ -775,13 +1029,16 @@ Friend Module VeinMatching
|
||||
EgtCreateLine(nSrfGrp, Points(3), Points(0))}, True)
|
||||
|
||||
If nCrvId = GDB_ID.NULL Then Return False
|
||||
EgtSetStatus(nCrvId, GDB_ST.OFF)
|
||||
|
||||
Dim nSrfId As Integer = EgtCreateSurfFlatRegion(nSrfGrp, nCrvId)
|
||||
nSrfId = EgtCreateSurfTmByRegion(nSrfGrp, {nCrvId}, EPS_SMALL)
|
||||
If bDeleteCrv Then
|
||||
EgtErase(nCrvId)
|
||||
Else
|
||||
EgtSetStatus(nCrvId, GDB_ST.OFF)
|
||||
End If
|
||||
Return nSrfId <> GDB_ID.NULL
|
||||
End Function
|
||||
|
||||
Friend Function MoveSolid(ByRef Item As Aletta, ByRef ThicknessRaw As Double) As Boolean
|
||||
Friend Function MoveAlettaSolid(ByRef Item As Aletta, ByRef ThicknessRaw As Double) As Boolean
|
||||
|
||||
Dim nType As Integer
|
||||
If Not EgtGetInfo(Item.IdSideRef, "AF", nType) Then Return False
|
||||
@@ -1039,6 +1296,27 @@ Friend Module VeinMatching
|
||||
Return nRegId
|
||||
End Function
|
||||
|
||||
Private Function GetVeinPartSolidId(nVeinPartId As Integer) As Integer
|
||||
' Imposto VeinMatching context
|
||||
Dim nCurrCtx = SetVeinContext()
|
||||
If nCurrCtx = 0 Then Return GDB_ID.NULL
|
||||
' Gruppo regione
|
||||
Dim nRegLayId As Integer = EgtGetFirstNameInGroup(nVeinPartId, NAME_VM_SOLID)
|
||||
' Entità superficie regione piatta
|
||||
Dim nRegId As Integer = EgtGetFirstInGroup(nRegLayId)
|
||||
While nRegId <> GDB_ID.NULL
|
||||
If EgtGetType(nRegId) = GDB_TY.SRF_MESH Then
|
||||
Exit While
|
||||
End If
|
||||
nRegId = EgtGetNext(nRegId)
|
||||
End While
|
||||
' Se necessario, ripristino il contesto originale
|
||||
If nCurrCtx > 0 Then EgtSetCurrentContext(nCurrCtx)
|
||||
Return nRegId
|
||||
End Function
|
||||
|
||||
|
||||
|
||||
End Module
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user