OmagOffice 2.1e4 :
- gestione ventose con rotazione a step come in OmagCUT - gestione angoli di lato e talloni da colori di DXF come in OmagCUT - gestione flag tastatura su tagli con angoli di fianco come in OmagCUT - impostata a Hidden regione di Kerf per Vacuum come in OmagCUT.
This commit is contained in:
@@ -942,6 +942,49 @@ Public Class SideEntityControlVM
|
||||
Return True
|
||||
End Function
|
||||
|
||||
Shared Sub ColorToSideAngle(nCtx As Integer)
|
||||
' Leggo dati corrispondenza colore-angolo
|
||||
Dim CurrCSA As New ColorSideAngs
|
||||
CurrCSA.Read( IniFile.m_sIniFile)
|
||||
' 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
|
||||
Dim LoopId As Integer = EgtGetFirstNameInGroup(PartId, NAME_OUTLOOP)
|
||||
While LoopId <> GDB_ID.NULL
|
||||
' Ciclo sulle curve
|
||||
Dim EntId As Integer = EgtGetFirstInGroup( LoopId)
|
||||
While EntId <> GDB_ID.NULL
|
||||
If EgtGetType(EntId) = GDB_TY.CRV_LINE Then
|
||||
Dim colEnt As Color3d
|
||||
If EgtGetColor( EntId, colEnt) Then
|
||||
Dim dAng As Double
|
||||
Dim dHeel As Double
|
||||
If CurrCSA.GetSideAngHeel( colEnt, dAng, dHeel) Then
|
||||
EgtSetInfo( EntId, INFO_SIDE_ANGLE, dAng)
|
||||
EgtSetInfo( EntId, INFO_ORIG_SIDE_ANGLE, dAng)
|
||||
EgtSetInfo( EntId, INFO_HEEL, dHeel)
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
EntId = EgtGetNext( EntId)
|
||||
End While
|
||||
If bOutLoop then
|
||||
bOutLoop = False
|
||||
LoopId = EgtGetFirstNameInGroup(PartId, NAME_INLOOP)
|
||||
Else
|
||||
LoopId = EgtGetNextName(LoopId, NAME_INLOOP)
|
||||
End If
|
||||
End While
|
||||
PartId = EgtGetNextPart(PartId)
|
||||
End While
|
||||
' Aggiorno scritte per angoli sui lati
|
||||
WriteSideAngleForNest(nCtx)
|
||||
End Sub
|
||||
|
||||
#End Region ' METHODS
|
||||
|
||||
End Class
|
||||
@@ -1199,4 +1242,60 @@ Friend Class DripEntity
|
||||
Return Nothing
|
||||
End Function
|
||||
|
||||
End Class
|
||||
End Class
|
||||
|
||||
Friend Class ColorSideAngs
|
||||
Class CTSA
|
||||
Friend m_R As Integer
|
||||
Friend m_G As Integer
|
||||
Friend m_B As Integer
|
||||
Friend m_dAng As Double
|
||||
Friend m_dHeel As Double
|
||||
End Class
|
||||
Private m_ListCtsa As New List(Of CTSA)
|
||||
Private m_nTol As Integer = 10
|
||||
|
||||
Friend Function Read( sIniFile As String) As Boolean
|
||||
' Lettura parametri di conversione
|
||||
Dim nIndex As Integer = 1
|
||||
Dim OneCtsa As CTSA = GetPrivateProfileColorSideAng( S_COLORTOSIDEANG, K_CTSA & nIndex, sIniFile)
|
||||
While Not IsNothing(OneCtsa)
|
||||
m_ListCtsa.Add(OneCtsa)
|
||||
nIndex += 1
|
||||
OneCtsa = GetPrivateProfileColorSideAng( S_COLORTOSIDEANG, K_CTSA & nIndex, sIniFile)
|
||||
End While
|
||||
' Lettura tolleranza
|
||||
m_nTol = GetPrivateProfileInt( S_COLORTOSIDEANG, K_CTSA_TOLERANCE, 10, sIniFile)
|
||||
Return True
|
||||
End Function
|
||||
|
||||
Private Function GetPrivateProfileColorSideAng( sSect As String, sKey As String, sIniFile As String) As CTSA
|
||||
Dim OneCtsa As New CTSA
|
||||
Dim sVal As String = String.Empty
|
||||
GetPrivateProfileString(sSect, sKey, "", sVal, sIniFile)
|
||||
Dim sItems() As String = sVal.Split(",".ToCharArray)
|
||||
If sItems.Count() = 5 Then
|
||||
StringToInt( sItems(0), OneCtsa.m_R)
|
||||
StringToInt( sItems(1), OneCtsa.m_G)
|
||||
StringToInt( sItems(2), OneCtsa.m_B)
|
||||
StringToDouble( sItems(3), OneCtsa.m_dAng)
|
||||
StringToDouble( sItems(4), OneCtsa.m_dHeel)
|
||||
Return OneCtsa
|
||||
End If
|
||||
Return Nothing
|
||||
End Function
|
||||
|
||||
Friend Function GetSideAngHeel( cCol As Color3d, ByRef dAng As Double, ByRef dHeel As Double) As Boolean
|
||||
For Each Ctsa In m_ListCtsa
|
||||
If Math.Abs( cCol.R - Ctsa.m_R) < m_nTol And
|
||||
Math.Abs( cCol.G - Ctsa.m_G) < m_nTol And
|
||||
Math.Abs( cCol.B - Ctsa.m_B) < m_nTol Then
|
||||
dAng = Ctsa.m_dAng
|
||||
dHeel = Ctsa.m_dHeel
|
||||
Return True
|
||||
End If
|
||||
Next
|
||||
Return False
|
||||
End Function
|
||||
|
||||
End Class
|
||||
|
||||
Reference in New Issue
Block a user