From 2d39dcacc31b85a7493ec89800739a0a1c9d93c8 Mon Sep 17 00:00:00 2001 From: DarioS Date: Tue, 16 Nov 2021 06:37:37 +0100 Subject: [PATCH] =?UTF-8?q?OmagOFFICE=202.3k1=20:=20-=20modifiche=20per=20?= =?UTF-8?q?escludere=20spessore=20sovratavola=20da=20scalatura=20foto=20fa?= =?UTF-8?q?tte=20con=20CameraMng=20-=20all'esportazione=20verso=20la=20mac?= =?UTF-8?q?china=20le=20foto=20vengono=20rese=20non=20pi=C3=B9=20scalabili?= =?UTF-8?q?=20per=20lo=20spessore=20pezzo=20(come=20gli=20scan)=20-=20corr?= =?UTF-8?q?etta=20scrittura=20dati=20in=20interfaccia=20per=20problema=20d?= =?UTF-8?q?ecimali=20che=20falsano=20la=20posizione=20del=20cursore.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../CompoParamPage/CompoParamPageVM.vb | 4 +- EgtStoneLib/EstPhoto.vb | 44 ++++++++++++------- MachOptionWindow/MachOptionWindowVM.vb | 20 ++++----- MainWindow/MainWindowM.vb | 4 +- My Project/AssemblyInfo.vb | 4 +- MySceneHost/MySceneHostVM.vb | 1 + OptionPanel/RawPartTab/RawPartTabVM.vb | 2 +- OptionPanel/SimulTab/MachineAxis.vb | 4 +- SideEntityControl/SideEntityControlVM.vb | 8 ++-- UnderDrillControl/UnderDrillControlVM.vb | 2 +- 10 files changed, 55 insertions(+), 38 deletions(-) diff --git a/CompoWindow/CompoParamPage/CompoParamPageVM.vb b/CompoWindow/CompoParamPage/CompoParamPageVM.vb index 8b61e89..1f80c7a 100644 --- a/CompoWindow/CompoParamPage/CompoParamPageVM.vb +++ b/CompoWindow/CompoParamPage/CompoParamPageVM.vb @@ -64,9 +64,11 @@ Public Class CompoParamPageVM End Set End Property - Private m_AlzAndFront_Visibility As Visibility + Private m_AlzAndFront_Visibility As Visibility Public Property AlzAndFront_Visibility As Visibility Get + ' !!!! Temporaneamente in attesa di completamento Frontalini e alzatine !!!! + Return Visibility.Collapsed Return m_AlzAndFront_Visibility End Get Set(value As Visibility) diff --git a/EgtStoneLib/EstPhoto.vb b/EgtStoneLib/EstPhoto.vb index 6234323..27f8246 100644 --- a/EgtStoneLib/EstPhoto.vb +++ b/EgtStoneLib/EstPhoto.vb @@ -1,13 +1,13 @@ '---------------------------------------------------------------------------- -' EgalTech 2015-2017 +' EgalTech 2015-2021 '---------------------------------------------------------------------------- -' File : GenPhoto.vb Data : 12.04.17 Versione : 1.8d1 +' File : GenPhoto.vb Data : 15.11.21 Versione : 2.3k1 ' Contenuto : Modulo gestione fotografie. ' Ogni gruppo di lavoro può avere una sua foto della lastra. ' ' ' Modifiche : 12.04.17 DS Creazione modulo. -' +' 15.11.21 PS Correzioni per scalatura foto da CameraMng senza sovratavola. ' '---------------------------------------------------------------------------- @@ -35,12 +35,12 @@ Module EstPhoto If dThick > EPS_SMALL Then OmagOFFICEMap.refRawPartTabVM.Height = DoubleToString( dThick, 3) End If - ' Altezza eventuale tavola aggiuntiva + ' Altezza della eventuale tavola aggiuntiva per solo posizionamento in Z Dim dAddTable As Double = CurrentMachine.dAdditionalTable ' Aggiusto dati per spessore grezzo If Math.Abs(EstCalc.GetRawHeight() + dAddTable) > EPS_SMALL Then - ' Coefficiente di scalatura - Dim dFsca As Double = (ptCen.z - EstCalc.GetRawHeight() - dAddTable) / (ptCen.z - ptOri.z) + ' Coefficiente di scalatura (non va considerata la sovratavola) + Dim dFsca As Double = (ptCen.z - EstCalc.GetRawHeight()) / (ptCen.z - ptOri.z) dMMxPixel *= dFsca ptOri.x = ptCen.x + (ptOri.x - ptCen.x) * dFsca ptOri.y = ptCen.y + (ptOri.y - ptCen.y) * dFsca @@ -67,7 +67,11 @@ Module EstPhoto End If EgtSetLevel(nPhGrpId, GDB_LV.SYSTEM) ' Carico la fotografia - Return EgtAddPhoto(GetPhotoName(), sPath, ptOri, ptCen, dMMxPixel, nPhGrpId, b3Tab.Min(), b3Tab.Max()) <> GDB_ID.NULL + Dim nPhotoId As Integer = EgtAddPhoto(GetPhotoName(), sPath, ptOri, ptCen, dMMxPixel, nPhGrpId, b3Tab.Min(), b3Tab.Max()) + If nPhotoId = GDB_ID.NULL Then Return False + ' Salvo spessore sovratavola usato per posizionamento in Z + EgtSetInfo( nPhotoId, "OvTab", dAddTable) + Return True End Function Friend Function LoadContour(sPath As String) As Boolean @@ -92,12 +96,12 @@ Module EstPhoto Dim nPixelX As Integer = 0 Dim nPixelY As Integer = 0 If Not EgtGetPhotoImagePixels(GetPhoto(), nPixelX, nPixelY) Then Return False - ' Altezza eventuale tavola aggiuntiva + ' Altezza della eventuale tavola aggiuntiva per solo posizionamento in Z Dim dAddTable As Double = CurrentMachine.dAdditionalTable ' Aggiusto dati per spessore grezzo If Math.Abs(EstCalc.GetRawHeight() + dAddTable) > EPS_SMALL Then - ' Coefficiente di scalatura - Dim dFsca As Double = (ptCen.z - EstCalc.GetRawHeight() - dAddTable) / (ptCen.z - ptOri.z) + ' Coefficiente di scalatura (non va considerata la sovratavola) + Dim dFsca As Double = (ptCen.z - EstCalc.GetRawHeight()) / (ptCen.z - ptOri.z) dMMxPixel *= dFsca ptOri.x = ptCen.x + (ptOri.x - ptCen.x) * dFsca ptOri.y = ptCen.y + (ptOri.y - ptCen.y) * dFsca @@ -385,10 +389,13 @@ Module EstPhoto ' Porto i punti in locale ptOri.ToLoc(New Frame3d(ptTab)) ptCen.ToLoc(New Frame3d(ptTab)) - ' Altezza eventuale tavola aggiuntiva + ' Altezza della eventuale tavola aggiuntiva originaria + Dim dOrigAddTable As Double = 0 + EgtGetInfo( nPhotoId, "OvTab", dOrigAddTable) + ' Altezza della eventuale tavola aggiuntiva per solo posizionamento in Z Dim dAddTable As Double = CurrentMachine.dAdditionalTable ' Aggiusto dati per spessore grezzo (Coefficiente di scalatura) - Dim dFsca As Double = (ptCen.z - EstCalc.GetRawHeight() - dAddTable) / (ptCen.z - ptOri.z) + Dim dFsca As Double = (ptCen.z - EstCalc.GetRawHeight()) / (ptCen.z - ptOri.z + dOrigAddTable) dDimX *= dFsca dDimY *= dFsca ptOri.x = ptCen.x + (ptOri.x - ptCen.x) * dFsca @@ -426,6 +433,8 @@ Module EstPhoto EgtSetInfo(nNewPhotoId, "OffsX", dOffsetX) EgtSetInfo(nNewPhotoId, "OffsY", dOffsetY) EgtSetInfo(nNewPhotoId, "Rot", dRot) + ' Salvo sovratavola attuale + EgtSetInfo( nPhotoId, "OvTab", dAddTable) Return True End Function @@ -482,18 +491,23 @@ Module EstPhoto ' Recupero origine della tavola Dim ptTab As Point3d If Not EgtGetTableRef(1, ptTab) Then Return False - ' Altezza eventuale tavola aggiuntiva + ' Altezza della eventuale tavola aggiuntiva originaria + Dim dOrigAddTable As Double = 0 + EgtGetInfo( nPhotoId, "OvTab", dOrigAddTable) + ' Altezza della eventuale tavola aggiuntiva per solo posizionamento in Z Dim dAddTable As Double = CurrentMachine.dAdditionalTable ' Recupero inizio contorno Dim ptStart As Point3d EgtStartPoint(nCrvId, GDB_ID.ROOT, ptStart) ' Calcolo coefficiente di scalatura - Dim dFsca As Double = (ptCen.z - ptTab.z - EstCalc.GetRawHeight() - dAddTable) / (ptCen.z - ptStart.z) + Dim dFsca As Double = (ptCen.z - ptTab.z - EstCalc.GetRawHeight()) / (ptCen.z - ptStart.z + dOrigAddTable) ' Scalo opportunamente EgtScale(nCrvId, New Frame3d(ptCen), dFsca, dFsca, 1, GDB_RT.GLOB) ' Sposto in Z - Dim vtMove As New Vector3d(0, 0, ptTab.z + EstCalc.GetRawHeight() + dAddTable - ptStart.z) + Dim vtMove As New Vector3d(0, 0, ptTab.z + EstCalc.GetRawHeight() + CurrentMachine.dAdditionalTable - ptStart.z) EgtMove(nCrvId, vtMove, GDB_RT.GLOB) + ' Salvo sovratavola attuale + EgtSetInfo( nPhotoId, "OvTab", dAddTable) Return True End Function diff --git a/MachOptionWindow/MachOptionWindowVM.vb b/MachOptionWindow/MachOptionWindowVM.vb index 497a10b..195be9d 100644 --- a/MachOptionWindow/MachOptionWindowVM.vb +++ b/MachOptionWindow/MachOptionWindowVM.vb @@ -33,7 +33,7 @@ Public Class MachOptionWindowVM Public Property HolesOffset As String Get - Return LenToString(CurrentMachine.dHolesOffset, -2) + Return LenToString(CurrentMachine.dHolesOffset, 2) End Get Set(value As String) Dim dHolesOffset As Double = 0 @@ -45,7 +45,7 @@ Public Class MachOptionWindowVM Public Property HolesOverlap As String Get - Return LenToString(CurrentMachine.dHolesOverlap, -2) + Return LenToString(CurrentMachine.dHolesOverlap, 2) End Get Set(value As String) Dim dHolesOverlap As Double = 0 @@ -57,7 +57,7 @@ Public Class MachOptionWindowVM Public Property HolesTolerance As String Get - Return LenToString(CurrentMachine.dHolesTolerance, -2) + Return LenToString(CurrentMachine.dHolesTolerance, 2) End Get Set(value As String) Dim dHolesTolerance As Double = 0 @@ -82,7 +82,7 @@ Public Class MachOptionWindowVM Public Property CutExtraLen As String Get - Return LenToString(CurrentMachine.dCutExtraLen, -2) + Return LenToString(CurrentMachine.dCutExtraLen, 2) End Get Set(value As String) Dim dCutExtraLen As Double = 0 @@ -94,7 +94,7 @@ Public Class MachOptionWindowVM Public Property AngleCutExtraLen As String Get - Return LenToString(CurrentMachine.dAngleCutExtraLen, -2) + Return LenToString(CurrentMachine.dAngleCutExtraLen, 2) End Get Set(value As String) Dim dAngleCutExtraLen As Double = 0 @@ -106,7 +106,7 @@ Public Class MachOptionWindowVM Public Property ExtArcMinRad As String Get - Return LenToString(CurrentMachine.dExtArcMinRad, -2) + Return LenToString(CurrentMachine.dExtArcMinRad, 2) End Get Set(value As String) Dim dExtArcMinRad As Double = 0 @@ -118,7 +118,7 @@ Public Class MachOptionWindowVM Public Property IntArcMaxSideAng As String Get - Return DoubleToString(CurrentMachine.dIntArcMaxSideAng, -2) + Return DoubleToString(CurrentMachine.dIntArcMaxSideAng, 2) End Get Set(value As String) Dim dIntArcMaxSideAng As Double = 0 @@ -150,7 +150,7 @@ Public Class MachOptionWindowVM Public Property SafeZ As String Get - Return LenToString(CurrentMachine.dSafeZ, -2) + Return LenToString(CurrentMachine.dSafeZ, 2) End Get Set(value As String) Dim dSafeZ As Double = 0 @@ -184,7 +184,7 @@ Public Class MachOptionWindowVM Public Property ShortCut As String Get - Return LenToString(CurrentMachine.dShortCut, -2) + Return LenToString(CurrentMachine.dShortCut, 2) End Get Set(value As String) Dim dShortCut As Double = 0 @@ -264,7 +264,7 @@ Public Class MachOptionWindowVM Public Property AdditionalTable As String Get - Return LenToString(CurrentMachine.dAdditionalTable, -2) + Return LenToString(CurrentMachine.dAdditionalTable, 2) End Get Set(value As String) Dim dAdditionalTable As Double = 0 diff --git a/MainWindow/MainWindowM.vb b/MainWindow/MainWindowM.vb index 8aa635a..fb4d84a 100644 --- a/MainWindow/MainWindowM.vb +++ b/MainWindow/MainWindowM.vb @@ -195,8 +195,8 @@ Public Class MainWindowM ' Verifico abilitazione nesting automatico m_bAutoNestOption = Not String.IsNullOrWhiteSpace( sNestKey) ' Recupero livello e opzioni della chiave - Dim bKey As Boolean = EgtGetKeyLevel(9423, 2310, 1, m_nKeyLevel) And - EgtGetKeyOptions(9423, 2310, 1, m_nKeyOptions) + Dim bKey As Boolean = EgtGetKeyLevel(9423, 2311, 1, m_nKeyLevel) And + EgtGetKeyOptions(9423, 2311, 1, m_nKeyOptions) ' Verifico abilitazione prodotto Dim bProd As Boolean = GetKeyOption(KEY_OPT.OFFICE_BASE) ' Inizializzazione generale di EgtInterface diff --git a/My Project/AssemblyInfo.vb b/My Project/AssemblyInfo.vb index 51b87b0..7faf111 100644 --- a/My Project/AssemblyInfo.vb +++ b/My Project/AssemblyInfo.vb @@ -69,6 +69,6 @@ Imports System.Windows ' by using the '*' as shown below: ' - - + + diff --git a/MySceneHost/MySceneHostVM.vb b/MySceneHost/MySceneHostVM.vb index ea5e9af..473d554 100644 --- a/MySceneHost/MySceneHostVM.vb +++ b/MySceneHost/MySceneHostVM.vb @@ -285,6 +285,7 @@ Public Class MySceneHostVM EgtOutLog( "Slab image not found :" & sOriPath) End Try EgtSetName(nPhotoId, PHOTO_NAME) + EgtChangePhotoCenterAsFlatScan( nPhotoId) End If ' Elimino gli altri gruppi di lavorazioni For Each nMGrpId As Integer In vMchGrps diff --git a/OptionPanel/RawPartTab/RawPartTabVM.vb b/OptionPanel/RawPartTab/RawPartTabVM.vb index 23580dd..662e3a0 100644 --- a/OptionPanel/RawPartTab/RawPartTabVM.vb +++ b/OptionPanel/RawPartTab/RawPartTabVM.vb @@ -231,7 +231,7 @@ Public Class RawPartTabVM Else Return LenToString(m_dLength, 2) End If - 'Return LenToString(m_dLength, -2) + 'Return LenToString(m_dLength, 2) End Get Set(value As String) Dim dLength As Double = 0 diff --git a/OptionPanel/SimulTab/MachineAxis.vb b/OptionPanel/SimulTab/MachineAxis.vb index 656f400..bb09ade 100644 --- a/OptionPanel/SimulTab/MachineAxis.vb +++ b/OptionPanel/SimulTab/MachineAxis.vb @@ -101,9 +101,9 @@ Public Class MachineAxis EgtSetAxisPos(m_Name, dVal) EgtGetAxisPos(m_Name, dVal) If m_Linear Then - Value = LenToString(dVal, -3) + Value = LenToString(dVal, 3) Else - Value = DoubleToString(dVal, -3) + Value = DoubleToString(dVal, 3) End If EgtDraw() End Sub diff --git a/SideEntityControl/SideEntityControlVM.vb b/SideEntityControl/SideEntityControlVM.vb index dfea230..ffc6ec5 100644 --- a/SideEntityControl/SideEntityControlVM.vb +++ b/SideEntityControl/SideEntityControlVM.vb @@ -116,7 +116,7 @@ Public Class SideEntityControlVM If m_Mode = ModeOpt.SIDEANGLE Then Return DoubleToString(m_Parameter1, 2) Else - Return LenToString(m_Parameter1, -2) + Return LenToString(m_Parameter1, 2) End If End Get Set(value As String) @@ -178,7 +178,7 @@ Public Class SideEntityControlVM If m_Mode = ModeOpt.SIDEANGLE Then Return LenToString(m_Parameter2, 2) Else - Return LenToString(m_Parameter2, -2) + Return LenToString(m_Parameter2, 2) End If End Get Set(value As String) @@ -307,7 +307,7 @@ Public Class SideEntityControlVM Private m_Parameter3 As Double Public Property Parameter3 As String Get - Return LenToString(m_Parameter3, -2) + Return LenToString(m_Parameter3, 2) End Get Set(value As String) If m_Mode <> ModeOpt.SIDEANGLE Then @@ -344,7 +344,7 @@ Public Class SideEntityControlVM Private m_Parameter4 As Double Public Property Parameter4 As String Get - Return LenToString(m_Parameter4, -2) + Return LenToString(m_Parameter4, 2) End Get Set(value As String) If m_Mode <> ModeOpt.SIDEANGLE Then diff --git a/UnderDrillControl/UnderDrillControlVM.vb b/UnderDrillControl/UnderDrillControlVM.vb index 74a81b4..ea895e1 100644 --- a/UnderDrillControl/UnderDrillControlVM.vb +++ b/UnderDrillControl/UnderDrillControlVM.vb @@ -7,7 +7,7 @@ Public Class UnderDrillControlVM Private m_dDrillDepth As Double Public Property dDrillDepth As String Get - Return LenToString(m_dDrillDepth, -2) + Return LenToString(m_dDrillDepth, 2) End Get Set(value As String) StringToLen(value, m_dDrillDepth)