Compare commits

...

51 Commits

Author SHA1 Message Date
Emmanuele Sassi 649a1d6a46 - correzioni e emigliorie 2025-06-05 15:04:57 +02:00
Demetrio Cassarino ccc824489b -aggiornato visualizzazione BTLFeatureVMList in xaml 2025-05-23 11:53:18 +02:00
Demetrio Cassarino 62db5e4a42 Merge branch 'feature/NewGraphicsProgram' of https://gitlab.steamware.net/egalware-cadcam/interfacce/egtbeamwall into feature/NewGraphicsProgram 2025-05-23 10:09:52 +02:00
Demetrio Cassarino fffbf3676f -aggiunto stile per listabtl 2025-05-23 10:09:47 +02:00
Emmanuele Sassi ac46e13c54 - modificata selezione feature in lista pezzi BTL 2025-05-23 10:07:12 +02:00
Emmanuele Sassi 3c84e91735 Merge branch 'feature/NewGraphicsProgram' of https://gitlab.steamware.net/egaltech/egtbeamwall into feature/NewGraphicsProgram 2025-05-22 17:43:44 +02:00
Emmanuele Sassi fab3b0fe14 - correzione su verifica duplo solo quando esistonmo
- aggiunta sezioni a warehouse su importazione file
2025-05-22 17:43:39 +02:00
Demetrio Cassarino 6ce4fa7641 -aggiornato margini validità pezzo 2025-05-22 17:16:23 +02:00
Emmanuele Sassi 51707cc973 - riportata correzione backup 2025-05-22 16:52:08 +02:00
Demetrio Cassarino a9e463141e -corretto inversione pezzo in btl 2025-05-22 16:03:35 +02:00
Demetrio Cassarino 1e2023234e -aggiunto messaggi di errore per feature 2025-05-22 15:14:33 +02:00
Demetrio Cassarino b305d8be17 Merge branch 'feature/NewGraphicsProgram' of https://gitlab.steamware.net/egalware-cadcam/interfacce/egtbeamwall into feature/NewGraphicsProgram 2025-05-22 12:13:39 +02:00
Demetrio Cassarino ac9d0dc076 -gestito flag checksum 2025-05-22 12:13:35 +02:00
Emmanuele Sassi a2a3642ecf aggiunto nome strategia e immagine, gestito errore su forcestrategy 2025-05-22 12:11:35 +02:00
Demetrio Cassarino 1051bf0f58 -aggiornato forcedstrategy 2025-05-22 09:46:20 +02:00
Demetrio Cassarino 3e03d44840 -sistemato commit 2025-05-22 08:36:08 +02:00
Demetrio Cassarino 4730c0ef42 -rimosso finestre inutulizzate 2025-05-22 08:35:19 +02:00
Demetrio Cassarino 9eac34222f -aggiornato immagini 2025-05-21 17:35:31 +02:00
Demetrio Cassarino f2c5b60acc -aggiunto reset per pezzo btl e machgroup e resetall
-risistemanto percorso beamnew
2025-05-21 09:39:10 +02:00
Emmanuele Sassi 5c5dae5e3a Merge branch 'feature/NewGraphicsProgram' of https://gitlab.steamware.net/egaltech/egtbeamwall into feature/NewGraphicsProgram 2025-05-20 16:14:45 +02:00
Emmanuele Sassi c400973972 - correzione import BTL
- rimossa scena assemblato
- fix bottoni verifica
- accelerato scorrimento lista BTLPart
2025-05-20 16:14:28 +02:00
Demetrio Cassarino 9522cd6d4e -aggiuntoi force strategy in btl 2025-05-20 11:06:27 +02:00
Demetrio Cassarino f0ce11dad7 Merge branch 'feature/NewGraphicsProgram' of https://gitlab.steamware.net/egalware-cadcam/interfacce/egtbeamwall into feature/NewGraphicsProgram 2025-05-19 16:13:03 +02:00
Demetrio Cassarino 493c63ece2 -aggiornato salvataggio e nuovo file json aisetup 2025-05-19 16:12:59 +02:00
Emmanuele Sassi 33d18efcc2 - migliorie strategy
- aggiunta strategy per btl
- aggiunte ForcedStrategy su feature
2025-05-19 16:09:36 +02:00
Demetrio Cassarino 07c67e0987 -gestito spostamento da strategie available ad attive 2025-05-16 17:02:17 +02:00
Emmanuele Sassi 07753855cd - miglioramenti lettura e scrittura Json strategie 2025-05-16 14:59:45 +02:00
Demetrio Cassarino d1e95372e1 -sistemato salvataggio file json 2025-05-16 10:14:57 +02:00
Emmanuele Sassi 9865028f99 - miglioramento strategie 2025-05-15 18:53:57 +02:00
Demetrio Cassarino ecb2055690 -rimosso liste inutilizzate 2025-05-15 14:32:46 +02:00
Demetrio Cassarino 187fdde32b -rispristinato spostamento strategia da available ad active 2025-05-15 13:04:14 +02:00
Demetrio Cassarino 5e66d99528 -rimosso liste deactivate e active strategy 2025-05-15 10:52:15 +02:00
Emmanuele Sassi 79f0b3ee9f - correzione libreria necessaria 2025-05-14 19:05:39 +02:00
Emmanuele Sassi feafc44022 - miglioramenti e correzioni StrategyManager 2025-05-14 19:02:43 +02:00
Demetrio Cassarino d376fdca3e Merge branch 'feature/NewGraphicsProgram' of https://gitlab.steamware.net/egalware-cadcam/interfacce/egtbeamwall into feature/NewGraphicsProgram 2025-05-14 11:48:40 +02:00
Demetrio Cassarino cc43198e05 -sistemato scena assemblato 2025-05-14 11:48:37 +02:00
Emmanuele Sassi 82892c2460 - sistemata selezione ed edit su tabella grezzi 2025-05-14 11:41:54 +02:00
Demetrio Cassarino 92656e997e -aggiunto finestra showbuilding
-aggiunto controllo su liste differenti
2025-05-13 12:27:16 +02:00
Demetrio Cassarino 32d576111a -piccole migliorie 2025-05-12 14:33:48 +02:00
Demetrio Cassarino 17ebba3e11 -ottmizzato codice su savestrategy 2025-05-09 16:52:07 +02:00
Demetrio Cassarino eed9456c8d -ottimizzazione codice strategie 2025-05-09 15:05:32 +02:00
Demetrio Cassarino 3f56e563c1 -sistemato pagina cofigstrategy, piccoli affinamenti
-introdotto forza strategia in produzione
2025-05-08 17:05:14 +02:00
Demetrio Cassarino 9c9b00d661 -sistemato simula per programma
-aggiunto salvataggio, salvataggio con nome
2025-05-07 17:14:57 +02:00
Demetrio Cassarino 4d2e18ebf1 -aggiunto pulsanti apri, salva, e salvacome 2025-05-06 17:23:33 +02:00
Demetrio Cassarino 8692baafff -rimosso sfondo rosso 2025-05-06 17:15:13 +02:00
Demetrio Cassarino b9a89fa212 -sistemato grafica su tabelle
-aggiunto combobox per scelte
2025-05-06 17:14:31 +02:00
Demetrio Cassarino 9d572699a2 -suddiviso in più xaml la finestra strategymanagerv
-inizio gestione checkboc, combobox
2025-05-05 17:34:56 +02:00
Demetrio Cassarino 1794d475ea -suddiviso xaml strategymanager 2025-05-05 14:14:48 +02:00
Demetrio Cassarino 8a73b3cab8 -gestito active e deactive strategy
-introdotto crea customconfig json
2025-04-30 15:01:37 +02:00
Demetrio Cassarino 86010b41c1 -creato strategymanagerVm
-sistemato codice
2025-04-29 17:04:55 +02:00
Demetrio Cassarino 6d8d3a1c1f -inizio strategie in pagina configurazione 2025-04-28 17:18:34 +02:00
106 changed files with 6017 additions and 1991 deletions
@@ -23,6 +23,10 @@ Public Module CalcIntegration
POINT_CLOUD = 5
RAWPART = 6
EDIT = 7
CHECKNOSIM = 8
TOPOLOGY = 9
OPENTOOLDB = 11 ' Non utilizzato
OPENMACHINIGDB = 12 ' Non utilizzato
End Enum
Private Structure MyProc
@@ -160,7 +164,7 @@ Public Module CalcIntegration
nActProc += 1
End If
Else
If vBar(nCurrBar).nCmdType = CmdTypes.CHECK OrElse vBar(nCurrBar).nCmdType = CmdTypes.CHECKGEN Then
If vBar(nCurrBar).nCmdType = CmdTypes.CHECK OrElse vBar(nCurrBar).nCmdType = CmdTypes.CHECKGEN OrElse vBar(nCurrBar).nCmdType = CmdTypes.CHECKNOSIM Then
RaiseEvent Calc_ProcessResult(Nothing, New CalcResultEventArgs(vBar(nCurrBar))) 'ProcessResults(vBar(nCurrBar))
ElseIf vBar(nCurrBar).nCmdType = CmdTypes.GENERATE Then
RaiseEvent Calc_ProcessResult(Nothing, New CalcResultEventArgs(vBar(nCurrBar))) 'ProcessResults(vBar(nCurrBar))
@@ -175,7 +179,7 @@ Public Module CalcIntegration
' se terminato con successo
If vProc(j).Proc.ExitCode = 0 Then
' salvo il risultato
If vBar(vProc(j).nBar).nCmdType = CmdTypes.CHECK OrElse vBar(vProc(j).nBar).nCmdType = CmdTypes.CHECKGEN Then
If vBar(vProc(j).nBar).nCmdType = CmdTypes.CHECK OrElse vBar(vProc(j).nBar).nCmdType = CmdTypes.CHECKGEN OrElse vBar(vProc(j).nBar).nCmdType = CmdTypes.CHECKNOSIM Then
RaiseEvent Calc_ProcessResult(Nothing, New CalcResultEventArgs(vBar(vProc(j).nBar))) ' ProcessResults(vBar(vProc(j).nBar))
ElseIf vBar(vProc(j).nBar).nCmdType = CmdTypes.GENERATE Then
RaiseEvent Calc_ProcessResult(Nothing, New CalcResultEventArgs(vBar(vProc(j).nBar))) ' ProcessResults(vBar(vProc(j).nBar))
@@ -197,7 +201,7 @@ Public Module CalcIntegration
' altrimenti (errore generico di esecuzione)
Else
' salvo il risultato
If vBar(vProc(j).nBar).nCmdType = CmdTypes.CHECK OrElse vBar(vProc(j).nBar).nCmdType = CmdTypes.CHECKGEN Then
If vBar(vProc(j).nBar).nCmdType = CmdTypes.CHECK OrElse vBar(vProc(j).nBar).nCmdType = CmdTypes.CHECKGEN OrElse vBar(vProc(j).nBar).nCmdType = CmdTypes.CHECKNOSIM Then
RaiseEvent Calc_ProcessResult(Nothing, New CalcResultEventArgs(vBar(vProc(j).nBar))) ' ProcessResults(vBar(vProc(j).nBar))
ElseIf vBar(vProc(j).nBar).nCmdType = CmdTypes.GENERATE Then
RaiseEvent Calc_ProcessResult(Nothing, New CalcResultEventArgs(vBar(vProc(j).nBar))) ' ProcessResults(vBar(vProc(j).nBar))
+14
View File
@@ -76,8 +76,12 @@ Public Module ConstGen
Public Const WAREHOUSE_DIR As String = "Warehouse"
' Sottodirettorio per lavorazioni travi
Public Const BEAM_DIR As String = "Beam"
' Sottodirettorio per lavorazioni travi nuovo
Public Const BEAMNEW_DIR As String = "BeamNew"
' Sottodirettorio per lavorazioni pareti
Public Const WALL_DIR As String = "Wall"
' Sottodirettorio per lavorazioni pareti nuovo
Public Const WALLNEW_DIR As String = "WallNew"
' Sottodirettorio di default per il salvataggio con nome
Public Const SAVE_DFL_NAMEDIR As String = "MyProjects"
' Sottodirettorio di default per le macchine
@@ -90,5 +94,15 @@ Public Module ConstGen
Public Const ZEBRAPRINTER_EXE As String = "ZebraPrinterUtilitiesD32.exe"
' Sottodirettorio di default per macro
Public Const MACRO_DFL_DIR As String = "Macro"
' Sottodirettorio per setup strategie
Public Const AISETUP_DIR As String = "AISetup"
' Sottodirettorio per automatismo strategie
Public Const STRATEGIES_DIR As String = "Strategies"
' Sottodirettorio per automatismo strategie standard
Public Const STANDARD_DIR As String = "Standard"
' File contenente lista strategie per feature/topologia
Public Const AVAILABLESTRATEGYLIST_FILE As String = "AvailableStrategyList"
' File contente tutte le feature
Public Const CUSTOMERCONFIG_FILE As String = "CustomerConfig"
End Module
+2
View File
@@ -50,11 +50,13 @@ Public Module ConstIni
Public Const K_EXPORTBWE As String = "ExpBwe"
Public Const S_BEAM As String = "Beam"
Public Const S_BEAMNEW As String = "BeamNew"
Public Const K_CALCPATH As String = "CalcPath"
Public Const K_BEAMBASEDIR As String = "BaseDir"
Public Const K_BEAMBWEEXEC As String = "BweExec"
Public Const S_WALL As String = "Wall"
Public Const S_WALLNEW As String = "WallNew"
Public Const K_WALLBASEDIR As String = "BaseDir"
Public Const K_WALLBWEEXEC As String = "BweExec"
-14
View File
@@ -222,12 +222,6 @@
<Compile Include="OpenProjectFileDialog\OnlyProdOpenProjectFileDialogV.xaml.vb">
<DependentUpon>OnlyProdOpenProjectFileDialogV.xaml</DependentUpon>
</Compile>
<Compile Include="SetUpWindow\OnlyProdSetUpWindowV.xaml.vb">
<DependentUpon>OnlyProdSetUpWindowV.xaml</DependentUpon>
</Compile>
<Compile Include="ToolsDbWindow\OnlyProdToolDbWindowV.xaml.vb">
<DependentUpon>OnlyProdToolDbWindowV.xaml</DependentUpon>
</Compile>
<Compile Include="Utility\Configuration.vb" />
<Compile Include="ProjectFileVM\ProdItem.vb" />
<Compile Include="Utility\DimensionsIniFile.vb" />
@@ -406,14 +400,6 @@
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="SetUpWindow\OnlyProdSetUpWindowV.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="ToolsDbWindow\OnlyProdToolDbWindowV.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="ViewPanel\ViewPanelV.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
@@ -343,16 +343,20 @@ Public Class MyMachGroupPanelM
Public Shared Sub SetDuploModified(nPartId As Integer)
If Configuration.bOnlyProd Then
' segno modificato e aggiorno duplo
EgtDuploSetModified(nPartId)
UpdateDuplo(nPartId)
' aggiorno grafica duplo
Dim DuploIdList As New List(Of Integer)
EgtDuploList(nPartId, DuploIdList)
Dim DuploList As List(Of MachGroupVM) = CoreMap.refMachGroupPanelVM.MachGroupVMList.Where(Function(x) tt(x, DuploIdList)).ToList()
For Each CurrMachGroup As MyMachGroupVM In DuploList
CurrMachGroup.RefreshMachGroup()
Next
Dim nDuploCount As Integer = 0
EgtDuploCount(nPartId, nDuploCount)
If nDuploCount > 0 Then
' segno modificato e aggiorno duplo
EgtDuploSetModified(nPartId)
UpdateDuplo(nPartId)
' aggiorno grafica duplo
Dim DuploIdList As New List(Of Integer)
EgtDuploList(nPartId, DuploIdList)
Dim DuploList As List(Of MachGroupVM) = CoreMap.refMachGroupPanelVM.MachGroupVMList.Where(Function(x) tt(x, DuploIdList)).ToList()
For Each CurrMachGroup As MyMachGroupVM In DuploList
CurrMachGroup.RefreshMachGroup()
Next
End If
Else
EgtDuploSetModified(nPartId)
End If
@@ -28,16 +28,16 @@
ToolTip="{Binding ToolDBToolTip}"
Command="{Binding ToolDbCommand}"
Style="{StaticResource GeneralConfigurationToolBar_TextButton}"/>
<Button Content="{Binding MachiningDbMsg}"
<!--<Button Content="{Binding MachiningDbMsg}"
Command="{Binding MachDbCommand}"
ToolTip="{Binding MachiningDbToolTip}"
Style="{StaticResource GeneralConfigurationToolBar_TextButton}" Width="100"/>
Style="{StaticResource GeneralConfigurationToolBar_TextButton}" Width="100"/>-->
<Button Content="{Binding SetUpMsg}"
Command="{Binding SetUpCommand}"
ToolTip="{Binding SetUpToolTip}"
Style="{StaticResource GeneralConfigurationToolBar_TextButton}"
Visibility="{Binding SetUp_Visibility}"/>
<Button ToolTip="{Binding BeamTable_ToolTip}"
<!--<Button ToolTip="{Binding BeamTable_ToolTip}"
Command="{Binding BeamTable_Command}"
Visibility="{Binding BeamTable_Visibility}"
Style="{StaticResource ToolBarWarehouse_Button}">
@@ -48,7 +48,7 @@
Visibility="{Binding WallTable_Visibility}"
Style="{StaticResource ToolBarWarehouse_Button}">
<Image Source="/Resources/Configuration/MachiningsTable.png" Stretch="Uniform"/>
</Button>
</Button>-->
<Button Content="{Binding ParameterMachineMsg}"
ToolTip="{Binding ParameterMachineMsg}"
Command="{Binding ParameterMachine_Command}"
@@ -1,208 +0,0 @@
<EgtWPFLib5:EgtCustomWindow x:Class="OnlyProdSetUpWindowV"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:EgtWPFLib5="clr-namespace:EgtWPFLib5;assembly=EgtWPFLib5"
Title="{Binding TitleMsg}"
WindowStyle="None" ResizeMode="NoResize" TitleBarHeight="30" IsResizable="False"
IsMinimizable="False" WindowStartupLocation="CenterOwner" ShowInTaskbar="False"
CloseCommand="{Binding CloseSetUpCommand, Mode=OneWay, UpdateSourceTrigger=PropertyChanged}"
Style="{StaticResource OnlyProd_EgtCustomWindow}">
<EgtWPFLib5:EgtCustomWindow.Resources>
<Style x:Key="HorizontalScrollViewerItemsControlStyle" TargetType="{x:Type ItemsControl}">
<Setter Property="ItemsPanel">
<Setter.Value>
<ItemsPanelTemplate>
<WrapPanel Orientation="Vertical"/>
</ItemsPanelTemplate>
</Setter.Value>
</Setter>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type ItemsControl}">
<ScrollViewer HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Disabled" >
<ItemsPresenter/>
</ScrollViewer>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</EgtWPFLib5:EgtCustomWindow.Resources>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="3*"/>
</Grid.ColumnDefinitions>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
<UniformGrid Columns="4">
<Button Content="{Binding ApplyMsg}" Command="{Binding ApplyCommand}"
IsEnabled="{Binding IsEnabledApplyBtn}" Height="30"
Style="{StaticResource OnlyRightPanel_HalfRound_Button}"/>
<Button Content="{Binding ArchiveMsg}" Command="{Binding ArchiveCommand}" Height="30"
Style="{StaticResource OnlyRightPanel_HalfRound_Button}"/>
<Button Content="{Binding RetrievesMsg}" Command="{Binding RetrievesCommand}" Height="30"
CommandParameter="{Binding SelectedItem,ElementName=ToolsTreeView}"
Style="{StaticResource OnlyRightPanel_HalfRound_Button}"/>
<Button Content="{Binding AutomaticMsg}" Command="{Binding AutomaticCommand}" Height="30"
CommandParameter="{Binding SelectedItem,ElementName=ToolsTreeView}"
Style="{StaticResource OnlyRightPanel_HalfRound_Button}"/>
</UniformGrid>
<TreeView Grid.Row="1" Name="ToolsTreeView" ItemsSource="{Binding ToolsList}">
<TreeView.Style>
<Style TargetType="{x:Type TreeView}">
<Setter Property="Background">
<Setter.Value>
<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.35,0">
<GradientStop Color="{StaticResource BeamWall_Mercury_Color}" Offset="0"/>
<GradientStop Color="{StaticResource BeamWall_Concrete_Color}" Offset="0.45"/>
<GradientStop Color="{StaticResource BeamWall_White_Color}" Offset="1"/>
</LinearGradientBrush>
</Setter.Value>
</Setter>
</Style>
</TreeView.Style>
<TreeView.ItemContainerStyle>
<Style TargetType="{x:Type TreeViewItem}">
<Setter Property="IsSelected" Value="{Binding IsSelected, Mode=TwoWay}" />
<Setter Property="IsExpanded" Value="{Binding IsExpanded, Mode=TwoWay}" />
<EventSetter Event="MouseDoubleClick" Handler="Tool_DoubleClick"/>
</Style>
</TreeView.ItemContainerStyle>
<TreeView.Resources>
<HierarchicalDataTemplate DataType="{x:Type EgtWPFLib5:FamilyToolItem}" ItemsSource="{Binding Items}">
<Grid Height="20">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<Image Grid.Column="0" Source="{Binding PictureString}" Height="20" Width="20" Margin="0,0,5,0" />
<TextBlock Grid.Column="1" Text="{Binding Name}" FontSize="15" Margin="0,-2,5,0" VerticalAlignment="Center" />
<Ellipse Grid.Column="2" Height="10" Width="10" Fill="{Binding FamilyColor}" />
</Grid>
</HierarchicalDataTemplate>
<DataTemplate DataType="{x:Type EgtWPFLib5:ToolItem}">
<Grid Height="20" ToolTip="{Binding ToolTipMsg}">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<!--<Image Grid.Column="0" Source="{Binding PictureString}" Height="32" Margin="0,8,6,4" />-->
<TextBlock Grid.Column="1" Text="{Binding Name}" FontSize="15" Margin="0,-2,5,0" VerticalAlignment="Center" />
<Ellipse Grid.Column="2" Height="10" Width="10" Fill="{Binding ToolColor}" />
</Grid>
</DataTemplate>
</TreeView.Resources>
</TreeView>
</Grid>
<Grid Grid.Column="1">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<Image Source="{Binding SetUpImage}" MaxWidth="300"/>
<ItemsControl Grid.Column="1" ItemsSource="{Binding PositionGroupList}"
Style="{DynamicResource HorizontalScrollViewerItemsControlStyle}">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel Orientation="Horizontal"/>
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate>
<DataTemplate>
<ItemsControl Grid.Column="1" ItemsSource="{Binding PositionList}" Margin="0,0,20,0">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<WrapPanel Orientation="Vertical"/>
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate>
<DataTemplate>
<Grid Margin="5,5,15,5">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="30"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<TextBlock Text="{Binding TcPos}"/>
<ItemsControl Grid.Column="1" ItemsSource="{Binding ExitToolAssociationList}"
HorizontalAlignment="Left">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<!--<WrapPanel Orientation="Horizontal" MaxWidth="200"/>-->
<UniformGrid Columns="1"/>
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate>
<DataTemplate>
<Grid Margin="10,0,0,5">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<ToggleButton Content="{Binding ExitPar}" Name="ExitBtn"
CommandParameter="{Binding SelectedItem,ElementName=ToolsTreeView}"
IsChecked="{Binding IsOccupied}" Height="25" Width="25" Margin="0,0,5,0"
Command="{Binding SetUpToolCommand}"
IsEnabled="{Binding IsEnabledPos}"
Background="{Binding ExitBtnBackgroundCol}"/>
<Border x:Name="ToolBorder" Grid.Column="1" BorderBrush="#4D84C4"
BorderThickness="1" ToolTip="{Binding ToolTipMsg}">
<Border.Style>
<Style TargetType="{x:Type Border}">
<Setter Property="Visibility" Value="Hidden"/>
<Style.Triggers>
<DataTrigger Binding="{Binding ElementName=ExitBtn, Path=IsChecked}" Value="True">
<Setter Property="Visibility" Value="Visible"/>
</DataTrigger>
</Style.Triggers>
</Style>
</Border.Style>
<TextBlock Text="{Binding Tool.Name}" Margin="3"/>
</Border>
</Grid>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</Grid>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</Grid>
</Grid>
</EgtWPFLib5:EgtCustomWindow>
@@ -1,31 +0,0 @@
Imports EgtWPFLib5
Imports System.Windows.Controls
Imports System.Windows.Input
Public Class OnlyProdSetUpWindowV
Private WithEvents m_SetUpWindowVM As SetUpWindowVM
Sub New(Owner As System.Windows.Window, SetUpWindowVM As SetUpWindowVM)
MyBase.New(Owner)
' This call is required by the designer.
InitializeComponent()
Me.DataContext = SetUpWindowVM
' Assegno al riferimento locale al VM il VM preso dal DataContext
m_SetUpWindowVM = SetUpWindowVM
End Sub
Private Sub Tool_DoubleClick(sender As Object, e As MouseButtonEventArgs)
Dim TreeViewItem As TreeViewItem = DirectCast(sender, TreeViewItem)
If TypeOf TreeViewItem.DataContext Is ToolItem Then
Dim SelTool As ToolItem = DirectCast(TreeViewItem.DataContext, ToolItem)
m_SetUpWindowVM.ToolDoubleClick(SelTool)
e.Handled = True
End If
End Sub
Private Sub CloseWindow(bDialogResult As Boolean) Handles m_SetUpWindowVM.m_CloseWindow
Me.DialogResult = bDialogResult
End Sub
End Class
@@ -1,138 +0,0 @@
<EgtWPFLib5:EgtCustomWindow x:Class="OnlyProdToolDbWindowV"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:sys="clr-namespace:System;assembly=mscorlib"
xmlns:EgtWPFLib5="clr-namespace:EgtWPFLib5;assembly=EgtWPFLib5"
Title="{Binding Title}"
WindowStyle="None" ResizeMode="NoResize" TitleBarHeight="30" IsResizable="False"
IsMinimizable="False" WindowStartupLocation="CenterOwner" ShowInTaskbar="False"
CloseCommand="{Binding CloseToolsDbCommand,Mode=OneWay,UpdateSourceTrigger=PropertyChanged}"
CloseCommandParameter="{Binding Path=SelectedItem, ElementName=ToolsTreeView}"
Style="{StaticResource OnlyProd_EgtCustomWindow}">
<EgtWPFLib5:EgtCustomWindow.InputBindings>
<KeyBinding Key="Escape" Command="{Binding ReloadToolCommand}"
CommandParameter="{Binding Path=SelectedItem,ElementName=ToolsTreeView}"/>
</EgtWPFLib5:EgtCustomWindow.InputBindings>
<EgtWPFLib5:EgtCustomWindow.Resources>
<EgtWPFLib5:ToolDrawUUIDConverter x:Key="ToolDrawUUIDConverter"/>
<EgtWPFLib5:ErrorVisibilityConverter x:Key="ErrorVisibilityConverter"/>
</EgtWPFLib5:EgtCustomWindow.Resources>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="0.75*"/>
<ColumnDefinition Width="2*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="10*"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<UniformGrid Grid.Row="0" Columns="3">
<Button Content="{Binding NewMsg}" Command="{Binding NewCommand}"
CommandParameter="{Binding Path=SelectedItem, ElementName=ToolsTreeView}"
IsEnabled="{Binding IsEnabledNewBtn, Mode=OneWay}" Height="30"
Style="{StaticResource OnlyRightPanel_HalfRound_Button}"/>
<Button Content="{Binding SaveMsg}" Command="{Binding SaveCommand}"
CommandParameter="{Binding Path=SelectedItem, ElementName=ToolsTreeView}"
IsEnabled="{Binding IsEnabledSaveBtn, Mode=OneWay}" Height="30"
Style="{StaticResource OnlyRightPanel_HalfRound_Button}"/>
<Button Content="{Binding RemoveMsg}" Command="{Binding RemoveCommand}"
CommandParameter="{Binding Path=SelectedItem, ElementName=ToolsTreeView}"
IsEnabled="{Binding IsEnabledRemoveBtn, Mode=OneWay}" Height="30"
Style="{StaticResource OnlyRightPanel_HalfRound_Button}"/>
</UniformGrid>
<TreeView Name="ToolsTreeView" Grid.Row="1" ItemsSource="{Binding ToolsList}">
<TreeView.Style>
<Style TargetType="{x:Type TreeView}">
<Setter Property="Background">
<Setter.Value>
<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.35,0">
<GradientStop Color="{StaticResource BeamWall_Mercury_Color}" Offset="0"/>
<GradientStop Color="{StaticResource BeamWall_Concrete_Color}" Offset="0.45"/>
<GradientStop Color="{StaticResource BeamWall_White_Color}" Offset="1"/>
</LinearGradientBrush>
</Setter.Value>
</Setter>
</Style>
</TreeView.Style>
<TreeView.ItemContainerStyle>
<Style TargetType="{x:Type TreeViewItem}">
<Setter Property="IsSelected" Value="{Binding IsSelected, Mode=TwoWay}" />
<Setter Property="IsExpanded" Value="{Binding IsExpanded, Mode=TwoWay}" />
<Setter Property="IsEnabled" Value="{Binding IsEnabled, Mode=TwoWay}" />
</Style>
</TreeView.ItemContainerStyle>
<TreeView.Resources>
<HierarchicalDataTemplate DataType="{x:Type EgtWPFLib5:FamilyToolTreeViewItem}" ItemsSource="{Binding Items}">
<Grid Height="20">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<Image Grid.Column="0" Source="{Binding PictureString}" Height="20" Width="20" Margin="0,0,5,0" />
<TextBlock Grid.Column="1" Text="{Binding Name}" FontSize="15" Margin="0,-2,5,0" VerticalAlignment="Center" />
</Grid>
</HierarchicalDataTemplate>
<DataTemplate DataType="{x:Type EgtWPFLib5:ToolTreeViewItem}">
<Grid Height="20">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<!--<Image Grid.Column="0" Source="{Binding PictureString}" Height="32" Margin="0,8,6,4" />-->
<CheckBox Name="ActiveTxBx" Grid.Column="0" Height="15" Width="15" Margin="-15,0,5,0" VerticalContentAlignment="Center"
IsChecked="{Binding Active}"
Visibility="{Binding Path=DataContext.Active_Visibility,
RelativeSource={RelativeSource AncestorType={x:Type EgtWPFLib5:EgtCustomWindow}}}"/>
<TextBlock Grid.Column="1" Text="{Binding NamePar}" FontSize="15" Margin="0,-2,5,0" VerticalAlignment="Center" />
</Grid>
</DataTemplate>
</TreeView.Resources>
</TreeView>
<UniformGrid Grid.Row="2" Columns="3">
<Button Content="{Binding ImportMsg}"
Command="{Binding ImportCommand}"
IsEnabled="{Binding IsEnabledImpExpBtn, Mode=OneWay}"
Height="30"
Style="{StaticResource OnlyRightPanel_HalfRound_Button}"/>
<Button Content="{Binding ExportMsg}"
Command="{Binding ExportCommand}"
IsEnabled="{Binding IsEnabledImpExpBtn, Mode=OneWay}"
Height="30"
Style="{StaticResource OnlyRightPanel_HalfRound_Button}"/>
<Button Content="{Binding ResetMsg}"
Command="{Binding ReloadToolCommand}"
CommandParameter="{Binding Path=SelectedItem,ElementName=ToolsTreeView}"
Height="30"
Style="{StaticResource OnlyRightPanel_HalfRound_Button}"/>
</UniformGrid>
</Grid>
<ContentControl Content="{Binding Path=ParamPageV}" Grid.Column="1"/>
<!--ContentControl che ospita la scena restituita sotto forma di WindowsFormsHost-->
<ContentControl Content="{Binding ToolSceneHost}" Grid.Column="2"/>
</Grid>
</EgtWPFLib5:EgtCustomWindow>
@@ -1,33 +0,0 @@
Imports EgtWPFLib5
Imports System.Windows.Input
Imports EgtUILib
Public Class OnlyProdToolDbWindowV
Private WithEvents m_ToolDbWindowVM As ToolDbWindowVM
Sub New(Owner As System.Windows.Window, ToolDbWindowVM As ToolDbWindowVM)
MyBase.New(Owner)
' This call is required by the designer.
InitializeComponent()
Me.DataContext = ToolDbWindowVM
' Assegno al riferimento locale al VM il VM preso dal DataContext
m_ToolDbWindowVM = ToolDbWindowVM
End Sub
Private Sub ToolsDbView_Closed(bDialogResult As Boolean) Handles m_ToolDbWindowVM.m_CloseWindow
' Imposto contesto generale
EgtSetCurrentContext(ToolDbWindowVM.ProjectSceneContext)
' Cancello contesto di visualizzazione utensile
EgtDeleteContext(ToolDbWindowVM.ToolDbSceneContext)
Me.Close()
End Sub
Private Sub ToolsDbView_Closing(sender As Object, e As System.ComponentModel.CancelEventArgs) Handles Me.Closing
If (Keyboard.Modifiers And ModifierKeys.Alt) = ModifierKeys.Alt OrElse Keyboard.IsKeyDown(Key.F4) Then
e.Cancel = True
Return
End If
End Sub
End Class
+152 -142
View File
@@ -12,148 +12,158 @@
Title="BTLDataWndV"
Name="BTLDataWndV"
Style="{StaticResource OnlyProd_EgtCustomWindow}">
<UniformGrid Margin="5"
Columns="6" Rows="7">
<TextBlock Text="{Binding PROJNUM_MSG}"
Style="{StaticResource PartParam_TextBlock}"/>
<EgtWPFLib5:EgtTextBox Grid.Column="1"
Text="{Binding Tag.sPROJNUM, UpdateSourceTrigger=Explicit,
RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:BTLDataWndV}}}"
Style="{StaticResource PartParam_TextBox}"/>
<TextBlock Text="{Binding PROJNAME_MSG}"
Style="{StaticResource PartParam_TextBlock}"/>
<EgtWPFLib5:EgtTextBox Grid.Column="1"
Text="{Binding Tag.sPROJNAME, UpdateSourceTrigger=Explicit,
RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:BTLDataWndV}}}"
Style="{StaticResource PartParam_TextBox}"/>
<TextBlock Text="{Binding PROJPART_MSG}"
Style="{StaticResource PartParam_TextBlock}"/>
<EgtWPFLib5:EgtTextBox Grid.Column="1"
Text="{Binding Tag.sPROJPART, UpdateSourceTrigger=Explicit,
RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:BTLDataWndV}}}"
Style="{StaticResource PartParam_TextBox}"/>
<TextBlock Text="{Binding PROJGUID_MSG}"
Style="{StaticResource PartParam_TextBlock}"/>
<EgtWPFLib5:EgtTextBox Grid.Column="1"
Text="{Binding Tag.sPROJGUID, UpdateSourceTrigger=Explicit,
RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:BTLDataWndV}}}"
Style="{StaticResource PartParam_TextBox}"/>
<TextBlock Text="{Binding LISTNAME_MSG}"
Style="{StaticResource PartParam_TextBlock}"/>
<EgtWPFLib5:EgtTextBox Grid.Column="1"
Text="{Binding Tag.sLISTNAME, UpdateSourceTrigger=Explicit,
RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:BTLDataWndV}}}"
Style="{StaticResource PartParam_TextBox}"/>
<TextBlock Text="{Binding CUSTOMER_MSG}"
Style="{StaticResource PartParam_TextBlock}"/>
<EgtWPFLib5:EgtTextBox Grid.Column="1"
Text="{Binding Tag.sCUSTOMER, UpdateSourceTrigger=Explicit,
RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:BTLDataWndV}}}"
Style="{StaticResource PartParam_TextBox}"/>
<TextBlock Text="{Binding ARCHITECT_MSG}"
Style="{StaticResource PartParam_TextBlock}"/>
<EgtWPFLib5:EgtTextBox Grid.Column="1"
Text="{Binding Tag.sARCHITECT, UpdateSourceTrigger=Explicit,
RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:BTLDataWndV}}}"
Style="{StaticResource PartParam_TextBox}"/>
<TextBlock Text="{Binding EDITOR_MSG}"
Style="{StaticResource PartParam_TextBlock}"/>
<EgtWPFLib5:EgtTextBox Grid.Column="1"
Text="{Binding Tag.sEDITOR, UpdateSourceTrigger=Explicit,
RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:BTLDataWndV}}}"
Style="{StaticResource PartParam_TextBox}"/>
<TextBlock Text="{Binding DELIVDATE_MSG}"
Style="{StaticResource PartParam_TextBlock}"/>
<EgtWPFLib5:EgtTextBox Grid.Column="1"
Text="{Binding Tag.sDELIVDATE, UpdateSourceTrigger=Explicit,
RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:BTLDataWndV}}}"
Style="{StaticResource PartParam_TextBox}"/>
<TextBlock Text="{Binding EXPDATE_MSG}"
Style="{StaticResource PartParam_TextBlock}"/>
<EgtWPFLib5:EgtTextBox Grid.Column="1"
Text="{Binding Tag.sEXPDATE, UpdateSourceTrigger=Explicit,
RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:BTLDataWndV}}}"
Style="{StaticResource PartParam_TextBox}"/>
<TextBlock Text="{Binding EXPTIME_MSG}"
Style="{StaticResource PartParam_TextBlock}"/>
<EgtWPFLib5:EgtTextBox Grid.Column="1"
Text="{Binding Tag.sEXPTIME, UpdateSourceTrigger=Explicit,
RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:BTLDataWndV}}}"
Style="{StaticResource PartParam_TextBox}"/>
<TextBlock Text="{Binding EXPRELEASE_MSG}"
Style="{StaticResource PartParam_TextBlock}"/>
<EgtWPFLib5:EgtTextBox Grid.Column="1"
Text="{Binding Tag.sEXPRELEASE, UpdateSourceTrigger=Explicit,
RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:BTLDataWndV}}}"
Style="{StaticResource PartParam_TextBox}"/>
<TextBlock Text="{Binding LANGUAGE_MSG}"
Style="{StaticResource PartParam_TextBlock}"/>
<EgtWPFLib5:EgtTextBox Grid.Column="1"
Text="{Binding Tag.sLANGUAGE, UpdateSourceTrigger=Explicit,
RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:BTLDataWndV}}}"
Style="{StaticResource PartParam_TextBox}"/>
<TextBlock Text="{Binding RANGE_MSG}"
Style="{StaticResource PartParam_TextBlock}"/>
<ComboBox Grid.Column="1"
ItemsSource="{Binding RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:BTLDataWndV}},
Path=Tag.ocRANGE,
Mode=OneWay}"
SelectedIndex="{Binding RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:BTLDataWndV}},
Path=Tag.SelRANGE,
Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
Style="{StaticResource PartParam_ComboBox}"/>
<TextBlock Text="{Binding PROCESSINGQUALITY_MSG}"
Style="{StaticResource PartParam_TextBlock}"/>
<ComboBox Grid.Column="1"
ItemsSource="{Binding RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:BTLDataWndV}},
Path=Tag.ocPROCESSINGQUALITY,
Mode=OneWay}"
SelectedIndex="{Binding RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:BTLDataWndV}},
Path=Tag.SelPROCESSINGQUALITY,
Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
Style="{StaticResource PartParam_ComboBox}"/>
<TextBlock Text="{Binding COMPUTERNAME_MSG}"
Style="{StaticResource PartParam_TextBlock}"/>
<EgtWPFLib5:EgtTextBox Grid.Column="1"
Text="{Binding Tag.sCOMPUTERNAME, UpdateSourceTrigger=Explicit,
RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:BTLDataWndV}}}"
Style="{StaticResource PartParam_TextBox}"/>
<TextBlock Text="{Binding USER_MSG}"
Style="{StaticResource PartParam_TextBlock}"/>
<EgtWPFLib5:EgtTextBox Grid.Column="1"
Text="{Binding Tag.sUSER, UpdateSourceTrigger=Explicit,
RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:BTLDataWndV}}}"
Style="{StaticResource PartParam_TextBox}"/>
<TextBlock Text="{Binding SRCFILE_MSG}"
Style="{StaticResource PartParam_TextBlock}"/>
<EgtWPFLib5:EgtTextBox Grid.Column="1"
Text="{Binding Tag.sSRCFILE, UpdateSourceTrigger=Explicit,
RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:BTLDataWndV}}}"
Style="{StaticResource PartParam_TextBox}"/>
<TextBlock Text="{Binding EXPFILE_MSG}"
Style="{StaticResource PartParam_TextBlock}"/>
<EgtWPFLib5:EgtTextBox Grid.Column="1"
Text="{Binding Tag.sEXPFILE, UpdateSourceTrigger=Explicit,
RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:BTLDataWndV}}}"
Style="{StaticResource PartParam_TextBox}"/>
<TextBlock Text="{Binding RECESS_MSG}"
Style="{StaticResource PartParam_TextBlock}"/>
<ComboBox Grid.Column="1"
ItemsSource="{Binding RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:BTLDataWndV}},
Path=Tag.ocRECESS,
Mode=OneWay}"
SelectedIndex="{Binding RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:BTLDataWndV}},
Path=Tag.SelRECESS,
Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
Style="{StaticResource PartParam_ComboBox}"/>
<TextBlock Text="{Binding USERATTRIBUTE_MSG}"
Style="{StaticResource PartParam_TextBlock}"/>
<EgtWPFLib5:EgtTextBox Grid.Column="1"
Text="{Binding Tag.sUSERATTRIBUTE, UpdateSourceTrigger=Explicit,
RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:BTLDataWndV}}}"
Style="{StaticResource PartParam_TextBox}"/>
<TabControl>
<TabItem Header="Strategy">
<ComboBox ItemsSource="{Binding StrategySetupList}"
SelectedItem="{Binding SelStrategySetup}"
Style="{StaticResource Strategy_ComboBox}"/>
</TabItem>
<TabItem Header="BTL">
</UniformGrid>
<UniformGrid Margin="5"
Columns="6" Rows="7">
<TextBlock Text="{Binding PROJNUM_MSG}"
Style="{StaticResource PartParam_TextBlock}"/>
<EgtWPFLib5:EgtTextBox Grid.Column="1"
Text="{Binding Tag.sPROJNUM, UpdateSourceTrigger=Explicit,
RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:BTLDataWndV}}}"
Style="{StaticResource PartParam_TextBox}"/>
<TextBlock Text="{Binding PROJNAME_MSG}"
Style="{StaticResource PartParam_TextBlock}"/>
<EgtWPFLib5:EgtTextBox Grid.Column="1"
Text="{Binding Tag.sPROJNAME, UpdateSourceTrigger=Explicit,
RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:BTLDataWndV}}}"
Style="{StaticResource PartParam_TextBox}"/>
<TextBlock Text="{Binding PROJPART_MSG}"
Style="{StaticResource PartParam_TextBlock}"/>
<EgtWPFLib5:EgtTextBox Grid.Column="1"
Text="{Binding Tag.sPROJPART, UpdateSourceTrigger=Explicit,
RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:BTLDataWndV}}}"
Style="{StaticResource PartParam_TextBox}"/>
<TextBlock Text="{Binding PROJGUID_MSG}"
Style="{StaticResource PartParam_TextBlock}"/>
<EgtWPFLib5:EgtTextBox Grid.Column="1"
Text="{Binding Tag.sPROJGUID, UpdateSourceTrigger=Explicit,
RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:BTLDataWndV}}}"
Style="{StaticResource PartParam_TextBox}"/>
<TextBlock Text="{Binding LISTNAME_MSG}"
Style="{StaticResource PartParam_TextBlock}"/>
<EgtWPFLib5:EgtTextBox Grid.Column="1"
Text="{Binding Tag.sLISTNAME, UpdateSourceTrigger=Explicit,
RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:BTLDataWndV}}}"
Style="{StaticResource PartParam_TextBox}"/>
<TextBlock Text="{Binding CUSTOMER_MSG}"
Style="{StaticResource PartParam_TextBlock}"/>
<EgtWPFLib5:EgtTextBox Grid.Column="1"
Text="{Binding Tag.sCUSTOMER, UpdateSourceTrigger=Explicit,
RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:BTLDataWndV}}}"
Style="{StaticResource PartParam_TextBox}"/>
<TextBlock Text="{Binding ARCHITECT_MSG}"
Style="{StaticResource PartParam_TextBlock}"/>
<EgtWPFLib5:EgtTextBox Grid.Column="1"
Text="{Binding Tag.sARCHITECT, UpdateSourceTrigger=Explicit,
RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:BTLDataWndV}}}"
Style="{StaticResource PartParam_TextBox}"/>
<TextBlock Text="{Binding EDITOR_MSG}"
Style="{StaticResource PartParam_TextBlock}"/>
<EgtWPFLib5:EgtTextBox Grid.Column="1"
Text="{Binding Tag.sEDITOR, UpdateSourceTrigger=Explicit,
RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:BTLDataWndV}}}"
Style="{StaticResource PartParam_TextBox}"/>
<TextBlock Text="{Binding DELIVDATE_MSG}"
Style="{StaticResource PartParam_TextBlock}"/>
<EgtWPFLib5:EgtTextBox Grid.Column="1"
Text="{Binding Tag.sDELIVDATE, UpdateSourceTrigger=Explicit,
RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:BTLDataWndV}}}"
Style="{StaticResource PartParam_TextBox}"/>
<TextBlock Text="{Binding EXPDATE_MSG}"
Style="{StaticResource PartParam_TextBlock}"/>
<EgtWPFLib5:EgtTextBox Grid.Column="1"
Text="{Binding Tag.sEXPDATE, UpdateSourceTrigger=Explicit,
RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:BTLDataWndV}}}"
Style="{StaticResource PartParam_TextBox}"/>
<TextBlock Text="{Binding EXPTIME_MSG}"
Style="{StaticResource PartParam_TextBlock}"/>
<EgtWPFLib5:EgtTextBox Grid.Column="1"
Text="{Binding Tag.sEXPTIME, UpdateSourceTrigger=Explicit,
RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:BTLDataWndV}}}"
Style="{StaticResource PartParam_TextBox}"/>
<TextBlock Text="{Binding EXPRELEASE_MSG}"
Style="{StaticResource PartParam_TextBlock}"/>
<EgtWPFLib5:EgtTextBox Grid.Column="1"
Text="{Binding Tag.sEXPRELEASE, UpdateSourceTrigger=Explicit,
RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:BTLDataWndV}}}"
Style="{StaticResource PartParam_TextBox}"/>
<TextBlock Text="{Binding LANGUAGE_MSG}"
Style="{StaticResource PartParam_TextBlock}"/>
<EgtWPFLib5:EgtTextBox Grid.Column="1"
Text="{Binding Tag.sLANGUAGE, UpdateSourceTrigger=Explicit,
RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:BTLDataWndV}}}"
Style="{StaticResource PartParam_TextBox}"/>
<TextBlock Text="{Binding RANGE_MSG}"
Style="{StaticResource PartParam_TextBlock}"/>
<ComboBox Grid.Column="1"
ItemsSource="{Binding RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:BTLDataWndV}},
Path=Tag.ocRANGE,
Mode=OneWay}"
SelectedIndex="{Binding RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:BTLDataWndV}},
Path=Tag.SelRANGE,
Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
Style="{StaticResource PartParam_ComboBox}"/>
<TextBlock Text="{Binding PROCESSINGQUALITY_MSG}"
Style="{StaticResource PartParam_TextBlock}"/>
<ComboBox Grid.Column="1"
ItemsSource="{Binding RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:BTLDataWndV}},
Path=Tag.ocPROCESSINGQUALITY,
Mode=OneWay}"
SelectedIndex="{Binding RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:BTLDataWndV}},
Path=Tag.SelPROCESSINGQUALITY,
Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
Style="{StaticResource PartParam_ComboBox}"/>
<TextBlock Text="{Binding COMPUTERNAME_MSG}"
Style="{StaticResource PartParam_TextBlock}"/>
<EgtWPFLib5:EgtTextBox Grid.Column="1"
Text="{Binding Tag.sCOMPUTERNAME, UpdateSourceTrigger=Explicit,
RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:BTLDataWndV}}}"
Style="{StaticResource PartParam_TextBox}"/>
<TextBlock Text="{Binding USER_MSG}"
Style="{StaticResource PartParam_TextBlock}"/>
<EgtWPFLib5:EgtTextBox Grid.Column="1"
Text="{Binding Tag.sUSER, UpdateSourceTrigger=Explicit,
RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:BTLDataWndV}}}"
Style="{StaticResource PartParam_TextBox}"/>
<TextBlock Text="{Binding SRCFILE_MSG}"
Style="{StaticResource PartParam_TextBlock}"/>
<EgtWPFLib5:EgtTextBox Grid.Column="1"
Text="{Binding Tag.sSRCFILE, UpdateSourceTrigger=Explicit,
RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:BTLDataWndV}}}"
Style="{StaticResource PartParam_TextBox}"/>
<TextBlock Text="{Binding EXPFILE_MSG}"
Style="{StaticResource PartParam_TextBlock}"/>
<EgtWPFLib5:EgtTextBox Grid.Column="1"
Text="{Binding Tag.sEXPFILE, UpdateSourceTrigger=Explicit,
RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:BTLDataWndV}}}"
Style="{StaticResource PartParam_TextBox}"/>
<TextBlock Text="{Binding RECESS_MSG}"
Style="{StaticResource PartParam_TextBlock}"/>
<ComboBox Grid.Column="1"
ItemsSource="{Binding RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:BTLDataWndV}},
Path=Tag.ocRECESS,
Mode=OneWay}"
SelectedIndex="{Binding RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:BTLDataWndV}},
Path=Tag.SelRECESS,
Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
Style="{StaticResource PartParam_ComboBox}"/>
<TextBlock Text="{Binding USERATTRIBUTE_MSG}"
Style="{StaticResource PartParam_TextBlock}"/>
<EgtWPFLib5:EgtTextBox Grid.Column="1"
Text="{Binding Tag.sUSERATTRIBUTE, UpdateSourceTrigger=Explicit,
RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:BTLDataWndV}}}"
Style="{StaticResource PartParam_TextBox}"/>
</UniformGrid>
</TabItem>
</TabControl>
</EgtWPFLib5:EgtCustomWindow>
@@ -1,9 +1,39 @@
Imports EgtWPFLib5
Imports EgtUILib
Imports System.Collections.ObjectModel
Imports System.IO
Imports EgtBEAMWALL.Core
Public Class BTLDataWndVM
Inherits VMBase
#Region "FIELDS & PROPERTIES"
Friend Event m_CloseWindow(bDialogResult As Boolean)
Private m_StrategySetupList As New ObservableCollection(Of String)
Public ReadOnly Property StrategySetupList As ObservableCollection(Of String)
Get
Return m_StrategySetupList
End Get
End Property
Private m_SelStrategySetup As String
Public Property SelStrategySetup As String
Get
Return m_SelStrategySetup
End Get
Set(value As String)
If m_SelStrategySetup <> value Then
EgtSetInfo(m_nBTLInfoLayerId, "AISETUP", value)
End If
m_SelStrategySetup = value
End Set
End Property
Private m_nBTLInfoLayerId As Integer = -1
#Region "Messages"
Public ReadOnly Property PROJNUM_MSG As String
@@ -134,10 +164,6 @@ Public Class BTLDataWndVM
#End Region ' Messages
#Region "FIELDS & PROPERTIES"
Friend Event m_CloseWindow(bDialogResult As Boolean)
' Definizione comandi
Private m_cmdOk As ICommand
@@ -145,8 +171,30 @@ Public Class BTLDataWndVM
#Region "CONSTRUCTOR"
Sub New()
Sub New(nProjId As Integer)
' leggo cartella dei setup delle strategie
Dim AISetupDirPath As String = Map.refMainWindowVM.MainWindowM.GetAISetupDirPath()
Dim AISetupPaths As String() = Directory.GetFiles(AISetupDirPath)
For Each AiSetup In AISetupPaths
m_StrategySetupList.Add(Path.GetFileNameWithoutExtension(AiSetup))
Next
'EgtGetInfo()
'Map.refProjectVM.BTLStructureVM.BTLStructureM.nBTLInfoId
' cerco tra i layer BTLInfo
Dim nBTLInfoLayerId As Integer = EgtGetFirstNameInGroup(GDB_ID.ROOT, BTLINFO)
While nBTLInfoLayerId <> GDB_ID.NULL
' verifico se il layer appartiene al ProjId
Dim nBTLInfoLayerProjId As Integer
EgtGetInfo(nBTLInfoLayerId, BTL_PRT_PROJ, nBTLInfoLayerProjId)
If nBTLInfoLayerProjId = nProjId Then
m_nBTLInfoLayerId = nBTLInfoLayerId
Exit While
End If
nBTLInfoLayerId = EgtGetNextName(nBTLInfoLayerId, BTLINFO)
End While
EgtGetInfo(m_nBTLInfoLayerId, "AISETUP", m_SelStrategySetup)
End Sub
#End Region ' CONSTRUCTOR
@@ -165,6 +213,12 @@ Public Class BTLDataWndVM
End Property
Public Sub Ok()
' scrivo AISetup
Dim sOldStrategySetup As String = ""
EgtGetInfo(m_nBTLInfoLayerId, "AISETUP", sOldStrategySetup)
If m_SelStrategySetup <> sOldStrategySetup Then
EgtSetInfo(m_nBTLInfoLayerId, "AISETUP", m_SelStrategySetup)
End If
RaiseEvent m_CloseWindow(True)
End Sub
@@ -8,17 +8,17 @@ Public Class BTLPartManagerVM
#Region "FIELDS & PROPERTIES"
'Public ReadOnly Property ViewPage_Visibility As Visibility
' Get
' Return If(Map.refMainMenuVM.SelPage = Pages.VIEW OrElse Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE, Visibility.Visible, Visibility.Collapsed)
' End Get
'End Property
Public ReadOnly Property ViewPage_Visibility As Visibility
Get
Return If(Map.refMainMenuVM.SelPage = Pages.VIEW OrElse Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE, Visibility.Visible, Visibility.Collapsed)
End Get
End Property
'Public ReadOnly Property MachiningPage_Visibility As Visibility
' Get
' Return If(Map.refMainMenuVM.SelPage = Pages.MACHINING OrElse Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE, Visibility.Visible, Visibility.Collapsed)
' End Get
'End Property
Public ReadOnly Property MachiningPage_Visibility As Visibility
Get
Return If(Map.refMainMenuVM.SelPage = Pages.MACHINING OrElse Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE, Visibility.Visible, Visibility.Collapsed)
End Get
End Property
Private m_BTLPartManager_IsEnabled As Boolean = True
Public ReadOnly Property BTLPartManager_IsEnabled As Boolean
@@ -57,6 +57,7 @@ Public Class BTLPartManagerVM
'Private m_cmdForwardRotation As ICommand
Private m_cmdSimulate As ICommand
Private m_cmdEdit As ICommand
Private m_cmdResetCalc As ICommand
#Region "Messages"
@@ -138,6 +139,12 @@ Public Class BTLPartManagerVM
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
@@ -1154,64 +1161,67 @@ Public Class BTLPartManagerVM
Dim ProjType As BWType
Dim BarList() As EgtBEAMWALL.Core.Bar = Nothing
ProjType = Map.refOnlyProdManagerVM.CurrProd.nType
If Map.refProjectVM.LastSelGridType = ProjectVM.GridSelTypes.PART Then
If Not CreateBarToSimulate(Pages.VIEW, ProjType, BarList) Then Return
' lancio simulazione
EgtBEAMWALL.Core.CalcIntegration.Run(BarList, ProjectManagerVM.CurrProj.sProjDirPath, AddressOf ManageCalc)
ElseIf Map.refProjectVM.LastSelGridType = ProjectVM.GridSelTypes.MACHGROUP Then
If Not CreateBarToSimulate(Pages.MACHINING, ProjType, BarList) Then Return
' lancio simulazione
EgtBEAMWALL.Core.CalcIntegration.Run(BarList, ProjectManagerVM.CurrProd.sProdDirPath, AddressOf ManageCalc)
End If
'If Map.refProjectVM.LastSelGridType = ProjectVM.GridSelTypes.PART Then
' If Not CreateBarToSimulate(Pages.VIEW, ProjType, BarList) Then Return
' ' lancio simulazione
' EgtBEAMWALL.Core.CalcIntegration.Run(BarList, ProjectManagerVM.CurrProj.sProjDirPath, AddressOf ManageCalc)
'ElseIf Map.refProjectVM.LastSelGridType = ProjectVM.GridSelTypes.MACHGROUP Then
' If Not CreateBarToSimulate(Pages.MACHINING, ProjType, BarList) Then Return
' ' lancio simulazione
' EgtBEAMWALL.Core.CalcIntegration.Run(BarList, ProjectManagerVM.CurrProd.sProdDirPath, AddressOf ManageCalc)
'End If
If Not CreateBarToSimulate(ProjType, BarList) Then Return
' lancio simulazione
EgtBEAMWALL.Core.CalcIntegration.Run(BarList, ProjectManagerVM.CurrProj.sProjDirPath, AddressOf ManageCalc)
End Sub
Private Function CreateBarToSimulate(SelPage As Pages, ProjType As BWType, ByRef BarList As Bar()) As Boolean
If SelPage = Pages.VIEW Then
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 = Map.refMachinePanelVM.SelectedMachine.Name,
.nCmdType = CalcIntegration.CmdTypes.SIMULATE,
.nGlobState = Map.refProjectVM.BTLStructureVM.SelBTLPart.nGlobalState}
If Map.refProjectVM.BTLStructureVM.SelBTLPart.nGlobalState = CalcStates.NOTCALCULATED Then
Dim sBTLPartFilePath As String = ProjectManagerVM.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
Return False
Private Function CreateBarToSimulate(ProjType As BWType, ByRef BarList As Bar()) As Boolean
'If SelPage = Pages.VIEW Then
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 = Map.refMachinePanelVM.SelectedMachine.Name,
.nCmdType = CalcIntegration.CmdTypes.SIMULATE,
.nGlobState = Map.refProjectVM.BTLStructureVM.SelBTLPart.nGlobalState}
If Map.refProjectVM.BTLStructureVM.SelBTLPart.nGlobalState = CalcStates.NOTCALCULATED Then
Dim sBTLPartFilePath As String = ProjectManagerVM.CurrProj.sProjDirPath & "\" & Map.refProjectVM.BTLStructureVM.SelBTLPart.nPDN.ToString() & ".ori.bwe"
If File.Exists(sBTLPartFilePath) Then File.Delete(sBTLPartFilePath)
End If
' disabilito interfaccia
Map.refProjectVM.SetCalcRunning(True)
ElseIf SelPage = Pages.MACHINING Then
If Not IsNothing(Map.refMachGroupPanelVM.SelectedMachGroup) Then
Dim SelMachGroup As MyMachGroupVM = Map.refMachGroupPanelVM.SelectedMachGroup
Dim TempBarList(0) As EgtBEAMWALL.Core.Bar
Dim MachineName As String = ""
EgtGetMachGroupMachineName(SelMachGroup.Id, MachineName)
Dim Bar As New EgtBEAMWALL.Core.Bar With {.nBarId = SelMachGroup.Id,
.nProgramPage = ProjectType.PROD,
.nProjType = ProjType,
.bBarOk = True,
.nMachineName = MachineName,
.nCmdType = CalcIntegration.CmdTypes.SIMULATE,
.nGlobState = SelMachGroup.nGlobalState}
If SelMachGroup.nGlobalState = CalcStates.NOTCALCULATED Then
Dim sMachGroupFilePath As String = ProjectManagerVM.CurrProd.sProdDirPath & "\" & SelMachGroup.Name.ToString() & ".ori.bwe"
If File.Exists(sMachGroupFilePath) Then File.Delete(sMachGroupFilePath)
End If
TempBarList(0) = Bar
BarList = TempBarList
Else
Return False
End If
' disabilito interfaccia
Map.refProjectVM.SetCalcRunning(True)
TempBarList(0) = Bar
BarList = TempBarList
Else
Return False
End If
' disabilito interfaccia
Map.refProjectVM.SetCalcRunning(True)
'ElseIf SelPage = Pages.MACHINING Then
' If Not IsNothing(Map.refMachGroupPanelVM.SelectedMachGroup) Then
' Dim SelMachGroup As MyMachGroupVM = Map.refMachGroupPanelVM.SelectedMachGroup
' Dim TempBarList(0) As EgtBEAMWALL.Core.Bar
' Dim MachineName As String = ""
' EgtGetMachGroupMachineName(SelMachGroup.Id, MachineName)
' Dim Bar As New EgtBEAMWALL.Core.Bar With {.nBarId = SelMachGroup.Id,
' .nProgramPage = ProjectType.PROD,
' .nProjType = ProjType,
' .bBarOk = True,
' .nMachineName = MachineName,
' .nCmdType = CalcIntegration.CmdTypes.SIMULATE,
' .nGlobState = SelMachGroup.nGlobalState}
' If SelMachGroup.nGlobalState = CalcStates.NOTCALCULATED Then
' Dim sMachGroupFilePath As String = ProjectManagerVM.CurrProd.sProdDirPath & "\" & SelMachGroup.Name.ToString() & ".ori.bwe"
' If File.Exists(sMachGroupFilePath) Then File.Delete(sMachGroupFilePath)
' End If
' TempBarList(0) = Bar
' BarList = TempBarList
'Else
' Return False
' End If
' disabilito interfaccia
Map.refProjectVM.SetCalcRunning(True)
'End If
Return True
End Function
@@ -1235,13 +1245,48 @@ Public Class BTLPartManagerVM
''' Execute the Open. This method is invoked by the OpenCommand.
''' </summary>
Friend Sub Edit()
Map.refProjectVM.SetSelManagerTab(ProjectVM.ManagerTab.FEATUREMANAGER)
If Not IsNothing(Map.refProjectVM.BTLStructureVM) AndAlso Not IsNothing(Map.refProjectVM.BTLStructureVM.SelBTLPart) AndAlso Not IsNothing(Map.refProjectVM.BTLStructureVM.SelBTLPart.SelBTLFeatureVM) Then
Map.refForcedStrategyBTLVM.Init(Map.refProjectVM.BTLStructureVM.SelBTLPart.SelBTLFeatureVM.BTLFeatureM)
End If
Map.refProjectVM.SetRawPartManagerVisibility(Visibility.Collapsed)
Map.refProjectVM.SetStrategyManagerVisibility(Visibility.Visible)
Map.refProjectVM.SetSelManagerTab(ProjectVM.StrategyManagerTab.FEATUREMANAGER)
Map.refProjectVM.SetSelFeatureManagerTab(ProjectVM.FeatureManagerTab.FEATUREMANAGERBTL)
' Disabilito LeftPanel
Map.refProjectVM.SetOnlyProdLeftPanel_IsEnabled(False)
Map.refProjectVM.SetOnlyProdLeftPanel_Opacity(0.2)
End Sub
#End Region ' Edit
#Region "ResetCalc"
''' <summary>
''' Returns a command that do Exec.
''' </summary>
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
''' <summary>
''' Execute the Exec. This method is invoked by the ExecCommand.
''' </summary>
Public Sub ResetCalc()
If (Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE AndAlso (IsNothing(ProjectManagerVM.CurrProj) OrElse IsNothing(Map.refProjectVM.BTLStructureVM)) AndAlso (IsNothing(ProjectManagerVM.CurrProd) 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
@@ -16,7 +16,7 @@
ToolTip="{Binding RemovePart_ToolTip}"
IsEnabled="{Binding RemovePart_IsEnabled}"
Style="{StaticResource OnlyProdLeftPanel_Button}">
<Image Source="/Resources/LeftPanel/RemovePart.png" Stretch="Uniform"/>
<Image Source="/Resources/NewPage/Remove.png" Stretch="Uniform"/>
</Button>
<Button ToolTip="{Binding Simulate_ToolTip}"
Command="{Binding Simulate_Command}"
@@ -31,6 +31,12 @@
Style="{StaticResource OnlyProdLeftPanel_Button}">
<Image Source="/Resources/CALCPanel/Edit.png" Stretch="Uniform"/>
</Button>
<Button Command="{Binding ResetCalc_Command}"
ToolTip="{Binding ResetCalc_ToolTip}"
IsEnabled="{Binding CALCPanel_IsEnabled}"
Style="{StaticResource OnlyProdLeftPanel_Button}">
<Image Source="/Resources/CALCPanel/ResetCalc.png" Stretch="Uniform"/>
</Button>
<!--<Button Command="{Binding NewRawPart_Command}"
Visibility="{Binding MachiningPage_Visibility}"
ToolTip="{Binding NewRawPart_ToolTip}"
@@ -407,10 +407,10 @@ Public Class BTLFeatureVM
End Sub
' funzione che aggiorna lo stato, la rotazione e gli errori dopo calcolo
Friend Sub CalcFeatureUpdate(ERR As Integer, ROT As Integer, MSG As String)
EgtSetInfo(nFeatureId, If(Map.refMainMenuVM.SelPage = Pages.VIEW, ITG_PROJ_ERR, ITG_PROD_ERR), ERR, True)
EgtSetInfo(nFeatureId, If(Map.refMainMenuVM.SelPage = Pages.VIEW, ITG_PROJ_MSG, ITG_PROD_MSG), MSG, True)
EgtSetInfo(nFeatureId, If(Map.refMainMenuVM.SelPage = Pages.VIEW, ITG_PROJ_ROT, ITG_PROD_ROT), ROT, True)
Friend Sub CalcFeatureUpdate(nProgramPage As Integer, ERR As Integer, ROT As Integer, MSG As String)
EgtSetInfo(nFeatureId, If(nProgramPage = ProjectType.PROJ, ITG_PROJ_ERR, ITG_PROD_ERR), ERR, True)
EgtSetInfo(nFeatureId, If(nProgramPage = ProjectType.PROJ, ITG_PROJ_MSG, ITG_PROD_MSG), MSG, True)
EgtSetInfo(nFeatureId, If(nProgramPage = ProjectType.PROJ, ITG_PROJ_ROT, ITG_PROD_ROT), ROT, True)
m_BTLFeatureM.nCALC_ERR = ERR
m_BTLFeatureM.nCALC_ROT = ROT
m_BTLFeatureM.sCALC_MSG = MSG
@@ -622,11 +622,17 @@ Public Class BTLFeatureVM
End Property
Public Sub Strategy()
' disattivo modalita' contorno libero
Map.refProjectVM.SetSelManagerTab(ProjectVM.ManagerTab.STRATEGYMANAGER)
' Visualizzo StrategyProductionV
Map.refProjectVM.SetSelManagerTab(ProjectVM.StrategyManagerTab.STRATEGYMANAGER)
' Disabilito LeftPanel
Map.refProjectVM.SetOnlyProdLeftPanel_IsEnabled(False)
Map.refProjectVM.SetOnlyProdLeftPanel_Opacity(0.2)
Map.refForcedStrategyPanelVM.Init(BTLFeatureM)
'' Richiamo Funzione per mostrare Stragetie della Feature
'Map.refStrategyManagerVM.GetStrategyProduction()
End Sub
#End Region ' Cancel
#End Region ' Strategy
#End Region ' COMMANDS
+88 -84
View File
@@ -1534,30 +1534,55 @@ Public Class BTLPartVM
m_SelBTLFeatureVM = value
'If Map.refMainMenuVM.SelPage = Pages.VIEW OrElse (Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE AndAlso Map.refProjectVM.LastSelGridType = ProjectVM.GridSelTypes.PART) Then
If Not IsNothing(m_SelBTLFeatureVM) Then
DirectCast(m_SelBTLFeatureVM, BTLFeatureVM).SelGeomFeature()
' deseleziono i parametri
If Not IsNothing(SelBTLFeatureVM.SelPBTLParam) Then SelBTLFeatureVM.SelPBTLParam = Nothing
' rinfresco bottoni freecontour
m_SelBTLFeatureVM.RefreshFCMBtnVisibility()
' aggiorno stato abilitazione del bottone modifica free contour
If Map.refMainMenuVM.SelPage <> Pages.ONLYPRODPAGE Then
Map.refFeatureManagerVM.SetEditIsEnabled()
Map.refFeatureManagerVM.NotifyPropertyChanged(NameOf(Map.refFeatureManagerVM.Priority_Visibility))
End If
' Controlo se nPRC è 900 rendo visibile combobox Variant
If m_SelBTLFeatureVM.nPRC = 900 Then
Map.refFeatureManagerVM.SetVariant_Visibility(Visibility.Visible)
Dim nVariant As Integer = 0
If Integer.TryParse(m_SelBTLFeatureVM.sDES, nVariant) Then
m_SelBTLFeatureVM.nSelVARIANT = nVariant
End If
Else
If Map.refMainMenuVM.SelPage <> Pages.ONLYPRODPAGE Then Map.refFeatureManagerVM.SetVariant_Visibility(Visibility.Collapsed)
DirectCast(m_SelBTLFeatureVM, BTLFeatureVM).SelGeomFeature()
' deseleziono i parametri
If Not IsNothing(SelBTLFeatureVM.SelPBTLParam) Then SelBTLFeatureVM.SelPBTLParam = Nothing
' rinfresco bottoni freecontour
m_SelBTLFeatureVM.RefreshFCMBtnVisibility()
'' aggiorno stato abilitazione del bottone modifica free contour
'If Map.refMainMenuVM.SelPage <> Pages.ONLYPRODPAGE Then
' Map.refFeatureManagerVM.SetEditIsEnabled()
' Map.refFeatureManagerVM.NotifyPropertyChanged(NameOf(Map.refFeatureManagerVM.Priority_Visibility))
'End If
' Controlo se nPRC è 900 rendo visibile combobox Variant
If m_SelBTLFeatureVM.nPRC = 900 Then
Map.refFeatureManagerVM.SetVariant_Visibility(Visibility.Visible)
Dim nVariant As Integer = 0
If Integer.TryParse(m_SelBTLFeatureVM.sDES, nVariant) Then
m_SelBTLFeatureVM.nSelVARIANT = nVariant
End If
Else
EgtDeselectAll()
'If Map.refMainMenuVM.SelPage <> Pages.ONLYPRODPAGE Then Map.refFeatureManagerVM.SetVariant_Visibility(Visibility.Collapsed)
End If
If Not IsNothing(Map.refFeatureListManagerVM) Then Map.refFeatureListManagerVM.FeatureSelectionChanged()
' Forzo strategia
Map.refForcedStrategyBTLVM.Init(m_SelBTLFeatureVM.BTLFeatureM)
Else
EgtDeselectAll()
End If
If Not IsNothing(Map.refFeatureListManagerVM) Then Map.refFeatureListManagerVM.FeatureSelectionChanged()
'End If
If Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE Then
EgtResetCurrMachGroup()
ResetSearchFound()
Map.refStatisticsTimePanelVM.SetViewPage_Visibility(Visibility.Visible)
Map.refStatisticsTimePanelVM.SetMachiningPage_Visibility(Visibility.Collapsed)
End If
EgtDraw()
NotifyPropertyChanged(NameOf(SelBTLFeatureVM))
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
DirectCast(m_SelBTLFeatureVM, BTLFeatureVM).SelGeomFeature()
' deseleziono i parametri
If Not IsNothing(SelBTLFeatureVM.SelPBTLParam) Then SelBTLFeatureVM.SelPBTLParam = Nothing
End If
If Not IsNothing(Map.refFeatureListManagerVM) Then Map.refFeatureListManagerVM.FeatureSelectionChanged()
'End If
If Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE Then
EgtResetCurrMachGroup()
@@ -1626,6 +1651,22 @@ Public Class BTLPartVM
NotifyPropertyChanged(NameOf(IsSettingBtnOpen))
End Sub
Public Property IsInverted As Boolean
Get
Return BTLPartM.nINVERTED = 180
End Get
Set(value As Boolean)
' eseguo inversione
m_BTLPartM.Inversion(Map.refProjectVM.BTLStructureVM.nPROJTYPE)
' setto part e tutte le feature da ricalcolare
ResetCalcTotalPart()
EgtDraw()
' imposto lock
bLockInversion = True
NotifyPropertyChanged(NameOf(IsInverted))
End Set
End Property
' Definizione comandi
Private m_cmdInvert As ICommand
Private m_cmdBackRotation As ICommand
@@ -1688,6 +1729,7 @@ Public Class BTLPartVM
' Aggiorno stato da stati feature
CalcGlobalUpdate()
NotifyPropertyChanged(NameOf(CALC_FALL_Visibility))
NotifyPropertyChanged(NameOf(IsInverted))
End Sub
Private Function FeatureFilter(Feature As Object) As Boolean
@@ -2292,77 +2334,39 @@ Public Class BTLPartVM
Dim ProjType As BWType
Dim BarList() As EgtBEAMWALL.Core.Bar = Nothing
ProjType = ProjectManagerVM.CurrProd.nType
If Map.refProjectVM.LastSelGridType = ProjectVM.GridSelTypes.PART Then
If Not CreateBarToVerify(Pages.VIEW, ProjType, BarList) Then Return
' lancio calcolo
EgtBEAMWALL.Core.CalcIntegration.Run(BarList, Map.refOnlyProdManagerVM.CurrProj.sProjDirPath, AddressOf ManageCalc)
ElseIf Map.refProjectVM.LastSelGridType = ProjectVM.GridSelTypes.MACHGROUP Then
If Not CreateBarToVerify(Pages.MACHINING, ProjType, BarList) Then Return
' lancio calcolo
EgtBEAMWALL.Core.CalcIntegration.Run(BarList, Map.refOnlyProdManagerVM.CurrProd.sProdDirPath, AddressOf ManageCalc)
End If
If Not CreateBarToVerify(ProjType, BarList) Then Return
' lancio calcolo
EgtBEAMWALL.Core.CalcIntegration.Run(BarList, Map.refOnlyProdManagerVM.CurrProj.sProjDirPath, AddressOf ManageCalc)
End Sub
Private Function CreateBarToVerify(SelPage As Pages, ProjType As BWType, ByRef BarList As Bar()) As Boolean
If SelPage = Pages.VIEW Then
If Not IsNothing(Map.refProjectVM.BTLStructureVM.SelBTLPart) Then
Dim TempBarList(0) As EgtBEAMWALL.Core.Bar
If Not Map.refProjectVM.BTLStructureVM.SelBTLPart.bDO Then Return False
Dim Bar As New EgtBEAMWALL.Core.Bar With {.nBarId = Map.refProjectVM.BTLStructureVM.SelBTLPart.nPartId,
Private Function CreateBarToVerify(ProjType As BWType, ByRef BarList As Bar()) As Boolean
If Not IsNothing(Map.refProjectVM.BTLStructureVM.SelBTLPart) Then
Dim TempBarList(0) As EgtBEAMWALL.Core.Bar
If Not Map.refProjectVM.BTLStructureVM.SelBTLPart.bDO Then Return False
Dim Bar As New EgtBEAMWALL.Core.Bar With {.nBarId = Map.refProjectVM.BTLStructureVM.SelBTLPart.nPartId,
.nProgramPage = ProjectType.PROJ,
.nProjType = ProjType,
.bBarOk = True,
.nMachineName = Map.refMachinePanelVM.SelectedMachine.Name,
.nGlobState = Map.refProjectVM.BTLStructureVM.SelBTLPart.nGlobalState}
Select Case Map.refProjectVM.BTLStructureVM.SelBTLPart.nGlobalState
Case Core.CalcStates.OK, CalcStates.INFO
Bar.nCmdType = CalcIntegration.CmdTypes.GENERATE
Case Else
If Map.refProjectVM.BTLStructureVM.SelBTLPart.nGlobalState = CalcStates.NOTCALCULATED OrElse Map.refProjectVM.BTLStructureVM.SelBTLPart.nFeaturesGlobalState > CalcStates.INFO Then
Dim sBTLPartFilePath As String = ProjectManagerVM.CurrProj.sProjDirPath & "\" & Map.refProjectVM.BTLStructureVM.SelBTLPart.nPDN.ToString() & ".ori.bwe"
If File.Exists(sBTLPartFilePath) Then File.Delete(sBTLPartFilePath)
End If
Bar.nCmdType = CalcIntegration.CmdTypes.CHECKGEN
End Select
TempBarList(0) = Bar
BarList = TempBarList
Else
Return False
End If
' disabilito interfaccia
Map.refProjectVM.SetCalcRunning(True)
ElseIf SelPage = Pages.MACHINING Then
If Not IsNothing(Map.refMachGroupPanelVM.SelectedMachGroup) Then
Dim SelMachGroup As MyMachGroupVM = Map.refMachGroupPanelVM.SelectedMachGroup
' se barra gia' assegnata a supervisore, esco
If SelMachGroup.nProduction_State >= ItemState.Assigned Then Return False
Dim TempBarList(0) As EgtBEAMWALL.Core.Bar
Dim MachineName As String = ""
EgtGetMachGroupMachineName(SelMachGroup.Id, MachineName)
Dim Bar As New EgtBEAMWALL.Core.Bar With {.nBarId = SelMachGroup.Id,
.nProgramPage = ProjectType.PROD,
.nProjType = ProjType,
.bBarOk = True,
.nMachineName = MachineName,
.nGlobState = SelMachGroup.nGlobalState}
Select Case SelMachGroup.nGlobalState
Case Core.CalcStates.OK, CalcStates.INFO
Bar.nCmdType = CalcIntegration.CmdTypes.GENERATE
Case Else
If SelMachGroup.nGlobalState = CalcStates.NOTCALCULATED OrElse (SelMachGroup.nPartsGlobalState > CalcStates.INFO) Then
Dim sMachGroupFilePath As String = ProjectManagerVM.CurrProd.sProdDirPath & "\" & SelMachGroup.Name.ToString() & ".ori.bwe"
If File.Exists(sMachGroupFilePath) Then File.Delete(sMachGroupFilePath)
End If
Bar.nCmdType = CalcIntegration.CmdTypes.CHECKGEN
End Select
TempBarList(0) = Bar
BarList = TempBarList
Else
Return False
End If
' disabilito interfaccia
Map.refProjectVM.SetCalcRunning(True)
Select Case Map.refProjectVM.BTLStructureVM.SelBTLPart.nGlobalState
Case Core.CalcStates.OK, CalcStates.INFO
Bar.nCmdType = CalcIntegration.CmdTypes.GENERATE
Case Else
If Map.refProjectVM.BTLStructureVM.SelBTLPart.nGlobalState = CalcStates.NOTCALCULATED OrElse Map.refProjectVM.BTLStructureVM.SelBTLPart.nFeaturesGlobalState > CalcStates.INFO Then
Dim sBTLPartFilePath As String = ProjectManagerVM.CurrProj.sProjDirPath & "\" & Map.refProjectVM.BTLStructureVM.SelBTLPart.nPDN.ToString() & ".ori.bwe"
If File.Exists(sBTLPartFilePath) Then File.Delete(sBTLPartFilePath)
End If
'Bar.nCmdType = CalcIntegration.CmdTypes.CHECKGEN
Bar.nCmdType = CalcIntegration.CmdTypes.CHECKNOSIM
End Select
TempBarList(0) = Bar
BarList = TempBarList
Else
Return False
End If
' disabilito interfaccia
Map.refProjectVM.SetCalcRunning(True)
Return True
End Function
@@ -5,6 +5,7 @@ Imports System.Windows.Threading
Imports EgtBEAMWALL.Core
Imports EgtUILib
Imports EgtWPFLib5
Imports System.IO
Public Class BTLStructureVM
Inherits VMBase
@@ -104,7 +105,7 @@ Public Class BTLStructureVM
' mostro pezzi selezionati
Map.refProjectVM.BTLStructureVM.ShowAll(False)
' se attivata opzione, li assemblo
Map.refProjectVM.BTLStructureVM.ShowBuilding(If(Map.refMainMenuVM.SelPage = Pages.VIEW OrElse Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE, Map.refShowBeamPanelVM.ShowBuilding_IsChecked, False), False)
'Map.refProjectVM.BTLStructureVM.ShowBuilding(If(Map.refMainMenuVM.SelPage = Pages.VIEW OrElse Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE, Map.refShowBeamPanelVM.ShowBuilding_IsChecked, False), False)
End Select
' aggiornamento grafica
Configuration.UpdateGraphics()
@@ -146,9 +147,14 @@ Public Class BTLStructureVM
Configuration.UpdateGraphics()
End Sub
Private m_SelWithoutOpenFeatureList As Boolean
Friend Sub SetSelWithoutOpenFeatureList(bValue As Boolean)
m_SelWithoutOpenFeatureList = bValue
End Sub
Public Sub SelectBTLPart(BtlPart As BTLPartVM)
m_SelBTLPart = BtlPart
m_SelBTLPart.SetIsSettingBtnOpen(False)
'm_SelBTLPart.SetIsSettingBtnOpen(False)
'If Map.refMainMenuVM.SelPage = Pages.VIEW Then
'ElseIf Map.refMainMenuVM.SelPage = Pages.MACHINING Then
' '' resetto gruppo di lavorazione corrente
@@ -205,17 +211,67 @@ Public Class BTLStructureVM
End If
End If
' seleziono la prima feature
If Not IsNothing(BtlPart) AndAlso Not IsNothing(BtlPart.BTLFeatureVMList) AndAlso BtlPart.BTLFeatureVMList.Count > 0 Then SelBTLPart.SelBTLFeatureVM = BtlPart.BTLFeatureVMList(0)
If Not IsNothing(BtlPart) AndAlso Not IsNothing(BtlPart.BTLFeatureVMList) AndAlso BtlPart.BTLFeatureVMList.Count > 0 Then SelBTLPart.SelBTLFeatureVMOnlyGraph = BtlPart.BTLFeatureVMList(0)
' aggiorno stato selezionato tutto
Map.refShowBeamPanelVM.bShowAll = False
'Map.refShowBeamPanelVM.bShowAll = False
Core.ViewPanelVM.BWSetView(If(Core.ViewPanelVM.Type = BWType.BEAM, VT.ISO_SW, VT.TOP), False)
Map.refProjectVM.SetSelManagerTab(ProjectVM.ManagerTab.RAWPARTMANAGER)
EgtZoom(ZM.ALL)
NotifyPropertyChanged(NameOf(SelBTLPart))
If m_SelBTLParts.Count = 1 Then
If Not m_SelWithoutOpenFeatureList AndAlso m_SelBTLParts.Count = 1 Then
BtlPart.SetOpenFeatureList(True)
End If
End Sub
Public Sub ReSelectBTLPart(BtlPart As BTLPartVM)
m_SelBTLPart = BtlPart
If Map.refProjectVM.LastSelGridType = ProjectVM.GridSelTypes.MACHGROUP Then
' resetto gruppo di lavorazione corrente
EgtResetCurrMachGroup()
End If
If Not IsNothing(BtlPart) Then
' gestisco selezione pezzo
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
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)
' trovo ed evidenzio MachGroup e Duplo di questo pezzo
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 la prima feature
If Not IsNothing(BtlPart) AndAlso Not IsNothing(BtlPart.BTLFeatureVMList) AndAlso BtlPart.BTLFeatureVMList.Count > 0 Then SelBTLPart.SelBTLFeatureVMOnlyGraph = BtlPart.BTLFeatureVMList(0)
' aggiorno stato selezionato tutto
'Map.refShowBeamPanelVM.bShowAll = False
Core.ViewPanelVM.BWSetView(If(Core.ViewPanelVM.Type = BWType.BEAM, VT.ISO_SW, VT.TOP), False)
EgtZoom(ZM.ALL)
NotifyPropertyChanged(NameOf(SelBTLPart))
End Sub
Private Sub DeselectBTLPart(BtlPart As BTLPartVM)
' se necessario tolgo solido dal precedentemente selezionato
Configuration.DeselectSolid(BtlPart.nPartId, True)
@@ -227,10 +283,10 @@ Public Class BTLStructureVM
End If
' disabilito eventuale feature selezionata
If Not IsNothing(BtlPart.m_SelBTLFeatureVM) Then
BtlPart.SelBTLFeatureVM = Nothing
BtlPart.SelBTLFeatureVMOnlyGraph = Nothing
End If
EgtDraw()
If m_SelBTLParts.Count = 1 Then
If Not m_SelWithoutOpenFeatureList AndAlso m_SelBTLParts.Count = 1 Then
m_SelBTLParts(0).SetOpenFeatureList(True)
End If
If BtlPart.bOpenFeatureList Then
@@ -306,7 +362,7 @@ Public Class BTLStructureVM
' ' disabilito eventuale feature selezionata
' If Not IsNothing(m_SelBTLPart.m_SelBTLFeatureVM) Then m_SelBTLPart.SelBTLFeatureVM = Nothing
'End If
'm_SelBTLPart = value
m_SelBTLPart = value
'' se seleziono un pezzo
'If Not IsNothing(m_SelBTLPart) Then
' If Map.refMainMenuVM.SelPage = Pages.VIEW OrElse Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE Then
@@ -333,7 +389,7 @@ Public Class BTLStructureVM
' EgtZoom(ZM.ALL)
' End If
'End If
'NotifyPropertyChanged(NameOf(SelBTLPart))
NotifyPropertyChanged(NameOf(SelBTLPart))
End Set
End Property
@@ -1080,7 +1136,13 @@ Public Class BTLStructureVM
Friend Sub ShowBuilding(bShow As Boolean, Optional bRedraw As Boolean = True)
' disabilito impostazione modificato
Dim DisableMgr As New DisableModifiedMgr
'ShowAll(False)
'Dim CurrProdPathFile As String = ProjectManagerVM.CurrProd.sProdPath
'If File.Exists(CurrProdPathFile) Then
' EgtOpenFile(CurrProdPathFile)
'Else
' EgtOutLog("File nge mancante")
'End If
Dim bOn As Boolean = EgtBeamGetBuildingIsOn()
If bShow <> bOn Then
EgtBeamShowBuilding(bShow)
@@ -1088,7 +1150,6 @@ Public Class BTLStructureVM
' ripristino precedente impostazione modificato
DisableMgr.ReEnable()
' aggiorno visualizzazione
Core.ViewPanelVM.BWSetView(VT.ISO_SW, False)
EgtZoom(ZM.ALL, bRedraw)
@@ -1312,8 +1373,8 @@ Public Class BTLStructureVM
''' <summary>
''' Execute the Open. This method is invoked by the OpenCommand.
''' </summary>
Friend Sub Data()
Dim BTLDataWnd As New BTLDataWndV(Application.Current.MainWindow, New BTLDataWndVM())
Friend Sub Data(nProjId As Integer)
Dim BTLDataWnd As New BTLDataWndV(Application.Current.MainWindow, New BTLDataWndVM(nProjId))
BTLDataWnd.ShowDialog()
End Sub
@@ -466,7 +466,7 @@ Public Class CALCPanelVM
CurrPartVM.CalcPartUpdate(Line.nERR, Line.dROT, Line.sMSG)
End If
Case ProcessResult.ProcessResultTypes.TASKID
CurrBTLFeatureVM.CalcFeatureUpdate(Line.nERR, Line.dROT, Line.sMSG)
CurrBTLFeatureVM.CalcFeatureUpdate(nProgramPage, Line.nERR, Line.dROT, Line.sMSG)
Case ProcessResult.ProcessResultTypes.FALL
If nProgramPage = ProjectType.PROJ Then
CurrBTLPartVM.CalcFallUpdate(Line.nFALL)
@@ -9,9 +9,11 @@ Imports Ionic.Zip
Public Class ConfigurationPageVM
Inherits VMBase
#Region "FIELDS & PROPERTIES"
Public Enum ConfigSubPages As Integer
GENERAL = 0
QPARAMETERS = 1
STRATEGYMANAGER = 0
GENERAL = 1
MACHINE = 2
PDFEDITOR = 3
End Enum
@@ -26,7 +28,7 @@ Public Class ConfigurationPageVM
m_QParametersModified = False
End Sub
Private m_SelConfigSubPage As ConfigSubPages = ConfigSubPages.GENERAL
Private m_SelConfigSubPage As ConfigSubPages = ConfigSubPages.STRATEGYMANAGER
Public Property SelConfigSubPage As Integer
Get
Return m_SelConfigSubPage
@@ -34,21 +36,27 @@ Public Class ConfigurationPageVM
Set(value As Integer)
m_SelConfigSubPage = value
If m_SelConfigSubPage = ConfigSubPages.GENERAL Then
' Controllo se il file CustomConfig Json è stato modificato
Map.refStrategyManagerVM.SaveCustomConfigJson()
SetGeneral_Visibility(Visibility.Visible)
SetParamaterQ_Visibility(Visibility.Collapsed)
SetStrategyManager_Visibility(Visibility.Collapsed)
SetPDFEditor_Visibility(Visibility.Collapsed)
ElseIf m_SelConfigSubPage = ConfigSubPages.QPARAMETERS Then
SetParamaterQ_Visibility(Visibility.Visible)
ElseIf m_SelConfigSubPage = ConfigSubPages.STRATEGYMANAGER Then
SetStrategyManager_Visibility(Visibility.Visible)
SetGeneral_Visibility(Visibility.Collapsed)
SetPDFEditor_Visibility(Visibility.Collapsed)
ElseIf m_SelConfigSubPage = ConfigSubPages.MACHINE Then
' Controllo se il file CustomConfig Json è stato modificato
Map.refStrategyManagerVM.SaveCustomConfigJson()
SetGeneral_Visibility(Visibility.Collapsed)
SetParamaterQ_Visibility(Visibility.Collapsed)
SetStrategyManager_Visibility(Visibility.Collapsed)
SetPDFEditor_Visibility(Visibility.Collapsed)
ElseIf m_SelConfigSubPage = ConfigSubPages.PDFEDITOR Then
' Controllo se il file CustomConfig Json è stato modificato
Map.refStrategyManagerVM.SaveCustomConfigJson()
SetPDFEditor_Visibility(Visibility.Visible)
SetGeneral_Visibility(Visibility.Collapsed)
SetParamaterQ_Visibility(Visibility.Collapsed)
SetStrategyManager_Visibility(Visibility.Collapsed)
End If
End Set
End Property
@@ -231,7 +239,7 @@ Public Class ConfigurationPageVM
End Set
End Property
Private m_bGeneral_Visibility As Visibility = Visibility.Visible
Private m_bGeneral_Visibility As Visibility = Visibility.Collapsed
Public ReadOnly Property General_Visibility As Visibility
Get
Return m_bGeneral_Visibility
@@ -242,15 +250,15 @@ Public Class ConfigurationPageVM
NotifyPropertyChanged(NameOf(General_Visibility))
End Sub
Private m_bParameterQ_Visibility As Visibility = Visibility.Collapsed
Public ReadOnly Property ParameterQ_Visibility As Visibility
Private m_bStrategyManager_Visibility As Visibility = Visibility.Visible
Public ReadOnly Property StrategyManager_Visibility As Visibility
Get
Return m_bParameterQ_Visibility
Return m_bStrategyManager_Visibility
End Get
End Property
Friend Sub SetParamaterQ_Visibility(value As Visibility)
m_bParameterQ_Visibility = value
NotifyPropertyChanged(NameOf(ParameterQ_Visibility))
Friend Sub SetStrategyManager_Visibility(value As Visibility)
m_bStrategyManager_Visibility = value
NotifyPropertyChanged(NameOf(StrategyManager_Visibility))
End Sub
Private m_bMachine_Visibility As Visibility = Visibility.Collapsed
@@ -514,9 +522,9 @@ Public Class ConfigurationPageVM
End Get
End Property
Public ReadOnly Property ParameterQ_Msg As String
Public ReadOnly Property Strategy_Msg As String
Get
Return EgtMsg(62536).ToUpper()
Return EgtMsg(62569).ToUpper()
End Get
End Property
@@ -584,6 +592,8 @@ Public Class ConfigurationPageVM
#End Region ' Messages
#End Region ' Fields & Properties
#Region "Constructor"
Sub New()
@@ -652,6 +662,265 @@ Public Class ConfigurationPageVM
#End Region ' Constructor
#Region "METHODS"
' funzione che scrive i parametri modificati sul file INI
Public Sub WriteMachParams()
If String.IsNullOrWhiteSpace(CurrentMachine.sMachParamIniFile) OrElse Not File.Exists(CurrentMachine.sMachParamIniFile) Then
EgtOutLog("Impossible loading Mach parameters: MachData.ini file not found or not readable")
Return
End If
For Each MachTableItem In ConfigMachTableList
For Each MachParamItem In MachTableItem.MachParamList
If MachParamItem.IsModified Then
Dim sMachParamType As String = String.Empty
Select Case MachParamItem.nType
Case MachParamType.DOUBLE_
sMachParamType = "d"
Case MachParamType.STRING_
sMachParamType = "s"
Case MachParamType.LENGTH
sMachParamType = "l"
End Select
Dim MachParamString As String = sMachParamType & "," & MachParamItem.sName & "," & MachParamItem.sValue & "," & MachParamItem.sDescription
Dim bOk = WriteMachPrivateProfileString(MachParamItem.nParentTable, MachParamItem.nParamIndex, MachParamString)
If Not bOk Then
MessageBox.Show(EgtMsg(61859), EgtMsg(30007))
Return
End If
MachParamItem.IsModifiedReset()
End If
Next
Next
' se macchina di tipo BOTH copio il file appena scritto nella cartella Beam nella cartella Wall o viceversa
If CurrentMachine.nType = MachineType.BOTH Then
If CurrentMachine.sMachParamIniFile.Contains("\" & K_BEAM & "\") Then
File.Copy(CurrentMachine.sMachParamIniFile, CurrentMachine.sMachParamIniFile.Replace("\" & K_BEAM & "\", "\" & K_WALL & "\"), True)
Else
File.Copy(CurrentMachine.sMachParamIniFile, CurrentMachine.sMachParamIniFile.Replace("\" & K_WALL & "\", "\" & K_BEAM & "\"), True)
End If
End If
End Sub
' funzione che scrive i parametri modificati sul file LUA
Private Function WriteMachParamsLua() As Boolean
If String.IsNullOrWhiteSpace(CurrentMachine.sMachParamIniFile) OrElse Not File.Exists(CurrentMachine.sMachParamIniFile) Then
EgtOutLog("Impossible loading Mach parameters: MachData.ini file not found or not readable")
Return False
End If
' inizio routine di scrittura
Dim NewTs3DataFileContent = New List(Of String)
Dim sMachineStr As String = String.Empty
For Each MachTableItem In ConfigMachTableList
NewTs3DataFileContent.Add("local " & MachTableItem.sName & " = {")
sMachineStr &= " " & MachTableItem.sName & "=" & MachTableItem.sName & ","
For Each MachParamItem In MachTableItem.MachParamList
NewTs3DataFileContent.Add(" " & MachParamItem.sName & "=" & MachParamItem.sValue & ",")
Next
NewTs3DataFileContent.Last().TrimEnd(",")
NewTs3DataFileContent.Add("}")
NewTs3DataFileContent.Add("")
Next
NewTs3DataFileContent.Add("local Machine = {" & sMachineStr.TrimEnd(",") & "}")
NewTs3DataFileContent.Add("return Machine")
Dim FilePath As String
If Map.refMainWindowVM.MainWindowM.bMachConfig Then
FilePath = CurrentMachine.sMachDir & "\" & If(CurrentMachine.nType = MachineType.BEAM, BEAM_DIR, WALL_DIR) & "\" & EBWDATA_FILE
Else
FilePath = CurrentMachine.sMachDir & "\" & If(CurrentMachine.nType = MachineType.BEAM, BEAM_DIR, WALL_DIR) & "\" & TS3DATA_FILE
End If
Dim sBakFilePath As String = Path.ChangeExtension(FilePath, ".bak")
If File.Exists(sBakFilePath) Then File.Delete(sBakFilePath)
If File.Exists(FilePath) Then File.Move(FilePath, sBakFilePath)
File.WriteAllLines(FilePath, NewTs3DataFileContent, Text.Encoding.UTF8)
' se macchina di tipo BOTH copio il file appena scritto nella cartella Wall nella cartella Beam
If CurrentMachine.nType = MachineType.BOTH Then
Dim DestinationFilePath As String
If Map.refMainWindowVM.MainWindowM.bMachConfig Then
DestinationFilePath = CurrentMachine.sMachDir & "\" & BEAM_DIR & "\" & EBWDATA_FILE
Else
DestinationFilePath = CurrentMachine.sMachDir & "\" & BEAM_DIR & "\" & TS3DATA_FILE
End If
sBakFilePath = Path.ChangeExtension(DestinationFilePath, ".bak")
If File.Exists(sBakFilePath) Then File.Delete(sBakFilePath)
File.Move(DestinationFilePath, Path.ChangeExtension(DestinationFilePath, ".bak"))
File.Copy(FilePath, DestinationFilePath, True)
End If
Return True
End Function
' funzione che verifica la modifica dei valori in Configurazione e ne chiede il salvataggio
Friend Sub VerifyConfigPageModification()
Dim bExitFor = False
Select Case m_SelConfigSubPage
'Case ConfigSubPages.STRATEGYMANAGER
' Map.refStrategyManagerVM.CreateCustumerConfigJsonFile()
Case ConfigSubPages.GENERAL
' aggiorno tutti i valori senza verificare modifiche
WriteMainPrivateProfileString(S_GENERAL, K_MESSAGES, m_SelectedLanguage.Name)
WriteMainPrivateProfileString(S_SCENE, K_MMUNITS, SelMeasureUnit.ToString())
WriteMainPrivateProfileString(S_NEST, K_SECTIONTIME, DoubleToString(m_SectionTime, 5))
WriteMainPrivateProfileString(S_NEST, K_PARTTIME, DoubleToString(m_PartTime, 5))
WriteMainPrivateProfileString(S_PRINTER, K_ENABLE, If(m_bPrintLabel_IsChecked, 1, 0))
'Case ConfigSubPages.QPARAMETERS
' ' ciclo sui parametri Q
' Dim bAskToSaveDefaultValues As Boolean = False
' For Each PRCItem In PRCList
' For Each QParam In PRCItem.QBTLParamVMList
' If QParam.bIsModified Then
' bAskToSaveDefaultValues = True
' ' esco dai For
' bExitFor = True
' Exit For
' End If
' Next
' If bExitFor Then Exit For
' Next
' ' se nel ciclo è stato trovato almeno un valore modificato chiedo il salvataggio
' If bAskToSaveDefaultValues Then
' If MessageBox.Show(EgtMsg(61861), "", MessageBoxButton.YesNo, MessageBoxImage.Question) = MessageBoxResult.Yes Then
' ' se si è scelto di salvare i valori li scrivo
' WriteProcessParams(PRCList.ToList())
' m_QParametersModified = True
' End If
' ' in ogni caso ricarico i valori (in modo da resettare i flag di modifica)
' 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))
' End If
Case ConfigSubPages.MACHINE
' ciclo sui parametri Macchina
For Each MachTableItem In ConfigMachTableList
For Each MachParamItem In MachTableItem.MachParamList
If MachParamItem.IsModified Then
If MessageBox.Show(EgtMsg(61860), "", MessageBoxButton.YesNo, MessageBoxImage.Question) = MessageBoxResult.Yes Then
' scrivo i parametri Macchina
WriteMachParams()
WriteMachParamsLua()
Else
' se da non salvare li resetto ed esco dai For
CreateMachParams()
bExitFor = True
Exit For
End If
End If
Next
If bExitFor Then Exit For
Next
End Select
End Sub
' funzione che verifica l'inserimento della password quando si edita un parametro Macchina
Friend Function VerifyConfigPagePassword() As Boolean
' Display message, title, and default value.
Dim InputPwdWndVM As New InputPwdWndVM()
Dim InputPwdWnd As New OnlyProdInputPwdWndV(Application.Current.MainWindow, InputPwdWndVM)
If InputPwdWnd.ShowDialog() Then
' Lettura PWD dall'INI e confronto
Dim sPwdIni As String = String.Empty
If GetMainPrivateProfileString(S_MACH, K_PASSWORD, "", sPwdIni) <> 0 Then
If sPwdIni = InputPwdWndVM.sPassword Then Return True
End If
End If
Return False
End Function
Public Sub GetQParamsList()
m_PRCList.Clear()
' carico lista process
Dim TempPRCList As New ObservableCollection(Of Integer)
' prima cerco i process L (GRPType = 0)
Dim GRPType As Integer = 0
GetBeamPrivateProfileProcessList(GRPType, TempPRCList)
For Each PRC In TempPRCList
' leggo gruppi
Dim GRPList As New ObservableCollection(Of Integer)
GetBeamPrivateProfileGRPList(GRPType, PRC, GRPList)
m_PRCList.Add(New PRC(If(GRPList.Count > 0, GRPList(0), GRPType), PRC, GetBeamPrivateProfileName(GRPType, PRC), CreateProcessParams(GRPType, PRC, False)))
Next
' ora cerco i process T (GRPType = 1)
GRPType = 1
GetBeamPrivateProfileProcessList(GRPType, TempPRCList)
For Each PRC In TempPRCList
' leggo gruppi
Dim GRPList As New ObservableCollection(Of Integer)
GetBeamPrivateProfileGRPList(GRPType, PRC, GRPList)
m_PRCList.Add(New PRC(If(GRPList.Count > 0, GRPList(0), GRPType), PRC, GetBeamPrivateProfileName(GRPType, PRC), CreateProcessParams(GRPType, PRC, False)))
Next
End Sub
' funzione che crea l'elenco dei parametri P o Q di un Process
Public Function CreateProcessParams(GRPType As Integer, PRC As Integer, IsP As Boolean)
Dim ParamIndex As Integer = 1
Dim TempList As New List(Of QBTLParamVM)
Dim NewBTLParam As BTLParamM = Nothing
' leggo tutti i parametri P o Q del Process
ParamIndex = 1
TempList = New List(Of QBTLParamVM)
If IsP Then
While BTLIniFile.GetBeamPrivateProfileParam(GRPType, PRC, 0, IsP, ParamIndex, Nothing, NewBTLParam)
TempList.Add(New QBTLParamVM(NewBTLParam, GRPType, PRC))
ParamIndex += 1
End While
Else
If CurrentMachine.nType = MachineType.BOTH Then
' se macchina di tipo BOTH carico i Q di tipo BEAM e poi di tipo WALL
While BTLIniFile.GetBeamPrivateProfileParam(GRPType, PRC, IsP, ParamIndex, Nothing, NewBTLParam, MachineType.BEAM)
TempList.Add(New QBTLParamVM(NewBTLParam, GRPType, PRC))
ParamIndex += 1
End While
ParamIndex = 1
While BTLIniFile.GetBeamPrivateProfileParam(GRPType, PRC, IsP, ParamIndex, Nothing, NewBTLParam, MachineType.WALL)
TempList.Add(New QBTLParamVM(NewBTLParam, GRPType, PRC))
ParamIndex += 1
End While
Else
' altrimenti carico solo quelli corrispondenti al tipo della macchina selezionata
While BTLIniFile.GetBeamPrivateProfileParam(GRPType, PRC, IsP, ParamIndex, Nothing, NewBTLParam, CurrentMachine.nType)
TempList.Add(New QBTLParamVM(NewBTLParam, GRPType, PRC))
ParamIndex += 1
End While
End If
End If
Return TempList
End Function
' funzione che scrive l'elenco dei parametri P o Q di un Process
Public Sub WriteProcessParams(PRCList As List(Of PRC))
For Each PRCItem In PRCList
Dim nPRCParamIndex As Integer = 1
Dim sPrevType As String = String.Empty
For Each PRCParam In PRCItem.QBTLParamVMList
If PRCParam.bIsModified Then
' costruisco la stringa da scrivere nel parametro
Dim sType As String = ""
If PRCParam.nType = 1 Then
sType = "d"
ElseIf PRCParam.nType = 4 Then
sType = "l"
End If
If sPrevType <> PRCParam.sBWType Then nPRCParamIndex = 1
Dim sPRCParam As String = sType & "," & If(PRCParam.bIsP, "P", "Q") & PRCParam.nId.ToString("D2") & "," & PRCParam.sMin & "," & PRCParam.sMax & "," & PRCParam.sDefault & "," & PRCParam.sDescription
WritePrivateProfileString(CalcBeamPrivateProfileGRP(PRCItem.nGRP) & "." & PRCItem.nPRC, If(PRCParam.bIsP, "P", "Q" & PRCParam.sBWType) & nPRCParamIndex, sPRCParam, m_sBTLIniFile)
' resetto il flag per il valore modificato
PRCParam.bIsModified = False
End If
sPrevType = PRCParam.sBWType
nPRCParamIndex += 1
Next
Next
End Sub
#End Region ' Methods
#Region "COMMANDS"
#Region "SaveCommand"
@@ -902,9 +1171,16 @@ Public Class ConfigurationPageVM
Dim sDayDir As String = sMonthDir & "\" & nDay
Dim VersionList() As String = Directory.GetFiles(sDayDir)
If VersionList.Length > 0 Then
Dim nMaxVersion As Int64 = VersionList.Max(Function(x) Int64.Parse(Path.GetFileNameWithoutExtension(x)))
sRestorePath = sDayDir & "\" & nMaxVersion & ".bwbck"
Exit For
Dim nMaxVersion As Int64 = 0
For Each item As String In VersionList
Dim nTmp As Int64 = 0
Int64.TryParse(Path.GetFileNameWithoutExtension(item), nTmp)
nMaxVersion = Math.Max(nMaxVersion, nTmp)
Next
If nMaxVersion > 0 Then
sRestorePath = sDayDir & "\" & nMaxVersion & ".bwbck"
Exit For
End If
End If
Next
If Not String.IsNullOrEmpty(sRestorePath) Then Exit For
@@ -914,6 +1190,8 @@ Public Class ConfigurationPageVM
End If
If String.IsNullOrEmpty(sRestorePath) Then
MessageBox.Show(EgtMsg(62106), EgtMsg(15001), MessageBoxButton.OK, MessageBoxImage.Error) ' Restore impossible! Last backup not found!
m_bRestoreRunning = False
Return
End If
If MessageBox.Show(String.Format(EgtMsg(62107), nYear, nMonth, nDay), EgtMsg(15002), MessageBoxButton.OKCancel, MessageBoxImage.Warning) <> MessageBoxResult.OK Then 'Are you sure you want to restore the last backup from {0}\{1}\{2}? If you proceed you will lose actual data!
m_bRestoreRunning = False
@@ -1055,265 +1333,7 @@ Public Class ConfigurationPageVM
'#End Region ' ReleaseCommand
#End Region ' COMMANDS
#Region "Methods"
' funzione che scrive i parametri modificati sul file INI
Public Sub WriteMachParams()
If String.IsNullOrWhiteSpace(CurrentMachine.sMachParamIniFile) OrElse Not File.Exists(CurrentMachine.sMachParamIniFile) Then
EgtOutLog("Impossible loading Mach parameters: MachData.ini file not found or not readable")
Return
End If
For Each MachTableItem In ConfigMachTableList
For Each MachParamItem In MachTableItem.MachParamList
If MachParamItem.IsModified Then
Dim sMachParamType As String = String.Empty
Select Case MachParamItem.nType
Case MachParamType.DOUBLE_
sMachParamType = "d"
Case MachParamType.STRING_
sMachParamType = "s"
Case MachParamType.LENGTH
sMachParamType = "l"
End Select
Dim MachParamString As String = sMachParamType & "," & MachParamItem.sName & "," & MachParamItem.sValue & "," & MachParamItem.sDescription
Dim bOk = WriteMachPrivateProfileString(MachParamItem.nParentTable, MachParamItem.nParamIndex, MachParamString)
If Not bOk Then
MessageBox.Show(EgtMsg(61859), EgtMsg(30007))
Return
End If
MachParamItem.IsModifiedReset()
End If
Next
Next
' se macchina di tipo BOTH copio il file appena scritto nella cartella Beam nella cartella Wall o viceversa
If CurrentMachine.nType = MachineType.BOTH Then
If CurrentMachine.sMachParamIniFile.Contains("\" & K_BEAM & "\") Then
File.Copy(CurrentMachine.sMachParamIniFile, CurrentMachine.sMachParamIniFile.Replace("\" & K_BEAM & "\", "\" & K_WALL & "\"), True)
Else
File.Copy(CurrentMachine.sMachParamIniFile, CurrentMachine.sMachParamIniFile.Replace("\" & K_WALL & "\", "\" & K_BEAM & "\"), True)
End If
End If
End Sub
' funzione che scrive i parametri modificati sul file LUA
Private Function WriteMachParamsLua() As Boolean
If String.IsNullOrWhiteSpace(CurrentMachine.sMachParamIniFile) OrElse Not File.Exists(CurrentMachine.sMachParamIniFile) Then
EgtOutLog("Impossible loading Mach parameters: MachData.ini file not found or not readable")
Return False
End If
' inizio routine di scrittura
Dim NewTs3DataFileContent = New List(Of String)
Dim sMachineStr As String = String.Empty
For Each MachTableItem In ConfigMachTableList
NewTs3DataFileContent.Add("local " & MachTableItem.sName & " = {")
sMachineStr &= " " & MachTableItem.sName & "=" & MachTableItem.sName & ","
For Each MachParamItem In MachTableItem.MachParamList
NewTs3DataFileContent.Add(" " & MachParamItem.sName & "=" & MachParamItem.sValue & ",")
Next
NewTs3DataFileContent.Last().TrimEnd(",")
NewTs3DataFileContent.Add("}")
NewTs3DataFileContent.Add("")
Next
NewTs3DataFileContent.Add("local Machine = {" & sMachineStr.TrimEnd(",") & "}")
NewTs3DataFileContent.Add("return Machine")
Dim FilePath As String
If Map.refMainWindowVM.MainWindowM.bMachConfig Then
FilePath = CurrentMachine.sMachDir & "\" & If(CurrentMachine.nType = MachineType.BEAM, BEAM_DIR, WALL_DIR) & "\" & EBWDATA_FILE
Else
FilePath = CurrentMachine.sMachDir & "\" & If(CurrentMachine.nType = MachineType.BEAM, BEAM_DIR, WALL_DIR) & "\" & TS3DATA_FILE
End If
Dim sBakFilePath As String = Path.ChangeExtension(FilePath, ".bak")
If File.Exists(sBakFilePath) Then File.Delete(sBakFilePath)
If File.Exists(FilePath) Then File.Move(FilePath, sBakFilePath)
File.WriteAllLines(FilePath, NewTs3DataFileContent, Text.Encoding.UTF8)
' se macchina di tipo BOTH copio il file appena scritto nella cartella Wall nella cartella Beam
If CurrentMachine.nType = MachineType.BOTH Then
Dim DestinationFilePath As String
If Map.refMainWindowVM.MainWindowM.bMachConfig Then
DestinationFilePath = CurrentMachine.sMachDir & "\" & BEAM_DIR & "\" & EBWDATA_FILE
Else
DestinationFilePath = CurrentMachine.sMachDir & "\" & BEAM_DIR & "\" & TS3DATA_FILE
End If
sBakFilePath = Path.ChangeExtension(DestinationFilePath, ".bak")
If File.Exists(sBakFilePath) Then File.Delete(sBakFilePath)
File.Move(DestinationFilePath, Path.ChangeExtension(DestinationFilePath, ".bak"))
File.Copy(FilePath, DestinationFilePath, True)
End If
Return True
End Function
' funzione che verifica la modifica dei valori in Configurazione e ne chiede il salvataggio
Friend Sub VerifyConfigPageModification()
Dim bExitFor = False
Select Case m_SelConfigSubPage
Case ConfigSubPages.GENERAL
' aggiorno tutti i valori senza verificare modifiche
WriteMainPrivateProfileString(S_GENERAL, K_MESSAGES, m_SelectedLanguage.Name)
WriteMainPrivateProfileString(S_SCENE, K_MMUNITS, SelMeasureUnit.ToString())
WriteMainPrivateProfileString(S_NEST, K_SECTIONTIME, DoubleToString(m_SectionTime, 5))
WriteMainPrivateProfileString(S_NEST, K_PARTTIME, DoubleToString(m_PartTime, 5))
WriteMainPrivateProfileString(S_PRINTER, K_ENABLE, If(m_bPrintLabel_IsChecked, 1, 0))
Case ConfigSubPages.QPARAMETERS
' ciclo sui parametri Q
Dim bAskToSaveDefaultValues As Boolean = False
For Each PRCItem In PRCList
For Each QParam In PRCItem.QBTLParamVMList
If QParam.bIsModified Then
bAskToSaveDefaultValues = True
' esco dai For
bExitFor = True
Exit For
End If
Next
If bExitFor Then Exit For
Next
' se nel ciclo è stato trovato almeno un valore modificato chiedo il salvataggio
If bAskToSaveDefaultValues Then
If MessageBox.Show(EgtMsg(61861), "", MessageBoxButton.YesNo, MessageBoxImage.Question) = MessageBoxResult.Yes Then
' se si è scelto di salvare i valori li scrivo
WriteProcessParams(PRCList.ToList())
m_QParametersModified = True
End If
' in ogni caso ricarico i valori (in modo da resettare i flag di modifica)
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))
End If
Case ConfigSubPages.MACHINE
' ciclo sui parametri Macchina
For Each MachTableItem In ConfigMachTableList
For Each MachParamItem In MachTableItem.MachParamList
If MachParamItem.IsModified Then
If MessageBox.Show(EgtMsg(61860), "", MessageBoxButton.YesNo, MessageBoxImage.Question) = MessageBoxResult.Yes Then
' scrivo i parametri Macchina
WriteMachParams()
WriteMachParamsLua()
Else
' se da non salvare li resetto ed esco dai For
CreateMachParams()
bExitFor = True
Exit For
End If
End If
Next
If bExitFor Then Exit For
Next
End Select
End Sub
' funzione che verifica l'inserimento della password quando si edita un parametro Macchina
Friend Function VerifyConfigPagePassword() As Boolean
' Display message, title, and default value.
Dim InputPwdWndVM As New InputPwdWndVM()
Dim InputPwdWnd As New OnlyProdInputPwdWndV(Application.Current.MainWindow, InputPwdWndVM)
If InputPwdWnd.ShowDialog() Then
' Lettura PWD dall'INI e confronto
Dim sPwdIni As String = String.Empty
If GetMainPrivateProfileString(S_MACH, K_PASSWORD, "", sPwdIni) <> 0 Then
If sPwdIni = InputPwdWndVM.sPassword Then Return True
End If
End If
Return False
End Function
Public Sub GetQParamsList()
m_PRCList.Clear()
' carico lista process
Dim TempPRCList As New ObservableCollection(Of Integer)
' prima cerco i process L (GRPType = 0)
Dim GRPType As Integer = 0
GetBeamPrivateProfileProcessList(GRPType, TempPRCList)
For Each PRC In TempPRCList
' leggo gruppi
Dim GRPList As New ObservableCollection(Of Integer)
GetBeamPrivateProfileGRPList(GRPType, PRC, GRPList)
m_PRCList.Add(New PRC(If(GRPList.Count > 0, GRPList(0), GRPType), PRC, GetBeamPrivateProfileName(GRPType, PRC), CreateProcessParams(GRPType, PRC, False)))
Next
' ora cerco i process T (GRPType = 1)
GRPType = 1
GetBeamPrivateProfileProcessList(GRPType, TempPRCList)
For Each PRC In TempPRCList
' leggo gruppi
Dim GRPList As New ObservableCollection(Of Integer)
GetBeamPrivateProfileGRPList(GRPType, PRC, GRPList)
m_PRCList.Add(New PRC(If(GRPList.Count > 0, GRPList(0), GRPType), PRC, GetBeamPrivateProfileName(GRPType, PRC), CreateProcessParams(GRPType, PRC, False)))
Next
End Sub
' funzione che crea l'elenco dei parametri P o Q di un Process
Public Function CreateProcessParams(GRPType As Integer, PRC As Integer, IsP As Boolean)
Dim ParamIndex As Integer = 1
Dim TempList As New List(Of QBTLParamVM)
Dim NewBTLParam As BTLParamM = Nothing
' leggo tutti i parametri P o Q del Process
ParamIndex = 1
TempList = New List(Of QBTLParamVM)
If IsP Then
While BTLIniFile.GetBeamPrivateProfileParam(GRPType, PRC, 0, IsP, ParamIndex, Nothing, NewBTLParam)
TempList.Add(New QBTLParamVM(NewBTLParam, GRPType, PRC))
ParamIndex += 1
End While
Else
If CurrentMachine.nType = MachineType.BOTH Then
' se macchina di tipo BOTH carico i Q di tipo BEAM e poi di tipo WALL
While BTLIniFile.GetBeamPrivateProfileParam(GRPType, PRC, IsP, ParamIndex, Nothing, NewBTLParam, MachineType.BEAM)
TempList.Add(New QBTLParamVM(NewBTLParam, GRPType, PRC))
ParamIndex += 1
End While
ParamIndex = 1
While BTLIniFile.GetBeamPrivateProfileParam(GRPType, PRC, IsP, ParamIndex, Nothing, NewBTLParam, MachineType.WALL)
TempList.Add(New QBTLParamVM(NewBTLParam, GRPType, PRC))
ParamIndex += 1
End While
Else
' altrimenti carico solo quelli corrispondenti al tipo della macchina selezionata
While BTLIniFile.GetBeamPrivateProfileParam(GRPType, PRC, IsP, ParamIndex, Nothing, NewBTLParam, CurrentMachine.nType)
TempList.Add(New QBTLParamVM(NewBTLParam, GRPType, PRC))
ParamIndex += 1
End While
End If
End If
Return TempList
End Function
' funzione che scrive l'elenco dei parametri P o Q di un Process
Public Sub WriteProcessParams(PRCList As List(Of PRC))
For Each PRCItem In PRCList
Dim nPRCParamIndex As Integer = 1
Dim sPrevType As String = String.Empty
For Each PRCParam In PRCItem.QBTLParamVMList
If PRCParam.bIsModified Then
' costruisco la stringa da scrivere nel parametro
Dim sType As String = ""
If PRCParam.nType = 1 Then
sType = "d"
ElseIf PRCParam.nType = 4 Then
sType = "l"
End If
If sPrevType <> PRCParam.sBWType Then nPRCParamIndex = 1
Dim sPRCParam As String = sType & "," & If(PRCParam.bIsP, "P", "Q") & PRCParam.nId.ToString("D2") & "," & PRCParam.sMin & "," & PRCParam.sMax & "," & PRCParam.sDefault & "," & PRCParam.sDescription
WritePrivateProfileString(CalcBeamPrivateProfileGRP(PRCItem.nGRP) & "." & PRCItem.nPRC, If(PRCParam.bIsP, "P", "Q" & PRCParam.sBWType) & nPRCParamIndex, sPRCParam, m_sBTLIniFile)
' resetto il flag per il valore modificato
PRCParam.bIsModified = False
End If
sPrevType = PRCParam.sBWType
nPRCParamIndex += 1
Next
Next
End Sub
#End Region ' Methods
#End Region ' Commands
End Class
@@ -17,6 +17,23 @@
<TabControl Grid.Row="0" Grid.Column="0" Grid.RowSpan="2" Grid.ColumnSpan="2"
SelectedIndex="{Binding SelConfigSubPage}"
Style="{StaticResource OnlyProd_TabControl}">
<TabItem>
<TabItem.Header>
<StackPanel Orientation="Horizontal" Margin="5">
<TextBlock Text="{Binding Strategy_Msg}"
FontSize="15"/>
<!--<Button Command="{Binding SaveCommand}"
ToolTip="{Binding SaveToolTip}"
Visibility="{Binding StrategyManager_Visibility}"
Style="{StaticResource SaveOptionPanel_Button}">
<Image Source="/Resources/ProjectManager/Save.png" Stretch="Uniform"/>
</Button>-->
</StackPanel>
</TabItem.Header>
<TabItem.Content>
<EgtBEAMWALL:StrategyManagerV DataContext="{StaticResource StrategyManagerVM}"/>
</TabItem.Content>
</TabItem>
<TabItem>
<TabItem.Header>
<StackPanel Orientation="Horizontal" Margin="5">
@@ -14,6 +14,21 @@
<Deterministic>true</Deterministic>
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
<PublishUrl>publish\</PublishUrl>
<Install>true</Install>
<InstallFrom>Disk</InstallFrom>
<UpdateEnabled>false</UpdateEnabled>
<UpdateMode>Foreground</UpdateMode>
<UpdateInterval>7</UpdateInterval>
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
<UpdatePeriodically>false</UpdatePeriodically>
<UpdateRequired>false</UpdateRequired>
<MapFileExtensions>true</MapFileExtensions>
<ApplicationRevision>0</ApplicationRevision>
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
<IsWebBootstrapper>false</IsWebBootstrapper>
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
</PropertyGroup>
<PropertyGroup>
<OptionExplicit>On</OptionExplicit>
@@ -48,6 +63,9 @@
<PlatformTarget>x86</PlatformTarget>
<Prefer32Bit>true</Prefer32Bit>
</PropertyGroup>
<PropertyGroup>
<ApplicationIcon>Resources\EgtBEAMWALL.ico</ApplicationIcon>
</PropertyGroup>
<ItemGroup>
<Reference Include="EgtBEAMWALL.Core">
<HintPath>..\EgtBEAMWALL.Core\bin\Debug\EgtBEAMWALL.Core.dll</HintPath>
@@ -85,9 +103,6 @@
<Reference Include="System.Xaml">
<RequiredTargetFramework>4.0</RequiredTargetFramework>
</Reference>
<Reference Include="Windows">
<HintPath>..\..\..\Program Files (x86)\Windows Kits\10\UnionMetadata\10.0.22000.0\Windows.winmd</HintPath>
</Reference>
<Reference Include="WindowsBase" />
<Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" />
@@ -122,6 +137,14 @@
<DependentUpon>Application.xaml</DependentUpon>
<SubType>Code</SubType>
</Compile>
<Compile Include="ForcedStrategyBTL\ForcedStrategyBTLV.xaml.vb">
<DependentUpon>ForcedStrategyBTLV.xaml</DependentUpon>
</Compile>
<Compile Include="ForcedStrategyBTL\ForcedStrategyBTLVM.vb" />
<Compile Include="ForcedStrategyPanel\ForcedStrategyPanelV.xaml.vb">
<DependentUpon>ForcedStrategyPanelV.xaml</DependentUpon>
</Compile>
<Compile Include="ForcedStrategyPanel\ForcedStrategyPanelVM.vb" />
<Compile Include="NestingRunningWnd\NestingRunningWndVM.vb" />
<Compile Include="NestingRunningWnd\OnlyProdNestingRunningWndV.xaml.vb">
<DependentUpon>OnlyProdNestingRunningWndV.xaml</DependentUpon>
@@ -167,10 +190,17 @@
<Compile Include="RawPartManager\RawPartManagerWndV.xaml.vb">
<DependentUpon>RawPartManagerWndV.xaml</DependentUpon>
</Compile>
<Compile Include="SaveAsStrategyWnd\SaveAsStrategyV.xaml.vb">
<DependentUpon>SaveAsStrategyV.xaml</DependentUpon>
</Compile>
<Compile Include="SaveAsStrategyWnd\SaveAsStrategyVM.vb" />
<Compile Include="SceneHost\MySceneHostVM.vb" />
<Compile Include="SceneHost\SceneHostV.xaml.vb">
<DependentUpon>SceneHostV.xaml</DependentUpon>
</Compile>
<Compile Include="SceneShowBulding\SceneShowBuldingV.xaml.vb">
<DependentUpon>SceneShowBuldingV.xaml</DependentUpon>
</Compile>
<Compile Include="SetUp\SetUpSupportClass.vb" />
<Compile Include="SetUp\SetUpV.xaml.vb">
<DependentUpon>SetUpV.xaml</DependentUpon>
@@ -211,6 +241,21 @@
<Compile Include="StatusBar\StatusBarV.xaml.vb">
<DependentUpon>StatusBarV.xaml</DependentUpon>
</Compile>
<Compile Include="StrategyManager\JsonAvailableStrategyHelper.vb" />
<Compile Include="StrategyManager\JsonStrategyHelper.vb" />
<Compile Include="StrategyManager\ParameterStrategyV.xaml.vb">
<DependentUpon>ParameterStrategyV.xaml</DependentUpon>
</Compile>
<Compile Include="StrategyManager\StrategyManagerV.xaml.vb">
<DependentUpon>StrategyManagerV.xaml</DependentUpon>
</Compile>
<Compile Include="StrategyManager\StrategyManagerVM.vb" />
<Compile Include="StrategyManager\StrategyProductionV.xaml.vb">
<DependentUpon>StrategyProductionV.xaml</DependentUpon>
</Compile>
<Compile Include="StrategyManager\StrategyV.xaml.vb">
<DependentUpon>StrategyV.xaml</DependentUpon>
</Compile>
<Compile Include="SupervisorCommThread\SupervisorComm.vb" />
<Compile Include="SupervisorCommThread\SupervisorCommThread.vb" />
<Compile Include="ToolsDbWindow\MyToolDbWindowVM.vb" />
@@ -239,10 +284,12 @@
<Compile Include="Utility\LuaExec.vb" />
<Compile Include="Utility\MachParamIniFile.vb" />
<Compile Include="Utility\Map.vb" />
<Compile Include="Utility\MapV.vb" />
<Compile Include="Utility\PartsObservableCollection.vb" />
<Compile Include="Utility\SectionXMaterialToBeAdded.vb" />
<Compile Include="Utility\Statistic_Messages.vb" />
<Compile Include="Utility\TextBlockUtils.vb" />
<Compile Include="Utility\TreeHelperManager.vb" />
<Compile Include="Utility\TreeViewItemBase.vb" />
<Compile Include="ViewPanel\OnlyProdViewPanelV.xaml.vb">
<DependentUpon>OnlyProdViewPanelV.xaml</DependentUpon>
@@ -499,6 +546,14 @@
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="ForcedStrategyBTL\ForcedStrategyBTLV.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="ForcedStrategyPanel\ForcedStrategyPanelV.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="FreeContourInput\OnlyProdFreeContourInputV.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
@@ -627,10 +682,18 @@
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="SaveAsStrategyWnd\SaveAsStrategyV.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="SceneHost\SceneHostV.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="SceneShowBulding\SceneShowBuldingV.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="SetUp\SetUpV.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
@@ -671,6 +734,22 @@
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="StrategyManager\ParameterStrategyV.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="StrategyManager\StrategyManagerV.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="StrategyManager\StrategyProductionV.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="StrategyManager\StrategyV.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="UpdateBTLWnd\OnlyProdUpdateBTLWndV.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
@@ -928,6 +1007,66 @@
<ItemGroup>
<Resource Include="Resources\NewPage\Ok.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\NewPage\+.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\NewPage\SaveModify.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\NewPage\LogoProvaStrategy.png" />
</ItemGroup>
<ItemGroup>
<BootstrapperPackage Include=".NETFramework,Version=v4.7.2">
<Visible>False</Visible>
<ProductName>Microsoft .NET Framework 4.7.2 %28x86 e x64%29</ProductName>
<Install>true</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1</ProductName>
<Install>false</Install>
</BootstrapperPackage>
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\NewPage\VerifyIntestazione.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\NewPage\AddToRawPartIntestazione.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\NewPage\SettingIntestazione.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\NewPage\InversionIntestazione.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\NewPage\Rotate.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\NewPage\RotateIntestazione.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\NewPage\ProduceRawPartIntestazione.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\NewPage\SimulateIntestazione.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\NewPage\RotateIntestazioneRawPart.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\NewPage\InversionIntestazioneRawPart.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\NewPage\Remove.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\NewPage\MoveDown.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\NewPage\MoveUp.png" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />
<PropertyGroup>
<PostBuildEvent>IF "$(PlatformName)"=="x86" IF "$(ConfigurationName)" == "Release" copy $(TargetPath) c:\EgtProg\EgtBEAMWALL\EgtBEAMWALL.OptimizerR32.exe
@@ -2,6 +2,7 @@
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
DataContext="{StaticResource FeatureListManagerVM}"
HorizontalAlignment="Left"
Style="{StaticResource OnlyProdFeatureListManager_StackPanel}">
<Button Command="{Binding CopyFeature_Command}"
@@ -26,7 +27,7 @@
ToolTip="{Binding RemoveFeature_ToolTip}"
IsEnabled="{Binding RemoveFeature_IsEnabled}"
Style="{StaticResource OnlyProdLeftPanel_Button}">
<Image Source="/Resources/LeftPanel/RemoveFeature.png" Stretch="Uniform"/>
<Image Source="/Resources/NewPage/Remove.png" Stretch="Uniform"/>
</Button>
</StackPanel>
@@ -0,0 +1,52 @@
<UserControl x:Class="ForcedStrategyBTLV"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:Optmizer="clr-namespace:EgtBEAMWALL.Optimizer">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<Border Margin="2,0,2,0"
Style="{StaticResource OnlyProdPage_Border}">
<ListBox ItemsSource="{Binding StrategyList}"
SelectedItem="{Binding SelStrategy}"
IsSynchronizedWithCurrentItem="True"
HorizontalAlignment="Left"
Style="{StaticResource NewAddFeature_ListBox}">
<ListBox.Resources>
<DataTemplate DataType="{x:Type Optmizer:Strategy}">
<StackPanel Orientation="Horizontal">
<RadioButton IsChecked="{Binding IsSelected, RelativeSource={RelativeSource AncestorType={x:Type ListBoxItem}}}"
GroupName="ForcedStrategy"/>
<Image Source="{Binding sStrategyImagePath}"
Stretch="Uniform"
Width="100"
Height="100"/>
<TextBlock Text="{Binding sStrategyName}"
Style="{StaticResource DialogWindow_TextBlock}"/>
</StackPanel>
</DataTemplate>
</ListBox.Resources>
<ListBox.ItemContainerStyle>
<Style TargetType="ListBoxItem">
<!--<EventSetter Event="PreviewMouseDown" Handler="AvailableStrategyList_PreviewMouseDown"/>-->
</Style>
</ListBox.ItemContainerStyle>
</ListBox>
</Border>
<GroupBox Grid.Column="1"
Foreground="Black"
BorderThickness="2"
Margin="0,-5,0,0"
BorderBrush="{StaticResource BeamWall_Glacier}">
<GroupBox.Header>
<TextBlock Text="{Binding SelStrategy.sStrategyID}"
FontWeight="Bold"
Style="{StaticResource DialogWindow_TextBlock}"/>
</GroupBox.Header>
<Optmizer:ParameterStrategyV Tag="{Binding SelStrategy}"/>
</GroupBox>
</Grid>
</UserControl>
@@ -0,0 +1,3 @@
Public Class ForcedStrategyBTL
End Class
@@ -0,0 +1,180 @@
Imports System.Collections.ObjectModel
Imports System.IO
Imports EgtWPFLib5
Imports Newtonsoft.Json
Imports EgtBEAMWALL.Core
Imports EgtUILib
Public Class ForcedStrategyBTLVM
Inherits VMBase
Public Const AUTOMATICSTRATEGYID As String = "AUTOMATIC"
Private m_StrategyList As New ObservableCollection(Of Strategy)
Public Property StrategyList As ObservableCollection(Of Strategy)
Get
Return m_StrategyList
End Get
Set(value As ObservableCollection(Of Strategy))
m_StrategyList = value
End Set
End Property
Private m_SelStrategy As Strategy
Public Property SelStrategy As Strategy
Get
Return m_SelStrategy
End Get
Set(value As Strategy)
m_SelStrategy = value
NotifyPropertyChanged(NameOf(SelStrategy))
End Set
End Property
Private m_CurrentFeature As BTLFeatureM
' Definizione Comandi
Private m_cmdOk As ICommand
Private m_cmdCancel As ICommand
Sub New()
Map.SetRefForcedStrategyBTLVM(Me)
End Sub
Friend Sub Init(Feature As BTLFeatureM)
m_CurrentFeature = Feature
LoadStrategyListFromTopology(Feature.nFeatureId, Feature.nPRC, Feature.nSelGRP)
' leggo eventuali parametri forzati
Dim sStrategyID As String = ""
EgtGetInfo(m_CurrentFeature.nFeatureId, "STRATEGY", sStrategyID)
If String.IsNullOrWhiteSpace(sStrategyID) Then Return
Dim ForcedStrategy As Strategy = m_StrategyList.FirstOrDefault(Function(x) x.sStrategyID = sStrategyID)
If IsNothing(ForcedStrategy) Then
Else
SelStrategy = ForcedStrategy
For Each Param In SelStrategy.ParameterList
Select Case Param.GetType()
Case GetType(BooleanStrategyParameter)
Dim bValue As Boolean = False
EgtGetInfo(m_CurrentFeature.nFeatureId, m_SelStrategy.sStrategyID & "_" & Param.sNameNge, bValue)
DirectCast(Param, BooleanStrategyParameter).SetValue(bValue)
Case GetType(DoubleStrategyParameter)
Dim dValue As Double = 0
EgtGetInfo(m_CurrentFeature.nFeatureId, m_SelStrategy.sStrategyID & "_" & Param.sNameNge, dValue)
DirectCast(Param, DoubleStrategyParameter).SetValue(dValue)
Case GetType(ComboStrategyParameter)
Dim sValue As String = 0
EgtGetInfo(m_CurrentFeature.nFeatureId, m_SelStrategy.sStrategyID & "_" & Param.sNameNge, sValue)
Dim ComboStrategyParameter As ComboStrategyParameter = DirectCast(Param, ComboStrategyParameter)
Dim SelCombo = ComboStrategyParameter.ComboList.FirstOrDefault(Function(x) x.sValue = sValue)
ComboStrategyParameter.SelValue = SelCombo
End Select
Next
End If
End Sub
Friend Function LoadStrategyListFromTopology(nFeatureId As Integer, nPRC As Integer, nGRP As Integer) As Boolean
m_StrategyList.Clear()
Dim sTopologyName As String = "Feature"
' carico default
Dim sStrategiesDirPath As String = Map.refMainWindowVM.MainWindowM.GetStrategiesDirPath()
Dim sAvailableStrategiesFilePath As String = sStrategiesDirPath & "\" & AVAILABLESTRATEGYLIST_FILE & ".json"
If File.Exists(sAvailableStrategiesFilePath) Then
Dim sReadedFile As String = File.ReadAllText(sAvailableStrategiesFilePath)
Dim JsonStrategyFeatureList As List(Of JsonAvailableStrategyFeature) = JsonConvert.DeserializeObject(Of List(Of JsonAvailableStrategyFeature))(sReadedFile)
nGRP = CalcBeamPrivateProfileGRP(nGRP)
Dim JsonAvailableStrategyFeature As JsonAvailableStrategyFeature = JsonStrategyFeatureList.FirstOrDefault(Function(x) x.nGRP = nGRP AndAlso x.nPRC = nPRC)
If IsNothing(JsonAvailableStrategyFeature) Then Return False
Dim JsonAvailableTopology As JsonAvailableTopology = JsonAvailableStrategyFeature.TopologyList.FirstOrDefault(Function(x) x.sName = sTopologyName)
If IsNothing(JsonAvailableTopology) Then
' ricavo topologia da feature
FindTopologyFromFeature(nFeatureId, sTopologyName)
JsonAvailableTopology = JsonAvailableStrategyFeature.TopologyList.FirstOrDefault(Function(x) x.sName = sTopologyName)
End If
If IsNothing(JsonAvailableTopology) Then Return False
m_StrategyList = New ObservableCollection(Of Strategy)((From JsonAvailableStrategy In JsonAvailableTopology.StrategyList
Select JsonAvailableStrategy.Deserialize(-1)).ToList())
End If
' recupero custom
Dim nPartId As Integer = EgtGetParent(EgtGetParent(nFeatureId))
Dim nPartProjId As Integer = 0
If Not EgtGetInfo(nPartId, PROJ, nPartProjId) OrElse nPartProjId <= 0 Then Return False
Dim nBTLInfoLayerId As Integer = GetCurrProjBtlInfoLayerId(nPartProjId)
Dim sStrategySetupName As String = ""
EgtGetInfo(nBTLInfoLayerId, "AISETUP", sStrategySetupName)
If Not String.IsNullOrWhiteSpace(sStrategySetupName) Then
' carico custom
Dim sAISetupDirPath As String = Map.refMainWindowVM.MainWindowM.GetAISetupDirPath()
Dim sStrategyConfigurationFilePath As String = sAISetupDirPath & "\" & sStrategySetupName & ".json"
If File.Exists(sStrategyConfigurationFilePath) Then
Dim sReadedFile As String = File.ReadAllText(sStrategyConfigurationFilePath)
Dim JsonStrategyFeatureList As List(Of JsonStrategyFeature) = JsonConvert.DeserializeObject(Of List(Of JsonStrategyFeature))(sReadedFile)
Dim JsonStrategyFeature As JsonStrategyFeature = JsonStrategyFeatureList.FirstOrDefault(Function(x) x.nGRP = nGRP AndAlso x.nPRC = nPRC)
If IsNothing(JsonStrategyFeature) Then Return False
Dim JsonTopology As JsonTopology = JsonStrategyFeature.TopologyList.FirstOrDefault(Function(x) x.sName = sTopologyName)
If IsNothing(JsonTopology) Then Return False
For Each Strategy In JsonTopology.StrategyList
Dim DefaultStrategy As Strategy = m_StrategyList.FirstOrDefault(Function(x) x.sStrategyID = Strategy.sStrategyID)
If IsNothing(DefaultStrategy) Then
' DefaultTopology.StrategyList.Add(New Strategy(DefaultTopology, Strategy))
' verifico indici!!
Else
DefaultStrategy.ReadConfiguration(Strategy)
End If
Next
End If
End If
' aggiungo strategia automatica
m_StrategyList.Insert(0, New Strategy() With {.sStrategyID = AUTOMATICSTRATEGYID, .sStrategyName = AUTOMATICSTRATEGYID})
NotifyPropertyChanged(NameOf(StrategyList))
Return True
End Function
Friend Function GetCurrProjBtlInfoLayerId(nProjId As Integer) As Integer
' cerco tra i layer BTLInfo
Dim nBTLInfoLayerId As Integer = EgtGetFirstNameInGroup(GDB_ID.ROOT, BTLINFO)
While nBTLInfoLayerId <> GDB_ID.NULL
' verifico se il layer appartiene al ProjId
Dim nBTLInfoLayerProjId As Integer
EgtGetInfo(nBTLInfoLayerId, BTL_PRT_PROJ, nBTLInfoLayerProjId)
If nBTLInfoLayerProjId = nProjId Then
Return nBTLInfoLayerId
End If
nBTLInfoLayerId = EgtGetNextName(nBTLInfoLayerId, BTLINFO)
End While
Return -1
End Function
Friend Sub ForcedStrategy()
' cancello precedenti valori
Dim sPrecStrategyID As String = ""
EgtGetInfo(m_CurrentFeature.nFeatureId, "STRATEGY", sPrecStrategyID)
If Not String.IsNullOrWhiteSpace(sPrecStrategyID) Then
Dim PrecInfo As String() = {}
EgtGetAllInfo(m_CurrentFeature.nFeatureId, PrecInfo)
Dim PrecStrategyInfo As String() = PrecInfo.Where(Function(x) x.StartsWith(sPrecStrategyID)).ToArray()
For Each Info In PrecStrategyInfo
EgtRemoveInfo(m_CurrentFeature.nFeatureId, Info.Split("="c)(0))
Next
End If
If Not IsNothing(m_SelStrategy) Then
If m_SelStrategy.sStrategyID = AUTOMATICSTRATEGYID Then
EgtRemoveInfo(m_CurrentFeature.nFeatureId, "STRATEGY")
Else
EgtSetInfo(m_CurrentFeature.nFeatureId, "STRATEGY", SelStrategy.sStrategyID)
For Each Param In SelStrategy.ParameterList
Select Case Param.GetType()
Case GetType(BooleanStrategyParameter)
EgtSetInfo(m_CurrentFeature.nFeatureId, m_SelStrategy.sStrategyID & "_" & Param.sNameNge, DirectCast(Param, BooleanStrategyParameter).bValue)
Case GetType(DoubleStrategyParameter)
EgtSetInfo(m_CurrentFeature.nFeatureId, m_SelStrategy.sStrategyID & "_" & Param.sNameNge, DirectCast(Param, DoubleStrategyParameter).sValue)
Case GetType(ComboStrategyParameter)
EgtSetInfo(m_CurrentFeature.nFeatureId, m_SelStrategy.sStrategyID & "_" & Param.sNameNge, DirectCast(Param, ComboStrategyParameter).SelValue.sValue)
End Select
Next
End If
End If
End Sub
End Class
@@ -0,0 +1,78 @@
<UserControl x:Class="ForcedStrategyPanelV"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:Optmizer="clr-namespace:EgtBEAMWALL.Optimizer">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="1*"/>
<!--<RowDefinition Height="1*"/>-->
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<Border Margin="2,0,2,0"
Style="{StaticResource OnlyProdPage_Border}">
<ListBox ItemsSource="{Binding StrategyList}"
SelectedItem="{Binding SelStrategy}"
Width="Auto"
Height="Auto"
IsSynchronizedWithCurrentItem="True"
Style="{StaticResource NewAddFeature_ListBox}">
<ListBox.Resources>
<DataTemplate DataType="{x:Type Optmizer:Strategy}">
<StackPanel Orientation="Horizontal">
<RadioButton IsChecked="{Binding IsSelected, RelativeSource={RelativeSource AncestorType={x:Type ListBoxItem}}}"
GroupName="ForcedStrategy"/>
<Image Source="{Binding sStrategyImagePath}"
Stretch="Uniform"
Width="100"
Height="100"/>
<TextBlock Text="{Binding sStrategyName}"
Style="{StaticResource DialogWindow_TextBlock}"/>
</StackPanel>
</DataTemplate>
</ListBox.Resources>
<ListBox.ItemContainerStyle>
<Style TargetType="ListBoxItem">
<!--<EventSetter Event="PreviewMouseDown" Handler="AvailableStrategyList_PreviewMouseDown"/>-->
</Style>
</ListBox.ItemContainerStyle>
</ListBox>
</Border>
<GroupBox Grid.Column="1"
Foreground="Black"
BorderThickness="2"
Margin="0,-5,0,0"
BorderBrush="{StaticResource BeamWall_Glacier}">
<GroupBox.Header>
<TextBlock Text="{Binding SelStrategy.sStrategyID}"
FontWeight="Bold"
Style="{StaticResource DialogWindow_TextBlock}"/>
</GroupBox.Header>
<Optmizer:ParameterStrategyV Tag="{Binding SelStrategy}"/>
</GroupBox>
<!--<StackPanel Grid.Row="1"
Grid.Column="2"/>-->
<StackPanel Grid.Row="2"
Grid.ColumnSpan="2"
HorizontalAlignment="Right"
Style="{StaticResource OnlyProdPartManager_StackPanel}">
<Button Command="{Binding Ok_Command}"
ToolTip="{Binding Ok_Msg}"
Style="{StaticResource ToolBarViewPanel_Button}">
<Image Source="/Resources/NewPage/Ok.png" Stretch="Uniform"/>
</Button>
<Button Command="{Binding Cancel_Command}"
ToolTip="{Binding Cancel_Msg}"
Style="{StaticResource ToolBarViewPanel_Button}">
<Image Source="/Resources/PDFEditor/Delete.png" Stretch="Uniform"/>
</Button>
</StackPanel>
</Grid>
</UserControl>
@@ -0,0 +1,3 @@
Public Class ForcedStrategyPanelV
End Class
@@ -0,0 +1,220 @@
Imports System.Collections.ObjectModel
Imports System.IO
Imports EgtWPFLib5
Imports Newtonsoft.Json
Imports EgtBEAMWALL.Core
Imports EgtUILib
Public Class ForcedStrategyPanelVM
Inherits VMBase
Public Const AUTOMATICSTRATEGYID As String = "AUTOMATIC"
Private m_StrategyList As New ObservableCollection(Of Strategy)
Public Property StrategyList As ObservableCollection(Of Strategy)
Get
Return m_StrategyList
End Get
Set(value As ObservableCollection(Of Strategy))
m_StrategyList = value
End Set
End Property
Private m_SelStrategy As Strategy
Public Property SelStrategy As Strategy
Get
Return m_SelStrategy
End Get
Set(value As Strategy)
m_SelStrategy = value
NotifyPropertyChanged(NameOf(SelStrategy))
End Set
End Property
Private m_CurrentFeature As BTLFeatureM
' Definizione Comandi
Private m_cmdOk As ICommand
Private m_cmdCancel As ICommand
Sub New()
Map.SetRefForcedStrategyPanelVM(Me)
End Sub
Friend Sub Init(Feature As BTLFeatureM)
m_CurrentFeature = Feature
LoadStrategyListFromTopology(Feature.nFeatureId, Feature.nPRC, Feature.nSelGRP)
' leggo eventuali parametri forzati
Dim sStrategyID As String = ""
EgtGetInfo(m_CurrentFeature.nFeatureId, "STRATEGY", sStrategyID)
If String.IsNullOrWhiteSpace(sStrategyID) Then Return
Dim ForcedStrategy As Strategy = m_StrategyList.FirstOrDefault(Function(x) x.sStrategyID = sStrategyID)
If IsNothing(ForcedStrategy) Then
Else
SelStrategy = ForcedStrategy
For Each Param In SelStrategy.ParameterList
Select Case Param.GetType()
Case GetType(BooleanStrategyParameter)
Dim bValue As Boolean = False
EgtGetInfo(m_CurrentFeature.nFeatureId, m_SelStrategy.sStrategyID & "_" & Param.sNameNge, bValue)
DirectCast(Param, BooleanStrategyParameter).SetValue(bValue)
Case GetType(DoubleStrategyParameter)
Dim dValue As Double = 0
EgtGetInfo(m_CurrentFeature.nFeatureId, m_SelStrategy.sStrategyID & "_" & Param.sNameNge, dValue)
DirectCast(Param, DoubleStrategyParameter).SetValue(dValue)
Case GetType(ComboStrategyParameter)
Dim sValue As String = 0
EgtGetInfo(m_CurrentFeature.nFeatureId, m_SelStrategy.sStrategyID & "_" & Param.sNameNge, sValue)
Dim ComboStrategyParameter As ComboStrategyParameter = DirectCast(Param, ComboStrategyParameter)
Dim SelCombo = ComboStrategyParameter.ComboList.FirstOrDefault(Function(x) x.sValue = sValue)
ComboStrategyParameter.SelValue = SelCombo
End Select
Next
End If
End Sub
Friend Function LoadStrategyListFromTopology(nFeatureId As Integer, nPRC As Integer, nGRP As Integer) As Boolean
m_StrategyList.Clear()
Dim sTopologyName As String = "Feature"
' carico default
Dim sStrategiesDirPath As String = Map.refMainWindowVM.MainWindowM.GetStrategiesDirPath()
Dim sAvailableStrategiesFilePath As String = sStrategiesDirPath & "\" & AVAILABLESTRATEGYLIST_FILE & ".json"
If File.Exists(sAvailableStrategiesFilePath) Then
Dim sReadedFile As String = File.ReadAllText(sAvailableStrategiesFilePath)
Dim JsonStrategyFeatureList As List(Of JsonAvailableStrategyFeature) = JsonConvert.DeserializeObject(Of List(Of JsonAvailableStrategyFeature))(sReadedFile)
nGRP = CalcBeamPrivateProfileGRP(nGRP)
Dim JsonAvailableStrategyFeature As JsonAvailableStrategyFeature = JsonStrategyFeatureList.FirstOrDefault(Function(x) x.nGRP = nGRP AndAlso x.nPRC = nPRC)
If IsNothing(JsonAvailableStrategyFeature) Then Return False
Dim JsonAvailableTopology As JsonAvailableTopology = JsonAvailableStrategyFeature.TopologyList.FirstOrDefault(Function(x) x.sName = sTopologyName)
If IsNothing(JsonAvailableTopology) Then
' ricavo topologia da feature
FindTopologyFromFeature(nFeatureId, sTopologyName)
JsonAvailableTopology = JsonAvailableStrategyFeature.TopologyList.FirstOrDefault(Function(x) x.sName = sTopologyName)
End If
If IsNothing(JsonAvailableTopology) Then Return False
m_StrategyList = New ObservableCollection(Of Strategy)((From JsonAvailableStrategy In JsonAvailableTopology.StrategyList
Select JsonAvailableStrategy.Deserialize(-1)).ToList())
End If
' recupero custom
Dim nPartId As Integer = EgtGetParent(EgtGetParent(nFeatureId))
Dim nPartProjId As Integer = 0
If Not EgtGetInfo(nPartId, PROJ, nPartProjId) OrElse nPartProjId <= 0 Then Return False
Dim nBTLInfoLayerId As Integer = GetCurrProjBtlInfoLayerId(nPartProjId)
Dim sStrategySetupName As String = ""
EgtGetInfo(nBTLInfoLayerId, "AISETUP", sStrategySetupName)
If Not String.IsNullOrWhiteSpace(sStrategySetupName) Then
' carico custom
Dim sAISetupDirPath As String = Map.refMainWindowVM.MainWindowM.GetAISetupDirPath()
Dim sStrategyConfigurationFilePath As String = sAISetupDirPath & "\" & sStrategySetupName & ".json"
If File.Exists(sStrategyConfigurationFilePath) Then
Dim sReadedFile As String = File.ReadAllText(sStrategyConfigurationFilePath)
Dim JsonStrategyFeatureList As List(Of JsonStrategyFeature) = JsonConvert.DeserializeObject(Of List(Of JsonStrategyFeature))(sReadedFile)
Dim JsonStrategyFeature As JsonStrategyFeature = JsonStrategyFeatureList.FirstOrDefault(Function(x) x.nGRP = nGRP AndAlso x.nPRC = nPRC)
If IsNothing(JsonStrategyFeature) Then Return False
Dim JsonTopology As JsonTopology = JsonStrategyFeature.TopologyList.FirstOrDefault(Function(x) x.sName = sTopologyName)
If IsNothing(JsonTopology) Then Return False
For Each Strategy In JsonTopology.StrategyList
Dim DefaultStrategy As Strategy = m_StrategyList.FirstOrDefault(Function(x) x.sStrategyID = Strategy.sStrategyID)
If IsNothing(DefaultStrategy) Then
' DefaultTopology.StrategyList.Add(New Strategy(DefaultTopology, Strategy))
' verifico indici!!
Else
DefaultStrategy.ReadConfiguration(Strategy)
End If
Next
End If
End If
' aggiungo strategia automatica
m_StrategyList.Insert(0, New Strategy() With {.sStrategyID = AUTOMATICSTRATEGYID, .sStrategyName = AUTOMATICSTRATEGYID})
NotifyPropertyChanged(NameOf(StrategyList))
Return True
End Function
Friend Function GetCurrProjBtlInfoLayerId(nProjId As Integer) As Integer
' cerco tra i layer BTLInfo
Dim nBTLInfoLayerId As Integer = EgtGetFirstNameInGroup(GDB_ID.ROOT, BTLINFO)
While nBTLInfoLayerId <> GDB_ID.NULL
' verifico se il layer appartiene al ProjId
Dim nBTLInfoLayerProjId As Integer
EgtGetInfo(nBTLInfoLayerId, BTL_PRT_PROJ, nBTLInfoLayerProjId)
If nBTLInfoLayerProjId = nProjId Then
Return nBTLInfoLayerId
End If
nBTLInfoLayerId = EgtGetNextName(nBTLInfoLayerId, BTLINFO)
End While
Return -1
End Function
#Region "COMMANDS"
#Region "Ok_Command"
Public ReadOnly Property Ok_Command As ICommand
Get
If m_cmdOk Is Nothing Then
m_cmdOk = New Command(AddressOf Ok)
End If
Return m_cmdOk
End Get
End Property
Public Sub Ok()
' cancello precedenti valori
Dim sPrecStrategyID As String = ""
EgtGetInfo(m_CurrentFeature.nFeatureId, "STRATEGY", sPrecStrategyID)
If Not String.IsNullOrWhiteSpace(sPrecStrategyID) Then
Dim PrecInfo As String() = {}
EgtGetAllInfo(m_CurrentFeature.nFeatureId, PrecInfo)
Dim PrecStrategyInfo As String() = PrecInfo.Where(Function(x) x.StartsWith(sPrecStrategyID)).ToArray()
For Each Info In PrecStrategyInfo
EgtRemoveInfo(m_CurrentFeature.nFeatureId, Info.Split("="c)(0))
Next
End If
If m_SelStrategy.sStrategyID = AUTOMATICSTRATEGYID Then
EgtRemoveInfo(m_CurrentFeature.nFeatureId, "STRATEGY")
Else
EgtSetInfo(m_CurrentFeature.nFeatureId, "STRATEGY", SelStrategy.sStrategyID)
For Each Param In SelStrategy.ParameterList
Select Case Param.GetType()
Case GetType(BooleanStrategyParameter)
EgtSetInfo(m_CurrentFeature.nFeatureId, m_SelStrategy.sStrategyID & "_" & Param.sNameNge, DirectCast(Param, BooleanStrategyParameter).bValue)
Case GetType(DoubleStrategyParameter)
EgtSetInfo(m_CurrentFeature.nFeatureId, m_SelStrategy.sStrategyID & "_" & Param.sNameNge, DirectCast(Param, DoubleStrategyParameter).sValue)
Case GetType(ComboStrategyParameter)
EgtSetInfo(m_CurrentFeature.nFeatureId, m_SelStrategy.sStrategyID & "_" & Param.sNameNge, DirectCast(Param, ComboStrategyParameter).SelValue.sValue)
End Select
Next
End If
Map.refProjectVM.SetSelManagerTab(ProjectVM.StrategyManagerTab.RAWPARTMANAGER)
' Abilito LeftPanel
Map.refProjectVM.SetOnlyProdLeftPanel_IsEnabled(True)
Map.refProjectVM.SetOnlyProdLeftPanel_Opacity(1)
End Sub
#End Region ' Ok_Command
#Region "Cancel_Command"
Public ReadOnly Property Cancel_Command As ICommand
Get
If m_cmdCancel Is Nothing Then
m_cmdCancel = New Command(AddressOf Cancel)
End If
Return m_cmdCancel
End Get
End Property
Public Sub Cancel()
Map.refProjectVM.SetSelManagerTab(ProjectVM.StrategyManagerTab.RAWPARTMANAGER)
' Abilito LeftPanel
Map.refProjectVM.SetOnlyProdLeftPanel_IsEnabled(True)
Map.refProjectVM.SetOnlyProdLeftPanel_Opacity(1)
End Sub
#End Region ' Cancel_Command
#End Region ' Commands
End Class
@@ -100,7 +100,12 @@ Public Class FeatureListVM
End Property
Public Sub Ok()
Map.refProjectVM.SetSelManagerTab(ProjectVM.ManagerTab.RAWPARTMANAGER)
Map.refForcedStrategyBTLVM.ForcedStrategy()
Map.refProjectVM.SetRawPartManagerVisibility(Visibility.Visible)
Map.refProjectVM.SetStrategyManagerVisibility(Visibility.Collapsed)
Map.refProjectVM.SetSelManagerTab(ProjectVM.StrategyManagerTab.RAWPARTMANAGER)
Map.refProjectVM.SetSelFeatureManagerTab(ProjectVM.FeatureManagerTab.FEATURERAWPARTMANAGER)
' Abilito LeftPanel
Map.refProjectVM.SetOnlyProdLeftPanel_IsEnabled(True)
Map.refProjectVM.SetOnlyProdLeftPanel_Opacity(1)
End Sub
@@ -119,7 +124,11 @@ Public Class FeatureListVM
End Property
Public Sub Cancel()
Map.refProjectVM.SetSelManagerTab(ProjectVM.ManagerTab.RAWPARTMANAGER)
Map.refProjectVM.SetRawPartManagerVisibility(Visibility.Visible)
Map.refProjectVM.SetStrategyManagerVisibility(Visibility.Collapsed)
Map.refProjectVM.SetSelManagerTab(ProjectVM.StrategyManagerTab.RAWPARTMANAGER)
Map.refProjectVM.SetSelFeatureManagerTab(ProjectVM.FeatureManagerTab.FEATURERAWPARTMANAGER)
' Abilito LeftPanel
Map.refProjectVM.SetOnlyProdLeftPanel_IsEnabled(True)
Map.refProjectVM.SetOnlyProdLeftPanel_Opacity(1)
End Sub
@@ -12,7 +12,6 @@
ItemsSource="{Binding Tag.BTLPartVMList,
RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdBTLPartListV}}}"
SelectionMode="Extended"
PreviewMouseDown="DataGrid_PreviewMouseDown"
PreviewMouseMove="DataGrid_PreviewMouseMove"
Margin="0,0,0,5"
EgtBEAMWALL:MultiSelectorBehaviours.SynchronizedSelectedItems="{Binding Tag.SelBTLParts,
@@ -29,8 +28,15 @@
ColumnHeaderPadding="0,2,0,2"
AreRowDetailsFrozen="True"
ScrollViewer.CanContentScroll="True"
VirtualizingPanel.ScrollUnit="Pixel"
EnableRowVirtualization="True"
EnableColumnVirtualization="True"
VirtualizingStackPanel.VirtualizationMode="Recycling"
VirtualizingStackPanel.IsVirtualizing="True"
VirtualizingPanel.IsVirtualizingWhenGrouping="True"
VirtualizingPanel.ScrollUnit="Pixel"
RenderOptions.CachingHint="Cache"
VirtualizingPanel.CacheLength="10"
VirtualizingPanel.CacheLengthUnit="Pixel"
Style="{StaticResource DataGrid_OnlyProd}">
<DataGrid.InputBindings>
@@ -45,20 +51,20 @@
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type GroupItem}">
<Expander IsExpanded="True">
<Expander IsExpanded="True" >
<Expander.Header>
<StackPanel Orientation="Horizontal">
<TextBlock Text="{Binding Path=Name}"
Margin="0,0,5,0"/>
<StackPanel Orientation="Horizontal" >
<TextBlock Text="{Binding Path=Name}"
Margin="0,0,5,0" FontSize="14"/>
<TextBlock Text="{Binding Path=Name, Converter={StaticResource ProjIdToBtlFileName}}"
Margin="0,0,5,0"/>
Margin="0,0,5,0" FontSize="14"/>
<Button Command="{Binding Tag.Data_Command, RelativeSource={RelativeSource AncestorType={x:Type UserControl}}}"
CommandParameter="{Binding Path=Name}"
ToolTip="{Binding Tag.Data_ToolTip, RelativeSource={RelativeSource AncestorType={x:Type UserControl}}}"
Height="20" Width="20" Margin="5,0,0,0"
Style="{StaticResource OnlyProdLeftPanel_Button}">
<Image Source="/Resources/InstrumentPanel/Analyze.png" Stretch="Uniform"/>
</Button>
<Button Command="{Binding Tag.AddPart_Command, RelativeSource={RelativeSource AncestorType={x:Type UserControl}}}"
ToolTip="{Binding Tag.AddPart_ToolTip, RelativeSource={RelativeSource AncestorType={x:Type UserControl}}}"
Height="20" Width="20" Margin="5,0,0,0"
@@ -96,15 +102,19 @@
<Style TargetType="DataGridRow" BasedOn="{StaticResource RowDataGrid_CustomHighLight}">
<Setter Property="DetailsVisibility" Value="{Binding bOpenFeatureList, Converter={StaticResource BooleanToVisibilityConverter}}"/>
<EventSetter Event="PreviewMouseDown" Handler="PartList_PreviewMouseDown"/>
<EventSetter Event="PreviewMouseUp" Handler="PartList_PreviewMouseUp"/>
</Style>
</DataGrid.RowStyle>
<DataGrid.Resources>
<!--PDN - Nome-->
<DataGridTextColumn x:Key="colPDN" Binding="{Binding nPDN}">
<DataGridTextColumn.Header>
<!--<DataGridTextColumn.Header>
<TextBlock Text="{Binding Path=DataContext.PDN_Msg,RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdBTLPartListV}}}"/>
</DataGridTextColumn.Header>
</DataGridTextColumn.Header>-->
<DataGridTextColumn.HeaderTemplate>
<DataTemplate>
<TextBlock Text="{Binding DataContext.PDN_Msg,RelativeSource={RelativeSource AncestorType={x:Type DataGrid}}}"/>
</DataTemplate>
</DataGridTextColumn.HeaderTemplate>
</DataGridTextColumn>
<!--Validità pezzo-->
<DataGridTemplateColumn x:Key="colCALC" CanUserResize="False"
@@ -114,16 +124,16 @@
<Grid Style="{StaticResource GlobalState_Grid}">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="25"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="10"/>
</Grid.ColumnDefinitions>
<TextBlock Text="↓"
Visibility="{Binding CALC_FALL_Visibility}"
Style="{StaticResource CALC_FALL_TextBlock}"/>
Style="{StaticResource OnlyProdRawPartList_TextBlock}"/>
<Border Grid.Column="1"
BorderBrush="{Binding Calc_BorderBrush}"
Style="{StaticResource CALC_FALL_Border}">
<ItemsControl ItemsSource="{Binding BTLFeatureVMList_View}"
Width="{Binding ActualHeight, RelativeSource={RelativeSource self}}"
Background="{Binding Calc_BorderBrush}">
<!--<ItemsControl ItemsSource="{Binding BTLFeatureVMList_View}"
Style="{StaticResource CALC_FALL_ItemsControl}">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
@@ -136,7 +146,7 @@
<Border Background="{Binding Calc_Background}"/>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</ItemsControl>-->
</Border>
<Grid Grid.Column="2"
HorizontalAlignment="Center">
@@ -176,47 +186,84 @@
</DataGridTemplateColumn>
<!--W - Larghezza-->
<DataGridTextColumn x:Key="colW" Binding="{Binding sW}" SortMemberPath="dW">
<DataGridTextColumn.Header>
<!--<DataGridTextColumn.Header>
<TextBlock Text="{Binding Path=DataContext.W_Msg,RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdBTLPartListV}}}"/>
</DataGridTextColumn.Header>
</DataGridTextColumn.Header>-->
<DataGridTextColumn.HeaderTemplate>
<DataTemplate>
<TextBlock Text="{Binding DataContext.W_Msg,RelativeSource={RelativeSource AncestorType={x:Type DataGrid}}}"/>
</DataTemplate>
</DataGridTextColumn.HeaderTemplate>
</DataGridTextColumn>
<!--H - Altezza-->
<DataGridTextColumn x:Key="colH" Binding="{Binding sH}" SortMemberPath="dH">
<DataGridTextColumn.Header>
<!--<DataGridTextColumn.Header>
<TextBlock Text="{Binding Path=DataContext.H_Msg,RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdBTLPartListV}}}"/>
</DataGridTextColumn.Header>
</DataGridTextColumn.Header>-->
<DataGridTextColumn.HeaderTemplate>
<DataTemplate>
<TextBlock Text="{Binding DataContext.H_Msg,RelativeSource={RelativeSource AncestorType={x:Type DataGrid}}}"/>
</DataTemplate>
</DataGridTextColumn.HeaderTemplate>
</DataGridTextColumn>
<!--L - Lunghezza-->
<DataGridTextColumn x:Key="colL" Binding="{Binding sL}" SortMemberPath="dL">
<DataGridTextColumn.Header>
<!--<DataGridTextColumn.Header>
<TextBlock Text="{Binding Path=DataContext.L_Msg,RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdBTLPartListV}}}"/>
</DataGridTextColumn.Header>
</DataGridTextColumn.Header>-->
<DataGridTextColumn.HeaderTemplate>
<DataTemplate>
<TextBlock Text="{Binding DataContext.L_Msg,RelativeSource={RelativeSource AncestorType={x:Type DataGrid}}}"/>
</DataTemplate>
</DataGridTextColumn.HeaderTemplate>
</DataGridTextColumn>
<!--NAM - Descrizione-->
<DataGridTextColumn x:Key="colNAM" Binding="{Binding sNAM}">
<DataGridTextColumn.Header>
<!--<DataGridTextColumn.Header>
<TextBlock Text="{Binding Path=DataContext.NAM_Msg,RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdBTLPartListV}}}"/>
</DataGridTextColumn.Header>
</DataGridTextColumn.Header>-->
<DataGridTextColumn.HeaderTemplate>
<DataTemplate>
<TextBlock Text="{Binding DataContext.NAM_Msg,RelativeSource={RelativeSource AncestorType={x:Type DataGrid}}}"/>
</DataTemplate>
</DataGridTextColumn.HeaderTemplate>
</DataGridTextColumn>
<!--MAT - Materiale-->
<DataGridTextColumn x:Key="colMATERIAL" Binding="{Binding sMATERIAL}">
<DataGridTextColumn.Header>
<!--<DataGridTextColumn.Header>
<TextBlock Text="{Binding Path=DataContext.MAT_Msg,RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdBTLPartListV}}}"/>
</DataGridTextColumn.Header>
</DataGridTextColumn.Header>-->
<DataGridTextColumn.HeaderTemplate>
<DataTemplate>
<TextBlock Text="{Binding DataContext.MAT_Msg,RelativeSource={RelativeSource AncestorType={x:Type DataGrid}}}"/>
</DataTemplate>
</DataGridTextColumn.HeaderTemplate>
</DataGridTextColumn>
<!--CNT - Richiesti da BTL-->
<DataGridTextColumn x:Key="colCNT" Binding="{Binding sCNT}" SortMemberPath="nCNT">
<DataGridTextColumn.Header>
<!--<DataGridTextColumn.Header>
<TextBlock Text="{Binding Path=DataContext.ShortCNT_Msg,RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdBTLPartListV}}}"
ToolTip="{Binding Path=DataContext.CNT_Msg,RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdBTLPartListV}}}"/>
</DataGridTextColumn.Header>
</DataGridTextColumn.Header>-->
<DataGridTextColumn.HeaderTemplate>
<DataTemplate>
<TextBlock Text="QTY"
ToolTip="{Binding DataContext.CNT_Msg,RelativeSource={RelativeSource AncestorType={x:Type DataGrid}}}"/>
</DataTemplate>
</DataGridTextColumn.HeaderTemplate>
</DataGridTextColumn>
<!--ADDED - Aggiunti-->
<DataGridTextColumn x:Key="colADDED" Binding="{Binding sADDED}" SortMemberPath="nADDED">
<DataGridTextColumn.Header>
<!--<DataGridTextColumn.Header>
<TextBlock Text="{Binding Path=DataContext.ShortADDED_Msg,RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdBTLPartListV}}}"
ToolTip="{Binding Path=DataContext.ADDED_Msg,RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdBTLPartListV}}}"/>
</DataGridTextColumn.Header>
</DataGridTextColumn.Header>-->
<DataGridTextColumn.HeaderTemplate>
<DataTemplate>
<TextBlock Text="{Binding DataContext.ShortADDED_Msg,RelativeSource={RelativeSource AncestorType={x:Type DataGrid}}}"
ToolTip="{Binding DataContext.ADDED_Msg,RelativeSource={RelativeSource AncestorType={x:Type DataGrid}}}"/>
</DataTemplate>
</DataGridTextColumn.HeaderTemplate>
<DataGridTextColumn.EditingElementStyle>
<Style TargetType="{x:Type TextBox}">
<Setter Property="Foreground" Value="Blue" />
@@ -225,35 +272,57 @@
</DataGridTextColumn>
<!--INPROD - IN OTTIMIZZAZIONE-->
<DataGridTextColumn x:Key="colINPROD" Binding="{Binding nINPROD}">
<DataGridTextColumn.Header>
<!--<DataGridTextColumn.Header>
<TextBlock Text="{Binding Path=DataContext.ShortINPROD_Msg,RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdBTLPartListV}}}"
ToolTip="{Binding Path=DataContext.INPROD_Msg,RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdBTLPartListV}}}"/>
</DataGridTextColumn.Header>
</DataGridTextColumn.Header>-->
<DataGridTextColumn.HeaderTemplate>
<DataTemplate>
<TextBlock Text="{Binding DataContext.ShortINPROD_Msg,RelativeSource={RelativeSource AncestorType={x:Type DataGrid}}}"
ToolTip="{Binding DataContext.INPROD_Msg,RelativeSource={RelativeSource AncestorType={x:Type DataGrid}}}"/>
</DataTemplate>
</DataGridTextColumn.HeaderTemplate>
</DataGridTextColumn>
<!--DONE - PRODOTTI-->
<DataGridTextColumn x:Key="colDONE" Binding="{Binding nDONE}">
<DataGridTextColumn.Header>
<!--<DataGridTextColumn.Header>
<TextBlock Text="{Binding Path=DataContext.ShortDONE_Msg,RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdBTLPartListV}}}"
ToolTip="{Binding Path=DataContext.DONE_Msg,RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdBTLPartListV}}}"/>
</DataGridTextColumn.Header>
</DataGridTextColumn.Header>-->
<DataGridTextColumn.HeaderTemplate>
<DataTemplate>
<TextBlock Text="{Binding DataContext.ShortDONE_Msg,RelativeSource={RelativeSource AncestorType={x:Type DataGrid}}}"
ToolTip="{Binding DataContext.DONE_Msg,RelativeSource={RelativeSource AncestorType={x:Type DataGrid}}}"/>
</DataTemplate>
</DataGridTextColumn.HeaderTemplate>
</DataGridTextColumn>
<!--GRP - Gruppo-->
<DataGridTextColumn x:Key="colGROUP" Binding="{Binding sGROUP}">
<DataGridTextColumn.Header>
<!--<DataGridTextColumn.Header>
<TextBlock Text="{Binding Path=DataContext.GRP_Msg,RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdBTLPartListV}}}"/>
</DataGridTextColumn.Header>
</DataGridTextColumn.Header>-->
<DataGridTextColumn.HeaderTemplate>
<DataTemplate>
<TextBlock Text="{Binding DataContext.GRP_Msg,RelativeSource={RelativeSource AncestorType={x:Type DataGrid}}}"/>
</DataTemplate>
</DataGridTextColumn.HeaderTemplate>
</DataGridTextColumn>
<!--STOREY - Sottogruppo-->
<DataGridTextColumn x:Key="colSTOREY" Binding="{Binding sSTOREY}">
<DataGridTextColumn.Header>
<!--<DataGridTextColumn.Header>
<TextBlock Text="{Binding Path=DataContext.STOREY_Msg,RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdBTLPartListV}}}"/>
</DataGridTextColumn.Header>
</DataGridTextColumn.Header>-->
<DataGridTextColumn.HeaderTemplate>
<DataTemplate>
<TextBlock Text="{Binding DataContext.STOREY_Msg,RelativeSource={RelativeSource AncestorType={x:Type DataGrid}}}"/>
</DataTemplate>
</DataGridTextColumn.HeaderTemplate>
</DataGridTextColumn>
<!--ROT - Rotazione-->
<DataGridTemplateColumn x:Key="colROT" SortMemberPath="dROT">
<DataGridTemplateColumn.HeaderTemplate>
<DataTemplate>
<TextBlock Text="{Binding Path=DataContext.ROTATION_Msg,RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdBTLPartListV}}}"/>
<Image Source="/Resources/NewPage/RotateIntestazione.png" Stretch="Uniform" Height="20"/>
</DataTemplate>
</DataGridTemplateColumn.HeaderTemplate>
<DataGridTemplateColumn.CellTemplate>
@@ -261,18 +330,17 @@
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<TextBlock Text="{Binding sROTATED}"
TextAlignment="Center"
Margin="2,0,2,0"/>
<Button Grid.Column="1"
Command="{Binding ForwardRotation_Command}"
ToolTip="{Binding ForwardRotation_ToolTip}"
IsEnabled="{Binding RotatePart_IsEnabled}"
Height="15" Width="15" Margin="2,0,2,0">
<Image Source="/Resources/PartManager/RightRotate.png" Stretch="Uniform"/>
Style="{StaticResource BTLPanel_Button}">
<Image Source="/Resources/NewPage/Rotate.png" Stretch="Uniform"/>
</Button>
</Grid>
</DataTemplate>
@@ -282,12 +350,12 @@
<DataGridTemplateColumn x:Key="colFLIP">
<DataGridTemplateColumn.HeaderTemplate>
<DataTemplate>
<TextBlock Text="{Binding Path=DataContext.INVERSION_Msg,RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdBTLPartListV}}}"/>
<Image Source="/Resources/NewPage/InversionIntestazione.png" Stretch="Uniform" Height="20"/>
</DataTemplate>
</DataGridTemplateColumn.HeaderTemplate>
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<CheckBox Command="{Binding Invert_Command}"
<CheckBox IsChecked="{Binding IsInverted, UpdateSourceTrigger=PropertyChanged}"
HorizontalAlignment="Center"
VerticalAlignment="Center"/>
</DataTemplate>
@@ -297,7 +365,7 @@
<DataGridTemplateColumn x:Key="colVERIFY">
<DataGridTemplateColumn.HeaderTemplate>
<DataTemplate>
<TextBlock Text="Verifica"/>
<Image Source="/Resources/NewPage/VerifyIntestazione.png" Stretch="Uniform" Height="20"/>
</DataTemplate>
</DataGridTemplateColumn.HeaderTemplate>
<DataGridTemplateColumn.CellTemplate>
@@ -305,8 +373,7 @@
<Button ToolTip="{Binding Verify_ToolTip}"
Command="{Binding Verify_Command}"
IsEnabled="{Binding Verify_IsEnabled}"
Height="15" Width="15" Margin="0"
Style="{StaticResource ToolBarViewPanel_Button}">
Style="{StaticResource BTLPanel_Button}">
<Image Source="/Resources/CALCPanel/Verify.png" Stretch="Uniform"/>
</Button>
</DataTemplate>
@@ -316,7 +383,7 @@
<DataGridTemplateColumn x:Key="colADD">
<DataGridTemplateColumn.HeaderTemplate>
<DataTemplate>
<TextBlock Text="{Binding Path=DataContext.AddToRawPart_Msg,RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdBTLPartListV}}}"/>
<Image Source="/Resources/NewPage/AddToRawPartIntestazione.png" Stretch="Uniform" Height="20"/>
</DataTemplate>
</DataGridTemplateColumn.HeaderTemplate>
<DataGridTemplateColumn.CellTemplate>
@@ -325,8 +392,7 @@
Visibility="{Binding MachiningPage_Visibility}"
ToolTip="{Binding AddToRawPart_ToolTip}"
IsEnabled="{Binding BTLPartManager_IsEnabled}"
Height="15" Width="15" Margin="0"
Style="{StaticResource OnlyProdLeftPanel_Button}">
Style="{StaticResource BTLPanel_Button}">
<Image Source="/Resources/LeftPanel/AddToRawPart.png" Stretch="Uniform"/>
</Button>
</DataTemplate>
@@ -336,7 +402,7 @@
<DataGridTemplateColumn x:Key="colSETTING">
<DataGridTemplateColumn.HeaderTemplate>
<DataTemplate>
<TextBlock Text="Opzioni"/>
<Image Source="/Resources/NewPage/SettingIntestazione.png" Stretch="Uniform" Height="20"/>
</DataTemplate>
</DataGridTemplateColumn.HeaderTemplate>
<DataGridTemplateColumn.CellTemplate>
@@ -344,14 +410,13 @@
<StackPanel>
<Button Command="{Binding ShowPopUpSettingBtnCommand}"
ToolTip="{Binding Settings_Command_ToolTip}"
Height="15" Width="15" Margin="0">
Style="{StaticResource BTLPanel_Button}"
Click="Button_Click">
<Image Source="/Resources/NewPage/Setting.png" Stretch="Uniform"/>
</Button>
<Popup IsOpen="{Binding IsSettingBtnOpen}"
AllowsTransparency="True"
<Popup AllowsTransparency="True"
PopupAnimation="Scroll"
StaysOpen="False"
PlacementTarget="{Binding ElementName=BTLPart_DataGrid.Button}">
StaysOpen="False">
<EgtBEAMWALL:OnlyProdBTLPartManagerV/>
</Popup>
</StackPanel>
@@ -363,29 +428,27 @@
<DataGrid.RowDetailsTemplate>
<DataTemplate>
<ListBox ItemsSource="{Binding BTLFeatureVMList}"
SelectedItem="{Binding SelBTLFeatureVM, UpdateSourceTrigger=PropertyChanged}"
SelectedItem="{Binding SelBTLFeatureVMOnlyGraph, UpdateSourceTrigger=PropertyChanged}"
PreviewMouseWheel="ListBox_PreviewMouseWheel"
SelectionMode="Single"
IsSynchronizedWithCurrentItem="True">
Width="860" Margin="20,0,0,0"
Style="{StaticResource BTL_ListBox}">
<ListBox.ItemTemplate>
<DataTemplate>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="50"/>
<ColumnDefinition Width="40"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<CheckBox IsChecked="{Binding bDO, UpdateSourceTrigger=PropertyChanged}"
VerticalAlignment="Center"
HorizontalAlignment="Center"
Margin="15,0,2.5,0"/>
<TextBlock Grid.Column="1"
Text="{Binding sDescGRP}"
Margin="2.5,0,10,0"
<TextBlock Text="{Binding nPRID}"
Style="{StaticResource OnlyProd_TextBlock}"/>
<Grid Grid.Column="2"
Margin="2.5,0,2.5,0">
<Grid Grid.Column="1">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="10"/>
@@ -404,9 +467,28 @@
Style="{StaticResource OnlyProdFeatureInPartInRawPartList_TextBlock}"/>
</Grid>
</Grid>
<CheckBox Grid.Column="2"
IsChecked="{Binding bDO, UpdateSourceTrigger=PropertyChanged}"
VerticalAlignment="Center"
HorizontalAlignment="Center"
Margin="0,0,5,0"/>
<TextBlock Grid.Column="3"
Text="{Binding sName}"
Margin="2.5,0,10,0"
Text="["
Style="{StaticResource OnlyProd_TextBlock}"/>
<TextBlock Grid.Column="4"
Text="{Binding nSelGRP}"
Style="{StaticResource OnlyProd_TextBlock}"/>
<TextBlock Grid.Column="5"
Text="-"
Style="{StaticResource OnlyProd_TextBlock}"/>
<TextBlock Grid.Column="6"
Text="{Binding nPRC, StringFormat={}{0:000}}"
Style="{StaticResource OnlyProd_TextBlock}"/>
<TextBlock Grid.Column="7"
Text="] "
Style="{StaticResource OnlyProd_TextBlock}"/>
<TextBlock Grid.Column="8"
Text="{Binding sName}" FontSize="11" HorizontalAlignment="Center" VerticalAlignment="Center"
Style="{StaticResource OnlyProd_TextBlock}"/>
</Grid>
</DataTemplate>
@@ -1,4 +1,5 @@
Imports System.Reflection
Imports System.Windows.Controls.Primitives
Public Class OnlyProdBTLPartListV
@@ -20,105 +21,8 @@ Public Class OnlyProdBTLPartListV
' Evita il drag sulla selezione multipla
s_isDraggingSelectionField = m_NameDataGridType.GetField("_isDraggingSelection", BindingFlags.Instance Or BindingFlags.NonPublic)
s_endDraggingMethod = m_NameDataGridType.GetMethod("EndDragging", BindingFlags.Instance Or BindingFlags.NonPublic)
'SetSelButton(MouseButton.Right)
End Sub
Public Sub SetSelButton(SelButton As MouseButton)
Select Case SelButton
Case MouseButton.Right
m_SelectBtn = MouseButton.Right
m_HighlightBtn = MouseButton.Left
Case Else ' MouseButton.Left
m_SelectBtn = MouseButton.Left
m_HighlightBtn = MouseButton.Right
End Select
End Sub
Public Sub DataGrid_PreviewMouseDown(sender As Object, e As MouseButtonEventArgs)
'If e.ChangedButton = MouseButton.Left Then
' If e.ChangedButton = m_SelectBtn Then
' If (Keyboard.Modifiers And ModifierKeys.Shift) = ModifierKeys.Shift OrElse (Keyboard.Modifiers And ModifierKeys.Control) = ModifierKeys.Control Then
' e.Handled = True
' Else
' Map.refProjectVM.BTLStructureVM.SetSelectionType(BTLStructureVM.SelectionTypes.SELECT_)
' End If
' ElseIf e.ChangedButton = m_HighlightBtn AndAlso (Map.refProjectVM.BTLStructureVM.SelectionType = BTLStructureVM.SelectionTypes.SELECT_ AndAlso
' ((Keyboard.Modifiers And ModifierKeys.Shift) = ModifierKeys.Shift OrElse (Keyboard.Modifiers And ModifierKeys.Control) = ModifierKeys.Control)) Then
' e.Handled = True
' ElseIf e.ChangedButton = m_HighlightBtn Then
' Map.refProjectVM.BTLStructureVM.SetSelectionType(BTLStructureVM.SelectionTypes.HIGHLIGHT)
' End If
' If TypeOf sender Is EgtBEAMWALL.Core.EgtDataGrid Then
' Dim EgtDataGridList As EgtBEAMWALL.Core.EgtDataGrid = DirectCast(sender, EgtBEAMWALL.Core.EgtDataGrid)
' If Not IsNothing(EgtDataGridList) AndAlso Not IsNothing(EgtDataGridList.SelectedItem) Then
' Map.refProjectVM.BTLStructureVM.SelectBTLPart(EgtDataGridList.SelectedItem)
' 'If TypeOf EgtDataGridList.SelectedItem IsNot BTLPartVM Then Return
' 'Dim VM As BTLPartVM = DirectCast(EgtDataGridList.SelectedItem, BTLPartVM)
' 'VM.SetOpenFeatureList(Not VM.bOpenFeatureList)
' 'If EgtDataGridList.SelectedItem Then
' ' VM.bOpenFeatureList = Not VM.bOpenFeatureList
' 'Else
' 'VM.bOpenFeatureList = False
' 'End If
' End If
' End If
' ' imposto tipo di grid selezionata
' If Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE Then Map.refProjectVM.SetLastSelGridType(ProjectVM.GridSelTypes.PART)
'Else
' ' imposto tipo di grid selezionata
' If Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE Then
' Map.refProjectVM.SetLastSelGridType(ProjectVM.GridSelTypes.MACHGROUP)
' Map.refSceneHostVM.MainScene.ZoomAll()
' End If
'End If
End Sub
Public Sub DataGrid_PreviewMouseUp(sender As Object, e As MouseButtonEventArgs)
'If e.ChangedButton = MouseButton.Right Then
' If e.ChangedButton = m_SelectBtn Then
' If (Keyboard.Modifiers And ModifierKeys.Shift) = ModifierKeys.Shift OrElse (Keyboard.Modifiers And ModifierKeys.Control) = ModifierKeys.Control Then
' e.Handled = True
' Else
' Map.refProjectVM.BTLStructureVM.SetSelectionType(BTLStructureVM.SelectionTypes.SELECT_)
' End If
' ElseIf e.ChangedButton = m_HighlightBtn Then
' Map.refProjectVM.BTLStructureVM.SetSelectionType(BTLStructureVM.SelectionTypes.HIGHLIGHT)
' End If
' ' imposto tipo di grid selezionata
' If Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE Then Map.refProjectVM.SetLastSelGridType(ProjectVM.GridSelTypes.PART)
'End If
End Sub
Public Shared Function FindVisualParent(Of T As DependencyObject)(ByVal child As DependencyObject) As T
Dim parentObject As DependencyObject = VisualTreeHelper.GetParent(child)
If parentObject Is Nothing Then Return Nothing
Dim parent As T = TryCast(parentObject, T)
If parent IsNot Nothing Then
Return parent
Else
Return FindVisualParent(Of T)(parentObject)
End If
End Function
Public Shared Function FindVisualParents(Of T As DependencyObject, U As DependencyObject, V As DependencyObject)(ByVal child As DependencyObject) As Object
Dim parentObject As DependencyObject = VisualTreeHelper.GetParent(child)
If parentObject Is Nothing Then Return Nothing
If TypeOf parentObject Is T Then
Return parentObject
ElseIf TypeOf parentObject Is U Then
Return parentObject
ElseIf TypeOf parentObject Is V Then
Return parentObject
Else
Return FindVisualParents(Of T, U, V)(parentObject)
End If
End Function
Public Sub DataGrid_PreviewMouseMove(sender As Object, e As MouseEventArgs)
' Evita il drag sulla selezione multipla
If m_SelectBtn = MouseButton.Left AndAlso e.LeftButton = MouseButtonState.Pressed Then
@@ -133,84 +37,19 @@ Public Class OnlyProdBTLPartListV
Dim Row As DataGridRow = DirectCast(sender, DataGridRow)
If TypeOf Row.DataContext IsNot BTLPartVM Then Return
Dim BTLPartVM As BTLPartVM = DirectCast(Row.DataContext, BTLPartVM)
Dim DataGridDetailsPresenter As Object = FindVisualParents(Of Button, CheckBox, Primitives.DataGridDetailsPresenter)(e.OriginalSource)
If Not IsNothing(DataGridDetailsPresenter) Then Return
'Dim parent = e.OriginalSource
'While Not IsNothing(parent)
' parent = VisualTreeHelper.GetParent(parent)
'End While
Dim DataGridDetailsPresenter As Object = TreeHelperManager.FindVisualParents(Of Button, CheckBox, Primitives.DataGridDetailsPresenter)(e.OriginalSource)
Dim bSelWithoutOpenFeatureList As Boolean = Not IsNothing(DataGridDetailsPresenter)
Map.refProjectVM.BTLStructureVM.SetSelWithoutOpenFeatureList(bSelWithoutOpenFeatureList)
If bSelWithoutOpenFeatureList Then Return
If Map.refProjectVM.BTLStructureVM.SelBTLParts.Contains(BTLPartVM) Then
BTLPartVM.SetOpenFeatureList(Not BTLPartVM.bOpenFeatureList)
End If
If Not IsNothing(Row) AndAlso Row.IsSelected AndAlso Not IsNothing(Map.refProjectVM.BTLStructureVM.SelBTLPart) AndAlso Map.refProjectVM.BTLStructureVM.SelBTLPart.Equals(BTLPartVM) Then
Map.refProjectVM.BTLStructureVM.ReSelectBTLPart(BTLPartVM)
End If
End If
End If
'If TypeOf sender Is DataGridRow Then
' Dim Row As DataGridRow = DirectCast(sender, DataGridRow)
' If Not Row.IsSelected Then Return
' If TypeOf Row.DataContext IsNot BTLPartVM Then Return
' Dim VM As BTLPartVM = DirectCast(Row.DataContext, BTLPartVM)
' If VM.bOpenFeatureList Then
' VM.bOpenFeatureList = False
' End If
'End If
'If TypeOf sender Is DataGridRow Then
' Dim Row As DataGridRow = DirectCast(sender, DataGridRow)
' If Not Row.IsSelected Then Return
' Select Case e.ChangedButton
' Case MouseButton.Left
' If (Keyboard.Modifiers And ModifierKeys.Shift) = ModifierKeys.Shift OrElse (Keyboard.Modifiers And ModifierKeys.Control) = ModifierKeys.Control Then
' Return
' Else
' BTLPart_DataGrid.SelectedItem = Nothing
' BTLPart_DataGrid.SelectedItem = Row.DataContext
' End If
' Case MouseButton.Right
' End Select
'End If
End Sub
Private Sub PartList_PreviewMouseUp(sender As Object, e As MouseButtonEventArgs)
'If e.ChangedButton = MouseButton.Left Then
' If TypeOf sender Is DataGridRow Then
' Dim Row As DataGridRow = DirectCast(sender, DataGridRow)
' If TypeOf Row.DataContext IsNot BTLPartVM Then Return
' Dim VM As BTLPartVM = DirectCast(Row.DataContext, BTLPartVM)
' VM.SetOpenFeatureList(Not VM.bOpenFeatureList)
' If Row.IsSelected Then
' VM.bOpenFeatureList = Not VM.bOpenFeatureList
' Else
' VM.bOpenFeatureList = False
' End If
' End If
'End If
'If TypeOf sender Is DataGridRow Then
' Dim Row As DataGridRow = DirectCast(sender, DataGridRow)
' If Not Row.IsSelected Then Return
' Select Case e.ChangedButton
' Case MouseButton.Right
' If (Keyboard.Modifiers And ModifierKeys.Shift) = ModifierKeys.Shift OrElse (Keyboard.Modifiers And ModifierKeys.Control) = ModifierKeys.Control Then
' Row.IsSelected = Not Row.IsSelected
' Else
' BTLPart_DataGrid.SelectedItem = Nothing
' BTLPart_DataGrid.SelectedItem = Row.DataContext
' ' metto focus su cella selezionata per evitare errori di focus del sistema normale
' Dim dep As DependencyObject = CType(e.OriginalSource, DependencyObject)
' While (dep IsNot Nothing) AndAlso Not (TypeOf dep Is DataGridCell)
' dep = VisualTreeHelper.GetParent(dep)
' End While
' If dep Is Nothing Then Return
' If TypeOf dep Is DataGridCell Then
' Dim cell As DataGridCell = TryCast(dep, DataGridCell)
' cell.Focus()
' End If
' End If
' End Select
'End If
End Sub
Private Sub ListBox_PreviewMouseWheel(ByVal sender As Object, ByVal e As MouseWheelEventArgs)
@@ -232,4 +71,22 @@ Public Class OnlyProdBTLPartListV
.Source = sender})
End Sub
Private Sub Button_Click(sender As Object, e As RoutedEventArgs)
Dim btn As Button = DirectCast(sender, Button) ' Ottieni il bottone che ha generato l'evento
Dim parent As DependencyObject = btn
' Cerca il Popup nel Visual Tree
While parent IsNot Nothing AndAlso Not TypeOf parent Is DataGridRow
parent = VisualTreeHelper.GetParent(parent)
End While
If parent IsNot Nothing Then
Dim row As DataGridRow = DirectCast(parent, DataGridRow)
Dim popup As Popup = TryCast(TreeHelperManager.FindVisualChild(Of Popup)(row), Popup)
If popup IsNot Nothing Then
popup.PlacementTarget = btn ' Associa il popup al bottone
popup.IsOpen = True ' Mostra il popup
End If
End If
End Sub
End Class
@@ -14,13 +14,13 @@
BeginningEdit="FeatureInPartInRawPartList_BeginningEdit"
AlternatingRowBackground="{StaticResource BeamWall_LinkWater}"
AlternationCount="2"
ColumnHeaderBackground="{StaticResource BeamWall_NeonCarrot}"
ColumnHeaderBackground="{StaticResource BeamWall_Teal}"
ColumnHeaderForeground="{StaticResource BeamWall_White}"
ColumnHeaderHorizontalContentAlignment="Center"
ColumnHeaderFontWeight="Bold"
ColumnHeaderFontSize="15"
ColumnHeaderPadding="0,2,0,2"
CellStyle="{StaticResource CellDataGrid_CustomHighLight_PartList}"
CellStyle="{StaticResource CellDataGrid_CustomHighLight}"
Style="{StaticResource DataGrid_OnlyProd}">
<DataGrid.InputBindings>
@@ -10,21 +10,21 @@
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<EgtBEAMWALLCORE:EgtDataGrid ItemsSource="{Binding Tag.BTLFeatureVMList, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdFeatureListV}}}"
SelectedItem="{Binding Tag.SelBTLFeatureVM, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdFeatureListV}}}"
SelectionMode="Single"
Margin="0,0,0,5"
IsEnabled="{Binding FeatureList_IsEnabled}"
BindingColumns="{Binding FeatureColumns}"
AlternatingRowBackground="{StaticResource BeamWall_LinkWater}"
AlternationCount="2"
ColumnHeaderBackground="{StaticResource BeamWall_Keppel}"
ColumnHeaderForeground="{StaticResource BeamWall_White}"
ColumnHeaderHorizontalContentAlignment="Center"
ColumnHeaderFontWeight="Bold"
ColumnHeaderFontSize="15"
ColumnHeaderPadding="0,2,0,2"
CellStyle="{StaticResource CellDataGrid_CustomHighLight}"
Style="{StaticResource DataGrid_OnlyProd}">
SelectedItem="{Binding Tag.SelBTLFeatureVM, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdFeatureListV}}}"
SelectionMode="Single"
Margin="0,0,0,5"
IsEnabled="{Binding FeatureList_IsEnabled}"
BindingColumns="{Binding FeatureColumns}"
AlternatingRowBackground="{StaticResource BeamWall_LinkWater}"
AlternationCount="2"
ColumnHeaderBackground="{StaticResource BeamWall_Keppel}"
ColumnHeaderForeground="{StaticResource BeamWall_White}"
ColumnHeaderHorizontalContentAlignment="Center"
ColumnHeaderFontWeight="Bold"
ColumnHeaderFontSize="15"
ColumnHeaderPadding="0,2,0,2"
CellStyle="{StaticResource CellDataGrid_CustomHighLight}"
Style="{StaticResource DataGrid_OnlyProd}">
<DataGrid.Resources>
<!--DO - Abilitazione-->
@@ -135,7 +135,7 @@
<Button Command="{Binding Cancel_Command}"
ToolTip="{Binding Cancel_Msg}"
Style="{StaticResource ToolBarViewPanel_Button}">
<Image Source="/Resources/NewPage/Cancel.png" Stretch="Uniform"/>
<Image Source="/Resources/PDFEditor/Delete.png" Stretch="Uniform"/>
</Button>
</StackPanel>
</Grid>
@@ -16,16 +16,16 @@
BeginningEdit="RawPartList_BeginningEdit"
AlternatingRowBackground="{StaticResource BeamWall_LinkWater}"
AlternationCount="2"
ColumnHeaderBackground="{StaticResource BeamWall_Christine}"
ColumnHeaderBackground="{StaticResource BeamWall_Teal}"
ColumnHeaderForeground="{StaticResource BeamWall_White}"
ColumnHeaderHorizontalContentAlignment="Center"
ColumnHeaderFontWeight="Bold"
ColumnHeaderFontSize="15"
ColumnHeaderPadding="0,2,0,2"
CellStyle="{StaticResource CellDataGrid_CustomHighLight_PartList}"
CellStyle="{StaticResource CellDataGrid_CustomHighLight}"
Style="{StaticResource DataGrid_OnlyProd}">
<DataGrid.RowStyle>
<Style TargetType="DataGridRow" BasedOn="{StaticResource RowDataGrid_CustomHighLight_PartList}">
<Style TargetType="DataGridRow" BasedOn="{StaticResource RowDataGrid_CustomHighLight}">
<Setter Property="Background" Value="{Binding Background}"/>
<EventSetter Event="PreviewMouseDown" Handler="RawPartRow_PreviewMouseDown"/>
</Style>
@@ -39,7 +39,7 @@
<TextBlock Text="{Binding Path=DataContext.ID_Msg, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdRawPartListV}}}"/>
</DataGridTextColumn.Header>
<DataGridTextColumn.CellStyle>
<Style TargetType="{x:Type DataGridCell}" BasedOn="{StaticResource CellDataGrid_CustomHighLight_PartList}">
<Style TargetType="{x:Type DataGridCell}" BasedOn="{StaticResource CellDataGrid_CustomHighLight}">
<Setter Property="BorderBrush" Value="{Binding Search_Background}"/>
<Setter Property="BorderThickness" Value="2,2,0,2"/>
</Style>
@@ -53,7 +53,7 @@
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="10"/>
<ColumnDefinition Width="15"/>
</Grid.ColumnDefinitions>
<TextBlock Text="↓"
Visibility="{Binding CALC_FALL_Visibility}"
@@ -167,7 +167,7 @@
<DataGridTemplateColumn x:Key="colVERIFY">
<DataGridTemplateColumn.HeaderTemplate>
<DataTemplate>
<TextBlock Text="Verifica"/>
<Image Source="/Resources/NewPage/VerifyIntestazione.png" Stretch="Uniform" Height="20"/>
</DataTemplate>
</DataGridTemplateColumn.HeaderTemplate>
<DataGridTemplateColumn.CellTemplate>
@@ -175,8 +175,7 @@
<Button ToolTip="{Binding Verify_ToolTip}"
Command="{Binding Verify_Command}"
IsEnabled="{Binding Verify_IsEnabled}"
Height="15" Width="15" Margin="0"
Style="{StaticResource ToolBarViewPanel_Button}">
Style="{StaticResource BTLPanel_Button}">
<Image Source="/Resources/CALCPanel/Verify.png" Stretch="Uniform"/>
</Button>
</DataTemplate>
@@ -186,7 +185,7 @@
<DataGridTemplateColumn x:Key="colSIMUL">
<DataGridTemplateColumn.HeaderTemplate>
<DataTemplate>
<TextBlock Text="Simula"/>
<TextBlock Text="CAM"/>
</DataTemplate>
</DataGridTemplateColumn.HeaderTemplate>
<DataGridTemplateColumn.CellTemplate>
@@ -194,8 +193,7 @@
<Button ToolTip="{Binding Simulate_ToolTip}"
Command="{Binding Simulate_Command}"
IsEnabled="{Binding Simulate_IsEnabled}"
Width="15" Height="15" Margin="0"
Style="{StaticResource ToolBarViewPanel_Button}">
Style="{StaticResource BTLPanel_Button}">
<Image Source="/Resources/CALCPanel/Simulate.png" Stretch="Uniform"/>
</Button>
</DataTemplate>
@@ -205,7 +203,7 @@
<DataGridTemplateColumn x:Key="colPROD">
<DataGridTemplateColumn.HeaderTemplate>
<DataTemplate>
<TextBlock Text="Produci"/>
<Image Source="/Resources/NewPage/ProduceRawPartIntestazione.png" Stretch="Uniform" Height="20"/>
</DataTemplate>
</DataGridTemplateColumn.HeaderTemplate>
<DataGridTemplateColumn.CellTemplate>
@@ -213,8 +211,7 @@
<Button Command="{Binding ProduceRawPart_Command}"
ToolTip="{Binding ProduceRawPart_ToolTip}"
IsEnabled="{Binding RawPartManagerIsEnabled}"
Width="15" Height="15" Margin="0"
Style="{StaticResource OnlyProdLeftPanel_Button}">
Style="{StaticResource BTLPanel_Button}">
<Image Source="/Resources/TopPanel/ProduceRawPart.png" Stretch="Uniform"/>
</Button>
</DataTemplate>
@@ -224,7 +221,7 @@
<DataGridTemplateColumn x:Key="colSETTING">
<DataGridTemplateColumn.HeaderTemplate>
<DataTemplate>
<TextBlock Text="Opzioni"/>
<Image Source="/Resources/NewPage/SettingIntestazione.png" Stretch="Uniform" Height="20"/>
</DataTemplate>
</DataGridTemplateColumn.HeaderTemplate>
<DataGridTemplateColumn.CellTemplate>
@@ -232,14 +229,13 @@
<StackPanel Margin="2">
<Button Command="{Binding ShowPopUpSettingBtnCommand}"
ToolTip="{Binding Settings_Command_ToolTip}"
Height="15" Width="15" Margin="0">
Style="{StaticResource BTLPanel_Button}"
Click="Button_Click">
<Image Source="/Resources/NewPage/Setting.png" Stretch="Uniform"/>
</Button>
<Popup IsOpen="{Binding IsSettingBtnOpen}"
AllowsTransparency="True"
<Popup AllowsTransparency="True"
PopupAnimation="Scroll"
StaysOpen="False"
PlacementTarget="{Binding ElementName=MachGroupVMList_DataGrid.Button}">
StaysOpen="False">
<StackPanel Style="{StaticResource OnlyProdBTLPartManager_StackPanel}">
<!--COPY - Copia-->
<Button Command="{Binding CopyRawPart_Command}"
@@ -255,7 +251,7 @@
IsEnabled="{Binding RawPartManagerIsEnabled}"
Height="20" Width="20"
Style="{StaticResource OnlyProdLeftPanel_Button}">
<Image Source="/Resources/TopPanel/RemoveRawPart.png" Stretch="Uniform"/>
<Image Source="/Resources/NewPage/Remove.png" Stretch="Uniform"/>
</Button>
<!--CAM - CAM-->
<Button ToolTip="{Binding Simulate_ToolTip}"
@@ -282,7 +278,6 @@
Style="{StaticResource OnlyProdLeftPanel_Button}">
<Image Source="/Resources/CALCPanel/ResetCalc.png" Stretch="Uniform"/>
</Button>
</StackPanel>
</Popup>
</StackPanel>
@@ -297,27 +292,32 @@
<DataGrid.RowDetailsTemplate>
<DataTemplate>
<StackPanel>
<EgtBEAMWALLCORE:EgtDataGrid ItemsSource="{Binding PartVMList}"
SelectedItem="{Binding SelPart, UpdateSourceTrigger=PropertyChanged}"
<EgtBEAMWALLCORE:EgtDataGrid ItemsSource="{Binding Tag.SelectedMachGroup.PartVMList,
RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdRawPartListV}}}"
SelectedItem="{Binding Tag.SelectedMachGroup.SelPart,
RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdRawPartListV}}}"
CanUserDeleteRows="False"
CanUserSortColumns="False"
SelectionMode="Single"
Margin="20,0,0,5"
Margin="15,0,0,5"
BeginningEdit="PartInRawPartList_BeginningEdit"
BindingColumns="{Binding DataContext.PartInRawPartColumns, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdRawPartListV}}}"
AlternatingRowBackground="{StaticResource BeamWall_LinkWater}"
AlternationCount="2"
ColumnHeaderBackground="{StaticResource BeamWall_Christine}"
ColumnHeaderForeground="{StaticResource BeamWall_White}"
ColumnHeaderBackground="{StaticResource BeamWall_White}"
ColumnHeaderHorizontalContentAlignment="Center"
ColumnHeaderFontWeight="Bold"
ColumnHeaderFontSize="15"
ColumnHeaderFontWeight="SemiBold"
ColumnHeaderFontSize="13"
ColumnHeaderPadding="0,2,0,2"
CellStyle="{StaticResource CellDataGrid_CustomHighLight_PartList}"
FontSize="11"
GridLinesVisibility="None"
BorderThickness="0"
ScrollViewer.HorizontalScrollBarVisibility="Hidden"
Width="860"
CellStyle="{StaticResource CellDataGrid_CustomHighLight}"
Style="{StaticResource DataGrid_OnlyProd}">
<DataGrid.RowStyle>
<Style TargetType="DataGridRow" BasedOn="{StaticResource RowDataGrid_CustomHighLight_PartList}">
<Style TargetType="DataGridRow" BasedOn="{StaticResource RowDataGrid_CustomHighLight}">
<Setter Property="Background" Value="{Binding Background}"/>
<!--<EventSetter Event="PreviewMouseDown" Handler="PartInRawPartRow_PreviewMouseDown"/>-->
<EventSetter Event="PreviewMouseDown" Handler="PartInRawPartRow_PreviewMouseDown"/>
</Style>
</DataGrid.RowStyle>
@@ -328,9 +328,9 @@
<TextBlock Text="{Binding Path=DataContext.PDN_Msg,RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdRawPartListV}}}"/>
</DataGridTextColumn.Header>
<DataGridTextColumn.CellStyle>
<Style TargetType="{x:Type DataGridCell}" BasedOn="{StaticResource CellDataGrid_CustomHighLight_PartList}">
<Style TargetType="{x:Type DataGridCell}" BasedOn="{StaticResource CellDataGrid_CustomHighLight}">
<Setter Property="BorderBrush" Value="{Binding Search_Background}"/>
<Setter Property="BorderThickness" Value="2,2,0,2"/>
<Setter Property="BorderThickness" Value="2,4,0,2"/>
</Style>
</DataGridTextColumn.CellStyle>
</DataGridTextColumn>
@@ -382,30 +382,28 @@
<DataGridTextColumn.Header>
<TextBlock Text="{Binding Path=DataContext.NAM_Msg,RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdRawPartListV}}}"/>
</DataGridTextColumn.Header>
</DataGridTextColumn>
<!--W - Larghezza-->
<DataGridTextColumn x:Key="colW" Binding="{Binding sW}" SortMemberPath="dW">
<DataGridTextColumn.Header>
<TextBlock Text="{Binding Path=DataContext.W_Msg,RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdRawPartListV}}}"/>
</DataGridTextColumn.Header>
</DataGridTextColumn>
<!--H - Altezza-->
<DataGridTextColumn x:Key="colH" Binding="{Binding sH}" SortMemberPath="dH">
<DataGridTextColumn.Header>
<TextBlock Text="{Binding Path=DataContext.H_Msg,RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdRawPartListV}}}"/>
</DataGridTextColumn.Header>
<DataGridTextColumn.CellStyle>
<Style TargetType="{x:Type DataGridCell}" BasedOn="{StaticResource CellDataGrid_CustomHighLight}">
<Setter Property="BorderThickness" Value="2,4,0,2"/>
</Style>
</DataGridTextColumn.CellStyle>
</DataGridTextColumn>
<!--L - Lunghezza-->
<DataGridTextColumn x:Key="colL" Binding="{Binding sL}" SortMemberPath="dL">
<DataGridTextColumn.Header>
<TextBlock Text="{Binding Path=DataContext.L_Msg,RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdRawPartListV}}}"/>
</DataGridTextColumn.Header>
<DataGridTextColumn.CellStyle>
<Style TargetType="{x:Type DataGridCell}" BasedOn="{StaticResource CellDataGrid_CustomHighLight}">
<Setter Property="BorderThickness" Value="2,4,0,2"/>
</Style>
</DataGridTextColumn.CellStyle>
</DataGridTextColumn>
<!--ROT - Rotazione-->
<DataGridTemplateColumn x:Key="colROT" SortMemberPath="dROT">
<DataGridTemplateColumn.HeaderTemplate>
<DataTemplate>
<TextBlock Text="{Binding Path=DataContext.ROTATION_Msg,RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdRawPartListV}}}"/>
<Image Source="/Resources/NewPage/RotateIntestazioneRawPart.png" Stretch="Uniform" Height="20"/>
</DataTemplate>
</DataGridTemplateColumn.HeaderTemplate>
<DataGridTemplateColumn.CellTemplate>
@@ -416,12 +414,13 @@
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<TextBlock Text="{Binding sROT}"
TextAlignment="Center"/>
TextAlignment="Center"
Margin="2,3,0,2"/>
<Button Grid.Column="1"
Command="{Binding ForwardRotation_Command}"
Height="15" Width="15"
Margin="-5,0,5,0">
<Image Source="/Resources/PartManager/RightRotate.png" Stretch="Uniform"/>
Margin="-5,0,5,0"
Style="{StaticResource RawPart_Button}">
<Image Source="/Resources/NewPage/Rotate.png" Stretch="Uniform"/>
</Button>
</Grid>
</DataTemplate>
@@ -431,7 +430,7 @@
<DataGridTemplateColumn x:Key="colFLIP">
<DataGridTemplateColumn.HeaderTemplate>
<DataTemplate>
<TextBlock Text="{Binding Path=DataContext.INVERSION_Msg,RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdRawPartListV}}}"/>
<Image Source="/Resources/NewPage/InversionIntestazioneRawPart.png" Stretch="Uniform" Height="20"/>
</DataTemplate>
</DataGridTemplateColumn.HeaderTemplate>
<DataGridTemplateColumn.CellTemplate>
@@ -449,6 +448,11 @@
<TextBlock Text="{Binding Path=DataContext.PosX_Msg,RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdRawPartListV}}}"/>
</DataTemplate>
</DataGridTextColumn.HeaderTemplate>
<DataGridTextColumn.CellStyle>
<Style TargetType="{x:Type DataGridCell}" BasedOn="{StaticResource CellDataGrid_CustomHighLight}">
<Setter Property="BorderThickness" Value="2,4,0,2"/>
</Style>
</DataGridTextColumn.CellStyle>
<DataGridTextColumn.EditingElementStyle>
<Style TargetType="{x:Type TextBox}">
<Setter Property="Foreground" Value="Blue" />
@@ -462,6 +466,11 @@
<TextBlock Text="{Binding Path=DataContext.PosY_Msg,RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdRawPartListV}}}"/>
</DataTemplate>
</DataGridTextColumn.HeaderTemplate>
<DataGridTextColumn.CellStyle>
<Style TargetType="{x:Type DataGridCell}" BasedOn="{StaticResource CellDataGrid_CustomHighLight}">
<Setter Property="BorderThickness" Value="2,4,0,2"/>
</Style>
</DataGridTextColumn.CellStyle>
<DataGridTextColumn.EditingElementStyle>
<Style TargetType="{x:Type TextBox}">
<Setter Property="Foreground" Value="Blue" />
@@ -475,6 +484,11 @@
<TextBlock Text="{Binding Path=DataContext.Offset_Msg,RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdRawPartListV}}}"/>
</DataTemplate>
</DataGridTextColumn.HeaderTemplate>
<DataGridTextColumn.CellStyle>
<Style TargetType="{x:Type DataGridCell}" BasedOn="{StaticResource CellDataGrid_CustomHighLight}">
<Setter Property="BorderThickness" Value="2,4,0,2"/>
</Style>
</DataGridTextColumn.CellStyle>
<DataGridTextColumn.EditingElementStyle>
<Style TargetType="{x:Type TextBox}">
<Setter Property="Foreground" Value="Blue" />
@@ -486,33 +500,48 @@
<DataGridTextColumn.Header>
<TextBlock Text="{Binding Path=DataContext.MAT_Msg,RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdRawPartListV}}}"/>
</DataGridTextColumn.Header>
<DataGridTextColumn.CellStyle>
<Style TargetType="{x:Type DataGridCell}" BasedOn="{StaticResource CellDataGrid_CustomHighLight}">
<Setter Property="BorderThickness" Value="2,4,0,2"/>
</Style>
</DataGridTextColumn.CellStyle>
</DataGridTextColumn>
<!--GRP - Gruppo-->
<DataGridTextColumn x:Key="colGROUP" Binding="{Binding sGROUP}">
<DataGridTextColumn.Header>
<TextBlock Text="{Binding Path=DataContext.GRP_Msg,RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdRawPartListV}}}"/>
</DataGridTextColumn.Header>
<DataGridTextColumn.CellStyle>
<Style TargetType="{x:Type DataGridCell}" BasedOn="{StaticResource CellDataGrid_CustomHighLight}">
<Setter Property="BorderThickness" Value="2,4,0,2"/>
</Style>
</DataGridTextColumn.CellStyle>
</DataGridTextColumn>
<!--STOREY - Sottogruppo-->
<DataGridTextColumn x:Key="colSTOREY" Binding="{Binding sSTOREY}">
<DataGridTextColumn.Header>
<TextBlock Text="{Binding Path=DataContext.STOREY_Msg,RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdRawPartListV}}}"/>
</DataGridTextColumn.Header>
<DataGridTextColumn.CellStyle>
<Style TargetType="{x:Type DataGridCell}" BasedOn="{StaticResource CellDataGrid_CustomHighLight}">
<Setter Property="BorderThickness" Value="2,4,0,2"/>
</Style>
</DataGridTextColumn.CellStyle>
</DataGridTextColumn>
<!--MUP - MoveUp-->
<DataGridTemplateColumn x:Key="colMOVEUP">
<DataGridTemplateColumn.HeaderTemplate>
<DataTemplate>
<TextBlock Text="Move Up"/>
<TextBlock Text=""/>
</DataTemplate>
</DataGridTemplateColumn.HeaderTemplate>
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<Button Command="{Binding MoveUpPart_Command}"
ToolTip="{Binding MoveUpPart_ToolTip}"
Width="15" Height="15" Margin="0"
Style="{StaticResource OnlyProdLeftPanel_Button}">
<Image Source="/Resources/TopPanel/MoveUpPart.png" Stretch="Uniform"/>
Margin="0"
Style="{StaticResource RawPart_Button}">
<Image Source="/Resources/NewPage/MoveUp.png" Stretch="Uniform"/>
</Button>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
@@ -521,16 +550,16 @@
<DataGridTemplateColumn x:Key="colMOVEDOWN">
<DataGridTemplateColumn.HeaderTemplate>
<DataTemplate>
<TextBlock Text="Move Down"/>
<TextBlock Text=""/>
</DataTemplate>
</DataGridTemplateColumn.HeaderTemplate>
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<Button Command="{Binding MoveDownPart_Command}"
ToolTip="{Binding MoveDownPart_ToolTip}"
Width="15" Height="15" Margin="0"
Style="{StaticResource OnlyProdLeftPanel_Button}">
<Image Source="/Resources/TopPanel/MoveDownPart.png" Stretch="Uniform"/>
Margin="0"
Style="{StaticResource RawPart_Button}">
<Image Source="/Resources/NewPage/MoveDown.png" Stretch="Uniform"/>
</Button>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
@@ -539,16 +568,16 @@
<DataGridTemplateColumn x:Key="colREMOVE">
<DataGridTemplateColumn.HeaderTemplate>
<DataTemplate>
<TextBlock Text="Remove"/>
<TextBlock Text=""/>
</DataTemplate>
</DataGridTemplateColumn.HeaderTemplate>
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<Button Command="{Binding RemovePart_Command}"
ToolTip="{Binding RemovePart_ToolTip}"
Width="15" Height="15" Margin="0"
Style="{StaticResource OnlyProdLeftPanel_Button}">
<Image Source="/Resources/TopPanel/RemovePart.png" Stretch="Uniform"/>
Margin="0"
Style="{StaticResource RawPart_Button}">
<Image Source="/Resources/NewPage/Remove.png" Stretch="Uniform"/>
</Button>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
@@ -1,4 +1,6 @@
Imports EgtBEAMWALL.Core
Imports EgtUILib.EgtInterface
Imports System.Windows.Controls.Primitives
Public Class OnlyProdRawPartListV
@@ -8,7 +10,9 @@ Public Class OnlyProdRawPartListV
If TypeOf sender Is DataGridRow Then
Dim Row As DataGridRow = DirectCast(sender, DataGridRow)
Dim RowVM As MyMachGroupVM = DirectCast(Row.DataContext, MyMachGroupVM)
' se gia' selezionato rifaccio selezione perche' potrbbe essere selezionato un BTLPart
Dim DataGridDetailsPresenter As Object = TreeHelperManager.FindVisualParents(Of Button, CheckBox, Primitives.DataGridDetailsPresenter)(e.OriginalSource)
If Not IsNothing(DataGridDetailsPresenter) Then Return
' se gia' selezionato rifaccio selezione perche' potrebbe essere selezionato un BTLPart
If Not IsNothing(Row) AndAlso Row.IsSelected Then
Map.refProjectVM.MachGroupPanelVM.SelectedMachGroup = Map.refProjectVM.MachGroupPanelVM.SelectedMachGroup
End If
@@ -46,27 +50,47 @@ Public Class OnlyProdRawPartListV
})
End Sub
'' funzione che permette di selezionare un pezzo anche quando gia' selezionato
'Private Sub PartInRawPartRow_PreviewMouseDown(sender As Object, e As MouseButtonEventArgs)
' If TypeOf sender Is DataGridRow Then
' Dim Row As DataGridRow = DirectCast(sender, DataGridRow)
' If Not IsNothing(Row) Then
' Dim MyMachGroup As Core.MyMachGroupVM = Map.refProjectVM.MachGroupPanelVM.SelectedMachGroup
' If EgtGetCurrMachGroup() = GDB_ID.NULL Then Map.refProjectVM.MachGroupPanelVM.SelectedMachGroup = MyMachGroup
' MyMachGroup.SelPart = MyMachGroup.SelPart
' End If
' End If
'End Sub
Private Sub Button_Click(sender As Object, e As RoutedEventArgs)
Dim btn As Button = DirectCast(sender, Button) ' Ottieni il bottone che ha generato l'evento
Dim parent As DependencyObject = btn
'' funzione che impedisce di editare le righe che sono gia' in produzione
'Private Sub PartInRawPartList_BeginningEdit(sender As Object, e As DataGridBeginningEditEventArgs)
' If IsNothing(e.Row) Then Return
' Dim RowVM As PartVM = DirectCast(e.Row.DataContext, PartVM)
' ' se in produzione impedisco modifica dei parametri
' If RowVM.nProduction_State > ItemState.ND Then
' 'For Each cell In Row.Item
' e.Cancel = True
' End If
'End Sub
' Cerca il Popup nel Visual Tree
While parent IsNot Nothing AndAlso Not TypeOf parent Is DataGridRow
parent = VisualTreeHelper.GetParent(parent)
End While
If parent IsNot Nothing Then
Dim row As DataGridRow = DirectCast(parent, DataGridRow)
Dim popup As Popup = TryCast(TreeHelperManager.FindVisualChild(Of Popup)(row), Popup)
If popup IsNot Nothing Then
popup.PlacementTarget = btn ' Associa il popup al bottone
popup.IsOpen = True ' Mostra il popup
End If
End If
End Sub
' funzione che permette di selezionare un pezzo anche quando gia' selezionato
Private Sub PartInRawPartRow_PreviewMouseDown(sender As Object, e As MouseButtonEventArgs)
If TypeOf sender Is DataGridRow Then
Dim Row As DataGridRow = DirectCast(sender, DataGridRow)
If Not IsNothing(Row) Then
Dim MyMachGroup As Core.MyMachGroupVM = Map.refProjectVM.MachGroupPanelVM.SelectedMachGroup
If EgtGetCurrMachGroup() = GDB_ID.NULL Then Map.refProjectVM.MachGroupPanelVM.SelectedMachGroup = MyMachGroup
MyMachGroup.SelPart = MyMachGroup.SelPart
End If
End If
End Sub
' funzione che impedisce di editare le righe che sono gia' in produzione
Private Sub PartInRawPartList_BeginningEdit(sender As Object, e As DataGridBeginningEditEventArgs)
If IsNothing(e.Row) Then Return
Dim RowVM As PartVM = DirectCast(e.Row.DataContext, PartVM)
' se in produzione impedisco modifica dei parametri
If RowVM.nProduction_State > ItemState.ND Then
'For Each cell In Row.Item
e.Cancel = True
End If
End Sub
End Class
@@ -239,11 +239,11 @@ Public Class RawPartListVM
col.ColumnVisibility = If(col.Visible, Visibility.Visible, Visibility.Collapsed)
Next
' recupero riferimento a colonne Offset, Rot, Flip, PosX, PosY
m_colPartInRawPart_Offset = m_PartInRawPartColumns.FirstOrDefault(Function(x) x.Name = COL_OFFSET)
m_colPartInRawPart_Rot = m_PartInRawPartColumns.FirstOrDefault(Function(x) x.Name = COL_ROT)
m_colPartInRawPart_Flip = m_PartInRawPartColumns.FirstOrDefault(Function(x) x.Name = COL_FLIP)
m_colPartInRawPart_PosX = m_PartInRawPartColumns.FirstOrDefault(Function(x) x.Name = COL_POSX)
m_colPartInRawPart_PosY = m_PartInRawPartColumns.FirstOrDefault(Function(x) x.Name = COL_POSY)
m_colPartInRawPart_Offset = PartInRawPartColumns.FirstOrDefault(Function(x) x.Name = COL_OFFSET)
m_colPartInRawPart_Rot = PartInRawPartColumns.FirstOrDefault(Function(x) x.Name = COL_ROT)
m_colPartInRawPart_Flip = PartInRawPartColumns.FirstOrDefault(Function(x) x.Name = COL_FLIP)
m_colPartInRawPart_PosX = PartInRawPartColumns.FirstOrDefault(Function(x) x.Name = COL_POSX)
m_colPartInRawPart_PosY = PartInRawPartColumns.FirstOrDefault(Function(x) x.Name = COL_POSY)
' aggiorno la visibilità delle colonne
For Each col In PartInRawPartColumns
If Not bOnlyProd AndAlso nMachType = MachineType.BEAM AndAlso (col.Name.Equals(COL_ROT) OrElse col.Name.Equals(COL_FLIP) OrElse col.Name.Equals(COL_POSX)) Then
+124 -83
View File
@@ -69,6 +69,7 @@ Public Class LeftPanelVM
Private m_cmdShowPopUpFilterBtnCmd As ICommand
Private m_cmdBackRotation As ICommand
Private m_cmdInvert As ICommand
Private m_cmdResetCalc As ICommand
#Region "Messages"
@@ -125,6 +126,18 @@ Public Class LeftPanelVM
End Get
End Property
Public ReadOnly Property FilterAll_ToolTip As String
Get
Return EgtMsg(62570)
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
@@ -190,95 +203,94 @@ Public Class LeftPanelVM
''' Execute the Open. This method is invoked by the OpenCommand.
''' </summary>
Friend Sub VerifyAll()
If (Map.refMainMenuVM.SelPage = Pages.VIEW AndAlso (IsNothing(ProjectManagerVM.CurrProj) OrElse IsNothing(Map.refProjectVM.BTLStructureVM))) OrElse
(Map.refMainMenuVM.SelPage = Pages.MACHINING AndAlso (IsNothing(ProjectManagerVM.CurrProd) OrElse IsNothing(Map.refProjectVM.MachGroupPanelVM))) OrElse
(Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE AndAlso (IsNothing(ProjectManagerVM.CurrProj) OrElse IsNothing(Map.refProjectVM.BTLStructureVM)) AndAlso (IsNothing(ProjectManagerVM.CurrProd) OrElse IsNothing(Map.refProjectVM.MachGroupPanelVM))) Then Return
If (Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE AndAlso (IsNothing(ProjectManagerVM.CurrProj) OrElse IsNothing(Map.refProjectVM.BTLStructureVM)) AndAlso (IsNothing(ProjectManagerVM.CurrProd) OrElse IsNothing(Map.refProjectVM.MachGroupPanelVM))) Then Return
' se modalita' assemblato
Configuration.AssembledMode(Map.refShowBeamPanelVM.ShowBuilding_IsChecked)
Dim BarList() As EgtBEAMWALL.Core.Bar = Nothing
Dim ProjType As BWType
If Map.refMainMenuVM.SelPage = Pages.VIEW Then
ProjType = ProjectManagerVM.CurrProj.nType
If Not CreateBarListToVerify(Pages.VIEW, ProjType, BarList) Then Return
' lancio calcolo
EgtBEAMWALL.Core.CalcIntegration.Run(BarList, ProjectManagerVM.CurrProj.sProjDirPath, AddressOf ManageCalc)
ElseIf Map.refMainMenuVM.SelPage = Pages.MACHINING Then
ProjType = ProjectManagerVM.CurrProd.nType
If Not CreateBarListToVerify(Pages.MACHINING, ProjType, BarList) Then Return
' lancio calcolo
EgtBEAMWALL.Core.CalcIntegration.Run(BarList, ProjectManagerVM.CurrProd.sProdDirPath, AddressOf ManageCalc)
ElseIf Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE Then
ProjType = ProjectManagerVM.CurrProd.nType
If Map.refProjectVM.LastSelGridType = ProjectVM.GridSelTypes.PART OrElse Map.refProjectVM.LastSelGridType = ProjectVM.GridSelTypes.PARTLIST Then
If Not CreateBarListToVerify(Pages.VIEW, ProjType, BarList) Then Return
' lancio calcolo
EgtBEAMWALL.Core.CalcIntegration.Run(BarList, ProjectManagerVM.CurrProj.sProjDirPath, AddressOf ManageCalc)
ElseIf Map.refProjectVM.LastSelGridType = ProjectVM.GridSelTypes.MACHGROUP Then
If Not CreateBarListToVerify(Pages.MACHINING, ProjType, BarList) Then Return
' lancio calcolo
EgtBEAMWALL.Core.CalcIntegration.Run(BarList, ProjectManagerVM.CurrProd.sProdDirPath, AddressOf ManageCalc)
End If
End If
'If Map.refMainMenuVM.SelPage = Pages.VIEW Then
' ProjType = ProjectManagerVM.CurrProj.nType
' If Not CreateBarListToVerify(Pages.VIEW, ProjType, BarList) Then Return
' ' lancio calcolo
' EgtBEAMWALL.Core.CalcIntegration.Run(BarList, ProjectManagerVM.CurrProj.sProjDirPath, AddressOf ManageCalc)
'ElseIf Map.refMainMenuVM.SelPage = Pages.MACHINING Then
' ProjType = ProjectManagerVM.CurrProd.nType
' If Not CreateBarListToVerify(Pages.MACHINING, ProjType, BarList) Then Return
' ' lancio calcolo
' EgtBEAMWALL.Core.CalcIntegration.Run(BarList, ProjectManagerVM.CurrProd.sProdDirPath, AddressOf ManageCalc)
'ElseIf Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE Then
ProjType = ProjectManagerVM.CurrProd.nType
'If Map.refProjectVM.LastSelGridType = ProjectVM.GridSelTypes.PART OrElse Map.refProjectVM.LastSelGridType = ProjectVM.GridSelTypes.PARTLIST Then
If Not CreateBarListToVerify(ProjType, BarList) Then Return
' lancio calcolo
EgtBEAMWALL.Core.CalcIntegration.Run(BarList, ProjectManagerVM.CurrProj.sProjDirPath, AddressOf ManageCalc)
'ElseIf Map.refProjectVM.LastSelGridType = ProjectVM.GridSelTypes.MACHGROUP Then
' If Not CreateBarListToVerify(Pages.MACHINING, ProjType, BarList) Then Return
' ' lancio calcolo
' EgtBEAMWALL.Core.CalcIntegration.Run(BarList, ProjectManagerVM.CurrProd.sProdDirPath, AddressOf ManageCalc)
'End If
'End If
End Sub
Private Function CreateBarListToVerify(SelPage As Pages, ProjType As BWType, ByRef BarList As Bar()) As Boolean
If SelPage = Pages.VIEW Then
Dim TempBarList As New List(Of EgtBEAMWALL.Core.Bar)
For PartIndex = 0 To Map.refProjectVM.BTLStructureVM.BTLPartVMList.Count - 1
Dim CurrPart As BTLPartVM = Map.refProjectVM.BTLStructureVM.BTLPartVMList(PartIndex)
If Not CurrPart.bDO Then Continue For
Dim Bar As New EgtBEAMWALL.Core.Bar With {.nBarId = CurrPart.nPartId,
.nProgramPage = ProjectType.PROJ,
.nProjType = ProjType,
.bBarOk = True,
.nMachineName = Map.refMachinePanelVM.SelectedMachine.Name,
.nGlobState = CurrPart.nGlobalState}
Select Case CurrPart.nGlobalState
Case Core.CalcStates.OK, CalcStates.INFO
Bar.nCmdType = CalcIntegration.CmdTypes.GENERATE
Case Else
If CurrPart.nGlobalState = CalcStates.NOTCALCULATED OrElse CurrPart.nFeaturesGlobalState > CalcStates.INFO Then
Dim sBTLPartFilePath As String = ProjectManagerVM.CurrProj.sProjDirPath & "\" & CurrPart.nPDN.ToString() & ".ori.bwe"
If File.Exists(sBTLPartFilePath) Then File.Delete(sBTLPartFilePath)
End If
Bar.nCmdType = CalcIntegration.CmdTypes.CHECKGEN
End Select
TempBarList.Add(Bar)
Next
BarList = TempBarList.ToArray()
' disabilito interfaccia
Map.refProjectVM.SetCalcRunning(True)
ElseIf SelPage = Pages.MACHINING Then
Dim TempBarList As New List(Of EgtBEAMWALL.Core.Bar)
For PartIndex = 0 To Map.refMachGroupPanelVM.MachGroupVMList.Count - 1
Dim CurrMachGroup As MyMachGroupVM = Map.refMachGroupPanelVM.MachGroupVMList(PartIndex)
' se e' gia' stato assegnato a supervisor, la salto e vado alla prossima barra
If CurrMachGroup.nProduction_State >= ItemState.Assigned Then Continue For
Dim MachineName As String = ""
EgtGetMachGroupMachineName(CurrMachGroup.Id, MachineName)
Dim Bar As New EgtBEAMWALL.Core.Bar With {.nBarId = CurrMachGroup.Id,
.nProgramPage = ProjectType.PROD,
.nProjType = ProjType,
.bBarOk = True,
.nMachineName = MachineName,
.nGlobState = CurrMachGroup.nGlobalState}
Select Case CurrMachGroup.nGlobalState
Case Core.CalcStates.OK, CalcStates.INFO
Bar.nCmdType = CalcIntegration.CmdTypes.GENERATE
Case Else
If CurrMachGroup.nGlobalState = CalcStates.NOTCALCULATED OrElse (CurrMachGroup.nPartsGlobalState > CalcStates.INFO) Then
Dim sMachGroupFilePath As String = ProjectManagerVM.CurrProd.sProdDirPath & "\" & CurrMachGroup.Name.ToString() & ".ori.bwe"
If File.Exists(sMachGroupFilePath) Then File.Delete(sMachGroupFilePath)
End If
Bar.nCmdType = CalcIntegration.CmdTypes.CHECKGEN
End Select
TempBarList.Add(Bar)
Next
If TempBarList.Count = 0 Then Return False
BarList = TempBarList.ToArray()
' disabilito interfaccia
Map.refProjectVM.SetCalcRunning(True)
End If
Private Function CreateBarListToVerify(ProjType As BWType, ByRef BarList As Bar()) As Boolean
'If SelPage = Pages.VIEW Then
Dim TempBarList As New List(Of EgtBEAMWALL.Core.Bar)
For PartIndex = 0 To Map.refProjectVM.BTLStructureVM.BTLPartVMList.Count - 1
Dim CurrPart As BTLPartVM = Map.refProjectVM.BTLStructureVM.BTLPartVMList(PartIndex)
If Not CurrPart.bDO Then Continue For
Dim Bar As New EgtBEAMWALL.Core.Bar With {.nBarId = CurrPart.nPartId,
.nProgramPage = ProjectType.PROJ,
.nProjType = ProjType,
.bBarOk = True,
.nMachineName = Map.refMachinePanelVM.SelectedMachine.Name,
.nGlobState = CurrPart.nGlobalState}
Select Case CurrPart.nGlobalState
Case Core.CalcStates.OK, CalcStates.INFO
Bar.nCmdType = CalcIntegration.CmdTypes.GENERATE
Case Else
If CurrPart.nGlobalState = CalcStates.NOTCALCULATED OrElse CurrPart.nFeaturesGlobalState > CalcStates.INFO Then
Dim sBTLPartFilePath As String = ProjectManagerVM.CurrProj.sProjDirPath & "\" & CurrPart.nPDN.ToString() & ".ori.bwe"
If File.Exists(sBTLPartFilePath) Then File.Delete(sBTLPartFilePath)
End If
'Bar.nCmdType = CalcIntegration.CmdTypes.CHECKGEN
Bar.nCmdType = CalcIntegration.CmdTypes.CHECKNOSIM
End Select
TempBarList.Add(Bar)
Next
BarList = TempBarList.ToArray()
' disabilito interfaccia
Map.refProjectVM.SetCalcRunning(True)
'ElseIf SelPage = Pages.MACHINING Then
' Dim TempBarList As New List(Of EgtBEAMWALL.Core.Bar)
' For PartIndex = 0 To Map.refMachGroupPanelVM.MachGroupVMList.Count - 1
' Dim CurrMachGroup As MyMachGroupVM = Map.refMachGroupPanelVM.MachGroupVMList(PartIndex)
' ' se e' gia' stato assegnato a supervisor, la salto e vado alla prossima barra
' If CurrMachGroup.nProduction_State >= ItemState.Assigned Then Continue For
' Dim MachineName As String = ""
' EgtGetMachGroupMachineName(CurrMachGroup.Id, MachineName)
' Dim Bar As New EgtBEAMWALL.Core.Bar With {.nBarId = CurrMachGroup.Id,
' .nProgramPage = ProjectType.PROD,
' .nProjType = ProjType,
' .bBarOk = True,
' .nMachineName = MachineName,
' .nGlobState = CurrMachGroup.nGlobalState}
' Select Case CurrMachGroup.nGlobalState
' Case Core.CalcStates.OK, CalcStates.INFO
' Bar.nCmdType = CalcIntegration.CmdTypes.GENERATE
' Case Else
' If CurrMachGroup.nGlobalState = CalcStates.NOTCALCULATED OrElse (CurrMachGroup.nPartsGlobalState > CalcStates.INFO) Then
' Dim sMachGroupFilePath As String = ProjectManagerVM.CurrProd.sProdDirPath & "\" & CurrMachGroup.Name.ToString() & ".ori.bwe"
' If File.Exists(sMachGroupFilePath) Then File.Delete(sMachGroupFilePath)
' End If
' Bar.nCmdType = CalcIntegration.CmdTypes.CHECKGEN
' End Select
' TempBarList.Add(Bar)
' Next
' If TempBarList.Count = 0 Then Return False
' BarList = TempBarList.ToArray()
' ' disabilito interfaccia
' Map.refProjectVM.SetCalcRunning(True)
'End If
Return True
End Function
@@ -378,6 +390,35 @@ Public Class LeftPanelVM
#End Region ' Invert
#Region "ResetCalc"
''' <summary>
''' Returns a command that do Exec.
''' </summary>
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
''' <summary>
''' Execute the Exec. This method is invoked by the ExecCommand.
''' </summary>
Public Sub ResetCalc()
If (Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE AndAlso (IsNothing(ProjectManagerVM.CurrProj) OrElse IsNothing(Map.refProjectVM.BTLStructureVM)) AndAlso (IsNothing(ProjectManagerVM.CurrProd) OrElse IsNothing(Map.refProjectVM.MachGroupPanelVM))) Then Return
For Each Part In Map.refProjectVM.BTLStructureVM.BTLPartVMList
If Part.nGlobalState <> CalcStates.NOTCALCULATED Then
' resetto stato dei calcoli
Part.ResetCalcTotalPart()
End If
Next
End Sub
#End Region ' ResetCalc
#End Region ' COMMANDS
End Class
@@ -26,6 +26,7 @@
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
@@ -38,6 +39,13 @@
<Image Source="/Resources/CALCPanel/VerifyAll.png" Stretch="Uniform"/>
</Button>
<Button Grid.Column="1"
Command="{Binding ResetCalc_Command}"
ToolTip="{Binding ResetCalc_ToolTip}"
IsEnabled="{Binding CALCPanel_IsEnabled}"
Style="{StaticResource OnlyProdLeftPanel_Button}">
<Image Source="/Resources/CALCPanel/ResetCalc.png" Stretch="Uniform"/>
</Button>
<Button Grid.Column="2"
Name="FilterAllBtn"
ToolTip="{Binding FilterAll_ToolTip}"
Command="{Binding ShowPopUpFilterBtnCommand}"
@@ -91,7 +99,7 @@
</Expander>
</UniformGrid>
</Popup>
<Expander Grid.Column="2"
<Expander Grid.Column="3"
Header="{Binding Section_Msg}"
Width="135"
Margin="0,4.5,5,0">
@@ -101,13 +109,13 @@
Style="{StaticResource OnlyProdLeftPanel_ListBox}"
ItemContainerStyle="{StaticResource AlternationIndex_ListBoxItem}"/>
</Expander>
<EgtWPFLib5:EgtTextBox Grid.Column="3"
<EgtWPFLib5:EgtTextBox Grid.Column="4"
Text="{Binding Tag.SearchText, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdLeftPanelV}}}"
TextAlignment="Justify"
Height="25"
Margin="0,6,4,0"
Style="{StaticResource SearchText_TextBox}"/>
<Button Grid.Column="4"
<Button Grid.Column="5"
Command="{Binding BackRotation_Command}"
Visibility="{Binding ViewPage_Visibility}"
ToolTip="Ruota Tutti"
@@ -115,7 +123,7 @@
Style="{StaticResource OnlyProdLeftPanel_Button}">
<Image Source="/Resources/PartManager/LeftRotate.png" Stretch="Uniform"/>
</Button>
<Button Grid.Column="5"
<Button Grid.Column="6"
Command="{Binding Invert_Command}"
Visibility="{Binding ViewPage_Visibility}"
ToolTip="Inverti Tutti"
@@ -123,7 +131,7 @@
Style="{StaticResource OnlyProdLeftPanel_Button}">
<Image Source="/Resources/PartManager/LeftInvert.png" Stretch="Uniform"/>
</Button>
<Button Grid.Column="6"
<Button Grid.Column="7"
ToolTip="Modifica Multipla"
Command="{Binding Edit_Command}"
IsEnabled="{Binding Edit_IsEnabled}"
@@ -47,6 +47,12 @@ Public Class MyMachGroupPanelVM
End If
End If
If Not IsNothing(Map.refProjectVM.BTLStructureVM) Then
For BTLPartIndex = 0 To Map.refProjectVM.BTLStructureVM.BTLPartVMList.Count - 1
Map.refProjectVM.BTLStructureVM.BTLPartVMList(BTLPartIndex).ResetSearchFound()
Next
End If
If Map.refMainMenuVM.SelPage <> Pages.ONLYPRODPAGE Then Map.refShowBeamPanelVM.bShowAll = False
m_SelectedMachGroup = value
@@ -1001,77 +1001,42 @@ Public Class MyMachGroupVM
Dim ProjType As BWType
Dim BarList() As EgtBEAMWALL.Core.Bar = Nothing
ProjType = ProjectManagerVM.CurrProd.nType
If Map.refProjectVM.LastSelGridType = ProjectVM.GridSelTypes.PART Then
If Not CreateBarToVerify(Pages.VIEW, ProjType, BarList) Then Return
' lancio calcolo
EgtBEAMWALL.Core.CalcIntegration.Run(BarList, Map.refOnlyProdManagerVM.CurrProj.sProjDirPath, AddressOf ManageCalc)
ElseIf Map.refProjectVM.LastSelGridType = ProjectVM.GridSelTypes.MACHGROUP Then
If Not CreateBarToVerify(Pages.MACHINING, ProjType, BarList) Then Return
' lancio calcolo
EgtBEAMWALL.Core.CalcIntegration.Run(BarList, Map.refOnlyProdManagerVM.CurrProd.sProdDirPath, AddressOf ManageCalc)
End If
If Not CreateBarToVerify(ProjType, BarList) Then Return
' lancio calcolo
EgtBEAMWALL.Core.CalcIntegration.Run(BarList, Map.refOnlyProdManagerVM.CurrProd.sProdDirPath, AddressOf ManageCalc)
End Sub
Private Function CreateBarToVerify(SelPage As Pages, ProjType As BWType, ByRef BarList As Bar()) As Boolean
If SelPage = Pages.VIEW Then
If Not IsNothing(Map.refProjectVM.BTLStructureVM.SelBTLPart) Then
Dim TempBarList(0) As EgtBEAMWALL.Core.Bar
If Not Map.refProjectVM.BTLStructureVM.SelBTLPart.bDO Then Return False
Dim Bar As New EgtBEAMWALL.Core.Bar With {.nBarId = Map.refProjectVM.BTLStructureVM.SelBTLPart.nPartId,
.nProgramPage = ProjectType.PROJ,
.nProjType = ProjType,
.bBarOk = True,
.nMachineName = Map.refMachinePanelVM.SelectedMachine.Name,
.nGlobState = Map.refProjectVM.BTLStructureVM.SelBTLPart.nGlobalState}
Select Case Map.refProjectVM.BTLStructureVM.SelBTLPart.nGlobalState
Case Core.CalcStates.OK, CalcStates.INFO
Bar.nCmdType = CalcIntegration.CmdTypes.GENERATE
Case Else
If Map.refProjectVM.BTLStructureVM.SelBTLPart.nGlobalState = CalcStates.NOTCALCULATED OrElse Map.refProjectVM.BTLStructureVM.SelBTLPart.nFeaturesGlobalState > CalcStates.INFO Then
Dim sBTLPartFilePath As String = ProjectManagerVM.CurrProj.sProjDirPath & "\" & Map.refProjectVM.BTLStructureVM.SelBTLPart.nPDN.ToString() & ".ori.bwe"
If File.Exists(sBTLPartFilePath) Then File.Delete(sBTLPartFilePath)
End If
Bar.nCmdType = CalcIntegration.CmdTypes.CHECKGEN
End Select
TempBarList(0) = Bar
BarList = TempBarList
Else
Return False
End If
' disabilito interfaccia
Map.refProjectVM.SetCalcRunning(True)
ElseIf SelPage = Pages.MACHINING Then
If Not IsNothing(Map.refMachGroupPanelVM.SelectedMachGroup) Then
Dim SelMachGroup As MyMachGroupVM = Map.refMachGroupPanelVM.SelectedMachGroup
' se barra gia' assegnata a supervisore, esco
If SelMachGroup.nProduction_State >= ItemState.Assigned Then Return False
Dim TempBarList(0) As EgtBEAMWALL.Core.Bar
Dim MachineName As String = ""
EgtGetMachGroupMachineName(SelMachGroup.Id, MachineName)
Dim Bar As New EgtBEAMWALL.Core.Bar With {.nBarId = SelMachGroup.Id,
Private Function CreateBarToVerify(ProjType As BWType, ByRef BarList As Bar()) As Boolean
If Not IsNothing(Map.refMachGroupPanelVM.SelectedMachGroup) Then
Dim SelMachGroup As MyMachGroupVM = Map.refMachGroupPanelVM.SelectedMachGroup
' se barra gia' assegnata a supervisore, esco
If SelMachGroup.nProduction_State >= ItemState.Assigned Then Return False
Dim TempBarList(0) As EgtBEAMWALL.Core.Bar
Dim MachineName As String = ""
EgtGetMachGroupMachineName(SelMachGroup.Id, MachineName)
Dim Bar As New EgtBEAMWALL.Core.Bar With {.nBarId = SelMachGroup.Id,
.nProgramPage = ProjectType.PROD,
.nProjType = ProjType,
.bBarOk = True,
.nMachineName = MachineName,
.nGlobState = SelMachGroup.nGlobalState}
Select Case SelMachGroup.nGlobalState
Case Core.CalcStates.OK, CalcStates.INFO
Bar.nCmdType = CalcIntegration.CmdTypes.GENERATE
Case Else
If SelMachGroup.nGlobalState = CalcStates.NOTCALCULATED OrElse (SelMachGroup.nPartsGlobalState > CalcStates.INFO) Then
Dim sMachGroupFilePath As String = ProjectManagerVM.CurrProd.sProdDirPath & "\" & SelMachGroup.Name.ToString() & ".ori.bwe"
If File.Exists(sMachGroupFilePath) Then File.Delete(sMachGroupFilePath)
End If
Bar.nCmdType = CalcIntegration.CmdTypes.CHECKGEN
End Select
TempBarList(0) = Bar
BarList = TempBarList
Else
Return False
End If
' disabilito interfaccia
Map.refProjectVM.SetCalcRunning(True)
Select Case SelMachGroup.nGlobalState
Case Core.CalcStates.OK, CalcStates.INFO
Bar.nCmdType = CalcIntegration.CmdTypes.GENERATE
Case Else
If SelMachGroup.nGlobalState = CalcStates.NOTCALCULATED OrElse (SelMachGroup.nPartsGlobalState > CalcStates.INFO) Then
Dim sMachGroupFilePath As String = ProjectManagerVM.CurrProd.sProdDirPath & "\" & SelMachGroup.Name.ToString() & ".ori.bwe"
If File.Exists(sMachGroupFilePath) Then File.Delete(sMachGroupFilePath)
End If
Bar.nCmdType = CalcIntegration.CmdTypes.CHECKGEN
End Select
TempBarList(0) = Bar
BarList = TempBarList
Else
Return False
End If
' disabilito interfaccia
Map.refProjectVM.SetCalcRunning(True)
Return True
End Function
@@ -1119,64 +1084,68 @@ Public Class MyMachGroupVM
Dim ProjType As BWType
Dim BarList() As EgtBEAMWALL.Core.Bar = Nothing
ProjType = Map.refOnlyProdManagerVM.CurrProd.nType
If Map.refProjectVM.LastSelGridType = ProjectVM.GridSelTypes.PART Then
If Not CreateBarToSimulate(Pages.VIEW, ProjType, BarList) Then Return
' lancio simulazione
EgtBEAMWALL.Core.CalcIntegration.Run(BarList, ProjectManagerVM.CurrProj.sProjDirPath, AddressOf ManageCalc)
ElseIf Map.refProjectVM.LastSelGridType = ProjectVM.GridSelTypes.MACHGROUP Then
If Not CreateBarToSimulate(Pages.MACHINING, ProjType, BarList) Then Return
' lancio simulazione
EgtBEAMWALL.Core.CalcIntegration.Run(BarList, ProjectManagerVM.CurrProd.sProdDirPath, AddressOf ManageCalc)
End If
'If Map.refProjectVM.LastSelGridType = ProjectVM.GridSelTypes.PART Then
' If Not CreateBarToSimulate(Pages.VIEW, ProjType, BarList) Then Return
' ' lancio simulazione
' EgtBEAMWALL.Core.CalcIntegration.Run(BarList, ProjectManagerVM.CurrProj.sProjDirPath, AddressOf ManageCalc)
'ElseIf Map.refProjectVM.LastSelGridType = ProjectVM.GridSelTypes.MACHGROUP Then
' If Not CreateBarToSimulate(Pages.MACHINING, ProjType, BarList) Then Return
' ' lancio simulazione
' EgtBEAMWALL.Core.CalcIntegration.Run(BarList, ProjectManagerVM.CurrProd.sProdDirPath, AddressOf ManageCalc)
'End If
If Not CreateBarToSimulate(ProjType, BarList) Then Return
' lancio simulazione
EgtBEAMWALL.Core.CalcIntegration.Run(BarList, ProjectManagerVM.CurrProd.sProdDirPath, AddressOf ManageCalc)
End Sub
Private Function CreateBarToSimulate(SelPage As Pages, ProjType As BWType, ByRef BarList As Bar()) As Boolean
If SelPage = Pages.VIEW Then
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 = Map.refMachinePanelVM.SelectedMachine.Name,
.nCmdType = CalcIntegration.CmdTypes.SIMULATE,
.nGlobState = Map.refProjectVM.BTLStructureVM.SelBTLPart.nGlobalState}
If Map.refProjectVM.BTLStructureVM.SelBTLPart.nGlobalState = CalcStates.NOTCALCULATED Then
Dim sBTLPartFilePath As String = ProjectManagerVM.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
Return False
Private Function CreateBarToSimulate(ProjType As BWType, ByRef BarList As Bar()) As Boolean
'If SelPage = Pages.VIEW Then
' 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 = Map.refMachinePanelVM.SelectedMachine.Name,
' .nCmdType = CalcIntegration.CmdTypes.SIMULATE,
' .nGlobState = Map.refProjectVM.BTLStructureVM.SelBTLPart.nGlobalState}
' If Map.refProjectVM.BTLStructureVM.SelBTLPart.nGlobalState = CalcStates.NOTCALCULATED Then
' Dim sBTLPartFilePath As String = ProjectManagerVM.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
' Return False
' End If
' ' disabilito interfaccia
' Map.refProjectVM.SetCalcRunning(True)
'ElseIf SelPage = Pages.MACHINING Then
If Not IsNothing(Map.refMachGroupPanelVM.SelectedMachGroup) Then
Dim SelMachGroup As MyMachGroupVM = Map.refMachGroupPanelVM.SelectedMachGroup
Dim TempBarList(0) As EgtBEAMWALL.Core.Bar
Dim MachineName As String = ""
EgtGetMachGroupMachineName(SelMachGroup.Id, MachineName)
Dim Bar As New EgtBEAMWALL.Core.Bar With {.nBarId = SelMachGroup.Id,
.nProgramPage = ProjectType.PROD,
.nProjType = ProjType,
.bBarOk = True,
.nMachineName = MachineName,
.nCmdType = CalcIntegration.CmdTypes.SIMULATE,
.nGlobState = SelMachGroup.nGlobalState}
If SelMachGroup.nGlobalState = CalcStates.NOTCALCULATED Then
Dim sMachGroupFilePath As String = ProjectManagerVM.CurrProd.sProdDirPath & "\" & SelMachGroup.Name.ToString() & ".ori.bwe"
If File.Exists(sMachGroupFilePath) Then File.Delete(sMachGroupFilePath)
End If
' disabilito interfaccia
Map.refProjectVM.SetCalcRunning(True)
ElseIf SelPage = Pages.MACHINING Then
If Not IsNothing(Map.refMachGroupPanelVM.SelectedMachGroup) Then
Dim SelMachGroup As MyMachGroupVM = Map.refMachGroupPanelVM.SelectedMachGroup
Dim TempBarList(0) As EgtBEAMWALL.Core.Bar
Dim MachineName As String = ""
EgtGetMachGroupMachineName(SelMachGroup.Id, MachineName)
Dim Bar As New EgtBEAMWALL.Core.Bar With {.nBarId = SelMachGroup.Id,
.nProgramPage = ProjectType.PROD,
.nProjType = ProjType,
.bBarOk = True,
.nMachineName = MachineName,
.nCmdType = CalcIntegration.CmdTypes.SIMULATE,
.nGlobState = SelMachGroup.nGlobalState}
If SelMachGroup.nGlobalState = CalcStates.NOTCALCULATED Then
Dim sMachGroupFilePath As String = ProjectManagerVM.CurrProd.sProdDirPath & "\" & SelMachGroup.Name.ToString() & ".ori.bwe"
If File.Exists(sMachGroupFilePath) Then File.Delete(sMachGroupFilePath)
End If
TempBarList(0) = Bar
BarList = TempBarList
Else
Return False
End If
' disabilito interfaccia
Map.refProjectVM.SetCalcRunning(True)
TempBarList(0) = Bar
BarList = TempBarList
Else
Return False
End If
' disabilito interfaccia
Map.refProjectVM.SetCalcRunning(True)
' End If
Return True
End Function
@@ -1414,43 +1383,41 @@ Public Class MyMachGroupVM
''' Execute the Exec. This method is invoked by the ExecCommand.
''' </summary>
Public Sub ResetCalc()
If (Map.refMainMenuVM.SelPage = Pages.VIEW AndAlso (IsNothing(ProjectManagerVM.CurrProj) OrElse IsNothing(Map.refProjectVM.BTLStructureVM))) OrElse
(Map.refMainMenuVM.SelPage = Pages.MACHINING AndAlso (IsNothing(ProjectManagerVM.CurrProd) OrElse IsNothing(Map.refProjectVM.MachGroupPanelVM))) OrElse
(Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE AndAlso (IsNothing(ProjectManagerVM.CurrProj) OrElse IsNothing(Map.refProjectVM.BTLStructureVM)) AndAlso (IsNothing(ProjectManagerVM.CurrProd) OrElse IsNothing(Map.refProjectVM.MachGroupPanelVM))) Then Return
If Map.refMainMenuVM.SelPage = Pages.VIEW OrElse (Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE AndAlso (Map.refProjectVM.LastSelGridType = ProjectVM.GridSelTypes.PART OrElse Map.refProjectVM.LastSelGridType = ProjectVM.GridSelTypes.PARTLIST)) Then
If (Keyboard.Modifiers And ModifierKeys.Shift) = ModifierKeys.Shift Then
For Each Part In Map.refProjectVM.BTLStructureVM.BTLPartVMList
If Part.nGlobalState <> CalcStates.NOTCALCULATED Then
' resetto stato dei calcoli
Part.ResetCalcTotalPart()
End If
Next
ElseIf Map.refProjectVM.BTLStructureVM.SelBTLPartsCnt > 1 Then
Else
Dim SelPart As BTLPartVM = Map.refProjectVM.BTLStructureVM.SelBTLPart
If IsNothing(SelPart) Then Return
If SelPart.nGlobalState <> CalcStates.NOTCALCULATED Then
SelPart.ResetCalcTotalPart()
End If
End If
ElseIf Map.refMainMenuVM.SelPage = Pages.MACHINING OrElse (Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE AndAlso Map.refProjectVM.LastSelGridType = ProjectVM.GridSelTypes.MACHGROUP) Then
If (Keyboard.Modifiers And ModifierKeys.Shift) = ModifierKeys.Shift Then
For Each MachGroup As MyMachGroupVM In Map.refProjectVM.MachGroupPanelVM.MachGroupVMList
If MachGroup.nProduction_State >= ItemState.Assigned Then Continue For
If MachGroup.nGlobalState <> CalcStates.NOTCALCULATED Then
MachGroup.ResetCalcTotalMachGroup()
End If
Next
Else
Dim SelMachGroup As MyMachGroupVM = Map.refMachGroupPanelVM.SelectedMachGroup
If IsNothing(SelMachGroup) Then Return
' se barra gia' assegnata a supervisore, esco
If SelMachGroup.nProduction_State >= ItemState.Assigned Then Return
If SelMachGroup.nGlobalState <> CalcStates.NOTCALCULATED Then
SelMachGroup.ResetCalcTotalMachGroup()
End If
End If
If (Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE AndAlso (IsNothing(ProjectManagerVM.CurrProj) OrElse IsNothing(Map.refProjectVM.BTLStructureVM)) AndAlso (IsNothing(ProjectManagerVM.CurrProd) OrElse IsNothing(Map.refProjectVM.MachGroupPanelVM))) Then Return
'If Map.refMainMenuVM.SelPage = Pages.VIEW OrElse (Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE AndAlso (Map.refProjectVM.LastSelGridType = ProjectVM.GridSelTypes.PART OrElse Map.refProjectVM.LastSelGridType = ProjectVM.GridSelTypes.PARTLIST)) Then
' If (Keyboard.Modifiers And ModifierKeys.Shift) = ModifierKeys.Shift Then
' For Each Part In Map.refProjectVM.BTLStructureVM.BTLPartVMList
' If Part.nGlobalState <> CalcStates.NOTCALCULATED Then
' ' resetto stato dei calcoli
' Part.ResetCalcTotalPart()
' End If
' Next
' ElseIf Map.refProjectVM.BTLStructureVM.SelBTLPartsCnt > 1 Then
' Else
' Dim SelPart As BTLPartVM = Map.refProjectVM.BTLStructureVM.SelBTLPart
' If IsNothing(SelPart) Then Return
' If SelPart.nGlobalState <> CalcStates.NOTCALCULATED Then
' SelPart.ResetCalcTotalPart()
' End If
' End If
'ElseIf Map.refMainMenuVM.SelPage = Pages.MACHINING OrElse (Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE AndAlso Map.refProjectVM.LastSelGridType = ProjectVM.GridSelTypes.MACHGROUP) Then
'If (Keyboard.Modifiers And ModifierKeys.Shift) = ModifierKeys.Shift Then
' For Each MachGroup As MyMachGroupVM In Map.refProjectVM.MachGroupPanelVM.MachGroupVMList
' If MachGroup.nProduction_State >= ItemState.Assigned Then Continue For
' If MachGroup.nGlobalState <> CalcStates.NOTCALCULATED Then
' MachGroup.ResetCalcTotalMachGroup()
' End If
' Next
' Else
Dim SelMachGroup As MyMachGroupVM = Map.refMachGroupPanelVM.SelectedMachGroup
If IsNothing(SelMachGroup) Then Return
' se barra gia' assegnata a supervisore, esco
If SelMachGroup.nProduction_State >= ItemState.Assigned Then Return
If SelMachGroup.nGlobalState <> CalcStates.NOTCALCULATED Then
SelMachGroup.ResetCalcTotalMachGroup()
End If
'End If
'End If
End Sub
#End Region ' ResetCalc
@@ -258,12 +258,7 @@ Public Class MachinePanelVM
End If
Dim ToolDbWindowVM As New MyToolDbWindowVM(CurrentMachine.sMachDir, CurrentMachine.sMachIniFile, Map.refSceneHostVM.MainScene.GetCtx(), "Beam")
Dim ToolDbWindowV = Nothing
If bOnlyProd Then
ToolDbWindowV = New OnlyProdToolDbWindowV(Application.Current.MainWindow, ToolDbWindowVM)
Else
ToolDbWindowV = New ToolDbWindowV(Application.Current.MainWindow, ToolDbWindowVM)
End If
Dim ToolDbWindowV = New ToolDbWindowV(Application.Current.MainWindow, ToolDbWindowVM)
If ToolDbWindowVM.MatType <> 0 Then
ToolDbWindowV.Height = 640
@@ -283,12 +278,7 @@ Public Class MachinePanelVM
Return
End If
Dim MachDbWindowVM As New EgtWPFLib5.MachiningDbWindowVM(CurrentMachine.sMachIniFile, Map.refSceneHostVM.MainScene.GetCtx(), "Stone")
Dim MachDbWindowV = Nothing
If bOnlyProd Then
MachDbWindowV = New OnlyProdMachiningDbWindowV(Application.Current.MainWindow, MachDbWindowVM)
Else
MachDbWindowV = New EgtWPFLib5.MachiningDbWindowV(Application.Current.MainWindow, MachDbWindowVM)
End If
Dim MachDbWindowV = New EgtWPFLib5.MachiningDbWindowV(Application.Current.MainWindow, MachDbWindowVM)
If EgtWPFLib5.MachiningTreeViewItem.m_MatType <> 0 Then
MachDbWindowV.Height = 768
@@ -331,18 +321,10 @@ Public Class MachinePanelVM
' Reset lua
EgtLuaResetGlobVar("STU")
Dim SetUpWindow As Object = Nothing
If bOnlyProd Then
SetUpWindow = New OnlyProdSetUpWindowV(Application.Current.MainWindow, New SetUpWindowVM(CurrentMachine.sMachDir, CurrentMachine.sMachineName)) With {
Dim SetUpWindow As New SetUpWindowV(Application.Current.MainWindow, New SetUpWindowVM(CurrentMachine.sMachDir, CurrentMachine.sMachineName)) With {
.Height = 614,
.Width = 1024
}
Else
SetUpWindow = New SetUpWindowV(Application.Current.MainWindow, New SetUpWindowVM(CurrentMachine.sMachDir, CurrentMachine.sMachineName)) With {
.Height = 614,
.Width = 1024
}
End If
SetUpWindow.ShowDialog()
End Sub
+108 -94
View File
@@ -29,35 +29,35 @@ Public Class MainMenuVM
End Get
End Property
Public Property View_IsChecked As Boolean
Get
Return m_SelPage = Pages.VIEW
End Get
Set(value As Boolean)
If value Then
If Not IsNothing(ProjectManagerVM.CurrProj) AndAlso Not IsNothing(ProjectManagerVM.CurrProd) AndAlso
ProjectManagerVM.CurrProj.nProdId = ProjectManagerVM.CurrProd.nProdId Then
ProjectManagerVM.CurrProj.SetReloadProject(False)
End If
SelPage = Pages.VIEW
End If
End Set
End Property
'Public Property View_IsChecked As Boolean
' Get
' Return m_SelPage = Pages.VIEW
' End Get
' Set(value As Boolean)
' If value Then
' If Not IsNothing(ProjectManagerVM.CurrProj) AndAlso Not IsNothing(ProjectManagerVM.CurrProd) AndAlso
' ProjectManagerVM.CurrProj.nProdId = ProjectManagerVM.CurrProd.nProdId Then
' ProjectManagerVM.CurrProj.SetReloadProject(False)
' End If
' SelPage = Pages.VIEW
' End If
' End Set
'End Property
Public Property Machining_IsChecked As Boolean
Get
Return m_SelPage = Pages.MACHINING
End Get
Set(value As Boolean)
If value Then
If Not IsNothing(ProjectManagerVM.CurrProj) AndAlso Not IsNothing(ProjectManagerVM.CurrProd) AndAlso
ProjectManagerVM.CurrProj.nProdId = ProjectManagerVM.CurrProd.nProdId Then
ProjectManagerVM.CurrProd.SetReloadProject(False)
End If
SelPage = Pages.MACHINING
End If
End Set
End Property
'Public Property Machining_IsChecked As Boolean
' Get
' Return m_SelPage = Pages.MACHINING
' End Get
' Set(value As Boolean)
' If value Then
' If Not IsNothing(ProjectManagerVM.CurrProj) AndAlso Not IsNothing(ProjectManagerVM.CurrProd) AndAlso
' ProjectManagerVM.CurrProj.nProdId = ProjectManagerVM.CurrProd.nProdId Then
' ProjectManagerVM.CurrProd.SetReloadProject(False)
' End If
' SelPage = Pages.MACHINING
' End If
' End Set
'End Property
Public Property OnlyProdPage_IsChecked As Boolean
Get
@@ -115,6 +115,7 @@ Public Class MainMenuVM
' bOk = ExitMACHINING(bVerifyModification)
Case Pages.CONFIG
bOk = ExitCONFIG()
SetbOpenProject(True)
Case Pages.ONLYPRODPAGE
bOk = ExitONLYPRODPAGE(bVerifyModification)
End Select
@@ -266,6 +267,17 @@ Public Class MainMenuVM
NotifyPropertyChanged(NameOf(MainMenu_IsEnabled))
End Sub
Private m_bOpenProject As Boolean = False
Public ReadOnly Property bOpenProject As Boolean
Get
Return bOpenProject
End Get
End Property
Friend Sub SetbOpenProject(value As Boolean)
m_bOpenProject = value
NotifyPropertyChanged(NameOf(bOpenProject))
End Sub
'Private Function InitVIEW() As Boolean
' Map.refProjectVM.SetBottomPanel_Visibility(True)
' Map.refProjectVM.SetLeftPanel_Visibility(True)
@@ -593,76 +605,78 @@ Public Class MainMenuVM
' inizializzo gruppi di lavorazione
If Not IsNothing(ProjectManagerVM.CurrProd) AndAlso Not IsNothing(ProjectManagerVM.CurrProd.nProdId) AndAlso ProjectManagerVM.CurrProd.nProdId > 0 Then
If File.Exists(ProjectManagerVM.CurrProd.sProdPath) Then
' apro progetto
If ProjectManagerVM.CurrProd.bReloadProject OrElse Map.refConfigurationPageVM.QParametersModified Then
LoadingWndHelper.UpdateLoadingWnd(ActiveIds.GOTOPROD, 2, EgtMsg(63005), 10, 50) ' Loading parts
Map.refOnlyProdManagerVM.TempCurrProd = ProjectManagerVM.CurrProd
If Map.refSceneHostVM.MainController.OpenProject(ProjectManagerVM.CurrProd.sProdPath, False) Then
' aggiorno le colonne in base al tipo progetto
Map.refRawPartListVM.UpdateColumns(Map.refProjectVM.BTLStructureVM.nPROJTYPE)
Map.refFeatureInPartInRawPartListVM.UpdateColumns(CurrentMachine.nType)
Map.refRawPartListVM.UpdateColumns(Map.refProjectVM.BTLStructureVM.nPROJTYPE)
' resetto modifica parametri Q default
Map.refConfigurationPageVM.ResetQParametersModified()
DbControllers.m_ProdController.LockByProdId(ProjectManagerVM.CurrProd.nProdId, True, Map.refMainWindowVM.MainWindowM.GetKeyNumber())
Map.refOnlyProdManagerVM.NotifyPropertyChanged(NameOf(Map.refOnlyProdManagerVM.MruFileNames))
End If
Else
LoadingWndHelper.UpdateLoadingWnd(ActiveIds.GOTOPROD, 2, EgtMsg(63005), 10, 30) ' Loading parts
' mostro tutti i pezzi
Map.refShowBeamPanelVM.ShowAll(False)
' verifico se il prod ha piu' proj
If ProjectManagerVM.CurrProd.nProjIdList.Count > 1 Then
' se si rigenero BTLStructure
Map.refProjectVM.BTLStructureVM = New BTLStructureVM(BTLStructureM.CreateBTLStructure(0))
' carico filtri di ricerca
Map.refProjectVM.BTLStructureVM.LoadFilters()
End If
' recupero indice di modifica progetto
Dim CommIndex As Integer = -1
Dim ActiveSessionList As List(Of StatusMapModel) = DbControllers.m_StatusMapController.GetProd(m_SupervisorId)
For Each ActiveSession In ActiveSessionList
If ActiveSession.ItemId = ProjectManagerVM.CurrProd.nProdId Then
CommIndex = ActiveSession.Index
If Not m_bOpenProject Then
If File.Exists(ProjectManagerVM.CurrProd.sProdPath) Then
' apro progetto
If ProjectManagerVM.CurrProd.bReloadProject OrElse Map.refConfigurationPageVM.QParametersModified Then
LoadingWndHelper.UpdateLoadingWnd(ActiveIds.GOTOPROD, 2, EgtMsg(63005), 10, 50) ' Loading parts
Map.refOnlyProdManagerVM.TempCurrProd = ProjectManagerVM.CurrProd
If Map.refSceneHostVM.MainController.OpenProject(ProjectManagerVM.CurrProd.sProdPath, False) Then
' aggiorno le colonne in base al tipo progetto
Map.refRawPartListVM.UpdateColumns(Map.refProjectVM.BTLStructureVM.nPROJTYPE)
Map.refFeatureInPartInRawPartListVM.UpdateColumns(CurrentMachine.nType)
Map.refRawPartListVM.UpdateColumns(Map.refProjectVM.BTLStructureVM.nPROJTYPE)
' resetto modifica parametri Q default
Map.refConfigurationPageVM.ResetQParametersModified()
DbControllers.m_ProdController.LockByProdId(ProjectManagerVM.CurrProd.nProdId, True, Map.refMainWindowVM.MainWindowM.GetKeyNumber())
Map.refOnlyProdManagerVM.NotifyPropertyChanged(NameOf(Map.refOnlyProdManagerVM.MruFileNames))
End If
Next
LoadingWndHelper.UpdateLoadingWnd(ActiveIds.GOTOPROD, 3, EgtMsg(63002), 30, 100) ' Loading machining groups
' carico lista dei MachGroup
Map.refProjectVM.MachGroupPanelVM = New MyMachGroupPanelVM(MyMachGroupPanelM.CreateMyMachGroupPanel(Map.refMachinePanelVM.MachineList.ToList()))
' fisso indice sessione di comunicazione
If CommIndex > -1 Then
ProjectManagerVM.CurrProd.SetModificationIndex(CommIndex)
Else
LoadingWndHelper.UpdateLoadingWnd(ActiveIds.GOTOPROD, 2, EgtMsg(63005), 10, 30) ' Loading parts
' mostro tutti i pezzi
Map.refShowBeamPanelVM.ShowAll(False)
' verifico se il prod ha piu' proj
If ProjectManagerVM.CurrProd.nProjIdList.Count > 1 Then
' se si rigenero BTLStructure
Map.refProjectVM.BTLStructureVM = New BTLStructureVM(BTLStructureM.CreateBTLStructure(0))
' carico filtri di ricerca
Map.refProjectVM.BTLStructureVM.LoadFilters()
End If
' recupero indice di modifica progetto
Dim CommIndex As Integer = -1
Dim ActiveSessionList As List(Of StatusMapModel) = DbControllers.m_StatusMapController.GetProd(m_SupervisorId)
For Each ActiveSession In ActiveSessionList
If ActiveSession.ItemId = ProjectManagerVM.CurrProd.nProdId Then
CommIndex = ActiveSession.Index
End If
Next
LoadingWndHelper.UpdateLoadingWnd(ActiveIds.GOTOPROD, 3, EgtMsg(63002), 30, 100) ' Loading machining groups
' carico lista dei MachGroup
Map.refProjectVM.MachGroupPanelVM = New MyMachGroupPanelVM(MyMachGroupPanelM.CreateMyMachGroupPanel(Map.refMachinePanelVM.MachineList.ToList()))
' fisso indice sessione di comunicazione
If CommIndex > -1 Then
ProjectManagerVM.CurrProd.SetModificationIndex(CommIndex)
End If
ProjectManagerVM.CurrProd.SetReloadProject(True)
End If
ProjectManagerVM.CurrProd.SetReloadProject(True)
End If
' se Warehouse di tipo Medium e piu' di un progetto collegato
Dim nDefault As Integer = 2
If GetMainPrivateProfileInt(S_WAREHOUSE, EgtBEAMWALL.Core.ConstIni.K_TYPE, nDefault) = WarehouseType.MEDIUM AndAlso ProjectManagerVM.CurrProd.nProjIdList.Count > 1 Then
' confronto le Sezioni del BTL importato con quelle in Warehouse
WarehouseWndVM.UpdateSectionXMaterial()
End If
' aggiorno titolo
Map.refMainWindowVM.UpdateTitle()
DbControllers.m_ProdController.LockByProdId(ProjectManagerVM.CurrProd.nProdId, True, Map.refMainWindowVM.MainWindowM.GetKeyNumber())
' controllo se devo lanciare verifica perche' importato
Dim bGetVerifyResult As Boolean = False
Dim bVerifyMach As Boolean = False
Dim nBTLInfoLayerId As Integer = EgtGetFirstNameInGroup(GDB_ID.ROOT, BTLINFO)
While nBTLInfoLayerId <> GDB_ID.NULL
If EgtGetInfo(nBTLInfoLayerId, IMP_VERIFYMACHGROUP, bGetVerifyResult) AndAlso bGetVerifyResult Then
If Not bVerifyMach Then bVerifyMach = True
EgtSetInfo(nBTLInfoLayerId, IMP_VERIFYMACHGROUP, False)
' se Warehouse di tipo Medium e piu' di un progetto collegato
Dim nDefault As Integer = 2
If GetMainPrivateProfileInt(S_WAREHOUSE, EgtBEAMWALL.Core.ConstIni.K_TYPE, nDefault) = WarehouseType.MEDIUM AndAlso ProjectManagerVM.CurrProd.nProjIdList.Count > 1 Then
' confronto le Sezioni del BTL importato con quelle in Warehouse
WarehouseWndVM.UpdateSectionXMaterial()
End If
nBTLInfoLayerId = EgtGetNextName(nBTLInfoLayerId, BTLINFO)
End While
If bVerifyMach Then
Map.refCALCPanelVM.VerifyAll()
' aggiorno titolo
Map.refMainWindowVM.UpdateTitle()
DbControllers.m_ProdController.LockByProdId(ProjectManagerVM.CurrProd.nProdId, True, Map.refMainWindowVM.MainWindowM.GetKeyNumber())
' controllo se devo lanciare verifica perche' importato
Dim bGetVerifyResult As Boolean = False
Dim bVerifyMach As Boolean = False
Dim nBTLInfoLayerId As Integer = EgtGetFirstNameInGroup(GDB_ID.ROOT, BTLINFO)
While nBTLInfoLayerId <> GDB_ID.NULL
If EgtGetInfo(nBTLInfoLayerId, IMP_VERIFYMACHGROUP, bGetVerifyResult) AndAlso bGetVerifyResult Then
If Not bVerifyMach Then bVerifyMach = True
EgtSetInfo(nBTLInfoLayerId, IMP_VERIFYMACHGROUP, False)
End If
nBTLInfoLayerId = EgtGetNextName(nBTLInfoLayerId, BTLINFO)
End While
If bVerifyMach Then
Map.refCALCPanelVM.VerifyAll()
End If
' seleziono prima barra
Map.refProjectVM.MachGroupPanelVM.SelFirstMachGroup()
Else
MessageBox.Show(EgtMsg(61871))
End If
' seleziono prima barra
Map.refProjectVM.MachGroupPanelVM.SelFirstMachGroup()
Else
MessageBox.Show(EgtMsg(61871))
End If
Else
Map.refSceneHostVM.MainController.NewProject()
@@ -273,12 +273,12 @@ Public Class MainWindowM
' Verifico abilitazione nesting automatico
m_bAutoNestOption = Not String.IsNullOrWhiteSpace(sNestKey)
' Impostazioni per chiave di rete
Dim bNetKey As Boolean = ( GetMainPrivateProfileInt( S_GENERAL, K_NETKEY, 0) = 1)
EgtSetNetHwKey( bNetKey)
Dim bNetKey As Boolean = (GetMainPrivateProfileInt(S_GENERAL, K_NETKEY, 0) = 1)
EgtSetNetHwKey(bNetKey)
Dim sLockId As String = ""
EgtUILib.GetPrivateProfileString( S_LICENCE, K_LOCKID, "", sLockId, sLicFile)
If Not String.IsNullOrEmpty( sLockId) Then
EgtSetLockId( sLockId)
EgtUILib.GetPrivateProfileString(S_LICENCE, K_LOCKID, "", sLockId, sLicFile)
If Not String.IsNullOrEmpty(sLockId) Then
EgtSetLockId(sLockId)
End If
' Recupero livello e opzioni della chiave
Dim bKey As Boolean = EgtGetKeyLevel(5327, 2701, 1, m_nKeyLevel) And
@@ -351,7 +351,6 @@ Public Class MainWindowM
GetMainPrivateProfileString(S_GENERAL, K_SERVERADDRESS, "", m_sServerAddressRelease)
' e lo imposto nel core
Core.Configuration.SetServerAddressRelease(m_sServerAddressRelease)
' Info su opzioni chiave
EgtOutLog("KeyOptions : " & bKey.ToString() & " " & m_nKeyOptions.ToString())
End Sub
@@ -385,7 +384,7 @@ Public Class MainWindowM
' porto in primo piano la prima istanza
Dim bFound As Boolean = False
' processi del programma a 32 bit
Dim localProc As Process() = Process.GetProcessesByName("EgtBEAMWALL.ViewerOptimizerR32")
Dim localProc As Process() = Process.GetProcessesByName("EgtBEAMWALL.OptimizerR32")
For Each p As Process In localProc
If p.Id <> Process.GetCurrentProcess().Id Then
bFound = True
@@ -395,7 +394,7 @@ Public Class MainWindowM
Next
' se non trovati processi a 32 bit provo a 64 bit
If Not bFound Then
localProc = Process.GetProcessesByName("EgtBEAMWALL.ViewerOptimizerR64")
localProc = Process.GetProcessesByName("EgtBEAMWALL.OptimizerR64")
For Each p As Process In localProc
If p.Id <> Process.GetCurrentProcess().Id Then
bFound = True
@@ -475,6 +474,92 @@ Public Class MainWindowM
If Not IsNothing(m_objMutex) Then m_objMutex.Close()
End Sub
''' <summary>
''' Funzione che recupera il CurrProd
''' </summary>
''' <returns></returns>
Private Function GetCurrProd() As Integer
Dim sLastProjectPath As String = String.Empty
Dim sMruSection As String = S_MRUPROJFILES
sMruSection = S_MRUPRODFILES
GetMainPrivateProfileString(sMruSection, K_FILE & "1", String.Empty, sLastProjectPath)
If Not String.IsNullOrWhiteSpace(sLastProjectPath) AndAlso File.Exists(sLastProjectPath) Then
' ricavo l'Id e il progetto associato per l'apertura di quest'ultimo
Dim PjId As Integer = 0
Dim sPjId As String = Path.GetFileNameWithoutExtension(sLastProjectPath)
Integer.TryParse(sPjId, PjId)
Return PjId
End If
Return -1
End Function
''' <summary>
''' Funzione che recupera il tipo di progetto
''' </summary>
''' <returns></returns>
Private Function GetProdType() As BWType
' Recupero CurrProd
Dim currProd As Integer = GetCurrProd()
ProjectManagerVM.SetCurrProd(currProd)
If Not IsNothing(ProjectManagerVM.CurrProd) Then
Return ProjectManagerVM.CurrProd.nType
Else
Return BWType.NULL
End If
End Function
''' <summary>
''' Fuzione che recupera la cartella dove salvare il file json CustomerConfig
''' </summary>
''' <returns></returns>
Friend Function GetAISetupDirPath() As String
' Recupero tipo progetto
Dim nProdType As BWType = GetProdType()
' Percorso SetUpDir
Dim sAISetUpDir As String = String.Empty
If nProdType = BWType.BEAM Then
sAISetUpDir = sMachinesRoot & "\" & sMachineName & "\" & BEAM_DIR & "\" & AISETUP_DIR
Else
sAISetUpDir = sMachinesRoot & "\" & sMachineName & "\" & WALL_DIR & "\" & AISETUP_DIR
End If
' Controllo se la cartella AISetup è presente
If Not Directory.Exists(sAISetUpDir) Then
' Se non esiste, la crea
Directory.CreateDirectory(sAISetUpDir)
End If
Return sAISetUpDir
End Function
''' <summary>
''' Funzione che recupera il percorso della cartella Strategies
''' </summary>
''' <returns></returns>
Friend Function GetStrategiesDirPath() As String
' Recupero tipo progetto
Dim nProdType As BWType = GetProdType()
If nProdType = BWType.BEAM Then
Return sBeamRoot & "\" & STRATEGIES_DIR
ElseIf nProdType = BWType.WALL Then
Return sWallRoot & "\" & STRATEGIES_DIR
End If
Return String.Empty
End Function
''' <summary>
''' Funzione che recupera il percorso della cartella Standard
''' </summary>
''' <returns></returns>
Friend Function GetStandardDirPath() As String
' Recupero tipo progetto
Dim nProdType As BWType = GetProdType()
If nProdType = BWType.BEAM Then
Return sBeamRoot & "\" & STRATEGIES_DIR & "\" & STANDARD_DIR
ElseIf nProdType = BWType.WALL Then
Return sWallRoot & "\" & STRATEGIES_DIR & "\" & STANDARD_DIR
End If
Return String.Empty
End Function
#End Region ' METHODS
End Class
@@ -218,9 +218,16 @@ Public Class MainWindowVM
Dim sDayDir As String = sMonthDir & "\" & nDay
Dim VersionList() As String = Directory.GetFiles(sDayDir)
If VersionList.Length > 0 Then
Dim nMaxVersion As Int64 = VersionList.Max(Function(x) Int64.Parse(Path.GetFileNameWithoutExtension(x)))
LastBackupDate = New Date(nYear, nMonth, nDay)
Exit For
Dim nMaxVersion As Int64 = 0
For Each item As String In VersionList
Dim nTmp As Int64 = 0
Int64.TryParse(Path.GetFileNameWithoutExtension(item), nTmp)
nMaxVersion = Math.Max(nMaxVersion, nTmp)
Next
If nMaxVersion > 0 Then
LastBackupDate = New Date(nYear, nMonth, nDay)
Exit For
End If
End If
Next
If LastBackupDate <> Date.MinValue Then Exit For
@@ -1,6 +1,7 @@
Imports EgtWPFLib5
Imports EgtUILib
Imports EgtBEAMWALL.Core
Imports System.Windows.Automation.Peers
Public Class OnlyProdMainWindowV
@@ -11,11 +11,26 @@ Imports System.Windows
' Review the values of the assembly attributes
<Assembly: AssemblyTitle("EgtBEAMWALL.Optimizer")>
<Assembly: AssemblyDescription("")>
<Assembly: AssemblyCompany("Windows User")>
<Assembly: AssemblyProduct("EgtBEAMWALL.Optimizer")>
<Assembly: AssemblyCopyright("Copyright © Windows User 2025")>
#If PLATFORM = "x64" Then
#If DEBUG Then
<Assembly: AssemblyTitle("EgtBEAMWALL.OptimizerD64.exe")>
<Assembly: AssemblyDescription("EgtBEAMWALL VO Debug 64 bit")>
#Else
<Assembly: AssemblyTitle("EgtBEAMWALL.OptimizerR64.exe")>
<Assembly: AssemblyDescription("EgtBEAMWALL VO 64 bit")>
#End if
#Else
#If DEBUG Then
<Assembly: AssemblyTitle("EgtBEAMWALL.OptimizerD32.exe")>
<Assembly: AssemblyDescription("EgtBEAMWALL VO Debug 32 bit")>
#Else
<Assembly: AssemblyTitle("EgtBEAMWALL.OptimizerR32.exe")>
<Assembly: AssemblyDescription("EgtBEAMWALL VO 32 bit")>
#End If
#End If
<Assembly: AssemblyCompany("Egalware s.r.l.")>
<Assembly: AssemblyProduct("EgtBEAMWALL.ViewerOptimizer")>
<Assembly: AssemblyCopyright("Copyright © 2020-2025 by Egalware s.r.l.")>
<Assembly: AssemblyTrademark("")>
<Assembly: ComVisible(false)>
@@ -75,7 +75,7 @@
</StackPanel>
</Popup>
<Button Content="BTL"
<Button Content="ADD"
Command="{Binding ShowPopUpBtlBtnCommand}"
Name="BtlBtn"
Style="{StaticResource ToolBarOnlyProdManagerNew_Button}"/>
@@ -403,14 +403,14 @@ Public Class OnlyProdManagerVM
' elimino da DB
DbControllers.m_ProdController.DeleteProd(nProdId, True)
End If
' riapro progetto prod
OpenProject(TempCurrProd)
' Ricavo il tipo di Warehouse settato nell'INI
Dim nDefault As Integer = 2
If GetMainPrivateProfileInt(S_WAREHOUSE, EgtBEAMWALL.Core.ConstIni.K_TYPE, nDefault) = WarehouseType.MEDIUM Then
' Se di tipo Medium confronto le Sezioni del BTL importato con quelle in Warehouse
WarehouseWndVM.UpdateSectionXMaterial()
End If
' riapro progetto prod
OpenProject(TempCurrProd)
End Sub
Private Sub ManageImportLog(nProjId As Integer, sProjDir As String)
@@ -757,6 +757,7 @@ Public Class OnlyProdManagerVM
''' Execute the ImportBTL. This method is invoked by the ImportBTLCommand.
''' </summary>
Public Sub ImportBTL(Optional sFile As String = "", Optional bWithDlg As Boolean = True)
Dim x As Integer = EgtGetCurrentContext()
If ProdFileVM.VerifyProjectModification(CurrProd) = MessageBoxResult.Cancel Then Return
Dim sDir As String = String.Empty
GetMainPrivateProfileString(S_GENERAL, K_LASTIMPDIR, "", sDir)
@@ -845,9 +846,11 @@ Public Class OnlyProdManagerVM
EgtOutLog("Impossibile copiare il file")
bOk = False
End Try
x = EgtGetCurrentContext()
' 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
x = EgtGetCurrentContext()
' importo file
If bOk Then
bOk = Map.refSceneHostVM.MainController.ImportProject(sBtlCopyPath, False)
@@ -890,10 +893,13 @@ Public Class OnlyProdManagerVM
'Map.refPartManagerVM.LockVisibilityUpdate()
LoadingWndHelper.UpdateLoadingWnd(ActiveIds.IMPORTBTL, 3, EgtMsg(63006), 70, 100) ' Loading graphics
Map.refShowBeamPanelVM.ShowBuilding_IsChecked = bAssembly
x = EgtGetCurrentContext()
' mostro tutti i pezzi
Map.refShowBeamPanelVM.ShowAll(True)
x = EgtGetCurrentContext()
Else
Map.refShowBeamPanelVM.ShowBuilding_IsChecked = bAssembly
x = EgtGetCurrentContext()
' elimino da Db
' CheckMe impostata come cancellazione FISICA dal DB...
DbControllers.m_ProjController.DeleteProj(nProjId, False)
@@ -31,27 +31,27 @@
<EgtBEAMWALL:OnlyProdCalcPanelV Grid.Column="1"
DataContext="{StaticResource CALCPanelVM}"/>
<EgtBEAMWALL:OnlyProdSpecialPanelV Grid.Column="2"
<EgtBEAMWALL:OnlyProdSpecialPanelV Grid.Column="2"
DataContext="{StaticResource SpecialPanelVM}"
Visibility="{Binding DataContext.SpecialPanel_Visibility, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdProjectV}}}"/>
<EgtBEAMWALL:OnlyProdStatisticsTimePanelV Grid.Column="3"
HorizontalAlignment="Center"
HorizontalAlignment="Center"
DataContext="{StaticResource StatisticsTimePanelVM}"
Tag="{Binding DataContext, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdProjectV}}}"/>
<StackPanel Grid.Column="4"
Orientation="Horizontal"
HorizontalAlignment="Right">
<Button Command="{Binding Visualization_Command}"
<!--<Button Command="{Binding Visualization_Command}"
ToolTip="{Binding Statistics_Msg}"
Style="{StaticResource ToolBarViewPanel_Button}">
<Image Source="/Resources/InstrumentPanel/Vis.png" Stretch="Uniform"/>
</Button>
</Button>-->
<Button Command="{Binding Optimizer_Command}"
ToolTip="{Binding Statistics_Msg}"
Style="{StaticResource ToolBarViewPanel_Button}">
<Image Source="/Resources/InstrumentPanel/Ott.png" Stretch="Uniform"/>
<Image Source="/Resources/InstrumentPanel/Statistics.png" Stretch="Uniform"/>
</Button>
</StackPanel>
</Grid>
@@ -96,7 +96,8 @@
<EgtBEAMWALL:OnlyProdFreeContourManagerV DataContext="{StaticResource FreeContourManagerVM}"
Visibility="{Binding DataContext.FreeContourManager_Visibility, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdProjectV}}}"/>
<EgtBEAMWALL:RawPartManagerWndV Grid.Column="1" Tag="{Binding DataContext, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdProjectV}}}"/>
<EgtBEAMWALL:RawPartManagerWndV Grid.Column="1"
Tag="{Binding DataContext, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdProjectV}}}"/>
</Grid>
</TabItem.Content>
</TabItem>
@@ -130,20 +131,44 @@
<EgtBEAMWALL:OnlyProdFeatureListManagerV Grid.Row="1" Grid.ColumnSpan="2"/>
<EgtBEAMWALL:OnlyProdFeatureListV Grid.Row="2" Grid.ColumnSpan="2"
DataContext="{StaticResource FeatureListVM}"
Tag="{Binding DataContext.BTLStructureVM.SelBTLPart, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdProjectV}}}"
Margin="2,0,2,0"/>
<Grid Grid.Row="2" Grid.ColumnSpan="2">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<EgtBEAMWALL:OnlyProdFeatureListV DataContext="{StaticResource FeatureListVM}"
Tag="{Binding DataContext.BTLStructureVM.SelBTLPart, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdProjectV}}}"
Margin="2,0,2,0"/>
<StackPanel Orientation="Vertical"
Grid.Column="1"
Width="250">
<TextBlock Text="{Binding DataContext.BTLStructureVM.SelBTLPart.sCALC_MSG, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdProjectV}}}"
Foreground="{Binding DataContext.BTLStructureVM.SelBTLPart.CALC_ERR_Foreground, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdProjectV}}}"
Margin="5,0,5,0"
Visibility="{Binding DataContext.BTLStructureVM.SelBTLPart.CALC_MSG_Visibility, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdProjectV}}}"/>
<TextBlock Text="{Binding DataContext.BTLStructureVM.SelBTLPart.SelBTLFeatureVM.sCALC_MSG, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdProjectV}}}"
Foreground="{Binding DataContext.BTLStructureVM.SelBTLPart.SelBTLFeatureVM.Calc_Background, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdProjectV}}}"
Margin="5,0,5,0"/>
</StackPanel>
</Grid>
</Grid>
</TabItem.Content>
</TabItem>
<TabItem Header="STRATEGYMANAGER">
<TabItem.Content>
<TextBlock Text="STRATEGY"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Height="200"/>
<EgtBEAMWALL:ForcedStrategyPanelV DataContext="{StaticResource ForcedStrategyPanelVM}"/>
</TabItem.Content>
</TabItem>
<TabItem Header="SCENESHOWBULDING">
<TabItem.Content>
<Button Command="{Binding Parameter_Command}"
ToolTip="{Binding Parameters_ToolTip}" Margin="0,2.5,10,2.5"
Style="{StaticResource OnlyProdLeftPanel_Button}">
<Image Source="/Resources/InstrumentPanel/Analyze.png" Stretch="Uniform"/>
</Button>
<!--<EgtBEAMWALL:SceneShowBuldingV Margin="4,4,0,4"/>-->
</TabItem.Content>
</TabItem>
</TabControl>
@@ -156,22 +181,43 @@
Grid.Column="2">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<TabControl BorderThickness="0"
Margin="0,-3.8,0,-2"
SelectedIndex="{Binding SelManagerTab}">
<TabControl.ItemContainerStyle>
SelectedIndex="{Binding SelFeatureManagerTab}"
Background="White"
Style="{StaticResource OnlyProd_TabControl}">
<!--<TabControl.ItemContainerStyle>
<Style TargetType="{x:Type TabItem}">
<Setter Property="Visibility" Value="Collapsed"/>
</Style>
</TabControl.ItemContainerStyle>
<TabItem Header="RAWPARTMANAGER">
<EgtBEAMWALL:OnlyProdFeatureInPartInRawPartListV DataContext="{StaticResource FeatureInPartInRawPartListVM}"
Tag="{Binding DataContext.MachGroupPanelVM.SelectedMachGroup.SelPart, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdProjectV}}}"
Visibility="{Binding DataContext.FeatureList_Visibility, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdProjectV}}}"/>
</TabControl.ItemContainerStyle>-->
<TabItem Header="FEATURERAWPARTMANAGER" Visibility="{Binding DataContext.RawPartManagerVisibility, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdProjectV}}}">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<EgtBEAMWALL:OnlyProdFeatureInPartInRawPartListV DataContext="{StaticResource FeatureInPartInRawPartListVM}"
Tag="{Binding DataContext.MachGroupPanelVM.SelectedMachGroup.SelPart, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdProjectV}}}"
Visibility="{Binding DataContext.FeatureList_Visibility, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdProjectV}}}"/>
<StackPanel Orientation="Vertical"
Grid.Column="1"
Width="250" >
<TextBlock Text="{Binding DataContext.MachGroupPanelVM.SelectedMachGroup.sCALC_MSG, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdProjectV}}}"
Margin="5,0,5,0"
Foreground="{Binding DataContext.MachGroupPanelVM.SelectedMachGroup.Calc_Background, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdProjectV}}}"/>
<TextBlock Text="{Binding DataContext.MachGroupPanelVM.SelectedMachGroup.SelPart.sCALC_MSG, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdProjectV}}}"
Margin="5,0,5,0"
Foreground="{Binding DataContext.MachGroupPanelVM.SelectedMachGroup.SelPart.Calc_Background, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdProjectV}}}"/>
<TextBlock Text="{Binding DataContext.MachGroupPanelVM.SelectedMachGroup.SelPart.SelFeatureVM.sCALC_MSG, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdProjectV}}}"
Margin="5,0,5,0"
Foreground="{Binding DataContext.MachGroupPanelVM.SelectedMachGroup.SelPart.SelFeatureVM.Calc_Background, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdProjectV}}}"/>
</StackPanel>
</Grid>
</TabItem>
<TabItem Header="FEATUREMANAGER">
<TabItem Header="FEATUREMANAGERBTL" Visibility="{Binding DataContext.StrategyManagerVisibility, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdProjectV}}}">
<TabItem.Content>
<Grid>
<Grid.RowDefinitions>
@@ -192,8 +238,12 @@
</TabItem.Content>
</TabItem>
<TabItem Header="STRATEGYMANAGERBTL" Visibility="{Binding DataContext.StrategyManagerVisibility, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdProjectV}}}">
<TabItem.Content>
<EgtBEAMWALL:ForcedStrategyBTLV DataContext="{StaticResource ForcedStrategyBTLVM}"/>
</TabItem.Content>
</TabItem>
</TabControl>
<TextBlock Grid.Column="1" Width="200" Text="LOG FILE"/>
</Grid>
<Grid Grid.Row="3">
+48 -3
View File
@@ -317,14 +317,16 @@ Public Class ProjectVM
End Set
End Property
Friend Enum ManagerTab As Integer
' Gestione Tab con Strategy
Friend Enum StrategyManagerTab As Integer
NULL = -1
RAWPARTMANAGER = 0
FEATUREMANAGER = 1
STRATEGYMANAGER = 2
SCENESHOWBULDING = 3
End Enum
Private m_SelManagerTab As ManagerTab
Private m_SelManagerTab As StrategyManagerTab
Public Property SelManagerTab As Integer
Get
Return m_SelManagerTab
@@ -333,11 +335,32 @@ Public Class ProjectVM
m_SelManagerTab = value
End Set
End Property
Friend Sub SetSelManagerTab(bSelManagerTab As ManagerTab)
Friend Sub SetSelManagerTab(bSelManagerTab As StrategyManagerTab)
m_SelManagerTab = bSelManagerTab
NotifyPropertyChanged(NameOf(SelManagerTab))
End Sub
Friend Enum FeatureManagerTab As Integer
NULL = -1
FEATURERAWPARTMANAGER = 0
FEATUREMANAGERBTL = 1
STRATEGYMANAGERBTL = 2
End Enum
Private m_SelFeatureManagerTab As FeatureManagerTab
Public Property SelFeatureManagerTab As Integer
Get
Return m_SelFeatureManagerTab
End Get
Set(value As Integer)
m_SelFeatureManagerTab = value
End Set
End Property
Friend Sub SetSelFeatureManagerTab(bSelFeatureManagerTab As FeatureManagerTab)
m_SelFeatureManagerTab = bSelFeatureManagerTab
NotifyPropertyChanged(NameOf(SelFeatureManagerTab))
End Sub
Private m_FeatureList_Visibility As Visibility = Visibility.Collapsed
Public ReadOnly Property FeatureList_Visibility As Visibility
Get
@@ -349,6 +372,28 @@ Public Class ProjectVM
NotifyPropertyChanged(NameOf(FeatureList_Visibility))
End Sub
Private m_RawPartManagerVisibility As Visibility = Visibility.Collapsed
Public ReadOnly Property RawPartManagerVisibility As Visibility
Get
Return m_RawPartManagerVisibility
End Get
End Property
Sub SetRawPartManagerVisibility(bVisible As Visibility)
m_RawPartManagerVisibility = bVisible
NotifyPropertyChanged(NameOf(RawPartManagerVisibility))
End Sub
Private m_StrategyManagerVisibility As Visibility = Visibility.Collapsed
Public ReadOnly Property StrategyManagerVisibility As Visibility
Get
Return m_StrategyManagerVisibility
End Get
End Property
Sub SetStrategyManagerVisibility(bVisible As Visibility)
m_StrategyManagerVisibility = bVisible
NotifyPropertyChanged(NameOf(StrategyManagerVisibility))
End Sub
#Region "Messages"
Public ReadOnly Property Statistics_Msg As String
@@ -1,8 +1,7 @@
<StackPanel x:Class="OnlyProdRawPartManagerV"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
DataContext="{StaticResource RawPartManagerVM}"
Style="{StaticResource OnlyProdRawPartManager_StackPanel}">
<Grid x:Class="OnlyProdRawPartManagerV"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
DataContext="{StaticResource RawPartManagerVM}">
<!--<Button Command="{Binding ProduceRawPart_Command}"
ToolTip="{Binding ProduceRawPart_ToolTip}"
@@ -11,49 +10,59 @@
Style="{StaticResource OnlyProdLeftPanel_Button}">
<Image Source="/Resources/TopPanel/ProduceRawPart.png" Stretch="Uniform"/>
</Button>-->
<Button Command="{Binding NewRawPart_Command}"
ToolTip="{Binding NewRawPart_ToolTip}"
IsEnabled="{Binding BTLPartManager_IsEnabled}"
Style="{StaticResource OnlyProdLeftPanel_Button}">
<Image Source="/Resources/LeftPanel/NewRawPart.png" Stretch="Uniform"/>
</Button>
<Button Command="{Binding ProduceAllRawPart_Command}"
ToolTip="{Binding ProduceAllRawPart_ToolTip}"
IsEnabled="{Binding RawPartManagerIsEnabled}"
Visibility="{Binding ProduceRawPart_Visibility}"
Style="{StaticResource OnlyProdLeftPanel_Button}">
<Image Source="/Resources/TopPanel/ProduceAllRawPart.png" Stretch="Uniform"/>
</Button>
<!--<Button Command="{Binding CopyRawPart_Command}"
ToolTip="{Binding CopyRawPart_ToolTip}"
IsEnabled="{Binding RawPartManagerIsEnabled}"
Style="{StaticResource OnlyProdLeftPanel_Button}">
<Image Source="/Resources/TopPanel/CopyRawPart.png" Stretch="Uniform"/>
</Button>-->
<!--<Button Command="{Binding RemoveRawPart_Command}"
ToolTip="{Binding RemoveRawPart_ToolTip}"
IsEnabled="{Binding RawPartManagerIsEnabled}"
Style="{StaticResource OnlyProdLeftPanel_Button}">
<Image Source="/Resources/TopPanel/RemoveRawPart.png" Stretch="Uniform"/>
</Button>-->
<Button ToolTip="{Binding VerifyAll_ToolTip}"
Command="{Binding VerifyAll_Command}"
IsEnabled="{Binding VerifyAll_IsEnabled}"
Style="{StaticResource OnlyProdLeftPanel_Button}">
<Image Source="/Resources/CALCPanel/VerifyAll.png" Stretch="Uniform"/>
</Button>
<Button Command="{Binding RemoveAllRawPart_Command}"
ToolTip="{Binding RemoveAllRawPart_ToolTip}"
IsEnabled="{Binding RawPartManagerIsEnabled}"
Style="{StaticResource OnlyProdLeftPanel_Button}">
<Image Source="/Resources/TopPanel/RemoveAllRawPart.png" Stretch="Uniform"/>
</Button>
<Button Command="{Binding MovePartInRawPart_Command}"
ToolTip="{Binding MovePartInRawPart_ToolTip}"
IsEnabled="{Binding RawPartManagerIsEnabled}"
Visibility="{Binding MovePartInRawPart_Visibility}"
Style="{StaticResource OnlyProdLeftPanel_Button}">
<Image Source="/Resources/TopPanel/MovePartInRawPart.png" Stretch="Uniform"/>
</Button>
<StackPanel Style="{StaticResource OnlyProdRawPartManager_StackPanel}">
<Button Command="{Binding NewRawPart_Command}"
ToolTip="{Binding NewRawPart_ToolTip}"
IsEnabled="{Binding BTLPartManager_IsEnabled}"
Style="{StaticResource OnlyProdLeftPanel_Button}">
<Image Source="/Resources/LeftPanel/NewRawPart.png" Stretch="Uniform"/>
</Button>
</StackPanel>
<StackPanel Style="{StaticResource OnlyProdRawPartManagerAll_StackPanel}">
<Button Command="{Binding ProduceAllRawPart_Command}"
ToolTip="{Binding ProduceAllRawPart_ToolTip}"
IsEnabled="{Binding RawPartManagerIsEnabled}"
Visibility="{Binding ProduceRawPart_Visibility}"
Style="{StaticResource OnlyProdLeftPanel_Button}">
<Image Source="/Resources/TopPanel/ProduceAllRawPart.png" Stretch="Uniform"/>
</Button>
<!--<Button Command="{Binding CopyRawPart_Command}"
ToolTip="{Binding CopyRawPart_ToolTip}"
IsEnabled="{Binding RawPartManagerIsEnabled}"
Style="{StaticResource OnlyProdLeftPanel_Button}">
<Image Source="/Resources/TopPanel/CopyRawPart.png" Stretch="Uniform"/>
</Button>-->
<!--<Button Command="{Binding RemoveRawPart_Command}"
ToolTip="{Binding RemoveRawPart_ToolTip}"
IsEnabled="{Binding RawPartManagerIsEnabled}"
Style="{StaticResource OnlyProdLeftPanel_Button}">
<Image Source="/Resources/TopPanel/RemoveRawPart.png" Stretch="Uniform"/>
</Button>-->
<Button ToolTip="{Binding VerifyAll_ToolTip}"
Command="{Binding VerifyAll_Command}"
IsEnabled="{Binding VerifyAll_IsEnabled}"
Style="{StaticResource OnlyProdLeftPanel_Button}">
<Image Source="/Resources/CALCPanel/VerifyAll.png" Stretch="Uniform"/>
</Button>
<Button Command="{Binding ResetCalc_Command}"
ToolTip="{Binding ResetCalc_ToolTip}"
IsEnabled="{Binding CALCPanel_IsEnabled}"
Style="{StaticResource OnlyProdLeftPanel_Button}">
<Image Source="/Resources/CALCPanel/ResetCalc.png" Stretch="Uniform"/>
</Button>
<Button Command="{Binding RemoveAllRawPart_Command}"
ToolTip="{Binding RemoveAllRawPart_ToolTip}"
IsEnabled="{Binding RawPartManagerIsEnabled}"
Style="{StaticResource OnlyProdLeftPanel_Button}">
<Image Source="/Resources/NewPage/Remove.png" Stretch="Uniform"/>
</Button>
<Button Command="{Binding MovePartInRawPart_Command}"
ToolTip="{Binding MovePartInRawPart_ToolTip}"
IsEnabled="{Binding RawPartManagerIsEnabled}"
Visibility="{Binding MovePartInRawPart_Visibility}"
Style="{StaticResource OnlyProdLeftPanel_Button}">
<Image Source="/Resources/TopPanel/MovePartInRawPart.png" Stretch="Uniform"/>
</Button>
</StackPanel>
</StackPanel>
</Grid>
@@ -43,6 +43,7 @@ Public Class RawPartManagerVM
Private m_cmdMovePartInRawPart As ICommand
Private m_cmdNewRawPart As ICommand
Private m_cmdVerifyAll As ICommand
Private m_cmdResetCalc As ICommand
#End Region ' Fields & Properties
@@ -108,6 +109,12 @@ Public Class RawPartManagerVM
End Get
End Property
Public ReadOnly Property ResetCalc_ToolTip As String
Get
Return EgtMsg(61940)
End Get
End Property
#End Region ' Messages
#Region "CONSTRUCTORS"
@@ -862,100 +869,127 @@ Public Class RawPartManagerVM
''' Execute the Open. This method is invoked by the OpenCommand.
''' </summary>
Friend Sub VerifyAll()
If (Map.refMainMenuVM.SelPage = Pages.VIEW AndAlso (IsNothing(ProjectManagerVM.CurrProj) OrElse IsNothing(Map.refProjectVM.BTLStructureVM))) OrElse
(Map.refMainMenuVM.SelPage = Pages.MACHINING AndAlso (IsNothing(ProjectManagerVM.CurrProd) OrElse IsNothing(Map.refProjectVM.MachGroupPanelVM))) OrElse
(Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE AndAlso (IsNothing(ProjectManagerVM.CurrProj) OrElse IsNothing(Map.refProjectVM.BTLStructureVM)) AndAlso (IsNothing(ProjectManagerVM.CurrProd) OrElse IsNothing(Map.refProjectVM.MachGroupPanelVM))) Then Return
If (Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE AndAlso (IsNothing(ProjectManagerVM.CurrProj) OrElse IsNothing(Map.refProjectVM.BTLStructureVM)) AndAlso (IsNothing(ProjectManagerVM.CurrProd) OrElse IsNothing(Map.refProjectVM.MachGroupPanelVM))) Then Return
' se modalita' assemblato
Configuration.AssembledMode(Map.refShowBeamPanelVM.ShowBuilding_IsChecked)
Dim BarList() As EgtBEAMWALL.Core.Bar = Nothing
Dim ProjType As BWType
If Map.refMainMenuVM.SelPage = Pages.VIEW Then
ProjType = ProjectManagerVM.CurrProj.nType
If Not CreateBarListToVerify(Pages.VIEW, ProjType, BarList) Then Return
' lancio calcolo
EgtBEAMWALL.Core.CalcIntegration.Run(BarList, ProjectManagerVM.CurrProj.sProjDirPath, AddressOf ManageCalc)
ElseIf Map.refMainMenuVM.SelPage = Pages.MACHINING Then
ProjType = ProjectManagerVM.CurrProd.nType
If Not CreateBarListToVerify(Pages.MACHINING, ProjType, BarList) Then Return
' lancio calcolo
EgtBEAMWALL.Core.CalcIntegration.Run(BarList, ProjectManagerVM.CurrProd.sProdDirPath, AddressOf ManageCalc)
ElseIf Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE Then
ProjType = ProjectManagerVM.CurrProd.nType
If Map.refProjectVM.LastSelGridType = ProjectVM.GridSelTypes.PART OrElse Map.refProjectVM.LastSelGridType = ProjectVM.GridSelTypes.PARTLIST Then
If Not CreateBarListToVerify(Pages.VIEW, ProjType, BarList) Then Return
' lancio calcolo
EgtBEAMWALL.Core.CalcIntegration.Run(BarList, ProjectManagerVM.CurrProj.sProjDirPath, AddressOf ManageCalc)
ElseIf Map.refProjectVM.LastSelGridType = ProjectVM.GridSelTypes.MACHGROUP Then
If Not CreateBarListToVerify(Pages.MACHINING, ProjType, BarList) Then Return
' lancio calcolo
EgtBEAMWALL.Core.CalcIntegration.Run(BarList, ProjectManagerVM.CurrProd.sProdDirPath, AddressOf ManageCalc)
End If
End If
'If Map.refMainMenuVM.SelPage = Pages.VIEW Then
' ProjType = ProjectManagerVM.CurrProj.nType
' If Not CreateBarListToVerify(Pages.VIEW, ProjType, BarList) Then Return
' ' lancio calcolo
' EgtBEAMWALL.Core.CalcIntegration.Run(BarList, ProjectManagerVM.CurrProj.sProjDirPath, AddressOf ManageCalc)
'ElseIf Map.refMainMenuVM.SelPage = Pages.MACHINING Then
' ProjType = ProjectManagerVM.CurrProd.nType
' If Not CreateBarListToVerify(Pages.MACHINING, ProjType, BarList) Then Return
' ' lancio calcolo
' EgtBEAMWALL.Core.CalcIntegration.Run(BarList, ProjectManagerVM.CurrProd.sProdDirPath, AddressOf ManageCalc)
'ElseIf Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE Then
ProjType = ProjectManagerVM.CurrProd.nType
'If Map.refProjectVM.LastSelGridType = ProjectVM.GridSelTypes.PART OrElse Map.refProjectVM.LastSelGridType = ProjectVM.GridSelTypes.PARTLIST Then
' If Not CreateBarListToVerify(Pages.VIEW, ProjType, BarList) Then Return
' ' lancio calcolo
' EgtBEAMWALL.Core.CalcIntegration.Run(BarList, ProjectManagerVM.CurrProj.sProjDirPath, AddressOf ManageCalc)
'ElseIf Map.refProjectVM.LastSelGridType = ProjectVM.GridSelTypes.MACHGROUP Then
If Not CreateBarListToVerify(ProjType, BarList) Then Return
' lancio calcolo
EgtBEAMWALL.Core.CalcIntegration.Run(BarList, ProjectManagerVM.CurrProd.sProdDirPath, AddressOf ManageCalc)
'End If
'End If
End Sub
Private Function CreateBarListToVerify(SelPage As Pages, ProjType As BWType, ByRef BarList As Bar()) As Boolean
If SelPage = Pages.VIEW Then
Dim TempBarList As New List(Of EgtBEAMWALL.Core.Bar)
For PartIndex = 0 To Map.refProjectVM.BTLStructureVM.BTLPartVMList.Count - 1
Dim CurrPart As BTLPartVM = Map.refProjectVM.BTLStructureVM.BTLPartVMList(PartIndex)
If Not CurrPart.bDO Then Continue For
Dim Bar As New EgtBEAMWALL.Core.Bar With {.nBarId = CurrPart.nPartId,
.nProgramPage = ProjectType.PROJ,
.nProjType = ProjType,
.bBarOk = True,
.nMachineName = Map.refMachinePanelVM.SelectedMachine.Name,
.nGlobState = CurrPart.nGlobalState}
Select Case CurrPart.nGlobalState
Case Core.CalcStates.OK, CalcStates.INFO
Bar.nCmdType = CalcIntegration.CmdTypes.GENERATE
Case Else
If CurrPart.nGlobalState = CalcStates.NOTCALCULATED OrElse CurrPart.nFeaturesGlobalState > CalcStates.INFO Then
Dim sBTLPartFilePath As String = ProjectManagerVM.CurrProj.sProjDirPath & "\" & CurrPart.nPDN.ToString() & ".ori.bwe"
If File.Exists(sBTLPartFilePath) Then File.Delete(sBTLPartFilePath)
End If
Bar.nCmdType = CalcIntegration.CmdTypes.CHECKGEN
End Select
TempBarList.Add(Bar)
Next
BarList = TempBarList.ToArray()
' disabilito interfaccia
Map.refProjectVM.SetCalcRunning(True)
ElseIf SelPage = Pages.MACHINING Then
Dim TempBarList As New List(Of EgtBEAMWALL.Core.Bar)
For PartIndex = 0 To Map.refMachGroupPanelVM.MachGroupVMList.Count - 1
Dim CurrMachGroup As MyMachGroupVM = Map.refMachGroupPanelVM.MachGroupVMList(PartIndex)
' se e' gia' stato assegnato a supervisor, la salto e vado alla prossima barra
If CurrMachGroup.nProduction_State >= ItemState.Assigned Then Continue For
Dim MachineName As String = ""
EgtGetMachGroupMachineName(CurrMachGroup.Id, MachineName)
Dim Bar As New EgtBEAMWALL.Core.Bar With {.nBarId = CurrMachGroup.Id,
.nProgramPage = ProjectType.PROD,
.nProjType = ProjType,
.bBarOk = True,
.nMachineName = MachineName,
.nGlobState = CurrMachGroup.nGlobalState}
Select Case CurrMachGroup.nGlobalState
Case Core.CalcStates.OK, CalcStates.INFO
Bar.nCmdType = CalcIntegration.CmdTypes.GENERATE
Case Else
If CurrMachGroup.nGlobalState = CalcStates.NOTCALCULATED OrElse (CurrMachGroup.nPartsGlobalState > CalcStates.INFO) Then
Dim sMachGroupFilePath As String = ProjectManagerVM.CurrProd.sProdDirPath & "\" & CurrMachGroup.Name.ToString() & ".ori.bwe"
If File.Exists(sMachGroupFilePath) Then File.Delete(sMachGroupFilePath)
End If
Bar.nCmdType = CalcIntegration.CmdTypes.CHECKGEN
End Select
TempBarList.Add(Bar)
Next
If TempBarList.Count = 0 Then Return False
BarList = TempBarList.ToArray()
' disabilito interfaccia
Map.refProjectVM.SetCalcRunning(True)
End If
Private Function CreateBarListToVerify(ProjType As BWType, ByRef BarList As Bar()) As Boolean
'If SelPage = Pages.VIEW Then
' Dim TempBarList As New List(Of EgtBEAMWALL.Core.Bar)
' For PartIndex = 0 To Map.refProjectVM.BTLStructureVM.BTLPartVMList.Count - 1
' Dim CurrPart As BTLPartVM = Map.refProjectVM.BTLStructureVM.BTLPartVMList(PartIndex)
' If Not CurrPart.bDO Then Continue For
' Dim Bar As New EgtBEAMWALL.Core.Bar With {.nBarId = CurrPart.nPartId,
' .nProgramPage = ProjectType.PROJ,
' .nProjType = ProjType,
' .bBarOk = True,
' .nMachineName = Map.refMachinePanelVM.SelectedMachine.Name,
' .nGlobState = CurrPart.nGlobalState}
' Select Case CurrPart.nGlobalState
' Case Core.CalcStates.OK, CalcStates.INFO
' Bar.nCmdType = CalcIntegration.CmdTypes.GENERATE
' Case Else
' If CurrPart.nGlobalState = CalcStates.NOTCALCULATED OrElse CurrPart.nFeaturesGlobalState > CalcStates.INFO Then
' Dim sBTLPartFilePath As String = ProjectManagerVM.CurrProj.sProjDirPath & "\" & CurrPart.nPDN.ToString() & ".ori.bwe"
' If File.Exists(sBTLPartFilePath) Then File.Delete(sBTLPartFilePath)
' End If
' Bar.nCmdType = CalcIntegration.CmdTypes.CHECKGEN
' End Select
' TempBarList.Add(Bar)
' Next
' BarList = TempBarList.ToArray()
' ' disabilito interfaccia
' Map.refProjectVM.SetCalcRunning(True)
'ElseIf SelPage = Pages.MACHINING Then
Dim TempBarList As New List(Of EgtBEAMWALL.Core.Bar)
For PartIndex = 0 To Map.refMachGroupPanelVM.MachGroupVMList.Count - 1
Dim CurrMachGroup As MyMachGroupVM = Map.refMachGroupPanelVM.MachGroupVMList(PartIndex)
' se e' gia' stato assegnato a supervisor, la salto e vado alla prossima barra
If CurrMachGroup.nProduction_State >= ItemState.Assigned Then Continue For
Dim MachineName As String = ""
EgtGetMachGroupMachineName(CurrMachGroup.Id, MachineName)
Dim Bar As New EgtBEAMWALL.Core.Bar With {.nBarId = CurrMachGroup.Id,
.nProgramPage = ProjectType.PROD,
.nProjType = ProjType,
.bBarOk = True,
.nMachineName = MachineName,
.nGlobState = CurrMachGroup.nGlobalState}
Select Case CurrMachGroup.nGlobalState
Case Core.CalcStates.OK, CalcStates.INFO
Bar.nCmdType = CalcIntegration.CmdTypes.GENERATE
Case Else
If CurrMachGroup.nGlobalState = CalcStates.NOTCALCULATED OrElse (CurrMachGroup.nPartsGlobalState > CalcStates.INFO) Then
Dim sMachGroupFilePath As String = ProjectManagerVM.CurrProd.sProdDirPath & "\" & CurrMachGroup.Name.ToString() & ".ori.bwe"
If File.Exists(sMachGroupFilePath) Then File.Delete(sMachGroupFilePath)
End If
Bar.nCmdType = CalcIntegration.CmdTypes.CHECKGEN
End Select
TempBarList.Add(Bar)
Next
If TempBarList.Count = 0 Then Return False
BarList = TempBarList.ToArray()
' disabilito interfaccia
Map.refProjectVM.SetCalcRunning(True)
'End If
Return True
End Function
#End Region ' VerifyAll
#Region "ResetCalc"
''' <summary>
''' Returns a command that do Exec.
''' </summary>
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
''' <summary>
''' Execute the Exec. This method is invoked by the ExecCommand.
''' </summary>
Public Sub ResetCalc()
If (Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE AndAlso (IsNothing(ProjectManagerVM.CurrProj) OrElse IsNothing(Map.refProjectVM.BTLStructureVM)) AndAlso (IsNothing(ProjectManagerVM.CurrProd) OrElse IsNothing(Map.refProjectVM.MachGroupPanelVM))) Then Return
For Each MachGroup As MyMachGroupVM In Map.refProjectVM.MachGroupPanelVM.MachGroupVMList
If MachGroup.nProduction_State >= ItemState.Assigned Then Continue For
If MachGroup.nGlobalState <> CalcStates.NOTCALCULATED Then
MachGroup.ResetCalcTotalMachGroup()
End If
Next
End Sub
#End Region ' ResetCalc
#End Region ' Commands
End Class
Binary file not shown.

After

Width:  |  Height:  |  Size: 563 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 689 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 819 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 717 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 766 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 751 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 868 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 963 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 506 B

After

Width:  |  Height:  |  Size: 631 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 629 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

@@ -0,0 +1,80 @@
<EgtWPFLib5:EgtCustomWindow x:Class="SaveAsStrategyV"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:EgtWPFLib5="clr-namespace:EgtWPFLib5;assembly=EgtWPFLib5"
xmlns:Optmizer="clr-namespace:EgtBEAMWALL.Optimizer"
WindowStyle="None" ResizeMode="NoResize"
SizeToContent="WidthAndHeight"
WindowStartupLocation="CenterOwner"
IsClosable="False"
IsMinimizable="False"
IsResizable="False"
MinWidth="350"
MinHeight="170"
TitleBarHeight="30"
Title="SaveAsStrategy"
Style="{StaticResource OnlyProd_EgtCustomWindow}"
CloseCommand="{Binding Close_Command, Mode=OneWay, UpdateSourceTrigger=PropertyChanged}">
<Grid HorizontalAlignment="Center">
<Grid.RowDefinitions>
<RowDefinition Height="1*"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<ListBox ItemsSource="{Binding StrategySetupList}"
SelectedItem="{Binding SelStrategySetup}"
Style="{StaticResource Strategy_ListBox}">
<ListBox.ItemTemplate>
<DataTemplate DataType="{x:Type Optmizer:StrategySetup}">
<StackPanel Orientation="Horizontal">
<TextBlock Text="•"
Margin="0,0,5,0"
Style="{StaticResource DialogWindow_TextBlock}"/>
<TextBlock Text="{Binding sName}"
Style="{StaticResource DialogWindow_TextBlock}"/>
</StackPanel>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
<Grid Grid.Row="1"
Margin="5,0,5,10">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<TextBox Text="{Binding sFileNameCustomConfig, UpdateSourceTrigger=PropertyChanged}"
IsReadOnly="False"
Style="{StaticResource Strategy_TextBox}"/>
<UniformGrid Grid.Column="2"
Columns="3">
<Button Command="{Binding SaveAsCommand}"
ToolTip="{Binding NewToolTip}"
IsEnabled="{Binding bSaveAsIsEnable}"
Visibility="{Binding bOpen_Visibility}"
Style="{StaticResource SaveStrategy_Button}">
<Image Source="/Resources/newPage/Ok.png" Stretch="Uniform"/>
</Button>
<Button Command="{Binding SaveAsCommand}"
ToolTip="{Binding SaveAsToolTip}"
IsEnabled="{Binding bSaveAsIsEnable}"
Visibility="{Binding bSave_Visibility}"
Style="{StaticResource SaveStrategy_Button}">
<Image Source="/Resources/newPage/Ok.png" Stretch="Uniform"/>
</Button>
<Button Command="{Binding CloseCommand}"
ToolTip="{Binding SaveAsToolTip}"
Style="{StaticResource SaveStrategy_Button}">
<Image Source="/Resources/PDFEditor/Delete.png" Stretch="Uniform"/>
</Button>
</UniformGrid>
</Grid>
<TextBlock Grid.Row="2"
Text="{Binding sErrorMsg}"
Visibility="{Binding ErrorMsgVisibility}"
Margin="0,0,0,10"
Style="{StaticResource ErrorMsg_TextBlock}"/>
</Grid>
</EgtWPFLib5:EgtCustomWindow>
@@ -0,0 +1,24 @@
Imports System.Windows.Forms
Public Class SaveAsStrategyV
#Region "FIELDS & PROPERTIES"
Private WithEvents m_SaveAsStrategyVM As SaveAsStrategyVM
#End Region ' Fields & Properties
#Region "EVENTS"
Private Sub Load() Handles Me.Loaded
m_SaveAsStrategyVM = Me.DataContext
End Sub
Private Sub CloseWindow(DialogResult As DialogResult) Handles m_SaveAsStrategyVM.m_CloseWindow
Me.DialogResult = DialogResult
Me.Close()
End Sub
#End Region
End Class
@@ -0,0 +1,203 @@
Imports EgtWPFLib5
Imports System.Windows.Forms
Imports System.Collections.ObjectModel
Imports EgtUILib
Public Class SaveAsStrategyVM
Inherits VMBase
#Region "FIELDS & PROPERTIES"
' Evento per chiusura finestra
Public Event m_CloseWindow(bDialogResult As DialogResult)
' Nome file json customconfig
Private m_sFileNameCustomConfig As String
Public Property sFileNameCustomConfig As String
Get
Return m_sFileNameCustomConfig
End Get
Set(value As String)
m_sFileNameCustomConfig = value
CheckJsonFile()
NotifyPropertyChanged(NameOf(sFileNameCustomConfig))
End Set
End Property
' Usato per gestire il fatto di non sovrascrivere il file
Private m_bSaveAsIsEnable As Boolean = True
Public ReadOnly Property bSaveAsIsEnable As Boolean
Get
Return m_bSaveAsIsEnable
End Get
End Property
Friend Sub SetSaveAsIsEnable(value As Boolean)
m_bSaveAsIsEnable = value
NotifyPropertyChanged(NameOf(bSaveAsIsEnable))
End Sub
' Usato per visualizzare messaggio di errore
Private m_ErrorMsgVisibility As Visibility = Visibility.Collapsed
Public ReadOnly Property ErrorMsgVisibility As Visibility
Get
Return m_ErrorMsgVisibility
End Get
End Property
Friend Sub SetErrorMsgVisibility(value As Visibility)
m_ErrorMsgVisibility = value
NotifyPropertyChanged(NameOf(ErrorMsgVisibility))
End Sub
' Messaggio di errore
Private m_sErrorMsg As String = String.Empty
Public ReadOnly Property sErrorMsg As String
Get
Return m_sErrorMsg
End Get
End Property
Friend Sub SetErrorMsg(value As String)
m_sErrorMsg = value
NotifyPropertyChanged(NameOf(sErrorMsg))
End Sub
' Lista dei file json presenti nella cartella AISetUp
Public ReadOnly Property StrategySetupList As ObservableCollection(Of StrategySetup)
Get
Return Map.refStrategyManagerVM.StrategySetupList
End Get
End Property
Private m_SelStrategySetup As StrategySetup = Map.refStrategyManagerVM.SelStrategySetup
Public Property SelStrategySetup As StrategySetup
Get
Return Map.refStrategyManagerVM.SelStrategySetup
End Get
Set(value As StrategySetup)
m_SelStrategySetup = value
CheckJsonFile()
NotifyPropertyChanged(NameOf(SelStrategySetup))
End Set
End Property
Private m_bOpen_Visibility As Visibility = Visibility.Collapsed
Public ReadOnly Property bOpen_Visibility As Visibility
Get
Return m_bOpen_Visibility
End Get
End Property
Friend Sub SetbOpen_Visibility(value As Visibility)
m_bOpen_Visibility = value
NotifyPropertyChanged(NameOf(bOpen_Visibility))
End Sub
Private m_bSave_Visibility As Visibility = Visibility.Collapsed
Public ReadOnly Property bSave_Visibility As Visibility
Get
Return m_bSave_Visibility
End Get
End Property
Friend Sub SetbSave_Visibility(value As Visibility)
m_bSave_Visibility = value
NotifyPropertyChanged(NameOf(bSave_Visibility))
End Sub
#Region "Messages"
Public ReadOnly Property NewToolTip As String
Get
Return EgtMsg(30501)
End Get
End Property
Public ReadOnly Property SaveAsToolTip As String
Get
Return EgtMsg(62572)
End Get
End Property
#End Region ' Messages
' Definizione Comandi
Private m_SaveAsCommand As ICommand
Private m_cmdCloseCommand As ICommand
#End Region ' Fields & Properties
#Region "METHODS"
''' <summary>
''' Funzione che controlla se il file json è già presente
''' </summary>
Private Sub CheckJsonFile()
' Controllo se il nome del file è stato scritto
Dim fileExists As Boolean = False
For Each ItemSetUp As StrategySetup In StrategySetupList
If ItemSetUp.sName = m_sFileNameCustomConfig Then
fileExists = True
End If
Next
' Imposta il messaggio di errore e la visibilità in base alla presenza del file
SetErrorMsg(If(fileExists, "FILE GIA' PRESENTE", String.Empty))
' Abilito o Disabilito pulsante saveas
SetSaveAsIsEnable(Not fileExists)
' Rendo visibile o invisibile textblock messaggio
SetErrorMsgVisibility(If(fileExists, Visibility.Visible, Visibility.Collapsed))
End Sub
#End Region ' Methods
#Region "COMMANDS"
#Region "SaveAsCommand"
Public ReadOnly Property SaveAsCommand As ICommand
Get
If m_SaveAsCommand Is Nothing Then
m_SaveAsCommand = New Command(AddressOf SaveAs)
End If
Return m_SaveAsCommand
End Get
End Property
''' <summary>
''' Funzione che salva il file json CustomerConfig
''' </summary>
Public Sub SaveAs()
Dim sAISetupDirPath As String = Map.refMainWindowVM.MainWindowM.GetAISetupDirPath()
Dim sStrategyConfigurationFilePath As String = sAISetupDirPath & "\" & sFileNameCustomConfig & ".json"
Dim Strategy As New StrategySetup(sFileNameCustomConfig)
Map.refStrategyManagerVM.SelStrategySetup = Strategy
Map.refStrategyManagerVM.StrategySetupList.Add(Strategy)
If m_bSave_Visibility = Visibility.Visible Then
Map.refStrategyManagerVM.SelStrategySetup.Write()
Map.refStrategyManagerVM.SetbIsModifyStrategy(False)
Else
Map.refStrategyManagerVM.SetbIsModifyStrategy(True)
End If
NotifyPropertyChanged(NameOf(StrategySetupList))
RaiseEvent m_CloseWindow(DialogResult.Cancel)
End Sub
#End Region ' SaveAsCommand
#Region "CloseCommand"
Public ReadOnly Property CloseCommand As ICommand
Get
If m_cmdCloseCommand Is Nothing Then
m_cmdCloseCommand = New Command(AddressOf Close)
End If
Return m_cmdCloseCommand
End Get
End Property
Public Sub Close()
' Chiudo finestra senza fare niente
RaiseEvent m_CloseWindow(DialogResult.Cancel)
End Sub
#End Region ' CloseCommand
#End Region ' Commands
End Class
@@ -0,0 +1,10 @@
<UserControl x:Class="SceneShowBuldingV"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:EgtUILib="clr-namespace:EgtUILib;assembly=EgtUILib">
<WindowsFormsHost>
<EgtUILib:Scene x:Name="SceneShowBulding"/>
</WindowsFormsHost>
</UserControl>
@@ -0,0 +1,106 @@
Imports EgtBEAMWALL.Core
Imports System.Windows.Interop
Imports EgtUILib.EgtInterface
Imports EgtWPFLib5
Public Class SceneShowBuldingV
#Region "CONSTRUCTOR"
Sub New()
' La chiamata è richiesta dalla finestra di progettazione.
InitializeComponent()
' Aggiungere le eventuali istruzioni di inizializzazione dopo la chiamata a InitializeComponent().
' Creo Riferimento
MapV.SetRefSceneShowBuldingV(Me)
' Inizializzazione Scena
PreInitializeScene()
If SceneShowBulding.Init() And Map.refMainWindowVM.MainWindowM.GetKeyOption(KEY_OPT.BEAM Or KEY_OPT.WALL) Then
PostInitializeScene()
' Imposto stato gestione mouse diretto della scena a nessuno
SceneShowBulding.SetStatusNull()
' Imposto focus pulsante su false
SceneShowBulding.SetFocusOnMove(False)
' Recupero e imposto handle finestra principale
'Dim hMainWnd As IntPtr = New WindowInteropHelper(Application.Current.MainWindow).Handle
'EgtSetMainWindowHandle(hMainWnd)
EgtSetCurrentContext(SceneShowBulding.GetCtx())
' Imposto direttorio ausiliario per import/gestione BTL
Dim sBtlAuxDir As String = String.Empty
GetMainPrivateProfileString(S_IMPORT, K_BTLAUXDIR, "", sBtlAuxDir)
EgtSetBtlAuxDir(sBtlAuxDir)
' inizializzo gestore travi e pareti
EgtInitBeamMgr(EIB_FL.TS3_POS + EIB_FL.USEUATTR)
' inizializzo gestore lavorazioni
EgtInitMachMgr(Map.refMainWindowVM.MainWindowM.sMachinesRoot, Map.refMainWindowVM.MainWindowM.sToolMakersDir)
' Seleziono la macchina impostata nel file ini
Map.refMachinePanelVM.LoadCurrentMachine()
Return
End If
End Sub
#End Region ' Constructor
#Region "METHODS"
Private Sub PreInitializeScene()
' imposto colore di default
Dim DefColor As New Color3d(0, 0, 0)
GetMainPrivateProfileColor(S_GEOMDB, K_DEFAULTCOLOR, DefColor)
SceneShowBulding.SetDefaultMaterial(DefColor)
' imposto colori sfondo
Dim BackTopColor As New Color3d(192, 192, 192)
GetMainPrivateProfileColor(S_SCENE, K_BACKTOP, BackTopColor)
Dim BackBotColor As New Color3d(BackTopColor)
GetMainPrivateProfileColor(S_SCENE, K_BACKBOTTOM, BackBotColor)
SceneShowBulding.SetViewBackground(BackTopColor, BackBotColor)
' imposto colore di evidenziazione
Dim MarkColor As New Color3d(255, 255, 0)
GetMainPrivateProfileColor(S_SCENE, K_MARK, MarkColor)
SceneShowBulding.SetMarkMaterial(MarkColor)
' imposto colore per superfici selezionate
Dim SelSurfColor As New Color3d(255, 255, 192)
GetMainPrivateProfileColor(S_SCENE, K_SELSURF, SelSurfColor)
SceneShowBulding.SetSelSurfMaterial(SelSurfColor)
' imposto tipo e colore del rettangolo di zoom
Dim bOutline As Boolean = True
Dim ZwColor As New Color3d(0, 0, 0)
GetMainPrivateProfileZoomWin(S_SCENE, K_ZOOMWIN, bOutline, ZwColor)
SceneShowBulding.SetZoomWinAttribs(bOutline, ZwColor)
' imposto colore della linea di distanza
Dim DstLnColor As New Color3d(255, 0, 0)
GetMainPrivateProfileColor(S_SCENE, K_DISTLINE, DstLnColor)
SceneShowBulding.SetDistLineMaterial(DstLnColor)
' imposto parametri OpenGL
Dim nDriver As Integer = GetMainPrivateProfileInt(S_OPENGL, K_DRIVER, 3)
Dim b2Buff As Boolean = (GetMainPrivateProfileInt(S_OPENGL, K_DOUBLEBUFFER, 1) <> 0)
Dim nColorBits As Integer = GetMainPrivateProfileInt(S_OPENGL, K_COLORBITS, 32)
Dim nDepthBits As Integer = GetMainPrivateProfileInt(S_OPENGL, K_DEPTHBITS, 32)
SceneShowBulding.SetViewAttributes(nDriver, b2Buff, nColorBits, nDepthBits)
End Sub
Private Sub PostInitializeScene()
' imposto tipo coordinate
SceneShowBulding.SetGridCursorPos(True)
' modo di visualizzazione
Dim nShowMode As Integer = GetMainPrivateProfileInt(S_SCENE, K_SHOWMODE, SM.SHADING)
'Map.refShowPanelVM.SetShowMode(DirectCast(nShowMode, SM))
EgtSetShowMode(DirectCast(nShowMode, SM))
' visualizzazione avanzata dei triangoli costituenti le superfici
Dim bShowTriaAdv As Boolean = (GetMainPrivateProfileInt(S_SCENE, K_SHOWTRIAADV, 1) <> 0)
EgtSetShowTriaAdv(bShowTriaAdv)
' tipo visualizzazione per Zmap
Dim nShowZmap As Integer = GetMainPrivateProfileInt(S_SCENE, K_SHOWZMAP, 1)
EgtSetShowZmap(DirectCast(nShowZmap, ZSM), False)
' dimensione lineare max in pixel delle textures
Dim nTxrMaxLinPix As Integer = GetMainPrivateProfileInt(S_SCENE, K_TEXMAXLINPIX, 4096)
EgtSetTextureMaxLinPixels(nTxrMaxLinPix)
' tipo snap point
SceneShowBulding.SetSnapPointType(SP.PT_SKETCH)
' imposto parametri geometrici griglia
EgtSetGridGeo(100, 1, 10, 100)
End Sub
#End Region ' Methods
End Class
@@ -18,10 +18,10 @@
<Image Source="/Resources/ShowBeamPanel/ShowSolid.png" Stretch="Uniform"/>
</ToggleButton>
<ToggleButton IsChecked="{Binding ShowBuilding_IsChecked}"
IsEnabled="False"
ToolTip="{Binding ShowBuilding_ToolTip}"
Style="{StaticResource ToolBarOnlyProdPage_ToggleButton}">
<Image Source="/Resources/ShowBeamPanel/ShowBuilding.png" Stretch="Uniform"/>
</ToggleButton>
<!--IsEnabled="{Binding ShowBuilding_IsEnabled}"-->
</StackPanel>
@@ -35,7 +35,7 @@ Public Class ShowBeamPanelVM
End Get
Set(value As Boolean)
m_bShowSolid = value
If Not IsNothing(Map.refProjectVM.BTLStructureVM) Then Map.refProjectVM.BTLStructureVM.ShowSolid( GDB_ID.NULL, m_bShowSolid)
If Not IsNothing(Map.refProjectVM.BTLStructureVM) Then Map.refProjectVM.BTLStructureVM.ShowSolid(GDB_ID.NULL, m_bShowSolid)
End Set
End Property
Friend Sub SetShowSolid(bValue As Boolean)
@@ -44,14 +44,22 @@ Public Class ShowBeamPanelVM
NotifyPropertyChanged(NameOf(ShowSolid_IsChecked))
End Sub
Private m_bShowBuilding As Boolean
Private m_bShowBuilding As Boolean = False
Public Property ShowBuilding_IsChecked As Boolean
Get
Return m_bShowBuilding
End Get
Set(value As Boolean)
m_bShowBuilding = value
If Not IsNothing(Map.refProjectVM.BTLStructureVM) Then Map.refProjectVM.BTLStructureVM.ShowBuilding(m_bShowBuilding)
If m_bShowBuilding Then
'Map.refProjectVM.SetSelManagerTab(ProjectVM.StrategyManagerTab.SCENESHOWBULDING)
'EgtSetCurrentContext(MapV.refSceneShowBuldingV.SceneShowBulding.GetCtx())
If Not IsNothing(Map.refProjectVM.BTLStructureVM) Then Map.refProjectVM.BTLStructureVM.ShowBuilding(m_bShowBuilding)
'EgtSetCurrentContext(Map.refSceneHostVM.MainScene.GetCtx())
'Else
' EgtSetCurrentContext(Map.refSceneHostVM.MainScene.GetCtx())
' Map.refProjectVM.SetSelManagerTab(ProjectVM.StrategyManagerTab.RAWPARTMANAGER)
End If
End Set
End Property
Friend Sub SetShowBuilding(bValue As Boolean)
@@ -3,7 +3,6 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:EgtFloating="clr-namespace:EgtWPFLib5.EgtFloating;assembly=EgtWPFLib5"
xmlns:EgtBEAMWALL="clr-namespace:EgtBEAMWALL.Optimizer"
IsEnabled="{Binding ProjManager_IsEnabled}"
Style="{StaticResource OnlyProdPartManager_StackPanel}">
<Border ToolTip="{Binding TotalTime_ToolTip}"
@@ -0,0 +1,25 @@
<ListBox x:Class="ActiveStrategyListBoxV"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:Optmizer="clr-namespace:EgtBEAMWALL.Optimizer"
Name="ActiveStrategyListBox"
ItemsSource="{Binding ActiveStrategyList, Mode=TwoWay}"
SelectedItem="{Binding SelectedActiveStrategy, Mode=TwoWay}"
Width="Auto"
Height="Auto"
IsSynchronizedWithCurrentItem="True"
PreviewMouseDown="ActiveStrategyList_PreviewMouseDown"
Style="{StaticResource NewAddFeature_ListBox}">
<ListBox.Resources>
<DataTemplate DataType="{x:Type Optmizer:Strategy}">
<StackPanel Orientation="Horizontal">
<Image Source="{Binding sImageStrategy}"
Stretch="Uniform"
Width="100"
Height="100"/>
<TextBlock Text="{Binding sStrategyID}"
Style="{StaticResource DialogWindow_TextBlock}"/>
</StackPanel>
</DataTemplate>
</ListBox.Resources>
</ListBox>
@@ -0,0 +1,14 @@
Public Class ActiveStrategyListBoxV
''' <summary>
''' Funzione che permette di riselezionare l'elemento ActiveStrategyList della lista già selezionato
''' </summary>
''' <param name="sender"></param>
''' <param name="e"></param>
Private Sub ActiveStrategyList_PreviewMouseDown(sender As Object, e As MouseButtonEventArgs)
Dim item As Object = ActiveStrategyListBox.SelectedItem
ActiveStrategyListBox.SelectedItem = Nothing
ActiveStrategyListBox.SelectedItem = item
End Sub
End Class
@@ -0,0 +1,25 @@
<ListBox x:Class="DeactivateStrategyListBoxV"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:Optmizer="clr-namespace:EgtBEAMWALL.Optimizer"
Name="DeactivateStrategyListBox"
ItemsSource="{Binding DeactivateStrategyList, Mode=TwoWay}"
SelectedItem="{Binding SelectDeactivateStrategy, Mode=TwoWay}"
Width="Auto"
Height="Auto"
IsSynchronizedWithCurrentItem="True"
PreviewMouseDown="DeactivateStrategyList_PreviewMouseDown"
Style="{StaticResource NewAddFeature_ListBox}">
<ListBox.Resources>
<DataTemplate DataType="{x:Type Optmizer:Strategy}">
<StackPanel Orientation="Horizontal">
<Image Source="{Binding sImageStrategy}"
Stretch="Uniform"
Width="100"
Height="100"/>
<TextBlock Text="{Binding sStrategyID}"
Style="{StaticResource DialogWindow_TextBlock}"/>
</StackPanel>
</DataTemplate>
</ListBox.Resources>
</ListBox>
@@ -0,0 +1,14 @@
Public Class DeactivateStrategyListBoxV
''' <summary>
''' Funzione che permette di riselezionare l'elemento DeactivateStrategyList della lista già selezionato
''' </summary>
''' <param name="sender"></param>
''' <param name="e"></param>
Private Sub DeactivateStrategyList_PreviewMouseDown(sender As Object, e As MouseButtonEventArgs)
Dim item As Object = DeactivateStrategyListBox.SelectedItem
DeactivateStrategyListBox.SelectedItem = Nothing
DeactivateStrategyListBox.SelectedItem = item
End Sub
End Class
@@ -0,0 +1,505 @@
Imports EgtWPFLib5
Imports EgtUILib
Imports Newtonsoft.Json
Imports System.Collections.ObjectModel
Imports System.IO
'----------- Classe che fa riferimento alle Feature del file Json -----------
Public Class JsonAvailableStrategyFeature
Inherits VMBase
#Region "FIELDS & PROPETIES"
Private m_sName As String
Public Property sName As String
Get
Return m_sName
End Get
Set(value As String)
m_sName = value
NotifyPropertyChanged(NameOf(sName))
End Set
End Property
Private m_nPRC As Integer
Public Property nPRC As Integer
Get
Return m_nPRC
End Get
Set(value As Integer)
m_nPRC = value
NotifyPropertyChanged(NameOf(nPRC))
End Set
End Property
Private m_nGRP As Integer
Public Property nGRP As Integer
Get
Return m_nGRP
End Get
Set(value As Integer)
m_nGRP = value
NotifyPropertyChanged(NameOf(nGRP))
End Set
End Property
Private m_TopologyList As New ObservableCollection(Of JsonAvailableTopology)
Public Property TopologyList As ObservableCollection(Of JsonAvailableTopology)
Get
Return m_TopologyList
End Get
Set(value As ObservableCollection(Of JsonAvailableTopology))
m_TopologyList = value
NotifyPropertyChanged(NameOf(TopologyList))
End Set
End Property
#End Region ' Fields & Propeties
#Region "CONSTRUCTOR"
<JsonConstructor>
Sub New(sName As String, nPRC As Integer, nGRP As Integer)
m_sName = sName
m_nPRC = nPRC
m_nGRP = nGRP
End Sub
Sub New(StrategyFeature As StrategyFeature)
m_sName = StrategyFeature.sName
m_nPRC = StrategyFeature.nPRC
m_nGRP = StrategyFeature.nGRP
For Each Topology In StrategyFeature.TopologyList
m_TopologyList.Add(New JsonAvailableTopology(Topology))
Next
End Sub
Friend Function Deserialize() As StrategyFeature
Dim StrategyFeature As New StrategyFeature() With {.sName = m_sName,
.nPRC = m_nPRC,
.nGRP = m_nGRP}
For Each Topology In TopologyList
StrategyFeature.TopologyList.Add(Topology.Deserialize())
Next
Return StrategyFeature
End Function
#End Region ' Constructor
End Class
'----------- Classe che fa riferimento alle Topologie delle Feature del file Json -----------
Public Class JsonAvailableTopology
Inherits VMBase
#Region "FIELDS & PROPETIES"
Private m_sName As String
Public Property sName As String
Get
Return m_sName
End Get
Set(value As String)
m_sName = value
NotifyPropertyChanged(NameOf(sName))
End Set
End Property
Private m_StrategyList As New ObservableCollection(Of JsonAvailableStrategy)
Public Property StrategyList As ObservableCollection(Of JsonAvailableStrategy)
Get
Return m_StrategyList
End Get
Set(value As ObservableCollection(Of JsonAvailableStrategy))
m_StrategyList = value
NotifyPropertyChanged(NameOf(StrategyList))
End Set
End Property
#End Region ' Fields & Propeties
#Region "CONSTRUCTOR"
<JsonConstructor>
Sub New(sName As String)
m_sName = sName
End Sub
Sub New(Topology As Topology)
m_sName = Topology.sName
For Each Strategy In Topology.StrategyList
m_StrategyList.Add(New JsonAvailableStrategy(Strategy))
Next
End Sub
#End Region ' Constructor
Friend Function Deserialize() As Topology
Dim Topology As New Topology() With {.sName = m_sName}
For StrategyIndex = 0 To StrategyList.Count - 1
Topology.StrategyList.Add(StrategyList(StrategyIndex).Deserialize(StrategyIndex))
Next
Topology.CreateStrategyViews()
Return Topology
End Function
End Class
'----------- Classe che fa alle Strategie delle Topologie delle Feature del file Json -----------
Public Class JsonAvailableStrategy
Inherits VMBase
#Region "FIELDS & PROPETIES"
Private m_sStrategyID As String
Public Property sStrategyID As String
Get
Return m_sStrategyID
End Get
Set(value As String)
m_sStrategyID = value
NotifyPropertyChanged(NameOf(sStrategyID))
End Set
End Property
#End Region ' Fields & Propeties
#Region "CONSTRUCTOR"
<JsonConstructor>
Sub New(sStrategyID As String)
m_sStrategyID = sStrategyID
End Sub
Sub New(Strategy As Strategy)
m_sStrategyID = Strategy.sStrategyID
End Sub
#End Region ' Constructor
Friend Function Deserialize(StrategyIndex As Integer) As Strategy
Dim Strategy As New Strategy() With {.sStrategyID = m_sStrategyID,
.nIndexInList = StrategyIndex}
' Recupero file StrategyJson
Dim StrategyPath As String = Map.refMainWindowVM.MainWindowM.GetStandardDirPath() & "\" & sStrategyID & "\" & sStrategyID & ".json"
' Controllo se il file esiste
If Not File.Exists(StrategyPath) Then
EgtOutLog("Error! Strategy file not found! " & m_sStrategyID)
End If
' Leggo il contenuto del file JSON e deserializzo
Dim StrategyJson As String = File.ReadAllText(StrategyPath)
Dim strategyConfig As JsonDefaultStrategy = JsonConvert.DeserializeObject(Of JsonDefaultStrategy)(StrategyJson)
Strategy.sStrategyName = strategyConfig.sStrategyName
Dim sImagePath As String = Map.refMainWindowVM.MainWindowM.GetStandardDirPath() & "\" & sStrategyID & "\" & sStrategyID & ".png"
If File.Exists(sImagePath) Then
Strategy.sStrategyImagePath = sImagePath
End If
If strategyConfig.sStrategyID <> m_sStrategyID Then EgtOutLog("Error! Strategy name wrong in " & m_sStrategyID)
For Each Parameter In strategyConfig.ParameterList
Strategy.ParameterList.Add(Parameter.Deserialize())
Next
Return Strategy
End Function
End Class
'----------- Classe che fa alle Strategie delle Topologie delle Feature del file Json -----------
Public Class JsonDefaultStrategy
Inherits VMBase
#Region "FIELDS & PROPETIES"
Private m_sStrategyID As String
Public Property sStrategyID As String
Get
Return m_sStrategyID
End Get
Set(value As String)
m_sStrategyID = value
End Set
End Property
Private m_sStrategyName As String
Public Property sStrategyName As String
Get
Return m_sStrategyName
End Get
Set(value As String)
m_sStrategyName = value
End Set
End Property
Private m_ParameterList As New ObservableCollection(Of JsonDefaultStrategyParameter)
Public Property ParameterList As ObservableCollection(Of JsonDefaultStrategyParameter)
Get
Return m_ParameterList
End Get
Set(value As ObservableCollection(Of JsonDefaultStrategyParameter))
m_ParameterList = value
End Set
End Property
#End Region ' Fields & Propeties
#Region "CONSTRUCTOR"
<JsonConstructor>
Sub New(sStrategyID As String, sStrategyName As String)
m_sStrategyID = sStrategyID
m_sStrategyName = sStrategyName
End Sub
Sub New(Strategy As Strategy)
m_sStrategyID = Strategy.sStrategyID
For Each Parameter In Strategy.ParameterList
m_ParameterList.Add(New JsonDefaultStrategyParameter(Parameter))
Next
End Sub
#End Region ' Constructor
End Class
'----------- Classe che fa riferimento ai parametri delle Strategie nel file Json -----------
Public Class JsonDefaultStrategyParameter
Inherits VMBase
#Region "FIELDS & PROPETIES"
Private m_sName As String
Public Property sName As String
Get
Return m_sName
End Get
Set(value As String)
m_sName = value
NotifyPropertyChanged(NameOf(sName))
End Set
End Property
Private m_sNameNge As String
Public Property sNameNge As String
Get
Return m_sNameNge
End Get
Set(value As String)
m_sNameNge = value
NotifyPropertyChanged(NameOf(sNameNge))
End Set
End Property
Private m_sValue As String
Public Property sValue As String
Get
Return m_sValue
End Get
Set(value As String)
m_sValue = value
NotifyPropertyChanged(NameOf(sValue))
End Set
End Property
Private m_sDescriptionShort As String
Public Property sDescriptionShort As String
Get
Return m_sDescriptionShort
End Get
Set(value As String)
m_sDescriptionShort = value
NotifyPropertyChanged(NameOf(sDescriptionShort))
End Set
End Property
Private m_sDescriptionLong As String
Public Property sDescriptionLong As String
Get
Return m_sDescriptionLong
End Get
Set(value As String)
m_sDescriptionLong = value
NotifyPropertyChanged(NameOf(sDescriptionLong))
End Set
End Property
Private m_sType As String
Public Property sType As String
Get
Return m_sType
End Get
Set(value As String)
m_sType = value
NotifyPropertyChanged(NameOf(sType))
End Set
End Property
Private m_sMessageId As String
Public Property sMessageId As String
Get
Return m_sMessageId
End Get
Set(value As String)
m_sMessageId = value
NotifyPropertyChanged(NameOf(sMessageId))
End Set
End Property
Private m_sMinUserLevel As Integer
Public Property sMinUserLevel As Integer
Get
Return m_sMinUserLevel
End Get
Set(value As Integer)
m_sMinUserLevel = value
NotifyPropertyChanged(NameOf(sMinUserLevel))
End Set
End Property
Private m_Choices As New ObservableCollection(Of JsonDefaultComboParameter)
Public Property Choices As ObservableCollection(Of JsonDefaultComboParameter)
Get
Return m_Choices
End Get
Set(value As ObservableCollection(Of JsonDefaultComboParameter))
m_Choices = value
NotifyPropertyChanged(NameOf(Choices))
End Set
End Property
#End Region ' Fields & Propeties
#Region "CONSTRUCTOR"
<JsonConstructor>
Sub New(sName As String, sNameNge As String, sValue As String, sDescriptionShort As String, sDescriptionLong As String, sType As String, sMessageId As String, sMinUserLevel As Integer)
m_sName = sName
m_sNameNge = sNameNge
m_sValue = sValue
m_sDescriptionShort = sDescriptionShort
m_sDescriptionLong = sDescriptionLong
m_sType = sType
m_sMessageId = sMessageId
m_sMinUserLevel = sMinUserLevel
End Sub
Sub New(StrategyParameter As StrategyParameter)
m_sName = StrategyParameter.sName
m_sNameNge = StrategyParameter.sNameNge
Select Case StrategyParameter.GetType()
Case GetType(BooleanStrategyParameter)
m_sValue = If(DirectCast(StrategyParameter, BooleanStrategyParameter).bValue, "true", "false")
Case GetType(DoubleStrategyParameter)
m_sValue = DirectCast(StrategyParameter, DoubleStrategyParameter).sValue
Case GetType(ComboStrategyParameter)
m_sValue = DirectCast(StrategyParameter, ComboStrategyParameter).SelValue.sValue
End Select
m_sDescriptionShort = StrategyParameter.sDescriptionShort
m_sDescriptionLong = StrategyParameter.sDescriptionLong
m_sMessageId = StrategyParameter.sMessageId
m_sMinUserLevel = StrategyParameter.sMinUserLevel
End Sub
#End Region ' Constructor
Friend Function Deserialize() As StrategyParameter
Dim StrategyParameter As StrategyParameter = Nothing
Select Case m_sType
Case "b"
StrategyParameter = New BooleanStrategyParameter()
DirectCast(StrategyParameter, BooleanStrategyParameter).SetValue(m_sValue)
Case "d"
StrategyParameter = New DoubleStrategyParameter()
DirectCast(StrategyParameter, DoubleStrategyParameter).SetValue(m_sValue)
Case "combo"
StrategyParameter = New ComboStrategyParameter()
For Each Choice In Choices
DirectCast(StrategyParameter, ComboStrategyParameter).ComboList.Add(Choice.Deserialize())
Next
DirectCast(StrategyParameter, ComboStrategyParameter).SetSelValue(m_sValue)
End Select
StrategyParameter.sName = m_sName
StrategyParameter.sNameNge = m_sNameNge
StrategyParameter.sDescriptionShort = m_sDescriptionShort
StrategyParameter.sDescriptionLong = m_sDescriptionLong
StrategyParameter.sMessageId = m_sMessageId
StrategyParameter.sMinUserLevel = m_sMinUserLevel
Return StrategyParameter
End Function
End Class
'----------- Classe che fa riferimento ai parametri delle Scelte nel file Json -----------
Public Class JsonDefaultComboParameter
Inherits VMBase
Private m_sValue As String
Public Property sValue As String
Get
Return m_sValue
End Get
Set(value As String)
m_sValue = value
NotifyPropertyChanged(NameOf(sValue))
End Set
End Property
Private m_sDescriptionShort As String
Public Property sDescriptionShort As String
Get
Return m_sDescriptionShort
End Get
Set(value As String)
m_sDescriptionShort = value
NotifyPropertyChanged(NameOf(sDescriptionShort))
End Set
End Property
Private m_sDescriptionLong As String
Public Property sDescriptionLong As String
Get
Return m_sDescriptionLong
End Get
Set(value As String)
m_sDescriptionLong = value
NotifyPropertyChanged(NameOf(sDescriptionLong))
End Set
End Property
Private m_sMessageId As String
Public Property sMessageId As String
Get
Return m_sMessageId
End Get
Set(value As String)
m_sMessageId = value
NotifyPropertyChanged(NameOf(sMessageId))
End Set
End Property
#Region "CONSTRUCTOR"
<JsonConstructor>
Sub New(sValue As String, sDescriptionShort As String, sDescriptionLong As String, sMessageId As String)
m_sValue = sValue
m_sDescriptionShort = sDescriptionShort
m_sDescriptionLong = sDescriptionLong
m_sMessageId = sMessageId
End Sub
Sub New(ComboParameter As ComboParameter)
m_sValue = ComboParameter.sValue
m_sDescriptionShort = ComboParameter.sDescriptionShort
m_sDescriptionLong = ComboParameter.sDescriptionLong
m_sMessageId = ComboParameter.sMessageId
End Sub
#End Region ' Constructor
Friend Function Deserialize() As ComboParameter
Dim ComboParameter As New ComboParameter() With {.sValue = m_sValue,
.sDescriptionShort = m_sDescriptionShort,
.sDescriptionLong = m_sDescriptionLong,
.sMessageId = m_sMessageId}
Return ComboParameter
End Function
End Class
@@ -0,0 +1,276 @@
Imports Newtonsoft.Json
'----------- Classe che fa riferimento alle Feature del file Json -----------
Imports EgtWPFLib5
Imports System.Collections.ObjectModel
Public Class JsonStrategyFeature
Inherits VMBase
#Region "FIELDS & PROPETIES"
Private m_sName As String
Public Property sName As String
Get
Return m_sName
End Get
Set(value As String)
m_sName = value
NotifyPropertyChanged(NameOf(sName))
End Set
End Property
Private m_nPRC As Integer
Public Property nPRC As Integer
Get
Return m_nPRC
End Get
Set(value As Integer)
m_nPRC = value
NotifyPropertyChanged(NameOf(nPRC))
End Set
End Property
Private m_nGRP As Integer
Public Property nGRP As Integer
Get
Return m_nGRP
End Get
Set(value As Integer)
m_nGRP = value
NotifyPropertyChanged(NameOf(nGRP))
End Set
End Property
Private m_TopologyList As New ObservableCollection(Of JsonTopology)
Public Property TopologyList As ObservableCollection(Of JsonTopology)
Get
Return m_TopologyList
End Get
Set(value As ObservableCollection(Of JsonTopology))
m_TopologyList = value
NotifyPropertyChanged(NameOf(TopologyList))
End Set
End Property
#End Region ' Fields & Propeties
#Region "CONSTRUCTOR"
<JsonConstructor>
Sub New(sName As String, nPRC As Integer, nGRP As Integer)
m_sName = sName
m_nPRC = nPRC
m_nGRP = nGRP
End Sub
Sub New(StrategyFeature As StrategyFeature)
m_sName = StrategyFeature.sName
m_nPRC = StrategyFeature.nPRC
m_nGRP = StrategyFeature.nGRP
For Each Topology In StrategyFeature.TopologyList
m_TopologyList.Add(New JsonTopology(Topology))
Next
End Sub
#End Region ' Constructor
End Class
'----------- Classe che fa riferimento alle Topologie delle Feature del file Json -----------
Public Class JsonTopology
Inherits VMBase
#Region "FIELDS & PROPETIES"
Private m_sName As String
Public Property sName As String
Get
Return m_sName
End Get
Set(value As String)
m_sName = value
NotifyPropertyChanged(NameOf(sName))
End Set
End Property
Private m_StrategyList As New ObservableCollection(Of JsonStrategy)
Public Property StrategyList As ObservableCollection(Of JsonStrategy)
Get
Return m_StrategyList
End Get
Set(value As ObservableCollection(Of JsonStrategy))
m_StrategyList = value
NotifyPropertyChanged(NameOf(StrategyList))
End Set
End Property
#End Region ' Fields & Propeties
#Region "CONSTRUCTOR"
<JsonConstructor>
Sub New(sName As String)
m_sName = sName
End Sub
Sub New(Topology As Topology)
m_sName = Topology.sName
For Each Strategy In Topology.StrategyList
m_StrategyList.Add(New JsonStrategy(Strategy))
Next
End Sub
#End Region ' Constructor
End Class
'----------- Classe che fa alle Strategie delle Topologie delle Feature del file Json -----------
Public Class JsonStrategy
Inherits VMBase
#Region "FIELDS & PROPETIES"
Private m_sStrategyID As String
Public Property sStrategyID As String
Get
Return m_sStrategyID
End Get
Set(value As String)
m_sStrategyID = value
NotifyPropertyChanged(NameOf(sStrategyID))
End Set
End Property
Private m_nIndexInList As Integer = -1
Public Property nIndexInList As Integer
Get
Return m_nIndexInList
End Get
Set(value As Integer)
m_nIndexInList = value
NotifyPropertyChanged(NameOf(nIndexInList))
End Set
End Property
Private m_ParameterList As New ObservableCollection(Of JsonStrategyParameter)
Public Property ParameterList As ObservableCollection(Of JsonStrategyParameter)
Get
Return m_ParameterList
End Get
Set(value As ObservableCollection(Of JsonStrategyParameter))
m_ParameterList = value
NotifyPropertyChanged(NameOf(ParameterList))
End Set
End Property
#End Region ' Fields & Propeties
#Region "CONSTRUCTOR"
<JsonConstructor>
Sub New(sStrategyID As String, nIndexInList As Integer)
m_sStrategyID = sStrategyID
m_nIndexInList = nIndexInList
End Sub
Sub New(Strategy As Strategy)
m_sStrategyID = Strategy.sStrategyID
m_nIndexInList = Strategy.nIndexInList
For Each Parameter In Strategy.ParameterList
m_ParameterList.Add(New JsonStrategyParameter(Parameter))
Next
End Sub
'Friend Function Deserialize(StrategyIndex As Integer) As Strategy
' Dim Strategy As New Strategy() With {.sStrategyID = m_sStrategyID,
' .nIndexInList = StrategyIndex}
' ' Recupero file StrategyJson
' For Each Parameter In ParameterList
' Strategy.ParameterList.Add(Parameter.Deserialize())
' Next
' Return Strategy
'End Function
#End Region ' Constructor
End Class
'----------- Classe che fa riferimento ai parametri delle Strategie nel file Json -----------
Public Class JsonStrategyParameter
Inherits VMBase
#Region "FIELDS & PROPETIES"
Private m_sName As String
Public Property sName As String
Get
Return m_sName
End Get
Set(value As String)
m_sName = value
NotifyPropertyChanged(NameOf(sName))
End Set
End Property
Private m_sNameNge As String
Public Property sNameNge As String
Get
Return m_sNameNge
End Get
Set(value As String)
m_sNameNge = value
NotifyPropertyChanged(NameOf(sNameNge))
End Set
End Property
Private m_sValue As String
Public Property sValue As String
Get
Return m_sValue
End Get
Set(value As String)
m_sValue = value
NotifyPropertyChanged(NameOf(sValue))
End Set
End Property
Private m_sType As String
Public Property sType As String
Get
Return m_sType
End Get
Set(value As String)
m_sType = value
NotifyPropertyChanged(NameOf(sType))
End Set
End Property
#End Region ' Fields & Propeties
#Region "CONSTRUCTOR"
<JsonConstructor>
Sub New(sName As String, sNameNge As String, sValue As String, sType As String)
m_sName = sName
m_sNameNge = sNameNge
m_sValue = sValue
m_sType = sType
End Sub
Sub New(StrategyParameter As StrategyParameter)
m_sName = StrategyParameter.sName
m_sNameNge = StrategyParameter.sNameNge
Select Case StrategyParameter.GetType()
Case GetType(BooleanStrategyParameter)
m_sValue = If(DirectCast(StrategyParameter, BooleanStrategyParameter).bValue, "true", "false")
Case GetType(DoubleStrategyParameter)
m_sValue = DirectCast(StrategyParameter, DoubleStrategyParameter).sValue
Case GetType(ComboStrategyParameter)
m_sValue = DirectCast(StrategyParameter, ComboStrategyParameter).SelValue.sValue
End Select
End Sub
#End Region ' Constructor
End Class
@@ -0,0 +1,55 @@
<ScrollViewer x:Class="ParameterStrategyV"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:Optmizer="clr-namespace:EgtBEAMWALL.Optimizer"
VerticalScrollBarVisibility="Visible"
Margin="5,10,0,0"
Style="{StaticResource OnlyProd_ScrollViewer}">
<ItemsControl ItemsSource="{Binding Tag.ParameterList,
RelativeSource={RelativeSource AncestorType={x:Type ScrollViewer}}}"
Foreground="Black">
<ItemsControl.Resources>
<DataTemplate DataType="{x:Type Optmizer:BooleanStrategyParameter}">
<UniformGrid Columns="2"
Margin="5,2,5,0">
<TextBlock Text="{Binding sDescriptionShort}"
HorizontalAlignment="Left"
Style="{StaticResource DialogWindow_TextBlock}"/>
<CheckBox IsChecked="{Binding bValue, UpdateSourceTrigger=PropertyChanged}"
Style="{StaticResource OnlyProdFeatureInPartInRawPartList_CheckBox}"/>
</UniformGrid>
</DataTemplate>
<DataTemplate DataType="{x:Type Optmizer:DoubleStrategyParameter}">
<UniformGrid Columns="2"
Margin="5,2,5,0">
<TextBlock Text="{Binding sDescriptionShort}"
HorizontalAlignment="Left"
Style="{StaticResource DialogWindow_TextBlock}"/>
<TextBox Text="{Binding sValue}"
Style="{StaticResource ColorPicker_TextBox}"/>
</UniformGrid>
</DataTemplate>
<DataTemplate DataType="{x:Type Optmizer:ComboStrategyParameter}">
<UniformGrid Columns="2"
Margin="5,2,5,0">
<TextBlock Text="{Binding sDescriptionShort}"
HorizontalAlignment="Left"
Style="{StaticResource DialogWindow_TextBlock}"/>
<ComboBox ItemsSource="{Binding ComboList}"
SelectedItem="{Binding SelValue}"
DisplayMemberPath="sValue"
Margin="0"
Foreground="Black"
Style="{StaticResource OnlyProdCalcPanel_ComboBox}">
<!--<ComboBox.Resources>
<DataTemplate DataType="{x:Type Optmizer:ComboParameter}">
<TextBlock Text="{Binding sValue}"
Style="{StaticResource DialogWindow_TextBlock}"/>
</DataTemplate>
</ComboBox.Resources>-->
</ComboBox>
</UniformGrid>
</DataTemplate>
</ItemsControl.Resources>
</ItemsControl>
</ScrollViewer>
@@ -0,0 +1,3 @@
Public Class ParameterStrategyV
End Class
@@ -0,0 +1,102 @@
<Grid x:Class="StrategyManagerV"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:Optimizer="clr-namespace:EgtBEAMWALL.Optimizer">
<Grid.Resources>
<Optimizer:StrategyTypeToFocusableConverter x:Key="StrategyTypeToFocusableConverter"/>
</Grid.Resources>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
<StackPanel Orientation="Horizontal"
HorizontalAlignment="Center"
Margin="0,0,0,5">
<ComboBox ItemsSource="{Binding StrategySetupList}"
SelectedItem="{Binding SelStrategySetup}"
DisplayMemberPath="sName"
Style="{StaticResource Strategy_ComboBox}"/>
<Button Command="{Binding New_Command}"
ToolTip="{Binding NewToolTip}"
Margin="10,0,10,0"
Style="{StaticResource SaveOptionPanel_Button}">
<Image Source="/Resources/ProjectManager/New.png" Stretch="Uniform"/>
</Button>
<Button Command="{Binding OpenFileNameCustomConfigCommand}"
ToolTip="{Binding SaveAsToolTip}"
Margin="10,0,10,0"
Style="{StaticResource SaveOptionPanel_Button}">
<Image Source="/Resources/NewPage/+.png" Stretch="Uniform"/>
</Button>
<Button Command="{Binding SaveCommand}"
ToolTip="{Binding SaveToolTip}"
Style="{StaticResource SaveOptionPanel_Button}">
<Image Source="{Binding SaveImage}" Stretch="Uniform"/>
</Button>
</StackPanel>
<Grid Grid.Row="1">
<Grid.RowDefinitions>
<RowDefinition Height="1*"/>
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<TreeView Grid.RowSpan="2"
Width="300"
Height="Auto"
ItemsSource="{Binding SelStrategySetup.StrategyFeatureList}">
<TreeView.Resources>
<HierarchicalDataTemplate DataType="{x:Type Optimizer:StrategyFeature}"
ItemsSource="{Binding TopologyList}">
<CheckBox IsChecked="{Binding RelativeSource={RelativeSource AncestorType=TreeViewItem}, Path=IsExpanded}">
<CheckBox.Template>
<ControlTemplate>
<Border Background="{Binding Background, RelativeSource={RelativeSource AncestorType={x:Type TreeView}}}">
<StackPanel Style="{StaticResource OnlyProdPartManager_StackPanel}">
<TextBlock Text="{Binding sName}" Style="{StaticResource DialogWindow_TextBlock}"/>
<TextBlock Text="{Binding nGRP}" Style="{StaticResource DialogWindow_TextBlock}" Margin="5,0,0,0"/>
<TextBlock Text="{Binding nPRC}" Style="{StaticResource DialogWindow_TextBlock}" Margin="0,0,5,0"/>
</StackPanel>
</Border>
</ControlTemplate>
</CheckBox.Template>
</CheckBox>
</HierarchicalDataTemplate>
<DataTemplate DataType="{x:Type Optimizer:Topology}">
<TextBlock Text="{Binding sName}" Style="{StaticResource DialogWindow_TextBlock}"/>
</DataTemplate>
</TreeView.Resources>
<TreeView.ItemContainerStyle>
<Style TargetType="{x:Type TreeViewItem}">
<Setter Property="IsSelected" Value="{Binding IsSelected, Mode=TwoWay}"/>
<Setter Property="IsExpanded" Value="{Binding IsExpanded, Mode=TwoWay}"/>
<Setter Property="Focusable" Value="{Binding RelativeSource={RelativeSource Self}, Converter={StaticResource StrategyTypeToFocusableConverter}}"/>
</Style>
</TreeView.ItemContainerStyle>
</TreeView>
<Optimizer:StrategyV Grid.Column="1"
Grid.RowSpan="2"/>
<GroupBox Grid.Column="2"
Foreground="Black"
BorderThickness="2"
Margin="0,-11,0,0"
BorderBrush="{StaticResource BeamWall_Glacier}">
<GroupBox.Header>
<TextBlock Text="{Binding SelTreeItem.SelParamStrategy.sStrategyID}"
FontWeight="Bold"
Style="{StaticResource DialogWindow_TextBlock}"/>
</GroupBox.Header>
<Optimizer:ParameterStrategyV Tag="{Binding SelTreeItem.SelParamStrategy}"/>
</GroupBox>
<StackPanel Grid.Row="1"
Grid.Column="2"
Width="600"/>
</Grid>
</Grid>
@@ -0,0 +1,3 @@
Public Class StrategyManagerV
End Class
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,22 @@
<ListBox x:Class="StrategyProductionListV"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:Optmizer="clr-namespace:EgtBEAMWALL.Optimizer"
ItemsSource="{Binding StrategyProductionList}"
SelectedItem="{Binding SelectedStrategyParamList}"
Width="Auto"
Height="Auto"
Style="{StaticResource NewAddFeature_ListBox}">
<ListBox.Resources>
<DataTemplate DataType="{x:Type Optmizer:Strategy}">
<StackPanel Orientation="Horizontal">
<Image Source="{Binding sImageStrategy}"
Stretch="Uniform"
Width="75"
Height="75"/>
<TextBlock Text="{Binding sStrategyID}"
Style="{StaticResource DialogWindow_TextBlock}"/>
</StackPanel>
</DataTemplate>
</ListBox.Resources>
</ListBox>
@@ -0,0 +1,3 @@
Public Class StrategyProductionListV
End Class
@@ -0,0 +1,85 @@
<GroupBox x:Class="StrategyProductionV"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:Optmizer="clr-namespace:EgtBEAMWALL.Optimizer"
Foreground="Black"
BorderThickness="1"
BorderBrush="{StaticResource BeamWall_Glacier}">
<GroupBox.Header>
<TextBlock Text="{Binding StrategyProductionPath, UpdateSourceTrigger=PropertyChanged}"
FontWeight="Bold"
Style="{StaticResource DialogWindow_TextBlock}"/>
</GroupBox.Header>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="1*"/>
<!--<RowDefinition Height="1*"/>-->
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<Border Margin="2,0,2,0"
Style="{StaticResource OnlyProdPage_Border}">
<ListBox ItemsSource="{Binding SelTreeItem.AvailableStrategyList}"
SelectedItem="{Binding SelTreeItem.SelAvailableStrategy}"
Width="Auto"
Height="Auto"
IsSynchronizedWithCurrentItem="False"
Style="{StaticResource NewAddFeature_ListBox}">
<ListBox.Resources>
<DataTemplate DataType="{x:Type Optmizer:Strategy}">
<StackPanel Orientation="Horizontal">
<Image Source="{Binding sImageStrategy}"
Stretch="Uniform"
Width="100"
Height="100"/>
<TextBlock Text="{Binding sStrategyID}"
Style="{StaticResource DialogWindow_TextBlock}"/>
</StackPanel>
</DataTemplate>
</ListBox.Resources>
<ListBox.ItemContainerStyle>
<Style TargetType="ListBoxItem">
<!--<EventSetter Event="PreviewMouseDown" Handler="AvailableStrategyList_PreviewMouseDown"/>-->
</Style>
</ListBox.ItemContainerStyle>
</ListBox>
</Border>
<GroupBox Grid.Column="1"
Foreground="Black"
BorderThickness="2"
Margin="0,-10,0,0"
BorderBrush="{StaticResource BeamWall_Glacier}">
<GroupBox.Header>
<TextBlock Text="{Binding SelectedStrategyParamList.sStrategyID}"
FontWeight="Bold"
Style="{StaticResource DialogWindow_TextBlock}"/>
</GroupBox.Header>
<Optmizer:ParameterStrategyV/>
</GroupBox>
<!--<StackPanel Grid.Row="1"
Grid.Column="2"/>-->
<StackPanel Grid.Row="2"
Grid.ColumnSpan="2"
HorizontalAlignment="Right"
Style="{StaticResource OnlyProdPartManager_StackPanel}">
<Button Command="{Binding Ok_Command}"
ToolTip="{Binding Ok_Msg}"
Style="{StaticResource ToolBarViewPanel_Button}">
<Image Source="/Resources/NewPage/Ok.png" Stretch="Uniform"/>
</Button>
<Button Command="{Binding Cancel_Command}"
ToolTip="{Binding Cancel_Msg}"
Style="{StaticResource ToolBarViewPanel_Button}">
<Image Source="/Resources/PDFEditor/Delete.png" Stretch="Uniform"/>
</Button>
</StackPanel>
</Grid>
</GroupBox>
@@ -0,0 +1,10 @@
Public Class StrategyProductionV
Sub New()
' La chiamata è richiesta dalla finestra di progettazione.
InitializeComponent()
' Aggiungere le eventuali istruzioni di inizializzazione dopo la chiamata a InitializeComponent().
MapV.SetRefStrategyProductionV(Me)
End Sub
End Class
@@ -0,0 +1,95 @@
<Grid x:Class="StrategyV"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Width="800"
xmlns:Optmizer="clr-namespace:EgtBEAMWALL.Optimizer">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<Border Margin="2,0,2,0"
Style="{StaticResource OnlyProdPage_Border}">
<ListBox ItemsSource="{Binding SelTreeItem.AvailableStrategyList_View}"
SelectedItem="{Binding SelTreeItem.SelAvailableStrategy}"
Width="Auto"
Height="Auto"
IsSynchronizedWithCurrentItem="False"
Style="{StaticResource NewAddFeature_ListBox}">
<ListBox.Resources>
<DataTemplate DataType="{x:Type Optmizer:Strategy}">
<StackPanel Orientation="Horizontal">
<Image Source="{Binding sStrategyImagePath}"
Stretch="Uniform"
Width="100"
Height="100"
/>
<TextBlock Text="{Binding sStrategyName}"
Style="{StaticResource DialogWindow_TextBlock}"/>
</StackPanel>
</DataTemplate>
</ListBox.Resources>
<ListBox.ItemContainerStyle>
<Style TargetType="ListBoxItem">
<EventSetter Event="PreviewMouseDown" Handler="AvailableStrategyList_PreviewMouseDown"/>
</Style>
</ListBox.ItemContainerStyle>
</ListBox>
</Border>
<StackPanel Grid.Column="1"
Orientation="Vertical"
VerticalAlignment="Center">
<Button Content="→"
Command="{Binding AddSelectedStrategyCommand}"
Style="{StaticResource Strategy_Button}"/>
<Button Content="←"
Command="{Binding RemoveSelectedStrategyCommand}"
Style="{StaticResource Strategy_Button}"/>
</StackPanel>
<Border Grid.Column="2"
Margin="2,0,2,0"
Style="{StaticResource OnlyProdPage_Border}">
<ListBox ItemsSource="{Binding SelTreeItem.ActiveStrategyList_View}"
SelectedItem="{Binding SelTreeItem.SelActiveStrategy}"
Width="Auto"
Height="Auto"
IsSynchronizedWithCurrentItem="False"
Style="{StaticResource NewAddFeature_ListBox}">
<ListBox.Resources>
<DataTemplate DataType="{x:Type Optmizer:Strategy}">
<StackPanel Orientation="Horizontal">
<Image Source="{Binding sStrategyImagePath}"
Stretch="Uniform"
Width="100"
Height="100"/>
<TextBlock Text="{Binding sStrategyName}"
Style="{StaticResource DialogWindow_TextBlock}"/>
</StackPanel>
</DataTemplate>
</ListBox.Resources>
<ListBox.ItemContainerStyle>
<Style TargetType="ListBoxItem">
<EventSetter Event="PreviewMouseDown" Handler="ActiveStrategyList_PreviewMouseDown"/>
</Style>
</ListBox.ItemContainerStyle>
</ListBox>
</Border>
<StackPanel Grid.Column="3"
Orientation="Vertical"
VerticalAlignment="Center">
<Button Command="{Binding MoveUpSelectedStrategyCommand}"
Style="{StaticResource Strategy_Button}">
<Image Source="/Resources/TopPanel/MoveUpPart.png" Stretch="Uniform"/>
</Button>
<Button Command="{Binding MoveDownSelectedStrategyCommand}"
Style="{StaticResource Strategy_Button}">
<Image Source="/Resources/TopPanel/MoveDownPart.png" Stretch="Uniform"/>
</Button>
</StackPanel>
</Grid>
@@ -0,0 +1,24 @@
Public Class StrategyV
''' <summary>
''' Funzione che permette di riselezionare l'elemento ActiveStrategyList della lista già selezionato
''' </summary>
''' <param name="sender"></param>
''' <param name="e"></param>
Private Sub AvailableStrategyList_PreviewMouseDown(sender As Object, e As MouseButtonEventArgs)
If TypeOf sender IsNot ListBoxItem Then Return
Dim Item As ListBoxItem = DirectCast(sender, ListBoxItem)
If Not IsNothing(Item) AndAlso Item.IsSelected Then
Map.refStrategyManagerVM.SelTreeItem.SelAvailableStrategy = Map.refStrategyManagerVM.SelTreeItem.SelAvailableStrategy
End If
End Sub
Private Sub ActiveStrategyList_PreviewMouseDown(sender As Object, e As MouseButtonEventArgs)
If TypeOf sender IsNot ListBoxItem Then Return
Dim Item As ListBoxItem = DirectCast(sender, ListBoxItem)
If Not IsNothing(Item) AndAlso Item.IsSelected Then
Map.refStrategyManagerVM.SelTreeItem.SelActiveStrategy = Map.refStrategyManagerVM.SelTreeItem.SelActiveStrategy
End If
End Sub
End Class
+181 -12
View File
@@ -51,6 +51,9 @@
<EgtBEAMWALL:FeatureListManagerVM x:Key="FeatureListManagerVM"/>
<EgtBEAMWALL:RawPartManagerVM x:Key="RawPartManagerVM"/>
<EgtBEAMWALL:SpecialPanelVM x:Key="SpecialPanelVM"/>
<EgtBEAMWALL:StrategyManagerVM x:Key="StrategyManagerVM"/>
<EgtBEAMWALL:ForcedStrategyPanelVM x:Key="ForcedStrategyPanelVM"/>
<EgtBEAMWALL:ForcedStrategyBTLVM x:Key="ForcedStrategyBTLVM"/>
<!--#endregion Panel ViewModel-->
@@ -80,8 +83,12 @@
<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}" />-->
<!--#D7E7F4-->
<Color x:Key="BeamWall_LinkWater_Color" R="215" G="231" B="244" A="255"/>
<SolidColorBrush x:Key="BeamWall_LinkWater" Color="{StaticResource BeamWall_LinkWater_Color}" />
<!--#A5C5E1-->
@@ -252,7 +259,7 @@
<!--#FF707070-->
<SolidColorBrush x:Key="Button.Static.Border" Color="{StaticResource BeamWall_Glacier_Color}"/>
<!--#FF000000-->
<SolidColorBrush x:Key="Button.Static.Foreground" Color="{StaticResource BeamWall_White_Color}"/>
<SolidColorBrush x:Key="Button.Static.Foreground" Color="{StaticResource BeamWall_Corduroy_Color}"/>
<!--#FFBEE6FD-->
<SolidColorBrush x:Key="Button.MouseOver.Background" Color="{StaticResource BeamWall_RegentStBlue_Color}"/>
<!--#FF3C7FB1-->
@@ -541,7 +548,7 @@
<Setter Property="TextAlignment" Value="Center"/>
<Setter Property="FontWeight" Value="Bold"/>
<Setter Property="FontSize" Value="12"/>
<Setter Property="Margin" Value="2,-6,-2,-3"/>
<Setter Property="Margin" Value="2,-6,1,-3"/>
</Style>
<Style x:Key="PasswordMsg_TextBlock" TargetType="{x:Type TextBlock}" BasedOn="{StaticResource {x:Type TextBlock}}">
@@ -554,7 +561,7 @@
<Setter Property="TextAlignment" Value="Center"/>
<Setter Property="FontWeight" Value="Bold"/>
<Setter Property="FontSize" Value="12"/>
<Setter Property="Margin" Value="0,-6,0,-2"/>
<Setter Property="Margin" Value="-2,-6,0,-2"/>
</Style>
<Style x:Key="OnlyProdRawPartList_TextBlock" TargetType="{x:Type TextBlock}" BasedOn="{StaticResource {x:Type TextBlock}}">
@@ -1009,7 +1016,7 @@
<!--#FF606060-->
<SolidColorBrush x:Key="ComboBox.Static.Glyph" Color="{StaticResource BeamWall_White_Color}"/>
<!--#FF000000-->
<SolidColorBrush x:Key="ComboBox.Static.Foreground" Color="{StaticResource BeamWall_White_Color}"/>
<SolidColorBrush x:Key="ComboBox.Static.Foreground" Color="{StaticResource BeamWall_Corduroy_Color}"/>
<SolidColorBrush x:Key="ComboBox.Static.Editable.Background" Color="#FFFFFFFF"/>
<SolidColorBrush x:Key="ComboBox.Static.Editable.Border" Color="#FFABADB3"/>
<SolidColorBrush x:Key="ComboBox.Static.Editable.Button.Background" Color="Transparent"/>
@@ -1294,6 +1301,12 @@
<Setter Property="CanUserAddRows" Value="False"/>
<Setter Property="CanUserResizeRows" Value="False"/>
<Setter Property="AutoGenerateColumns" Value="False"/>
<Setter Property="VirtualizingPanel.IsVirtualizing" Value="True"/>
<Setter Property="VirtualizingPanel.VirtualizationMode" Value="Recycling"/>
<Setter Property="EnableColumnVirtualization" Value="True"/>
<Setter Property="EnableRowVirtualization" Value="True"/>
<Setter Property="VirtualizingStackPanel.ScrollUnit" Value="Pixel"/>
<Setter Property="RowHeight" Value="24"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type DataGrid}">
@@ -2513,7 +2526,7 @@
<Style x:Key="ToolBarOnlyProdManagerNew_Button" TargetType="{x:Type Button}" BasedOn="{StaticResource OnlyProd_Button}">
<Setter Property="Height" Value="30"/>
<Setter Property="Width" Value="30"/>
<Setter Property="Width" Value="35"/>
</Style>
<Style x:Key="ToolBarOnlyProdManagerGoToSupervisor_Button" TargetType="{x:Type Button}" BasedOn="{StaticResource OnlyProd_Button}">
@@ -2638,6 +2651,12 @@
<Setter Property="Margin" Value="2.5,2.5,2.5,2.5"/>
</Style>
<Style x:Key="RawPart_Button" TargetType="{x:Type Button}" BasedOn="{StaticResource OnlyProd_Button}">
<Setter Property="Height" Value="18"/>
<Setter Property="Width" Value="25"/>
<Setter Property="Margin" Value="2.5,2.5,2.5,2.5"/>
</Style>
<Style x:Key="OnlyProdPDFPanel_Button" TargetType="{x:Type Button}" BasedOn="{StaticResource OnlyProd_Button}">
<Setter Property="Height" Value="40"/>
<Setter Property="Width" Value="120"/>
@@ -2674,6 +2693,28 @@
</Setter>
</Style>
<Style x:Key="Strategy_Button" TargetType="{x:Type Button}" BasedOn="{StaticResource OnlyProd_Button}">
<Setter Property="Height" Value="40"/>
<Setter Property="Width" Value="50"/>
<Setter Property="Margin" Value="5"/>
<Setter Property="FontSize" Value="20"/>
</Style>
<Style x:Key="SaveStrategy_Button" TargetType="{x:Type Button}" BasedOn="{StaticResource OnlyProd_Button}">
<Setter Property="Height" Value="40"/>
<Setter Property="Width" Value="40"/>
<Setter Property="Margin" Value="5,0,0,0"/>
<Setter Property="VerticalAlignment" Value="Center"/>
<Setter Property="HorizontalAlignment" Value="Center"/>
</Style>
<Style x:Key="BTLPanel_Button" TargetType="{x:Type Button}" BasedOn="{StaticResource OnlyProd_Button}">
<!--<Setter Property="Background" Value="Transparent"/>-->
<Setter Property="Height" Value="20"/>
<Setter Property="Width" Value="25"/>
<Setter Property="Margin" Value="2,-2,2,-2"/>
</Style>
<!--#endregion Button Style-->
<!--#region ToggleButton Style-->
@@ -2774,6 +2815,15 @@
<Setter Property="TextWrapping" Value="Wrap"/>
</Style>
<Style x:Key="Strategy_TextBox" TargetType="{x:Type TextBox}" BasedOn="{StaticResource {x:Type TextBox}}">
<Setter Property="Height" Value="25"/>
<Setter Property="VerticalContentAlignment" Value="Center"/>
<Setter Property="HorizontalContentAlignment" Value="Left"/>
<Setter Property="Width" Value="200"/>
<Setter Property="Margin" Value="5,0,5,0"/>
<Setter Property="TextWrapping" Value="Wrap"/>
</Style>
<!--#endregion TextBox-->
<!--#region Border-->
@@ -2923,6 +2973,13 @@
<Setter Property="Width" Value="100"/>
</Style>
<Style x:Key="Strategy_ComboBox" TargetType="{x:Type ComboBox}" BasedOn="{StaticResource OnlyProd_ComboBox}">
<Setter Property="Foreground" Value="Black"/>
<Setter Property="Height" Value="30"/>
<Setter Property="Width" Value="160"/>
<Setter Property="FontSize" Value="15"/>
</Style>
<!--#endregion ComboBox-->
<!--#region CheckBox-->
@@ -3035,7 +3092,7 @@
</Style>
<Style x:Key="CellDataGrid_CustomHighLight" TargetType="{x:Type DataGridCell}">
<Setter Property="Height" Value="23"/>
<Setter Property="Height" Value="24"/>
<Setter Property="Foreground" Value="{StaticResource BeamWall_Corduroy}" />
<Style.Resources>
<SolidColorBrush x:Key="{x:Static SystemColors.HighlightBrushKey}" Color="Transparent" />
@@ -3125,9 +3182,16 @@
<Style x:Key="OnlyProdRawPartManager_StackPanel" TargetType="{x:Type StackPanel}">
<Setter Property="Orientation" Value="Horizontal"/>
<Setter Property="HorizontalAlignment" Value="Left"/>
<Setter Property="Margin" Value="30,1,0,1"/>
<Setter Property="Margin" Value="5,1,0,1"/>
</Style>
<Style x:Key="OnlyProdRawPartManagerAll_StackPanel" TargetType="{x:Type StackPanel}">
<Setter Property="Orientation" Value="Horizontal"/>
<Setter Property="HorizontalAlignment" Value="Right"/>
<Setter Property="Margin" Value="0,1,5,1"/>
</Style>
<Style x:Key="OnlyProdLeftPanel_StackPanel" TargetType="{x:Type StackPanel}">
<Setter Property="Orientation" Value="Horizontal"/>
<Setter Property="HorizontalAlignment" Value="Left"/>
@@ -3144,10 +3208,35 @@
<Setter Property="Width" Value="260"/>
<Setter Property="Margin" Value="5"/>
<Setter Property="Background" Value="Transparent"/>
<Setter Property="AlternationCount" Value="2"/>
<!--<Setter Property="AlternationCount" Value="2"/>-->
<Style.Resources>
<Style TargetType="{x:Type ScrollBar}" BasedOn="{StaticResource OnlyProd_ScrollBar}"/>
</Style.Resources>
<Style TargetType="{x:Type ListBoxItem}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="ListBoxItem">
<Border Background="{TemplateBinding Background}"
BorderBrush="Transparent"
BorderThickness="1">
<ContentPresenter />
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
<Style.Triggers>
<Trigger Property="IsSelected" Value="True">
<Setter Property="Background" Value="{StaticResource BeamWall_FountainBlue}"/>
<Setter Property="Foreground" Value="{StaticResource BeamWall_White}"/>
<Setter Property="FontWeight" Value="Bold"/>
</Trigger>
<Trigger Property="IsSelected" Value="False">
<Setter Property="Background" Value="Transparent"/>
<Setter Property="Foreground" Value="{StaticResource BeamWall_Corduroy}"/>
<Setter Property="FontWeight" Value="Normal"/>
</Trigger>
</Style.Triggers>
</Style>
</Style.Resources>
</Style>
<Style x:Key="MacroCustom_ListBox" TargetType="{x:Type ListBox}" BasedOn="{StaticResource {x:Type ListBox}}">
@@ -3237,6 +3326,78 @@
<Setter Property="MinHeight" Value="40"/>
</Style>
<Style x:Key="Strategy_ListBox" TargetType="{x:Type ListBox}" BasedOn="{StaticResource {x:Type ListBox}}">
<Setter Property="BorderThickness" Value="0"/>
<Setter Property="Margin" Value="10"/>
<Setter Property="FontSize" Value="12"/>
<Setter Property="Background" Value="Transparent"/>
<Style.Resources>
<Style TargetType="{x:Type ScrollBar}" BasedOn="{StaticResource OnlyProd_ScrollBar}"/>
<Style TargetType="{x:Type ListBoxItem}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="ListBoxItem">
<Border Background="{TemplateBinding Background}"
BorderBrush="Transparent"
BorderThickness="1">
<ContentPresenter />
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
<Style.Triggers>
<Trigger Property="IsSelected" Value="True">
<Setter Property="Background" Value="{StaticResource BeamWall_FountainBlue}"/>
<Setter Property="Foreground" Value="{StaticResource BeamWall_White}"/>
<Setter Property="FontWeight" Value="Bold"/>
</Trigger>
<Trigger Property="IsSelected" Value="False">
<Setter Property="Background" Value="Transparent"/>
<Setter Property="Foreground" Value="{StaticResource BeamWall_Corduroy}"/>
<Setter Property="FontWeight" Value="Normal"/>
</Trigger>
</Style.Triggers>
</Style>
</Style.Resources>
</Style>
<Style x:Key="BTL_ListBox" TargetType="{x:Type ListBox}" BasedOn="{StaticResource {x:Type ListBox}}">
<Setter Property="BorderThickness" Value="0"/>
<Setter Property="HorizontalAlignment" Value="Left"/>
<Setter Property="SelectionMode" Value="Single"/>
<Setter Property="IsSynchronizedWithCurrentItem" Value="True"/>
<Style.Resources>
<Style TargetType="{x:Type ScrollBar}" BasedOn="{StaticResource OnlyProd_ScrollBar}"/>
<Style TargetType="{x:Type ListBoxItem}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="ListBoxItem">
<Border Background="{TemplateBinding Background}"
BorderBrush="Transparent"
BorderThickness="1">
<ContentPresenter />
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
<Style.Triggers>
<Trigger Property="IsSelected" Value="True">
<Setter Property="Background" Value="{StaticResource BeamWall_FountainBlue}"/>
<Setter Property="Foreground" Value="{StaticResource BeamWall_White}"/>
<Setter Property="FontWeight" Value="Bold"/>
<Setter Property="FontSize" Value="12"/>
</Trigger>
<Trigger Property="IsSelected" Value="False">
<Setter Property="Background" Value="Transparent"/>
<Setter Property="Foreground" Value="{StaticResource BeamWall_Corduroy}"/>
<Setter Property="FontWeight" Value="SemiBold"/>
<Setter Property="FontSize" Value="12"/>
</Trigger>
</Style.Triggers>
</Style>
</Style.Resources>
</Style>
<!--#endregion ListBox-->
<!--#region WrapPanel-->
@@ -3290,7 +3451,7 @@
<!--#region Ellipse-->
<Style x:Key="CALC_ROT_Ellipse" TargetType="{x:Type Ellipse}">
<Setter Property="Fill" Value="{StaticResource Omag_Red}"/>
<Setter Property="Fill" Value="{StaticResource Omag_Green}"/>
<Setter Property="Width" Value="5"/>
<Setter Property="Height" Value="5"/>
<Setter Property="HorizontalAlignment" Value="Center"/>
@@ -3459,7 +3620,7 @@
<Style x:Key="DialogWindow_TextBlock" TargetType="{x:Type TextBlock}" BasedOn="{StaticResource {x:Type TextBlock}}">
<Setter Property="HorizontalAlignment" Value="Center"/>
<Setter Property="VerticalAlignment" Value="Center"/>
<Setter Property="FontSize" Value="12"/>
<Setter Property="FontSize" Value="13"/>
</Style>
<Style x:Key="OnlyRightPanel_HalfRound_Button" TargetType="{x:Type Button}" BasedOn="{StaticResource OnlyProd_Button}">
@@ -3485,6 +3646,14 @@
<Setter Property="Width" Value="65"/>
</Style>
<Style x:Key="ErrorMsg_TextBlock" TargetType="{x:Type TextBlock}" BasedOn="{StaticResource {x:Type TextBlock}}">
<Setter Property="Foreground" Value="{StaticResource Omag_Red}"/>
<Setter Property="HorizontalAlignment" Value="Center"/>
<Setter Property="VerticalAlignment" Value="Center"/>
<Setter Property="FontSize" Value="13"/>
<Setter Property="FontWeight" Value="Bold"/>
</Style>
<!--#endregion EgtManageDialog-->
</ResourceDictionary>
+36
View File
@@ -212,4 +212,40 @@ Module LuaExec
EgtLuaExecFile(sFilePath)
End Sub
Friend Function FindTopologyFromFeature(nFeatureId As Integer, ByRef sTopologyName As String) As Boolean
EgtOutLog("-- Start ExecBeam --")
' Recupero lo script da eseguire
Dim sExecPath As String = ""
Dim sExecName As String = ""
GetMainPrivateProfileString(S_BEAM, K_BEAMBWEEXEC, "", sExecName)
sExecPath = (Map.refMainWindowVM.MainWindowM.sBeamRoot & "\" & sExecName).TrimEnd({"\"c})
If Not My.Computer.FileSystem.FileExists(sExecPath) Then
EgtOutLog("Not found BeamExec script " & sExecPath)
Return False
End If
' Assegno i dati
EgtLuaCreateGlobTable("BEAM")
EgtLuaSetGlobStringVar("BEAM.BASEDIR", Map.refMainWindowVM.MainWindowM.sBeamRoot)
EgtLuaSetGlobStringVar("BEAM.MACHINE", "")
EgtLuaSetGlobStringVar("BEAM.FILE", "")
EgtLuaSetGlobIntVar("BEAM.FLAG", CmdTypes.TOPOLOGY)
EgtLuaSetGlobIntVar("BEAM.FEATUREID", nFeatureId)
' Eseguo lo script
Dim bOk As Boolean = False
If EgtLuaExecFile(sExecPath) Then
' Recupero i risultati
Dim nErr As Integer = 999
EgtLuaGetGlobIntVar("BEAM.ERR", nErr)
bOk = (nErr <= 0)
If Not bOk Then EgtOutLog("BeamExec Err=" & nErr.ToString())
EgtLuaGetGlobStringVar("BEAM.TOPOLOGY", sTopologyName)
Else
EgtOutLog("Error executing Beam Exec script " & sExecPath)
Return False
End If
' Cancello tavola globale
EgtLuaResetGlobVar("BEAM")
Return bOk
End Function
End Module
+38 -1
View File
@@ -35,6 +35,9 @@ Module Map
Private m_refRawPartManagerVM As RawPartManagerVM
Private m_refFeatureListManagerVM As FeatureListManagerVM
Private m_refSpecialPanelVM As SpecialPanelVM
Private m_refStrategyManagerVM As StrategyManagerVM
Private m_refForcedStrategyPanelVM As ForcedStrategyPanelVM
Private m_refForcedStrategyBTLVM As ForcedStrategyBTLVM
#Region "Get"
@@ -260,6 +263,24 @@ Module Map
End Get
End Property
Public ReadOnly Property refStrategyManagerVM As StrategyManagerVM
Get
Return m_refStrategyManagerVM
End Get
End Property
Public ReadOnly Property refForcedStrategyPanelVM As ForcedStrategyPanelVM
Get
Return m_refForcedStrategyPanelVM
End Get
End Property
Public ReadOnly Property refForcedStrategyBTLVM As ForcedStrategyBTLVM
Get
Return m_refForcedStrategyBTLVM
End Get
End Property
#End Region ' Get
#Region "Set"
@@ -444,6 +465,21 @@ Module Map
Return Not IsNothing(m_refSpecialPanelVM)
End Function
Friend Function SetRefStrategyManagerVM(StrategyManagerVM As StrategyManagerVM) As Boolean
m_refStrategyManagerVM = StrategyManagerVM
Return Not IsNothing(m_refStrategyManagerVM)
End Function
Friend Function SetRefForcedStrategyPanelVM(ForcedStrategyPanelVM As ForcedStrategyPanelVM) As Boolean
m_refForcedStrategyPanelVM = ForcedStrategyPanelVM
Return Not IsNothing(m_refForcedStrategyPanelVM)
End Function
Friend Function SetRefForcedStrategyBTLVM(ForcedStrategyBTLVM As ForcedStrategyBTLVM) As Boolean
m_refForcedStrategyBTLVM = ForcedStrategyBTLVM
Return Not IsNothing(m_refForcedStrategyBTLVM)
End Function
#End Region ' Set
#Region "Init"
@@ -470,7 +506,8 @@ Module Map
Not IsNothing(m_refSpecialPanelVM) AndAlso Not IsNothing(m_refOnlyProdManagerVM) AndAlso
Not IsNothing(m_refBTLPartManagerVM) AndAlso Not IsNothing(m_refRawPartManagerVM) AndAlso
Not IsNothing(m_refFeatureListManagerVM) AndAlso Not IsNothing(m_refSpecialPanelVM) AndAlso
LibMap.EndInit()
Not IsNothing(m_refStrategyManagerVM) AndAlso Not IsNothing(m_refForcedStrategyPanelVM) AndAlso
Not IsNothing(m_refForcedStrategyBTLVM) AndAlso LibMap.EndInit()
End Function
#End Region ' Init
+36
View File
@@ -0,0 +1,36 @@
Module MapV
Private m_refStrategyProductionV As StrategyProductionV
Private m_refSceneShowBuldingV As SceneShowBuldingV
#Region "Get"
Public ReadOnly Property refStrategyProductionV As StrategyProductionV
Get
Return m_refStrategyProductionV
End Get
End Property
Public ReadOnly Property refSceneShowBuldingV As SceneShowBuldingV
Get
Return m_refSceneShowBuldingV
End Get
End Property
#End Region ' Get
#Region "Set"
Friend Function SetRefStrategyProductionV(StrategyProductionV As StrategyProductionV) As Boolean
m_refStrategyProductionV = StrategyProductionV
Return Not IsNothing(m_refStrategyProductionV)
End Function
Friend Function SetRefSceneShowBuldingV(SceneShowBuldingV As SceneShowBuldingV) As Boolean
m_refSceneShowBuldingV = SceneShowBuldingV
Return Not IsNothing(m_refSceneShowBuldingV)
End Function
#End Region ' Set
End Module
@@ -0,0 +1,44 @@
Module TreeHelperManager
Public Function FindVisualParent(Of T As DependencyObject)(ByVal child As DependencyObject) As T
Dim parentObject As DependencyObject = VisualTreeHelper.GetParent(child)
If parentObject Is Nothing Then Return Nothing
Dim parent As T = TryCast(parentObject, T)
If parent IsNot Nothing Then
Return parent
Else
Return FindVisualParent(Of T)(parentObject)
End If
End Function
Public Function FindVisualParents(Of T As DependencyObject, U As DependencyObject, V As DependencyObject)(ByVal child As DependencyObject) As Object
Dim parentObject As DependencyObject = VisualTreeHelper.GetParent(child)
If parentObject Is Nothing Then Return Nothing
If TypeOf parentObject Is T Then
Return parentObject
ElseIf TypeOf parentObject Is U Then
Return parentObject
ElseIf TypeOf parentObject Is V Then
Return parentObject
Else
Return FindVisualParents(Of T, U, V)(parentObject)
End If
End Function
' Funzione per trovare un controllo figlio nel Visual Tree
Public Function FindVisualChild(Of T As DependencyObject)(parent As DependencyObject) As T
Dim childCount As Integer = VisualTreeHelper.GetChildrenCount(parent)
For i As Integer = 0 To childCount - 1
Dim child As DependencyObject = VisualTreeHelper.GetChild(parent, i)
If TypeOf child Is T Then
Return DirectCast(child, T)
Else
Dim foundChild As T = FindVisualChild(Of T)(child)
If foundChild IsNot Nothing Then Return foundChild
End If
Next
Return Nothing
End Function
End Module
@@ -234,12 +234,8 @@ Public Class MachinePanelVM
End If
Dim ToolDbWindowVM As New EgtWPFLib5.ToolDbWindowVM(CurrentMachine.sMachDir, CurrentMachine.sMachIniFile, Map.refSceneHostVM.MainScene.GetCtx(), "Beam")
Dim ToolDbWindowV As Object = Nothing
If bOnlyProd Then
ToolDbWindowV = New OnlyProdToolDbWindowV(Application.Current.MainWindow, ToolDbWindowVM)
Else
ToolDbWindowV = New ToolDbWindowV(Application.Current.MainWindow, ToolDbWindowVM)
End If
Dim ToolDbWindowV As New ToolDbWindowV(Application.Current.MainWindow, ToolDbWindowVM)
If ToolDbWindowVM.MatType <> 0 Then
ToolDbWindowV.Height = 640
ToolDbWindowV.Width = 1024
@@ -314,18 +310,10 @@ Public Class MachinePanelVM
' Reset lua
EgtLuaResetGlobVar("STU")
Dim SetUpWindow As Object = Nothing
If bOnlyProd Then
SetUpWindow = New OnlyProdSetUpWindowV(Application.Current.MainWindow, New SetUpWindowVM(CurrentMachine.sMachDir, CurrentMachine.sMachineName)) With {
Dim SetUpWindow As New SetUpWindowV(Application.Current.MainWindow, New SetUpWindowVM(CurrentMachine.sMachDir, CurrentMachine.sMachineName)) With {
.Height = 614,
.Width = 1024
}
Else
SetUpWindow = New SetUpWindowV(Application.Current.MainWindow, New SetUpWindowVM(CurrentMachine.sMachDir, CurrentMachine.sMachineName)) With {
.Height = 614,
.Width = 1024
}
End If
SetUpWindow.ShowDialog()

Some files were not shown because too many files have changed in this diff Show More