diff --git a/CompoWindow/CompoParamPage/CompoParamPageVM.vb b/CompoWindow/CompoParamPage/CompoParamPageVM.vb index 0c204b8..2642cae 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) @@ -409,8 +411,13 @@ Public Class CompoParamPageVM CompoWindowMap.refCompoSceneHostV.CompoScene, SideEntityControlVM.ModeOpt.ENGRAVE) SideEntityControl = New SideEntityControlV(m_SideEntityControlVM) + If m_SideEntityControlVM.SideEntityList.Count < 1 Then + ' eventulmente stamnpare messaggio! + ' OmagOFFICEMap.refStatusBarVM.ClearOutputMessage() + ' OmagOFFICEMap.refStatusBarVM.SetOutputMessage("Lavorazioni non disponibile", MSG_TYPE.WARNING) + End If Else - SideAngle_IsEnabled = True + SideAngle_IsEnabled = True Drip_IsEnabled = OmagOFFICEMap.refMainWindowVM.MainWindowM.GetKeyOption(KEY_OPT.UNDER_CUT) And Not String.IsNullOrWhiteSpace(CurrentMachine.sCurrDripSaw) FiloTop_IsEnabled = True diff --git a/CurrMachWindow/CurrMachWindowV.xaml b/CurrMachWindow/CurrMachWindowV.xaml index 4780657..9b92a8b 100644 --- a/CurrMachWindow/CurrMachWindowV.xaml +++ b/CurrMachWindow/CurrMachWindowV.xaml @@ -14,9 +14,11 @@ + + + diff --git a/CurrMachWindow/CurrMachWindowVM.vb b/CurrMachWindow/CurrMachWindowVM.vb index 2982384..d09b4f5 100644 --- a/CurrMachWindow/CurrMachWindowVM.vb +++ b/CurrMachWindow/CurrMachWindowVM.vb @@ -32,6 +32,16 @@ Public Class CurrMachWindowVM End Set End Property + Public ReadOnly Property CurrSawing_Visibility As Visibility + Get + If EgtGetHeadId("H1") = GDB_ID.NULL Then + Return Visibility.Collapsed + Else + Return Visibility.Visible + End If + End Get + End Property + #End Region ' Saw #Region " AUX MACHINING " @@ -257,6 +267,29 @@ Public Class CurrMachWindowVM End Set End Property + Private m_CurrWaterjettingQualityList As New List(Of String) + Public Property CurrWaterjettingQualityList As List(Of String) + Get + Return m_CurrWaterjettingQualityList + End Get + Set(value As List(Of String)) + m_CurrWaterjettingQualityList = value + End Set + End Property + + Private m_SelCurrWaterjettingQuality As String + Public Property SelCurrWaterjettingQuality As String + Get + Return m_SelCurrWaterjettingQuality + End Get + Set(value As String) + If value <> m_SelCurrWaterjettingQuality Then + m_SelCurrWaterjettingQuality = value + CurrentMachine.sCurrWaterJettingQuality = m_SelCurrWaterjettingQuality + End If + End Set + End Property + Private m_CurrWaterjetting_Visibility As Visibility Public Property CurrWaterjetting_Visibility As Visibility Get @@ -264,7 +297,18 @@ Public Class CurrMachWindowVM End Get Set(value As Visibility) m_CurrWaterjetting_Visibility = value - NotifyPropertyChanged("CurrWaterjetting_Visibility") + NotifyPropertyChanged(NameOf(CurrWaterjetting_Visibility)) + End Set + End Property + + Private m_CurrWaterjettingQuality_Visibility As Visibility + Public Property CurrWaterjettingQuality_Visibility As Visibility + Get + Return m_CurrWaterjettingQuality_Visibility + End Get + Set(value As Visibility) + m_CurrWaterjettingQuality_Visibility = value + NotifyPropertyChanged(NameOf(CurrWaterjettingQuality_Visibility)) End Set End Property @@ -313,6 +357,13 @@ Public Class CurrMachWindowVM Return EgtMsg(MSG_CHOOSEMACHININGPAGEUC + 10) End Get End Property + + Public ReadOnly Property CurrWaterjettingQualityMsg As String + Get + Return "Quality" + End Get + End Property + Public ReadOnly Property OkMsg As String Get Return "Ok" @@ -381,6 +432,7 @@ Public Class CurrMachWindowVM If m_CurrWaterjettingList.Count = 0 Then CurrentMachine.sCurrWaterJetting = String.Empty End If + m_CurrWaterjettingQualityList = New List(Of String)(CurrentMachine.Qualities) ElseIf CurrentMachine.MountedToolConfig = CurrentMachine.MountedToolConfigs.MANUALTOOLCHANGER Or CurrentMachine.MountedToolConfig = CurrentMachine.MountedToolConfigs.TOOLCHANGER Then @@ -411,6 +463,7 @@ Public Class CurrMachWindowVM If m_CurrWaterjettingList.Count = 0 Then CurrentMachine.sCurrWaterJetting = String.Empty End If + m_CurrWaterjettingQualityList = New List(Of String)(CurrentMachine.Qualities) End If ' Nascondo la selezione dell'utensile ausiliario -- DA ELIMINARE? -- @@ -459,11 +512,20 @@ Public Class CurrMachWindowVM If CurrentMachine.bWaterJetting And CurrWaterjettingList.Count > 1 Then CurrWaterjetting_Visibility = Visibility.Visible - If CurrentMachine.sCurrWaterJetting <> String.Empty Then - SelCurrWaterjetting = CurrentMachine.sCurrWaterJetting + ' se DB WaterJet abilitato avrò anche la CmBx della Quality solo la CmBx del Waterjetting corrente + If CurrentMachine.bFromDBWaterJet Then + If CurrentMachine.sCurrWaterJetting <> String.Empty Then + SelCurrWaterjetting = CurrentMachine.sCurrWaterJetting + End If + If CurrentMachine.sCurrWaterJettingQuality <> String.Empty Then + SelCurrWaterjettingQuality = CurrentMachine.sCurrWaterJettingQuality + End If + CurrWaterjettingQuality_Visibility = Visibility.Visible + Else + CurrWaterjettingQuality_Visibility = Visibility.Collapsed End If Else - CurrWaterjetting_Visibility = Visibility.Collapsed + CurrWaterjettingQuality_Visibility = Visibility.Collapsed End If ' Con le nuove modifiche questa selezione dovrebbe scompaire definitivamente -- DA ELIMINARE? -- @@ -595,26 +657,56 @@ Public Class CurrMachWindowVM EgtMdbGetCurrMachiningParam(MCH_MP.SYSNOTES, SysNotes) If SysNotes <> String.Empty Then Dim MachiningMaterials() = SysNotes.Split(";".ToCharArray) - For Each Material In MachiningMaterials - Dim Param() As String = Material.Split(",".ToCharArray) - If Param.Count() < 2 Then Continue For - Dim CurrMatId As String = String.Empty - For Each Mat In CurrentMachine.Materials - If Mat.sName = EstCalc.GetMaterialName Then - CurrMatId = Mat.nId.ToString() - Exit For + + If CurrentMachine.bWaterJet And CurrentMachine.bFromDBWaterJet Then + For Each Material As Object In MachiningMaterials + Dim Param() As String = Material.Split(",".ToCharArray) + If Param.Count() < 2 Then Continue For + Dim CurrMatId As String = String.Empty + Dim CurrMatSubId As String = String.Empty + For Each Mat In CurrentMachine.Materials + If Mat.sName = EstCalc.GetMaterialName Then + CurrMatId = Mat.nId.ToString() + CurrMatSubId = Mat.SubId.ToString() + Exit For + End If + Next + Dim SubParam() As String = Param(0).Split(".".ToCharArray) + If SubParam(0) = CurrentMachine.CurrMat.nId.ToString() AndAlso SubParam.Count > 1 AndAlso SubParam(1) = CurrentMachine.CurrMat.SubId.ToString() Then + Dim MatMinH As Double = 0 + StringToDouble(Param(1), MatMinH) + Dim MatMaxH As Double = 0 + StringToDouble(Param(2), MatMaxH) + If EstCalc.GetRawHeight > MatMinH - EPS_SMALL And EstCalc.GetRawHeight < MatMaxH + EPS_SMALL Then + Return True + End If End If Next - If Param(0) = CurrMatId Then - Dim MatMinH As Double = 0 - StringToDouble(Param(1), MatMinH) - Dim MatMaxH As Double = 0 - StringToDouble(Param(2), MatMaxH) - If EstCalc.GetRawHeight > MatMinH - EPS_SMALL And EstCalc.GetRawHeight < MatMaxH + EPS_SMALL Then - Return True + Else + + For Each Material In MachiningMaterials + Dim Param() As String = Material.Split(",".ToCharArray) + If Param.Count() < 2 Then Continue For + Dim CurrMatId As String = String.Empty + For Each Mat In CurrentMachine.Materials + If Mat.sName = EstCalc.GetMaterialName Then + CurrMatId = Mat.nId.ToString() + Exit For + End If + Next + If Param(0) = CurrMatId Then + Dim MatMinH As Double = 0 + StringToDouble(Param(1), MatMinH) + Dim MatMaxH As Double = 0 + StringToDouble(Param(2), MatMaxH) + If EstCalc.GetRawHeight > MatMinH - EPS_SMALL And EstCalc.GetRawHeight < MatMaxH + EPS_SMALL Then + Return True + End If End If - End If - Next + Next + + End If + Return False Else Return True @@ -624,6 +716,53 @@ Public Class CurrMachWindowVM End If End Function + 'Private Function VerifyMatThickCompatibility() As Boolean + ' If Not IsNothing(m_CurrentMachine.CurrMat) Then + ' Dim SysNotes As String = String.Empty + ' EgtMdbGetCurrMachiningParam(MCH_MP.SYSNOTES, SysNotes) + ' If SysNotes <> String.Empty Then + ' Dim MachiningMaterials() = SysNotes.Split(";".ToCharArray) + ' SysNotes = String.Empty + ' If m_CurrentMachine.bWaterJet Then + ' For Each Material As Object In MachiningMaterials + ' Dim Param() As String = Material.Split(",".ToCharArray) + ' Dim SubParam() As String = Param(0).Split(".".ToCharArray) + ' If SubParam(0) = m_CurrentMachine.CurrMat.nId.ToString() AndAlso SubParam.Count > 1 AndAlso SubParam(1) = m_CurrentMachine.CurrMat.SubId.ToString() Then + ' Dim dRawHeight = GetRawHeight() + ' Dim MatMinH As Double = 0 + ' StringToDouble(Param(1), MatMinH) + ' Dim MatMaxH As Double = 0 + ' StringToDouble(Param(2), MatMaxH) + ' If dRawHeight > MatMinH - EPS_SMALL And dRawHeight < MatMaxH + EPS_SMALL Then + ' Return True + ' End If + ' End If + ' Next + ' Else + ' For Each Material As Object In MachiningMaterials + ' Dim Param() As String = Material.Split(",".ToCharArray) + ' If Param(0) = m_CurrentMachine.CurrMat.nId.ToString() Then + ' Dim dRawHeight = GetRawHeight() + ' Dim MatMinH As Double = 0 + ' StringToDouble(Param(1), MatMinH) + ' Dim MatMaxH As Double = 0 + ' StringToDouble(Param(2), MatMaxH) + ' If dRawHeight > MatMinH - EPS_SMALL And dRawHeight < MatMaxH + EPS_SMALL Then + ' Return True + ' End If + ' End If + ' Next + ' End If + + ' Return False + ' Else + ' Return False + ' End If + ' Else + ' Return True + ' End If + 'End Function + #End Region ' METHODS End Class diff --git a/EgtStoneLib/CamAuto.vb b/EgtStoneLib/CamAuto.vb index 3d32098..9766be5 100644 --- a/EgtStoneLib/CamAuto.vb +++ b/EgtStoneLib/CamAuto.vb @@ -668,6 +668,9 @@ Friend Module CamAuto End If ' Lo sposto dalla lavorazione al pezzo Dim nId As Integer = EgtGetFirstInGroup(nMchPvId) + + If nId = GDB_ID.NULL Then Return False + While nId <> GDB_ID.NULL EgtRelocateGlob(nId, nPartPvId) nId = EgtGetFirstInGroup(nMchPvId) diff --git a/EgtStoneLib/ConstMachIni.vb b/EgtStoneLib/ConstMachIni.vb index 5e651eb..fc22a66 100644 --- a/EgtStoneLib/ConstMachIni.vb +++ b/EgtStoneLib/ConstMachIni.vb @@ -253,11 +253,13 @@ Public Const K_CURRDRIPSAWING As String = "CurrDripSawing" Public Const K_CURRDRIPDRILLING As String = "CurrDripDrilling" Public Const K_CURRWATERJETTING As String = "CurrWaterJetting" + Public Const K_CURRWATERJETTINGQUALITY As String = "CurrWaterJettingQuality" Public Const S_MATERIALS As String = "Materials" Public Const K_CURRMATERIAL As String = "CurrMaterial" Public Const K_CURROFFICEMATERIAL As String = "CurrOfficeMaterial" Public Const K_MATERIAL As String = "Material" + Public Const K_FROMDBWATERJET As String = "FromDBWaterJet" Public Const S_SETUP As String = "SetUp" Public Const K_DEFAULT As String = "Default" diff --git a/EgtStoneLib/CurrentMachine.vb b/EgtStoneLib/CurrentMachine.vb index e41ec89..3e4cdb0 100644 --- a/EgtStoneLib/CurrentMachine.vb +++ b/EgtStoneLib/CurrentMachine.vb @@ -86,6 +86,9 @@ Public Module CurrentMachine Private m_bPolishingWheel As Boolean = False Private m_bWaterJet As Boolean = False + ' Abilitazione DB WaterJet + Private m_bFromDBWaterJet As Boolean = False + ' Flag per visualizzazione TcPos, Testa/uscita e Note utente Private m_nShowToolChanger As Integer = 0 ' 0=no, 1=tutti utensili, 2=solo lame Private m_bShowHeadExit As Boolean = False @@ -123,6 +126,7 @@ Public Module CurrentMachine Private m_sCurrDripSawing As String = String.Empty Private m_sCurrDripDrilling As String = String.Empty Private m_sCurrWaterJetting As String = String.Empty + Private m_sCurrWaterJettingQuality As String = String.Empty ' Spessore sottopezzo Private m_dAdditionalTable As Double = 0 @@ -162,6 +166,9 @@ Public Module CurrentMachine ' Lista dei materiali Private m_Materials As New ObservableCollection(Of Material) + ' Lista delle qualità di lavorazioni disponibili nel WaterJet + Private m_Qualities As New ObservableCollection(Of String) + ' Massimo id della lista materiali nel file ini Private m_MaxIdMat As Integer = 0 @@ -559,6 +566,12 @@ Public Module CurrentMachine End Get End Property + Friend ReadOnly Property bFromDBWaterJet As Boolean + Get + Return m_bFromDBWaterJet + End Get + End Property + Friend ReadOnly Property ShowToolChanger As Integer Get Return m_nShowToolChanger @@ -828,6 +841,17 @@ Friend Property sCurrMillNoTip As String End Set End Property + Friend Property sCurrWaterJettingQuality As String + Get + Return m_sCurrWaterJettingQuality + End Get + Set(value As String) + If WritePrivateProfileString(S_MACH_MACH, K_CURRWATERJETTINGQUALITY, value, sMachIniFile) Then + m_sCurrWaterJettingQuality = value + End If + End Set + End Property + Friend ReadOnly Property WaterJettingActive As Boolean Get Return m_bWaterJetting AndAlso Not String.IsNullOrWhiteSpace(m_sCurrWaterJetting) @@ -1006,6 +1030,12 @@ Friend Property sCurrMillNoTip As String End Get End Property + Friend ReadOnly Property Qualities As ObservableCollection(Of String) + Get + Return m_Qualities + End Get + End Property + Friend Sub AddMaterial(value As Material) For Each Material In Materials If Material.nId = value.nId Then @@ -1089,9 +1119,13 @@ Friend Property sCurrMillNoTip As String If Not IsNothing(value) Then Dim CurrMatId As String = value.nId.ToString Dim sKey As String = If(m_bOffice, K_CURROFFICEMATERIAL, K_CURRMATERIAL) - WritePrivateProfileString(S_MATERIALS, sKey, CurrMatId, sMachIniFile) + If bWaterJet And bFromDBWaterJet Then + WritePrivateProfileString(S_MATERIALS, sKey, CurrMatId & "." & value.SubId, sMachIniFile) + Else + WritePrivateProfileString(S_MATERIALS, sKey, CurrMatId, sMachIniFile) + End If + m_CurrMat = value End If - m_CurrMat = value End Set End Property @@ -1200,6 +1234,8 @@ Friend Property sCurrMillNoTip As String m_bPolishingWheel = (GetPrivateProfileInt(S_TOOLS, K_POLISHINGWHEEL, 0, sMachIniFile) > 0) And bKeyPolish ' waterjet m_bWaterJet = (GetPrivateProfileInt(S_TOOLS, K_WATERJET, 0, sMachIniFile) > 0) And bKeyWJ + ' Leggo abilitazione DB WaterJet + m_bFromDBWaterJet = (GetPrivateProfileInt(S_MATERIALS, K_FROMDBWATERJET, 0, sMachIniFile) > 0) ' Leggo abilitazione visualizzazione TcPos e Head/exit m_nShowToolChanger = GetPrivateProfileInt(S_TOOLS, K_SHOWTOOLCHANGER, 0, sMachIniFile) m_bShowHeadExit = (GetPrivateProfileInt(S_TOOLS, K_SHOWHEADEXIT, 0, sMachIniFile) > 0) @@ -1272,6 +1308,8 @@ Friend Property sCurrMillNoTip As String GetPrivateProfileString(S_MACH_MACH, K_CURRDRIPDRILLING, Nothing, m_sCurrDripDrilling, sMachIniFile) ' waterjetting GetPrivateProfileString(S_MACH_MACH, K_CURRWATERJETTING, Nothing, m_sCurrWaterJetting, sMachIniFile) + ' waterjettingquality + GetPrivateProfileString(S_MACH_MACH, K_CURRWATERJETTINGQUALITY, Nothing, m_sCurrWaterJettingQuality, sMachIniFile) ' Leggo numero di portautensili m_ToolChangerNbr = GetPrivateProfileInt(S_TOOLCHANGER, K_NUMBER, 0, sMachIniFile) @@ -1330,24 +1368,80 @@ Friend Property sCurrMillNoTip As String ' Leggo la lista dei materiali Dim Material As Material = Nothing Dim nIndex As Integer = 1 - While (GetPrivateProfileMaterial(S_MATERIALS, K_MATERIAL & nIndex, Material, sMachIniFile)) - m_Materials.Add(Material) - nIndex += 1 - End While + If m_bWaterJet And m_bFromDBWaterJet Then + LoadWJMaterial(True) + Else + While (GetPrivateProfileMaterial(S_MATERIALS, K_MATERIAL & nIndex, Material, sMachIniFile)) + m_Materials.Add(Material) + nIndex += 1 + End While + End If ' Salvo massimo indice a cui sono arrivato per usarlo quando devo aggiungere nuovi elementi alla lista m_MaxIdMat = nIndex - 1 ' Leggo materiale correntemente attivo + Dim sCurrMatId As String = String.Empty Dim sKey As String = If(m_bOffice, K_CURROFFICEMATERIAL, K_CURRMATERIAL) - Dim CurrMatId As Integer = GetPrivateProfileInt(S_MATERIALS, sKey, 0, sMachIniFile) - For Each Material In Materials - If Material.nId = CurrMatId Then - m_CurrMat = Material - Exit For + EgtUILib.GetPrivateProfileString(S_MATERIALS, sKey, "0", sCurrMatId, sMachIniFile) + If bWaterJet And bFromDBWaterJet Then + Dim sCurrMatIds As String() + sCurrMatIds = sCurrMatId.Split("."c) + If sCurrMatIds.Length > 1 Then + Dim nCurrMatId As Integer + Dim nCurrSubMatId As Integer + If Not Integer.TryParse(sCurrMatIds(0), nCurrMatId) Then nCurrMatId = 0 + If Not Integer.TryParse(sCurrMatIds(1), nCurrSubMatId) Then nCurrSubMatId = 0 + For Each Material In Materials + If Material.nId = nCurrMatId AndAlso Material.SubId = nCurrSubMatId Then + m_CurrMat = Material + Exit For + End If + Next End If - Next + Else + Dim nCurrMatId As Integer + If Not Integer.TryParse(sCurrMatId, nCurrMatId) Then nCurrMatId = 0 + For Each Material In Materials + If Material.nId = nCurrMatId Then + m_CurrMat = Material + Exit For + End If + Next + End If ' Leggo se la macchina ha il tastatore dello spessore lastra m_HasRawProbe = (GetPrivateProfileInt(S_MACH_PROBING, K_ENABLERAWPROBE, 1, sMachIniFile) <> 0) + + ' Se macchina ha Waterjet mostro il bottone per DB Waterjet + OmagOFFICEMap.refMachinePanelVM.NotifyPropertyChanged(NameOf(OmagOFFICEMap.refMachinePanelVM.WjDb_Visibility)) + End Sub + + Public Sub LoadWJMaterial(Optional bIsStart As Boolean = False) + Dim TempCurrMat As Material = CurrMat + ' Svuoto l'attuale lista di materiali e delle qualità + m_Materials.Clear() + m_Qualities.Clear() + ' Leggo valori da file .data e li carico nelle proprietà + Dim sFilePath As String = sMachDir & EgtWPFLib5.WaterjetDbWindowVM.WATERJETDB_PATH + WjMaterialList = EgtWPFLib5.WaterjetDbWindowVM.LoadWjMaterials(sFilePath) + ' definisco la lista delle qualità + m_Qualities.Add("") + m_Qualities.Add("Q1") + m_Qualities.Add("Q2") + m_Qualities.Add("Q3") + m_Qualities.Add("Q4") + m_Qualities.Add("Q5") + m_Qualities.Add("QExtra") + ' costruisco la lista + Dim i As Integer = 0 + Dim sName As String = String.Empty + For i = 0 To WjMaterialList.Count - 1 + sName = WjMaterialList(i).Name + Dim j As Integer = 0 + For j = 0 To WjMaterialList(i).SubMaterialList.Count - 1 + m_Materials.Add(New Material(i + 1, sName & "." & WjMaterialList(i).SubMaterialList(j).Name, j + 1)) + Next + Next + If Not bIsStart Then CurrMat = TempCurrMat End Sub Friend Function IsVacuumMovePossible() As Boolean @@ -1456,6 +1550,7 @@ Public Class Material Private m_nId As Integer Private m_sName As String + Private m_SubId As Integer = 0 Public ReadOnly Property nId As Integer Get @@ -1472,6 +1567,15 @@ Public Class Material End Set End Property + Public Property SubId As Integer + Get + Return m_SubId + End Get + Set(value As Integer) + m_SubId = value + End Set + End Property + Sub New(sName As String, MaterialList As ObservableCollection(Of Material)) Dim nMaxId As Integer = 0 For Each Material In MaterialList @@ -1488,4 +1592,10 @@ Public Class Material m_sName = sName End Sub + Sub New(nId As Integer, sName As String, nSubId As Integer) + m_nId = nId + m_sName = sName + m_SubId = nSubId + End Sub + End Class diff --git a/EgtStoneLib/EstPhoto.vb b/EgtStoneLib/EstPhoto.vb index 6234323..21476f0 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( nNewPhotoId, "OvTab", dAddTable) Return True End Function @@ -482,17 +491,20 @@ 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) Return True End Function diff --git a/EgtStoneLib/SplitAuto.vb b/EgtStoneLib/SplitAuto.vb index a4d097a..232d83f 100644 --- a/EgtStoneLib/SplitAuto.vb +++ b/EgtStoneLib/SplitAuto.vb @@ -160,6 +160,17 @@ Public Module SplitAuto End Function '----------------------------------------------------------------------------------------------- + ' calcolo il numero di tipi di lavorazioni + Friend Sub CountMachiningType(MachSplit As SplitMach, ByRef nCountSawing As Integer, ByRef nCountWaterjetting As Integer, ByRef nCountOtherMachining As Integer) + If MachSplit.m_nType = MCH_OY.SAWING Then + nCountSawing += 1 + ElseIf MachSplit.m_nType = MCH_OY.WATERJETTING Then + nCountWaterjetting += 1 + Else + nCountOtherMachining += 1 + End If + End Sub + Friend Sub ColorMachining(MachSplit As SplitMach, Optional bReset As Boolean = False) EgtDisableModified() ' Assegno stato diff --git a/MachOptionWindow/MachOptionWindowV.xaml b/MachOptionWindow/MachOptionWindowV.xaml index e28ddb7..94b3fa7 100644 --- a/MachOptionWindow/MachOptionWindowV.xaml +++ b/MachOptionWindow/MachOptionWindowV.xaml @@ -75,7 +75,7 @@ + Grid.Row="3" Grid.RowSpan="5" Visibility="{Binding Materials_Visibility}"> @@ -126,7 +126,7 @@ - + - + - + @@ -193,7 +193,7 @@ - + diff --git a/MachOptionWindow/MachOptionWindowVM.vb b/MachOptionWindow/MachOptionWindowVM.vb index 497a10b..695830c 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 @@ -144,13 +144,24 @@ Public Class MachOptionWindowVM End Set End Property + Public ReadOnly Property SawParam_Visibility As Visibility + Get + ' in assenza dell'uscita H1 nascondo i parametri lama + If EgtGetHeadId("H1") = GDB_ID.NULL Then + Return Visibility.Hidden + Else + Return Visibility.Visible + End If + End Get + End Property + #End Region ' Saw Param #Region "Machine Param" 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 +195,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 @@ -194,6 +205,16 @@ Public Class MachOptionWindowVM End Set End Property + Public ReadOnly Property MillingParam_Visibility As Visibility + Get + If bWaterJet Then + Return Visibility.Hidden + Else + Return Visibility.Visible + End If + End Get + End Property + #End Region ' Milling Param #Region "Nesting Param" @@ -264,7 +285,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 @@ -382,6 +403,12 @@ Public Class MachOptionWindowVM End Set End Property + Public ReadOnly Property Materials_Visibility As Visibility + Get + Return If(CurrentMachine.bWaterJet, Visibility.Collapsed, Visibility.Visible) + End Get + End Property + #End Region ' Material ' Definizione comandi @@ -469,7 +496,11 @@ Public Class MachOptionWindowVM End Property Public ReadOnly Property MillingParamMsg As String Get - Return EgtMsg(MSG_ALARMSPAGEUC + 29) + If bWaterJet Then + Return EgtMsg(91058) + Else + Return EgtMsg(MSG_ALARMSPAGEUC + 29) + End If End Get End Property Public ReadOnly Property CornerCutsMsg As String diff --git a/MachinePanel/MachinePanelV.xaml b/MachinePanel/MachinePanelV.xaml index 81679cb..6ff12dc 100644 --- a/MachinePanel/MachinePanelV.xaml +++ b/MachinePanel/MachinePanelV.xaml @@ -22,5 +22,7 @@ +