OmagOFFICE 1.9k1 :
- aggiunta gestione angoli di fianco con tallone (bisello) - ora angolo verso esterno mantiene dimensione totale del pezzo - gestione ventose con asse rotante a step (STEPS=Val1,Val2,... in GEO di asse) - aggiunta gestione accorciamento fresate negli angoli - sistemazione dati TRF da compo e aggiunta codice pezzo - in DB utensili con nuova lama creazione/aggiornamento note speciali Hofmann - abilitazione bottoni UnderCut e DripDrill sempre da chiave - aggiunto secondo offset nei tagli da sotto - modifiche a componenti per import DXF e nome su linea separata - dati TRF non più richiesti per default sui componenti
This commit is contained in:
@@ -84,7 +84,7 @@ Public Class SideEntityControlVM
|
||||
RefreshSideAngleText()
|
||||
Else
|
||||
' Recupero il valore
|
||||
StringToDouble(value, m_dDripOffset)
|
||||
StringToLen(value, m_dDripOffset)
|
||||
' Creo le geometrie dei gocciolatoi
|
||||
RefreshSideAngleText()
|
||||
End If
|
||||
@@ -102,7 +102,12 @@ Public Class SideEntityControlVM
|
||||
Return LenToString(m_Parameter2, -2)
|
||||
End Get
|
||||
Set(value As String)
|
||||
StringToLen(value, m_Parameter2)
|
||||
If m_Mode = ModeOpt.DRIP Then
|
||||
StringToLen(value, m_Parameter2)
|
||||
m_dDripOffset2 = m_Parameter2
|
||||
' Creo le geometrie dei gocciolatoi
|
||||
RefreshSideAngleText()
|
||||
End If
|
||||
End Set
|
||||
End Property
|
||||
Private Sub SetParameter2(value As Double)
|
||||
@@ -116,7 +121,12 @@ Public Class SideEntityControlVM
|
||||
Return LenToString(m_Parameter3, -2)
|
||||
End Get
|
||||
Set(value As String)
|
||||
StringToLen(value, m_Parameter3)
|
||||
If m_Mode = ModeOpt.DRIP Then
|
||||
StringToLen(value, m_Parameter3)
|
||||
m_dDripDepth = m_Parameter3
|
||||
' Creo le geometrie dei gocciolatoi
|
||||
RefreshSideAngleText()
|
||||
End If
|
||||
End Set
|
||||
End Property
|
||||
Private Sub SetParameter3(value As Double)
|
||||
@@ -124,7 +134,27 @@ Public Class SideEntityControlVM
|
||||
NotifyPropertyChanged("Parameter3")
|
||||
End Sub
|
||||
|
||||
Private m_Parameter4 As Double
|
||||
Public Property Parameter4 As String
|
||||
Get
|
||||
Return LenToString(m_Parameter4, -2)
|
||||
End Get
|
||||
Set(value As String)
|
||||
If m_Mode = ModeOpt.DRIP Then
|
||||
StringToLen(value, m_Parameter4)
|
||||
m_dDripShort = m_Parameter4
|
||||
' Creo le geometrie dei gocciolatoi
|
||||
RefreshSideAngleText()
|
||||
End If
|
||||
End Set
|
||||
End Property
|
||||
Private Sub SetParameter4(value As Double)
|
||||
m_Parameter4 = value
|
||||
NotifyPropertyChanged("Parameter4")
|
||||
End Sub
|
||||
|
||||
Private m_dDripOffset As Double = 10
|
||||
Private m_dDripOffset2 As Double = 0
|
||||
Private m_dDripDepth As Double = 10
|
||||
Private m_dDripShort As Double = 0
|
||||
|
||||
@@ -145,10 +175,15 @@ Public Class SideEntityControlVM
|
||||
End Property
|
||||
Public ReadOnly Property Parameter2Msg As String
|
||||
Get
|
||||
Return EgtMsg(MSG_IMPORTPAGEUC + 11) ' Affondamento
|
||||
Return EgtMsg(MSG_IMPORTPAGEUC + 16) ' Offset 2
|
||||
End Get
|
||||
End Property
|
||||
Public ReadOnly Property Parameter3Msg As String
|
||||
Get
|
||||
Return EgtMsg(MSG_IMPORTPAGEUC + 11) ' Affondamento
|
||||
End Get
|
||||
End Property
|
||||
Public ReadOnly Property Parameter4Msg As String
|
||||
Get
|
||||
Return EgtMsg(MSG_IMPORTPAGEUC + 12) ' Accorciamento
|
||||
End Get
|
||||
@@ -161,6 +196,7 @@ Public Class SideEntityControlVM
|
||||
Sub New(CallingWindow As CallingWindowOpt, CallingWndScene As Scene, Mode As ModeOpt)
|
||||
|
||||
SideAngleEntity.m_ModifySideAngle = AddressOf ModifySideAngle
|
||||
SideAngleEntity.m_ModifySideHeel = AddressOf ModifySideHeel
|
||||
SideAngleEntity.m_RefreshSideAngleText = AddressOf RefreshSideAngleText
|
||||
DripEntity.m_ModifyDrip = AddressOf ModifyDrip
|
||||
DripEntity.m_RefreshSideAngleText = AddressOf RefreshSideAngleText
|
||||
@@ -202,11 +238,13 @@ Public Class SideEntityControlVM
|
||||
Else
|
||||
Parameter1Msg = EgtMsg(MSG_IMPORTPAGEUC + 10) ' Offset
|
||||
m_dDripOffset = GetMainPrivateProfileDouble(S_SIDES, K_DRIPOFFSET, 20)
|
||||
m_dDripOffset2 = GetMainPrivateProfileDouble(S_SIDES, K_DRIPOFFSET2, 0)
|
||||
m_dDripDepth = GetMainPrivateProfileDouble(S_SIDES, K_DRIPDEPTH, 10)
|
||||
m_dDripShort = GetMainPrivateProfileDouble(S_SIDES, K_DRIPSHORT, 0)
|
||||
SetParameter1(m_dDripOffset)
|
||||
SetParameter2(m_dDripDepth)
|
||||
SetParameter3(m_dDripShort)
|
||||
SetParameter2(m_dDripOffset2)
|
||||
SetParameter3(m_dDripDepth)
|
||||
SetParameter4(m_dDripShort)
|
||||
End If
|
||||
|
||||
' Aggiorno visualizzazione
|
||||
@@ -257,7 +295,9 @@ Public Class SideEntityControlVM
|
||||
If m_Mode = ModeOpt.SIDEANGLE Then
|
||||
' Per ogni entità, creo testo con nome e angolo di inclinazione
|
||||
For Each Entity In m_SideEntityList
|
||||
Dim sText As String = Entity.sEntityName & " = " & DoubleToString(DirectCast(Entity, SideAngleEntity).dSideAngle, 1) & "°"
|
||||
Dim SideEntity As SideAngleEntity = TryCast(Entity, SideAngleEntity)
|
||||
Dim sText As String = Entity.sEntityName & " = " & DoubleToString(SideEntity.dSideAngle, 1) & "°"
|
||||
If SideEntity.dSideHeel > 10 * EPS_SMALL Then sText += "; " & LenToString(SideEntity.dSideHeel, 1)
|
||||
AddTextToLine(sText, Entity.nTextId, Entity.nGeomId, 20, dBBoxRad, True)
|
||||
Next
|
||||
' Altrimenti modalità gocciolatoio
|
||||
@@ -462,12 +502,17 @@ Public Class SideEntityControlVM
|
||||
' Ricavo angolo dell'entità
|
||||
Dim dSideAngleVal As Double
|
||||
If Not EgtGetInfo(CurrLine, INFO_SIDE_ANGLE, dSideAngleVal) Then dSideAngleVal = 0
|
||||
' Ricavo tallone dell'entità
|
||||
Dim dSideHeelVal As Double
|
||||
If Not EgtGetInfo(CurrLine, INFO_HEEL, dSideHeelVal) Then dSideHeelVal = 0
|
||||
' Aggiungo entità all'elenco di quelle inclinabili
|
||||
Dim sEntityName As String = String.Empty
|
||||
EgtGetName(CurrLine, sEntityName)
|
||||
m_SideEntityList.Add(New SideAngleEntity(CurrLine, sEntityName, TextLayer, dSideAngleVal, m_Mode))
|
||||
' Creo testo con angolo di inclinazione 0
|
||||
AddTextToLine(sEntityName & " = " & DoubleToString(dSideAngleVal, 1) & "°", TextLayer, CurrLine, 20, dBBoxRad, True)
|
||||
m_SideEntityList.Add(New SideAngleEntity(CurrLine, sEntityName, TextLayer, dSideAngleVal, dSideHeelVal, m_Mode))
|
||||
' Creo testo con angolo di inclinazione ed eventuale tallone
|
||||
Dim sText As String = sEntityName & " = " & DoubleToString(dSideAngleVal, 1) & "°"
|
||||
If dSideHeelVal > 10 * EPS_SMALL Then sText += "; " & LenToString(dSideHeelVal, 1)
|
||||
AddTextToLine(sText, TextLayer, CurrLine, 20, dBBoxRad, True)
|
||||
End Sub
|
||||
|
||||
' Funzione che gestisce le operazioni sull'entità con gocciolatoio
|
||||
@@ -590,23 +635,60 @@ Public Class SideEntityControlVM
|
||||
vSelId.Add(nNewId)
|
||||
End If
|
||||
Next
|
||||
' Concateno le curve
|
||||
EgtCreateCurveCompoByReorder(DripLayer, vSelId.Count(), vSelId.ToArray(), New Point3d(), True)
|
||||
' Eseguo offset dei risultati ed eventuali accorciamenti iniziali e finali
|
||||
' Eseguo eventuali allungamenti iniziali e finali
|
||||
Dim nCrvId As Integer = EgtGetFirstInGroup(DripLayer)
|
||||
While nCrvId <> GDB_ID.NULL
|
||||
EgtOffsetCurve(nCrvId, -m_dDripOffset, OFF_TYPE.EXTEND)
|
||||
EgtSetColor(nCrvId, New Color3d(255, 165, 0))
|
||||
EgtSetInfo(nCrvId, INFO_DEPTH, m_dDripDepth)
|
||||
If m_dDripShort > EPS_SMALL Then
|
||||
If m_dDripShort < -EPS_SMALL Then
|
||||
EgtExtendCurveStartByLen(nCrvId, -m_dDripShort)
|
||||
EgtExtendCurveEndByLen(nCrvId, -m_dDripShort)
|
||||
End If
|
||||
nCrvId = EgtGetNext(nCrvId)
|
||||
End While
|
||||
' Concateno le curve
|
||||
EgtCreateCurveCompoByReorder(DripLayer, vSelId.Count(), vSelId.ToArray(), New Point3d(), True)
|
||||
' Eseguo eventuali accorciamenti iniziali e finali
|
||||
nCrvId = EgtGetFirstInGroup(DripLayer)
|
||||
While nCrvId <> GDB_ID.NULL
|
||||
If m_dDripShort > EPS_SMALL AndAlso Not EgtCurveIsClosed(nCrvId) Then
|
||||
Dim dLen As Double
|
||||
EgtCurveLength(nCrvId, dLen)
|
||||
EgtTrimCurveEndAtLen(nCrvId, dLen - m_dDripShort)
|
||||
EgtTrimCurveStartAtLen(nCrvId, m_dDripShort)
|
||||
EgtSetInfo(nCrvId, INFO_STRICT, "1")
|
||||
End If
|
||||
nCrvId = EgtGetNext(nCrvId)
|
||||
End While
|
||||
' Eseguo offset dei risultati
|
||||
nCrvId = EgtGetFirstInGroup(DripLayer)
|
||||
While nCrvId <> GDB_ID.NULL
|
||||
EgtOffsetCurve(nCrvId, -m_dDripOffset, OFF_TYPE.EXTEND)
|
||||
nCrvId = EgtGetNext(nCrvId)
|
||||
End While
|
||||
' Eventuali curve aggiuntive con offset2
|
||||
If m_dDripOffset2 > EPS_SMALL Then
|
||||
nCrvId = EgtGetFirstInGroup(DripLayer)
|
||||
While nCrvId <> GDB_ID.NULL
|
||||
Dim nNextCrvId As Integer = EgtGetNext(nCrvId)
|
||||
Dim nNewId As Integer = EgtCopy(nCrvId, nCrvId, GDB_POS.AFTER)
|
||||
EgtOffsetCurve(nNewId, -m_dDripOffset2, OFF_TYPE.EXTEND)
|
||||
nCrvId = nNextCrvId
|
||||
End While
|
||||
End If
|
||||
' Esplodo nelle curve componenti
|
||||
nCrvId = EgtGetFirstInGroup(DripLayer)
|
||||
While nCrvId <> GDB_ID.NULL
|
||||
Dim nNextCrvId = EgtGetNext(nCrvId)
|
||||
Dim nCount As Integer
|
||||
EgtExplodeCurveCompo(nCrvId, nCount)
|
||||
nCrvId = nNextCrvId
|
||||
End While
|
||||
' Assegno colore e attributi
|
||||
nCrvId = EgtGetFirstInGroup(DripLayer)
|
||||
While nCrvId <> GDB_ID.NULL
|
||||
EgtSetColor(nCrvId, New Color3d(255, 165, 0))
|
||||
EgtSetInfo(nCrvId, INFO_DEPTH, m_dDripDepth)
|
||||
If m_dDripShort > EPS_SMALL Then EgtSetInfo(nCrvId, INFO_STRICT, "1")
|
||||
nCrvId = EgtGetNext(nCrvId)
|
||||
End While
|
||||
End Sub
|
||||
|
||||
' Funzione che modifica l'inclinazione di un lato
|
||||
@@ -629,6 +711,26 @@ Public Class SideEntityControlVM
|
||||
Return True
|
||||
End Function
|
||||
|
||||
' Funzione che modifica il tallone di un lato
|
||||
Friend Function ModifySideHeel(sEntityName As String, dSideHeel As Double) As Boolean
|
||||
' Ricavo CurrEntity dal nome
|
||||
Dim CurrEntity As SideAngleEntity = SideAngleEntity.FindEntity(sEntityName, m_SideEntityList)
|
||||
If IsNothing(CurrEntity) Then
|
||||
EgtOutLog("Error in side angle definition: selected line not found in SideAngleList")
|
||||
Return False
|
||||
End If
|
||||
' Scrivo nuovo tallone nelle info
|
||||
If dSideHeel > 10 * EPS_SMALL Then
|
||||
EgtSetInfo(CurrEntity.nGeomId, INFO_HEEL, dSideHeel)
|
||||
' Cancello inclinazione nell'apposito campo info
|
||||
Else
|
||||
EgtRemoveInfo(CurrEntity.nGeomId, INFO_HEEL)
|
||||
End If
|
||||
' Aggiorno lista entità con nuova inclinazione
|
||||
CurrEntity.dSideHeel = dSideHeel
|
||||
Return True
|
||||
End Function
|
||||
|
||||
' Funzione che modifica l'inclinazione di un lato
|
||||
Friend Function ModifyDrip(sEntityName As String, bVal As Boolean) As Boolean
|
||||
' Ricavo CurrEntity dal nome
|
||||
@@ -683,11 +785,13 @@ Public Class SideEntityControlVM
|
||||
Else
|
||||
Parameter1Msg = EgtMsg(MSG_IMPORTPAGEUC + 10) ' Offset
|
||||
m_dDripOffset = GetMainPrivateProfileDouble(S_SIDES, K_DRIPOFFSET, 20)
|
||||
m_dDripOffset2 = GetMainPrivateProfileDouble(S_SIDES, K_DRIPOFFSET2, 0)
|
||||
m_dDripDepth = GetMainPrivateProfileDouble(S_SIDES, K_DRIPDEPTH, 10)
|
||||
m_dDripShort = GetMainPrivateProfileDouble(S_SIDES, K_DRIPSHORT, 0)
|
||||
SetParameter1(m_dDripOffset)
|
||||
SetParameter2(m_dDripDepth)
|
||||
SetParameter3(m_dDripShort)
|
||||
SetParameter2(m_dDripOffset2)
|
||||
SetParameter3(m_dDripDepth)
|
||||
SetParameter4(m_dDripShort)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
@@ -704,6 +808,7 @@ Public Class SideEntityControlVM
|
||||
WriteMainPrivateProfileString(S_SIDES, K_SIDEANGLE, DoubleToString(m_Parameter1, 3))
|
||||
Else
|
||||
WriteMainPrivateProfileString(S_SIDES, K_DRIPOFFSET, DoubleToString(m_dDripOffset, 3))
|
||||
WriteMainPrivateProfileString(S_SIDES, K_DRIPOFFSET2, DoubleToString(m_dDripOffset2, 3))
|
||||
WriteMainPrivateProfileString(S_SIDES, K_DRIPDEPTH, DoubleToString(m_dDripDepth, 3))
|
||||
WriteMainPrivateProfileString(S_SIDES, K_DRIPSHORT, DoubleToString(m_dDripShort, 3))
|
||||
End If
|
||||
@@ -746,13 +851,15 @@ Public Class SideEntityControlVM
|
||||
While LineId <> GDB_ID.NULL
|
||||
Dim dSideAngle As Double = 0
|
||||
Dim bSA As Boolean = EgtGetInfo(LineId, INFO_SIDE_ANGLE, dSideAngle)
|
||||
Dim dSideAngle2 As Double = 0
|
||||
Dim bSA2 As Boolean = EgtGetInfo(LineId, INFO_SIDE_ANGLE2, dSideAngle2)
|
||||
If Math.Abs(dSideAngle) > EPS_ANG_SMALL Or bSA2 Then
|
||||
Dim dSideHeel As Double = 0
|
||||
Dim bSH As Boolean = EgtGetInfo(LineId, INFO_HEEL, dSideHeel)
|
||||
If Math.Abs(dSideAngle) > EPS_ANG_SMALL Or bSH Then
|
||||
' Creo testo con angolo di inclinazione
|
||||
Dim sText As String = DoubleToString(dSideAngle, 1) & "°"
|
||||
If bSA2 Then sText &= "; " & DoubleToString(dSideAngle2, 1) & "°"
|
||||
If dSideHeel > 10 * EPS_SMALL Then sText &= "; " & LenToString(dSideHeel, 1) & "°"
|
||||
SideEntityControlVM.AddTextToLine(sText, TextLayId, LineId, 15, dBBoxRad, False, True)
|
||||
' Imposto angolo originale
|
||||
EgtSetInfo(LineId, INFO_ORIG_SIDE_ANGLE, dSideAngle)
|
||||
End If
|
||||
LineId = EgtGetNext(LineId)
|
||||
End While
|
||||
@@ -845,6 +952,7 @@ Friend Class SideAngleEntity
|
||||
|
||||
Friend Shared m_Parameter1 As Double
|
||||
Friend Shared m_ModifySideAngle As Action(Of String, Double)
|
||||
Friend Shared m_ModifySideHeel As Action(Of String, Double)
|
||||
Friend Shared m_RefreshSideAngleText As Action
|
||||
|
||||
Private m_dSideAngle As Double
|
||||
@@ -889,6 +997,43 @@ Friend Class SideAngleEntity
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_dSideHeel As Double
|
||||
Public Property GrphSideHeel As String
|
||||
Get
|
||||
Return DoubleToString(m_dSideHeel, 2)
|
||||
End Get
|
||||
Set(value As String)
|
||||
Dim dVal As Double = 0
|
||||
If Not String.IsNullOrWhiteSpace(value) Then StringToDouble(value, dVal)
|
||||
If dVal <> m_dSideHeel Then
|
||||
' Verifico stia nei limiti
|
||||
If dVal < 0 Then
|
||||
m_dSideHeel = 0
|
||||
NotifyPropertyChanged("GrphSideHeel")
|
||||
Else
|
||||
m_dSideHeel = dVal
|
||||
End If
|
||||
' Lo modifico nella geometria e nella lista inclinazioni
|
||||
m_ModifySideHeel(sEntityName, dSideHeel)
|
||||
' Aggiorno tutti i testi
|
||||
m_RefreshSideAngleText()
|
||||
End If
|
||||
End Set
|
||||
End Property
|
||||
Public Property dSideHeel As Double
|
||||
Get
|
||||
Return m_dSideHeel
|
||||
End Get
|
||||
Set(value As Double)
|
||||
' Verifico stia nei limiti
|
||||
If value < 0 Then
|
||||
m_dSideHeel = 0
|
||||
Else
|
||||
m_dSideHeel = value
|
||||
End If
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Overrides Property bIsChecked As Boolean
|
||||
Get
|
||||
Return Not m_dSideAngle = 0
|
||||
@@ -910,9 +1055,10 @@ Friend Class SideAngleEntity
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Sub New(nId As Integer, sEntityName As String, nTextId As Integer, dSideAngle As Double, Mode As SideEntityControlVM.ModeOpt)
|
||||
Sub New(nId As Integer, sEntityName As String, nTextId As Integer, dSideAngle As Double, dSideHeel As Double, Mode As SideEntityControlVM.ModeOpt)
|
||||
MyBase.New(nId, sEntityName, nTextId, Mode)
|
||||
m_dSideAngle = dSideAngle
|
||||
m_dSideHeel = dSideHeel
|
||||
End Sub
|
||||
|
||||
Friend Shared Function FindEntity(sEntityName As String, EntityList As ObservableCollection(Of SideEntity)) As SideAngleEntity
|
||||
|
||||
Reference in New Issue
Block a user