From f0d08c562e677f1a69160bef75207203f929d62d Mon Sep 17 00:00:00 2001 From: NicolaP Date: Thu, 11 Nov 2021 19:32:15 +0100 Subject: [PATCH] Modifica gestione alzatine --- .../CompoParamPage/CompoParamPageVM.vb | 14 ++++-- SideEntityControl/SideEntityControlVM.vb | 48 +++++++++++++++++-- 2 files changed, 56 insertions(+), 6 deletions(-) diff --git a/CompoWindow/CompoParamPage/CompoParamPageVM.vb b/CompoWindow/CompoParamPage/CompoParamPageVM.vb index 1bd7978..e1717c0 100644 --- a/CompoWindow/CompoParamPage/CompoParamPageVM.vb +++ b/CompoWindow/CompoParamPage/CompoParamPageVM.vb @@ -201,9 +201,17 @@ Public Class CompoParamPageVM CompoWindowMap.refCompoSceneHostV.SelectedLayer = GDB_ID.NULL ' Attivo layer delle misure Dim PartId As Integer = EgtGetFirstPart() - EgtSetStatus(EgtGetFirstNameInGroup(PartId, COMPO_LAYER_AUX), GDB_ST.ON_) - EgtSetStatus(EgtGetFirstNameInGroup(PartId, COMPO_LAYER_QUOTATURE), GDB_ST.ON_) - EgtSetStatus(EgtGetFirstNameInGroup(PartId, COMPO_LAYER_ETICHETTE), GDB_ST.ON_) + + If CompoWindowMap.refCompoWindowVM.m_bSelInternalCompo Or CompoWindowMap.refCompoWindowVM.m_bSelAlzAndFront Then + EgtSetStatus(EgtGetFirstNameInGroup(PartId, COMPO_LAYER_AUX), GDB_ST.OFF) + EgtSetStatus(EgtGetFirstNameInGroup(PartId, COMPO_LAYER_QUOTATURE), GDB_ST.OFF) + EgtSetStatus(EgtGetFirstNameInGroup(PartId, COMPO_LAYER_ETICHETTE), GDB_ST.OFF) + Else + EgtSetStatus(EgtGetFirstNameInGroup(PartId, COMPO_LAYER_AUX), GDB_ST.ON_) + EgtSetStatus(EgtGetFirstNameInGroup(PartId, COMPO_LAYER_QUOTATURE), GDB_ST.ON_) + EgtSetStatus(EgtGetFirstNameInGroup(PartId, COMPO_LAYER_ETICHETTE), GDB_ST.ON_) + End If + End If NotifyPropertyChanged("SideAngle_IsChecked") EgtZoom(ZM.ALL) diff --git a/SideEntityControl/SideEntityControlVM.vb b/SideEntityControl/SideEntityControlVM.vb index 9243192..0327a23 100644 --- a/SideEntityControl/SideEntityControlVM.vb +++ b/SideEntityControl/SideEntityControlVM.vb @@ -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