-aggiunto check default config file strategie
This commit is contained in:
@@ -119,6 +119,12 @@
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</GroupBox>
|
||||
<UniformGrid Columns="2"
|
||||
Margin="0,5,0,0">
|
||||
<TextBlock Text="Importa BTL con verifica" VerticalAlignment="Center" Foreground="{StaticResource BeamWall_Corduroy}"/>
|
||||
<CheckBox IsChecked="{Binding bVerifyImportBTL_IsChecked}"
|
||||
Margin="0,5,0,0"/>
|
||||
</UniformGrid>
|
||||
</StackPanel>
|
||||
|
||||
</Grid>
|
||||
@@ -129,4 +129,9 @@ Public Module ConstIni
|
||||
Public Const K_SERVERADDRESS As String = "ServerAddressRelease"
|
||||
Public Const K_BEAMWALL As String = "EgtBeamWall"
|
||||
|
||||
Public Const S_STRATEGY As String = "Strategy"
|
||||
Public Const K_PARAMPASSWORD As String = "ParamPassword"
|
||||
Public Const K_DEFAULTCONFIG As String = "DefaultConfiguration"
|
||||
|
||||
Public Const K_VERIFYIMPORTBTL As String = "VerifyImportBTL"
|
||||
End Module
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
<TabControl>
|
||||
<TabItem Header="Strategy">
|
||||
<ComboBox ItemsSource="{Binding StrategySetupList}"
|
||||
SelectedItem="{Binding SelStrategySetup}"
|
||||
SelectedItem="{Binding SelStrategySetup, UpdateSourceTrigger=PropertyChanged}"
|
||||
Style="{StaticResource Strategy_ComboBox}"/>
|
||||
</TabItem>
|
||||
<TabItem Header="BTL">
|
||||
|
||||
@@ -26,8 +26,11 @@ Public Class BTLDataWndVM
|
||||
Set(value As String)
|
||||
If m_SelStrategySetup <> value Then
|
||||
EgtSetInfo(m_nBTLInfoLayerId, "AISETUP", value)
|
||||
WriteMainPrivateProfileString(S_STRATEGY, K_DEFAULTCONFIG, m_SelStrategySetup & ".json")
|
||||
Map.refOnlyProdManagerVM.Save()
|
||||
End If
|
||||
m_SelStrategySetup = value
|
||||
NotifyPropertyChanged(NameOf(SelStrategySetup))
|
||||
End Set
|
||||
End Property
|
||||
|
||||
@@ -539,8 +542,16 @@ Public Class BTLDataWndVM
|
||||
End While
|
||||
' leggo parametri Btl
|
||||
ReadBtlParams()
|
||||
' leggo strategia
|
||||
EgtGetInfo(m_nBTLInfoLayerId, "AISETUP", m_SelStrategySetup)
|
||||
'' leggo strategia
|
||||
'EgtGetInfo(m_nBTLInfoLayerId, "AISETUP", m_SelStrategySetup)
|
||||
|
||||
' Controllo se presente file default config
|
||||
Dim sDefaultConfigFile As String = String.Empty
|
||||
Dim sTrimDefaultConfig As String = String.Empty
|
||||
If GetMainPrivateProfileString(S_STRATEGY, K_DEFAULTCONFIG, "", sDefaultConfigFile) <> 0 Then
|
||||
sTrimDefaultConfig = System.IO.Path.GetFileNameWithoutExtension(sDefaultConfigFile)
|
||||
m_SelStrategySetup = sTrimDefaultConfig
|
||||
End If
|
||||
End Sub
|
||||
|
||||
#End Region ' CONSTRUCTOR
|
||||
|
||||
@@ -1576,32 +1576,32 @@ Public Class BTLPartVM
|
||||
End If
|
||||
End Set
|
||||
End Property
|
||||
Public Property SelBTLFeatureVMOnlyGraph As BTLFeatureVM
|
||||
Get
|
||||
Return m_SelBTLFeatureVM
|
||||
End Get
|
||||
Set(value As BTLFeatureVM)
|
||||
m_SelBTLFeatureVM = value
|
||||
If Not IsNothing(m_SelBTLFeatureVM) Then
|
||||
m_SelBTLFeatureVM.SelGeomFeature()
|
||||
' deseleziono i parametri
|
||||
If Not IsNothing(SelBTLFeatureVM.SelPBTLParam) Then SelBTLFeatureVM.SelPBTLParam = Nothing
|
||||
End If
|
||||
If Not IsNothing(Map.refFeatureListManagerVM) Then Map.refFeatureListManagerVM.FeatureSelectionChanged()
|
||||
EgtResetCurrMachGroup()
|
||||
ResetSearchFound()
|
||||
Map.refStatisticsTimePanelVM.SetViewPage_Visibility(Visibility.Visible)
|
||||
Map.refStatisticsTimePanelVM.SetMachiningPage_Visibility(Visibility.Collapsed)
|
||||
EgtDraw()
|
||||
NotifyPropertyChanged(NameOf(SelBTLFeatureVM))
|
||||
NotifyPropertyChanged(NameOf(SelBTLFeatureVMOnlyGraph))
|
||||
' se modalità building, la tolgo
|
||||
If Not IsNothing(m_SelBTLFeatureVM) AndAlso Map.refShowBeamPanelVM.ShowBuilding_IsChecked Then
|
||||
Map.refProjectVM.BTLStructureVM.ShowBuilding(False, False)
|
||||
Map.refShowBeamPanelVM.SetShowBuilding(False)
|
||||
End If
|
||||
End Set
|
||||
End Property
|
||||
'Public Property SelBTLFeatureVMOnlyGraph As BTLFeatureVM
|
||||
' Get
|
||||
' Return m_SelBTLFeatureVM
|
||||
' End Get
|
||||
' Set(value As BTLFeatureVM)
|
||||
' m_SelBTLFeatureVM = value
|
||||
' If Not IsNothing(m_SelBTLFeatureVM) Then
|
||||
' m_SelBTLFeatureVM.SelGeomFeature()
|
||||
' ' deseleziono i parametri
|
||||
' If Not IsNothing(SelBTLFeatureVM.SelPBTLParam) Then SelBTLFeatureVM.SelPBTLParam = Nothing
|
||||
' End If
|
||||
' If Not IsNothing(Map.refFeatureListManagerVM) Then Map.refFeatureListManagerVM.FeatureSelectionChanged()
|
||||
' EgtResetCurrMachGroup()
|
||||
' ResetSearchFound()
|
||||
' Map.refStatisticsTimePanelVM.SetViewPage_Visibility(Visibility.Visible)
|
||||
' Map.refStatisticsTimePanelVM.SetMachiningPage_Visibility(Visibility.Collapsed)
|
||||
' EgtDraw()
|
||||
' NotifyPropertyChanged(NameOf(SelBTLFeatureVM))
|
||||
' NotifyPropertyChanged(NameOf(SelBTLFeatureVMOnlyGraph))
|
||||
' ' se modalità building, la tolgo
|
||||
' If Not IsNothing(m_SelBTLFeatureVM) AndAlso Map.refShowBeamPanelVM.ShowBuilding_IsChecked Then
|
||||
' Map.refProjectVM.BTLStructureVM.ShowBuilding(False, False)
|
||||
' Map.refShowBeamPanelVM.SetShowBuilding(False)
|
||||
' End If
|
||||
' End Set
|
||||
'End Property
|
||||
|
||||
Private m_Calc_PartEnd As Boolean = False
|
||||
Public ReadOnly Property Calc_PartEnd As Boolean
|
||||
|
||||
@@ -289,14 +289,22 @@ Public Class ConfigurationPageVM
|
||||
NotifyPropertyChanged(NameOf(MachineParameter_Visibility))
|
||||
End Sub
|
||||
|
||||
Private m_bVerifyImportBTL_IsChecked As Boolean = False
|
||||
Public Property bVerifyImportBTL_IsChecked As String
|
||||
Get
|
||||
Return m_bVerifyImportBTL_IsChecked
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_bVerifyImportBTL_IsChecked = value
|
||||
WriteMainPrivateProfileString(S_GENERAL, K_VERIFYIMPORTBTL, If(m_bVerifyImportBTL_IsChecked, 1, 0))
|
||||
End Set
|
||||
End Property
|
||||
|
||||
' Definizione comandi
|
||||
Private m_cmdSave As ICommand
|
||||
Private m_cmdChooseExternalBackupFolderPath As ICommand
|
||||
Private m_cmdBackup As ICommand
|
||||
Private m_cmdRestore As ICommand
|
||||
Private m_cmdGetAllRelease As ICommand
|
||||
Private m_cmdLinkVersion As ICommand
|
||||
Private m_cmdGetVersionFrom As ICommand
|
||||
|
||||
#Region "Messages"
|
||||
|
||||
@@ -555,24 +563,6 @@ Public Class ConfigurationPageVM
|
||||
GetMainPrivateProfileString(S_NEST, K_SECTIONTIME, "", SectionTime)
|
||||
GetMainPrivateProfileString(S_NEST, K_PARTTIME, "", PartTime)
|
||||
m_bPrintLabel_IsChecked = (GetMainPrivateProfileInt(S_PRINTER, K_ENABLE, 0) <> 0)
|
||||
'' assegno le liste dei parametri della macchina corrente alla ConfigMachTableList alla pagina di Configurazione
|
||||
'ConfigMachTableList = CurrentMachine.MachTableList
|
||||
'' carico i parametri Q dei Process letti dall'ini
|
||||
'GetQParamsList()
|
||||
'' carico la lista di tutti i parametri Q ciclando su ogni Process di PRCList
|
||||
'If Not IsNothing(QBTLParamVMList) Then
|
||||
' QBTLParamVMList.Clear()
|
||||
'End If
|
||||
'For Each PRCItem In PRCList
|
||||
' For Each QBTLParam In PRCItem.QBTLParamVMList
|
||||
' QBTLParamVMList.Add(QBTLParam)
|
||||
' Next
|
||||
'Next
|
||||
'NotifyPropertyChanged(NameOf(QBTLParamVMList))
|
||||
'' setto il grouping a 2 livelli (GRP e, sotto, PRC col nome completo) per la DataGrid
|
||||
'm_QBTLParamVMList_View = CollectionViewSource.GetDefaultView(m_QBTLParamVMList)
|
||||
'm_QBTLParamVMList_View.GroupDescriptions.Add(New PropertyGroupDescription(NameOf(QBTLParamVM.GroupType)))
|
||||
'm_QBTLParamVMList_View.GroupDescriptions.Add(New PropertyGroupDescription(NameOf(QBTLParamVM.ghDesc)))
|
||||
' leggo dati per backup
|
||||
GetMainPrivateProfileString(S_BACKUPANDRESTORE, K_EXTERNALFILEPATH, "", m_ExternalBackupFolderPath)
|
||||
Dim nDefaultReminderFrequency As Integer = GetMainPrivateProfileInt(S_BACKUPANDRESTORE, K_REMINDERFREQUENCY, 1)
|
||||
@@ -581,6 +571,8 @@ Public Class ConfigurationPageVM
|
||||
m_bExternalBackupActive = nExternalBackupActive > 0
|
||||
SetMachineParameter_Visibility(Visibility.Collapsed)
|
||||
SetMachine_Visibility(Visibility.Collapsed)
|
||||
' Recupero flag per verificare se fare solo l'importazione del btl o anche la verifica
|
||||
m_bVerifyImportBTL_IsChecked = GetMainPrivateProfileInt(S_GENERAL, K_VERIFYIMPORTBTL, 0) <> 0
|
||||
NotifyPropertyChanged(NameOf(bExternalBackupActive))
|
||||
End Sub
|
||||
|
||||
|
||||
@@ -33,17 +33,6 @@
|
||||
<EgtBEAMWALLCORE:OnlyProdGeneral_ConfigurationPageV/>
|
||||
</TabItem.Content>
|
||||
</TabItem>
|
||||
<!--<TabItem>
|
||||
<TabItem.Header>
|
||||
<StackPanel Orientation="Horizontal" Margin="5">
|
||||
<TextBlock Text="{Binding Machine_Msg}"
|
||||
FontSize="15"/>
|
||||
</StackPanel>
|
||||
</TabItem.Header>
|
||||
<TabItem.Content>
|
||||
<EgtBEAMWALL:OnlyProdMachinePanelV DataContext="{Binding MachinePanelVM}"/>
|
||||
</TabItem.Content>
|
||||
</TabItem>-->
|
||||
<TabItem>
|
||||
<TabItem.Header>
|
||||
<StackPanel Orientation="Horizontal" Margin="5">
|
||||
|
||||
@@ -39,6 +39,7 @@
|
||||
RenderOptions.CachingHint="Cache"
|
||||
VirtualizingPanel.CacheLength="10"
|
||||
VirtualizingPanel.CacheLengthUnit="Pixel"
|
||||
Width="{Binding ActualWidth, RelativeSource={RelativeSource AncestorType={x:Type UserControl}}}"
|
||||
Style="{StaticResource DataGrid_OnlyProd}">
|
||||
|
||||
<DataGrid.InputBindings>
|
||||
@@ -53,7 +54,8 @@
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="{x:Type GroupItem}">
|
||||
<Expander IsExpanded="True">
|
||||
<Expander IsExpanded="True"
|
||||
Width="{Binding ActualWidth, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALLCORE:EgtDataGrid}}}">
|
||||
<Expander.Header>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<TextBlock Text="{Binding Path=Name}"
|
||||
@@ -377,7 +379,7 @@
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<EgtBEAMWALL:OnlyProdFeatureListManagerV/>
|
||||
<ListBox Grid.Column="1"
|
||||
@@ -387,11 +389,11 @@
|
||||
Grid.IsSharedSizeScope="True"
|
||||
ScrollViewer.HorizontalScrollBarVisibility="Auto"
|
||||
ScrollViewer.VerticalScrollBarVisibility="Auto"
|
||||
Width="{Binding ActualWidth, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALLCORE:EgtDataGrid}}}"
|
||||
Width="{Binding ActualWidth, RelativeSource={RelativeSource AncestorType={x:Type Expander}}}"
|
||||
Style="{StaticResource BTL_ListBox}">
|
||||
<ListBox.ItemsPanel>
|
||||
<ItemsPanelTemplate>
|
||||
<WrapPanel Orientation="Vertical"
|
||||
<WrapPanel Orientation="Vertical"
|
||||
MaxHeight="{Binding ActualHeight, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALLCORE:EgtDataGrid}},
|
||||
Converter={StaticResource FractionHeightConverter},
|
||||
ConverterParameter={StaticResource FeatureWrapPanelHeight}}"
|
||||
|
||||
@@ -526,6 +526,7 @@ Public Class OnlyProdManagerVM
|
||||
End If
|
||||
' aggiorno nome macchina in statusbar
|
||||
Map.refMyStatusBarVM.RefreshMachName()
|
||||
SetDefaultConfigFile()
|
||||
Return True
|
||||
End Function
|
||||
|
||||
@@ -707,6 +708,13 @@ Public Class OnlyProdManagerVM
|
||||
' scrivo info proj su layer AsseBase
|
||||
Dim nAsseBaseLayer As Integer = EgtGetFirstNameInGroup(GDB_ID.ROOT, ASSEBASE)
|
||||
EgtSetInfo(nAsseBaseLayer, BTL_PRT_PROJ, nProjId)
|
||||
|
||||
' Controllo se effettuare import + verifica
|
||||
If Map.refConfigurationPageVM.bVerifyImportBTL_IsChecked Then
|
||||
' Eseguo procedura
|
||||
|
||||
End If
|
||||
|
||||
' leggo struttura BTL per liste
|
||||
Map.refProjectVM.BTLStructureVM = New BTLStructureVM(BTLStructureM.CreateBTLStructure(0))
|
||||
' aggiorno Db
|
||||
@@ -832,18 +840,18 @@ Public Class OnlyProdManagerVM
|
||||
' scrivo info proj su layer AsseBase
|
||||
Dim nAsseBaseLayer As Integer = EgtGetLastNameInGroup(GDB_ID.ROOT, ASSEBASE)
|
||||
EgtSetInfo(nAsseBaseLayer, BTL_PRT_PROJ, nProjId)
|
||||
|
||||
' Controllo se effettuare import + verifica
|
||||
If Map.refConfigurationPageVM.bVerifyImportBTL_IsChecked Then
|
||||
' Eseguo procedura
|
||||
|
||||
End If
|
||||
|
||||
' leggo struttura BTL per liste
|
||||
Map.refProjectVM.BTLStructureVM = New BTLStructureVM(BTLStructureM.CreateBTLStructure(0))
|
||||
Dim sProjFileName As String = sProjDir & "\" & nProjId.ToString("0000") & ".nge"
|
||||
Dim bFirstPart As Boolean = EgtGetFirstPart() <> GDB_ID.NULL
|
||||
If bOk Then 'OrElse bFirstPart Then
|
||||
'' salvo path di importazione
|
||||
'WriteMainPrivateProfileString(S_GENERAL, K_LASTIMPDIR, Path.GetDirectoryName(sFile))
|
||||
'' salvo il progetto
|
||||
'bOk = EgtSaveFile(sProjFileName, NGE.CMPTEXT)
|
||||
'SectionXMaterial.SetType(nType)
|
||||
'Core.ViewPanelVM.UpdateBWType(nType)
|
||||
Else
|
||||
If Not bOk Then
|
||||
EgtOutLog("Errore nell'importazione BTL")
|
||||
End If
|
||||
' aggiorno Db
|
||||
@@ -1037,6 +1045,29 @@ Public Class OnlyProdManagerVM
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub SetDefaultConfigFile()
|
||||
' Setto default configuration per strategie
|
||||
' cerco tra i layer BTLInfo
|
||||
Dim nBTLInfoLayerId As Integer = 0
|
||||
Dim nCurrBTLInfoLayerId As Integer = EgtGetFirstNameInGroup(GDB_ID.ROOT, BTLINFO)
|
||||
While nCurrBTLInfoLayerId <> GDB_ID.NULL
|
||||
' verifico se il layer appartiene al ProjId
|
||||
Dim nBTLInfoLayerProjId As Integer
|
||||
EgtGetInfo(nCurrBTLInfoLayerId, BTL_PRT_PROJ, nBTLInfoLayerProjId)
|
||||
If nBTLInfoLayerProjId = ProjectManagerVM.CurrProd.nProdId Then
|
||||
nBTLInfoLayerId = nCurrBTLInfoLayerId
|
||||
Exit While
|
||||
End If
|
||||
nCurrBTLInfoLayerId = EgtGetNextName(nCurrBTLInfoLayerId, BTLINFO)
|
||||
End While
|
||||
Dim sDefaultConfigFile As String = String.Empty
|
||||
Dim sTrimDefaultConfig As String = String.Empty
|
||||
If GetMainPrivateProfileString(S_STRATEGY, K_DEFAULTCONFIG, "", sDefaultConfigFile) <> 0 Then
|
||||
sTrimDefaultConfig = System.IO.Path.GetFileNameWithoutExtension(sDefaultConfigFile)
|
||||
EgtSetInfo(nBTLInfoLayerId, "AISETUP", sTrimDefaultConfig)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
#End Region ' Methods
|
||||
|
||||
#Region "COMMANDS"
|
||||
@@ -1435,145 +1466,6 @@ Public Class OnlyProdManagerVM
|
||||
EgtOutLog(sErrMsg)
|
||||
End If
|
||||
Return
|
||||
If ProdFileVM.VerifyProjectModification(CurrProd) = MessageBoxResult.Cancel Then Return
|
||||
Dim sDir As String = String.Empty
|
||||
GetMainPrivateProfileString(S_GENERAL, K_LASTIMPDIR, "", sDir)
|
||||
If bWithDlg Then
|
||||
' apro finestra scelta file
|
||||
Dim BTLDlg As New Microsoft.Win32.OpenFileDialog() With {
|
||||
.DefaultExt = ".btl",
|
||||
.Filter = "BTL (*.btl)|*.btl" &
|
||||
"|BTLX (*.btlx)|*.btlx",
|
||||
.InitialDirectory = If(Directory.Exists(sDir), sDir, ""),
|
||||
.CheckFileExists = True,
|
||||
.ValidateNames = True}
|
||||
If BTLDlg.ShowDialog() Then
|
||||
sFile = BTLDlg.FileName
|
||||
Else
|
||||
Return
|
||||
End If
|
||||
End If
|
||||
Dim nProjId As Integer = 0
|
||||
Dim sProjDir As String = ""
|
||||
' verifico se non e' tra i BTL gia' importati
|
||||
Dim sBTLFileName As String = Path.GetFileNameWithoutExtension(sFile)
|
||||
Dim nAlreadyImported As Integer = DbControllers.m_ProjController.AlreadyImported(sBTLFileName)
|
||||
If nAlreadyImported > 0 Then
|
||||
' recupero progetto con lo stesso nome
|
||||
Dim ToDeleteProj As ProjFileM = DbControllers.m_ProjController.FindByProjIdConv(nAlreadyImported)
|
||||
' se esiste gia' un'ottimizzazione
|
||||
If ToDeleteProj.nProdId > 0 Then
|
||||
Select Case MessageBox.Show(EgtMsg(61942), "Information", MessageBoxButton.YesNo, MessageBoxImage.Information) ' BTL file already imported and optimized. Do you want to import it again?
|
||||
Case MessageBoxResult.Yes
|
||||
' lo importo, quindi non devo fare nulla
|
||||
Case MessageBoxResult.No
|
||||
Return
|
||||
End Select
|
||||
End If
|
||||
End If
|
||||
' se si ha una sola macchina disponibile (non BOTH) setto il progetto importato a quella macchina e al tipo progetto associato
|
||||
' altrimenti apro il dialog per scegliere la macchina e il tipo progetto a cui settare il progetto importato
|
||||
Dim Machine As Machine = Nothing
|
||||
Dim nType As BWType = BWType.NULL
|
||||
Dim ProjectTypeWndVM As New ProjectTypeWndVM()
|
||||
If ProjectTypeWndVM.MachineList.Count = 1 AndAlso DirectCast(ProjectTypeWndVM.SelMachine, MyMachine).nType <> MachineType.BOTH Then
|
||||
Machine = ProjectTypeWndVM.SelMachine
|
||||
nType = DirectCast(Machine, MyMachine).nType
|
||||
Else
|
||||
Dim ProjectTypeWnd As New OnlyProdProjectTypeWndV(Application.Current.MainWindow, ProjectTypeWndVM)
|
||||
If ProjectTypeWnd.ShowDialog() Then
|
||||
Machine = ProjectTypeWndVM.SelMachine
|
||||
nType = ProjectTypeWndVM.nSelType
|
||||
Else
|
||||
Return
|
||||
End If
|
||||
End If
|
||||
LoadingWndHelper.OpenLoadingWnd(ActiveIds.IMPORTBTL, 3, EgtMsg(63008), EgtMsg(63009), 50) ' BTL file importing ' Reading BTL file
|
||||
' inizializzo nuovo progetto
|
||||
InitNewProj(nProjId, sProjDir, nType, Machine.Name)
|
||||
'SetCurrProj(nProjId)
|
||||
'' imposto il tipo di parametri Q da utilizzare
|
||||
'BTLIniFile.m_nBTLBWType = nType
|
||||
'' carico lista macchine e macchina del progetto per il pulsante Reset Macchina del CALCPanel
|
||||
'Map.refCALCPanelVM.LoadMachineList()
|
||||
' imposto ProjId di caricamento
|
||||
ProjectManagerVM.nLoadingProjId = nProjId
|
||||
' copio file BTL
|
||||
Dim sBtlCopyPath As String = sProjDir & "\" & Path.GetFileName(sFile)
|
||||
Dim bOk = False
|
||||
Try
|
||||
File.Copy(sFile, sBtlCopyPath, True)
|
||||
bOk = True
|
||||
Catch ex As Exception
|
||||
EgtOutLog("Impossibile copiare il file")
|
||||
bOk = False
|
||||
End Try
|
||||
'' disattivo temporaneamente bottone assemblato per non prendere il riferimento sbagliato durante importazione
|
||||
'Dim bAssembly As Boolean = Map.refShowBeamPanelVM.ShowBuilding_IsChecked
|
||||
'Map.refShowBeamPanelVM.ShowBuilding_IsChecked = False
|
||||
' importo file
|
||||
If bOk Then
|
||||
bOk = Map.refSceneHostVM.MainController.ImportProject(sBtlCopyPath, False)
|
||||
End If
|
||||
Dim sProjFileName As String = sProjDir & "\" & nProjId.ToString("0000") & ".nge"
|
||||
Dim bFirstPart As Boolean = EgtGetFirstPart() <> GDB_ID.NULL
|
||||
If bOk OrElse bFirstPart Then
|
||||
' salvo path di importazione
|
||||
WriteMainPrivateProfileString(S_GENERAL, K_LASTIMPDIR, Path.GetDirectoryName(sFile))
|
||||
' salvo il progetto
|
||||
bOk = EgtSaveFile(sProjFileName, NGE.CMPTEXT)
|
||||
SectionXMaterial.SetType(nType)
|
||||
Core.ViewPanelVM.UpdateBWType(nType)
|
||||
' imposto flag secondo tipo di progetto (travi o pareti)
|
||||
Dim sBTLFlag As String = If(nType = Core.ConstBeam.BWType.BEAM, K_BTLFLAG, K_WALLBTLFLAG)
|
||||
Dim nFlag As Integer = GetMainPrivateProfileInt(S_IMPORT, sBTLFlag, EIB_FL.TS3_POS + EIB_FL.SORT + EIB_FL.USEUATTR)
|
||||
EgtBeamSetFlag(nFlag)
|
||||
Else
|
||||
EgtOutLog("Errore nell'importazione BTL")
|
||||
End If
|
||||
If bOk Then
|
||||
' aggiorno Db
|
||||
Dim ExportDate As DateTime
|
||||
DateTime.TryParse(Map.refProjectVM.BTLStructureVM.BTLStructureM.m_sEXPDATE & " " &
|
||||
Map.refProjectVM.BTLStructureVM.BTLStructureM.m_sEXPTIME, ExportDate)
|
||||
DbControllers.m_ProjController.UpdateInfo(nProjId, sBTLFileName, sBTLFileName, Map.refProjectVM.BTLStructureVM.sLISTNAME, ExportDate, nType, ProjectManagerVM.CurrProd.sMachine)
|
||||
SetCurrProj(nProjId)
|
||||
' se progetto pareti e vista ruotata
|
||||
If nType = BWType.WALL AndAlso (CurrentMachine.ViewDir = VT.ISO_NW OrElse CurrentMachine.ViewDir = VT.ISO_NE) Then
|
||||
' ruoto le pareti di 180 per raddrizzarle rispetto alla vista
|
||||
For Each Wall In Map.refProjectVM.BTLStructureVM.BTLPartVMList
|
||||
Wall.Rotation(True, Map.refProjectVM.BTLStructureVM.nPROJTYPE, True, 180, False)
|
||||
Next
|
||||
End If
|
||||
' calcolo volumi pezzi
|
||||
For Each Part In Map.refProjectVM.BTLStructureVM.BTLPartVMList
|
||||
Part.CalcBTLPartVolume()
|
||||
Next
|
||||
Map.refProjectVM.SetOnlyProdOptimizePanel_Visibility(Map.refProjectVM.BTLStructureVM.nPROJTYPE = BWType.WALL AndAlso Map.refMainWindowVM.MainWindowM.GetKeyOption(KEY_OPT.NESTING_AUTO))
|
||||
'Map.refPartManagerVM.LockVisibilityUpdate()
|
||||
LoadingWndHelper.UpdateLoadingWnd(ActiveIds.IMPORTBTL, 3, EgtMsg(63006), 70, 100) ' Loading graphics
|
||||
' Map.refShowBeamPanelVM.ShowBuilding_IsChecked = bAssembly
|
||||
' mostro tutti i pezzi
|
||||
Map.refShowBeamPanelVM.ShowAll(True)
|
||||
Else
|
||||
' Map.refShowBeamPanelVM.ShowBuilding_IsChecked = bAssembly
|
||||
' elimino da Db
|
||||
' CheckMe impostata come cancellazione FISICA dal DB...
|
||||
DbControllers.m_ProjController.DeleteProj(nProjId, False)
|
||||
End If
|
||||
If bOk Then
|
||||
' salvo il progetto
|
||||
bOk = EgtSaveFile(sProjFileName, NGE.CMPTEXT)
|
||||
' inizializzo nuovo progetto PROD
|
||||
NewProdFromProj()
|
||||
End If
|
||||
' carico filtri di ricerca
|
||||
Map.refProjectVM.BTLStructureVM.LoadFilters()
|
||||
' gestisco log di importazione
|
||||
ManageImportLog(nProjId, sProjDir)
|
||||
' aggiorno titolo
|
||||
Map.refMainWindowVM.UpdateTitle()
|
||||
LoadingWndHelper.CloseLoadingWnd(ActiveIds.IMPORTBTL)
|
||||
End Sub
|
||||
|
||||
#End Region ' ImportBTL
|
||||
|
||||
@@ -23,6 +23,8 @@
|
||||
Visibility="{Binding StrategyType_Visibility}"
|
||||
Style="{StaticResource Strategy_ComboBox}"
|
||||
Margin="0,0,10,0"/>
|
||||
<CheckBox IsChecked="{Binding DefaultConfig_IsChecked}"
|
||||
Style="{StaticResource FreeContourInput_CheckBox}"/>
|
||||
<ComboBox ItemsSource="{Binding StrategySetupList}"
|
||||
SelectedItem="{Binding SelStrategySetup}"
|
||||
DisplayMemberPath="sName"
|
||||
|
||||
@@ -58,7 +58,9 @@ Public Class StrategyManagerVM
|
||||
m_SelTreeItem.StrategyList.Clear()
|
||||
End If
|
||||
m_SelStrategySetup = value
|
||||
m_SelStrategySetup.Read()
|
||||
If Not IsNothing(m_SelStrategySetup) Then
|
||||
m_SelStrategySetup.Read()
|
||||
End If
|
||||
NotifyPropertyChanged(NameOf(SelStrategySetup))
|
||||
End Set
|
||||
End Property
|
||||
@@ -232,6 +234,24 @@ Public Class StrategyManagerVM
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_bDefaultConfig_IsChecked As Boolean = False
|
||||
Public Property DefaultConfig_IsChecked As Boolean
|
||||
Get
|
||||
Return m_bDefaultConfig_IsChecked
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
m_bDefaultConfig_IsChecked = value
|
||||
If m_bDefaultConfig_IsChecked Then
|
||||
WriteMainPrivateProfileString(S_STRATEGY, K_DEFAULTCONFIG, m_SelStrategySetup.sName & ".json")
|
||||
End If
|
||||
NotifyPropertyChanged(NameOf(DefaultConfig_IsChecked))
|
||||
End Set
|
||||
End Property
|
||||
Friend Sub SetDefaultConfig_IsChecked(value As Boolean)
|
||||
m_bDefaultConfig_IsChecked = value
|
||||
NotifyPropertyChanged(NameOf(DefaultConfig_IsChecked))
|
||||
End Sub
|
||||
|
||||
#Region "Messages"
|
||||
|
||||
Public ReadOnly Property SaveToolTip As String
|
||||
@@ -305,6 +325,7 @@ Public Class StrategyManagerVM
|
||||
End Sub
|
||||
|
||||
Friend Sub Update()
|
||||
m_StrategySetupList.Clear()
|
||||
' imposto Type a primo della lista per default
|
||||
Select Case Map.refMachinePanelVM.SelectedMachine.nType
|
||||
Case MachineType.BEAM
|
||||
@@ -322,11 +343,26 @@ Public Class StrategyManagerVM
|
||||
' leggo cartella dei setup delle strategie
|
||||
Dim AISetupDirPath As String = Map.refMainWindowVM.MainWindowM.GetAISetupDirPath(SelStrategyType.Id, False)
|
||||
Dim AISetupPaths As String() = Directory.GetFiles(AISetupDirPath)
|
||||
Dim sDefaultConfigFile As String = String.Empty
|
||||
Dim sTrimDefaultConfigFile As String = String.Empty
|
||||
Dim DefaultConfigFile As StrategySetup = Nothing
|
||||
For Each AiSetup In AISetupPaths
|
||||
m_StrategySetupList.Add(New StrategySetup(Path.GetFileNameWithoutExtension(AiSetup)))
|
||||
Next
|
||||
If m_StrategySetupList.Count > 0 Then
|
||||
SelStrategySetup = m_StrategySetupList(0)
|
||||
'SelStrategySetup = m_StrategySetupList(0)
|
||||
' Controllo se presente file default config
|
||||
If GetMainPrivateProfileString(S_STRATEGY, K_DEFAULTCONFIG, "", sDefaultConfigFile) <> 0 Then
|
||||
sTrimDefaultConfigFile = System.IO.Path.GetFileNameWithoutExtension(sDefaultConfigFile)
|
||||
SetDefaultConfig_IsChecked(True)
|
||||
DefaultConfigFile = m_StrategySetupList.FirstOrDefault(Function(x) x.sName = sTrimDefaultConfigFile)
|
||||
End If
|
||||
If Not IsNothing(DefaultConfigFile) Then
|
||||
SelStrategySetup = DefaultConfigFile
|
||||
Else
|
||||
SelStrategySetup = m_StrategySetupList(0)
|
||||
SetDefaultConfig_IsChecked(False)
|
||||
End If
|
||||
End If
|
||||
End Sub
|
||||
|
||||
@@ -370,7 +406,7 @@ Public Class StrategyManagerVM
|
||||
Dim InputPwdWnd As New OnlyProdInputPwdWndV(Application.Current.MainWindow, InputPwdWndVM)
|
||||
Dim sPwdIni As String = String.Empty
|
||||
If InputPwdWnd.ShowDialog() Then
|
||||
If GetMainPrivateProfileString("Strategy", "ParamPassword", "", sPwdIni) <> 0 Then
|
||||
If GetMainPrivateProfileString(S_STRATEGY, K_PARAMPASSWORD, "", sPwdIni) <> 0 Then
|
||||
If sPwdIni <> InputPwdWndVM.sPassword Then
|
||||
MessageBox.Show("Password Errata", EgtMsg(15002), MessageBoxButton.OK, MessageBoxImage.Error)
|
||||
End If
|
||||
@@ -522,6 +558,7 @@ Public Class StrategyManagerVM
|
||||
''' Funzione apre un nuovo il file json CustomerConfig
|
||||
''' </summary>
|
||||
Public Sub NewAiSetup()
|
||||
SetDefaultConfig_IsChecked(False)
|
||||
Dim NewStrategyVM As New SaveAsStrategyVM()
|
||||
NewStrategyVM.SetbOpen_Visibility(Visibility.Visible)
|
||||
Dim NewStrategyWnd As New SaveAsStrategyV With {
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
xmlns:theme="clr-namespace:Microsoft.Windows.Themes;assembly=PresentationFramework.Aero2">
|
||||
|
||||
<!--#region Panel ViewModel-->
|
||||
|
||||
|
||||
<!--
|
||||
Assign a Key to every Panel ViewModel to use
|
||||
it in xaml file(ProjectView.xaml).
|
||||
@@ -56,9 +56,9 @@
|
||||
<!--<EgtBEAMWALL:ForcedStrategyBTLVM x:Key="ForcedStrategyBTLVM"/>-->
|
||||
|
||||
<!--#endregion Panel ViewModel-->
|
||||
|
||||
|
||||
<!--#region Colori predefiniti-->
|
||||
|
||||
|
||||
<SolidColorBrush x:Key="Omag_Blue" Color="#FF095CA8" />
|
||||
<SolidColorBrush x:Key="Omag_Yellow" Color="#FFFFCE5B" />
|
||||
<SolidColorBrush x:Key="Omag_Red" Color="Red" />
|
||||
@@ -83,7 +83,8 @@
|
||||
<Color x:Key="BeamWall_White_Color" R="255" G="255" B="255" A="255"/>
|
||||
<SolidColorBrush x:Key="BeamWall_White" Color="{StaticResource BeamWall_White_Color}" />
|
||||
|
||||
<!--#C9DFF0--><!--
|
||||
<!--#C9DFF0-->
|
||||
<!--
|
||||
<Color x:Key="BeamWall_LinkWater_Color" R="201" G="223" B="240" A="255"/>
|
||||
<SolidColorBrush x:Key="BeamWall_LinkWater" Color="{StaticResource BeamWall_LinkWater_Color}" />-->
|
||||
|
||||
@@ -160,20 +161,20 @@
|
||||
<SolidColorBrush x:Key="BeamWall_Concrete" Color="{StaticResource BeamWall_Concrete_Color}" />
|
||||
|
||||
<!--#endregion Colori Nuova Grafica-->
|
||||
|
||||
|
||||
<!--#region Colori per EgtWPFLib5-->
|
||||
|
||||
|
||||
<SolidColorBrush x:Key="TextBox.Static.Border" Color="#FFABAdB3"/>
|
||||
|
||||
|
||||
<!--#endregion Colori per EgtWPFLib5-->
|
||||
|
||||
|
||||
<!--#region Colori per TabHeader-->
|
||||
|
||||
|
||||
<!--<LinearGradientBrush x:Key="TabItem.Static.Background" EndPoint="0,1" StartPoint="0,0">
|
||||
<GradientStop Color="#F0F0F0" Offset="0.0"/>
|
||||
<GradientStop Color="#E5E5E5" Offset="1.0"/>
|
||||
</LinearGradientBrush>-->
|
||||
|
||||
|
||||
<!--Risorsa che toglie le animazioni dai menù popup per evitare che i menù mru di scelta dei file rimangano aperti se il file è grosso -->
|
||||
<!--o viene eseguito un lua che non aggiorna l'interfaccia-->
|
||||
<PopupAnimation x:Key="{x:Static SystemParameters.MenuPopupAnimationKey}">None</PopupAnimation>
|
||||
@@ -181,7 +182,7 @@
|
||||
<!-- ______________________________________________________________________________________________________________________________________________ -->
|
||||
|
||||
<!--#region FocusVisual standard-->
|
||||
|
||||
|
||||
<Style x:Key="FocusVisual">
|
||||
<Setter Property="Control.Template">
|
||||
<Setter.Value>
|
||||
@@ -197,7 +198,7 @@
|
||||
<!-- ______________________________________________________________________________________________________________________________________________ -->
|
||||
|
||||
<!--#region GRAFICA GENERALE-->
|
||||
|
||||
|
||||
<!--#region Button Old Style-->
|
||||
|
||||
<SolidColorBrush x:Key="ButtonBasic.Static.Background" Color="#FFDDDDDD"/>
|
||||
@@ -251,7 +252,7 @@
|
||||
</Style>
|
||||
|
||||
<!--#endregion Button Old Style-->
|
||||
|
||||
|
||||
<!--#region Button New Style-->
|
||||
|
||||
<!--#FFDDDDDD-->
|
||||
@@ -1164,7 +1165,7 @@
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
|
||||
<!--<ControlTemplate x:Key="ComboBoxEditableTemplate" TargetType="{x:Type ComboBox}">
|
||||
<Grid x:Name="templateRoot" SnapsToDevicePixels="true">
|
||||
<Grid.ColumnDefinitions>
|
||||
@@ -1217,7 +1218,7 @@
|
||||
</Trigger>
|
||||
</ControlTemplate.Triggers>
|
||||
</ControlTemplate>-->
|
||||
|
||||
|
||||
<!--<ControlTemplate x:Key="ComboBoxTemplate" TargetType="{x:Type ComboBox}">
|
||||
<Grid x:Name="templateRoot" SnapsToDevicePixels="true">
|
||||
<Grid.ColumnDefinitions>
|
||||
@@ -1262,7 +1263,7 @@
|
||||
</Trigger>
|
||||
</ControlTemplate.Triggers>
|
||||
</ControlTemplate>-->
|
||||
|
||||
|
||||
<Style x:Key="OnlyProd_ComboBox" TargetType="{x:Type ComboBox}">
|
||||
<Setter Property="FocusVisualStyle" Value="{StaticResource FocusVisual}"/>
|
||||
<Setter Property="Background" Value="{StaticResource ComboBox.Static.Background}"/>
|
||||
@@ -1368,7 +1369,7 @@
|
||||
<Style TargetType="{x:Type ScrollBar}" BasedOn="{StaticResource OnlyProd_ScrollBar}"/>
|
||||
</Style.Resources>
|
||||
</Style>
|
||||
|
||||
|
||||
<!--#endregion DataGrid-->
|
||||
|
||||
<!--#region DatePicker-->
|
||||
@@ -1681,7 +1682,7 @@
|
||||
</Style>
|
||||
|
||||
<!--#endregion Expander-->
|
||||
|
||||
|
||||
<!--#region ListBox-->
|
||||
|
||||
<!--#1F26A0DA-->
|
||||
@@ -2190,8 +2191,8 @@
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
<!--#endregion Tab Item-->
|
||||
|
||||
<!--#endregion Tab Item-->
|
||||
|
||||
<!--#region ItemControl-->
|
||||
|
||||
<Style x:Key="UsersControlStyle" TargetType="{x:Type ItemsControl}">
|
||||
@@ -2208,15 +2209,15 @@
|
||||
</Setter>
|
||||
</Style>
|
||||
<!--#endregion ItemControl-->
|
||||
|
||||
|
||||
<!--#endregion GRAFICA GENERALE-->
|
||||
|
||||
|
||||
<!-- ______________________________________________________________________________________________________________________________________________ -->
|
||||
|
||||
<!--#region GRAFICA VECCHIA PAGINA-->
|
||||
|
||||
|
||||
<!--#region Button Style-->
|
||||
|
||||
|
||||
<!--Template che permette di andare a capo-->
|
||||
<DataTemplate x:Key="WrapButton_DataTemplate">
|
||||
<TextBlock TextWrapping="WrapWithOverflow" Text="{Binding}"/>
|
||||
@@ -2293,7 +2294,7 @@
|
||||
</Style>
|
||||
|
||||
<!--#endregion Button Style-->
|
||||
|
||||
|
||||
<!--#region ToggleButton Style-->
|
||||
|
||||
<Style x:Key="OldStyle_ToggleButton" TargetType="{x:Type ToggleButton}">
|
||||
@@ -2379,8 +2380,8 @@
|
||||
</Style.Resources>
|
||||
</Style>
|
||||
|
||||
<!--#endregion ToggleButton Style-->
|
||||
|
||||
<!--#endregion ToggleButton Style-->
|
||||
|
||||
<!--#region TextBox-->
|
||||
|
||||
<Style TargetType="{x:Type EgtWPFLib5:EgtTextBox}" BasedOn="{StaticResource {x:Type EgtWPFLib5:EgtTextBox}}">
|
||||
@@ -2402,7 +2403,7 @@
|
||||
</Style>
|
||||
|
||||
<!--#endregion TextBox-->
|
||||
|
||||
|
||||
<!--#region Border-->
|
||||
|
||||
<Style x:Key="DefaultBorder" TargetType="{x:Type Border}">
|
||||
@@ -2421,7 +2422,7 @@
|
||||
</Style>
|
||||
|
||||
<!--#endregion Border-->
|
||||
|
||||
|
||||
<!--#region EgtCustomWindow-->
|
||||
|
||||
<Style TargetType="{x:Type EgtWPFLib5:EgtCustomWindow}" BasedOn="{StaticResource {x:Type EgtWPFLib5:EgtCustomWindow}}">
|
||||
@@ -2442,7 +2443,7 @@
|
||||
</Style>
|
||||
|
||||
<!--#endregion EgtFloatingPanel-->
|
||||
|
||||
|
||||
<!--#region ComboBox-->
|
||||
|
||||
<Style x:Key="FeatureComboBox" TargetType="{x:Type ComboBox}" BasedOn="{StaticResource {x:Type ComboBox}}">
|
||||
@@ -2471,7 +2472,7 @@
|
||||
</Style>
|
||||
|
||||
<!--#endregion ComboBox-->
|
||||
|
||||
|
||||
<!--#region CheckBox-->
|
||||
|
||||
<Style x:Key="OptionCheckBox" TargetType="{x:Type CheckBox}" BasedOn="{StaticResource {x:Type CheckBox}}">
|
||||
@@ -2560,7 +2561,7 @@
|
||||
</Style>
|
||||
|
||||
<!--#endregion TabControl-->
|
||||
|
||||
|
||||
<!--#region Image-->
|
||||
|
||||
<Style x:Key="LockImage" TargetType="{x:Type Image}">
|
||||
@@ -2577,7 +2578,7 @@
|
||||
<!--#endregion Image-->
|
||||
|
||||
<!--#region DataGridRow/DataGridCell-->
|
||||
|
||||
|
||||
<Style x:Key="StaticRowDataGrid_CustomHighLight" TargetType="{x:Type DataGridRow}">
|
||||
<Setter Property="BorderBrush" Value="LightGray" />
|
||||
<Style.Triggers>
|
||||
@@ -2601,7 +2602,7 @@
|
||||
<!--#endregion DataGridRow/DataGridCell-->
|
||||
|
||||
<!--region DataGrid-->
|
||||
|
||||
|
||||
<Style x:Key="DataGrid_CustomHighLight" TargetType="{x:Type DataGrid}">
|
||||
<Setter Property="HeadersVisibility" Value="Column"/>
|
||||
<Style.Resources>
|
||||
@@ -2644,7 +2645,7 @@
|
||||
</Style>
|
||||
|
||||
<!--#endregion CheckBox with text on the left-->
|
||||
|
||||
|
||||
<!--#region ScrollViewer-->
|
||||
|
||||
<Style x:Key="ScrollViewer" TargetType="{x:Type ScrollViewer}" BasedOn="{StaticResource {x:Type ScrollViewer}}">
|
||||
@@ -2655,7 +2656,7 @@
|
||||
</Style>
|
||||
|
||||
<!--#endregion ScrollViewer-->
|
||||
|
||||
|
||||
<!--#region ItemsControl-->
|
||||
|
||||
<Style x:Key="ItemsControl_ExpanderList" TargetType="{x:Type ItemsControl}" BasedOn="{StaticResource {x:Type ItemsControl}}">
|
||||
@@ -2672,7 +2673,7 @@
|
||||
</Style>
|
||||
|
||||
<!--#endregion ItemsControl-->
|
||||
|
||||
|
||||
<!--#region StackPanel-->
|
||||
|
||||
<Style x:Key="StackPanel" TargetType="{x:Type StackPanel}">
|
||||
@@ -2693,7 +2694,7 @@
|
||||
</Style>
|
||||
|
||||
<!--#endregion StackPanel-->
|
||||
|
||||
|
||||
<!--#region Expander-->
|
||||
|
||||
<Style x:Key="Expander_PDF" TargetType="{x:Type Expander}" BasedOn="{StaticResource {x:Type Expander}}">
|
||||
@@ -3342,7 +3343,7 @@
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
|
||||
<!--#endregion TabControl-->
|
||||
|
||||
<!--#region Image-->
|
||||
@@ -3955,5 +3956,5 @@
|
||||
</Style>
|
||||
|
||||
<!--#endregion EgtManageDialog-->
|
||||
|
||||
|
||||
</ResourceDictionary>
|
||||
|
||||
Reference in New Issue
Block a user