OmagOFFICE 2.3b2:
-> salvataggio parametri Step e AngStep pagina OptionPanel/Nesting. -> Aggiunto tabella Engrave da colore in OptionPage
This commit is contained in:
@@ -1138,7 +1138,7 @@ Public Class SideEntityControlVM
|
||||
Shared Sub ColorToSideAngle(nCtx As Integer)
|
||||
' Leggo dati corrispondenza colore-angolo
|
||||
Dim CurrCSA As New ColorSideAngs
|
||||
CurrCSA.Read( IniFile.m_sIniFile)
|
||||
CurrCSA.Read(IniFile.m_sIniFile)
|
||||
' Imposto contesto corrente
|
||||
EgtSetCurrentContext(nCtx)
|
||||
' Ciclo sui pezzi
|
||||
@@ -1149,11 +1149,11 @@ Public Class SideEntityControlVM
|
||||
Dim LoopId As Integer = EgtGetFirstNameInGroup(PartId, NAME_OUTLOOP)
|
||||
While LoopId <> GDB_ID.NULL
|
||||
' Ciclo sulle curve
|
||||
Dim PrevId As Integer = EgtGetLastInGroup( LoopId)
|
||||
Dim EntId As Integer = EgtGetFirstInGroup( LoopId)
|
||||
Dim PrevId As Integer = EgtGetLastInGroup(LoopId)
|
||||
Dim EntId As Integer = EgtGetFirstInGroup(LoopId)
|
||||
While EntId <> GDB_ID.NULL
|
||||
Dim NextId As Integer = EgtGetNext( EntId)
|
||||
If NextId = GDB_ID.NULL Then NextId = EgtGetFirstInGroup( LoopId)
|
||||
Dim NextId As Integer = EgtGetNext(EntId)
|
||||
If NextId = GDB_ID.NULL Then NextId = EgtGetFirstInGroup(LoopId)
|
||||
If VerifySideAnglePossible(PrevId, EntId, NextId, bOutLoop) Then
|
||||
Dim colEnt As Color3d
|
||||
If EgtGetColor(EntId, colEnt) Then
|
||||
@@ -1167,9 +1167,9 @@ Public Class SideEntityControlVM
|
||||
End If
|
||||
End If
|
||||
PrevId = EntId
|
||||
EntId = EgtGetNext( EntId)
|
||||
EntId = EgtGetNext(EntId)
|
||||
End While
|
||||
If bOutLoop then
|
||||
If bOutLoop Then
|
||||
bOutLoop = False
|
||||
LoopId = EgtGetFirstNameInGroup(PartId, NAME_INLOOP)
|
||||
Else
|
||||
@@ -1182,6 +1182,37 @@ Public Class SideEntityControlVM
|
||||
WriteSideAngleForNest(nCtx)
|
||||
End Sub
|
||||
|
||||
Shared Sub ColorToEngrave(nCtx As Integer)
|
||||
' Leggo dati corrispondenza colore-angolo
|
||||
Dim CurrCE As New ColorEngrave
|
||||
CurrCE.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 Engraving
|
||||
Dim LayerId As Integer = EgtGetFirstNameInGroup(PartId, NAME_ONPATH)
|
||||
While LayerId <> GDB_ID.NULL
|
||||
' Ciclo sulle curve
|
||||
Dim EntId As Integer = EgtGetFirstInGroup(LayerId)
|
||||
While EntId <> GDB_ID.NULL
|
||||
Dim colEnt As Color3d
|
||||
If EgtGetColor(EntId, colEnt) Then
|
||||
Dim dAff, dLar As Double
|
||||
If CurrCE.GetEngraveAff(colEnt, dAff, dLar) Then
|
||||
EgtSetInfo(EntId, INFO_DEPTH, dAff)
|
||||
EgtSetInfo(EntId, INFO_WIDTH, dLar)
|
||||
End If
|
||||
End If
|
||||
EntId = EgtGetNext(EntId)
|
||||
End While
|
||||
LayerId = EgtGetNextLayer(LayerId)
|
||||
End While
|
||||
PartId = EgtGetNextPart(PartId)
|
||||
End While
|
||||
End Sub
|
||||
|
||||
#End Region ' METHODS
|
||||
|
||||
End Class
|
||||
@@ -1557,3 +1588,62 @@ Friend Class ColorSideAngs
|
||||
End Function
|
||||
|
||||
End Class
|
||||
|
||||
Friend Class ColorEngrave
|
||||
Class CTE
|
||||
Friend m_bOk As Boolean
|
||||
Friend m_R As Integer
|
||||
Friend m_G As Integer
|
||||
Friend m_B As Integer
|
||||
Friend m_dAff As Double
|
||||
Friend m_dLar As Double
|
||||
End Class
|
||||
Private m_ListCte As New List(Of CTE)
|
||||
Private m_nTol As Integer = 10
|
||||
|
||||
Friend Function Read(sIniFile As String) As Boolean
|
||||
' Lettura parametri di conversione
|
||||
Dim nIndex As Integer = 1
|
||||
Dim OneCte As CTE = GetPrivateProfileColorEngrave(S_COLORTOENGRAVE, K_CTE & nIndex, sIniFile)
|
||||
While Not IsNothing(OneCte)
|
||||
m_ListCte.Add(OneCte)
|
||||
nIndex += 1
|
||||
OneCte = GetPrivateProfileColorEngrave(S_COLORTOENGRAVE, K_CTE & nIndex, sIniFile)
|
||||
End While
|
||||
' Lettura tolleranza
|
||||
m_nTol = GetPrivateProfileInt(S_COLORTOENGRAVE, K_CTE_TOLERANCE, 10, sIniFile)
|
||||
Return True
|
||||
End Function
|
||||
|
||||
Private Function GetPrivateProfileColorEngrave(sSect As String, sKey As String, sIniFile As String) As CTE
|
||||
Dim OneCte As New CTE
|
||||
Dim sVal As String = String.Empty
|
||||
GetPrivateProfileString(sSect, sKey, "", sVal, sIniFile)
|
||||
Dim sItems() As String = sVal.Split(",".ToCharArray)
|
||||
OneCte.m_bOk = If(sItems.Count() = 6, (sItems(5).Trim() <> "0"), True)
|
||||
If sItems.Count() >= 5 Then
|
||||
StringToInt(sItems(0), OneCte.m_R)
|
||||
StringToInt(sItems(1), OneCte.m_G)
|
||||
StringToInt(sItems(2), OneCte.m_B)
|
||||
StringToDouble(sItems(3), OneCte.m_dAff)
|
||||
StringToDouble(sItems(4), OneCte.m_dLar)
|
||||
Return OneCte
|
||||
End If
|
||||
Return Nothing
|
||||
End Function
|
||||
|
||||
Friend Function GetEngraveAff(cCol As Color3d, ByRef dAff As Double, ByRef dLar As Double) As Boolean
|
||||
For Each Ctsa In m_ListCte
|
||||
If Ctsa.m_bOk And
|
||||
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
|
||||
dAff = Ctsa.m_dAff
|
||||
dLar = Ctsa.m_dLar
|
||||
Return True
|
||||
End If
|
||||
Next
|
||||
Return False
|
||||
End Function
|
||||
|
||||
End Class
|
||||
Reference in New Issue
Block a user