- pulizia codice

- aggoirnato controllo su errore script aggiunta nuovo pezzo
This commit is contained in:
Demetrio Cassarino
2024-01-31 12:03:54 +01:00
parent 3d957138ee
commit 8b96a07386
14 changed files with 53 additions and 373 deletions
-2
View File
@@ -144,8 +144,6 @@
Public Const BTL_PRT_INVERTED As String = "INVERTED"
Public Const BTL_PRT_MATERIAL As String = "MATERIAL"
Public Const BTL_PRT_VOLUME As String = "VOLUME"
Public Const BTL_PRT_ROT As String = "ROT"
Public Const BTL_PRT_FLIP As String = "FLIP"
' parametri pezzo
Public Const BTL_PRT_SINGLEMEMBERNUM = "SINGLEMEMBERNUMBER"
Public Const BTL_PRT_ASSEMBLYNUM = "ASSEMBLYNUMBER"
+2 -4
View File
@@ -482,8 +482,8 @@ Public Class PartM
EgtGetInfo(nPartId, BTL_PRT_GROUP, NewPartM.m_sGROUP)
EgtGetInfo(nPartId, BTL_PRT_STOREY, NewPartM.m_sSTOREY)
EgtGetInfo(nPartId, BTL_PRT_MATERIAL, NewPartM.m_sMATERIAL)
EgtGetInfo(nPartId, BTL_PRT_ROT, NewPartM.m_dROT)
EgtGetInfo(nPartId, BTL_PRT_FLIP, NewPartM.m_nFLIP)
EgtGetInfo(nPartId, MGR_PRT_ROT, NewPartM.m_dROT)
EgtGetInfo(nPartId, MGR_PRT_FLIP, NewPartM.m_nFLIP)
Dim nTemp As Integer = 0
If Not EgtGetInfo(nPartId, BTL_PRT_ROTATED, nTemp) Then
nTemp = 0
@@ -516,8 +516,6 @@ Public Class PartM
' leggo PosX, PosY, Rot e Flip
EgtGetInfo(nPartId, MGR_PRT_POSX, NewPartM.m_dPOSX)
EgtGetInfo(nPartId, MGR_PRT_POSY, NewPartM.m_dPOSY)
EgtGetInfo(nPartId, MGR_PRT_ROT, NewPartM.m_dROT)
EgtGetInfo(nPartId, MGR_PRT_FLIP, NewPartM.m_nFLIP)
End If
' leggo volume
If Not EgtGetInfo(nPartId, BTL_PRT_VOLUME, NewPartM.dVolume) Then
@@ -709,18 +709,13 @@ Public Class BTLPartManagerVM
EgtSetMode(nDuploId, GDB_MD.STD)
nPartDuploIdList.Add(nDuploId)
Next
'' salvo lista info
Dim saveInfoBeamList As MyMachGroupVM = BeamMachGroup
'Dim saveInfoBeamList As New List(Of PartVM)
'For Each info As PartVM In BeamMachGroup.PartVMList
' saveInfoBeamList.Add(info)
'Next
' calcolo posizione nuovo pezzo per rispettare ordine lunghezze
Dim nInsertIndex As Integer
' scrivo dati di tutti i pezzi
Dim dPosX As Double = BeamMachGroup.dStartCut
Dim nPartIndex As Integer = 0
Dim nIndex As Integer
Dim bDuploInfo As Boolean = False
' ciclo sui pezzi
For nIndex = 0 To BeamMachGroup.PartVMList.Count - 1
For PartsToAddIndex = nPartIndex To PartsToAdd.Count - 1
@@ -774,34 +769,26 @@ Public Class BTLPartManagerVM
Dim sLogPath As String = Map.refMainWindowVM.MainWindowM.sTempDir & "\RawPartLog.txt"
If Not ExecBeam(sLogPath, Map.refMachinePanelVM.SelectedMachine.Name, CalcIntegration.CmdTypes.RAWPART, False) Then
EgtOutLog("Fallito inserimento grezzo nella barra in AddPartToBeam")
' elimino duplo
For Each nDuploId In nPartDuploIdList
EgtErase(nDuploId)
EgtRemoveRawPart(nDuploId)
Next
' rimuovo info duplo e aggiorno info grezzo
nPartIndex = 0
' aggiorno info grezzo
For nIndex = 0 To BeamMachGroup.PartVMList.Count - 1
If nPartIndex < nPartDuploIdList.Count() AndAlso BeamMachGroup.PartVMList(nIndex).dL > PartsToAdd(0).dL Then
EgtRemoveInfo(BeamMachGroup.Id, MGR_RPT_PART & nIndex + 1)
nPartIndex += 1
ElseIf nPartIndex < nPartDuploIdList.Count() AndAlso BeamMachGroup.PartVMList(nIndex).dL < PartsToAdd(0).dL Then
EgtRemoveInfo(BeamMachGroup.Id, MGR_RPT_PART & nIndex + 1)
nPartIndex += 1
End If
EgtRemoveInfo(BeamMachGroup.Id, MGR_RPT_PART & nIndex + nPartIndex + 1)
EgtSetInfo(BeamMachGroup.Id, MGR_RPT_PART & nIndex + 1, BeamMachGroup.PartVMList(nIndex).nPartId & "," & DoubleToString(BeamMachGroup.PartVMList(nIndex).dPOSX, 3))
Next
' rimuovo info duplo
While EgtGetInfo(BeamMachGroup.Id, MGR_RPT_PART & nIndex + 1, nPartDuploIdList(0))
bDuploInfo = EgtGetInfo(BeamMachGroup.Id, MGR_RPT_PART & nIndex + 1, nPartDuploIdList(0))
EgtRemoveInfo(BeamMachGroup.Id, MGR_RPT_PART & nIndex + 1)
nIndex += 1
End While
' elimino vecchio grezzo ed eseguo script creazione nuovo
nRawId = EgtGetFirstRawPart()
While nRawId <> GDB_ID.NULL
EgtRemoveRawPart(nRawId)
nRawId = EgtGetFirstRawPart()
End While
If Not ExecBeam(sLogPath, Map.refMachinePanelVM.SelectedMachine.Name, CalcIntegration.CmdTypes.RAWPART, False) Then
EgtOutLog("Fallita esecuzione ExecBeam. ERRORE")
End If
@@ -815,8 +802,8 @@ Public Class BTLPartManagerVM
' seleziono pezzo aggiunto
If BeamMachGroup.PartVMList.Count > nInsertIndex Then
BeamMachGroup.SelPart = BeamMachGroup.PartVMList(nInsertIndex)
Else
BeamMachGroup.SelPart = BeamMachGroup.PartVMList(nInsertIndex - 1)
ElseIf bDuploInfo Then
BeamMachGroup.SelPart = BeamMachGroup.PartVMList(BeamMachGroup.PartVMList.Count - 1)
End If
Return True
End Function
@@ -1100,10 +1087,6 @@ Public Class BTLPartManagerVM
' se modalita' assemblato
Dim bShowBuilding As Boolean = Map.refShowBeamPanelVM.ShowBuilding_IsChecked
Configuration.AssembledMode(bShowBuilding)
'If bShowBuilding AndAlso Map.refShowBeamPanelVM.bShowAll Then
' ' devo smontarlo prima di ruotare le travi
' Map.refProjectVM.BTLStructureVM.ShowBuilding(False, False)
'End If
' inverto i pezzi selezionati
For Each Part In Map.refProjectVM.BTLStructureVM.SelBTLParts
Part.Invert()
@@ -1138,10 +1121,6 @@ Public Class BTLPartManagerVM
' se modalita' assemblato
Dim bShowBuilding As Boolean = Map.refShowBeamPanelVM.ShowBuilding_IsChecked
Configuration.AssembledMode(bShowBuilding)
'If bShowBuilding AndAlso Map.refShowBeamPanelVM.bShowAll Then
' ' devo smontarlo prima di ruotare le travi
' Map.refProjectVM.BTLStructureVM.ShowBuilding(False, False)
'End If
' ruoto i pezzi selezionati
For Each Part In Map.refProjectVM.BTLStructureVM.SelBTLParts
Part.BackRotation(False, False)
@@ -1183,10 +1162,6 @@ Public Class BTLPartManagerVM
' se modalita' assemblato
Dim bShowBuilding As Boolean = Map.refShowBeamPanelVM.ShowBuilding_IsChecked
Configuration.AssembledMode(bShowBuilding)
'If bShowBuilding AndAlso Map.refShowBeamPanelVM.bShowAll Then
' ' devo smontarlo prima di ruotare le travi
' Map.refProjectVM.BTLStructureVM.ShowBuilding(False, False)
'End If
' ruoto i pezzi selezionati
For Each Part In Map.refProjectVM.BTLStructureVM.SelBTLParts
Part.ForwardRotation(False, False)
@@ -165,7 +165,7 @@ Public Class BTLFeatureVM
' se in View
If Map.refMainMenuVM.SelPage = Pages.VIEW OrElse (Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE AndAlso Not IsNothing(m_BTLPartM)) Then
' imposto modificato per copie
Dim cc = Map.refMachGroupPanelVM.MachGroupVMList
'Dim cc = Map.refMachGroupPanelVM.MachGroupVMList
MyMachGroupPanelM.SetDuploModified(m_BTLPartM.nPartId)
End If
NotifyPropertyChanged(NameOf(bDO))
@@ -135,6 +135,22 @@ Public Class BTLParamVM
NotifyPropertyChanged("sValue")
Return
End If
' recupero ParentPart
Dim ParentPart As BTLPartM = TryCast(m_BTLParamM.ParentFeature.ParentPart, BTLPartM)
' recupero PartId
Dim nPartId As Integer = ParentPart.nPartId
' numero di pezzi inseriti nelle barre
Dim INPROD As Integer = 0
EgtDuploInRawCount(nPartId, INPROD)
' recupero pezzi lavorati da Db
Dim nDoneCnt As Integer = DbControllers.m_ProjController.getCountItemState(ProjectManagerVM.CurrProj.nProjId, nPartId, ItemState.Assigned)
' controllo se i pezzi sono lavorati se si messaggio di warning altrimenti messaggio informativo
If nDoneCnt > 0 Then
MessageBox.Show("Pezzo " & nPartId & " non modificato in " & INPROD & " barra/e perche' settata/e come da produrre", EgtMsg(30009), MessageBoxButton.OK, MessageBoxImage.Warning)
dNewValue = m_BTLParamM.dValue
Else
MessageBox.Show("Pezzo " & nPartId & " modificato in " & INPROD & " barra/e grezza/e", EgtMsg(30009), MessageBoxButton.OK, MessageBoxImage.Information)
End If
UpdateParamValue(dNewValue, "")
Case Else
UpdateParamValue(0, value)
@@ -84,7 +84,6 @@ Public Class BTLStructureVM
Select Case m_SelectionType
Case SelectionTypes.SELECT_
' imposto modalita' proj su vista feature
'Map.refProjectVM.SelProdProj = ProdProj.PROJ
If Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE Then Map.refProdProjManagerVM.SelProdProj = ProdProj.PROJ
' rendo enable bottone parameters
Map.refLeftPanelVM.SetParametersIsEnabled(True)
@@ -98,7 +97,6 @@ Public Class BTLStructureVM
Map.refProjectVM.NotifyPropertyChanged(NameOf(Map.refProdProjManagerVM.PartManager_Visibility))
Case SelectionTypes.HIGHLIGHT
' imposto modalita' nulla su vista feature
'Map.refProjectVM.SelProdProj = ProdProj.NULL
If Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE Then Map.refProdProjManagerVM.SelProdProj = ProdProj.NULL
' rendo disable bottone parameters
Map.refLeftPanelVM.SetParametersIsEnabled(False)
@@ -122,8 +120,6 @@ Public Class BTLStructureVM
' aggiornamento grafica
'Map.refLeftPanelVM.PartShowAllChanged()
Configuration.UpdateGraphics()
'If Not IsNothing(Map.refFeatureListManagerVM) Then Map.refFeatureListManagerVM.PartShowAllChanged()
'If Not IsNothing(Map.refBTLPartManagerVM) Then Map.refBTLPartManagerVM.PartShowAllChanged()
'Map.refLeftPanelVM.FeatureSelectionChanged()
If Not IsNothing(Map.refFeatureListManagerVM) Then Map.refFeatureListManagerVM.FeatureSelectionChanged()
Map.refCALCPanelVM.SetIsEnabledForSelPart()
@@ -219,29 +215,12 @@ Public Class BTLStructureVM
' aggiornamento grafica
'Map.refLeftPanelVM.PartShowAllChanged()
Configuration.UpdateGraphics()
'If Not IsNothing(Map.refFeatureListManagerVM) Then Map.refFeatureListManagerVM.PartShowAllChanged()
'If Not IsNothing(Map.refBTLPartManagerVM) Then Map.refBTLPartManagerVM.PartShowAllChanged()
End Sub
Private Sub SelectBTLPart(BtlPart As BTLPartVM)
m_SelBTLPart = BtlPart
If Map.refMainMenuVM.SelPage = Pages.VIEW Then
Configuration.SelectedPieces(BtlPart.nPartId, Me)
'EgtBeamShowFacesName(False)
'EgtBeamShowLoadingSide(False, False)
'Map.refProjectVM.MacroFeature_IsEnabled = True
'' se modalità building, la tolgo
'If Map.refShowBeamPanelVM.ShowBuilding_IsChecked Then
' ShowBuilding(False, False)
'End If
'' seleziono pezzo nella scena
'SceneSelPartSelection()
'' seleziono pezzo in Db geometrico
'EgtBeamSetPart(BtlPart.nPartId)
'EgtBeamShowFacesName(True)
'Dim bLoadingSideShow As Boolean = (nPROJTYPE = BWType.BEAM)
'Dim bLeftToRight As Boolean = Not (CurrentMachine.ViewDir = VT.ISO_NW OrElse CurrentMachine.ViewDir = VT.ISO_NE)
'EgtBeamShowLoadingSide(bLoadingSideShow, bLeftToRight)
' seleziono pagina BottomPanel
If Not IsNothing(Map.refBottomPanelVM) Then
Map.refBottomPanelVM.SetSelPartFeatureTab(BottomPanelVM.PartFeatureTab.PART)
@@ -261,25 +240,6 @@ Public Class BTLStructureVM
EgtBeamShowLoadingSide(False, False)
' trovo ed evidenzio MachGroup e Duplo di questo pezzo
Configuration.SetSearchPiece(BtlPart.nPartId)
'If Not IsNothing(Map.refProjectVM.MachGroupPanelVM) Then
' Dim MachGroupList As New List(Of MyMachGroupVM)
' For Each Machgroup As MyMachGroupVM In Map.refProjectVM.MachGroupPanelVM.MachGroupVMList
' Dim bFound As Boolean = False
' For Each Part As PartVM In Machgroup.PartVMList
' If EgtDuploGetOriginal(Part.nPartId) = BtlPart.nPartId Then
' Part.SetSearchFound()
' bFound = True
' Else
' Part.ResetSearchFound()
' End If
' Next
' If bFound Then
' Machgroup.SetSearchFound()
' Else
' Machgroup.ResetSearchFound()
' End If
' Next
'End If
' seleziono pezzo nella scena
SceneSelPartSelection()
Core.ViewPanelVM.BWSetView(If(Core.ViewPanelVM.Type = BWType.BEAM, VT.ISO_SW, VT.TOP), False)
@@ -294,21 +254,6 @@ Public Class BTLStructureVM
EgtResetCurrMachGroup()
End If
Configuration.SelectedPieces(BtlPart.nPartId, Me)
'EgtBeamShowFacesName(False)
'EgtBeamShowLoadingSide(False, False)
'Map.refProjectVM.MacroFeature_IsEnabled = True
'' se modalità building, la tolgo
'If Map.refShowBeamPanelVM.ShowBuilding_IsChecked Then
' ShowBuilding(False, False)
'End If
'' seleziono pezzo nella scena
'SceneSelPartSelection()
'' seleziono pezzo in Db geometrico
'EgtBeamSetPart(BtlPart.nPartId)
'EgtBeamShowFacesName(True)
'Dim bLoadingSideShow As Boolean = (nPROJTYPE = BWType.BEAM)
'Dim bLeftToRight As Boolean = Not (CurrentMachine.ViewDir = VT.ISO_NW OrElse CurrentMachine.ViewDir = VT.ISO_NE)
'EgtBeamShowLoadingSide(bLoadingSideShow, bLeftToRight)
' seleziono la prima feature
If Not IsNothing(BtlPart.BTLFeatureVMList) AndAlso BtlPart.BTLFeatureVMList.Count > 0 Then SelBTLPart.SelBTLFeatureVM = BtlPart.BTLFeatureVMList(0)
' aggiorno stato selezionato tutto
@@ -341,11 +286,6 @@ Public Class BTLStructureVM
Private Sub DeselectBTLPart(BtlPart As BTLPartVM)
' se necessario tolgo solido dal precedentemente selezionato
Configuration.DeselectSolid(BtlPart.nPartId, True)
'If Map.refShowBeamPanelVM.ShowSolid_IsChecked Then
' ' tolgo eventuale indicazione solido rimasta da pezzo precedente
' Map.refShowBeamPanelVM.SetShowSolid(False)
' Map.refProjectVM.BTLStructureVM.ShowSolid(BtlPart.nPartId, False, False)
'End If
If m_SelBTLPart Is BtlPart Then
EgtBeamShowFacesName(False)
EgtBeamShowLoadingSide(False, False)
@@ -353,7 +293,7 @@ Public Class BTLStructureVM
NotifyPropertyChanged(NameOf(SelBTLPart))
End If
' disabilito eventuale feature selezionata
If Not IsNothing(BtlPart.m_SelBTLFeatureVM) Then BtlPart.SelBTLFeatureVM = Nothing
If Not IsNothing(BtlPart.m_SelBTLFeatureVM) AndAlso (Map.refMainMenuVM.SelPage = Pages.VIEW OrElse Map.refMainMenuVM.SelPage = Pages.MACHINING) Then BtlPart.SelBTLFeatureVM = Nothing
'' deevidenzio MachGroup e Duplo di questo pezzo
'If Not IsNothing(Map.refProjectVM.MachGroupPanelVM) Then
' Dim MachGroupList As New List(Of MyMachGroupVM)
@@ -371,7 +311,7 @@ Public Class BTLStructureVM
' End If
' Next
'End If
EgtResetCurrMachGroup()
'EgtResetCurrMachGroup()
EgtDraw()
End Sub
Private Sub HighlightBTLPart(BtlPart As BTLPartVM)
@@ -393,25 +333,6 @@ Public Class BTLStructureVM
If Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE Then
' trovo ed evidenzio MachGroup e Duplo di questo pezzo
Configuration.SetSearchPiece(BtlPart.nPartId)
'If Not IsNothing(Map.refProjectVM.MachGroupPanelVM) Then
' Dim MachGroupList As New List(Of MyMachGroupVM)
' For Each Machgroup As MyMachGroupVM In Map.refProjectVM.MachGroupPanelVM.MachGroupVMList
' Dim bFound As Boolean = False
' For Each Part As PartVM In Machgroup.PartVMList
' If EgtDuploGetOriginal(Part.nPartId) = BtlPart.nPartId Then
' Part.SetSearchFound()
' bFound = True
' Else
' Part.ResetSearchFound()
' End If
' Next
' If bFound Then
' Machgroup.SetSearchFound()
' Else
' Machgroup.ResetSearchFound()
' End If
' Next
'End If
End If
' seleziono pagina BottomPanel
If Not IsNothing(Map.refBottomPanelVM) Then Map.refBottomPanelVM.SetSelPartFeatureTab(BottomPanelVM.PartFeatureTab.NULL)
@@ -435,22 +356,6 @@ Public Class BTLStructureVM
End If
' deevidenzio MachGroup e Duplo di questo pezzo
Configuration.ResetSearchPiece(BtlPart.nPartId)
'If Not IsNothing(Map.refProjectVM.MachGroupPanelVM) Then
' Dim MachGroupList As New List(Of MyMachGroupVM)
' For Each Machgroup As MyMachGroupVM In Map.refProjectVM.MachGroupPanelVM.MachGroupVMList
' Dim bFound As Boolean = False
' For Each Part As PartVM In Machgroup.PartVMList
' Dim i = EgtDuploGetOriginal(Part.nPartId)
' If EgtDuploGetOriginal(Part.nPartId) = BtlPart.nPartId Then
' Part.ResetSearchFound()
' bFound = True
' End If
' Next
' If bFound Then
' Machgroup.ResetSearchFound()
' End If
' Next
'End If
' seleziono pagina BottomPanel
'Map.refBottomPanelVM.SetSelPartFeatureTab(BottomPanelVM.PartFeatureTab.NULL)
If bDraw Then EgtDraw()
@@ -476,9 +381,6 @@ Public Class BTLStructureVM
If Not IsNothing(m_SelBTLPart) Then
' se necessario tolgo solido dal precedentemente selezionato
Configuration.DeselectSolid()
'If Map.refShowBeamPanelVM.ShowSolid_IsChecked Then
' Map.refShowBeamPanelVM.SetShowSolid(False)
'End If
' disabilito eventuale feature selezionata
If Not IsNothing(m_SelBTLPart.m_SelBTLFeatureVM) Then m_SelBTLPart.SelBTLFeatureVM = Nothing
End If
@@ -508,25 +410,6 @@ Public Class BTLStructureVM
ElseIf Map.refMainMenuVM.SelPage = Pages.MACHINING Then
' trovo ed evidenzio MachGroup e Duplo di questo pezzo
Configuration.SetSearchPiece(m_SelBTLPart.nPartId)
'If Not IsNothing(Map.refProjectVM.MachGroupPanelVM) Then
' Dim MachGroupList As New List(Of MyMachGroupVM)
' For Each Machgroup As MyMachGroupVM In Map.refProjectVM.MachGroupPanelVM.MachGroupVMList
' Dim bFound As Boolean = False
' For Each Part As PartVM In Machgroup.PartVMList
' If EgtDuploGetOriginal(Part.nPartId) = m_SelBTLPart.nPartId Then
' Part.SetSearchFound()
' bFound = True
' Else
' Part.ResetSearchFound()
' End If
' Next
' If bFound Then
' Machgroup.SetSearchFound()
' Else
' Machgroup.ResetSearchFound()
' End If
' Next
'End If
' seleziono pezzo nella scena
SceneSelPartSelection()
Core.ViewPanelVM.BWSetView(If(Core.ViewPanelVM.Type = BWType.BEAM, VT.ISO_SW, VT.TOP), False)
@@ -551,25 +434,6 @@ Public Class BTLStructureVM
Map.refShowBeamPanelVM.bShowAll = False
' trovo ed evidenzio MachGroup e Duplo di questo pezzo
Configuration.ResetSearchPiece(m_SelBTLPart.nPartId)
'If Not IsNothing(Map.refProjectVM.MachGroupPanelVM) Then
' Dim MachGroupList As New List(Of MyMachGroupVM)
' For Each Machgroup As MyMachGroupVM In Map.refProjectVM.MachGroupPanelVM.MachGroupVMList
' Dim bFound As Boolean = False
' For Each Part As PartVM In Machgroup.PartVMList
' If EgtDuploGetOriginal(Part.nPartId) = m_SelBTLPart.nPartId Then
' Part.SetSearchFound()
' bFound = True
' Else
' Part.ResetSearchFound()
' End If
' Next
' If bFound Then
' Machgroup.SetSearchFound()
' Else
' Machgroup.ResetSearchFound()
' End If
' Next
'End If
Core.ViewPanelVM.BWSetView(If(Core.ViewPanelVM.Type = BWType.BEAM, VT.ISO_SW, VT.TOP), False)
EgtZoom(ZM.ALL)
End If
@@ -24,7 +24,8 @@
<DataGridCheckBoxColumn x:Key="colDO" Binding="{Binding bDO, UpdateSourceTrigger=PropertyChanged}"
MinWidth="28">
<DataGridCheckBoxColumn.Header>
<CheckBox IsChecked="{Binding Path=Tag.bDOALL, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:FeatureListV}}}"/>
<CheckBox IsChecked="{Binding Path=Tag.bDOALL, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:FeatureListV}}}"
HorizontalAlignment="Center"/>
</DataGridCheckBoxColumn.Header>
</DataGridCheckBoxColumn>
<!--Validità feature-->
@@ -19,13 +19,16 @@
Style="{StaticResource DataGrid_CustomHighLight}">
<DataGrid.Resources>
<!--DO - Abilitazione-->
<DataGridCheckBoxColumn x:Key="colDO" Binding="{Binding bDO,UpdateSourceTrigger=PropertyChanged}">
<DataGridCheckBoxColumn x:Key="colDO" Binding="{Binding bDO, UpdateSourceTrigger=PropertyChanged}"
MinWidth="28">
<!--<DataGridCheckBoxColumn.Header>
<TextBlock Text="{Binding Path=DataContext.DO_Msg,RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:FeatureInPartInRawPartListV}}}"/>
</DataGridCheckBoxColumn.Header>-->
<DataGridCheckBoxColumn.HeaderTemplate>
<DataTemplate>
<TextBlock Text="{Binding DataContext.DO_Msg,RelativeSource={RelativeSource AncestorType={x:Type DataGrid}}}"/>
<!--<TextBlock Text="{Binding DataContext.DO_Msg,RelativeSource={RelativeSource AncestorType={x:Type DataGrid}}}"/>-->
<CheckBox IsChecked="{Binding Path=Tag.bDOALL, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdFeatureListV}}}"
HorizontalAlignment="Center"/>
</DataTemplate>
</DataGridCheckBoxColumn.HeaderTemplate>
</DataGridCheckBoxColumn>
@@ -34,8 +34,8 @@
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<CheckBox IsChecked="{Binding bCustom, UpdateSourceTrigger=PropertyChanged}"
Visibility="{Binding Tag, RelativeSource={RelativeSource AncestorType={x:Type DataGrid}}}"
HorizontalAlignment="Center"/>
Visibility="{Binding Tag, RelativeSource={RelativeSource AncestorType={x:Type DataGrid}}}"
HorizontalAlignment="Center"/>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
@@ -24,39 +24,13 @@ Public Class MyMachGroupPanelVM
Dim nSelBTLPartId As Integer = Map.refProjectVM.BTLStructureVM.SelBTLParts(0).nPartId
' deevidenzio MachGroup e Duplo di questo pezzo
Configuration.ResetSearchPiece(nSelBTLPartId)
'If Not IsNothing(Map.refProjectVM.MachGroupPanelVM) Then
' Dim MachGroupList As New List(Of MyMachGroupVM)
' For Each Machgroup As MyMachGroupVM In Map.refProjectVM.MachGroupPanelVM.MachGroupVMList
' Dim bFound As Boolean = False
' For Each Part As PartVM In Machgroup.PartVMList
' If EgtDuploGetOriginal(Part.nPartId) = nSelBTLPartId Then
' Part.ResetSearchFound()
' bFound = True
' End If
' Next
' If bFound Then
' Machgroup.ResetSearchFound()
' End If
' Next
'End If
End If
End If
If Not IsNothing(SelectedMachGroup) AndAlso Not IsNothing(SelectedMachGroup.SelPart) AndAlso Not IsNothing(Map.refProjectVM.BTLStructureVM) Then
Configuration.ResetSearch(SelectedMachGroup.SelPart.nPartId)
'For BTLPartIndex = 0 To Map.refProjectVM.BTLStructureVM.BTLPartVMList.Count - 1
' Dim nDuploOriginalId As Integer = 0
' If EgtGetInfo(SelectedMachGroup.SelPart.nPartId, GDB_SI_DUPSOU, nDuploOriginalId) AndAlso nDuploOriginalId > 0 AndAlso nDuploOriginalId = Map.refProjectVM.BTLStructureVM.BTLPartVMList(BTLPartIndex).nPartId Then
' Map.refProjectVM.BTLStructureVM.BTLPartVMList(BTLPartIndex).ResetSearchFound()
' Exit For
' End If
'Next
End If
' se modalita' assemblato
Configuration.AssembledMode(Map.refShowBeamPanelVM.ShowBuilding_IsChecked)
'If Map.refShowBeamPanelVM.ShowBuilding_IsChecked AndAlso Map.refShowBeamPanelVM.bShowAll Then
' ' devo smontarlo prima di calcolare le travi, altrimenti non trova i pezzi
' Map.refProjectVM.BTLStructureVM.ShowBuilding(False, False)
'End If
' se precedente pezzo selezionato
If Not IsNothing(value) AndAlso Map.refProjectVM.LastSelGridType = ProjectVM.GridSelTypes.PART AndAlso Map.refProjectVM.BTLStructureVM.SelBTLParts.Count > 0 Then
Dim SelBTLPart As BTLPartVM = Map.refProjectVM.BTLStructureVM.SelBTLParts(0)
@@ -1,6 +1,4 @@
Imports System.Collections.ObjectModel
Imports System.Collections.Specialized
Imports System.ComponentModel
Imports System.IO
Imports System.Windows.Threading
Imports EgtBEAMWALL.Core
@@ -30,47 +28,15 @@ Public Class MyMachGroupVM
Dim nSelBTLPartId As Integer = Map.refProjectVM.BTLStructureVM.SelBTLParts(0).nPartId
' deevidenzio MachGroup e Duplo di questo pezzo
Configuration.ResetSearchPiece(nSelBTLPartId)
'If Not IsNothing(Map.refProjectVM.MachGroupPanelVM) Then
' Dim MachGroupList As New List(Of MyMachGroupVM)
' For Each Machgroup As MyMachGroupVM In Map.refProjectVM.MachGroupPanelVM.MachGroupVMList
' Dim bFound As Boolean = False
' For Each Part As PartVM In Machgroup.PartVMList
' If EgtDuploGetOriginal(Part.nPartId) = nSelBTLPartId Then
' Part.ResetSearchFound()
' bFound = True
' End If
' Next
' If bFound Then
' Machgroup.ResetSearchFound()
' End If
' Next
'End If
End If
If Not IsNothing(m_SelPart) Then
' deevidenzio BTLPart di questo pezzo
If Not IsNothing(Map.refProjectVM.BTLStructureVM) Then
Configuration.ResetSearch(m_SelPart.nPartId)
'For BTLPartIndex = 0 To Map.refProjectVM.BTLStructureVM.BTLPartVMList.Count - 1
' Dim nDuploOriginalId As Integer = 0
' If EgtGetInfo(m_SelPart.nPartId, GDB_SI_DUPSOU, nDuploOriginalId) AndAlso nDuploOriginalId > 0 AndAlso nDuploOriginalId = Map.refProjectVM.BTLStructureVM.BTLPartVMList(BTLPartIndex).nPartId Then
' Map.refProjectVM.BTLStructureVM.BTLPartVMList(BTLPartIndex).ResetSearchFound()
' Exit For
' End If
'Next
End If
End If
' se modalita' assemblato
Configuration.AssembledMode(Map.refShowBeamPanelVM.ShowBuilding_IsChecked)
'If Map.refShowBeamPanelVM.ShowBuilding_IsChecked AndAlso Map.refShowBeamPanelVM.bShowAll Then
' ' devo smontarlo prima di calcolare le travi, altrimenti non trova i pezzi
' Map.refProjectVM.BTLStructureVM.ShowBuilding(False, False)
'End If
'If Map.refProjectVM.BTLStructureVM.SelBTLParts.Count > 0 Then
' ' deseleziono pezzo in lista BTLPart
' For BTLPartIndex = Map.refProjectVM.BTLStructureVM.SelBTLParts.Count - 1 To 0 Step -1
' Map.refProjectVM.BTLStructureVM.SelBTLParts.Remove(Map.refProjectVM.BTLStructureVM.SelBTLParts(BTLPartIndex))
' Next
'End If
End If
m_SelPart = value
' seleziono pezzo
@@ -78,10 +44,11 @@ Public Class MyMachGroupVM
If Not IsNothing(value) Then
If Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE Then
' imposto modalita' prod su vista feature
'Map.refProjectVM.SelProdProj = ProdProj.PROD
Map.refProdProjManagerVM.SelProdProj = ProdProj.PROD
'' deseleziono pezzo in lista BTLPart
'Map.refProjectVM.BTLStructureVM.SelBTLParts.Clear()
' deseleziono pezzo in lista BTLPart
For BTLPartIndex = Map.refProjectVM.BTLStructureVM.SelBTLParts.Count - 1 To 0 Step -1
Map.refProjectVM.BTLStructureVM.SelBTLParts.RemoveFromList(Map.refProjectVM.BTLStructureVM.SelBTLParts(BTLPartIndex))
Next
End If
EgtSelectObj(SelPart.nPartId)
If Map.refMainMenuVM.SelPage = Pages.MACHINING Then
@@ -89,15 +56,7 @@ Public Class MyMachGroupVM
End If
' trovo ed evidenzio BTLPart di questo pezzo
If Not IsNothing(Map.refProjectVM.MachGroupPanelVM) Then
'Dim MachGroupList As New List(Of MyMachGroupVM)
Configuration.SetSearch(m_SelPart.nPartId)
'For BTLPartIndex = 0 To Map.refProjectVM.BTLStructureVM.BTLPartVMList.Count - 1
' Dim nDuploOriginalId As Integer = 0
' If EgtGetInfo(m_SelPart.nPartId, GDB_SI_DUPSOU, nDuploOriginalId) AndAlso nDuploOriginalId > 0 AndAlso nDuploOriginalId = Map.refProjectVM.BTLStructureVM.BTLPartVMList(BTLPartIndex).nPartId Then
' Map.refProjectVM.BTLStructureVM.BTLPartVMList(BTLPartIndex).SetSearchFound()
' Exit For
' End If
'Next
End If
End If
@@ -150,14 +109,6 @@ Public Class MyMachGroupVM
' verifico se la dimensione e' maggiore del box minimo dei pezzi
Dim b3Parts As New BBox3d
Configuration.VerifyMaxDimension(m_PartVMList, b3Parts)
'Dim nBoxLayerId As Integer = EgtGetFirstNameInGroup(m_PartVMList(0).nPartId, "Box")
'EgtGetBBoxGlob(nBoxLayerId, GDB_BB.EXACT, b3Parts)
'For PartIndex = 1 To m_PartVMList.Count - 1
' Dim b3Part As New BBox3d
' nBoxLayerId = EgtGetFirstNameInGroup(m_PartVMList(PartIndex).nPartId, "Box")
' EgtGetBBoxGlob(nBoxLayerId, GDB_BB.EXACT, b3Part)
' b3Parts.Add(b3Part)
'Next
Dim b3RawPart As New BBox3d
EgtGetRawPartBBox(nRawPartId, b3RawPart)
Dim dMinValue As Double = 0
@@ -175,19 +126,6 @@ Public Class MyMachGroupVM
' riporto il grezzo nell'angolo tavola di origine
Dim b3Tab As New BBox3d
Configuration.SelectCorner(b3Tab, nRawPartId)
'EgtGetTableArea(1, b3Tab)
'Dim p3OrigOnTab As Point3d
'Select Case CurrentMachine.OrigCorner
' Case MCH_CR.BL
' p3OrigOnTab = New Point3d(CurrentMachine.OrigOffsX, CurrentMachine.OrigOffsY, 0)
' Case MCH_CR.BR
' p3OrigOnTab = New Point3d(b3Tab.DimX() - CurrentMachine.OrigOffsX, CurrentMachine.OrigOffsY, 0)
' Case MCH_CR.TL
' p3OrigOnTab = New Point3d(CurrentMachine.OrigOffsX, b3Tab.DimY() - CurrentMachine.OrigOffsY, 0)
' Case MCH_CR.TR
' p3OrigOnTab = New Point3d(b3Tab.DimX() - CurrentMachine.OrigOffsX, b3Tab.DimY() - CurrentMachine.OrigOffsY, 0)
'End Select
'EgtMoveToCornerRawPart(nRawPartId, p3OrigOnTab, CurrentMachine.OrigCorner)
' sposto tutti i pezzi di quanto si e' accorciato il grezzo
If CurrentMachine.NestingCorner = MCH_CR.TR OrElse CurrentMachine.NestingCorner = MCH_CR.BR Then
For Each Part In m_PartVMList
@@ -223,14 +161,6 @@ Public Class MyMachGroupVM
' verifico se la dimensione e' maggiore del box minimo dei pezzi
Dim b3Parts As New BBox3d
Configuration.VerifyMaxDimension(m_PartVMList, b3Parts)
'Dim nBoxLayerId As Integer = EgtGetFirstNameInGroup(m_PartVMList(0).nPartId, "Box")
'EgtGetBBoxGlob(nBoxLayerId, GDB_BB.EXACT, b3Parts)
'For PartIndex = 1 To m_PartVMList.Count - 1
' Dim b3Part As New BBox3d
' nBoxLayerId = EgtGetFirstNameInGroup(m_PartVMList(PartIndex).nPartId, "Box")
' EgtGetBBoxGlob(nBoxLayerId, GDB_BB.EXACT, b3Part)
' b3Parts.Add(b3Part)
'Next
Dim b3RawPart As New BBox3d
EgtGetRawPartBBox(nRawPartId, b3RawPart)
Dim dMinValue As Double = 0
@@ -248,19 +178,6 @@ Public Class MyMachGroupVM
' riporto il grezzo nell'angolo tavola di origine
Dim b3Tab As New BBox3d
Configuration.SelectCorner(b3Tab, nRawPartId)
'EgtGetTableArea(1, b3Tab)
'Dim p3OrigOnTab As Point3d
'Select Case CurrentMachine.OrigCorner
' Case MCH_CR.BL
' p3OrigOnTab = New Point3d(CurrentMachine.OrigOffsX, CurrentMachine.OrigOffsY, 0)
' Case MCH_CR.BR
' p3OrigOnTab = New Point3d(b3Tab.DimX() - CurrentMachine.OrigOffsX, CurrentMachine.OrigOffsY, 0)
' Case MCH_CR.TL
' p3OrigOnTab = New Point3d(CurrentMachine.OrigOffsX, b3Tab.DimY() - CurrentMachine.OrigOffsY, 0)
' Case MCH_CR.TR
' p3OrigOnTab = New Point3d(b3Tab.DimX() - CurrentMachine.OrigOffsX, b3Tab.DimY() - CurrentMachine.OrigOffsY, 0)
'End Select
'EgtMoveToCornerRawPart(nRawPartId, p3OrigOnTab, CurrentMachine.OrigCorner)
' sposto tutti i pezzi di quanto si e' accorciato il grezzo
If CurrentMachine.NestingCorner = MCH_CR.TR OrElse CurrentMachine.NestingCorner = MCH_CR.TL Then
For Each Part In m_PartVMList
@@ -1,7 +1,6 @@
Imports System.Collections.ObjectModel
Imports System.Collections.Specialized
Imports System.ComponentModel
Imports System.IO
Imports EgtBEAMWALL.Core
Imports EgtBEAMWALL.DataLayer.DatabaseModels
Imports EgtUILib
@@ -360,39 +359,21 @@ Public Class PartVM
' annullo Flip
If bFLIP Then EgtRotate(nPartId, b3Box.Center, Vector3d.Z_AX, 180, GDB_RT.GLOB)
' ripristino rotazione
Dim dRotation As Integer = 0
If dW <> dH Then
dRotation = m_PartM.dROT + dRot
m_PartM.dROT = dRotation
If dRotation >= 360 Then
dRotation = dRot
m_PartM.dROT = 0
End If
ElseIf dW = dH Then
dRotation = m_PartM.dROT - dRot
If dRotation = 0 Then
dRotation = 3 * dRot
m_PartM.dROT = 0
ElseIf dRotation = 90 Then
dRotation += 2 * dRot
m_PartM.dROT = 90
ElseIf dRotation = 180 Then
dRotation += dRot
m_PartM.dROT = 180
ElseIf dRotation < 0 Then
dRotation += 4 * dRot
m_PartM.dROT = 270
End If
Dim TempRot = m_PartM.dROT
TempRot -= dRot
If TempRot >= 360 Then
TempRot -= 360
ElseIf TempRot < 0 Then
TempRot += 360
End If
EgtRotate(nPartId, b3Box.Center, Vector3d.X_AX, dRotation, GDB_RT.GLOB)
' salvo informazione
m_PartM.dROT = TempRot
EgtSetInfo(nPartId, MGR_PRT_ROT, m_PartM.dROT)
' annullo Flip
EgtRotate(nPartId, b3Box.Center, Vector3d.X_AX, -dRot, GDB_RT.GLOB)
If bFLIP Then EgtRotate(nPartId, b3Box.Center, Vector3d.Z_AX, 180, GDB_RT.GLOB)
If Not ExecBeam(sLogPath, Map.refMachinePanelVM.SelectedMachine.Name, CalcIntegration.CmdTypes.RAWPART, False) Then
EgtOutLog("Fallita esecuzione ExecBeam. ERRORE")
End If
NotifyPropertyChanged(NameOf(m_PartM.dROT))
NotifyPropertyChanged(NameOf(sROT))
End If
ElseIf Map.refProjectVM.BTLStructureVM.nPROJTYPE = BWType.WALL Then
' salvo posizione
@@ -563,15 +563,6 @@ Public Class ProjManagerVM
If bShowLoading Then LoadingWndHelper.OpenLoadingWnd(ActiveIds.SAVEPROJ, 1, EgtMsg(63007), "", 100) ' Project saving
' se vista tutti i pezzi
Configuration.ShowAllPieces(bShowBuilding, bShowSolid, True, False)
'If Map.refShowBeamPanelVM.bShowAll Then
' ' verifico se assemblato e lo annullo per salvataggio
' bShowBuilding = Map.refShowBeamPanelVM.ShowBuilding_IsChecked
' If bShowBuilding Then Map.refProjectVM.BTLStructureVM.ShowBuilding(False, False)
' ' se vista singolo pezzo
'Else
' bShowSolid = Map.refShowBeamPanelVM.ShowSolid_IsChecked
' If bShowSolid Then Map.refProjectVM.BTLStructureVM.ShowSolid(GDB_ID.NULL, False, False)
'End If
' imposto ProjId di caricamento
m_nLoadingProjId = CurrProj.nProjId
Map.refSceneHostVM.SaveProject()
@@ -861,18 +852,6 @@ Public Class ProjManagerVM
Dim bShowSolid As Boolean = False
Dim nSelPartId As Integer = GDB_ID.NULL
Configuration.ShowAllPieces(bShowBuilding, bShowSolid, nSelPartId, True)
'If Map.refShowBeamPanelVM.bShowAll Then
' ' verifico se assemblato e lo annullo per salvataggio
' bShowBuilding = Map.refShowBeamPanelVM.ShowBuilding_IsChecked
' If bShowBuilding Then Map.refProjectVM.BTLStructureVM.ShowBuilding(False, False)
' ' se vista singolo pezzo
'Else
' bShowSolid = Map.refShowBeamPanelVM.ShowSolid_IsChecked
' If bShowSolid Then Map.refProjectVM.BTLStructureVM.ShowSolid(GDB_ID.NULL, False, False)
' ' se pezzo selezionato lo segno e metto vista tutti
' nSelPartId = Map.refProjectVM.BTLStructureVM.SelBTLPart.nPartId
' Map.refProjectVM.BTLStructureVM.ShowAll(False)
'End If
Dim sDir As String = String.Empty
GetMainPrivateProfileString(S_GENERAL, K_LASTUPDATEDIR, "", sDir)
@@ -1182,26 +1161,6 @@ Public Class ProjManagerVM
' elimino i pezzi da sovrascrivere nel progetto corrente
Configuration.DeletePieces(UpdateBTLWndVM.BTLPartList)
'For Each BTLPartToOverwriteWith In UpdateBTLWndVM.BTLPartList
' If BTLPartToOverwriteWith.bInsert Then
' Dim BTLPartToUpdate As BTLPartVM = Map.refProjectVM.BTLStructureVM.BTLPartVMList.FirstOrDefault(Function(x) x.nPDN = BTLPartToOverwriteWith.nPDN)
' ' se BTLPartToUpdate è Nothing significa che il pezzo è nuovo e quindi basta accodarlo senza eliminare nulla
' If Not IsNothing(BTLPartToUpdate) Then
' Dim nPartToDeleteId As Integer = BTLPartToUpdate.nPartId
' Dim nCurrPartId = EgtGetCurrPart()
' EgtErase(nPartToDeleteId)
' nCurrPartId = EgtGetCurrPart()
' ' verifico se rimuovere sezione dalla lista
' If Not Map.refProjectVM.BTLStructureVM.BTLPartVMList.Any(Function(x) x IsNot BTLPartToUpdate AndAlso x.Section = BTLPartToUpdate.Section) Then
' Map.refProjectVM.BTLStructureVM.SectionList.Remove(BTLPartToUpdate.Section)
' End If
' ' rimuovo dalla lista pezzi
' Dim Index As Integer = Map.refProjectVM.BTLStructureVM.BTLPartVMList.IndexOf(BTLPartToUpdate)
' Map.refProjectVM.BTLStructureVM.SetSelBTLPart(Nothing)
' Map.refProjectVM.BTLStructureVM.BTLPartVMList.RemoveAt(Index)
' End If
' End If
'Next
' salvo gli id degli AsseBase presenti nel progetto corrente
Dim AsseBaseIdList As New List(Of Integer)
@@ -1384,11 +1343,6 @@ Public Class ProjManagerVM
Dim bShowBuilding As Boolean = False
If Map.refMainMenuVM.SelPage = Pages.VIEW Then
Configuration.ShowAllPieces(bShowBuilding)
'If Map.refShowBeamPanelVM.bShowAll Then
' ' verifico se assemblato e lo annullo per salvataggio
' bShowBuilding = Map.refShowBeamPanelVM.ShowBuilding_IsChecked
' If bShowBuilding Then Map.refProjectVM.BTLStructureVM.ShowBuilding(False, False)
'End If
End If
' per ogni BTLInfo nel progetto riporto il relativo nome del BTL
@@ -1,7 +1,6 @@
Imports System.Collections.ObjectModel
Imports EgtBEAMWALL.Core
Imports EgtUILib
Imports EgtWPFLib5
Module Configuration