diff --git a/EgtBEAMWALL.Core/BeamM.vb b/EgtBEAMWALL.Core/BeamM.vb index f11e70bc..4c8910bb 100644 --- a/EgtBEAMWALL.Core/BeamM.vb +++ b/EgtBEAMWALL.Core/BeamM.vb @@ -165,12 +165,25 @@ Public Class BeamM Private Shared Function LoadBTLFeatures(nPartId As Integer) As List(Of BTLFeatureM) Dim TempList As New List(Of BTLFeatureM) + ' Aggiungo outline + Dim nOutLayerId As Integer = EgtGetFirstNameInGroup(nPartId, OUTLINE) + Dim nOutlineId As Integer = EgtGetFirstInGroup(nOutLayerId) + While nOutlineId <> GDB_ID.NULL + ' verifico che sia una feature + Dim nGRP As Integer + If EgtGetInfo(nOutlineId, BTL_FTR_GRP, nGRP) AndAlso Not EgtExistsInfo(nOutlineId, BTL_FTR_MAINID) Then + ' creo la feature + TempList.Add(BTLFeatureM.CreateBTLFeature(Nothing, nOutlineId)) + End If + nOutlineId = EgtGetNext(nOutlineId) + End While + ' Aggiungo feature Dim nProcessingId As Integer = EgtGetFirstNameInGroup(nPartId, PROCESSINGS) Dim nFeatureId As Integer = EgtGetFirstInGroup(nProcessingId) While nFeatureId <> GDB_ID.NULL ' verifico che sia una feature Dim nGRP As Integer - If EgtGetInfo(nFeatureId, BTL_FTR_GRP, nGRP) Then + If EgtGetInfo(nFeatureId, BTL_FTR_GRP, nGRP) AndAlso Not EgtExistsInfo(nFeatureId, BTL_FTR_MAINID) Then ' creo la feature TempList.Add(BTLFeatureM.CreateBTLFeature(Nothing, nFeatureId)) End If diff --git a/EgtBEAMWALL.Core/WallM.vb b/EgtBEAMWALL.Core/WallM.vb index da918ddb..5af428d9 100644 --- a/EgtBEAMWALL.Core/WallM.vb +++ b/EgtBEAMWALL.Core/WallM.vb @@ -78,12 +78,25 @@ Public Class WallM Private Shared Function LoadBTLFeatures(nPartId As Integer) As List(Of BTLFeatureM) Dim TempList As New List(Of BTLFeatureM) + ' Aggiungo outline + Dim nOutLayerId As Integer = EgtGetFirstNameInGroup(nPartId, OUTLINE) + Dim nOutlineId As Integer = EgtGetFirstInGroup(nOutLayerId) + While nOutlineId <> GDB_ID.NULL + ' verifico che sia una feature + Dim nGRP As Integer + If EgtGetInfo(nOutlineId, BTL_FTR_GRP, nGRP) AndAlso Not EgtExistsInfo(nOutlineId, BTL_FTR_MAINID) Then + ' creo la feature + TempList.Add(BTLFeatureM.CreateBTLFeature(Nothing, nOutlineId)) + End If + nOutlineId = EgtGetNext(nOutlineId) + End While + ' Aggiungo feature Dim nProcessingId As Integer = EgtGetFirstNameInGroup(nPartId, PROCESSINGS) Dim nFeatureId As Integer = EgtGetFirstInGroup(nProcessingId) While nFeatureId <> GDB_ID.NULL ' verifico che sia una feature Dim nGRP As Integer - If EgtGetInfo(nFeatureId, BTL_FTR_GRP, nGRP) Then + If EgtGetInfo(nFeatureId, BTL_FTR_GRP, nGRP) AndAlso Not EgtExistsInfo(nFeatureId, BTL_FTR_MAINID) Then ' creo la feature TempList.Add(BTLFeatureM.CreateBTLFeature(Nothing, nFeatureId)) End If diff --git a/EgtBEAMWALL.Supervisor/My Project/AssemblyInfo.vb b/EgtBEAMWALL.Supervisor/My Project/AssemblyInfo.vb index 1941705e..a45d2170 100644 --- a/EgtBEAMWALL.Supervisor/My Project/AssemblyInfo.vb +++ b/EgtBEAMWALL.Supervisor/My Project/AssemblyInfo.vb @@ -13,9 +13,9 @@ Imports System.Windows - + - + @@ -55,5 +55,5 @@ Imports System.Windows ' by using the '*' as shown below: ' - - + + diff --git a/EgtBEAMWALL.ViewerOptimizer/BTLParam/BTLPartVM.vb b/EgtBEAMWALL.ViewerOptimizer/BTLParam/BTLPartVM.vb index 094ca9fd..ca594f41 100644 --- a/EgtBEAMWALL.ViewerOptimizer/BTLParam/BTLPartVM.vb +++ b/EgtBEAMWALL.ViewerOptimizer/BTLParam/BTLPartVM.vb @@ -1284,7 +1284,6 @@ Public Class BTLPartVM If Map.refMainMenuVM.SelPage = Pages.VIEW Then If Not IsNothing(m_SelBTLFeatureVM) Then DirectCast(m_SelBTLFeatureVM, BTLFeatureVM).SelGeomFeature() - EgtDraw() ' imposto path disegno da mostrare in BottomPanel Map.refBottomPanelVM.SetCurrDraw(DirectCast(m_SelBTLFeatureVM, BTLFeatureVM).sDrawPath) ' seleziono pagina BottomPanel @@ -1297,6 +1296,7 @@ Public Class BTLPartVM EgtDeselectAll() End If End If + EgtDraw() NotifyPropertyChanged(NameOf(SelBTLFeatureVM)) End Set End Property @@ -1672,7 +1672,9 @@ Public Class BTLPartVM Dim NewPart As BTLPartM = BTLPartM.CreateBTLPart(nNewPartId) 'aggiungo tutte le sue feature For Each Feature In m_BTLFeatureVMList - Feature.Copy(NewPart) + If Feature.nPRC <> 250 And Feature.nPRC <> 251 And Feature.nPRC <> 252 Then + Feature.Copy(NewPart) + End If Next ' aggiungo pezzo alla lista m_BTLStructureM.AddBTLPart(NewPart) diff --git a/EgtBEAMWALL.ViewerOptimizer/InstrumentPanel/MyInstrumentPanelVM.vb b/EgtBEAMWALL.ViewerOptimizer/InstrumentPanel/MyInstrumentPanelVM.vb index 326c38fb..35ef932a 100644 --- a/EgtBEAMWALL.ViewerOptimizer/InstrumentPanel/MyInstrumentPanelVM.vb +++ b/EgtBEAMWALL.ViewerOptimizer/InstrumentPanel/MyInstrumentPanelVM.vb @@ -1,4 +1,5 @@ Imports System.Collections.ObjectModel +Imports System.IO Imports EgtWPFLib5 Imports EgtBEAMWALL.Core @@ -170,6 +171,8 @@ Public Class MyInstrumentPanelVM Case Core.CalcStates.OK Bar.nCmdType = CalcIntegration.CmdType.GENERATE Case Else + Dim sBTLPartFilePath As String = Map.refProjManagerVM.CurrProj.sProjDirPath & "\" & CurrPart.nPDN.ToString() & ".ori.bwe" + If File.Exists( sBTLPartFilePath) Then File.Delete( sBTLPartFilePath) Bar.nCmdType = CalcIntegration.CmdType.CHECKGEN End Select TempBarList(PartIndex) = Bar @@ -184,6 +187,8 @@ Public Class MyInstrumentPanelVM Case Core.CalcStates.OK Bar.nCmdType = CalcIntegration.CmdType.GENERATE Case Else + Dim sBTLPartFilePath As String = Map.refProjManagerVM.CurrProj.sProjDirPath & "\" & Map.refProjectVM.BTLStructureVM.SelBTLPart.nPDN.ToString() & ".ori.bwe" + If File.Exists( sBTLPartFilePath) Then File.Delete( sBTLPartFilePath) Bar.nCmdType = CalcIntegration.CmdType.CHECKGEN End Select TempBarList(0) = Bar @@ -201,10 +206,12 @@ Public Class MyInstrumentPanelVM Dim Bar As New CalcIntegration.Bar With {.nBarId = CurrMachGroup.Id, .nBarType = ProjectType.PROD, .bBarOk = True} - Select Case CurrMachGroup.nState + Select Case CurrMachGroup.nGlobalState Case Core.CalcStates.OK Bar.nCmdType = CalcIntegration.CmdType.GENERATE Case Else + Dim sMachGroupFilePath As String = Map.refProdManagerVM.CurrProd.sProdDirPath & "\" & CurrMachGroup.Name.ToString() & ".ori.bwe" + If File.Exists( sMachGroupFilePath) Then File.Delete( sMachGroupFilePath) Bar.nCmdType = CalcIntegration.CmdType.CHECKGEN End Select TempBarList(PartIndex) = Bar @@ -216,10 +223,12 @@ Public Class MyInstrumentPanelVM .nBarType = ProjectType.PROD, .bBarOk = True} Dim SelMachGroup As MyMachGroupVM = Map.refMachGroupPanelVM.SelectedMachGroup - Select Case SelMachGroup.nState + Select Case SelMachGroup.nGlobalState Case Core.CalcStates.OK Bar.nCmdType = CalcIntegration.CmdType.GENERATE Case Else + Dim sMachGroupFilePath As String = Map.refProdManagerVM.CurrProd.sProdDirPath & "\" & SelMachGroup.Name.ToString() & ".ori.bwe" + If File.Exists( sMachGroupFilePath) Then File.Delete( sMachGroupFilePath) Bar.nCmdType = CalcIntegration.CmdType.CHECKGEN End Select TempBarList(0) = Bar @@ -279,6 +288,10 @@ Public Class MyInstrumentPanelVM .nBarType = ProjectType.PROJ, .bBarOk = True, .nCmdType = CalcIntegration.CmdType.SIMULATE} + If Map.refProjectVM.BTLStructureVM.SelBTLPart.nGlobalState <> Core.CalcStates.OK Then + Dim sBTLPartFilePath As String = Map.refProjManagerVM.CurrProj.sProjDirPath & "\" & Map.refProjectVM.BTLStructureVM.SelBTLPart.nPDN.ToString() & ".ori.bwe" + If File.Exists( sBTLPartFilePath) Then File.Delete( sBTLPartFilePath) + End If TempBarList(0) = Bar BarList = TempBarList Else @@ -292,6 +305,11 @@ Public Class MyInstrumentPanelVM .nBarType = ProjectType.PROD, .bBarOk = True, .nCmdType = CalcIntegration.CmdType.SIMULATE} + Dim SelMachGroup As MyMachGroupVM = Map.refMachGroupPanelVM.SelectedMachGroup + If SelMachGroup.nGlobalState <> Core.CalcStates.OK Then + Dim sMachGroupFilePath As String = Map.refProdManagerVM.CurrProd.sProdDirPath & "\" & SelMachGroup.Name.ToString() & ".ori.bwe" + If File.Exists( sMachGroupFilePath) Then File.Delete( sMachGroupFilePath) + End If TempBarList(0) = Bar BarList = TempBarList Else diff --git a/EgtBEAMWALL.ViewerOptimizer/Integration/CalcIntegration.vb b/EgtBEAMWALL.ViewerOptimizer/Integration/CalcIntegration.vb index f12b8fbe..2a3fe930 100644 --- a/EgtBEAMWALL.ViewerOptimizer/Integration/CalcIntegration.vb +++ b/EgtBEAMWALL.ViewerOptimizer/Integration/CalcIntegration.vb @@ -222,7 +222,7 @@ Public Class CalcIntegration Dim nPDN As Integer = 0 EgtGetInfo(nPartId, BTL_PRT_PDN, nPDN) Dim sPartFilePath As String = sProjDirPath & "\" & nPDN.ToString() & ".bwe" - bOk = EgtSaveObjToFile(nPartId, sPartFilePath, NGE.BIN) + bOk = EgtSaveObjToFile(nPartId, sPartFilePath, NGE.CMPTEXT) ' Ripristino visibilita' pezzo EgtSetMode(nPartId, nOldPartMode) @@ -258,8 +258,10 @@ Public Class CalcIntegration End If ' Salvo gruppo di lavorazione nel suo progetto - Dim sMachGroupFilePath As String = sProjDirPath & "\" & nMachGroupId.ToString() & ".bwe" - If EgtSaveObjToFile(nMachGroupId, sMachGroupFilePath, NGE.BIN) Then + Dim sMachGroupName As String = "" + EgtGetMachGroupName(nMachGroupId, sMachGroupName) + Dim sMachGroupFilePath As String = sProjDirPath & "\" & sMachGroupName & ".bwe" + If EgtSaveObjToFile(nMachGroupId, sMachGroupFilePath, NGE.CMPTEXT) Then Return sMachGroupFilePath End If Return String.Empty @@ -268,6 +270,27 @@ Public Class CalcIntegration Private Shared Function UpdateCutIdAndTaskId(nPartId As Integer) As Boolean ' Assegno Id a CutId per calcoli EgtSetInfo(nPartId, "CUTID", nPartId, True) + + ' Assegno TASKID agli outline per calcoli + Dim nOutLayerId As Integer = EgtGetFirstNameInGroup(nPartId, OUTLINE) + Dim nOutlineId As Integer = EgtGetFirstInGroup(nOutLayerId) + While nOutlineId <> GDB_ID.NULL + ' verifico che sia una feature + Dim nGRP As Integer + If EgtGetInfo(nOutlineId, BTL_FTR_GRP, nGRP) Then + ' verifico se ha un principale + Dim nMainOffsId As Integer + If EgtGetInfo(nOutlineId, BTL_FTR_MAINID, nMainOffsId) Then + ' assegno TASKID alla feature per calcoli + EgtSetInfo(nOutlineId, "TASKID", nOutlineId + nMainOffsId, True) + Else + ' assegno TASKID alla feature per calcoli + EgtSetInfo(nOutlineId, "TASKID", nOutlineId, True) + End If + End If + nOutlineId = EgtGetNext(nOutlineId) + End While + ' Assegno TASKID alle feature per calcoli Dim nProcessingId As Integer = EgtGetFirstNameInGroup(nPartId, PROCESSINGS) Dim nFeatureId As Integer = EgtGetFirstInGroup(nProcessingId) @@ -334,97 +357,10 @@ Public Class CalcIntegration ElseIf line.StartsWith("CUTID=") Then Dim nVal As Integer? = GetVal(line, "CUTID") cutId = If(nVal IsNot Nothing, nVal.Value, 0) - 'If cutId <> 0 AndAlso cutId <> prevCutId Then - ' ' aggiornamento globale pezzo precedente - ' If prevCutId <> GDB_ID.NULL Then - ' EgtSetInfo(prevCutId, If(Bar.nBarType = ProjectType.PROJ, ITG_PROJ_ROT, ITG_PROD_ROT), dTotRot, True) - ' dTotRot = 0 - ' End If - ' ' aggiornamento risultati in struttura BTL - ' If Bar.nBarType = ProjectType.PROJ Then - ' ' cerco pezzo in btl structure da id - ' For Each Part In Map.refProjectVM.BTLStructureVM.BTLPartVMList - ' If Part.nPartId = cutId Then - ' currBTLPart = Part - ' Exit For - ' End If - ' Next - ' ElseIf Bar.nBarType = ProjectType.PROD Then - ' For Each MachGroup As MyMachGroupVM In Map.refMachGroupPanelVM.MachGroupVMList - ' For Each Part In MachGroup.PartVMList - ' If Part.nPartId = cutId Then - ' currPart = Part - ' Exit For - ' End If - ' Next - ' Next - ' End If - ' prevCutId = cutId - 'End If - ElseIf line.StartsWith("TASKID=") Then Dim nVal As Integer? = GetVal(line, "TASKID") taskId = (If(nVal IsNot Nothing, nVal.Value, 0)) ProcessResultAdd(ProcessResultList, ProcessResult.CreateTaskResult(cutId, taskId, nErr, sMsg, dRot), Bar) - '' se taskid diverso da zero, errore feature - 'If taskId <> 0 Then - ' EgtSetInfo(taskId, If(Bar.nBarType = ProjectType.PROJ, ITG_PROJ_ERR, ITG_PROD_ERR), nErr, True) - ' EgtSetInfo(taskId, If(Bar.nBarType = ProjectType.PROJ, ITG_PROJ_MSG, ITG_PROD_MSG), sMsg, True) - ' EgtSetInfo(taskId, If(Bar.nBarType = ProjectType.PROJ, ITG_PROJ_ROT, ITG_PROD_ROT), dRot, True) - ' ' aggiornamento risultati in struttura BTL - ' If Bar.nBarType = ProjectType.PROJ Then - ' ' cerco task in btl structure da id - ' If Not IsNothing(currBTLPart) Then - ' For Each Feature In currBTLPart.BTLFeatureVMList - ' If Feature.nFeatureId = taskId Then - ' DirectCast(Feature, BTLFeatureVM).CalcFeatureUpdate(True, nErr, dRot, nFall, sMsg) - ' Exit For - ' End If - ' Next - ' End If - ' ElseIf Bar.nBarType = ProjectType.PROD Then - ' ' cerco task in MachGroupList da id - ' If Not IsNothing(currPart) Then - ' For Each Feature In currPart.FeaturevMList - ' If Feature.nFeatureId = taskId Then - ' DirectCast(Feature, BTLFeatureVM).CalcFeatureUpdate(True, nErr, dRot, nFall, sMsg) - ' Exit For - ' End If - ' Next - ' End If - ' End If - '' se taskid uguale a zero e cutit diverso da zero, errore pezzo - 'ElseIf cutId <> 0 Then - ' EgtSetInfo(cutId, If(Bar.nBarType = ProjectType.PROJ, ITG_PROJ_ERR, ITG_PROD_ERR), nErr, True) - ' EgtSetInfo(cutId, If(Bar.nBarType = ProjectType.PROJ, ITG_PROJ_MSG, ITG_PROD_MSG), sMsg, True) - ' ' aggiorno in struttura btl - ' If Bar.nBarType = ProjectType.PROJ Then - ' If Not IsNothing(currBTLPart) Then currBTLPart.CalcPartUpdate(True, nErr, dRot, nFall, sMsg) - ' ElseIf Bar.nBarType = ProjectType.PROD Then - ' If Not IsNothing(currPart) Then currPart.CalcPartUpdate(True, nErr, dRot, nFall, sMsg) - ' End If - '' se taskid e cutid uguali a zero, errore barra - 'Else - ' If Bar.nBarType = ProjectType.PROJ Then - ' ' cerco pezzo in btl structure da id - ' For Each Part In Map.refProjectVM.BTLStructureVM.BTLPartVMList - ' If Part.nPartId = Bar.nBarId Then - ' currBTLPart = Part - ' Exit For - ' End If - ' Next - ' If Not IsNothing(currBTLPart) Then - ' EgtSetInfo(Bar.nBarId, ITG_PROJ_ERR, nErr, True) - ' EgtSetInfo(Bar.nBarId, ITG_PROJ_MSG, sMsg, True) - ' currBTLPart.CalcPartUpdate(True, nErr, dRot, nFall, sMsg) - ' For Each Feature In currBTLPart.BTLFeatureVMList - ' EgtSetInfo(Feature.nFeatureId, ITG_PROJ_ERR, nErr, True) - ' EgtSetInfo(Feature.nFeatureId, ITG_PROJ_MSG, sMsg, True) - ' Feature.CalcFeatureUpdate( True, nErr, dRot, nFall, sMsg) - ' Next - ' End If - ' End If - 'End If ElseIf line.StartsWith("FALL=") Then Dim nVal As Integer? = GetVal(line, "FALL") nFall = (If(nVal IsNot Nothing, nVal.Value, 0)) @@ -530,349 +466,14 @@ Public Class CalcIntegration End If - 'For Each line As String In lines - - ' If line.StartsWith("ERR=") Then - ' Dim nVal As Integer? = GetVal(line, "ERR") - ' nErr = (If(nVal IsNot Nothing, nVal.Value, 0)) - ' sMsg = "" - ' dRot = 0 - ' cutId = 0 - ' taskId = 0 - ' ElseIf line.StartsWith("ROT=") Then - ' Dim nVal As Integer? = GetVal(line, "ROT") - ' Dim nRot As Integer = (If(nVal IsNot Nothing, nVal.Value, 0)) - ' dRot = Math.Abs(((4 - nRot) Mod 4) * 90) - ' dPartRot = Math.Max(dPartRot, dRot) - ' dTotRot = Math.Max(dTotRot, dRot) - ' ElseIf line.StartsWith("CUTID=") Then - ' Dim nVal As Integer? = GetVal(line, "CUTID") - ' cutId = If(nVal IsNot Nothing, nVal.Value, 0) - ' If cutId <> 0 AndAlso cutId <> prevCutId Then - ' ' aggiornamento globale pezzo precedente - ' If prevCutId <> GDB_ID.NULL Then - ' EgtSetInfo(prevCutId, If(Bar.nBarType = ProjectType.PROJ, ITG_PROJ_ROT, ITG_PROD_ROT), dTotRot, True) - ' dTotRot = 0 - ' End If - ' ' aggiornamento risultati in struttura BTL - ' If Bar.nBarType = ProjectType.PROJ Then - ' ' cerco pezzo in btl structure da id - ' For Each Part In Map.refProjectVM.BTLStructureVM.BTLPartVMList - ' If Part.nPartId = cutId Then - ' currBTLPart = Part - ' Exit For - ' End If - ' Next - ' ElseIf Bar.nBarType = ProjectType.PROD Then - ' For Each MachGroup As MyMachGroupVM In Map.refMachGroupPanelVM.MachGroupVMList - ' For Each Part In MachGroup.PartVMList - ' If Part.nPartId = cutId Then - ' currPart = Part - ' Exit For - ' End If - ' Next - ' Next - ' End If - ' prevCutId = cutId - ' End If - - ' ElseIf line.StartsWith("TASKID=") Then - ' Dim nVal As Integer? = GetVal(line, "TASKID") - ' taskId = (If(nVal IsNot Nothing, nVal.Value, 0)) - ' ' se taskid diverso da zero, errore feature - ' If taskId <> 0 Then - ' EgtSetInfo(taskId, If(Bar.nBarType = ProjectType.PROJ, ITG_PROJ_ERR, ITG_PROD_ERR), nErr, True) - ' EgtSetInfo(taskId, If(Bar.nBarType = ProjectType.PROJ, ITG_PROJ_MSG, ITG_PROD_MSG), sMsg, True) - ' EgtSetInfo(taskId, If(Bar.nBarType = ProjectType.PROJ, ITG_PROJ_ROT, ITG_PROD_ROT), dRot, True) - ' ' aggiornamento risultati in struttura BTL - ' If Bar.nBarType = ProjectType.PROJ Then - ' ' cerco task in btl structure da id - ' If Not IsNothing(currBTLPart) Then - ' For Each Feature In currBTLPart.BTLFeatureVMList - ' If Feature.nFeatureId = taskId Then - ' DirectCast(Feature, BTLFeatureVM).CalcFeatureUpdate(True, nErr, dRot, nFall, sMsg) - ' Exit For - ' End If - ' Next - ' End If - ' ElseIf Bar.nBarType = ProjectType.PROD Then - ' ' cerco task in MachGroupList da id - ' If Not IsNothing(currPart) Then - ' For Each Feature In currPart.FeatureVMList - ' If Feature.nFeatureId = taskId Then - ' DirectCast(Feature, BTLFeatureVM).CalcFeatureUpdate(True, nErr, dRot, nFall, sMsg) - ' Exit For - ' End If - ' Next - ' End If - ' End If - ' ' se taskid uguale a zero e cutit diverso da zero, errore pezzo - ' ElseIf cutId <> 0 Then - ' EgtSetInfo(cutId, If(Bar.nBarType = ProjectType.PROJ, ITG_PROJ_ERR, ITG_PROD_ERR), nErr, True) - ' EgtSetInfo(cutId, If(Bar.nBarType = ProjectType.PROJ, ITG_PROJ_MSG, ITG_PROD_MSG), sMsg, True) - ' ' aggiorno in struttura btl - ' If Bar.nBarType = ProjectType.PROJ Then - ' If Not IsNothing(currBTLPart) Then currBTLPart.CalcPartUpdate(True, nErr, dRot, nFall, sMsg) - ' ElseIf Bar.nBarType = ProjectType.PROD Then - ' If Not IsNothing(currPart) Then currPart.CalcPartUpdate(True, nErr, dRot, nFall, sMsg) - ' End If - ' ' se taskid e cutid uguali a zero, errore barra - ' Else - ' If Bar.nBarType = ProjectType.PROJ Then - ' ' cerco pezzo in btl structure da id - ' For Each Part In Map.refProjectVM.BTLStructureVM.BTLPartVMList - ' If Part.nPartId = Bar.nBarId Then - ' currBTLPart = Part - ' Exit For - ' End If - ' Next - ' If Not IsNothing(currBTLPart) Then - ' EgtSetInfo(Bar.nBarId, ITG_PROJ_ERR, nErr, True) - ' EgtSetInfo(Bar.nBarId, ITG_PROJ_MSG, sMsg, True) - ' currBTLPart.CalcPartUpdate(True, nErr, dRot, nFall, sMsg) - ' For Each Feature In currBTLPart.BTLFeatureVMList - ' EgtSetInfo(Feature.nFeatureId, ITG_PROJ_ERR, nErr, True) - ' EgtSetInfo(Feature.nFeatureId, ITG_PROJ_MSG, sMsg, True) - ' Feature.CalcFeatureUpdate(True, nErr, dRot, nFall, sMsg) - ' Next - ' End If - ' End If - ' End If - ' ElseIf line.StartsWith("FALL=") Then - ' Dim nVal As Integer? = GetVal(line, "FALL") - ' If Not IsNothing(nVal) Then - ' nFall = nVal - ' Else - ' nFall = 0 - ' End If - ' ElseIf line.StartsWith("TIME=") Then - ' Dim nVal As Integer? = GetVal(line, "TIME") - ' nTotTime = (If(nVal IsNot Nothing, nVal.Value, 0)) - ' If Bar.nBarType = ProjectType.PROJ AndAlso Not IsNothing(currBTLPart) Then - ' EgtSetInfo(currBTLPart.nPartId, If(Bar.nBarType = ProjectType.PROJ, ITG_PROJ_TIME, ITG_PROD_TIME), nTotTime, True) - ' End If - - ' ElseIf Not String.IsNullOrWhiteSpace(line) AndAlso line <> "---" Then - ' sMsg = line - ' End If - 'Next - Else bErrors = True nLastErr = 25 sLastMsg = "Execution Error" End If - '' aggiornamento risultati in struttura BTL - 'If Bar.nBarType = ProjectType.PROJ Then - ' ' cerco pezzo in btl structure da id - ' For Each Part In Map.refProjectVM.BTLStructureVM.BTLPartVMList - ' If Part.nPartId = Bar.nBarId Then - ' ' leggo errori da geometria e li aggiorno in struttura btl - ' DirectCast(Part, BTLPartVM).CalcGlobalUpdate() - ' ' aggiungo nota che indica macchina - - ' End If - ' Next - 'ElseIf Bar.nBarType = ProjectType.PROD Then - ' ' cerco pezzo in MachGroupList da id - ' For Each MachGroup As MyMachGroupVM In Map.refMachGroupPanelVM.MachGroupVMList - ' If MachGroup.Id = Bar.nBarId Then - ' For Each Part In MachGroup.PartVMList - ' ' leggo errori da geometria e li aggiorno in struttura btl - ' Part.CalcGlobalUpdate() - ' Next - ' MachGroup.CalcMachGroupUpdate() - ' End If - ' Next - 'End If - End Sub - 'Private Shared Sub ProcessResults(Bar As Bar) - - ' Dim BtlPath As String = Bar.sBarPath - ' Dim ResPath As String = Path.ChangeExtension(BtlPath, ".txt") - ' Dim bErrors As Boolean = False - ' Dim nLastErr As Integer = 0 - ' Dim sLastMsg As String = "" - ' Dim nCurrCutId As Integer = 0 - ' Dim nTotTime As Integer = 0 - - ' If File.Exists(ResPath) Then - - ' Dim nErr As Integer = 0 - ' Dim sMsg As String = "" - ' Dim dRot As Double = 0 - ' Dim nFall As Integer = 0 - ' Dim dPartRot As Double = 0 - ' Dim dTotRot As Double = 0 - ' Dim cutId As Integer = 0 - ' Dim taskId As Integer = 0 - ' Dim prevCutId As Integer = GDB_ID.NULL - ' Dim currBTLPart As BTLPartVM = Nothing - ' Dim currPart As PartVM - - ' Dim lines As String() = System.IO.File.ReadAllLines(ResPath) - ' For Each line As String In lines - - ' If line.StartsWith("ERR=") Then - ' Dim nVal As Integer? = GetVal(line, "ERR") - ' nErr = (If(nVal IsNot Nothing, nVal.Value, 0)) - ' sMsg = "" - ' dRot = 0 - ' cutId = 0 - ' taskId = 0 - ' ElseIf line.StartsWith("ROT=") Then - ' Dim nVal As Integer? = GetVal(line, "ROT") - ' Dim nRot As Integer = (If(nVal IsNot Nothing, nVal.Value, 0)) - ' dRot = Math.Abs(((4 - nRot) Mod 4) * 90) - ' dPartRot = Math.Max(dPartRot, dRot) - ' dTotRot = Math.Max(dTotRot, dRot) - ' ElseIf line.StartsWith("CUTID=") Then - ' Dim nVal As Integer? = GetVal(line, "CUTID") - ' cutId = If(nVal IsNot Nothing, nVal.Value, 0) - ' If cutId <> 0 AndAlso cutId <> prevCutId Then - ' ' aggiornamento globale pezzo precedente - ' If prevCutId <> GDB_ID.NULL Then - ' EgtSetInfo(prevCutId, If(Bar.nBarType = ProjectType.PROJ, ITG_PROJ_ROT, ITG_PROD_ROT), dTotRot, True) - ' dTotRot = 0 - ' End If - ' ' aggiornamento risultati in struttura BTL - ' If Bar.nBarType = ProjectType.PROJ Then - ' ' cerco pezzo in btl structure da id - ' For Each Part In Map.refProjectVM.BTLStructureVM.BTLPartVMList - ' If Part.nPartId = cutId Then - ' currBTLPart = Part - ' Exit For - ' End If - ' Next - ' ElseIf Bar.nBarType = ProjectType.PROD Then - ' For Each MachGroup As MyMachGroupVM In Map.refMachGroupPanelVM.MachGroupVMList - ' For Each Part In MachGroup.PartVMList - ' If Part.nPartId = cutId Then - ' currPart = Part - ' Exit For - ' End If - ' Next - ' Next - ' End If - ' prevCutId = cutId - ' End If - - ' ElseIf line.StartsWith("TASKID=") Then - ' Dim nVal As Integer? = GetVal(line, "TASKID") - ' taskId = (If(nVal IsNot Nothing, nVal.Value, 0)) - ' ' se taskid diverso da zero, errore feature - ' If taskId <> 0 Then - ' EgtSetInfo(taskId, If(Bar.nBarType = ProjectType.PROJ, ITG_PROJ_ERR, ITG_PROD_ERR), nErr, True) - ' EgtSetInfo(taskId, If(Bar.nBarType = ProjectType.PROJ, ITG_PROJ_MSG, ITG_PROD_MSG), sMsg, True) - ' EgtSetInfo(taskId, If(Bar.nBarType = ProjectType.PROJ, ITG_PROJ_ROT, ITG_PROD_ROT), dRot, True) - ' ' aggiornamento risultati in struttura BTL - ' If Bar.nBarType = ProjectType.PROJ Then - ' ' cerco task in btl structure da id - ' If Not IsNothing(currBTLPart) Then - ' For Each Feature In currBTLPart.BTLFeatureVMList - ' If Feature.nFeatureId = taskId Then - ' DirectCast(Feature, BTLFeatureVM).CalcFeatureUpdate(True, nErr, dRot, nFall, sMsg) - ' Exit For - ' End If - ' Next - ' End If - ' ElseIf Bar.nBarType = ProjectType.PROD Then - ' ' cerco task in MachGroupList da id - ' If Not IsNothing(currPart) Then - ' For Each Feature In currPart.FeatureVMList - ' If Feature.nFeatureId = taskId Then - ' DirectCast(Feature, BTLFeatureVM).CalcFeatureUpdate(True, nErr, dRot, nFall, sMsg) - ' Exit For - ' End If - ' Next - ' End If - ' End If - ' ' se taskid uguale a zero e cutit diverso da zero, errore pezzo - ' ElseIf cutId <> 0 Then - ' EgtSetInfo(cutId, If(Bar.nBarType = ProjectType.PROJ, ITG_PROJ_ERR, ITG_PROD_ERR), nErr, True) - ' EgtSetInfo(cutId, If(Bar.nBarType = ProjectType.PROJ, ITG_PROJ_MSG, ITG_PROD_MSG), sMsg, True) - ' ' aggiorno in struttura btl - ' If Bar.nBarType = ProjectType.PROJ Then - ' If Not IsNothing(currBTLPart) Then currBTLPart.CalcPartUpdate(True, nErr, dRot, nFall, sMsg) - ' ElseIf Bar.nBarType = ProjectType.PROD Then - ' If Not IsNothing(currPart) Then currPart.CalcPartUpdate(True, nErr, dRot, nFall, sMsg) - ' End If - ' ' se taskid e cutid uguali a zero, errore barra - ' Else - ' If Bar.nBarType = ProjectType.PROJ Then - ' ' cerco pezzo in btl structure da id - ' For Each Part In Map.refProjectVM.BTLStructureVM.BTLPartVMList - ' If Part.nPartId = Bar.nBarId Then - ' currBTLPart = Part - ' Exit For - ' End If - ' Next - ' If Not IsNothing(currBTLPart) Then - ' EgtSetInfo(Bar.nBarId, ITG_PROJ_ERR, nErr, True) - ' EgtSetInfo(Bar.nBarId, ITG_PROJ_MSG, sMsg, True) - ' currBTLPart.CalcPartUpdate(True, nErr, dRot, nFall, sMsg) - ' For Each Feature In currBTLPart.BTLFeatureVMList - ' EgtSetInfo(Feature.nFeatureId, ITG_PROJ_ERR, nErr, True) - ' EgtSetInfo(Feature.nFeatureId, ITG_PROJ_MSG, sMsg, True) - ' Feature.CalcFeatureUpdate(True, nErr, dRot, nFall, sMsg) - ' Next - ' End If - ' End If - ' End If - ' ElseIf line.StartsWith("FALL=") Then - ' Dim nVal As Integer? = GetVal(line, "FALL") - ' If Not IsNothing(nVal) Then - ' nFall = nVal - ' Else - ' nFall = 0 - ' End If - ' ElseIf line.StartsWith("TIME=") Then - ' Dim nVal As Integer? = GetVal(line, "TIME") - ' nTotTime = (If(nVal IsNot Nothing, nVal.Value, 0)) - ' If Bar.nBarType = ProjectType.PROJ AndAlso Not IsNothing(currBTLPart) Then - ' EgtSetInfo(currBTLPart.nPartId, If(Bar.nBarType = ProjectType.PROJ, ITG_PROJ_TIME, ITG_PROD_TIME), nTotTime, True) - ' End If - - ' ElseIf Not String.IsNullOrWhiteSpace(line) AndAlso line <> "---" Then - ' sMsg = line - ' End If - ' Next - - ' Else - ' bErrors = True - ' nLastErr = 25 - ' sLastMsg = "Execution Error" - ' End If - - ' ' aggiornamento risultati in struttura BTL - ' If Bar.nBarType = ProjectType.PROJ Then - ' ' cerco pezzo in btl structure da id - ' For Each Part In Map.refProjectVM.BTLStructureVM.BTLPartVMList - ' If Part.nPartId = Bar.nBarId Then - ' ' leggo errori da geometria e li aggiorno in struttura btl - ' DirectCast(Part, BTLPartVM).CalcFeatureUpdate() - ' ' aggiungo nota che indica macchina - - ' End If - ' Next - ' ElseIf Bar.nBarType = ProjectType.PROD Then - ' ' cerco pezzo in MachGroupList da id - ' For Each MachGroup As MyMachGroupVM In Map.refMachGroupPanelVM.MachGroupVMList - ' If MachGroup.Id = Bar.nBarId Then - ' For Each Part In MachGroup.PartVMList - ' ' leggo errori da geometria e li aggiorno in struttura btl - ' Part.CalcFeatureUpdate() - ' Next - ' MachGroup.CalcMachGroupUpdate() - ' End If - ' Next - ' End If - - 'End Sub - Private Shared Function GetVal(sText As String, sKey As String) As Integer? Dim sParts As String() = sText.Split("="c) If String.Compare(sParts(0), sKey) <> 0 Then Return Nothing @@ -901,7 +502,7 @@ Public Class CalcIntegration End Select If IsNothing(Prev) Then PRList.Add(NewPR) - ElseIf NewPR.nERR = 22 Or (NewPR.nERR > 0 And Prev.nERR < 0) Then + ElseIf NewPR.nERR = 22 Or (NewPR.nERR > 0 And Prev.nERR <= 0) Or (NewPR.nERR < 0 And Prev.nERR = 0) Then If NewPR.dROT = 0 And Prev.dROT <> NewPR.dROT Then NewPR.SetROT(Prev.dROT) End If diff --git a/EgtBEAMWALL.ViewerOptimizer/LeftPanel/LeftPanelVM.vb b/EgtBEAMWALL.ViewerOptimizer/LeftPanel/LeftPanelVM.vb index d200161a..eface9c4 100644 --- a/EgtBEAMWALL.ViewerOptimizer/LeftPanel/LeftPanelVM.vb +++ b/EgtBEAMWALL.ViewerOptimizer/LeftPanel/LeftPanelVM.vb @@ -649,6 +649,8 @@ Public Class LeftPanelVM ''' Public Sub RemoveFeature() If IsNothing(Map.refProjManagerVM.CurrProj) Then Return + If IsNothing(Map.refProjectVM.BTLStructureVM.SelBTLPart) Then Return + If IsNothing(Map.refProjectVM.BTLStructureVM.SelBTLPart.SelBTLFeatureVM) Then Return If EgtBeamEraseProcess(Map.refProjectVM.BTLStructureVM.SelBTLPart.SelBTLFeatureVM.nFeatureId) Then ' rimuovo dalla lista pezzi Dim Index As Integer = Map.refProjectVM.BTLStructureVM.SelBTLPart.BTLFeatureVMList.IndexOf(Map.refProjectVM.BTLStructureVM.SelBTLPart.SelBTLFeatureVM) diff --git a/EgtBEAMWALL.ViewerOptimizer/MachGroupPanel/MyMachGroupVM.vb b/EgtBEAMWALL.ViewerOptimizer/MachGroupPanel/MyMachGroupVM.vb index 89d0fe3b..b69b209e 100644 --- a/EgtBEAMWALL.ViewerOptimizer/MachGroupPanel/MyMachGroupVM.vb +++ b/EgtBEAMWALL.ViewerOptimizer/MachGroupPanel/MyMachGroupVM.vb @@ -179,6 +179,12 @@ Public MustInherit Class MyMachGroupVM End Set End Property + Public ReadOnly Property nProductionState As Integer + Get + Return MyMachGroupM.nProductionState + End Get + End Property + Public ReadOnly Property Calc_Background As SolidColorBrush Get If MyMachGroupM.nGlobalState = CalcStates.OK Then diff --git a/EgtBEAMWALL.ViewerOptimizer/MachGroupPanel/PartVM.vb b/EgtBEAMWALL.ViewerOptimizer/MachGroupPanel/PartVM.vb index a915c554..5c79315c 100644 --- a/EgtBEAMWALL.ViewerOptimizer/MachGroupPanel/PartVM.vb +++ b/EgtBEAMWALL.ViewerOptimizer/MachGroupPanel/PartVM.vb @@ -290,8 +290,11 @@ Public MustInherit Class PartVM End Get Set(value As BTLFeatureVM) m_SelFeatureVM = value - EgtDeselectAll() - If Not IsNothing(value) Then EgtSelectObj(m_SelFeatureVM.nFeatureId) + If Not IsNothing(m_SelFeatureVM) Then + DirectCast(m_SelFeatureVM, BTLFeatureVM).SelGeomFeature() + Else + EgtDeselectAll() + End If EgtDraw() NotifyPropertyChanged(NameOf(SelFeatureVM)) End Set diff --git a/EgtBEAMWALL.ViewerOptimizer/My Project/AssemblyInfo.vb b/EgtBEAMWALL.ViewerOptimizer/My Project/AssemblyInfo.vb index a53b874e..78606a79 100644 --- a/EgtBEAMWALL.ViewerOptimizer/My Project/AssemblyInfo.vb +++ b/EgtBEAMWALL.ViewerOptimizer/My Project/AssemblyInfo.vb @@ -70,5 +70,5 @@ Imports System.Windows ' by using the '*' as shown below: ' - - + + diff --git a/EgtBEAMWALL.ViewerOptimizer/OpenProjectFileDialog/OpenProjectFileDialogVM.vb b/EgtBEAMWALL.ViewerOptimizer/OpenProjectFileDialog/OpenProjectFileDialogVM.vb index 4a05dd75..16fc2f7c 100644 --- a/EgtBEAMWALL.ViewerOptimizer/OpenProjectFileDialog/OpenProjectFileDialogVM.vb +++ b/EgtBEAMWALL.ViewerOptimizer/OpenProjectFileDialog/OpenProjectFileDialogVM.vb @@ -329,7 +329,7 @@ Public Class OpenProjectFileDialogVM ' lo salvo in tutti i proj correlati Dim ProdFile As ProdFileVM = DirectCast(SelProject, ProdFileVM) For Each nProjId In ProdFile.nProjIdList - EgtSaveFile(ProdFile.GetProjPath(nProjId), NGE.BIN) + EgtSaveFile(ProdFile.GetProjPath(nProjId), NGE.CMPTEXT) Next ' torno sul contesto corrente EgtSetCurrentContext(nCurrCtx) diff --git a/EgtBEAMWALL.ViewerOptimizer/ProjManager/ProjManagerVM.vb b/EgtBEAMWALL.ViewerOptimizer/ProjManager/ProjManagerVM.vb index 46c76a11..f78aed35 100644 --- a/EgtBEAMWALL.ViewerOptimizer/ProjManager/ProjManagerVM.vb +++ b/EgtBEAMWALL.ViewerOptimizer/ProjManager/ProjManagerVM.vb @@ -236,7 +236,7 @@ Public Class ProjManagerVM SetCurrProj(nProjId) Dim sProjFileName As String = sProjDir & "\" & nProjId.ToString("0000") & ".nge" ' salvo il progetto - EgtSaveFile(sProjFileName, NGE.BIN) + EgtSaveFile(sProjFileName, NGE.CMPTEXT) Else MessageBox.Show("Impossibile creare un nuovo file!!") End If @@ -387,7 +387,7 @@ Public Class ProjManagerVM nPartId = EgtGetNextPart(nPartId) End While ' salvo il progetto - bOk = EgtSaveFile(sProjFileName, NGE.BIN) + bOk = EgtSaveFile(sProjFileName, NGE.CMPTEXT) Else EgtOutLog("Errore nell'importazione BTL") End If