29ce306644
-aggiunto salvataggio info strategia forzata e parametro generale forzato
477 lines
20 KiB
VB.net
477 lines
20 KiB
VB.net
Imports System.Collections.ObjectModel
|
|
Imports System.IO
|
|
Imports EgtBEAMWALL.Core
|
|
Imports EgtBEAMWALL.Optimizer.MainMenuVM
|
|
Imports EgtUILib
|
|
Imports EgtWPFLib5
|
|
Imports Newtonsoft.Json
|
|
|
|
Public Class BTLPartManagerVM
|
|
Inherits VMBase
|
|
|
|
#Region "FIELDS & PROPERTIES"
|
|
|
|
Private m_BTLPartManager_IsEnabled As Boolean = True
|
|
Public ReadOnly Property BTLPartManager_IsEnabled As Boolean
|
|
Get
|
|
Return m_BTLPartManager_IsEnabled
|
|
End Get
|
|
End Property
|
|
|
|
Public ReadOnly Property CopyPart_IsEnabled As Boolean
|
|
Get
|
|
Return m_BTLPartManager_IsEnabled AndAlso Not IsNothing(Map.refShowBeamPanelVM) AndAlso Not Map.refShowBeamPanelVM.bShowAll AndAlso Not IsNothing(Map.refProjectVM.BTLStructureVM) AndAlso Not Map.refProjectVM.BTLStructureVM.SelBTLParts.Count > 1
|
|
End Get
|
|
End Property
|
|
|
|
Public ReadOnly Property RotatePart_IsEnabled As Boolean
|
|
Get
|
|
Return m_BTLPartManager_IsEnabled AndAlso Not IsNothing(Map.refProjectVM) AndAlso Not IsNothing(Map.refProjectVM.BTLStructureVM) AndAlso Map.refProjectVM.BTLStructureVM.SelBTLParts.Count > 1
|
|
End Get
|
|
End Property
|
|
|
|
Public ReadOnly Property RemovePart_IsEnabled As Boolean
|
|
Get
|
|
Return m_BTLPartManager_IsEnabled
|
|
End Get
|
|
End Property
|
|
|
|
' Definizione comandi
|
|
Private m_cmdCopyPart As ICommand
|
|
Private m_cmdRemovePart As ICommand
|
|
Private m_cmdSimulate As ICommand
|
|
Private m_cmdEdit As ICommand
|
|
Private m_cmdResetCalc As ICommand
|
|
|
|
#Region "Messages"
|
|
|
|
Public ReadOnly Property NewRawPart_ToolTip As String
|
|
Get
|
|
Return EgtMsg(61903)
|
|
End Get
|
|
End Property
|
|
|
|
Public ReadOnly Property NewRawPartLast_ToolTip As String
|
|
Get
|
|
Return EgtMsg(61977)
|
|
End Get
|
|
End Property
|
|
|
|
Public ReadOnly Property AddToRawPart_ToolTip As String
|
|
Get
|
|
Return EgtMsg(61904)
|
|
End Get
|
|
End Property
|
|
|
|
Public ReadOnly Property CopyPart_ToolTip As String
|
|
Get
|
|
Return EgtMsg(61905)
|
|
End Get
|
|
End Property
|
|
|
|
Public ReadOnly Property RemovePart_ToolTip As String
|
|
Get
|
|
Return EgtMsg(61907)
|
|
End Get
|
|
End Property
|
|
|
|
Public ReadOnly Property AddFeature_ToolTip As String
|
|
Get
|
|
Return EgtMsg(61910)
|
|
End Get
|
|
End Property
|
|
|
|
Public ReadOnly Property RemoveFeature_ToolTip As String
|
|
Get
|
|
Return EgtMsg(61911)
|
|
End Get
|
|
End Property
|
|
|
|
Public ReadOnly Property BackRotation_ToolTip As String
|
|
Get
|
|
Return EgtMsg(61996)
|
|
End Get
|
|
End Property
|
|
|
|
Public ReadOnly Property ForwardRotation_ToolTip As String
|
|
Get
|
|
Return EgtMsg(61997)
|
|
End Get
|
|
End Property
|
|
|
|
Public ReadOnly Property InvertSx_ToolTip As String
|
|
Get
|
|
Return EgtMsg(61998)
|
|
End Get
|
|
End Property
|
|
|
|
Public ReadOnly Property InvertDx_ToolTip As String
|
|
Get
|
|
Return EgtMsg(61999)
|
|
End Get
|
|
End Property
|
|
|
|
Public ReadOnly Property Simulate_ToolTip As String
|
|
Get
|
|
Return EgtMsg(61902)
|
|
End Get
|
|
End Property
|
|
|
|
Public ReadOnly Property Edit_ToolTip As String
|
|
Get
|
|
Return EgtMsg(61939)
|
|
End Get
|
|
End Property
|
|
|
|
Public ReadOnly Property ResetCalc_ToolTip As String
|
|
Get
|
|
Return EgtMsg(61940)
|
|
End Get
|
|
End Property
|
|
|
|
#End Region ' Messages
|
|
|
|
#End Region ' Fields & Properties
|
|
|
|
#Region "CONSTRUCTOR"
|
|
|
|
Sub New()
|
|
Map.SetRefBTLPartManagerVM(Me)
|
|
End Sub
|
|
|
|
#End Region ' Constructor
|
|
|
|
#Region "METHODS"
|
|
|
|
Friend Sub SetBTLPartManagerIsEnabled(bIsEnabled As Boolean)
|
|
m_BTLPartManager_IsEnabled = bIsEnabled
|
|
NotifyPropertyChanged(NameOf(BTLPartManager_IsEnabled))
|
|
NotifyPropertyChanged(NameOf(CopyPart_IsEnabled))
|
|
NotifyPropertyChanged(NameOf(RemovePart_IsEnabled))
|
|
End Sub
|
|
|
|
Friend Sub PartShowAllChanged()
|
|
NotifyPropertyChanged(NameOf(CopyPart_IsEnabled))
|
|
NotifyPropertyChanged(NameOf(RemovePart_IsEnabled))
|
|
End Sub
|
|
|
|
' funzione che gestisce risposta da thread di verifica, aggiorna progress e segnala comando di interruzione
|
|
Private Sub ManageCalc(dProgress As Double, sProgress As String, ByRef bCancel As Boolean)
|
|
If dProgress = 0 Then
|
|
Map.refMyStatusBarVM.SetLoadingProgress_Visibility(True)
|
|
Map.refMyStatusBarVM.SetStopProgress_IsActive(True)
|
|
Map.refMyStatusBarVM.SetStopProgress_IsEnabled(True)
|
|
Map.refMyStatusBarVM.SetOutputMessage(sProgress)
|
|
Map.refMyStatusBarVM.SetStopProgress_IsActive(True)
|
|
Map.refMyStatusBarVM.SetStopProgress_IsEnabled(True)
|
|
ElseIf dProgress = 1 Then
|
|
Map.refMyStatusBarVM.SetLoadingProgress_Visibility(False)
|
|
Map.refMyStatusBarVM.SetStopProgress_IsActive(False)
|
|
Map.refMyStatusBarVM.SetStopProgress_IsEnabled(False)
|
|
Map.refMyStatusBarVM.SetOutputMessage(sProgress, 3)
|
|
End If
|
|
bCancel = Map.refMyStatusBarVM.bStopProgress
|
|
Map.refMyStatusBarVM.SetLoadingProgress(dProgress * 100)
|
|
Map.refMyStatusBarVM.SetOutputMessage(sProgress)
|
|
End Sub
|
|
|
|
Private Sub GetGeneralParameters()
|
|
' leggo cartella dei setup delle strategie
|
|
Dim AISetupDirPath As String = Map.refMainWindowVM.MainWindowM.GetAISetupDirPath(ProjectManagerVM.CurrProd.nType, True)
|
|
Dim AISetupPaths As String() = Directory.GetFiles(AISetupDirPath)
|
|
For Each AiSetup In AISetupPaths
|
|
Map.refProjectVM.StrategySetupList.Add(Path.GetFileNameWithoutExtension(AiSetup))
|
|
Next
|
|
|
|
Dim sStrategiesDirPath As String = Map.refMainWindowVM.MainWindowM.GetStrategiesDirPath(Map.refStrategyManagerVM.SelStrategyType.Id)
|
|
Dim sGeneralParametersFilePath As String = sStrategiesDirPath & "\" & GENERALPARAMETERS_FILE & ".json"
|
|
If File.Exists(sGeneralParametersFilePath) Then
|
|
Dim sReadedFiles As String = File.ReadAllText(sGeneralParametersFilePath)
|
|
Dim JsonGeneralParametersList As List(Of JsonGeneralParameters) = JsonConvert.DeserializeObject(Of List(Of JsonGeneralParameters))(sReadedFiles)
|
|
Map.refProjectVM.GeneralParametersList = New ObservableCollection(Of ProjectParameters)((From JsonGeneralParameter In JsonGeneralParametersList
|
|
Select JsonGeneralParameter.Deserialize(Map.refStrategyManagerVM.SelStrategyType.Id)).ToList())
|
|
For Each GenericItem As ProjectParameters In Map.refProjectVM.GeneralParametersList
|
|
Select Case GenericItem.sMinUserLevel
|
|
Case UserLevel.ADVANCED
|
|
Map.refMainMenuVM.UserLevelGenericVisibility(GenericItem, If(Map.refMainMenuVM.UserAdmin_IsChecked, Visibility.Visible, Visibility.Collapsed))
|
|
Case Else
|
|
If Not Map.refMainMenuVM.UserAdmin_IsChecked Then
|
|
Map.refMainMenuVM.UserLevelGenericVisibility(GenericItem, If(GenericItem.sMinUserLevel = UserLevel.USER, Visibility.Visible, Visibility.Collapsed))
|
|
Map.refMainMenuVM.SetUnloackImage("pack://application:,,,/Resources/NewPage/padlock.png")
|
|
End If
|
|
End Select
|
|
Next
|
|
NotifyPropertyChanged(NameOf(Map.refProjectVM.GeneralParametersList))
|
|
End If
|
|
|
|
' Leggo info se presenti
|
|
Dim sInfo As String = String.Empty
|
|
Dim sDefaultConfigFile As String = String.Empty
|
|
Dim sTrimDefaultConfig As String = String.Empty
|
|
EgtGetInfo(Map.refProjectVM.BTLStructureVM.SelBTLPart.BTLPartM.nPartId, AI_SETUP, Map.refProjectVM.SelStrategySetup)
|
|
If Map.refProjectVM.SelStrategySetup Is String.Empty Then
|
|
If GetMainPrivateProfileString(S_STRATEGY, K_DEFAULTCONFIG, "", sDefaultConfigFile) <> 0 Then
|
|
sTrimDefaultConfig = System.IO.Path.GetFileNameWithoutExtension(sDefaultConfigFile)
|
|
Map.refProjectVM.SelStrategySetup = sTrimDefaultConfig
|
|
EgtSetInfo(Map.refProjectVM.BTLStructureVM.SelBTLPart.BTLPartM.nPartId, AI_SETUP, Map.refProjectVM.SelStrategySetup)
|
|
End If
|
|
End If
|
|
For Each GeneralParameter In Map.refProjectVM.GeneralParametersList
|
|
Select Case GeneralParameter.GetType()
|
|
Case GetType(BooleanGenericParameter)
|
|
Map.refProjectVM.SetbSaveGeneralParameters(True)
|
|
Map.refProjectVM.SetGeneralParametersIsEnable(True)
|
|
Dim sTmpBoolValue As Boolean = DirectCast(GeneralParameter, BooleanGenericParameter).bValue
|
|
If Not EgtGetInfo(Map.refProjectVM.BTLStructureVM.SelBTLPart.BTLPartM.nPartId, GeneralParameter.sNameNge, DirectCast(GeneralParameter, BooleanGenericParameter).bValue) Then
|
|
DirectCast(GeneralParameter, BooleanGenericParameter).bValue = sTmpBoolValue
|
|
Map.refProjectVM.SetbSaveGeneralParameters(False)
|
|
Map.refProjectVM.SetGeneralParametersIsEnable(False)
|
|
Return
|
|
End If
|
|
Case GetType(DoubleGenericParameter)
|
|
Map.refProjectVM.SetbSaveGeneralParameters(True)
|
|
Map.refProjectVM.SetGeneralParametersIsEnable(True)
|
|
Dim sTmpDoubleValue As String = DirectCast(GeneralParameter, DoubleGenericParameter).sValue
|
|
If Not EgtGetInfo(Map.refProjectVM.BTLStructureVM.SelBTLPart.BTLPartM.nPartId, GeneralParameter.sNameNge, DirectCast(GeneralParameter, DoubleGenericParameter).sValue) Then
|
|
DirectCast(GeneralParameter, DoubleGenericParameter).sValue = sTmpDoubleValue
|
|
Map.refProjectVM.SetbSaveGeneralParameters(False)
|
|
Map.refProjectVM.SetGeneralParametersIsEnable(False)
|
|
Return
|
|
End If
|
|
Case GetType(ComboGenericParameter)
|
|
Map.refProjectVM.SetbSaveGeneralParameters(True)
|
|
Map.refProjectVM.SetGeneralParametersIsEnable(True)
|
|
Dim sTmpComboValue As String = DirectCast(GeneralParameter, ComboGenericParameter).SelValue.sValue
|
|
Dim sTmpValueInfo As String = String.Empty
|
|
EgtGetInfo(Map.refProjectVM.BTLStructureVM.SelBTLPart.BTLPartM.nPartId, GeneralParameter.sNameNge, sTmpValueInfo)
|
|
If sTmpValueInfo = String.Empty Then
|
|
DirectCast(GeneralParameter, ComboGenericParameter).SelValue.sValue = sTmpComboValue
|
|
Map.refProjectVM.SetbSaveGeneralParameters(False)
|
|
Map.refProjectVM.SetGeneralParametersIsEnable(False)
|
|
Return
|
|
Else
|
|
DirectCast(GeneralParameter, ComboGenericParameter).SelValue = DirectCast(GeneralParameter, ComboGenericParameter).ComboList.FirstOrDefault(Function(x) x.sValue = sTmpValueInfo)
|
|
End If
|
|
Case GetType(StringGenericParameter)
|
|
Map.refProjectVM.SetbSaveGeneralParameters(True)
|
|
Map.refProjectVM.SetGeneralParametersIsEnable(True)
|
|
Dim sTmpStringValue As String = DirectCast(GeneralParameter, StringGenericParameter).sValue
|
|
If Not EgtGetInfo(Map.refProjectVM.BTLStructureVM.SelBTLPart.BTLPartM.nPartId, GeneralParameter.sNameNge, DirectCast(GeneralParameter, StringGenericParameter).sValue) Then
|
|
DirectCast(GeneralParameter, StringGenericParameter).sValue = sTmpStringValue
|
|
Map.refProjectVM.SetbSaveGeneralParameters(False)
|
|
Map.refProjectVM.SetGeneralParametersIsEnable(False)
|
|
Return
|
|
End If
|
|
Case GetType(ListGenericParameter)
|
|
Map.refProjectVM.SetbSaveGeneralParameters(True)
|
|
Map.refProjectVM.SetGeneralParametersIsEnable(True)
|
|
For Each Item As ToolParameter In DirectCast(GeneralParameter, ListGenericParameter).ListValue
|
|
If Item.bIsActive Then
|
|
sInfo &= Item.sUUID & "," & Item.sName & ";"
|
|
Dim sTmpInfo As String = sInfo
|
|
If Not EgtGetInfo(Map.refProjectVM.BTLStructureVM.SelBTLPart.BTLPartM.nPartId, GeneralParameter.sNameNge, sInfo) Then
|
|
sInfo = sTmpInfo
|
|
Map.refProjectVM.SetbSaveGeneralParameters(False)
|
|
Map.refProjectVM.SetGeneralParametersIsEnable(False)
|
|
Return
|
|
End If
|
|
End If
|
|
Next
|
|
End Select
|
|
Next
|
|
End Sub
|
|
|
|
#End Region ' Methods
|
|
|
|
#Region "COMMANDS"
|
|
|
|
#Region "CopyPart"
|
|
|
|
Public ReadOnly Property CopyPart_Command As ICommand
|
|
Get
|
|
If m_cmdCopyPart Is Nothing Then
|
|
m_cmdCopyPart = New Command(AddressOf CopyPart)
|
|
End If
|
|
Return m_cmdCopyPart
|
|
End Get
|
|
End Property
|
|
|
|
Public Sub CopyPart()
|
|
If IsNothing(ProjectManagerVM.CurrProd) Then Return
|
|
Dim SelPart As BTLPartVM = Map.refProjectVM.BTLStructureVM.SelBTLPart
|
|
If IsNothing(SelPart) Then Return
|
|
' creo copia
|
|
Dim NewPart As BTLPartM = SelPart.Copy()
|
|
If Not IsNothing(NewPart) Then
|
|
' selezione ultimo che e' quello appena creato
|
|
Map.refProjectVM.BTLStructureVM.SetSelBTLPart(Map.refProjectVM.BTLStructureVM.BTLPartVMList(Map.refProjectVM.BTLStructureVM.BTLPartVMList.Count - 1), False, True)
|
|
End If
|
|
End Sub
|
|
|
|
#End Region ' CopyPart
|
|
|
|
#Region "RemovePart"
|
|
|
|
Public ReadOnly Property RemovePart_Command As ICommand
|
|
Get
|
|
If m_cmdRemovePart Is Nothing Then
|
|
m_cmdRemovePart = New Command(AddressOf RemovePartCmd)
|
|
End If
|
|
Return m_cmdRemovePart
|
|
End Get
|
|
End Property
|
|
|
|
Public Sub RemovePartCmd()
|
|
If IsNothing(ProjectManagerVM.CurrProd) Then Return
|
|
If MessageBox.Show(EgtMsg(62573), EgtMsg(30009), MessageBoxButton.OKCancel, MessageBoxImage.Exclamation) = MessageBoxResult.OK Then
|
|
If Map.refProjectVM.BTLStructureVM.SelBTLParts.Count > 0 Then
|
|
Dim CurrSelBTLParts As List(Of BTLPartVM) = Map.refProjectVM.BTLStructureVM.SelBTLParts.ToList()
|
|
For RemoveIndex = CurrSelBTLParts.Count - 1 To 0 Step -1
|
|
RemovePart(CurrSelBTLParts(RemoveIndex), RemoveIndex = 0)
|
|
Next
|
|
End If
|
|
Else
|
|
Return
|
|
End If
|
|
End Sub
|
|
|
|
Public Sub RemovePart(BTLPartToDelete As BTLPartVM, bSelPrevious As Boolean)
|
|
' verifico se ci sono già copie in grezzi
|
|
Dim nDuploCount As Integer = 0
|
|
If EgtDuploCount(BTLPartToDelete.nPartId, nDuploCount) AndAlso nDuploCount > 0 Then
|
|
' avviso che il pezzo non è cancellabile perchè in produzione
|
|
MessageBox.Show(String.Format(EgtMsg(61929), nDuploCount), EgtMsg(15003), MessageBoxButton.OK, MessageBoxImage.Warning)
|
|
Return
|
|
End If
|
|
' verifico se rimuovere sezione dalla lista
|
|
If Not Map.refProjectVM.BTLStructureVM.BTLPartVMList.Any(Function(x) x IsNot BTLPartToDelete AndAlso x.Section = BTLPartToDelete.Section) Then
|
|
Map.refProjectVM.BTLStructureVM.SectionList.Remove(BTLPartToDelete.Section)
|
|
Map.refProjectVM.BTLStructureVM.SelSection = SectionXMaterial.Empty
|
|
End If
|
|
' Eseguo cancellazione
|
|
EgtBeamSetPart(BTLPartToDelete.nPartId)
|
|
' seleziono elemento precedente
|
|
Dim Index As Integer = Map.refProjectVM.BTLStructureVM.BTLPartVMList.IndexOf(BTLPartToDelete)
|
|
Dim FilteredIndex As Integer = Map.refProjectVM.BTLStructureVM.BTLPartVMList_View.IndexOf(BTLPartToDelete)
|
|
Map.refProjectVM.BTLStructureVM.SelBTLParts.Remove(BTLPartToDelete)
|
|
If EgtBeamErasePart() Then
|
|
If bSelPrevious Then
|
|
If FilteredIndex = 0 Then
|
|
If Map.refProjectVM.BTLStructureVM.BTLPartVMList_View.Count > 1 Then
|
|
Map.refProjectVM.BTLStructureVM.SetSelBTLPart(Map.refProjectVM.BTLStructureVM.BTLPartVMList_View(1))
|
|
Else
|
|
Map.refProjectVM.BTLStructureVM.SetSelBTLPart(Nothing)
|
|
End If
|
|
ElseIf FilteredIndex = Map.refProjectVM.BTLStructureVM.BTLPartVMList_View.Count - 1 Then
|
|
If Map.refProjectVM.BTLStructureVM.BTLPartVMList_View.Count > 1 Then
|
|
Map.refProjectVM.BTLStructureVM.SetSelBTLPart(Map.refProjectVM.BTLStructureVM.BTLPartVMList_View(Map.refProjectVM.BTLStructureVM.BTLPartVMList_View.Count - 2))
|
|
Else
|
|
Map.refProjectVM.BTLStructureVM.SetSelBTLPart(Nothing)
|
|
End If
|
|
Else
|
|
Map.refProjectVM.BTLStructureVM.SetSelBTLPart(Map.refProjectVM.BTLStructureVM.BTLPartVMList_View(FilteredIndex - 1))
|
|
End If
|
|
End If
|
|
' rimuovo dalla lista pezzi
|
|
Map.refProjectVM.BTLStructureVM.BTLPartVMList.RemoveAt(Index)
|
|
End If
|
|
End Sub
|
|
|
|
#End Region ' RemovePart
|
|
|
|
#Region "SimulateCommand"
|
|
|
|
Public ReadOnly Property Simulate_Command As ICommand
|
|
Get
|
|
If m_cmdSimulate Is Nothing Then
|
|
m_cmdSimulate = New Command(AddressOf Simulate)
|
|
End If
|
|
Return m_cmdSimulate
|
|
End Get
|
|
End Property
|
|
|
|
Friend Sub Simulate()
|
|
If ((IsNothing(ProjectManagerVM.CurrProj) OrElse IsNothing(Map.refProjectVM.BTLStructureVM)) AndAlso (IsNothing(ProjectManagerVM.CurrProd) OrElse IsNothing(Map.refProjectVM.MachGroupPanelVM))) Then Return
|
|
Dim ProjType As BWType
|
|
Dim BarList() As EgtBEAMWALL.Core.Bar = Nothing
|
|
ProjType = Map.refProdManagerVM.CurrProd.nType
|
|
If Not CreateBarToSimulate(ProjType, BarList) Then Return
|
|
' lancio simulazione
|
|
EgtBEAMWALL.Core.CalcIntegration.Run(BarList, ProjectManagerVM.CurrProd.sProdDirPath & "\Projs\" & Map.refProjectVM.BTLStructureVM.SelBTLPart.nPROJ.ToString("0000"), AddressOf ManageCalc)
|
|
End Sub
|
|
|
|
Private Function CreateBarToSimulate(ProjType As BWType, ByRef BarList As Bar()) As Boolean
|
|
If Not IsNothing(Map.refProjectVM.BTLStructureVM.SelBTLPart) Then
|
|
Dim TempBarList(0) As EgtBEAMWALL.Core.Bar
|
|
Dim Bar As New EgtBEAMWALL.Core.Bar With {.nBarId = Map.refProjectVM.BTLStructureVM.SelBTLPart.nPartId,
|
|
.nProgramPage = ProjectType.PROJ,
|
|
.nProjType = ProjType,
|
|
.bBarOk = True,
|
|
.nMachineName = ProjectManagerVM.CurrProd.sMachine,
|
|
.nCmdType = CalcIntegration.CmdTypes.SIMULATE,
|
|
.nGlobState = Map.refProjectVM.BTLStructureVM.SelBTLPart.nGlobalState}
|
|
If Map.refProjectVM.BTLStructureVM.SelBTLPart.nGlobalState = CalcStates.NOTCALCULATED Then
|
|
Dim sBTLPartFilePath As String = ProjectManagerVM.CurrProd.sProdDirPath & "\Projs\" & Map.refProjectVM.BTLStructureVM.SelBTLPart.nPROJ.ToString("0000") & "\" & Map.refProjectVM.BTLStructureVM.SelBTLPart.nPDN.ToString() & ".ori.bwe"
|
|
If File.Exists(sBTLPartFilePath) Then File.Delete(sBTLPartFilePath)
|
|
End If
|
|
TempBarList(0) = Bar
|
|
BarList = TempBarList
|
|
Else
|
|
Return False
|
|
End If
|
|
' disabilito interfaccia
|
|
Map.refProjectVM.SetCalcRunning(True)
|
|
Return True
|
|
End Function
|
|
|
|
#End Region ' SimulateCommand
|
|
|
|
#Region "Edit"
|
|
|
|
Public ReadOnly Property Edit_Command As ICommand
|
|
Get
|
|
If m_cmdEdit Is Nothing Then
|
|
m_cmdEdit = New Command(AddressOf Edit)
|
|
End If
|
|
Return m_cmdEdit
|
|
End Get
|
|
End Property
|
|
|
|
Friend Sub Edit()
|
|
GetGeneralParameters()
|
|
Map.refProjectVM.SetRawPartManagerVisibility(Visibility.Collapsed)
|
|
Map.refProjectVM.SetFeatureListVisibility(Visibility.Collapsed)
|
|
Map.refProjectVM.SetSelManagerTab(ProjectVM.StrategyManagerTab.FEATUREMANAGER)
|
|
' Disabilito LeftPanel
|
|
Map.refProjectVM.SetLeftPanel_IsEnabled(False)
|
|
Map.refProjectVM.SetLeftPanel_Opacity(0.2)
|
|
End Sub
|
|
|
|
#End Region ' Edit
|
|
|
|
#Region "ResetCalc"
|
|
|
|
Public ReadOnly Property ResetCalc_Command As ICommand
|
|
Get
|
|
If m_cmdResetCalc Is Nothing Then
|
|
m_cmdResetCalc = New Command(AddressOf ResetCalc)
|
|
End If
|
|
Return m_cmdResetCalc
|
|
End Get
|
|
End Property
|
|
|
|
Public Sub ResetCalc()
|
|
If IsNothing(ProjectManagerVM.CurrProd) OrElse IsNothing(Map.refProjectVM.BTLStructureVM) OrElse IsNothing(Map.refProjectVM.MachGroupPanelVM) Then Return
|
|
Dim SelPart As BTLPartVM = Map.refProjectVM.BTLStructureVM.SelBTLPart
|
|
If IsNothing(SelPart) Then Return
|
|
If SelPart.nGlobalState <> CalcStates.NOTCALCULATED Then
|
|
SelPart.ResetCalcTotalPart()
|
|
End If
|
|
End Sub
|
|
|
|
#End Region ' ResetCalc
|
|
|
|
#End Region ' COMMANDS
|
|
|
|
End Class
|