Modifica gestione alzatine

This commit is contained in:
NicolaP
2021-11-11 19:32:15 +01:00
parent 0e77455500
commit f0d08c562e
2 changed files with 56 additions and 6 deletions
+45 -3
View File
@@ -585,12 +585,14 @@ Public Class SideEntityControlVM
AddTextToLine(sText, Entity.nTextId, Entity.nGeomId, 20, dBBoxRad, True)
Next
ElseIf m_Mode = ModeOpt.ALZANDFRONT Then
' ---------------- ATTENZIONE ----------------
' tutta le gestione dei mesaggi è eseguita dal file lua della componente!
' Per ogni entità, creo testo con nome e angolo di inclinazione
For Each Entity In m_SideEntityList
Dim SideEntity As AlzAndFrontEntity = TryCast(Entity, AlzAndFrontEntity)
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)
'AddTextToLine(sText, Entity.nTextId, Entity.nGeomId, 20, dBBoxRad, True)
Next
' Altrimenti modalità gocciolatoio
ElseIf m_Mode = ModeOpt.DRIP Or m_Mode = ModeOpt.ENGRAVE Then
@@ -661,7 +663,7 @@ Public Class SideEntityControlVM
ElseIf m_Mode = ModeOpt.FILOTOP Then
' --- NON FARE NIENTE ---
ElseIf m_Mode = ModeOpt.ALZANDFRONT Then
If VerifySideAnglePossible(PrevLine, CurrLine, NextLine, bOutLoop) Then
If VerifySideAnglePossible(PrevLine, CurrLine, NextLine, bOutLoop) And ApprovedSideToAlzFront(CurrLine) Then
' Aggiungo il lato alla lista di quelli inclinabili e ne azzero l'inclinazione
AddAlzAndFront(CurrLine, TextLayer, dBBoxRad, nEntityIndex)
nEntityIndex += 1
@@ -791,7 +793,7 @@ Public Class SideEntityControlVM
EgtSetInfo(NewEntity.nGeomId, "IsModify", 0)
m_SideEntityList.Add(NewEntity)
NotifyPropertyChanged("Legenda_Visibility")
AddTextToLine("A" & CurrLine.ToString, TextLayer, CurrLine, 20, dBBoxRad, True)
'AddTextToLine("A" & CurrLine.ToString, TextLayer, CurrLine, 20, dBBoxRad, True)
End Sub
' Funzione che gestisce le operazioni sull'entità con gocciolatoio
@@ -1566,6 +1568,7 @@ Public Class SideEntityControlVM
End Sub
'---------------------- GESTIONE ALZATIENE E FRONTALINI ----------------------
' eseguo compo
Shared Sub LoadCurrentCompo()
Dim m_dBBoxRad As Double = 0.5 * Point3d.DistXY(EstCalc.GetRawPtMin, EstCalc.GetRawPtMax)
Dim m_dH As Double = 0.05 * m_dBBoxRad
@@ -1632,6 +1635,45 @@ Public Class SideEntityControlVM
EgtZoom(ZM.ALL)
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
Shared Sub RefreshEntity(bIsAlz As Boolean, bIsChecked As Boolean, GeneralSideEntity As SideEntity, Optional DrawCompo As Boolean = True)
Dim Loacl_AlzFrontEntity As AlzAndFrontEntity = Nothing