OmagOFFICE 2.2i1 :
- ripristinata gestione nome lastra da dati MapaScan (Hneraux) - aggiunta a lettura nome lastra anche lettura codice blocco e codice lastra - modifica utente di codice blocco o codice lastra produce aggiornamento nome lastra.
This commit is contained in:
+11
-1
@@ -121,11 +121,21 @@ Module EstCalc
|
||||
|
||||
Friend Function GetSlabName() As String
|
||||
Dim nMGrpId As Integer = EgtGetCurrMachGroup()
|
||||
Dim sSlabName As String = String.Empty
|
||||
Dim sSlabName As String = ""
|
||||
EgtGetInfo(nMGrpId, INFO_SLABNAME, sSlabName)
|
||||
Return sSlabName
|
||||
End Function
|
||||
|
||||
Public Function SetBlockCode(sBlockCode As String) As Boolean
|
||||
Dim nRawId As Integer = EstCalc.GetRawId()
|
||||
Return EgtSetInfo(nRawId, INFO_RAW_BLOCK, sBlockCode)
|
||||
End Function
|
||||
|
||||
Public Function SetSlabCode(sSlabCode As String) As Boolean
|
||||
Dim nRawId As Integer = EstCalc.GetRawId()
|
||||
Return EgtSetInfo(nRawId, INFO_RAW_SLABNBR, sSlabCode)
|
||||
End Function
|
||||
|
||||
'--------------------------------------------------------------------------------------------------
|
||||
Public Function SetSlabHeight(dSlabHeight As Double) As Boolean
|
||||
Dim nMGrpId As Integer = EgtGetCurrMachGroup()
|
||||
|
||||
+18
-12
@@ -18,7 +18,7 @@ Imports EgtWPFLib5
|
||||
Module EstPhoto
|
||||
|
||||
Friend Function LoadPhoto(sPath As String,
|
||||
ByRef nSlabId As Integer, ByRef sSlabName As String, ByRef sMat As String) As Boolean
|
||||
ByRef nSlabId As Integer, ByRef sBlockCode As String, ByRef sSlabCode As String, ByRef sSlabName As String, ByRef sMat As String) As Boolean
|
||||
' Verifico esistenza file immagine
|
||||
If Not File.Exists(sPath) Then Return False
|
||||
' Leggo eventuale file dati aggiuntivi
|
||||
@@ -26,7 +26,7 @@ Module EstPhoto
|
||||
Dim ptCen As New Point3d(0, 0, INFINITO)
|
||||
Dim dMMxPixel As Double = 1
|
||||
Dim dCoeff As Double = 1
|
||||
If Not ReadAuxData(sPath, nSlabId, sSlabName, sMat, ptOri, ptCen, dMMxPixel, dCoeff) Then Return False
|
||||
If Not ReadAuxData(sPath, nSlabId, sBlockCode, sSlabCode, sSlabName, sMat, ptOri, ptCen, dMMxPixel, dCoeff) Then Return False
|
||||
' Aggiungo eventuali offset
|
||||
ptOri += CurrentMachine.PhotoOffset
|
||||
ptCen += CurrentMachine.PhotoOffset
|
||||
@@ -70,13 +70,15 @@ Module EstPhoto
|
||||
RemoveContour()
|
||||
' Leggo eventuale file dati aggiuntivi
|
||||
Dim nSlabId As Integer = 0
|
||||
Dim sSlabName As String = String.Empty
|
||||
Dim sMat As String = String.Empty
|
||||
Dim sBlockCode As String = ""
|
||||
Dim sSlabCode As String = ""
|
||||
Dim sSlabName As String = ""
|
||||
Dim sMat As String = ""
|
||||
Dim ptOri As New Point3d(0, 0, 0)
|
||||
Dim ptCen As New Point3d(0, 0, INFINITO)
|
||||
Dim dMMxPixel As Double = 1
|
||||
Dim dCoeff As Double = 1
|
||||
If Not ReadAuxData(sPath, nSlabId, sSlabName, sMat, ptOri, ptCen, dMMxPixel, dCoeff) Then Return False
|
||||
If Not ReadAuxData(sPath, nSlabId, sBlockCode, sSlabCode, sSlabName, sMat, ptOri, ptCen, dMMxPixel, dCoeff) Then Return False
|
||||
' Aggiungo eventuali offset
|
||||
ptOri += CurrentMachine.PhotoOffset
|
||||
ptCen += CurrentMachine.PhotoOffset
|
||||
@@ -206,23 +208,25 @@ Module EstPhoto
|
||||
End Function
|
||||
|
||||
Private Function ReadAuxData(sPath As String,
|
||||
ByRef nSlabId As Integer, ByRef sSlabName As String, ByRef sMat As String,
|
||||
ByRef nSlabId As Integer, ByRef sBlockCode As String, ByRef sSlabCode As String, ByRef sSlabName As String, ByRef sMat As String,
|
||||
ByRef ptOri As Point3d, ByRef ptCen As Point3d, ByRef dMMxPixel As Double, ByRef dCoeff As Double) As Boolean
|
||||
' Se esiste file txt lancio lettore standard, altrimenti quello personalizzato
|
||||
Dim sAuxPath As String = Path.ChangeExtension(sPath, ".txt")
|
||||
If My.Computer.FileSystem.FileExists(sAuxPath) Then
|
||||
Return ReadStandardAuxData(sAuxPath, nSlabId, sSlabName, sMat, ptOri, ptCen, dMMxPixel, dCoeff)
|
||||
Return ReadStandardAuxData(sAuxPath, nSlabId, sBlockCode, sSlabCode, sSlabName, sMat, ptOri, ptCen, dMMxPixel, dCoeff)
|
||||
Else
|
||||
Return ReadCustomAuxData(sPath, nSlabId, sSlabName, sMat, ptOri, ptCen, dMMxPixel, dCoeff)
|
||||
Return ReadCustomAuxData(sPath, nSlabId, sBlockCode, sSlabCode, sSlabName, sMat, ptOri, ptCen, dMMxPixel, dCoeff)
|
||||
End If
|
||||
End Function
|
||||
|
||||
Private Function ReadStandardAuxData(sAuxPath As String,
|
||||
ByRef nSlabId As Integer, ByRef sSlabName As String, ByRef sMat As String,
|
||||
ByRef nSlabId As Integer, ByRef sBlockCode As String, ByRef sSlabCode As String, ByRef sSlabName As String, ByRef sMat As String,
|
||||
ByRef ptOri As Point3d, ByRef ptCen As Point3d, ByRef dMMxPixel As Double, ByRef dCoeff As Double) As Boolean
|
||||
nSlabId = 0
|
||||
sSlabName = String.Empty
|
||||
sMat = String.Empty
|
||||
sBlockCode = ""
|
||||
sSlabCode = ""
|
||||
sSlabName = ""
|
||||
sMat = ""
|
||||
dCoeff = 1
|
||||
Try
|
||||
Dim sLine As String = String.Empty
|
||||
@@ -259,7 +263,7 @@ Module EstPhoto
|
||||
End Function
|
||||
|
||||
Private Function ReadCustomAuxData(sPath As String,
|
||||
ByRef nSlabId As Integer, ByRef sSlabName As String, ByRef sMat As String,
|
||||
ByRef nSlabId As Integer, ByRef sBlockCode As String, ByRef sSlabCode As String, ByRef sSlabName As String, ByRef sMat As String,
|
||||
ByRef ptOri As Point3d, ByRef ptCen As Point3d, ByRef dMMxPixel As Double, ByRef dCoeff As Double) As Boolean
|
||||
' Definizione variabili
|
||||
EgtLuaCreateGlobTable("RDT")
|
||||
@@ -278,6 +282,8 @@ Module EstPhoto
|
||||
' Leggo i risultati
|
||||
If Not EgtLuaGetGlobIntVar("RDT.SLABID", nSlabId) Then nSlabId = 0
|
||||
If Not EgtLuaGetGlobStringVar("RDT.SLABNAME", sSlabName) Then sSlabName = String.Empty
|
||||
If Not EgtLuaGetGlobStringVar("RDT.BLOCKCODE", sBlockCode) Then sBlockCode = String.Empty
|
||||
If Not EgtLuaGetGlobStringVar("RDT.SLABCODE", sSlabCode) Then sSlabCode = String.Empty
|
||||
If Not EgtLuaGetGlobStringVar("RDT.MATERIAL", sMat) Then sMat = String.Empty
|
||||
Dim dThick As Double = 0
|
||||
EgtLuaGetGlobNumVar("RDT.TH", dThick)
|
||||
|
||||
@@ -69,6 +69,6 @@ Imports System.Windows
|
||||
' by using the '*' as shown below:
|
||||
' <Assembly: AssemblyVersion("1.0.*")>
|
||||
|
||||
<Assembly: AssemblyVersion("2.2.8.3")>
|
||||
<Assembly: AssemblyFileVersion("2.2.8.3")>
|
||||
<Assembly: AssemblyVersion("2.2.9.1")>
|
||||
<Assembly: AssemblyFileVersion("2.2.9.1")>
|
||||
|
||||
|
||||
@@ -1693,6 +1693,13 @@ Public Class RawPartTabVM
|
||||
' Assegno info
|
||||
EgtSetInfo( nRawId, INFO_RAW_BLOCK, sBlockName)
|
||||
EgtSetInfo( nRawId, INFO_RAW_SLABNBR, sSlabNbr)
|
||||
' Aggiorno nome lastra
|
||||
If Not String.IsNullOrWhiteSpace( sBlockName) And Not String.IsNullOrWhiteSpace( sBlockName) Then
|
||||
Dim sSlabName = sBlockName & "-" & sSlabNbr
|
||||
EstCalc.SetSlabName( sSlabName)
|
||||
' notifico il MachGroup Corrente
|
||||
OmagOFFICEMap.refMachGroupPanelVM.SelectedMachGroup.NotifyPropertyChanged("MachGroupToolTip")
|
||||
End If
|
||||
' Cancello eventuale vecchio BarCode
|
||||
EgtErase(EgtGetFirstNameInGroup(nRawId, NAME_BARCODE))
|
||||
' Se definito, inserisco nuovo BarCode
|
||||
@@ -1731,24 +1738,28 @@ Public Class RawPartTabVM
|
||||
End Sub
|
||||
|
||||
Public Sub Photo(ByVal param As Object)
|
||||
Dim sPhoto As String = String.Empty
|
||||
Dim nSlabId As Integer = 0
|
||||
Dim sSlabName As String = String.Empty
|
||||
Dim sSlabNameDB As String = String.Empty
|
||||
Dim sMat As String = String.Empty
|
||||
' recupero il nome del progetto corrente
|
||||
Dim sFileProject As String = String.Empty
|
||||
EgtGetCurrFilePath(sFileProject)
|
||||
|
||||
' devo verificare se attualmente c'è una foto di lastra nel MachGroup corrente
|
||||
If Not IsNothing(OmagOFFICEMap.refMachGroupPanelVM.SelectedMachGroup) Then
|
||||
Dim CurrMachGroup As MachGroup = OmagOFFICEMap.refMachGroupPanelVM.SelectedMachGroup
|
||||
sSlabNameDB = GetSlabName()
|
||||
End If
|
||||
' cancello eventuali nome di materiali
|
||||
Dim sPhoto As String = String.Empty
|
||||
Dim sSlabNameDB As String = ""
|
||||
|
||||
Dim nSlabId As Integer = 0
|
||||
Dim sBlockCode As String = ""
|
||||
Dim sSlabCode As String = ""
|
||||
Dim sSlabName As String = ""
|
||||
Dim sMat As String = ""
|
||||
|
||||
' cancello eventuali nome di materiali da DB
|
||||
SetMaterialFromDB(String.Empty)
|
||||
|
||||
If OmagOFFICEMap.refMainWindowVM.MainWindowM.m_SlabDB Then
|
||||
' recupero il nome del progetto corrente
|
||||
Dim sFileProject As String = String.Empty
|
||||
EgtGetCurrFilePath(sFileProject)
|
||||
' devo verificare se attualmente c'è una foto di lastra nel MachGroup corrente
|
||||
If Not IsNothing(OmagOFFICEMap.refMachGroupPanelVM.SelectedMachGroup) Then
|
||||
Dim CurrMachGroup As MachGroup = OmagOFFICEMap.refMachGroupPanelVM.SelectedMachGroup
|
||||
sSlabNameDB = GetSlabName()
|
||||
End If
|
||||
SetMaterialFromDB(GetMaterialPhoto())
|
||||
' salvo il contesto corrente del programma
|
||||
Dim nCurrentContetxt As Integer = EgtGetCurrentContext()
|
||||
@@ -1824,7 +1835,7 @@ Public Class RawPartTabVM
|
||||
SetPhotoOffsetY(0)
|
||||
SetPhotoRot(0)
|
||||
' Carico immagine
|
||||
If Not EstPhoto.LoadPhoto(sPhoto, nSlabId, sSlabName, sMat) Then
|
||||
If Not EstPhoto.LoadPhoto(sPhoto, nSlabId, sBlockCode, sSlabCode, sSlabName, sMat) Then
|
||||
' Ripristino offset e rotazione foto
|
||||
Dim dPhotoOffsetX, dPhotoOffsetY, dPhotoRot As Double
|
||||
GetPhotoOffsetRot(dPhotoOffsetX, dPhotoOffsetY, dPhotoRot)
|
||||
@@ -1835,6 +1846,8 @@ Public Class RawPartTabVM
|
||||
MessageBox.Show(EgtMsg(MSG_RAWPARTTAB + 1), EgtMsg(MSG_MESSAGEBOX + 1), MessageBoxButton.OK, MessageBoxImage.Error)
|
||||
Return
|
||||
End If
|
||||
' Se da DB aggiorno nome lastra
|
||||
If OmagOFFICEMap.refMainWindowVM.MainWindowM.m_SlabDB Then sSlabName = sSlabNameDB
|
||||
' Aggiorno immagini nel VeinMatching
|
||||
VeinMatching.RemoveUnusedPhotos()
|
||||
' Parcheggio tutti i pezzi presenti nella lastra
|
||||
@@ -1852,9 +1865,9 @@ Public Class RawPartTabVM
|
||||
EstCalc.HideParkedParts()
|
||||
|
||||
' Imposto nome e spessore lastra
|
||||
If Not String.IsNullOrEmpty(sSlabNameDB) Then
|
||||
EstCalc.SetSlabName(sSlabNameDB)
|
||||
End If
|
||||
If Not String.IsNullOrEmpty(sSlabName) Then EstCalc.SetSlabName(sSlabName)
|
||||
If Not String.IsNullOrEmpty(sBlockCode) Then EstCalc.SetBlockCode(sBlockCode)
|
||||
If Not String.IsNullOrEmpty(sSlabCode) Then EstCalc.SetSlabCode(sSlabCode)
|
||||
EstCalc.SetSlabHeight(m_dHeight)
|
||||
' notifico il MachGroup Corrente
|
||||
OmagOFFICEMap.refMachGroupPanelVM.SelectedMachGroup.NotifyPropertyChanged("MachGroupToolTip")
|
||||
|
||||
Reference in New Issue
Block a user