Compare commits
78 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 649a1d6a46 | |||
| ccc824489b | |||
| 62db5e4a42 | |||
| fffbf3676f | |||
| ac46e13c54 | |||
| 3c84e91735 | |||
| fab3b0fe14 | |||
| 6ce4fa7641 | |||
| 51707cc973 | |||
| a9e463141e | |||
| 1e2023234e | |||
| b305d8be17 | |||
| ac9d0dc076 | |||
| a2a3642ecf | |||
| 1051bf0f58 | |||
| 3e03d44840 | |||
| 4730c0ef42 | |||
| 9eac34222f | |||
| f2c5b60acc | |||
| 5c5dae5e3a | |||
| c400973972 | |||
| 9522cd6d4e | |||
| f0ce11dad7 | |||
| 493c63ece2 | |||
| 33d18efcc2 | |||
| 07c67e0987 | |||
| 07753855cd | |||
| d1e95372e1 | |||
| 9865028f99 | |||
| ecb2055690 | |||
| 187fdde32b | |||
| 5e66d99528 | |||
| 79f0b3ee9f | |||
| feafc44022 | |||
| d376fdca3e | |||
| cc43198e05 | |||
| 82892c2460 | |||
| 92656e997e | |||
| 32d576111a | |||
| 17ebba3e11 | |||
| eed9456c8d | |||
| 3f56e563c1 | |||
| 9c9b00d661 | |||
| 4d2e18ebf1 | |||
| 8692baafff | |||
| b9a89fa212 | |||
| 9d572699a2 | |||
| 1794d475ea | |||
| 8a73b3cab8 | |||
| 86010b41c1 | |||
| 6d8d3a1c1f | |||
| b48b63bd4d | |||
| 05feb0ab8b | |||
| deca9cd4c0 | |||
| 8b36b65b37 | |||
| 06899fadfd | |||
| 80e9ea4c15 | |||
| ad47a070ef | |||
| d99ea84058 | |||
| 069df21cfa | |||
| 7def1b8d5d | |||
| 82aea136c2 | |||
| 55260fe380 | |||
| 4bdbba6599 | |||
| 0d38b47f24 | |||
| 2332eccef9 | |||
| a3481659f2 | |||
| 4b90d2e915 | |||
| bb0a3b385a | |||
| 0c82debdf4 | |||
| 995650aac2 | |||
| f7a85a0680 | |||
| 910e54cae8 | |||
| ea2cb64886 | |||
| c785adbcdf | |||
| 9546248819 | |||
| 13b2dd29d1 | |||
| 55879d431e |
@@ -1,5 +1,4 @@
|
||||
Imports System.Collections.ObjectModel
|
||||
Imports System.Globalization
|
||||
Imports System.Windows
|
||||
Imports EgtUILib
|
||||
Imports EgtWPFLib5
|
||||
|
||||
@@ -18,6 +18,17 @@ Public Class BTLPartM
|
||||
End Property
|
||||
|
||||
' Info del pezzo
|
||||
|
||||
Public m_nPROJ As Integer
|
||||
Public Property nPROJ As Integer
|
||||
Get
|
||||
Return m_nPROJ
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
m_nPROJ = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public m_nPDN As Integer
|
||||
Public Property nPDN As Integer
|
||||
Get
|
||||
@@ -752,6 +763,7 @@ Public Class BTLPartM
|
||||
Dim sValArray() As String
|
||||
Dim sValue As String = String.Empty
|
||||
Dim nValue As Integer = 0
|
||||
EgtGetInfo(nPartId, BTL_PRT_PROJ, NewBTLPart.m_nPROJ)
|
||||
EgtGetInfo(nPartId, BTL_PRT_PDN, NewBTLPart.m_nPDN)
|
||||
Dim nDO As Integer = 1
|
||||
If EgtGetInfo(nPartId, BTL_PRT_DO, nDO) Then
|
||||
|
||||
@@ -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))
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
Public Module ConstDataGridColumnsIni
|
||||
|
||||
Public Const DATAGRIDCOLUMNS_FILE_NAME As String = "DataGridColumns.ini"
|
||||
Public Const OPTIMIZERDATAGRIDCOLUMNS_FILE_NAME As String = "OPTIMIZERDataGridColumns.ini"
|
||||
|
||||
Public Const S_FEATURELIST As String = "DG_FeatureList"
|
||||
Public Const S_OPENPROJFILEDLG_PROJ As String = "DG_OpenProjectFileDialog_PROJ"
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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"
|
||||
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -522,7 +522,11 @@ Public Class EgtDataGridColumn
|
||||
Private Property m_Width As DataGridLength
|
||||
Public Property Width As DataGridLength
|
||||
Get
|
||||
Return m_dgColumn.Width
|
||||
If Not IsNothing(m_dgColumn) Then
|
||||
Return m_dgColumn.Width
|
||||
Else
|
||||
Return m_Width
|
||||
End If
|
||||
End Get
|
||||
Set(value As DataGridLength)
|
||||
If Not IsNothing(m_dgColumn) Then
|
||||
@@ -539,10 +543,14 @@ Public Class EgtDataGridColumn
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private Property m_DisplayIndex As Integer
|
||||
Private Property m_DisplayIndex As Integer = -1
|
||||
Public Property DisplayIndex As Integer
|
||||
Get
|
||||
Return m_dgColumn.DisplayIndex
|
||||
If Not IsNothing(m_dgColumn) Then
|
||||
Return m_dgColumn.DisplayIndex
|
||||
Else
|
||||
Return m_DisplayIndex
|
||||
End If
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
If Not IsNothing(m_dgColumn) Then
|
||||
@@ -557,7 +565,11 @@ Public Class EgtDataGridColumn
|
||||
Private Property m_IsReadOnly As Boolean = True
|
||||
Public Property IsReadOnly As Boolean
|
||||
Get
|
||||
Return m_dgColumn.IsReadOnly
|
||||
If Not IsNothing(m_dgColumn) Then
|
||||
Return m_dgColumn.IsReadOnly
|
||||
Else
|
||||
Return m_IsReadOnly
|
||||
End If
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
If Not IsNothing(m_dgColumn) Then
|
||||
@@ -575,7 +587,11 @@ Public Class EgtDataGridColumn
|
||||
Private m_CanUserReorder As Boolean
|
||||
Public Property CanUserReorder As Boolean
|
||||
Get
|
||||
Return m_dgColumn.CanUserReorder
|
||||
If Not IsNothing(m_dgColumn) Then
|
||||
Return m_dgColumn.CanUserReorder
|
||||
Else
|
||||
Return m_CanUserReorder
|
||||
End If
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
If Not IsNothing(m_dgColumn) Then
|
||||
@@ -591,7 +607,11 @@ Public Class EgtDataGridColumn
|
||||
Private m_CanUserResize As Boolean
|
||||
Public Property CanUserResize As Boolean
|
||||
Get
|
||||
Return m_dgColumn.CanUserResize
|
||||
If Not IsNothing(m_dgColumn) Then
|
||||
Return m_dgColumn.CanUserResize
|
||||
Else
|
||||
Return m_CanUserResize
|
||||
End If
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
If Not IsNothing(m_dgColumn) Then
|
||||
@@ -606,7 +626,11 @@ Public Class EgtDataGridColumn
|
||||
Private m_CanUserSort As Boolean
|
||||
Public Property CanUserSort As Boolean
|
||||
Get
|
||||
Return m_dgColumn.CanUserSort
|
||||
If Not IsNothing(m_dgColumn) Then
|
||||
Return m_dgColumn.CanUserSort
|
||||
Else
|
||||
Return m_CanUserSort
|
||||
End If
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
If Not IsNothing(m_dgColumn) Then
|
||||
@@ -721,6 +745,7 @@ Public Class EgtDataGridColumn
|
||||
|
||||
' funzione per calcolare e scrivere la stringa dei parametri della colonna nell'INI
|
||||
Public Function SaveDataGridColumn() As Boolean
|
||||
If DisplayIndex = -1 Then Return False
|
||||
Dim bOk As Boolean
|
||||
Dim sColumnParams = String.Empty
|
||||
sColumnParams = Name & "," & If(CanUserReorder, 1, 0) & "," & If(CanUserResize, 1, 0) & "," & If(CanUserSort, 1, 0) & "," & If(m_OrigIsReadOnly, 1, 0) & "," & DoubleToString(Width.Value, 6) & "," & Width.UnitType & "," & If(Visible, 1, 0) & "," & If(CanUserEditVisible, 1, 0) & "," & CInt(SortDirection)
|
||||
|
||||
@@ -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
|
||||
@@ -0,0 +1,52 @@
|
||||
<Window x:Class="AboutBoxV"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
Title="AboutBox" Height="400" Width="360" WindowStyle="None" ResizeMode="NoResize"
|
||||
ShowInTaskbar="False" WindowStartupLocation="CenterOwner">
|
||||
|
||||
<Border BorderThickness="2" BorderBrush="LightBlue">
|
||||
<Grid >
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="0.5*"/>
|
||||
<ColumnDefinition Width="5*"/>
|
||||
<ColumnDefinition Width="0.5*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="0.5*"/>
|
||||
<RowDefinition Height="1.75*"/>
|
||||
<RowDefinition Height="0.15*"/>
|
||||
<RowDefinition Height="0.5*"/>
|
||||
<RowDefinition Height="0.5*"/>
|
||||
<RowDefinition Height="0.5*"/>
|
||||
<RowDefinition Height="2.5*"/>
|
||||
<RowDefinition Height="0.35*"/>
|
||||
<RowDefinition Height="0.5*"/>
|
||||
<RowDefinition Height="0.35*"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<Grid Grid.Column="1" Grid.Row="1">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="3*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Border Name="LogoBrd" Grid.Column="1" Background="White">
|
||||
<Image Source="/Resources/AboutBox/EgalwareLogo.png" Stretch="Uniform"/>
|
||||
</Border>
|
||||
</Grid>
|
||||
<TextBlock Name="DescriptionLbl" Grid.Column="1" Grid.Row="3" HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center" FontSize="18" />
|
||||
<TextBlock Name="VersionLbl" Grid.Column="1" Grid.Row="4" HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center" FontSize="18"/>
|
||||
<TextBlock Name="CopyrightLbl" Grid.Column="1" Grid.Row="5" HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center" FontSize="12" />
|
||||
<TextBox Name="InfoLbl" Grid.Column="1" Grid.Row="6" HorizontalAlignment="Stretch"
|
||||
VerticalAlignment="Stretch" FontSize="12" IsReadOnly="True" TextWrapping="Wrap"/>
|
||||
<Button Name="ExitBtn" Grid.Column="1" Grid.Row="8" IsCancel="True"
|
||||
Margin="100,0"/>
|
||||
|
||||
</Grid>
|
||||
|
||||
</Border>
|
||||
|
||||
</Window>
|
||||
@@ -0,0 +1,40 @@
|
||||
Imports EgtUILib
|
||||
Imports EgtBEAMWALL.Core
|
||||
|
||||
Public Class AboutBoxV
|
||||
|
||||
Private Sub AboutBoxWD_Loaded(sender As Object, e As RoutedEventArgs) Handles Me.Loaded
|
||||
DescriptionLbl.Text = My.Application.Info.Description.ToString()
|
||||
VersionLbl.Text = "Version : " & My.Application.Info.Version.Major.ToString() &
|
||||
"." & My.Application.Info.Version.Minor.ToString() &
|
||||
(ChrW(97 - 1 + My.Application.Info.Version.Build)).ToString() &
|
||||
My.Application.Info.Version.Revision.ToString()
|
||||
CopyrightLbl.Text = My.Application.Info.Copyright.ToString()
|
||||
Dim sInfo As String = String.Empty
|
||||
Dim sKey As String = String.Empty
|
||||
EgtGetKeyInfo(sKey)
|
||||
Dim sKlev As String = Map.refMainWindowVM.MainWindowM.nKeyLevel.ToString()
|
||||
Dim sOpts As String = Map.refMainWindowVM.MainWindowM.nKeyOptions.ToString()
|
||||
Dim sLeftDays As String = ""
|
||||
Dim nLeftDays As Integer
|
||||
if EgtGetKeyLeftDays( nLeftDays) AndAlso nLeftDays < 500 Then sLeftDays= " (" & nLeftDays.ToString() & ")"
|
||||
sInfo = If( EgtIsDebug(), "*** Debug Libraries ***" & Environment.NewLine, "")
|
||||
sInfo &= "User " & Environment.MachineName & "\" & Environment.UserName &
|
||||
" (" & Map.refMainWindowVM.MainWindowM.nInstance.ToString() & ")" & Environment.NewLine
|
||||
sInfo &= sKey & " - " & sKlev & " - " & sOpts & sLeftDays & Environment.NewLine
|
||||
sInfo &= "DataRoot " & Map.refMainWindowVM.MainWindowM.sDataRoot & Environment.NewLine
|
||||
sInfo &= "MachinesRoot " & Map.refMainWindowVM.MainWindowM.sMachinesRoot & Environment.NewLine
|
||||
Dim sOpSys As String = String.Empty
|
||||
EgtGetOsInfo( sOpSys)
|
||||
sInfo &= sOpSys & Environment.NewLine
|
||||
Dim sCPU As String = String.Empty
|
||||
EgtGetCpuInfo( sCPU)
|
||||
sInfo &= sCPU & Environment.NewLine
|
||||
Dim sScene As String = String.Empty
|
||||
EgtGetSceneInfo(sScene)
|
||||
sInfo &= sScene
|
||||
InfoLbl.Text = sInfo
|
||||
ExitBtn.Content = EgtMsg(10104) 'Ok
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
@@ -0,0 +1,18 @@
|
||||
Public Class AddFeatureWndV
|
||||
|
||||
Private WithEvents m_AddFeatureWndVM As AddFeatureWndVM
|
||||
|
||||
Sub New(Owner As Window, AddFeatureWndVM As AddFeatureWndVM)
|
||||
MyBase.New(Owner)
|
||||
' This call is required by the designer.
|
||||
InitializeComponent()
|
||||
Me.DataContext = AddFeatureWndVM
|
||||
' Assegno al riferimento locale al VM il VM preso dal DataContext
|
||||
m_AddFeatureWndVM = AddFeatureWndVM
|
||||
End Sub
|
||||
|
||||
Private Sub CloseWindow(bDialogResult As Boolean) Handles m_AddFeatureWndVM.m_CloseWindow
|
||||
Me.DialogResult = bDialogResult
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
@@ -0,0 +1,90 @@
|
||||
<EgtWPFLib5:EgtCustomWindow x:Class="AddFeatureWndV"
|
||||
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:EgtBEAMWALL="clr-namespace:EgtBEAMWALL.Optimizer"
|
||||
Style="{DynamicResource {x:Type EgtWPFLib5:EgtCustomWindow}}"
|
||||
WindowStyle="None" ResizeMode="NoResize"
|
||||
SizeToContent="WidthAndHeight"
|
||||
WindowStartupLocation="CenterOwner"
|
||||
IsClosable="False"
|
||||
IsMinimizable="False"
|
||||
IsResizable="False"
|
||||
Title="AddProcess">
|
||||
<StackPanel Margin="5,5,5,0">
|
||||
<TabControl SelectedIndex="{Binding SelGRPType}">
|
||||
<TabItem Header="L"/>
|
||||
<TabItem Header="T"/>
|
||||
</TabControl>
|
||||
<Border Grid.Row="1"
|
||||
BorderThickness="1"
|
||||
BorderBrush="DarkGray"
|
||||
Background="White"
|
||||
Margin="0,-6,0,5">
|
||||
<Grid Margin="0,5,0,0">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
<Grid HorizontalAlignment="Center"
|
||||
Grid.Row="0"
|
||||
Margin="0,0,0,5">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock Text="Process"
|
||||
Style="{StaticResource OptionTextBlock}"/>
|
||||
<ComboBox ItemsSource="{Binding PRCList}"
|
||||
SelectedItem="{Binding nSelPRC}"
|
||||
Grid.Column="1"
|
||||
DisplayMemberPath="ghDesc"
|
||||
Width="200"
|
||||
HorizontalAlignment="Left"
|
||||
Style="{StaticResource FeatureComboBox}"/>
|
||||
<TextBlock Text="Macro"
|
||||
Grid.Row="1"
|
||||
Margin="0,5,0,0"
|
||||
Style="{StaticResource OptionTextBlock}"/>
|
||||
<ComboBox ItemsSource="{Binding MacroCustomList}"
|
||||
SelectedIndex="{Binding nSelMacroCustom}"
|
||||
Grid.Row="1"
|
||||
Grid.Column="1"
|
||||
DisplayMemberPath="Name"
|
||||
IsEnabled="{Binding MacroList_IsEnabled}"
|
||||
Width="200"
|
||||
Margin="0,5,0,0"
|
||||
Style="{StaticResource FeatureComboBox}"/>
|
||||
</Grid>
|
||||
<Image Source="{Binding sDrawPath}"
|
||||
Grid.Row="1"
|
||||
Height="300"
|
||||
Width="300"
|
||||
Margin="5,0,5,5"/>
|
||||
<Grid Grid.Row="2" Margin="0,0,0,5">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Button Content="Ok"
|
||||
Command="{Binding Ok_Command}"
|
||||
IsDefault="True"
|
||||
Grid.Column="1"
|
||||
Style="{StaticResource EgtWPFLib5_InputButton}"/>
|
||||
<Button Content="Cancel"
|
||||
IsCancel="True"
|
||||
Grid.Column="3"
|
||||
Style="{StaticResource EgtWPFLib5_InputButton}"/>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Border>
|
||||
</StackPanel>
|
||||
</EgtWPFLib5:EgtCustomWindow>
|
||||
@@ -0,0 +1,451 @@
|
||||
Imports System.Collections.ObjectModel
|
||||
Imports System.IO
|
||||
Imports EgtUILib
|
||||
Imports EgtWPFLib5
|
||||
Imports EgtBEAMWALL.Core
|
||||
|
||||
Public Class AddFeatureWndVM
|
||||
Inherits VMBase
|
||||
|
||||
#Region "FIELDS & PROPERTIES"
|
||||
|
||||
Friend Event m_CloseWindow(bDialogResult As Boolean)
|
||||
Friend m_MacroFilePathList As List(Of String)
|
||||
Friend m_MacroCustomFilePathList As List(Of String)
|
||||
|
||||
Private m_PrevSelPRCIndex_L As Integer = 0
|
||||
Private m_PrevSelPRCIndex_T As Integer = 0
|
||||
|
||||
Private m_SelGRPType As GRPType
|
||||
Public Property SelGRPType As Integer
|
||||
Get
|
||||
Return m_SelGRPType
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
m_SelGRPType = value
|
||||
' carico lista process
|
||||
Dim TempPRCList As New ObservableCollection(Of Integer)
|
||||
GetBeamPrivateProfileProcessList(m_SelGRPType, TempPRCList)
|
||||
m_PRCList.Clear()
|
||||
For Each PRC In TempPRCList
|
||||
' leggo gruppi
|
||||
Dim GRPList As New ObservableCollection(Of Integer)
|
||||
GetBeamPrivateProfileGRPList(m_SelGRPType, PRC, GRPList)
|
||||
m_PRCList.Add(New PRC(If(GRPList.Count > 0, GRPList(0), m_SelGRPType), PRC, GetBeamPrivateProfileName(m_SelGRPType, PRC)))
|
||||
Next
|
||||
If m_SelGRPType = GRPType.L Then
|
||||
nSelPRC = PRCList(m_PrevSelPRCIndex_L)
|
||||
ElseIf m_SelGRPType = GRPType.T Then
|
||||
nSelPRC = PRCList(m_PrevSelPRCIndex_T)
|
||||
End If
|
||||
NotifyPropertyChanged(NameOf(PRCList))
|
||||
NotifyPropertyChanged(NameOf(nSelPRC))
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_PRCList As New ObservableCollection(Of PRC)
|
||||
Public ReadOnly Property PRCList As ObservableCollection(Of PRC)
|
||||
Get
|
||||
Return m_PRCList
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_PRCListView As New List(Of PRC)
|
||||
Public ReadOnly Property PRCListView As List(Of PRC)
|
||||
Get
|
||||
Return m_PRCListView
|
||||
End Get
|
||||
End Property
|
||||
|
||||
#Region "New Macro OnlyProdPage"
|
||||
|
||||
Private m_MacroDefaultList As New ObservableCollection(Of Object)
|
||||
Public ReadOnly Property MacroDefaultList As ObservableCollection(Of Object)
|
||||
Get
|
||||
Return m_MacroDefaultList
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_nSelMacroDefault As Integer = -1
|
||||
Public Property nSelMacroDefault As Integer
|
||||
Get
|
||||
Return m_nSelMacroDefault
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
If value <> m_nSelMacroDefault Then
|
||||
m_nSelMacroDefault = value
|
||||
End If
|
||||
End Set
|
||||
End Property
|
||||
|
||||
#End Region ' New Macro OnlyProdPage
|
||||
|
||||
Private m_nSelPRC As PRC = Nothing
|
||||
Public Property nSelPRC As PRC
|
||||
Get
|
||||
Return m_nSelPRC
|
||||
End Get
|
||||
Set(value As PRC)
|
||||
If value IsNot m_nSelPRC Then
|
||||
m_nSelPRC = value
|
||||
If Not IsNothing(m_nSelPRC) Then
|
||||
If SelGRPType = GRPType.L Then
|
||||
m_PrevSelPRCIndex_L = PRCList.IndexOf(m_nSelPRC)
|
||||
ElseIf SelGRPType = GRPType.T Then
|
||||
m_PrevSelPRCIndex_T = PRCList.IndexOf(m_nSelPRC)
|
||||
End If
|
||||
End If
|
||||
NotifyPropertyChanged(NameOf(sDrawPath))
|
||||
' carico eventuali file Macro
|
||||
MacroCustomList.Clear()
|
||||
If Core.Configuration.bOnlyProd Then
|
||||
MacroDefaultList.Clear()
|
||||
End If
|
||||
m_MacroFilePathList = New List(Of String)
|
||||
m_MacroCustomFilePathList = New List(Of String)
|
||||
If Not IsNothing(nSelPRC) Then
|
||||
Dim nGRPFromFileName As Integer = 0
|
||||
Dim nPRCFromFileName As Integer = 0
|
||||
Dim sMacroNameFromFileName As String = String.Empty
|
||||
Dim nIdMacroName As Integer = 0
|
||||
' ricavo lista file Macro Default
|
||||
GetMacroListDefault(nGRPFromFileName, nPRCFromFileName, sMacroNameFromFileName, nIdMacroName)
|
||||
' ricavo lista file Macro Custom
|
||||
If Core.Configuration.bOnlyProd Then GetMacroListCustom(nGRPFromFileName, nPRCFromFileName, sMacroNameFromFileName, nIdMacroName)
|
||||
If MacroCustomList.Count > 0 Then
|
||||
MacroList_IsEnabled = True
|
||||
Else
|
||||
MacroList_IsEnabled = False
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
NotifyPropertyChanged(NameOf(nSelPRC))
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_MacroList_IsEnabled As Boolean
|
||||
Public Property MacroList_IsEnabled As Boolean
|
||||
Get
|
||||
Return m_MacroList_IsEnabled
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
If value <> m_MacroList_IsEnabled Then
|
||||
m_MacroList_IsEnabled = value
|
||||
NotifyPropertyChanged(NameOf(MacroList_IsEnabled))
|
||||
End If
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_MacroCustomList As New ObservableCollection(Of Object)
|
||||
Public ReadOnly Property MacroCustomList As ObservableCollection(Of Object)
|
||||
Get
|
||||
Return m_MacroCustomList
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_nSelMacroCustom As Integer = -1
|
||||
Public Property nSelMacroCustom As Integer
|
||||
Get
|
||||
Return m_nSelMacroCustom
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
If value <> m_nSelMacroCustom Then
|
||||
m_nSelMacroCustom = value
|
||||
End If
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property sDrawPath As String
|
||||
Get
|
||||
If IsNothing(m_nSelPRC) Then Return ""
|
||||
Dim sDescConstruction As String = String.Empty
|
||||
If m_SelGRPType = GRPType.L Then
|
||||
sDescConstruction = "L"
|
||||
Else
|
||||
sDescConstruction = "T"
|
||||
End If
|
||||
sDescConstruction &= m_nSelPRC.nPRC.ToString("000")
|
||||
Return Map.refMainWindowVM.MainWindowM.sResourcesRoot & "\Features\" & sDescConstruction & ".png"
|
||||
End Get
|
||||
End Property
|
||||
|
||||
' Definizione comandi
|
||||
Private m_cmdOk As ICommand
|
||||
|
||||
#Region "Messages"
|
||||
|
||||
Public ReadOnly Property Process_Msg As String
|
||||
Get
|
||||
Return EgtMsg(61805).ToUpper()
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property Default_Msg As String
|
||||
Get
|
||||
Return EgtMsg(61899).ToUpper()
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property Custom_Msg As String
|
||||
Get
|
||||
Return EgtMsg(61801).ToUpper()
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property OK_Msg As String
|
||||
Get
|
||||
Return EgtMsg(91651)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property Cancel_Msg As String
|
||||
Get
|
||||
Return EgtMsg(91652)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
#End Region
|
||||
|
||||
#End Region ' FIELDS & PROPERTIES
|
||||
|
||||
#Region "CONSTRUCTOR"
|
||||
|
||||
Sub New()
|
||||
If Core.Configuration.bOnlyProd Then
|
||||
' carico lista process
|
||||
Dim TempPRCList As New ObservableCollection(Of Integer)
|
||||
Dim TempPRCLList As New ObservableCollection(Of Integer)
|
||||
Dim TempPRCLTist As New ObservableCollection(Of Integer)
|
||||
GetBeamPrivateProfileProcessList(0, TempPRCLList)
|
||||
GetBeamPrivateProfileProcessList(1, TempPRCLTist)
|
||||
' riporto le liste process in un unica lista
|
||||
For Each PRCL In TempPRCLList
|
||||
TempPRCList.Add(PRCL)
|
||||
Next
|
||||
For Each PRCT In TempPRCLTist
|
||||
TempPRCList.Add(PRCT)
|
||||
Next
|
||||
m_PRCList.Clear()
|
||||
' ciclo sulla lista process eliminado i doppi
|
||||
For Each PRC In TempPRCList.Distinct()
|
||||
' leggo gruppi
|
||||
Dim GRPLList As New ObservableCollection(Of Integer)
|
||||
Dim GRPTList As New ObservableCollection(Of Integer)
|
||||
GetBeamPrivateProfileGRPList(0, PRC, GRPLList)
|
||||
GetBeamPrivateProfileGRPList(1, PRC, GRPTList)
|
||||
If GRPLList.Count > 0 Then m_PRCList.Add(New PRC(GRPLList(0), PRC, GetBeamPrivateProfileName(0, PRC)))
|
||||
If GRPTList.Count > 0 Then m_PRCList.Add(New PRC(GRPTList(0), PRC, GetBeamPrivateProfileName(1, PRC)))
|
||||
Next
|
||||
m_PRCListView = m_PRCList.OrderBy(Function(x) x.nPRC).ToList()
|
||||
nSelPRC = m_PRCList(0)
|
||||
NotifyPropertyChanged(NameOf(PRCListView))
|
||||
NotifyPropertyChanged(NameOf(PRCList))
|
||||
Else
|
||||
SelGRPType = 0
|
||||
nSelPRC = PRCList(0)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
#End Region ' CONSTRUCTOR
|
||||
|
||||
#Region "METHODS"
|
||||
|
||||
Private Sub GetMacroListDefault(ByRef nGRPFromFileName As Integer, ByRef nPRCFromFileName As Integer, ByRef sMacroNameFromFileName As String, ByRef nIdMacroName As Integer)
|
||||
Dim AllFilesInDir As IEnumerable(Of String) = IO.Directory.EnumerateFiles(Map.refMainWindowVM.MainWindowM.sMacroCustomDir)
|
||||
For Each File In AllFilesInDir
|
||||
If Path.GetExtension(File).ToLower() = ".lua" Then
|
||||
If File.Contains(FILENAMESEPARATOR) Then
|
||||
Dim FileName As String = Path.GetFileNameWithoutExtension(File)
|
||||
Dim DataFromFileName As String() = FileName.Split(FILENAMESEPARATOR)
|
||||
If DataFromFileName.Count = 2 Then
|
||||
If Not String.IsNullOrEmpty(DataFromFileName(0)) Then
|
||||
Dim NumbersFromFileName As String() = DataFromFileName(0).Split(".")
|
||||
Integer.TryParse(NumbersFromFileName(0), nGRPFromFileName)
|
||||
Integer.TryParse(NumbersFromFileName(1), nPRCFromFileName)
|
||||
End If
|
||||
If Not String.IsNullOrEmpty(DataFromFileName(1)) Then
|
||||
sMacroNameFromFileName = DataFromFileName(1)
|
||||
End If
|
||||
If nGRPFromFileName = CalcBeamPrivateProfileGRP(nSelPRC.nGRP) AndAlso nPRCFromFileName = nSelPRC.nPRC Then
|
||||
If Core.Configuration.bOnlyProd Then
|
||||
MacroCustomList.Add(New NewMacro(nIdMacroName, sMacroNameFromFileName, Map.refMainWindowVM.MainWindowM.sMacroCustomDir & "\Template\" & sMacroNameFromFileName & ".png"))
|
||||
Else
|
||||
MacroCustomList.Add(New IdNameStruct(nIdMacroName, sMacroNameFromFileName))
|
||||
End If
|
||||
m_MacroFilePathList.Add(File)
|
||||
nIdMacroName += 1
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
Next
|
||||
End Sub
|
||||
|
||||
Private Sub GetMacroListCustom(ByRef nGRPFromFileName As Integer, ByRef nPRCFromFileName As Integer, ByRef sMacroNameFromFileName As String, ByRef nIdMacroName As Integer)
|
||||
nIdMacroName = 0
|
||||
Dim AllFilesInDirCustom As IEnumerable(Of String) = IO.Directory.EnumerateFiles(Map.refMainWindowVM.MainWindowM.sMacroDefaultDir)
|
||||
For Each File In AllFilesInDirCustom
|
||||
If Path.GetExtension(File).ToLower() = ".lua" Then
|
||||
If File.Contains(FILENAMESEPARATOR) Then
|
||||
Dim FileName As String = Path.GetFileNameWithoutExtension(File)
|
||||
Dim DataFromFileName As String() = FileName.Split(FILENAMESEPARATOR)
|
||||
If DataFromFileName.Count = 2 Then
|
||||
If Not String.IsNullOrEmpty(DataFromFileName(0)) Then
|
||||
Dim NumbersFromFileName As String() = DataFromFileName(0).Split(".")
|
||||
Integer.TryParse(NumbersFromFileName(0), nGRPFromFileName)
|
||||
Integer.TryParse(NumbersFromFileName(1), nPRCFromFileName)
|
||||
End If
|
||||
If Not String.IsNullOrEmpty(DataFromFileName(1)) Then
|
||||
sMacroNameFromFileName = DataFromFileName(1)
|
||||
End If
|
||||
If nGRPFromFileName = CalcBeamPrivateProfileGRP(nSelPRC.nGRP) AndAlso nPRCFromFileName = nSelPRC.nPRC Then
|
||||
MacroDefaultList.Add(New NewMacro(nIdMacroName, sMacroNameFromFileName))
|
||||
m_MacroCustomFilePathList.Add(File)
|
||||
nIdMacroName += 1
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
Next
|
||||
End Sub
|
||||
|
||||
#End Region ' METHODS
|
||||
|
||||
#Region "COMMANDS"
|
||||
|
||||
#Region "Ok"
|
||||
|
||||
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()
|
||||
'verifico che tutti i campi contengano un valore valido
|
||||
If Not IsNothing(m_nSelPRC) AndAlso m_nSelPRC.nPRC > 0 Then
|
||||
RaiseEvent m_CloseWindow(True)
|
||||
Else
|
||||
MessageBox.Show(EgtMsg(61852), EgtMsg(30007))
|
||||
End If
|
||||
End Sub
|
||||
|
||||
#End Region ' Ok
|
||||
|
||||
#End Region ' COMMANDS
|
||||
|
||||
End Class
|
||||
|
||||
Public Class PRC
|
||||
|
||||
' Processo
|
||||
Private m_nPRC As Integer
|
||||
Friend ReadOnly Property nPRC As Integer
|
||||
Get
|
||||
Return m_nPRC
|
||||
End Get
|
||||
End Property
|
||||
|
||||
' Gruppo
|
||||
Private m_nGRP As Integer
|
||||
Friend ReadOnly Property nGRP As Integer
|
||||
Get
|
||||
Return m_nGRP
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_nSIDE As Integer = 2
|
||||
Public ReadOnly Property nSIDE As Integer
|
||||
Get
|
||||
Return m_nSIDE
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_nVARIANT As Integer = 0
|
||||
Public ReadOnly Property nVARIANT As Integer
|
||||
Get
|
||||
Return m_nVARIANT
|
||||
End Get
|
||||
End Property
|
||||
|
||||
' Nome
|
||||
Private m_sName As String
|
||||
Public ReadOnly Property sName As String
|
||||
Get
|
||||
Return m_sName
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property ghDesc As String
|
||||
Get
|
||||
Return If(m_nGRP = 1 OrElse m_nGRP = 2, "T", "L") & m_nPRC.ToString("000") & " " & m_sName
|
||||
End Get
|
||||
End Property
|
||||
|
||||
' lista dei parametri Q della feature
|
||||
Protected m_QBTLParamVMList As List(Of QBTLParamVM)
|
||||
Public Property QBTLParamVMList As List(Of QBTLParamVM)
|
||||
Get
|
||||
Return m_QBTLParamVMList
|
||||
End Get
|
||||
Set(value As List(Of QBTLParamVM))
|
||||
m_QBTLParamVMList = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Sub New(GRP As Integer, PRC As Integer, Name As String)
|
||||
m_nPRC = PRC
|
||||
m_sName = Name
|
||||
m_nGRP = GRP
|
||||
End Sub
|
||||
|
||||
Sub New(GRP As Integer, PRC As Integer, Name As String, QBTLParamList As List(Of QBTLParamVM))
|
||||
m_nPRC = PRC
|
||||
m_sName = Name
|
||||
m_nGRP = GRP
|
||||
m_QBTLParamVMList = QBTLParamList
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
|
||||
Public Class NewMacro
|
||||
|
||||
' Indice Macro
|
||||
Private m_nIndexMacro As Integer
|
||||
Public ReadOnly Property nIndexMacro As Integer
|
||||
Get
|
||||
Return m_nIndexMacro
|
||||
End Get
|
||||
End Property
|
||||
|
||||
' Nome Macro
|
||||
Private m_sMacroName As String
|
||||
Public ReadOnly Property sMacroName As String
|
||||
Get
|
||||
Return m_sMacroName.ToUpper()
|
||||
End Get
|
||||
End Property
|
||||
|
||||
' Cartella dove sono contenuti i templete delle macro
|
||||
Private m_sMacroDrawPath As String
|
||||
Public ReadOnly Property sMacroDrawPath As String
|
||||
Get
|
||||
Return m_sMacroDrawPath
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Sub New(IndexMacro As Integer, MacroName As String)
|
||||
m_nIndexMacro = IndexMacro
|
||||
m_sMacroName = MacroName
|
||||
End Sub
|
||||
|
||||
Sub New(IndexMacro As Integer, MacroName As String, MacroDrawPath As String)
|
||||
m_nIndexMacro = IndexMacro
|
||||
m_sMacroName = MacroName
|
||||
m_sMacroDrawPath = MacroDrawPath
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
@@ -0,0 +1,120 @@
|
||||
<EgtWPFLib5:EgtCustomWindow x:Class="NewAddFeatureWndV"
|
||||
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"
|
||||
WindowStyle="None" ResizeMode="NoResize"
|
||||
SizeToContent="WidthAndHeight"
|
||||
WindowStartupLocation="CenterOwner"
|
||||
IsClosable="False"
|
||||
IsMinimizable="False"
|
||||
IsResizable="False"
|
||||
Title="AddProcess"
|
||||
Style="{StaticResource OnlyProd_EgtCustomWindow}">
|
||||
|
||||
<Grid Margin="5">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
<Border Background="{StaticResource BeamWall_Kashmir}" Margin="0,2,0,2" CornerRadius="4,0,0,4">
|
||||
<TextBlock Text="{Binding Process_Msg}"
|
||||
Style="{StaticResource ListTextBlock}"/>
|
||||
</Border>
|
||||
<Border Grid.Row="1"
|
||||
Style="{StaticResource OnlyProdPage_Border}"
|
||||
CornerRadius="4,0,0,4"
|
||||
BorderThickness="2,2,0,2">
|
||||
<ListBox Grid.Row="1"
|
||||
ItemsSource="{Binding PRCListView}"
|
||||
SelectedItem="{Binding nSelPRC}"
|
||||
Style="{StaticResource NewAddFeature_ListBox}"
|
||||
ItemContainerStyle="{StaticResource AlternationIndex_ListBoxItem}">
|
||||
<ListBox.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding ghDesc}"
|
||||
ToolTip="{Binding ghDesc}"
|
||||
TextAlignment="Justify"
|
||||
Width="{Binding ActualWidth, RelativeSource={RelativeSource AncestorType={x:Type ListBox}}}"
|
||||
Style="{StaticResource OptionTextBlock}"/>
|
||||
</DataTemplate>
|
||||
</ListBox.ItemTemplate>
|
||||
</ListBox>
|
||||
</Border>
|
||||
<Border Grid.Column="1" Background="{StaticResource BeamWall_Kashmir}" Margin="0,2,0,2">
|
||||
<TextBlock Grid.Column="1"
|
||||
Text="{Binding Custom_Msg}"
|
||||
Style="{StaticResource ListTextBlock}"/>
|
||||
</Border>
|
||||
<Border Grid.Row="1"
|
||||
Grid.Column="1"
|
||||
Style="{StaticResource OnlyProdPage_Border}"
|
||||
CornerRadius="0"
|
||||
BorderThickness="0,2,0,2">
|
||||
<ListBox ItemsSource="{Binding MacroCustomList}"
|
||||
SelectedIndex="{Binding nSelMacroCustom}"
|
||||
Style="{StaticResource MacroCustom_ListBox}">
|
||||
<ListBox.ItemsPanel>
|
||||
<ItemsPanelTemplate>
|
||||
<WrapPanel Style="{StaticResource MacroCustom_WrapPanel}"/>
|
||||
</ItemsPanelTemplate>
|
||||
</ListBox.ItemsPanel>
|
||||
<ListBox.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
</Grid.RowDefinitions>
|
||||
<TextBlock Text="{Binding sMacroName}"
|
||||
Style="{StaticResource Macro_TextBlock}"/>
|
||||
<Image Grid.Row="1"
|
||||
Source="{Binding sMacroDrawPath}"
|
||||
Style="{StaticResource Macro_Image}"/>
|
||||
</Grid>
|
||||
</DataTemplate>
|
||||
</ListBox.ItemTemplate>
|
||||
</ListBox>
|
||||
</Border>
|
||||
<Border Grid.Column="2" Background="{StaticResource BeamWall_Kashmir}" Margin="0,2,0,2" Padding="0,10,0,10" CornerRadius="0,4,4,0">
|
||||
<TextBlock
|
||||
Text="{Binding Default_Msg}"
|
||||
Style="{StaticResource ListTextBlock}"/>
|
||||
</Border>
|
||||
<Border Grid.Row="1"
|
||||
Grid.Column="2"
|
||||
Style="{StaticResource OnlyProdPage_Border}"
|
||||
CornerRadius="0,4,4,0"
|
||||
BorderThickness="0,2,2,2">
|
||||
<ListBox ItemsSource="{Binding MacroDefaultList}"
|
||||
SelectedIndex="{Binding nSelMacroDefault}"
|
||||
Style="{StaticResource MacroDefault_ListBox}"
|
||||
ItemContainerStyle="{StaticResource AlternationIndex_ListBoxItem}">
|
||||
<ListBox.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding sMacroName}"
|
||||
TextAlignment="Justify"
|
||||
Style="{StaticResource MacroDefault_TextBlock}"/>
|
||||
</DataTemplate>
|
||||
</ListBox.ItemTemplate>
|
||||
</ListBox>
|
||||
</Border>
|
||||
<UniformGrid Columns="2"
|
||||
Grid.Row="2"
|
||||
Grid.ColumnSpan="3"
|
||||
Margin="5">
|
||||
<Button Content="{Binding OK_Msg}"
|
||||
Command="{Binding Ok_Command}"
|
||||
IsDefault="True"
|
||||
Style="{StaticResource OnlyProdEgtWPFLib5_InputButton}"/>
|
||||
<Button Content="{Binding Cancel_Msg}"
|
||||
IsCancel="True"
|
||||
Style="{StaticResource OnlyProdEgtWPFLib5_InputButton}"/>
|
||||
</UniformGrid>
|
||||
</Grid>
|
||||
</EgtWPFLib5:EgtCustomWindow>
|
||||
@@ -0,0 +1,17 @@
|
||||
Public Class NewAddFeatureWndV
|
||||
|
||||
Private WithEvents m_AddFeatureWndVM As AddFeatureWndVM
|
||||
|
||||
Sub New(Owner As Window, AddFeatureWndVM As AddFeatureWndVM)
|
||||
' La chiamata è richiesta dalla finestra di progettazione.
|
||||
InitializeComponent()
|
||||
Me.DataContext = AddFeatureWndVM
|
||||
' Aggiungere le eventuali istruzioni di inizializzazione dopo la chiamata a InitializeComponent().
|
||||
m_AddFeatureWndVM = AddFeatureWndVM
|
||||
End Sub
|
||||
|
||||
Private Sub CloseWindow(bDialogResult As Boolean) Handles m_AddFeatureWndVM.m_CloseWindow
|
||||
Me.DialogResult = bDialogResult
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
@@ -0,0 +1,103 @@
|
||||
<EgtWPFLib5:EgtCustomWindow x:Class="AddPartWndV"
|
||||
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:EgtBEAMWALL="clr-namespace:EgtBEAMWALL.Optimizer"
|
||||
Style="{DynamicResource {x:Type EgtWPFLib5:EgtCustomWindow}}"
|
||||
WindowStyle="None" ResizeMode="NoResize"
|
||||
SizeToContent="WidthAndHeight"
|
||||
WindowStartupLocation="CenterOwner"
|
||||
IsClosable="False"
|
||||
IsMinimizable="False"
|
||||
IsResizable="False"
|
||||
Title="AddPartWndV">
|
||||
<Grid Margin="5,5,5,0">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<Grid HorizontalAlignment="Center"
|
||||
Margin="0,0,0,5">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock Text="Name"
|
||||
Style="{StaticResource OptionTextBlock}"/>
|
||||
<EgtWPFLib5:EgtTextBox Text="{Binding sNAM}"
|
||||
Grid.Column="1"
|
||||
Width="200"/>
|
||||
</Grid>
|
||||
<Grid Grid.Row="1"
|
||||
Margin="0,0,0,5">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock Text="Prod Number"
|
||||
Style="{StaticResource OptionTextBlock}"/>
|
||||
<EgtWPFLib5:EgtTextBox Text="{Binding nPDN}"
|
||||
Grid.Column="1"
|
||||
Width="45"/>
|
||||
<TextBlock Text="Count"
|
||||
Grid.Column="2"
|
||||
Style="{StaticResource OptionTextBlock}"/>
|
||||
<EgtWPFLib5:EgtTextBox Text="{Binding sCNT}"
|
||||
Grid.Column="3"
|
||||
Width="45"/>
|
||||
</Grid>
|
||||
<Grid Grid.Row="2"
|
||||
Margin="0,0,0,5">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock Text="W"
|
||||
Style="{StaticResource OptionTextBlock}"/>
|
||||
<EgtWPFLib5:EgtTextBox Text="{Binding sW}"
|
||||
Grid.Column="1"
|
||||
Width="45"/>
|
||||
<TextBlock Text="H"
|
||||
Grid.Column="2"
|
||||
Style="{StaticResource OptionTextBlock}"/>
|
||||
<EgtWPFLib5:EgtTextBox Text="{Binding sH}"
|
||||
Grid.Column="3"
|
||||
Width="45"/>
|
||||
<TextBlock Text="L"
|
||||
Grid.Column="4"
|
||||
Style="{StaticResource OptionTextBlock}"/>
|
||||
<EgtWPFLib5:EgtTextBox Text="{Binding sL}"
|
||||
Grid.Column="5"
|
||||
Width="45"/>
|
||||
</Grid>
|
||||
|
||||
<Grid Grid.Row="3"
|
||||
Margin="0,0,0,5">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Button Content="Ok"
|
||||
Command="{Binding Ok_Command}"
|
||||
IsDefault="True"
|
||||
Grid.Column="1"
|
||||
Style="{StaticResource EgtWPFLib5_InputButton}"/>
|
||||
<Button Content="Cancel"
|
||||
IsCancel="True"
|
||||
Grid.Column="3"
|
||||
Style="{StaticResource EgtWPFLib5_InputButton}"/>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</EgtWPFLib5:EgtCustomWindow>
|
||||
@@ -0,0 +1,18 @@
|
||||
Public Class AddPartWndV
|
||||
|
||||
Private WithEvents m_AddPartWndVM As AddPartWndVM
|
||||
|
||||
Sub New(Owner As Window, AddPartWndVM As AddPartWndVM)
|
||||
MyBase.New(Owner)
|
||||
' This call is required by the designer.
|
||||
InitializeComponent()
|
||||
Me.DataContext = AddPartWndVM
|
||||
' Assegno al riferimento locale al VM il VM preso dal DataContext
|
||||
m_AddPartWndVM = AddPartWndVM
|
||||
End Sub
|
||||
|
||||
Private Sub CloseWindow(bDialogResult As Boolean) Handles m_AddPartWndVM.m_CloseWindow
|
||||
Me.DialogResult = bDialogResult
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
@@ -0,0 +1,176 @@
|
||||
Imports EgtWPFLib5
|
||||
Imports EgtUILib
|
||||
|
||||
Public Class AddPartWndVM
|
||||
Inherits VMBase
|
||||
|
||||
#Region "FIELDS & PROPERTIES"
|
||||
|
||||
Friend Event m_CloseWindow(bDialogResult As Boolean)
|
||||
|
||||
Private m_nPDN As Integer
|
||||
Public Property nPDN As Integer
|
||||
Get
|
||||
Return m_nPDN
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
m_nPDN = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_sNAM As String
|
||||
Public Property sNAM As String
|
||||
Get
|
||||
Return m_sNAM
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_sNAM = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_dL As Double
|
||||
Public ReadOnly Property dL As Double
|
||||
Get
|
||||
Return m_dL
|
||||
End Get
|
||||
End Property
|
||||
Public Property sL As String
|
||||
Get
|
||||
Return LenToString(m_dL, 3)
|
||||
End Get
|
||||
Set(value As String)
|
||||
Dim dTempL As Double
|
||||
If StringToLenAdv(value, dTempL, True) AndAlso dTempL > 0 Then
|
||||
m_dL = dTempL
|
||||
Else
|
||||
NotifyPropertyChanged(NameOf(sL))
|
||||
End If
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_dW As Double
|
||||
Public ReadOnly Property dW As Double
|
||||
Get
|
||||
Return m_dW
|
||||
End Get
|
||||
End Property
|
||||
Public Property sW As String
|
||||
Get
|
||||
Return LenToString(m_dW, 3)
|
||||
End Get
|
||||
Set(value As String)
|
||||
Dim dTempW As Double
|
||||
If StringToLenAdv(value, dTempW, True) AndAlso dTempW > 0 Then
|
||||
EgtDraw()
|
||||
m_dW = dTempW
|
||||
Else
|
||||
NotifyPropertyChanged(NameOf(sW))
|
||||
End If
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_dH As Double
|
||||
Public ReadOnly Property dH As Double
|
||||
Get
|
||||
Return m_dH
|
||||
End Get
|
||||
End Property
|
||||
Public Property sH As String
|
||||
Get
|
||||
Return LenToString(m_dH, 3)
|
||||
End Get
|
||||
Set(value As String)
|
||||
Dim dTempH As Double
|
||||
If StringToLenAdv(value, dTempH, True) AndAlso dTempH > 0 Then
|
||||
EgtDraw()
|
||||
m_dH = dTempH
|
||||
Else
|
||||
NotifyPropertyChanged(NameOf(sH))
|
||||
End If
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_sMAT As String
|
||||
Public Property sMAT As String
|
||||
Get
|
||||
Return m_sMAT
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_sMAT = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_nCNT As Integer
|
||||
Public ReadOnly Property nCNT As Integer
|
||||
Get
|
||||
Return m_nCNT
|
||||
End Get
|
||||
End Property
|
||||
Public Property sCNT As String
|
||||
Get
|
||||
Return m_nCNT
|
||||
End Get
|
||||
Set(value As String)
|
||||
Dim nTempCNT As Integer
|
||||
If Integer.TryParse(value, nTempCNT) AndAlso nTempCNT > 0 Then
|
||||
m_nCNT = nTempCNT
|
||||
Else
|
||||
NotifyPropertyChanged(NameOf(sCNT))
|
||||
End If
|
||||
End Set
|
||||
End Property
|
||||
|
||||
' Definizione comandi
|
||||
Private m_cmdOk As ICommand
|
||||
|
||||
#End Region ' FIELDS & PROPERTIES
|
||||
|
||||
#Region "CONSTRUCTOR"
|
||||
|
||||
Sub New()
|
||||
If Not IsNothing(Map.refProjectVM.BTLStructureVM.BTLPartVMList) Then
|
||||
If Not IsNothing(Map.refProjectVM.BTLStructureVM.SelBTLPart) Then
|
||||
m_dW = Map.refProjectVM.BTLStructureVM.SelBTLPart.dW
|
||||
m_dH = Map.refProjectVM.BTLStructureVM.SelBTLPart.dH
|
||||
m_dL = Map.refProjectVM.BTLStructureVM.SelBTLPart.dL
|
||||
ElseIf Map.refProjectVM.BTLStructureVM.BTLPartVMList.Count > 0 Then
|
||||
m_dW = Map.refProjectVM.BTLStructureVM.BTLPartVMList(0).dW
|
||||
m_dH = Map.refProjectVM.BTLStructureVM.BTLPartVMList(0).dH
|
||||
m_dL = Map.refProjectVM.BTLStructureVM.BTLPartVMList(0).dL
|
||||
End If
|
||||
m_nPDN = Map.refProjectVM.BTLStructureVM.BTLStructureM.NewPDN()
|
||||
End If
|
||||
m_nCNT = 1
|
||||
End Sub
|
||||
|
||||
#End Region ' CONSTRUCTOR
|
||||
|
||||
#Region "COMMANDS"
|
||||
|
||||
#Region "Ok"
|
||||
|
||||
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()
|
||||
'verifico che tutti i campi contengano un valore valido
|
||||
If Not IsNothing(m_dL) AndAlso m_dL > 0 AndAlso
|
||||
Not IsNothing(m_dW) AndAlso m_dW >= 0 AndAlso
|
||||
Not IsNothing(m_dH) AndAlso m_dH >= 0 Then
|
||||
RaiseEvent m_CloseWindow(True)
|
||||
Else
|
||||
MessageBox.Show(EgtMsg(61853), EgtMsg(30007))
|
||||
End If
|
||||
End Sub
|
||||
|
||||
#End Region ' Ok
|
||||
|
||||
#End Region ' COMMANDS
|
||||
|
||||
End Class
|
||||
@@ -0,0 +1,94 @@
|
||||
<EgtWPFLib5:EgtCustomWindow x:Class="OnlyProdAddPartWndV"
|
||||
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"
|
||||
WindowStyle="None" ResizeMode="NoResize"
|
||||
SizeToContent="WidthAndHeight"
|
||||
WindowStartupLocation="CenterOwner"
|
||||
IsClosable="False"
|
||||
IsMinimizable="False"
|
||||
IsResizable="False"
|
||||
Title="AddPartWndV"
|
||||
Style="{StaticResource OnlyProd_EgtCustomWindow}">
|
||||
|
||||
<Grid Margin="5,5,5,0">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<Grid Style="{StaticResource OnlyProdAddPart_Grid}">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock Text="Name"
|
||||
Style="{StaticResource OptionTextBlock}"/>
|
||||
<EgtWPFLib5:EgtTextBox Grid.Column="1"
|
||||
Text="{Binding sNAM}"
|
||||
Style="{StaticResource NAM_TextBox}"/>
|
||||
</Grid>
|
||||
<Grid Grid.Row="1"
|
||||
Margin="0,0,0,5">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock Text="Prod Number"
|
||||
Style="{StaticResource OptionTextBlock}"/>
|
||||
<EgtWPFLib5:EgtTextBox Grid.Column="1"
|
||||
Text="{Binding nPDN}"
|
||||
Style="{StaticResource Dimension_TextBox}"/>
|
||||
<TextBlock Grid.Column="2"
|
||||
Text="Count"
|
||||
Style="{StaticResource OptionTextBlock}"/>
|
||||
<EgtWPFLib5:EgtTextBox Grid.Column="3"
|
||||
Text="{Binding sCNT}"
|
||||
Style="{StaticResource Dimension_TextBox}"/>
|
||||
</Grid>
|
||||
<Grid Grid.Row="2"
|
||||
Margin="0,0,0,5">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock Text="W"
|
||||
Style="{StaticResource OptionTextBlock}"/>
|
||||
<EgtWPFLib5:EgtTextBox Grid.Column="1"
|
||||
Text="{Binding sW}"
|
||||
Style="{StaticResource Dimension_TextBox}"/>
|
||||
<TextBlock Grid.Column="2"
|
||||
Text="H"
|
||||
Style="{StaticResource OptionTextBlock}"/>
|
||||
<EgtWPFLib5:EgtTextBox Grid.Column="3"
|
||||
Text="{Binding sH}"
|
||||
Style="{StaticResource Dimension_TextBox}"/>
|
||||
<TextBlock Grid.Column="4"
|
||||
Text="L"
|
||||
Style="{StaticResource OptionTextBlock}"/>
|
||||
<EgtWPFLib5:EgtTextBox Grid.Column="5"
|
||||
Text="{Binding sL}"
|
||||
Style="{StaticResource Dimension_TextBox}"/>
|
||||
</Grid>
|
||||
|
||||
<UniformGrid Grid.Row="3"
|
||||
Columns="2"
|
||||
Margin="0,5,0,5">
|
||||
<Button Content="Ok"
|
||||
Command="{Binding Ok_Command}"
|
||||
IsDefault="True"
|
||||
Style="{StaticResource OnlyProdEgtWPFLib5_InputButton}"/>
|
||||
<Button Content="Cancel"
|
||||
IsCancel="True"
|
||||
Style="{StaticResource OnlyProdEgtWPFLib5_InputButton}"/>
|
||||
</UniformGrid>
|
||||
</Grid>
|
||||
</EgtWPFLib5:EgtCustomWindow>
|
||||
@@ -0,0 +1,18 @@
|
||||
Public Class OnlyProdAddPartWndV
|
||||
|
||||
Private WithEvents m_AddPartWndVM As AddPartWndVM
|
||||
|
||||
Sub New(Owner As Window, AddPartWndVM As AddPartWndVM)
|
||||
MyBase.New(Owner)
|
||||
' This call is required by the designer.
|
||||
InitializeComponent()
|
||||
Me.DataContext = AddPartWndVM
|
||||
' Assegno al riferimento locale al VM il VM preso dal DataContext
|
||||
m_AddPartWndVM = AddPartWndVM
|
||||
End Sub
|
||||
|
||||
Private Sub CloseWindow(bDialogResult As Boolean) Handles m_AddPartWndVM.m_CloseWindow
|
||||
Me.DialogResult = bDialogResult
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
@@ -0,0 +1,64 @@
|
||||
<EgtWPFLib5:EgtCustomWindow x:Class="AddRawPartWndV"
|
||||
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:EgtBEAMWALL="clr-namespace:EgtBEAMWALL.Optimizer"
|
||||
Style="{DynamicResource {x:Type EgtWPFLib5:EgtCustomWindow}}"
|
||||
WindowStyle="None" ResizeMode="NoResize"
|
||||
SizeToContent="WidthAndHeight"
|
||||
WindowStartupLocation="CenterOwner"
|
||||
IsClosable="False"
|
||||
IsMinimizable="False"
|
||||
IsResizable="False"
|
||||
Title="AddRawPartWnd">
|
||||
<Grid Margin="5,5,5,0">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
<ComboBox ItemsSource="{Binding DimensionsList}"
|
||||
SelectedItem="{Binding SelDimension}"
|
||||
DisplayMemberPath="sDimension"
|
||||
Visibility="{Binding DimensionsList_Visibility}"
|
||||
Margin="0,0,0,5"/>
|
||||
<ItemsControl ItemsSource="{Binding VariableList}"
|
||||
Grid.Row="1">
|
||||
<ItemsControl.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<Grid Margin="0,0,0,5">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<TextBlock Text="{Binding sMsg}"
|
||||
Style="{StaticResource OptionTextBlock}"/>
|
||||
<EgtWPFLib5:EgtTextBox Text="{Binding sValue}"
|
||||
Grid.Column="1"
|
||||
Width="65"/>
|
||||
</Grid>
|
||||
</DataTemplate>
|
||||
</ItemsControl.ItemTemplate>
|
||||
</ItemsControl>
|
||||
<Grid Grid.Row="2"
|
||||
Margin="0,0,0,5">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Button Content="Ok"
|
||||
Command="{Binding Ok_Command}"
|
||||
IsDefault="True"
|
||||
Grid.Column="1"
|
||||
Style="{StaticResource EgtWPFLib5_InputButton}"/>
|
||||
<Button Content="Cancel"
|
||||
IsCancel="True"
|
||||
Grid.Column="3"
|
||||
Style="{StaticResource EgtWPFLib5_InputButton}"/>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</EgtWPFLib5:EgtCustomWindow>
|
||||
@@ -0,0 +1,18 @@
|
||||
Public Class AddRawPartWndV
|
||||
|
||||
Private WithEvents m_AddRawPartWndVM As AddRawPartWndVM
|
||||
|
||||
Sub New(Owner As Window, AddRawPartWndVM As AddRawPartWndVM)
|
||||
MyBase.New(Owner)
|
||||
' This call is required by the designer.
|
||||
InitializeComponent()
|
||||
Me.DataContext = AddRawPartWndVM
|
||||
' Assegno al riferimento locale al VM il VM preso dal DataContext
|
||||
m_AddRawPartWndVM = AddRawPartWndVM
|
||||
End Sub
|
||||
|
||||
Private Sub CloseWindow(bDialogResult As Boolean) Handles m_AddRawPartWndVM.m_CloseWindow
|
||||
Me.DialogResult = bDialogResult
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
@@ -0,0 +1,256 @@
|
||||
Imports System.Collections.ObjectModel
|
||||
Imports EgtWPFLib5
|
||||
Imports EgtUILib
|
||||
Imports EgtBEAMWALL.Core
|
||||
|
||||
Public Class AddRawPartWndVM
|
||||
Inherits VMBase
|
||||
|
||||
#Region "FIELDS & PROPERTIES"
|
||||
|
||||
Public Enum EditTypes As Integer
|
||||
ONLY_TEXT = 1
|
||||
ONLY_COMBO = 2
|
||||
TEXT_AND_COMBO = 3
|
||||
End Enum
|
||||
|
||||
Friend Event m_CloseWindow(bDialogResult As Boolean)
|
||||
|
||||
' flag che indica se trave o parete
|
||||
Private m_nProjectType As BWType = BWType.BEAM
|
||||
Private m_EditType As EditTypes = EditTypes.ONLY_TEXT
|
||||
|
||||
' lista delle variabili da mostrare
|
||||
Private m_VariableList_View As CollectionView = Nothing
|
||||
Private m_VariableList As ObservableCollection(Of Variable)
|
||||
Public ReadOnly Property VariableList As ObservableCollection(Of Variable)
|
||||
Get
|
||||
Return m_VariableList
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_DimensionsList As List(Of SParam)
|
||||
Public Property DimensionsList As List(Of SParam)
|
||||
Get
|
||||
Return m_DimensionsList
|
||||
End Get
|
||||
Set(value As List(Of SParam))
|
||||
m_DimensionsList = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_SelDimension As SParam
|
||||
Public Property SelDimension As SParam
|
||||
Get
|
||||
Return m_SelDimension
|
||||
End Get
|
||||
Set(value As SParam)
|
||||
m_SelDimension = value
|
||||
If m_EditType = EditTypes.ONLY_COMBO OrElse m_EditType = EditTypes.TEXT_AND_COMBO Then
|
||||
' aggiorno textbox
|
||||
Select Case m_nProjectType
|
||||
Case BWType.BEAM
|
||||
m_VariableList(0).SetValue(value.dL)
|
||||
Case BWType.WALL
|
||||
m_VariableList(0).SetValue(value.dW)
|
||||
m_VariableList(1).SetValue(value.dL)
|
||||
End Select
|
||||
End If
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_DimensionsList_Visibility As Visibility
|
||||
Public ReadOnly Property DimensionsList_Visibility As Visibility
|
||||
Get
|
||||
Return If(m_EditType = EditTypes.ONLY_COMBO OrElse m_EditType = EditTypes.TEXT_AND_COMBO, Visibility.Visible, Visibility.Collapsed)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
' Definizione comandi
|
||||
Private m_cmdOk As ICommand
|
||||
|
||||
#End Region ' FIELDS & PROPERTIES
|
||||
|
||||
#Region "CONSTRUCTOR"
|
||||
|
||||
Sub New(MachineType As Integer, dL As Double, dW As Double, dPosx As Double)
|
||||
m_nProjectType = MachineType
|
||||
m_EditType = EditTypes.ONLY_TEXT
|
||||
Select Case m_nProjectType
|
||||
Case ConstBeam.MachineType.BEAM
|
||||
m_VariableList = New ObservableCollection(Of Variable)({New Variable(Variable.VariableType.LENGTH, EgtMsg(61935), dL), ' lunghezza
|
||||
New Variable(Variable.VariableType.LENGTH, EgtMsg(61816), dPosx)}) ' ritaglio iniziale
|
||||
Case ConstBeam.MachineType.WALL
|
||||
m_VariableList = New ObservableCollection(Of Variable)({New Variable(Variable.VariableType.LENGTH, EgtMsg(61935), dL), ' lunghezza
|
||||
New Variable(Variable.VariableType.LENGTH, EgtMsg(61936), dW)}) ' larghezza
|
||||
End Select
|
||||
End Sub
|
||||
|
||||
Sub New(EditType As EditTypes, ProjectType As BWType, DimensionsList As List(Of SParam), dL As Double, dW As Double, dPosx As Double, dOffset As Double, dKerf As Double)
|
||||
m_EditType = EditType
|
||||
m_nProjectType = ProjectType
|
||||
Select Case ProjectType
|
||||
Case BWType.BEAM
|
||||
m_VariableList = New ObservableCollection(Of Variable)({New Variable(Variable.VariableType.LENGTH, EgtMsg(61935), dL + dPosx), ' lunghezza + ritaglio iniziale
|
||||
New Variable(Variable.VariableType.LENGTH, EgtMsg(61816), dPosx), ' ritaglio iniziale
|
||||
New Variable(Variable.VariableType.LENGTH, EgtMsg(61937), dOffset)}) ' offset
|
||||
Case BWType.WALL
|
||||
m_VariableList = New ObservableCollection(Of Variable)({New Variable(Variable.VariableType.LENGTH, EgtMsg(61936), dW), ' larghezza
|
||||
New Variable(Variable.VariableType.LENGTH, EgtMsg(61935), dL), ' lunghezza
|
||||
New Variable(Variable.VariableType.LENGTH, EgtMsg(61938), dKerf), ' kerf
|
||||
New Variable(Variable.VariableType.LENGTH, EgtMsg(61937), dOffset)}) ' offset
|
||||
End Select
|
||||
m_DimensionsList = DimensionsList
|
||||
If m_DimensionsList.Count > 0 Then
|
||||
Dim LastMaterial As SParam = WarehouseHelper.GetLastMaterial(DimensionsList(0).SectXMat)
|
||||
If IsNothing(LastMaterial) Then
|
||||
SelDimension = m_DimensionsList(0)
|
||||
Else
|
||||
Dim TempDimension As SParam = m_DimensionsList.FirstOrDefault(Function(x) x.SectXMat = LastMaterial.SectXMat AndAlso x.dL = LastMaterial.dL AndAlso x.dW = LastMaterial.dW AndAlso x.nQuantity = LastMaterial.nQuantity)
|
||||
If Not IsNothing(TempDimension) Then
|
||||
SelDimension = TempDimension
|
||||
Else
|
||||
SelDimension = m_DimensionsList(0)
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
' riduco lista parametri a solo quelli che utilizzati
|
||||
m_VariableList_View = CollectionViewSource.GetDefaultView(m_VariableList)
|
||||
m_VariableList_View.Filter = AddressOf VariableListFilter
|
||||
NotifyPropertyChanged(NameOf(DimensionsList_Visibility))
|
||||
End Sub
|
||||
|
||||
Private Function VariableListFilter(Variable As Object) As Boolean
|
||||
Dim CurrVariable As Variable = DirectCast(Variable, Variable)
|
||||
Dim nVariableIndex As Integer = m_VariableList.IndexOf(Variable)
|
||||
Select Case m_nProjectType
|
||||
Case BWType.BEAM
|
||||
If m_EditType = EditTypes.ONLY_TEXT OrElse m_EditType = EditTypes.TEXT_AND_COMBO Then
|
||||
Return True
|
||||
Else
|
||||
Return nVariableIndex = 1 OrElse nVariableIndex = 2
|
||||
End If
|
||||
Case BWType.WALL
|
||||
If m_EditType = EditTypes.ONLY_TEXT OrElse m_EditType = EditTypes.TEXT_AND_COMBO Then
|
||||
Return True
|
||||
Else
|
||||
Return nVariableIndex = 2 OrElse nVariableIndex = 3
|
||||
End If
|
||||
End Select
|
||||
Return False
|
||||
End Function
|
||||
|
||||
#End Region ' CONSTRUCTOR
|
||||
|
||||
#Region "COMMANDS"
|
||||
|
||||
#Region "Ok"
|
||||
|
||||
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()
|
||||
'verifico che tutti i campi contengano un valore valido
|
||||
For Each Variable In m_VariableList
|
||||
If (Variable.nType = Variable.VariableType.STRING_ AndAlso IsNothing(Variable.sValue)) OrElse
|
||||
((Variable.nType = Variable.VariableType.DOUBLE_ OrElse Variable.nType = Variable.VariableType.LENGTH) AndAlso IsNothing(Variable.dValue)) Then
|
||||
MessageBox.Show(If(m_nProjectType = MachineType.BEAM, EgtMsg(61854), EgtMsg(61855)), EgtMsg(30007))
|
||||
Return
|
||||
End If
|
||||
Next
|
||||
' se non ci sono problemi esco restituendo vero
|
||||
RaiseEvent m_CloseWindow(True)
|
||||
End Sub
|
||||
|
||||
#End Region ' Ok
|
||||
|
||||
#End Region ' COMMANDS
|
||||
|
||||
End Class
|
||||
|
||||
Public Class Variable
|
||||
Inherits VMBase
|
||||
|
||||
Public Enum VariableType As Integer
|
||||
DOUBLE_ = 1
|
||||
STRING_ = 2
|
||||
COMBO = 3
|
||||
LENGTH = 4
|
||||
End Enum
|
||||
|
||||
Private m_nType As VariableType
|
||||
Public ReadOnly Property nType As VariableType
|
||||
Get
|
||||
Return m_nType
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_sMsg As String
|
||||
Public Property sMsg As String
|
||||
Get
|
||||
Return m_sMsg
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_sMsg = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_dValue As Double = 0
|
||||
Friend ReadOnly Property dValue As Double
|
||||
Get
|
||||
Return m_dValue
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_sValue As String = ""
|
||||
Public Property sValue As String
|
||||
Get
|
||||
Select Case m_nType
|
||||
Case VariableType.STRING_
|
||||
Return m_sValue
|
||||
Case VariableType.LENGTH
|
||||
Return LenToString(m_dValue, 3)
|
||||
Case Else ' VariableType.DOUBLE_
|
||||
Return DoubleToString(m_dValue, 3)
|
||||
End Select
|
||||
End Get
|
||||
Set(value As String)
|
||||
Select Case m_nType
|
||||
Case VariableType.STRING_
|
||||
m_sValue = value
|
||||
Case VariableType.LENGTH
|
||||
Dim dTempValue As Double
|
||||
If StringToLenAdv(value, dTempValue, True) Then
|
||||
m_dValue = dTempValue
|
||||
Else
|
||||
NotifyPropertyChanged(NameOf(sValue))
|
||||
End If
|
||||
Case Else ' VariableType.DOUBLE_
|
||||
Dim dTempValue As Double
|
||||
If StringToDoubleAdv(value, dTempValue, True) Then
|
||||
m_dValue = dTempValue
|
||||
Else
|
||||
NotifyPropertyChanged(NameOf(sValue))
|
||||
End If
|
||||
End Select
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Sub New(Type As VariableType, Msg As String, Value As Double)
|
||||
m_nType = Type
|
||||
m_sMsg = Msg
|
||||
m_dValue = Value
|
||||
End Sub
|
||||
|
||||
Friend Sub SetValue(dValue As Double)
|
||||
m_dValue = dValue
|
||||
NotifyPropertyChanged(NameOf(sValue))
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
@@ -0,0 +1,60 @@
|
||||
<EgtWPFLib5:EgtCustomWindow x:Class="OnlyProdAddRawPartWndV"
|
||||
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"
|
||||
WindowStyle="None" ResizeMode="NoResize"
|
||||
SizeToContent="WidthAndHeight"
|
||||
WindowStartupLocation="CenterOwner"
|
||||
IsClosable="False"
|
||||
IsMinimizable="False"
|
||||
IsResizable="False"
|
||||
Title="AddRawPartWnd"
|
||||
Style="{StaticResource OnlyProd_EgtCustomWindow}">
|
||||
<Grid Margin="5,5,5,0">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
<ComboBox ItemsSource="{Binding DimensionsList}"
|
||||
SelectedItem="{Binding SelDimension}"
|
||||
DisplayMemberPath="sDimension"
|
||||
Visibility="{Binding DimensionsList_Visibility}"
|
||||
Margin="0,0,0,5"
|
||||
Style="{StaticResource OnlyProd_ComboBox}"/>
|
||||
<ItemsControl Grid.Row="1"
|
||||
ItemsSource="{Binding VariableList}">
|
||||
<ItemsControl.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<Grid Margin="0,0,0,5">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<TextBlock Text="{Binding sMsg}"
|
||||
Style="{StaticResource OptionTextBlock}"/>
|
||||
<EgtWPFLib5:EgtTextBox Grid.Column="1"
|
||||
Text="{Binding sValue}"
|
||||
Style="{StaticResource Value_TextBox}"/>
|
||||
</Grid>
|
||||
</DataTemplate>
|
||||
</ItemsControl.ItemTemplate>
|
||||
</ItemsControl>
|
||||
<UniformGrid Grid.Row="2"
|
||||
Columns="2"
|
||||
Margin="0,0,0,5">
|
||||
<Button Grid.Column="1"
|
||||
Content="Ok"
|
||||
Command="{Binding Ok_Command}"
|
||||
IsDefault="True"
|
||||
Style="{StaticResource OnlyProdEgtWPFLib5_InputButton}"
|
||||
Margin="0,0,5,0"/>
|
||||
<Button Grid.Column="3"
|
||||
Content="Cancel"
|
||||
IsCancel="True"
|
||||
Style="{StaticResource OnlyProdEgtWPFLib5_InputButton}"/>
|
||||
</UniformGrid>
|
||||
</Grid>
|
||||
|
||||
</EgtWPFLib5:EgtCustomWindow>
|
||||
@@ -0,0 +1,18 @@
|
||||
Public Class OnlyProdAddRawPartWndV
|
||||
|
||||
Private WithEvents m_AddRawPartWndVM As AddRawPartWndVM
|
||||
|
||||
Sub New(Owner As Window, AddRawPartWndVM As AddRawPartWndVM)
|
||||
MyBase.New(Owner)
|
||||
' This call is required by the designer.
|
||||
InitializeComponent()
|
||||
Me.DataContext = AddRawPartWndVM
|
||||
' Assegno al riferimento locale al VM il VM preso dal DataContext
|
||||
m_AddRawPartWndVM = AddRawPartWndVM
|
||||
End Sub
|
||||
|
||||
Private Sub CloseWindow(bDialogResult As Boolean) Handles m_AddRawPartWndVM.m_CloseWindow
|
||||
Me.DialogResult = bDialogResult
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
@@ -0,0 +1,128 @@
|
||||
<EgtWPFLib5:EgtCustomWindow x:Class="AddSectionXMaterialWndV"
|
||||
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:EgtBEAMWALL="clr-namespace:EgtBEAMWALL.Optimizer"
|
||||
xmlns:EgtBEAMWALLCORE="clr-namespace:EgtBEAMWALL.Core;assembly=EgtBEAMWALL.Core"
|
||||
Style="{DynamicResource {x:Type EgtWPFLib5:EgtCustomWindow}}"
|
||||
WindowStyle="None" ResizeMode="NoResize"
|
||||
SizeToContent="WidthAndHeight"
|
||||
WindowStartupLocation="CenterOwner"
|
||||
IsClosable="False"
|
||||
IsMinimizable="False"
|
||||
IsResizable="False"
|
||||
Title="AddSectionXMaterial">
|
||||
<StackPanel Margin="5,5,5,0">
|
||||
|
||||
<EgtBEAMWALLCORE:EgtDataGrid Grid.Row="0" Width="500" MaxHeight="600"
|
||||
ItemsSource="{Binding NewSectionXMaterialList}"
|
||||
SelectedItem="{Binding SelNewSectionXMaterial}"
|
||||
CanUserAddRows="False"
|
||||
AutoGenerateColumns="False"
|
||||
CanUserResizeRows="False"
|
||||
SelectionMode="Single"
|
||||
ScrollViewer.CanContentScroll="False"
|
||||
ScrollViewer.VerticalScrollBarVisibility="Auto"
|
||||
ScrollViewer.HorizontalScrollBarVisibility="Auto"
|
||||
Margin="5"
|
||||
ColumnHeaderBackground="{x:Null}"
|
||||
BindingColumns="{Binding SectXMatColumns}">
|
||||
<DataGrid.Resources>
|
||||
<!-- SectionXMaterial -->
|
||||
<DataGridTextColumn x:Key="colSECTXMAT" Binding="{Binding sSectionXMaterial}">
|
||||
<DataGridTextColumn.HeaderTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding Path=DataContext.SectionXMaterial_Msg,RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:AddSectionXMaterialWndV}}}"/>
|
||||
</DataTemplate>
|
||||
</DataGridTextColumn.HeaderTemplate>
|
||||
</DataGridTextColumn>
|
||||
<!-- Alias -->
|
||||
<DataGridTemplateColumn x:Key="colALIAS">
|
||||
<DataGridTemplateColumn.Header>
|
||||
<TextBlock Text="{Binding Path=DataContext.Alias_Msg,RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:AddSectionXMaterialWndV}}}"/>
|
||||
</DataGridTemplateColumn.Header>
|
||||
<DataGridTemplateColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
<CheckBox IsChecked="{Binding Path=Alias_IsChecked, UpdateSourceTrigger=PropertyChanged}"
|
||||
IsEnabled="{Binding Alias_IsEnabled}"
|
||||
HorizontalAlignment="Center"/>
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
<!-- W -->
|
||||
<DataGridTextColumn x:Key="colW" Binding="{Binding sNewW}">
|
||||
<DataGridTextColumn.HeaderTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding Path=DataContext.W_Msg,RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:AddSectionXMaterialWndV}}}"/>
|
||||
</DataTemplate>
|
||||
</DataGridTextColumn.HeaderTemplate>
|
||||
<DataGridTextColumn.CellStyle>
|
||||
<Style TargetType="DataGridCell">
|
||||
<Setter Property="IsEnabled" Value="{Binding Alias_IsNotChecked}" />
|
||||
</Style>
|
||||
</DataGridTextColumn.CellStyle>
|
||||
</DataGridTextColumn>
|
||||
<!-- L -->
|
||||
<DataGridTextColumn x:Key="colL" Binding="{Binding sNewL}">
|
||||
<DataGridTextColumn.HeaderTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding Path=DataContext.L_Msg,RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:AddSectionXMaterialWndV}}}"/>
|
||||
</DataTemplate>
|
||||
</DataGridTextColumn.HeaderTemplate>
|
||||
<DataGridTextColumn.CellStyle>
|
||||
<Style TargetType="DataGridCell">
|
||||
<Setter Property="IsEnabled" Value="{Binding Alias_IsNotChecked}" />
|
||||
</Style>
|
||||
</DataGridTextColumn.CellStyle>
|
||||
</DataGridTextColumn>
|
||||
<!-- Material -->
|
||||
<DataGridTemplateColumn x:Key="colMATERIAL">
|
||||
<DataGridTemplateColumn.Header>
|
||||
<TextBlock Text="{Binding Path=DataContext.Material_Msg,RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:AddSectionXMaterialWndV}}}"/>
|
||||
</DataGridTemplateColumn.Header>
|
||||
<DataGridTemplateColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
<ComboBox ItemsSource="{Binding MaterialForSameSection_List}"
|
||||
SelectedItem="{Binding SelMaterialForSameSection, UpdateSourceTrigger=PropertyChanged}"
|
||||
IsEnabled="{Binding Alias_IsChecked, UpdateSourceTrigger=PropertyChanged}"/>
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
<!-- Quantity -->
|
||||
<DataGridTextColumn x:Key="colQTY" Binding="{Binding sQuantity}">
|
||||
<DataGridTextColumn.HeaderTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding Path=DataContext.Quantity_Msg,RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:AddSectionXMaterialWndV}}}"/>
|
||||
</DataTemplate>
|
||||
</DataGridTextColumn.HeaderTemplate>
|
||||
<DataGridTextColumn.CellStyle>
|
||||
<Style TargetType="DataGridCell">
|
||||
<Setter Property="IsEnabled" Value="{Binding Alias_IsNotChecked}" />
|
||||
</Style>
|
||||
</DataGridTextColumn.CellStyle>
|
||||
</DataGridTextColumn>
|
||||
</DataGrid.Resources>
|
||||
</EgtBEAMWALLCORE:EgtDataGrid>
|
||||
|
||||
<Grid Grid.Row="2" Margin="0,0,0,5">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Button Content="{Binding Ok_Msg}"
|
||||
Command="{Binding Ok_Command}"
|
||||
IsDefault="True"
|
||||
Grid.Column="1"
|
||||
Style="{StaticResource EgtWPFLib5_InputButton}"/>
|
||||
<Button Content="{Binding Cancel_Msg}"
|
||||
Command="{Binding Cancel_Command}"
|
||||
IsCancel="True"
|
||||
Grid.Column="3"
|
||||
Style="{StaticResource EgtWPFLib5_InputButton}"/>
|
||||
</Grid>
|
||||
|
||||
</StackPanel>
|
||||
</EgtWPFLib5:EgtCustomWindow>
|
||||
@@ -0,0 +1,18 @@
|
||||
Public Class AddSectionXMaterialWndV
|
||||
|
||||
Private WithEvents m_AddSectionXMaterialWndVM As AddSectionXMaterialWndVM
|
||||
|
||||
Sub New(Owner As Window, AddSectionXMaterialWndVM As AddSectionXMaterialWndVM)
|
||||
MyBase.New(Owner)
|
||||
' This call is required by the designer.
|
||||
InitializeComponent()
|
||||
Me.DataContext = AddSectionXMaterialWndVM
|
||||
' Assegno al riferimento locale al VM il VM preso dal DataContext
|
||||
m_AddSectionXMaterialWndVM = AddSectionXMaterialWndVM
|
||||
End Sub
|
||||
|
||||
Private Sub CloseWindow(bDialogResult As Boolean) Handles m_AddSectionXMaterialWndVM.m_CloseWindow
|
||||
Me.DialogResult = bDialogResult
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
@@ -0,0 +1,381 @@
|
||||
Imports System.Collections.ObjectModel
|
||||
Imports EgtUILib
|
||||
Imports EgtWPFLib5
|
||||
Imports EgtBEAMWALL.Core
|
||||
|
||||
Public Class AddSectionXMaterialWndVM
|
||||
Inherits VMBase
|
||||
|
||||
#Region "FIELDS & PROPERTIES"
|
||||
|
||||
Friend Event m_CloseWindow(bDialogResult As Boolean)
|
||||
|
||||
Protected m_SectXMatColumns As New ObservableCollection(Of EgtDataGridColumn)
|
||||
Public Property SectXMatColumns As ObservableCollection(Of EgtDataGridColumn)
|
||||
Get
|
||||
Return m_SectXMatColumns
|
||||
End Get
|
||||
Set(value As ObservableCollection(Of EgtDataGridColumn))
|
||||
m_SectXMatColumns = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
' Lista dei nuovi SectionXMaterial in BTLSTructure non presenti in Warehouse
|
||||
Private m_NewSectionXMaterialList As New ObservableCollection(Of SectionXMaterialToBeAdded)
|
||||
Public Property NewSectionXMaterialList As ObservableCollection(Of SectionXMaterialToBeAdded)
|
||||
Get
|
||||
Return m_NewSectionXMaterialList
|
||||
End Get
|
||||
Set(value As ObservableCollection(Of SectionXMaterialToBeAdded))
|
||||
m_NewSectionXMaterialList = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
' Lista dei SectionXMaterial presenti in Warehouse
|
||||
Private m_WhSectXMatList As New List(Of SectionXMaterial)
|
||||
Public Property WhSectXMatList As List(Of SectionXMaterial)
|
||||
Get
|
||||
Return m_WhSectXMatList
|
||||
End Get
|
||||
Set(value As List(Of SectionXMaterial))
|
||||
m_WhSectXMatList = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
' SectionXMaterial correntemente selezionato nella Datagrid
|
||||
Private m_SelNewSectionXMaterial As SectionXMaterialToBeAdded
|
||||
Public Property SelNewSectionXMaterial As SectionXMaterialToBeAdded
|
||||
Get
|
||||
Return m_SelNewSectionXMaterial
|
||||
End Get
|
||||
Set(value As SectionXMaterialToBeAdded)
|
||||
m_SelNewSectionXMaterial = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
' Definizione comandi
|
||||
Private m_cmdOk As ICommand
|
||||
Private m_cmdCancel As ICommand
|
||||
|
||||
#End Region ' FIELDS & PROPERTIES
|
||||
|
||||
#Region "MESSAGES"
|
||||
|
||||
Public ReadOnly Property SectionXMaterial_Msg As String
|
||||
Get
|
||||
Return EgtMsg(61771)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property Alias_Msg As String
|
||||
Get
|
||||
Return EgtMsg(61772)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property L_Msg As String
|
||||
Get
|
||||
Return EgtMsg(61604)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property W_Msg As String
|
||||
Get
|
||||
Return EgtMsg(61605)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property Material_Msg As String
|
||||
Get
|
||||
Return EgtMsg(61607)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property Quantity_Msg As String
|
||||
Get
|
||||
Return EgtMsg(61774)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property Ok_Msg As String
|
||||
Get
|
||||
Return EgtMsg(61761)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property Cancel_Msg As String
|
||||
Get
|
||||
Return EgtMsg(61763)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property Error_Msg As String
|
||||
Get
|
||||
Return EgtMsg(61764)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property IncorrectValues_Msg As String
|
||||
Get
|
||||
Return EgtMsg(61768)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
#End Region ' MESSAGES
|
||||
|
||||
#Region "CONSTRUCTOR"
|
||||
|
||||
Sub New(SectXMatList As List(Of SectionXMaterialToBeAdded))
|
||||
' Aggiungo riferimento a Map
|
||||
Map.SetRefAddSectionXMaterialWndVM(Me)
|
||||
' carico le colonne della datagrid
|
||||
LoadColumns(Map.refProjectVM.BTLStructureVM.nPROJTYPE)
|
||||
NewSectionXMaterialList = New ObservableCollection(Of SectionXMaterialToBeAdded)(SectXMatList)
|
||||
WhSectXMatList = WarehouseWndVM.GetSectionXMaterialsFromWarehouse()
|
||||
' Prendo i SectionXMaterial appena messi nella Lista di questa finestra e li confronto con ciascuno di quelli presenti in Warehouse.
|
||||
' Se le sezioni sono uguali carico i materiali relativi alla medesima sezione.
|
||||
' Se i materiali di quella medesima sezione non ci sono disabilito la CheckBox Alias.
|
||||
For Each NewSectXMatItem In NewSectionXMaterialList
|
||||
NewSectXMatItem.Alias_IsChecked = False
|
||||
For Each SectionListItem In WhSectXMatList
|
||||
If Map.refProjectVM.BTLStructureVM.nPROJTYPE = MachineType.BEAM Then
|
||||
If NewSectXMatItem.dW = SectionListItem.dW AndAlso NewSectXMatItem.dH = SectionListItem.dH Then
|
||||
' Se le sezioni sono uguali allora indago sui materiali
|
||||
For Index As Integer = 0 To SectionListItem.sMaterial.Count - 1
|
||||
If Not NewSectXMatItem.MaterialForSameSection_List.Contains(SectionListItem.sMaterial(Index)) And
|
||||
Not NewSectXMatItem.sMaterial.Contains(SectionListItem.sMaterial(Index)) Then
|
||||
NewSectXMatItem.MaterialForSameSection_List.Add(SectionListItem.sMaterial(Index))
|
||||
End If
|
||||
If NewSectXMatItem.MaterialForSameSection_List.Count > 0 Then
|
||||
NewSectXMatItem.Alias_IsEnabled = True
|
||||
End If
|
||||
Next
|
||||
End If
|
||||
ElseIf Map.refProjectVM.BTLStructureVM.nPROJTYPE = MachineType.WALL Then
|
||||
If NewSectXMatItem.dH = SectionListItem.dH Then
|
||||
' Se le sezioni sono uguali allora indago sui materiali
|
||||
For Index As Integer = 0 To SectionListItem.sMaterial.Count - 1
|
||||
If Not NewSectXMatItem.MaterialForSameSection_List.Contains(SectionListItem.sMaterial(Index)) And
|
||||
Not NewSectXMatItem.sMaterial.Contains(SectionListItem.sMaterial(Index)) Then
|
||||
NewSectXMatItem.MaterialForSameSection_List.Add(SectionListItem.sMaterial(Index))
|
||||
End If
|
||||
If NewSectXMatItem.MaterialForSameSection_List.Count > 0 Then
|
||||
NewSectXMatItem.Alias_IsEnabled = True
|
||||
End If
|
||||
Next
|
||||
End If
|
||||
End If
|
||||
Next
|
||||
Next
|
||||
End Sub
|
||||
|
||||
#End Region ' CONSTRUCTOR
|
||||
|
||||
#Region "COMMANDS"
|
||||
|
||||
#Region "Ok"
|
||||
|
||||
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()
|
||||
' Se i valori non sono corretti segnalo l'errore e impedisco il salvataggio
|
||||
For Index As Integer = 0 To NewSectionXMaterialList.Count - 1
|
||||
If Map.refProjectVM.BTLStructureVM.nPROJTYPE = MachineType.BEAM AndAlso
|
||||
(Not NewSectionXMaterialList(Index).Alias_IsChecked And NewSectionXMaterialList(Index).dNewL < 0) OrElse
|
||||
(NewSectionXMaterialList(Index).Alias_IsChecked And IsNothing(NewSectionXMaterialList(Index).SelMaterialForSameSection)) OrElse
|
||||
(Not NewSectionXMaterialList(Index).Alias_IsChecked And (NewSectionXMaterialList(Index).nQuantity < 0 Or NewSectionXMaterialList(Index).nQuantity > 99)) Then
|
||||
MessageBox.Show(IncorrectValues_Msg, Error_Msg)
|
||||
Return
|
||||
End If
|
||||
If Map.refProjectVM.BTLStructureVM.nPROJTYPE = MachineType.WALL AndAlso
|
||||
(Not NewSectionXMaterialList(Index).Alias_IsChecked And (NewSectionXMaterialList(Index).dNewW < 0 Or NewSectionXMaterialList(Index).dNewL < 0)) OrElse
|
||||
(NewSectionXMaterialList(Index).Alias_IsChecked And IsNothing(NewSectionXMaterialList(Index).SelMaterialForSameSection)) OrElse
|
||||
(Not NewSectionXMaterialList(Index).Alias_IsChecked And (NewSectionXMaterialList(Index).nQuantity < 0 Or NewSectionXMaterialList(Index).nQuantity > 99)) Then
|
||||
MessageBox.Show(IncorrectValues_Msg, Error_Msg)
|
||||
Return
|
||||
End If
|
||||
Next
|
||||
' Se i valori sono corretti salvo
|
||||
Save()
|
||||
End Sub
|
||||
|
||||
#End Region ' Ok
|
||||
|
||||
#Region "Cancel"
|
||||
|
||||
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()
|
||||
' Resetto i valori prima di salvarli
|
||||
For Index As Integer = 0 To NewSectionXMaterialList.Count - 1
|
||||
NewSectionXMaterialList(Index).Alias_IsChecked = False
|
||||
NewSectionXMaterialList(Index).dNewL = 0
|
||||
NewSectionXMaterialList(Index).nQuantity = 0
|
||||
If Map.refProjectVM.BTLStructureVM.nPROJTYPE = MachineType.WALL Then NewSectionXMaterialList(Index).dNewW = 0
|
||||
Next
|
||||
Save()
|
||||
End Sub
|
||||
|
||||
#End Region ' Cancel
|
||||
|
||||
#End Region ' CONSTRUCTOR
|
||||
|
||||
#Region "METHODS"
|
||||
|
||||
#Region "LoadColumns"
|
||||
|
||||
Protected Sub LoadColumns(ProjectType As BWType)
|
||||
If ProjectType = BWType.BEAM Then
|
||||
' carico le colonne della datagrid
|
||||
GetPrivateProfileColumns(S_SECTXMATLIST_BEAM, SectXMatColumns)
|
||||
ElseIf ProjectType = BWType.WALL Then
|
||||
' carico le colonne della datagrid
|
||||
GetPrivateProfileColumns(S_SECTXMATLIST_WALL, SectXMatColumns)
|
||||
End If
|
||||
' aggiorno la visibilità delle colonne
|
||||
For Each col In SectXMatColumns
|
||||
col.ColumnVisibility = If(col.Visible, Visibility.Visible, Visibility.Collapsed)
|
||||
Next
|
||||
End Sub
|
||||
|
||||
#End Region ' LoadColumns
|
||||
|
||||
#Region "Save"
|
||||
|
||||
Public Sub Save()
|
||||
|
||||
' Indice per scansionare NewSectionXMaterialList
|
||||
Dim Index = 0
|
||||
' Indice da incrementare in modo da scrivere i nuovi parametri L/S a partire dal giusto numero
|
||||
Dim ParamIndex = 1
|
||||
' Indice da incrementare in modo da scrivere i nuovi SectionXMaterial a partire dal giusto numero
|
||||
Dim SxMParamIndex = 1
|
||||
|
||||
Dim sWarehousePath As String = Map.refMainWindowVM.MainWindowM.sWarehouseDir & "\" & WH_MEDIUM_INI_FILE_NAME
|
||||
|
||||
If Map.refProjectVM.BTLStructureVM.nPROJTYPE = MachineType.BEAM Then
|
||||
|
||||
' Ciclo sui parametri L esistenti nell'INI in modo da avere l'indice di partenza per gli ulteriori parametri da scrivere
|
||||
Dim sValue As String = String.Empty
|
||||
While EgtUILib.GetPrivateProfileString(S_BEAM, "L" & ParamIndex, String.Empty, sValue, sWarehousePath)
|
||||
ParamIndex += 1
|
||||
End While
|
||||
' Ciclo sui SectionXMaterial BEAM esistenti nell'INI in modo da avere l'indice di partenza per gli ulteriori parametri da scrivere
|
||||
While EgtUILib.GetPrivateProfileString(S_BEAM_LIST, SxMParamIndex, String.Empty, sValue, sWarehousePath)
|
||||
SxMParamIndex += 1
|
||||
End While
|
||||
|
||||
' Se i valori sono tutti >= 0 li scrivo nel file INI
|
||||
Index = 0
|
||||
For Each NewSxMItem In NewSectionXMaterialList
|
||||
Dim sAlias As String = String.Empty
|
||||
For Each Mat In NewSectionXMaterialList(Index).sMaterial
|
||||
sAlias &= Mat & ";"
|
||||
Next
|
||||
sAlias = sAlias.TrimEnd(";")
|
||||
' Se Alias è checkato aggiungo l'Alias scelto dalla ComboBox alla stringa e setto NewL e Quantity a 0 e aggiorno il SectionXmaterial in BeamList
|
||||
If NewSxMItem.Alias_IsChecked Then
|
||||
sAlias &= ";" & NewSxMItem.SelMaterialForSameSection
|
||||
NewSectionXMaterialList(Index).dNewL = 0
|
||||
NewSectionXMaterialList(Index).nQuantity = 0
|
||||
' Ricavo l'indice del SectionXMaterial da aggiornare
|
||||
Dim UpdateSxMIndex = 1
|
||||
For Each WhSectXMat In WhSectXMatList
|
||||
If WhSectXMat.dW = NewSxMItem.dW AndAlso WhSectXMat.dH = NewSxMItem.dH Then
|
||||
Exit For
|
||||
End If
|
||||
UpdateSxMIndex += 1
|
||||
Next
|
||||
' Aggiorno il SectionXMaterial
|
||||
WritePrivateProfileString(S_BEAM_LIST, UpdateSxMIndex, LenToString(NewSectionXMaterialList(Index).dW, 3) & "," &
|
||||
LenToString(NewSectionXMaterialList(Index).dH, 3) & "," &
|
||||
sAlias, sWarehousePath)
|
||||
Else
|
||||
' Altrimenti aggiungo il nuovo SectionXMaterial e il parametro
|
||||
WritePrivateProfileString(S_BEAM_LIST, SxMParamIndex, LenToString(NewSectionXMaterialList(Index).dW, 3) & "," &
|
||||
LenToString(NewSectionXMaterialList(Index).dH, 3) & "," &
|
||||
sAlias, sWarehousePath)
|
||||
WritePrivateProfileString(S_BEAM, K_L & ParamIndex, SxMParamIndex & "," &
|
||||
LenToString(NewSectionXMaterialList(Index).dNewL, 3) & "," &
|
||||
NewSectionXMaterialList(Index).nQuantity, sWarehousePath)
|
||||
ParamIndex += 1
|
||||
SxMParamIndex += 1
|
||||
End If
|
||||
|
||||
Index += 1
|
||||
Next
|
||||
ElseIf Map.refProjectVM.BTLStructureVM.nPROJTYPE = MachineType.WALL Then
|
||||
|
||||
' Ciclo sui parametri S esistenti nell'INI in modo da avere l'indice di partenza per gli ulteriori parametri da scrivere
|
||||
Dim sValue As String = String.Empty
|
||||
While EgtUILib.GetPrivateProfileString(S_WALL, "S" & ParamIndex, String.Empty, sValue, sWarehousePath)
|
||||
ParamIndex += 1
|
||||
End While
|
||||
' Ciclo sui SectionXMaterial WALL esistenti nell'INI in modo da avere l'indice di partenza per gli ulteriori parametri da scrivere
|
||||
While EgtUILib.GetPrivateProfileString(S_WALL_LIST, SxMParamIndex, String.Empty, sValue, sWarehousePath)
|
||||
SxMParamIndex += 1
|
||||
End While
|
||||
|
||||
' Se i valori sono tutti > 0 li scrivo nel file INI
|
||||
Index = 0
|
||||
For Each NewSxMItem In NewSectionXMaterialList
|
||||
Dim sAlias As String = String.Empty
|
||||
For Each Mat In NewSectionXMaterialList(Index).sMaterial
|
||||
sAlias &= Mat & ";"
|
||||
Next
|
||||
sAlias = sAlias.TrimEnd(";")
|
||||
' Se Alias è checkato aggiungo l'Alias scelto dalla ComboBox alla stringa
|
||||
If NewSxMItem.Alias_IsChecked Then
|
||||
sAlias &= ";" & NewSxMItem.SelMaterialForSameSection
|
||||
NewSectionXMaterialList(Index).dNewW = 0
|
||||
NewSectionXMaterialList(Index).dNewL = 0
|
||||
NewSectionXMaterialList(Index).nQuantity = 0
|
||||
' Ricavo l'indice del SectionXMaterial da aggiornare
|
||||
Dim UpdateSxMIndex = 1
|
||||
For Each WhSectXMat In WhSectXMatList
|
||||
If WhSectXMat.dH = NewSxMItem.dH Then
|
||||
Exit For
|
||||
End If
|
||||
UpdateSxMIndex += 1
|
||||
Next
|
||||
' Aggiorno il SectionXMaterial
|
||||
WritePrivateProfileString(S_WALL_LIST, UpdateSxMIndex, LenToString(NewSectionXMaterialList(Index).dH, 3) & "," &
|
||||
sAlias, sWarehousePath)
|
||||
Else
|
||||
' Altrimenti aggiungo il nuovo SectionXMaterial e il parametro
|
||||
WritePrivateProfileString(S_WALL_LIST, SxMParamIndex, LenToString(NewSectionXMaterialList(Index).dH, 3) & "," &
|
||||
sAlias, sWarehousePath)
|
||||
WritePrivateProfileString(S_WALL, K_S & ParamIndex, SxMParamIndex & "," &
|
||||
LenToString(NewSectionXMaterialList(Index).dNewW, 3) & "," &
|
||||
LenToString(NewSectionXMaterialList(Index).dNewL, 3) & "," &
|
||||
NewSectionXMaterialList(Index).nQuantity, sWarehousePath)
|
||||
ParamIndex += 1
|
||||
SxMParamIndex += 1
|
||||
End If
|
||||
|
||||
Index += 1
|
||||
Next
|
||||
End If
|
||||
|
||||
RaiseEvent m_CloseWindow(True)
|
||||
End Sub
|
||||
|
||||
#End Region ' Save
|
||||
|
||||
#End Region ' METHODS
|
||||
|
||||
End Class
|
||||
@@ -0,0 +1,47 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<configuration>
|
||||
<configSections>
|
||||
|
||||
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
|
||||
</configSections>
|
||||
<startup>
|
||||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
|
||||
</startup>
|
||||
<entityFramework>
|
||||
<providers>
|
||||
<provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
|
||||
</providers>
|
||||
</entityFramework>
|
||||
<runtime>
|
||||
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Memory" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.1.2" newVersion="4.0.1.2" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="Google.Protobuf" publicKeyToken="a7d26565bac4d604" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-3.21.9.0" newVersion="3.21.9.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="K4os.Compression.LZ4.Streams" publicKeyToken="2186fa9121ef231d" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-1.3.5.0" newVersion="1.3.5.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="BouncyCastle.Crypto" publicKeyToken="0e99375e54769942" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-1.9.0.0" newVersion="1.9.0.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.IO.Pipelines" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Numerics.Vectors" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.1.4.0" newVersion="4.1.4.0" />
|
||||
</dependentAssembly>
|
||||
</assemblyBinding>
|
||||
</runtime>
|
||||
</configuration>
|
||||
@@ -0,0 +1,9 @@
|
||||
<Application x:Class="Application"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
|
||||
<Application.Resources>
|
||||
<ResourceDictionary Source="Utility/Dictionary.xaml"/>
|
||||
</Application.Resources>
|
||||
|
||||
</Application>
|
||||
@@ -0,0 +1,14 @@
|
||||
Class Application
|
||||
|
||||
' Application-level events, such as Startup, Exit, and DispatcherUnhandledException
|
||||
' can be handled in this file.
|
||||
Protected Overrides Sub OnStartup(e As StartupEventArgs)
|
||||
MyBase.OnStartup(e)
|
||||
ShutdownMode = System.Windows.ShutdownMode.OnMainWindowClose
|
||||
' Creo la View principale
|
||||
Me.MainWindow = New OnlyProdMainWindowV
|
||||
' Mostro la View principale
|
||||
Me.MainWindow.Show()
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
@@ -0,0 +1,169 @@
|
||||
<EgtWPFLib5:EgtCustomWindow x:Class="BTLDataWndV"
|
||||
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:EgtBEAMWALL="clr-namespace:EgtBEAMWALL.Optimizer"
|
||||
WindowStyle="None" ResizeMode="NoResize"
|
||||
SizeToContent="WidthAndHeight"
|
||||
WindowStartupLocation="CenterOwner"
|
||||
IsClosable="True"
|
||||
IsMinimizable="False"
|
||||
IsResizable="False"
|
||||
Title="BTLDataWndV"
|
||||
Name="BTLDataWndV"
|
||||
Style="{StaticResource OnlyProd_EgtCustomWindow}">
|
||||
|
||||
<TabControl>
|
||||
<TabItem Header="Strategy">
|
||||
<ComboBox ItemsSource="{Binding StrategySetupList}"
|
||||
SelectedItem="{Binding SelStrategySetup}"
|
||||
Style="{StaticResource Strategy_ComboBox}"/>
|
||||
</TabItem>
|
||||
<TabItem Header="BTL">
|
||||
|
||||
<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>
|
||||
@@ -0,0 +1,19 @@
|
||||
Public Class BTLDataWndV
|
||||
|
||||
Private WithEvents m_BTLDataWndVM As BTLDataWndVM
|
||||
|
||||
Sub New(Owner As Window, BTLDataWndVM As BTLDataWndVM)
|
||||
MyBase.New(Owner)
|
||||
' This call is required by the designer.
|
||||
InitializeComponent()
|
||||
Me.DataContext = BTLDataWndVM
|
||||
Me.Tag = Map.refProjectVM.BTLStructureVM
|
||||
' Assegno al riferimento locale al VM il VM preso dal DataContext
|
||||
m_BTLDataWndVM = BTLDataWndVM
|
||||
End Sub
|
||||
|
||||
Private Sub CloseWindow(bDialogResult As Boolean) Handles m_BTLDataWndVM.m_CloseWindow
|
||||
Me.DialogResult = bDialogResult
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
@@ -0,0 +1,229 @@
|
||||
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
|
||||
Get
|
||||
Return EgtMsg(61692)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property PROJNAME_MSG As String
|
||||
Get
|
||||
Return EgtMsg(61693)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property PROJPART_MSG As String
|
||||
Get
|
||||
Return EgtMsg(61694)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property PROJGUID_MSG As String
|
||||
Get
|
||||
Return EgtMsg(61695)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property LISTNAME_MSG As String
|
||||
Get
|
||||
Return EgtMsg(61696)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property CUSTOMER_MSG As String
|
||||
Get
|
||||
Return EgtMsg(61697)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property ARCHITECT_MSG As String
|
||||
Get
|
||||
Return EgtMsg(61698)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property EDITOR_MSG As String
|
||||
Get
|
||||
Return EgtMsg(61699)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property DELIVDATE_MSG As String
|
||||
Get
|
||||
Return EgtMsg(61700)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property EXPDATE_MSG As String
|
||||
Get
|
||||
Return EgtMsg(61701)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property EXPTIME_MSG As String
|
||||
Get
|
||||
Return EgtMsg(61702)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property EXPRELEASE_MSG As String
|
||||
Get
|
||||
Return EgtMsg(61703)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property LANGUAGE_MSG As String
|
||||
Get
|
||||
Return EgtMsg(61704)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property RANGE_MSG As String
|
||||
Get
|
||||
Return EgtMsg(61705)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property PROCESSINGQUALITY_MSG As String
|
||||
Get
|
||||
Return EgtMsg(61642)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property COMPUTERNAME_MSG As String
|
||||
Get
|
||||
Return EgtMsg(61706)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property USER_MSG As String
|
||||
Get
|
||||
Return EgtMsg(61707)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property SRCFILE_MSG As String
|
||||
Get
|
||||
Return EgtMsg(61708)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property EXPFILE_MSG As String
|
||||
Get
|
||||
Return EgtMsg(61709)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property RECESS_MSG As String
|
||||
Get
|
||||
Return EgtMsg(61643)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property USERATTRIBUTE_MSG As String
|
||||
Get
|
||||
Return EgtMsg(61648)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
#End Region ' Messages
|
||||
|
||||
' Definizione comandi
|
||||
Private m_cmdOk As ICommand
|
||||
|
||||
#End Region ' FIELDS & PROPERTIES
|
||||
|
||||
#Region "CONSTRUCTOR"
|
||||
|
||||
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
|
||||
|
||||
#Region "COMMANDS"
|
||||
|
||||
#Region "Ok"
|
||||
|
||||
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()
|
||||
' 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
|
||||
|
||||
#End Region ' Ok
|
||||
|
||||
#End Region ' COMMANDS
|
||||
|
||||
End Class
|
||||
@@ -0,0 +1,79 @@
|
||||
<StackPanel x:Class="BTLPartManagerV"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
Orientation="Horizontal"
|
||||
HorizontalAlignment="Right"
|
||||
DataContext="{StaticResource BTLPartManagerVM}">
|
||||
|
||||
<Button Command="{Binding NewRawPart_Command}"
|
||||
Visibility="{Binding MachiningPage_Visibility}"
|
||||
ToolTip="{Binding NewRawPart_ToolTip}"
|
||||
IsEnabled="{Binding BTLPartManager_IsEnabled}"
|
||||
Style="{StaticResource LeftPanel_Button}">
|
||||
<Image Source="/Resources/LeftPanel/NewRawPart.png" Stretch="Uniform"/>
|
||||
</Button>
|
||||
<Button Command="{Binding NewRawPartLast_Command}"
|
||||
Visibility="{Binding MachiningPage_Visibility}"
|
||||
ToolTip="{Binding NewRawPartLast_ToolTip}"
|
||||
IsEnabled="{Binding BTLPartManager_IsEnabled}"
|
||||
Style="{StaticResource LeftPanel_Button}">
|
||||
<Image Source="/Resources/LeftPanel/NewRawPartAuto.png" Stretch="Uniform"/>
|
||||
</Button>
|
||||
<Button Command="{Binding AddToRawPart_Command}"
|
||||
Visibility="{Binding MachiningPage_Visibility}"
|
||||
ToolTip="{Binding AddToRawPart_ToolTip}"
|
||||
IsEnabled="{Binding BTLPartManager_IsEnabled}"
|
||||
Style="{StaticResource LeftPanel_Button}">
|
||||
<Image Source="/Resources/LeftPanel/AddToRawPart.png" Stretch="Uniform"/>
|
||||
</Button>
|
||||
<Button Command="{Binding CopyPart_Command}"
|
||||
Visibility="{Binding ViewPage_Visibility}"
|
||||
ToolTip="{Binding CopyPart_ToolTip}"
|
||||
IsEnabled="{Binding CopyPart_IsEnabled}"
|
||||
Style="{StaticResource LeftPanel_Button}">
|
||||
<Image Source="/Resources/LeftPanel/CopyPart.png" Stretch="Uniform"/>
|
||||
</Button>
|
||||
<Button Command="{Binding AddPart_Command}"
|
||||
Visibility="{Binding ViewPage_Visibility}"
|
||||
ToolTip="{Binding AddPart_ToolTip}"
|
||||
IsEnabled="{Binding BTLPartManager_IsEnabled}"
|
||||
Style="{StaticResource LeftPanel_Button}">
|
||||
<Image Source="/Resources/LeftPanel/AddPart.png" Stretch="Uniform"/>
|
||||
</Button>
|
||||
<Button Command="{Binding RemovePart_Command}"
|
||||
Visibility="{Binding ViewPage_Visibility}"
|
||||
ToolTip="{Binding RemovePart_ToolTip}"
|
||||
IsEnabled="{Binding RemovePart_IsEnabled}"
|
||||
Style="{StaticResource LeftPanel_Button}">
|
||||
<Image Source="/Resources/LeftPanel/RemovePart.png" Stretch="Uniform"/>
|
||||
</Button>
|
||||
<Button Command="{Binding Invert_Command}"
|
||||
Visibility="{Binding ViewPage_Visibility}"
|
||||
ToolTip="{Binding InvertSx_ToolTip}"
|
||||
IsEnabled="{Binding RotatePart_IsEnabled}"
|
||||
Style="{StaticResource LeftPanel_Button}">
|
||||
<Image Source="/Resources/PartManager/LeftInvert.png" Stretch="Uniform"/>
|
||||
</Button>
|
||||
<Button Command="{Binding Invert_Command}"
|
||||
Visibility="{Binding ViewPage_Visibility}"
|
||||
ToolTip="{Binding InvertDx_ToolTip}"
|
||||
IsEnabled="{Binding RotatePart_IsEnabled}"
|
||||
Style="{StaticResource LeftPanel_Button}">
|
||||
<Image Source="/Resources/PartManager/RightInvert.png" Stretch="Uniform"/>
|
||||
</Button>
|
||||
<Button Command="{Binding BackRotation_Command}"
|
||||
Visibility="{Binding ViewPage_Visibility}"
|
||||
ToolTip="{Binding BackRotation_ToolTip}"
|
||||
IsEnabled="{Binding RotatePart_IsEnabled}"
|
||||
Style="{StaticResource LeftPanel_Button}">
|
||||
<Image Source="/Resources/PartManager/LeftRotate.png" Stretch="Uniform"/>
|
||||
</Button>
|
||||
<Button Command="{Binding ForwardRotation_Command}"
|
||||
Visibility="{Binding ViewPage_Visibility}"
|
||||
ToolTip="{Binding ForwardRotation_ToolTip}"
|
||||
IsEnabled="{Binding RotatePart_IsEnabled}"
|
||||
Style="{StaticResource LeftPanel_Button}">
|
||||
<Image Source="/Resources/PartManager/RightRotate.png" Stretch="Uniform"/>
|
||||
</Button>
|
||||
|
||||
</StackPanel>
|
||||
@@ -0,0 +1,3 @@
|
||||
Public Class BTLPartManagerV
|
||||
|
||||
End Class
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,90 @@
|
||||
<StackPanel x:Class="OnlyProdBTLPartManagerV"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
DataContext="{StaticResource BTLPartManagerVM}"
|
||||
Style="{StaticResource OnlyProdBTLPartManager_StackPanel}">
|
||||
|
||||
<Button Command="{Binding CopyPart_Command}"
|
||||
Visibility="{Binding ViewPage_Visibility}"
|
||||
ToolTip="{Binding CopyPart_ToolTip}"
|
||||
IsEnabled="{Binding CopyPart_IsEnabled}"
|
||||
Style="{StaticResource OnlyProdLeftPanel_Button}">
|
||||
<Image Source="/Resources/LeftPanel/CopyPart.png" Stretch="Uniform"/>
|
||||
</Button>
|
||||
<Button Command="{Binding RemovePart_Command}"
|
||||
Visibility="{Binding ViewPage_Visibility}"
|
||||
ToolTip="{Binding RemovePart_ToolTip}"
|
||||
IsEnabled="{Binding RemovePart_IsEnabled}"
|
||||
Style="{StaticResource OnlyProdLeftPanel_Button}">
|
||||
<Image Source="/Resources/NewPage/Remove.png" Stretch="Uniform"/>
|
||||
</Button>
|
||||
<Button ToolTip="{Binding Simulate_ToolTip}"
|
||||
Command="{Binding Simulate_Command}"
|
||||
IsEnabled="{Binding Simulate_IsEnabled}"
|
||||
Style="{StaticResource OnlyProdLeftPanel_Button}">
|
||||
<Image Source="/Resources/CALCPanel/Simulate.png" Stretch="Uniform"/>
|
||||
</Button>
|
||||
<Button ToolTip="{Binding Edit_ToolTip}"
|
||||
Command="{Binding Edit_Command}"
|
||||
IsEnabled="{Binding Edit_IsEnabled}"
|
||||
Visibility="{Binding Edit_Visibility}"
|
||||
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}"
|
||||
IsEnabled="{Binding BTLPartManager_IsEnabled}"
|
||||
Style="{StaticResource OnlyProdLeftPanel_Button}">
|
||||
<Image Source="/Resources/LeftPanel/NewRawPart.png" Stretch="Uniform"/>
|
||||
</Button>
|
||||
<Button Command="{Binding NewRawPartLast_Command}"
|
||||
Visibility="{Binding MachiningPage_Visibility}"
|
||||
ToolTip="{Binding NewRawPartLast_ToolTip}"
|
||||
IsEnabled="{Binding BTLPartManager_IsEnabled}"
|
||||
Style="{StaticResource OnlyProdLeftPanel_Button}">
|
||||
<Image Source="/Resources/LeftPanel/NewRawPartAuto.png" Stretch="Uniform"/>
|
||||
</Button>-->
|
||||
<!--<Button Command="{Binding AddToRawPart_Command}"
|
||||
Visibility="{Binding MachiningPage_Visibility}"
|
||||
ToolTip="{Binding AddToRawPart_ToolTip}"
|
||||
IsEnabled="{Binding BTLPartManager_IsEnabled}"
|
||||
Style="{StaticResource OnlyProdLeftPanel_Button}">
|
||||
<Image Source="/Resources/LeftPanel/AddToRawPart.png" Stretch="Uniform"/>
|
||||
</Button>-->
|
||||
<!--<Button Command="{Binding Invert_Command}"
|
||||
Visibility="{Binding ViewPage_Visibility}"
|
||||
ToolTip="{Binding InvertSx_ToolTip}"
|
||||
IsEnabled="{Binding RotatePart_IsEnabled}"
|
||||
Style="{StaticResource OnlyProdLeftPanel_Button}">
|
||||
<Image Source="/Resources/PartManager/LeftInvert.png" Stretch="Uniform"/>
|
||||
</Button>
|
||||
<Button Command="{Binding Invert_Command}"
|
||||
Visibility="{Binding ViewPage_Visibility}"
|
||||
ToolTip="{Binding InvertDx_ToolTip}"
|
||||
IsEnabled="{Binding RotatePart_IsEnabled}"
|
||||
Style="{StaticResource OnlyProdLeftPanel_Button}">
|
||||
<Image Source="/Resources/PartManager/RightInvert.png" Stretch="Uniform"/>
|
||||
</Button>
|
||||
<Button Command="{Binding BackRotation_Command}"
|
||||
Visibility="{Binding ViewPage_Visibility}"
|
||||
ToolTip="{Binding BackRotation_ToolTip}"
|
||||
IsEnabled="{Binding RotatePart_IsEnabled}"
|
||||
Style="{StaticResource OnlyProdLeftPanel_Button}">
|
||||
<Image Source="/Resources/PartManager/LeftRotate.png" Stretch="Uniform"/>
|
||||
</Button>
|
||||
<Button Command="{Binding ForwardRotation_Command}"
|
||||
Visibility="{Binding ViewPage_Visibility}"
|
||||
ToolTip="{Binding ForwardRotation_ToolTip}"
|
||||
IsEnabled="{Binding RotatePart_IsEnabled}"
|
||||
Style="{StaticResource OnlyProdLeftPanel_Button}">
|
||||
<Image Source="/Resources/PartManager/RightRotate.png" Stretch="Uniform"/>
|
||||
</Button>-->
|
||||
|
||||
</StackPanel>
|
||||
@@ -0,0 +1,3 @@
|
||||
Public Class OnlyProdBTLPartManagerV
|
||||
|
||||
End Class
|
||||
@@ -0,0 +1,752 @@
|
||||
Imports System.Collections.ObjectModel
|
||||
Imports System.Collections.Specialized
|
||||
Imports System.ComponentModel
|
||||
Imports EgtBEAMWALL.Core
|
||||
Imports EgtUILib
|
||||
Imports EgtWPFLib5
|
||||
|
||||
Public Class BTLFeatureVM
|
||||
Inherits Core.BTLFeatureVM
|
||||
|
||||
Public Property GRPList As ObservableCollection(Of Integer)
|
||||
Get
|
||||
Return m_BTLFeatureM.GRPList
|
||||
End Get
|
||||
Set(value As ObservableCollection(Of Integer))
|
||||
m_BTLFeatureM.GRPList = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Overrides Property nSelGRP As Integer
|
||||
Get
|
||||
Return m_BTLFeatureM.nSelGRP
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
If value <> -1 Then
|
||||
' verifico se solido attivo
|
||||
Dim bShowSolid As Boolean = Map.refShowBeamPanelVM.ShowSolid_IsChecked
|
||||
If bShowSolid Then Map.refProjectVM.BTLStructureVM.ShowSolid(GDB_ID.NULL, False, False)
|
||||
' aggiorno la feature con nuovo valore
|
||||
Dim vPar() As Double = Nothing
|
||||
Dim sPar As String = String.Empty
|
||||
Dim vParQ() As String = Nothing
|
||||
m_BTLFeatureM.CalcParamArray(vPar, sPar, vParQ)
|
||||
Dim bOK As Boolean = m_BTLFeatureM.UpdateParams(value, m_BTLFeatureM.nPRC, nSelSIDE, m_BTLFeatureM.sDES, m_BTLFeatureM.nPRID,
|
||||
m_BTLFeatureM.frFRAME, vPar, sPar, vParQ)
|
||||
If bOK Then
|
||||
m_BTLFeatureM.nSelGRP = value
|
||||
' seleziono feature in disegno
|
||||
SelGeomFeature()
|
||||
' rendo non calcolata questa feature
|
||||
ResetCalcFeature()
|
||||
End If
|
||||
NotifyPropertyChanged(NameOf(nSelGRP))
|
||||
If bShowSolid Then Map.refProjectVM.BTLStructureVM.ShowSolid(GDB_ID.NULL, True, False)
|
||||
EgtDraw()
|
||||
End If
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property SIDEList As ObservableCollection(Of Integer)
|
||||
Get
|
||||
Return m_BTLFeatureM.SIDEList
|
||||
End Get
|
||||
Set(value As ObservableCollection(Of Integer))
|
||||
m_BTLFeatureM.SIDEList = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
' Lato
|
||||
Public Overrides Property nSelSIDE As Integer
|
||||
Get
|
||||
Return m_BTLFeatureM.nSelSIDE
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
If value <> -1 Then
|
||||
' verifico se solido attivo
|
||||
Dim bShowSolid As Boolean = Map.refShowBeamPanelVM.ShowSolid_IsChecked
|
||||
If bShowSolid Then Map.refProjectVM.BTLStructureVM.ShowSolid(GDB_ID.NULL, False, False)
|
||||
' se freecontour
|
||||
If Me.m_BTLFeatureM.IsFreeContour() Then
|
||||
' cambio faccia alla geometria
|
||||
Dim frOld As New Frame3d
|
||||
EgtBeamGetSideData(nSelSIDE, frOld)
|
||||
frOld.Invert()
|
||||
Dim frNew As New Frame3d
|
||||
EgtBeamGetSideData(value, frNew)
|
||||
Dim sAuxId As String = ""
|
||||
If EgtGetInfo(nFeatureId, "AUXID", sAuxId) Then
|
||||
' verifico se ha uno o due percorsi
|
||||
Dim sAuxIdSplit() As String = sAuxId.Split(","c)
|
||||
If Not IsNothing(sAuxIdSplit) AndAlso sAuxIdSplit.Length() >= 1 Then
|
||||
Dim nAuxId As Integer = GDB_ID.NULL
|
||||
If Integer.TryParse(sAuxIdSplit(0), nAuxId) Then
|
||||
EgtTransform(nFeatureId + nAuxId, frOld, GDB_RT.GLOB)
|
||||
EgtTransform(nFeatureId + nAuxId, frNew, GDB_RT.GLOB)
|
||||
End If
|
||||
End If
|
||||
If Not IsNothing(sAuxIdSplit) AndAlso sAuxIdSplit.Length() >= 2 Then
|
||||
Dim nAux2Id As Integer = GDB_ID.NULL
|
||||
If Integer.TryParse(sAuxIdSplit(1), nAux2Id) Then
|
||||
EgtTransform(nFeatureId + nAux2Id, frOld, GDB_RT.GLOB)
|
||||
EgtTransform(nFeatureId + nAux2Id, frNew, GDB_RT.GLOB)
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
' aggiorno la feature con nuovo valore
|
||||
Dim vPar() As Double = Nothing
|
||||
Dim sPar As String = String.Empty
|
||||
Dim vParQ() As String = Nothing
|
||||
m_BTLFeatureM.CalcParamArray(vPar, sPar, vParQ)
|
||||
Dim bOK As Boolean = m_BTLFeatureM.UpdateParams(nSelGRP, m_BTLFeatureM.nPRC, value, m_BTLFeatureM.sDES, m_BTLFeatureM.nPRID,
|
||||
m_BTLFeatureM.frFRAME, vPar, sPar, vParQ)
|
||||
If bOK Then
|
||||
m_BTLFeatureM.nSelSIDE = value
|
||||
SelGeomFeature()
|
||||
' rendo non calcolata questa feature
|
||||
ResetCalcFeature()
|
||||
End If
|
||||
NotifyPropertyChanged(NameOf(nSelSIDE))
|
||||
If bShowSolid Then Map.refProjectVM.BTLStructureVM.ShowSolid(GDB_ID.NULL, True, False)
|
||||
EgtDraw()
|
||||
End If
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property VARIANTList As ObservableCollection(Of Integer)
|
||||
Get
|
||||
Return m_BTLFeatureM.VARIANTList
|
||||
End Get
|
||||
Set(value As ObservableCollection(Of Integer))
|
||||
m_BTLFeatureM.VARIANTList = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Overrides Property nSelVARIANT As Integer
|
||||
Get
|
||||
Return m_BTLFeatureM.nSelVARIANT
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
If value <> m_BTLFeatureM.nSelVARIANT Then
|
||||
m_BTLFeatureM.nSelVARIANT = value
|
||||
Dim vPar As Double() = Nothing
|
||||
Dim sPar As String = Nothing
|
||||
Dim vParQ As String() = Nothing
|
||||
CreateFeatureVariant(value, vPar, sPar, vParQ)
|
||||
If IsNothing(vPar) Then
|
||||
m_BTLFeatureM.nSelVARIANT = 0
|
||||
CreateFeatureVariant(value, vPar, sPar, vParQ)
|
||||
End If
|
||||
m_BTLFeatureM.nSelVARIANT = value
|
||||
Dim bOK As Boolean = m_BTLFeatureM.UpdateParams(nSelGRP, m_BTLFeatureM.nPRC, nSelSIDE, sDES, m_BTLFeatureM.nPRID,
|
||||
m_BTLFeatureM.frFRAME, vPar, sPar, vParQ)
|
||||
If bOK Then
|
||||
EgtDuploSetModified(m_BTLPartM.nPartId)
|
||||
' seleziono feature in disegno
|
||||
SelGeomFeature()
|
||||
' rendo non calcolata questa feature
|
||||
ResetCalcFeature()
|
||||
End If
|
||||
NotifyPropertyChanged(NameOf(nSelVARIANT))
|
||||
NotifyPropertyChanged(NameOf(PBTLParamVMList))
|
||||
NotifyPropertyChanged(NameOf(QBTLParamVMList))
|
||||
EgtDraw()
|
||||
End If
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private Sub CreateFeatureVariant(value As Integer, ByRef vPar() As Double, ByRef sPar As String, ByRef vParQ() As String)
|
||||
' crea parametri per questa feature da file ini
|
||||
m_BTLFeatureM.CreateFeatureParams(m_BTLFeatureM)
|
||||
m_BTLFeatureM.SetDefaultValues()
|
||||
CreatePBTLParamVMList()
|
||||
CreateQBTLParamVMList()
|
||||
' aggiorno la feature con nuovo valore
|
||||
vPar = Nothing
|
||||
sPar = Nothing
|
||||
vParQ = Nothing
|
||||
m_BTLFeatureM.CalcParamArray(vPar, sPar, vParQ)
|
||||
'' imposto path disegno da mostrare in BottomPanel
|
||||
'If value > 0 AndAlso File.Exists(Map.refMainWindowVM.MainWindowM.sResourcesRoot & "\Features\" & sDescGRP & "." & sDES & ".png") Then
|
||||
' Map.refBottomPanelVM.SetCurrDraw(Map.refMainWindowVM.MainWindowM.sResourcesRoot & "\Features\" & sDescGRP & "." & sDES & ".png")
|
||||
'Else
|
||||
' Map.refBottomPanelVM.SetCurrDraw(Map.refMainWindowVM.MainWindowM.sResourcesRoot & "\Features\" & sDescGRP & ".png")
|
||||
'End If
|
||||
End Sub
|
||||
|
||||
Public Property sPriority As String
|
||||
Get
|
||||
Return m_BTLFeatureM.nPriority.ToString()
|
||||
End Get
|
||||
Set(value As String)
|
||||
Dim nTemp As Integer = 0
|
||||
If Integer.TryParse(value, nTemp) Then
|
||||
If EgtSetInfo(nFeatureId, BTL_FTR_PRIORITY, nTemp) Then
|
||||
m_BTLFeatureM.nPriority = nTemp
|
||||
' setto feature da ricalcolare
|
||||
ResetCalcFeature()
|
||||
' se in View
|
||||
If Map.refMainMenuVM.SelPage = Pages.VIEW OrElse Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE Then
|
||||
' imposto modificato per copie
|
||||
MyMachGroupPanelM.SetDuploModified(m_BTLPartM.nPartId)
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
NotifyPropertyChanged(NameOf(sPriority))
|
||||
End Set
|
||||
End Property
|
||||
' proprieta' che indica se e' attivo l'update del parametro bDO su piu' feature (attiva/disattiva tutti su pezzo, o per tipo con tasto destro)
|
||||
' necessario per evitare ricalcolo della grafica sulla modifica del parametro per ogni feature
|
||||
Private Shared m_bDO_MultipleUpdate As Boolean = False
|
||||
Public Shared Property bDO_MultipleUpdate As Boolean
|
||||
Get
|
||||
Return m_bDO_MultipleUpdate
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
m_bDO_MultipleUpdate = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Overrides Property bDO As Boolean
|
||||
Get
|
||||
Return m_BTLFeatureM.bDO
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
Dim bShowSolid As Boolean = Map.refShowBeamPanelVM.ShowSolid_IsChecked
|
||||
If value <> m_BTLFeatureM.bDO Then
|
||||
'If Map.refMainMenuVM.SelPage = Pages.VIEW Then
|
||||
' ' verifico se solido attivo
|
||||
' If bShowSolid Then Map.refProjectVM.BTLStructureVM.ShowSolid(GDB_ID.NULL, False, False)
|
||||
'End If
|
||||
If EgtBeamEnableProcess(nFeatureId, value, Not m_bDO_MultipleUpdate) Then
|
||||
m_BTLFeatureM.bDO = value
|
||||
' setto feature da ricalcolare
|
||||
ResetCalcFeature()
|
||||
' se in View
|
||||
If Map.refMainMenuVM.SelPage = Pages.VIEW OrElse (Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE AndAlso Not IsNothing(m_BTLPartM)) Then
|
||||
MyMachGroupPanelM.SetDuploModified(m_BTLPartM.nPartId)
|
||||
End If
|
||||
NotifyPropertyChanged(NameOf(bDO))
|
||||
' aggiorno messaggio su context menu
|
||||
For Each Item In MenuList
|
||||
Item.NotifyPropertyChanged(NameOf(Item.sMsg))
|
||||
Next
|
||||
End If
|
||||
'If Map.refMainMenuVM.SelPage = Pages.VIEW Then
|
||||
' ' eventualmente ripristino solido
|
||||
' If bShowSolid Then Map.refProjectVM.BTLStructureVM.ShowSolid(GDB_ID.NULL, True, False)
|
||||
'End If
|
||||
If Not m_bDO_MultipleUpdate Then EgtDraw()
|
||||
' aggiorno stato abilitazione del bottone modifica free contour
|
||||
Map.refFeatureManagerVM.SetEditIsEnabled()
|
||||
End If
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property sDrawPath As String
|
||||
Get
|
||||
If nPRC = 900 AndAlso nSelVARIANT > 0 Then
|
||||
Return Map.refMainWindowVM.MainWindowM.sResourcesRoot & "\Features\" & sDescGRP & "." & sDES & ".png"
|
||||
Else
|
||||
Return Map.refMainWindowVM.MainWindowM.sResourcesRoot & "\Features\" & sDescGRP & ".png"
|
||||
End If
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_PBTLParamVMList As ObservableCollection(Of BTLParamVM)
|
||||
Public Property PBTLParamVMList As ObservableCollection(Of BTLParamVM)
|
||||
Get
|
||||
Return m_PBTLParamVMList
|
||||
End Get
|
||||
Set(value As ObservableCollection(Of BTLParamVM))
|
||||
m_PBTLParamVMList = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Protected m_SelPBTLParam As BTLParamVM
|
||||
Public Property SelPBTLParam As BTLParamVM
|
||||
Get
|
||||
Return m_SelPBTLParam
|
||||
End Get
|
||||
Set(value As BTLParamVM)
|
||||
m_SelPBTLParam = value
|
||||
If Not IsNothing(m_SelPBTLParam) Then
|
||||
' imposto path disegno da mostrare in BottomPanel
|
||||
'If Not IsNothing(Map.refBottomPanelVM) Then
|
||||
' Map.refBottomPanelVM.SetCurrDraw(m_SelPBTLParam.sDrawPath)
|
||||
'End If
|
||||
End If
|
||||
NotifyPropertyChanged(NameOf(SelPBTLParam))
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_QBTLParamVMList As ObservableCollection(Of BTLParamVM)
|
||||
Public Property QBTLParamVMList As ObservableCollection(Of BTLParamVM)
|
||||
Get
|
||||
Return m_QBTLParamVMList
|
||||
End Get
|
||||
Set(value As ObservableCollection(Of BTLParamVM))
|
||||
m_QBTLParamVMList = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Protected m_SelQParam As BTLParamVM
|
||||
Public Property SelQBTLParam As BTLParamVM
|
||||
Get
|
||||
Return m_SelQParam
|
||||
End Get
|
||||
Set(value As BTLParamVM)
|
||||
m_SelQParam = value
|
||||
'If Not IsNothing(m_SelQParam) AndAlso Not IsNothing(Map.refBottomPanelVM) Then
|
||||
' ' imposto path disegno da mostrare in BottomPanel
|
||||
' Map.refBottomPanelVM.SetCurrDraw(m_SelQParam.sDrawPath)
|
||||
'End If
|
||||
NotifyPropertyChanged(NameOf(SelQBTLParam))
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property Edit_Visibility As Visibility
|
||||
Get
|
||||
Return If(BTLFeatureM.IsFreeContour AndAlso Not Map.refFreeContourManagerVM.bIsActive, Visibility.Visible, Visibility.Collapsed)
|
||||
End Get
|
||||
End Property
|
||||
Public ReadOnly Property SaveCancel_Visibility As Visibility
|
||||
Get
|
||||
Return If(BTLFeatureM.IsFreeContour AndAlso Map.refFreeContourManagerVM.bIsActive, Visibility.Visible, Visibility.Collapsed)
|
||||
End Get
|
||||
End Property
|
||||
Friend Sub RefreshFCMBtnVisibility()
|
||||
NotifyPropertyChanged(NameOf(Edit_Visibility))
|
||||
NotifyPropertyChanged(NameOf(SaveCancel_Visibility))
|
||||
End Sub
|
||||
|
||||
Private m_MenuList As New List(Of MenuItemVm)
|
||||
Public Property MenuList As List(Of MenuItemVm)
|
||||
Get
|
||||
Return m_MenuList
|
||||
End Get
|
||||
Set(value As List(Of MenuItemVm))
|
||||
m_MenuList = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
#Region "Messages"
|
||||
|
||||
Public ReadOnly Property Edit_ToolTip As String
|
||||
Get
|
||||
Return EgtMsg(61939)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
#End Region ' Messages
|
||||
|
||||
' Definizione comandi
|
||||
Private m_cmdEdit As ICommand
|
||||
Private m_cmdSave As ICommand
|
||||
Private m_cmdCancel As ICommand
|
||||
Private m_cmdDeleteFeature As ICommand
|
||||
Private m_cmdEditFeature As ICommand
|
||||
Private m_cmdStategyCmd As ICommand
|
||||
|
||||
#Region "CONSTRUCTOR"
|
||||
|
||||
Sub New(BTLFeatureM As BTLFeatureM, BTLPartM As BTLPartM)
|
||||
m_BTLFeatureM = BTLFeatureM
|
||||
AddHandler m_BTLFeatureM.PBTLParamAdded, AddressOf OnPBTLParamAdded
|
||||
AddHandler m_BTLFeatureM.QBTLParamAdded, AddressOf OnQBTLParamAdded
|
||||
m_BTLPartM = BTLPartM
|
||||
CreatePBTLParamVMList()
|
||||
CreateQBTLParamVMList()
|
||||
NotifyPropertyChanged(NameOf(Calc_Background))
|
||||
NotifyPropertyChanged(NameOf(CALC_ROT_Visibility))
|
||||
NotifyPropertyChanged(NameOf(CALC_ERR_Letter))
|
||||
NotifyPropertyChanged(NameOf(CALC_ERR_Foreground))
|
||||
m_MenuList.Add(New MenuItemVm(Me))
|
||||
End Sub
|
||||
|
||||
Sub New(BTLFeatureM As BTLFeatureM)
|
||||
m_BTLFeatureM = BTLFeatureM
|
||||
AddHandler m_BTLFeatureM.QBTLParamAdded, AddressOf OnQBTLParamAdded
|
||||
m_BTLPartM = Nothing
|
||||
Dim Part As PartM = BTLFeatureM.ParentPart
|
||||
If Part.nType = BWType.WALL Then CreateQBTLParamVMList()
|
||||
NotifyPropertyChanged(NameOf(Calc_Background))
|
||||
NotifyPropertyChanged(NameOf(CALC_ROT_Visibility))
|
||||
NotifyPropertyChanged(NameOf(CALC_ERR_Letter))
|
||||
NotifyPropertyChanged(NameOf(CALC_ERR_Foreground))
|
||||
End Sub
|
||||
|
||||
#End Region ' CONSTRUCTOR
|
||||
|
||||
#Region "METHODS"
|
||||
|
||||
Private Sub CreatePBTLParamVMList()
|
||||
Dim all As List(Of BTLParamVM) = (From BTLParamM In m_BTLFeatureM.GetPBTLParams()
|
||||
Select New BTLParamVM(BTLParamM, m_BTLFeatureM)).ToList()
|
||||
|
||||
For Each BTLParamVM As BTLParamVM In all
|
||||
AddHandler BTLParamVM.PropertyChanged, AddressOf OnPBTLParamVMPropertyChanged
|
||||
Next
|
||||
|
||||
m_PBTLParamVMList = New ObservableCollection(Of BTLParamVM)(all)
|
||||
AddHandler m_PBTLParamVMList.CollectionChanged, AddressOf OnPBTLParamVMListChanged
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub CreateQBTLParamVMList()
|
||||
Dim all As List(Of BTLParamVM) = (From BTLParamM In m_BTLFeatureM.GetQBTLParams()
|
||||
Select New BTLParamVM(BTLParamM, m_BTLFeatureM)).ToList()
|
||||
|
||||
For Each BTLParamVM As BTLParamVM In all
|
||||
AddHandler BTLParamVM.PropertyChanged, AddressOf OnQBTLParamVMPropertyChanged
|
||||
Next
|
||||
|
||||
m_QBTLParamVMList = New ObservableCollection(Of BTLParamVM)(all)
|
||||
AddHandler m_QBTLParamVMList.CollectionChanged, AddressOf OnQBTLParamVMListChanged
|
||||
End Sub
|
||||
|
||||
' funzione che aggiorna lo stato, la rotazione e gli errori dopo calcolo
|
||||
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
|
||||
Select Case ERR
|
||||
Case 0
|
||||
m_BTLFeatureM.nState = CalcStates.OK
|
||||
Case 22
|
||||
m_BTLFeatureM.nState = CalcStates.COLLISION
|
||||
Case 17, 19
|
||||
m_BTLFeatureM.nState = CalcStates.WARNING
|
||||
Case < 0
|
||||
m_BTLFeatureM.nState = CalcStates.INFO
|
||||
Case > 0
|
||||
m_BTLFeatureM.nState = CalcStates.ERROR_
|
||||
End Select
|
||||
NotifyPropertyChanged(NameOf(Calc_Background))
|
||||
NotifyPropertyChanged(NameOf(CALC_ROT_Visibility))
|
||||
NotifyPropertyChanged(NameOf(sCALC_MSG))
|
||||
NotifyPropertyChanged(NameOf(CALC_ERR_Letter))
|
||||
NotifyPropertyChanged(NameOf(CALC_ERR_Foreground))
|
||||
End Sub
|
||||
|
||||
' funzione che resetta gli errori del calcolo
|
||||
Friend Sub ResetFeatureError()
|
||||
Dim ERR As Integer = 0
|
||||
Dim 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)
|
||||
m_BTLFeatureM.nCALC_ERR = ERR
|
||||
m_BTLFeatureM.sCALC_MSG = MSG
|
||||
Select Case ERR
|
||||
Case 0
|
||||
m_BTLFeatureM.nState = CalcStates.OK
|
||||
Case 22
|
||||
m_BTLFeatureM.nState = CalcStates.COLLISION
|
||||
Case 17, 19
|
||||
m_BTLFeatureM.nState = CalcStates.WARNING
|
||||
Case < 0
|
||||
m_BTLFeatureM.nState = CalcStates.INFO
|
||||
Case > 0
|
||||
m_BTLFeatureM.nState = CalcStates.ERROR_
|
||||
End Select
|
||||
NotifyPropertyChanged(NameOf(Calc_Background))
|
||||
NotifyPropertyChanged(NameOf(sCALC_MSG))
|
||||
NotifyPropertyChanged(NameOf(CALC_ERR_Letter))
|
||||
NotifyPropertyChanged(NameOf(CALC_ERR_Foreground))
|
||||
End Sub
|
||||
|
||||
Friend Sub ResetCalcFeature()
|
||||
EgtRemoveInfo(nFeatureId, If(IsNothing(m_BTLPartM), ITG_PROD_ERR, ITG_PROJ_ERR))
|
||||
EgtRemoveInfo(nFeatureId, If(IsNothing(m_BTLPartM), ITG_PROD_MSG, ITG_PROJ_MSG))
|
||||
EgtRemoveInfo(nFeatureId, If(IsNothing(m_BTLPartM), ITG_PROD_ROT, ITG_PROJ_ROT))
|
||||
m_BTLFeatureM.nState = CalcStates.NOTCALCULATED
|
||||
m_BTLFeatureM.nCALC_ERR = 0
|
||||
m_BTLFeatureM.nCALC_ROT = 0
|
||||
m_BTLFeatureM.sCALC_MSG = ""
|
||||
NotifyPropertyChanged(NameOf(Calc_Background))
|
||||
NotifyPropertyChanged(NameOf(CALC_ROT_Visibility))
|
||||
NotifyPropertyChanged(NameOf(sCALC_MSG))
|
||||
NotifyPropertyChanged(NameOf(CALC_ERR_Letter))
|
||||
NotifyPropertyChanged(NameOf(CALC_ERR_Foreground))
|
||||
End Sub
|
||||
|
||||
Public Function Copy() As BTLFeatureM
|
||||
Return Copy(m_BTLPartM)
|
||||
End Function
|
||||
|
||||
Public Function Copy(DestBTLPart As BTLPartM) As BTLFeatureM
|
||||
' creo nuova feature
|
||||
Dim vPar() As Double = Nothing
|
||||
Dim sPar As String = String.Empty
|
||||
Dim vParQ() As String = Nothing
|
||||
m_BTLFeatureM.CalcParamArray(vPar, sPar, vParQ)
|
||||
' imposto eventuali percorsi
|
||||
Dim nCrvId As Integer = GDB_ID.NULL
|
||||
Dim nCrv2Id As Integer = GDB_ID.NULL
|
||||
m_BTLFeatureM.GetFreeContourPaths(nCrvId, nCrv2Id)
|
||||
' creo la feature con nuovi valori
|
||||
EgtBeamSetPart(DestBTLPart.nPartId)
|
||||
Dim nNewFeatureId As Integer = EgtBeamAddProcess(m_BTLFeatureM.nSelGRP, m_BTLFeatureM.nPRC, m_BTLFeatureM.nSelSIDE, m_BTLFeatureM.sDES,
|
||||
DestBTLPart.NewProcId(), m_BTLFeatureM.frFRAME, vPar, sPar, vParQ, nCrvId, nCrv2Id)
|
||||
' se è stata creata
|
||||
If nNewFeatureId <> GDB_ID.NULL Then
|
||||
' Riporto eventuali indicazioni di parametri Q custom
|
||||
For Each QPar In QBTLParamVMList
|
||||
If QPar.bCustom Then EgtSetInfo(nNewFeatureId, QPar.sName & "A", 1)
|
||||
Next
|
||||
' Riporto priority
|
||||
EgtSetInfo(nNewFeatureId, BTL_FTR_PRIORITY, m_BTLFeatureM.nPriority)
|
||||
Dim NewFeat As BTLFeatureM = BTLFeatureM.CreateBTLFeature(m_BTLPartM, nNewFeatureId)
|
||||
' la aggiungo a struttura BTL pezzo di destinazione
|
||||
DestBTLPart.AddBTLFeature(NewFeat)
|
||||
Return NewFeat
|
||||
End If
|
||||
Return Nothing
|
||||
End Function
|
||||
|
||||
Public Overrides Sub RefreshFeature()
|
||||
' leggo gruppo, numero feature, lato e priorità
|
||||
EgtGetInfo(nFeatureId, BTL_FTR_GRP, m_BTLFeatureM.nSelGRP)
|
||||
EgtGetInfo(nFeatureId, BTL_FTR_PRC, m_BTLFeatureM.nPRC)
|
||||
EgtGetInfo(nFeatureId, BTL_FTR_SIDE, m_BTLFeatureM.nSelSIDE)
|
||||
EgtGetInfo(nFeatureId, BTL_FTR_PRIORITY, m_BTLFeatureM.nPriority)
|
||||
Dim nDO As Integer = 1
|
||||
If EgtGetInfo(nFeatureId, BTL_FTR_DO, nDO) Then
|
||||
m_BTLFeatureM.bDO = (nDO <> 0)
|
||||
Else
|
||||
m_BTLFeatureM.bDO = True
|
||||
End If
|
||||
NotifyPropertyChanged(NameOf(bDO))
|
||||
' leggo des,prid e frame
|
||||
EgtGetInfo(nFeatureId, BTL_FTR_DES, m_BTLFeatureM.sDES)
|
||||
EgtGetInfo(nFeatureId, BTL_FTR_PRID, m_BTLFeatureM.nPRID)
|
||||
EgtGetInfo(nFeatureId, BTL_FTR_FRAME, m_BTLFeatureM.frFRAME)
|
||||
|
||||
' aggiorno parametri della feature
|
||||
|
||||
End Sub
|
||||
|
||||
#End Region ' METHODS
|
||||
|
||||
#Region "COMMANDS"
|
||||
|
||||
#Region "DeleteFeature"
|
||||
|
||||
Public ReadOnly Property DeleteFeature_Command As ICommand
|
||||
Get
|
||||
If m_cmdDeleteFeature Is Nothing Then
|
||||
m_cmdDeleteFeature = New Command(AddressOf DeleteFeature)
|
||||
End If
|
||||
Return m_cmdDeleteFeature
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Sub DeleteFeature()
|
||||
If Map.refMainMenuVM.SelPage = Pages.VIEW Then Map.refFeatureListManagerVM.RemoveFeature()
|
||||
End Sub
|
||||
|
||||
#End Region ' DeleteFeature
|
||||
|
||||
#Region "Edit"
|
||||
|
||||
Public ReadOnly Property Edit_Command As ICommand
|
||||
Get
|
||||
If m_cmdEdit Is Nothing Then
|
||||
m_cmdEdit = New Command(AddressOf Edit)
|
||||
End If
|
||||
Return m_cmdEdit
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Sub Edit()
|
||||
' attivo modalita' contorno libero
|
||||
Map.refFreeContourManagerVM.Open()
|
||||
End Sub
|
||||
|
||||
#End Region ' Edit
|
||||
|
||||
#Region "Save"
|
||||
|
||||
Public ReadOnly Property Save_Command As ICommand
|
||||
Get
|
||||
If m_cmdSave Is Nothing Then
|
||||
m_cmdSave = New Command(AddressOf Save)
|
||||
End If
|
||||
Return m_cmdSave
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Sub Save()
|
||||
Select Case Map.refFreeContourManagerVM.SelType
|
||||
Case FreeContourManagerVM.FreeContourTypes.ONE
|
||||
Case FreeContourManagerVM.FreeContourTypes.ONEWITHANGLES
|
||||
Case FreeContourManagerVM.FreeContourTypes.TWO
|
||||
End Select
|
||||
' disattivo modalita' contorno libero
|
||||
Map.refFreeContourManagerVM.Close(True)
|
||||
End Sub
|
||||
|
||||
#End Region ' Save
|
||||
|
||||
#Region "Cancel"
|
||||
|
||||
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()
|
||||
' disattivo modalita' contorno libero
|
||||
Map.refFreeContourManagerVM.Close(False)
|
||||
End Sub
|
||||
|
||||
#End Region ' Cancel
|
||||
|
||||
#Region "Strategy"
|
||||
|
||||
Public ReadOnly Property Strategy_Command As ICommand
|
||||
Get
|
||||
If m_cmdStategyCmd Is Nothing Then
|
||||
m_cmdStategyCmd = New Command(AddressOf Strategy)
|
||||
End If
|
||||
Return m_cmdStategyCmd
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Sub Strategy()
|
||||
' 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 ' Strategy
|
||||
|
||||
#End Region ' COMMANDS
|
||||
|
||||
#Region "EVENTS"
|
||||
|
||||
Private Sub OnPBTLParamAdded(sender As Object, e As BTLParamAddedEventArgs) Handles m_BTLFeatureM.PBTLParamAdded
|
||||
Dim BTLParamVM As New BTLParamVM(e.NewBTLParam, m_BTLFeatureM)
|
||||
PBTLParamVMList.Add(BTLParamVM)
|
||||
End Sub
|
||||
Private Sub OnQBTLParamAdded(sender As Object, e As BTLParamAddedEventArgs) Handles m_BTLFeatureM.QBTLParamAdded
|
||||
Dim BTLParamVM As New BTLParamVM(e.NewBTLParam, m_BTLFeatureM)
|
||||
QBTLParamVMList.Add(BTLParamVM)
|
||||
End Sub
|
||||
|
||||
Private Sub OnPBTLParamVMListChanged(sender As Object, e As NotifyCollectionChangedEventArgs)
|
||||
If Not IsNothing(e.NewItems) AndAlso e.NewItems.Count > 0 Then
|
||||
For Each BTLParamVM As BTLParamVM In e.NewItems
|
||||
AddHandler BTLParamVM.PropertyChanged, AddressOf OnPBTLParamVMPropertyChanged
|
||||
Next
|
||||
End If
|
||||
If Not IsNothing(e.OldItems) AndAlso e.OldItems.Count > 0 Then
|
||||
For Each BTLParamVM As BTLParamVM In e.OldItems
|
||||
RemoveHandler BTLParamVM.PropertyChanged, AddressOf OnPBTLParamVMPropertyChanged
|
||||
Next
|
||||
End If
|
||||
End Sub
|
||||
Private Sub OnQBTLParamVMListChanged(sender As Object, e As NotifyCollectionChangedEventArgs)
|
||||
If Not IsNothing(e.NewItems) AndAlso e.NewItems.Count > 0 Then
|
||||
For Each BTLParamVM As BTLParamVM In e.NewItems
|
||||
AddHandler BTLParamVM.PropertyChanged, AddressOf OnQBTLParamVMPropertyChanged
|
||||
Next
|
||||
End If
|
||||
If Not IsNothing(e.OldItems) AndAlso e.OldItems.Count > 0 Then
|
||||
For Each BTLParamVM As BTLParamVM In e.OldItems
|
||||
RemoveHandler BTLParamVM.PropertyChanged, AddressOf OnQBTLParamVMPropertyChanged
|
||||
Next
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub OnPBTLParamVMPropertyChanged(sender As Object, e As PropertyChangedEventArgs)
|
||||
Select Case e.PropertyName
|
||||
Case NameOf(sender.dValue), NameOf(sender.sValue)
|
||||
' riseleziono questa feature
|
||||
SelGeomFeature()
|
||||
' rendo non calcolata questa feature
|
||||
ResetCalcFeature()
|
||||
End Select
|
||||
End Sub
|
||||
Private Sub OnQBTLParamVMPropertyChanged(sender As Object, e As PropertyChangedEventArgs)
|
||||
Select Case e.PropertyName
|
||||
Case NameOf(sender.dValue), NameOf(sender.sValue)
|
||||
' riseleziono questa feature
|
||||
SelGeomFeature()
|
||||
' rendo non calcolata questa feature
|
||||
ResetCalcFeature()
|
||||
End Select
|
||||
End Sub
|
||||
|
||||
#End Region ' EVENTS
|
||||
|
||||
End Class
|
||||
|
||||
Public Class MenuItemVm
|
||||
Inherits VMBase
|
||||
|
||||
Private m_ParentFeature As BTLFeatureVM
|
||||
Public ReadOnly Property ParentFeature As BTLFeatureVM
|
||||
Get
|
||||
Return m_ParentFeature
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property sMsg As String
|
||||
Get
|
||||
Return If(ParentFeature.bDO, "Disable all ", "Enable all ") & ParentFeature.sDescGRP
|
||||
End Get
|
||||
End Property
|
||||
|
||||
' Definizione comando
|
||||
Private m_cmdCommand As ICommand
|
||||
|
||||
Sub New(Parent As BTLFeatureVM)
|
||||
m_ParentFeature = Parent
|
||||
End Sub
|
||||
|
||||
#Region "Cancel"
|
||||
|
||||
Public ReadOnly Property MenuItem_Command As ICommand
|
||||
Get
|
||||
If m_cmdCommand Is Nothing Then
|
||||
m_cmdCommand = New Command(AddressOf Command)
|
||||
End If
|
||||
Return m_cmdCommand
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Sub Command()
|
||||
Dim bNewDo As Boolean = Not ParentFeature.bDO
|
||||
' imposto modalita' update multiplo
|
||||
BTLFeatureVM.bDO_MultipleUpdate = True
|
||||
' aggiorno tutte le feature del pezzo
|
||||
Dim SameProcFeatureList As List(Of BTLFeatureVM) = Map.refProjectVM.BTLStructureVM.SelBTLPart.BTLFeatureVMList.Where(Function(x) x.nPRC = ParentFeature.nPRC AndAlso x.GRPList.Contains(ParentFeature.nSelGRP)).ToList()
|
||||
For FeatureVMIndex = 0 To SameProcFeatureList.Count - 1
|
||||
If FeatureVMIndex = SameProcFeatureList.Count - 1 Then
|
||||
' reset modalita' update multiplo
|
||||
BTLFeatureVM.bDO_MultipleUpdate = False
|
||||
End If
|
||||
Dim FeatureVM As BTLFeatureVM = SameProcFeatureList(FeatureVMIndex)
|
||||
If FeatureVM.nPRC = ParentFeature.nPRC AndAlso FeatureVM.GRPList.Contains(ParentFeature.nSelGRP) Then
|
||||
FeatureVM.bDO = bNewDo
|
||||
End If
|
||||
Next
|
||||
End Sub
|
||||
|
||||
#End Region ' Cancel
|
||||
|
||||
End Class
|
||||
@@ -0,0 +1,334 @@
|
||||
Imports EgtBEAMWALL.Core
|
||||
Imports EgtUILib
|
||||
Imports EgtWPFLib5
|
||||
|
||||
Public Class BTLParamVM
|
||||
Inherits VMBase
|
||||
|
||||
Protected m_BTLParamM As BTLParamM
|
||||
Public ReadOnly Property BTLParamM As BTLParamM
|
||||
Get
|
||||
Return m_BTLParamM
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_BTLFeatureM As BTLFeatureM
|
||||
|
||||
Public ReadOnly Property bIsP As Boolean
|
||||
Get
|
||||
Return m_BTLParamM.bIsP
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Property bIsModified As Boolean
|
||||
Get
|
||||
Return m_BTLParamM.bIsModified
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
m_BTLParamM.bIsModified = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property Custom_Visibility As Visibility
|
||||
Get
|
||||
If bIsP Then
|
||||
Return Visibility.Collapsed
|
||||
Else
|
||||
Return Visibility.Visible
|
||||
End If
|
||||
End Get
|
||||
End Property
|
||||
|
||||
' parametri da struttura
|
||||
Public Property sName As String
|
||||
Get
|
||||
Return m_BTLParamM.sName
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_BTLParamM.sName = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property nId As Integer
|
||||
Get
|
||||
Return m_BTLParamM.nId
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Property sDescription As String
|
||||
Get
|
||||
Return m_BTLParamM.sDescription
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_BTLParamM.sDescription = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property sMin As String
|
||||
Get
|
||||
Select Case m_BTLParamM.nType
|
||||
Case BTLParamType.DOUBLE_
|
||||
Return DoubleToString(m_BTLParamM.dMin, 3)
|
||||
Case BTLParamType.LENGTH
|
||||
Return LenToString(m_BTLParamM.dMin, 3)
|
||||
Case Else
|
||||
Return ""
|
||||
End Select
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property dMin As Double
|
||||
Get
|
||||
Return m_BTLParamM.dMin
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property sMax As String
|
||||
Get
|
||||
Select Case m_BTLParamM.nType
|
||||
Case BTLParamType.DOUBLE_
|
||||
Return DoubleToString(m_BTLParamM.dMax, 3)
|
||||
Case BTLParamType.LENGTH
|
||||
Return LenToString(m_BTLParamM.dMax, 3)
|
||||
Case Else
|
||||
Return ""
|
||||
End Select
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property dMax As Double
|
||||
Get
|
||||
Return m_BTLParamM.dMax
|
||||
End Get
|
||||
End Property
|
||||
|
||||
' parametri da geometria
|
||||
Public Property sValue As String
|
||||
Get
|
||||
Select Case m_BTLParamM.nType
|
||||
Case BTLParamType.DOUBLE_
|
||||
Return DoubleToString(m_BTLParamM.dValue, 3)
|
||||
Case BTLParamType.LENGTH
|
||||
Return LenToString(m_BTLParamM.dValue, 3)
|
||||
Case Else ' stringhe
|
||||
Return m_BTLParamM.sValue
|
||||
End Select
|
||||
Return If(m_BTLParamM.nType = BTLParamType.LENGTH, LenToString(m_BTLParamM.dValue, 3), DoubleToString(m_BTLParamM.dValue, 3))
|
||||
End Get
|
||||
Set(value As String)
|
||||
Dim dNewValue As Double
|
||||
' trasformo valori
|
||||
Select Case m_BTLParamM.nType
|
||||
Case BTLParamType.DOUBLE_
|
||||
StringToDoubleAdv(value, dNewValue, True)
|
||||
Case BTLParamType.LENGTH
|
||||
StringToLenAdv(value, dNewValue, True)
|
||||
Case Else
|
||||
' per string non faccio nulla
|
||||
End Select
|
||||
Select Case m_BTLParamM.nType
|
||||
Case BTLParamType.DOUBLE_, BTLParamType.LENGTH
|
||||
' verifico che sia compreso tra minimo e massimo
|
||||
If dNewValue < m_BTLParamM.dMin OrElse dNewValue > m_BTLParamM.dMax Then
|
||||
MessageBox.Show(EgtMsg(61856), EgtMsg(30007))
|
||||
NotifyPropertyChanged(NameOf(sValue))
|
||||
Return
|
||||
End If
|
||||
' recupero ParentPart
|
||||
Dim ParentPart As BTLPartM = TryCast(m_BTLParamM.ParentFeature.ParentPart, BTLPartM)
|
||||
' recupero PartId
|
||||
Dim nPartId As Integer = ParentPart.nPartId
|
||||
' numero di pezzi inseriti nelle barre
|
||||
Dim INPROD As Integer = 0
|
||||
EgtDuploInRawCount(nPartId, INPROD)
|
||||
' recupero pezzi lavorati da Db
|
||||
Dim nDoneCnt As Integer = DbControllers.m_ProjController.getCountItemState(ProjectManagerVM.CurrProj.nProjId, nPartId, ItemState.Assigned)
|
||||
' controllo se i pezzi sono lavorati se si messaggio di warning altrimenti messaggio informativo
|
||||
If nDoneCnt > 0 Then
|
||||
MessageBox.Show("Pezzo " & nPartId & " non modificato in " & INPROD & " barra/e perche' settata/e come da produrre", EgtMsg(30009), MessageBoxButton.OK, MessageBoxImage.Warning)
|
||||
ElseIf INPROD > 0 Then
|
||||
MessageBox.Show("Pezzo " & nPartId & " modificato in " & INPROD & " barra/e grezza/e", EgtMsg(30009), MessageBoxButton.OK, MessageBoxImage.Information)
|
||||
End If
|
||||
UpdateParamValue(dNewValue, "")
|
||||
Case Else
|
||||
UpdateParamValue(0, value)
|
||||
End Select
|
||||
NotifyPropertyChanged(NameOf(bCustom))
|
||||
End Set
|
||||
End Property
|
||||
Public Property dValue As Double
|
||||
Get
|
||||
Return m_BTLParamM.dValue
|
||||
End Get
|
||||
Set(value As Double)
|
||||
m_BTLParamM.dValue = value
|
||||
NotifyPropertyChanged(NameOf(sValue))
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property sDefault As String
|
||||
Get
|
||||
Select Case m_BTLParamM.nType
|
||||
Case BTLParamType.DOUBLE_
|
||||
Return DoubleToString(m_BTLParamM.dDefault, 3)
|
||||
Case BTLParamType.LENGTH
|
||||
Return LenToString(m_BTLParamM.dDefault, 3)
|
||||
Case Else
|
||||
Return ""
|
||||
End Select
|
||||
End Get
|
||||
Set(value As String)
|
||||
Dim dNewValue As Double
|
||||
' trasformo valori
|
||||
Select Case m_BTLParamM.nType
|
||||
Case BTLParamType.DOUBLE_
|
||||
StringToDoubleAdv(value, dNewValue, True)
|
||||
Case BTLParamType.LENGTH
|
||||
StringToLenAdv(value, dNewValue, True)
|
||||
Case Else
|
||||
' per string non faccio nulla
|
||||
End Select
|
||||
Select Case m_BTLParamM.nType
|
||||
Case BTLParamType.DOUBLE_, BTLParamType.LENGTH
|
||||
' verifico che sia compreso tra minimo e massimo
|
||||
If dNewValue < m_BTLParamM.dMin OrElse dNewValue > m_BTLParamM.dMax Then
|
||||
MessageBox.Show(EgtMsg(61856), EgtMsg(30007))
|
||||
NotifyPropertyChanged(NameOf(sDefault))
|
||||
Return
|
||||
End If
|
||||
m_BTLParamM.dDefault = dNewValue
|
||||
m_BTLParamM.bIsModified = True
|
||||
Case Else
|
||||
m_BTLParamM.dDefault = 0
|
||||
m_BTLParamM.bIsModified = True
|
||||
End Select
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property nType As BTLParamType
|
||||
Get
|
||||
Return m_BTLParamM.nType
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Protected m_sDrawPath As String
|
||||
Public ReadOnly Property sDrawPath As String
|
||||
Get
|
||||
Return Map.refMainWindowVM.MainWindowM.sResourcesRoot & "\Parameters\" & m_BTLFeatureM.sDescGRP & "_" & m_BTLParamM.sName & "_" & m_BTLFeatureM.nSelGRP & ".gif"
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Property bCustom As Boolean
|
||||
Get
|
||||
Return m_BTLParamM.bCustom
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
' Se de-checko il parametro settiamo il suo valore a quello di default
|
||||
Dim bFound As Boolean = False
|
||||
If Not value Then
|
||||
' Cerco il parametro Q direttamente nel file ini
|
||||
Dim ParamIndex As String = 1
|
||||
Dim NewBTLParam As BTLParamM = Nothing
|
||||
While BTLIniFile.GetBeamPrivateProfileParam(Me.m_BTLFeatureM.nSelGRP, Me.m_BTLFeatureM.nPRC, Me.m_BTLFeatureM.nSelVARIANT, False, ParamIndex, Nothing, NewBTLParam)
|
||||
Dim QBTLParam As BTLParamVM = New BTLParamVM(NewBTLParam)
|
||||
If QBTLParam.sName = Me.sName Then
|
||||
Me.sValue = QBTLParam.sDefault
|
||||
NotifyPropertyChanged(NameOf(sValue))
|
||||
m_BTLParamM.bCustom = value
|
||||
' setto nel DB che il parametro attuale è custom o meno
|
||||
EgtSetInfo(m_BTLFeatureM.nFeatureId, m_BTLParamM.sName & "A", If(value, "1", ""))
|
||||
NotifyPropertyChanged(NameOf(bCustom))
|
||||
Exit While
|
||||
End If
|
||||
ParamIndex += 1
|
||||
End While
|
||||
End If
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property sBWType As String
|
||||
Get
|
||||
Return m_BTLParamM.sBWType
|
||||
End Get
|
||||
End Property
|
||||
|
||||
#Region "CONSTRUCTOR"
|
||||
|
||||
Sub New(BTLParamM As BTLParamM, BTLFeatureM As BTLFeatureM)
|
||||
m_BTLParamM = BTLParamM
|
||||
m_BTLFeatureM = BTLFeatureM
|
||||
End Sub
|
||||
|
||||
Sub New(BTLParamM As BTLParamM)
|
||||
m_BTLParamM = BTLParamM
|
||||
m_BTLFeatureM = Nothing
|
||||
End Sub
|
||||
|
||||
#End Region ' CONSTRUCTOR
|
||||
|
||||
Friend Sub UpdateParamValue(dNewValue As Double, sNewValue As String, Optional bDraw As Boolean = True)
|
||||
' verifico se solido attivo
|
||||
Dim bShowSolid As Boolean = Map.refShowBeamPanelVM.ShowSolid_IsChecked
|
||||
If bShowSolid Then Map.refProjectVM.BTLStructureVM.ShowSolid(GDB_ID.NULL, False, False)
|
||||
' Recupero i parametri attuali della feature
|
||||
Dim vPar() As Double = Nothing
|
||||
Dim sPar As String = String.Empty
|
||||
Dim vParQ() As String = Nothing
|
||||
m_BTLFeatureM.CalcParamArray(vPar, sPar, vParQ)
|
||||
' se P
|
||||
If m_BTLParamM.bIsP Then
|
||||
' modifico parametro cambiato con value
|
||||
Select Case m_BTLParamM.nType
|
||||
Case BTLParamType.DOUBLE_, BTLParamType.LENGTH
|
||||
vPar(m_BTLParamM.nId - 1) = dNewValue
|
||||
Case BTLParamType.STRING_
|
||||
sPar = sNewValue
|
||||
End Select
|
||||
Dim bOK As Boolean = m_BTLFeatureM.UpdateParams(m_BTLFeatureM.nSelGRP, m_BTLFeatureM.nPRC, m_BTLFeatureM.nSelSIDE, m_BTLFeatureM.sDES,
|
||||
m_BTLFeatureM.nPRID, m_BTLFeatureM.frFRAME, vPar, sPar, vParQ)
|
||||
If bOK Then
|
||||
Select Case m_BTLParamM.nType
|
||||
Case BTLParamType.DOUBLE_, BTLParamType.LENGTH
|
||||
m_BTLParamM.dValue = dNewValue
|
||||
NotifyPropertyChanged(NameOf(sValue))
|
||||
Case BTLParamType.STRING_
|
||||
m_BTLParamM.sValue = sNewValue
|
||||
NotifyPropertyChanged(NameOf(sValue))
|
||||
End Select
|
||||
Else
|
||||
NotifyPropertyChanged(NameOf(sValue))
|
||||
End If
|
||||
' se Q
|
||||
Else
|
||||
For Ind = 0 To vParQ.Length() - 1
|
||||
If vParQ(Ind).StartsWith(m_BTLParamM.sName) Then
|
||||
vParQ(Ind) = m_BTLParamM.sName & ":" & DoubleToString(dNewValue, 3)
|
||||
End If
|
||||
Next
|
||||
Dim bOK As Boolean = m_BTLFeatureM.UpdateParams(m_BTLFeatureM.nSelGRP, m_BTLFeatureM.nPRC, m_BTLFeatureM.nSelSIDE, m_BTLFeatureM.sDES,
|
||||
m_BTLFeatureM.nPRID, m_BTLFeatureM.frFRAME, vPar, sPar, vParQ)
|
||||
|
||||
If bOK Then
|
||||
m_BTLParamM.bCustom = True
|
||||
' se sono in ottimizzazione
|
||||
If Map.refMainMenuVM.SelPage = Pages.VIEW Then
|
||||
' setto nel progetto il fatto che il parametro attuale è custom o meno
|
||||
EgtSetInfo(m_BTLFeatureM.nFeatureId, m_BTLParamM.sName & "A", If(bCustom, "1", ""))
|
||||
NotifyPropertyChanged(NameOf(bCustom))
|
||||
End If
|
||||
m_BTLParamM.dValue = dNewValue
|
||||
' modifica provvisoria per mancanza aggiornamento su freecontour
|
||||
If m_BTLFeatureM.IsFreeContour Then
|
||||
EgtSetInfo(m_BTLFeatureM.nFeatureId, sName, dNewValue)
|
||||
End If
|
||||
NotifyPropertyChanged(NameOf(dValue))
|
||||
Else
|
||||
NotifyPropertyChanged(NameOf(dValue))
|
||||
End If
|
||||
End If
|
||||
|
||||
If bShowSolid Then Map.refProjectVM.BTLStructureVM.ShowSolid(GDB_ID.NULL, True, False)
|
||||
If bDraw Then EgtDraw()
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,3 @@
|
||||
Friend Class BTLRawPartVM
|
||||
|
||||
End Class
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,155 @@
|
||||
<EgtWPFLib5:EgtCustomWindow x:Class="BeamMachiningsWindowV"
|
||||
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:EgtBEAMWALLCORE="clr-namespace:EgtBEAMWALL.Core;assembly=EgtBEAMWALL.Core"
|
||||
Title="{Binding Title}"
|
||||
Style="{DynamicResource {x:Type EgtWPFLib5:EgtCustomWindow}}"
|
||||
WindowStyle="None" ResizeMode="NoResize"
|
||||
Width="500" Height="450"
|
||||
IsResizable="False"
|
||||
IsMinimizable="False" WindowStartupLocation="CenterOwner" ShowInTaskbar="False"
|
||||
CloseCommand="{Binding Close_Command,Mode=OneWay,UpdateSourceTrigger=PropertyChanged}">
|
||||
|
||||
<Grid Margin="5,5,5,0">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<TabControl ItemsSource="{Binding MachiningList}"
|
||||
SelectedItem="{Binding SelMachining}"
|
||||
IsSynchronizedWithCurrentItem="True"
|
||||
Margin="5,0,5,0"
|
||||
Style="{StaticResource TabControl_OnlyHeaders}"/>
|
||||
|
||||
<EgtBEAMWALLCORE:EgtDataGrid Grid.Row="1"
|
||||
ItemsSource="{Binding TableRowList}"
|
||||
SelectedIndex="{Binding SelRowIndex}"
|
||||
AutoGenerateColumns="False"
|
||||
CanUserResizeRows="False"
|
||||
SelectionMode="Single"
|
||||
ScrollViewer.CanContentScroll="True"
|
||||
ScrollViewer.VerticalScrollBarVisibility="Auto"
|
||||
ScrollViewer.HorizontalScrollBarVisibility="Auto"
|
||||
Margin="0,0,0,5"
|
||||
BindingColumns="{Binding BeamMachiningsColumns}">
|
||||
|
||||
<DataGrid.RowStyle>
|
||||
<Style TargetType="DataGridRow">
|
||||
<Setter Property="Height" Value="25"/>
|
||||
<Setter Property="VerticalContentAlignment" Value="Center"/>
|
||||
</Style>
|
||||
</DataGrid.RowStyle>
|
||||
|
||||
<DataGrid.Resources>
|
||||
<Style x:Key="DataGridCheckBoxColumn_Style"
|
||||
TargetType="{x:Type DataGridCell}">
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="{x:Type DataGridCell}">
|
||||
<Grid Background="{TemplateBinding Background}">
|
||||
<ContentPresenter VerticalAlignment="Center" />
|
||||
</Grid>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
<!--Colonna On-->
|
||||
<DataGridCheckBoxColumn x:Key="colON" Binding="{Binding OnPar, UpdateSourceTrigger=PropertyChanged}"
|
||||
CellStyle="{StaticResource DataGridCheckBoxColumn_Style}">
|
||||
<DataGridCheckBoxColumn.Header>
|
||||
<TextBlock Text="{Binding Path=DataContext.OnHdr,RelativeSource={RelativeSource AncestorType={x:Type EgtWPFLib5:EgtCustomWindow}}}"/>
|
||||
</DataGridCheckBoxColumn.Header>
|
||||
</DataGridCheckBoxColumn>
|
||||
|
||||
<!--Colonna Name-->
|
||||
<DataGridTemplateColumn x:Key="colNAME">
|
||||
<DataGridTemplateColumn.Header>
|
||||
<TextBlock Text="{Binding Path=DataContext.NameHdr,RelativeSource={RelativeSource AncestorType={x:Type EgtWPFLib5:EgtCustomWindow}}}"/>
|
||||
</DataGridTemplateColumn.Header>
|
||||
<DataGridTemplateColumn.CellEditingTemplate>
|
||||
<DataTemplate>
|
||||
<ComboBox IsEditable="False"
|
||||
SelectedItem="{Binding Name,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"
|
||||
ItemsSource="{Binding Path=NamesList, Mode=OneWay, UpdateSourceTrigger=PropertyChanged}"/>
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellEditingTemplate>
|
||||
<DataGridTemplateColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding Path=Name,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"
|
||||
VerticalAlignment="Center"
|
||||
Margin="5,0,0,0"/>
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
|
||||
<!--Colonna Style-->
|
||||
<DataGridTemplateColumn x:Key="colTYPE">
|
||||
<DataGridTemplateColumn.Header>
|
||||
<TextBlock Text="{Binding Path=DataContext.TypeHdr,RelativeSource={RelativeSource AncestorType={x:Type EgtWPFLib5:EgtCustomWindow}}}"/>
|
||||
</DataGridTemplateColumn.Header>
|
||||
<DataGridTemplateColumn.CellEditingTemplate>
|
||||
<DataTemplate>
|
||||
<ComboBox IsEditable="False"
|
||||
SelectedItem="{Binding Type,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"
|
||||
ItemsSource="{Binding Path=TypeList, Mode=OneWay, UpdateSourceTrigger=PropertyChanged}"/>
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellEditingTemplate>
|
||||
<DataGridTemplateColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding Path=Type,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"
|
||||
VerticalAlignment="Center"
|
||||
Margin="5,0,0,0"/>
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
|
||||
</DataGrid.Resources>
|
||||
|
||||
</EgtBEAMWALLCORE:EgtDataGrid>
|
||||
|
||||
<Grid Grid.Row="2"
|
||||
Margin="0,0,0,5"
|
||||
HorizontalAlignment="Center">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<Button Content="/\"
|
||||
Command="{Binding MoveRowUp_Command}"
|
||||
Grid.Column="0"
|
||||
Margin="0,0,2.5,0"
|
||||
Style="{StaticResource EgtWPFLib5_InputButton}"/>
|
||||
<Button Content="\/"
|
||||
Command="{Binding MoveRowDown_Command}"
|
||||
Grid.Column="1"
|
||||
Margin="2.5,0,2.5,0"
|
||||
Style="{StaticResource EgtWPFLib5_InputButton}"/>
|
||||
<Button Content="{Binding AddRowMsg}"
|
||||
Command="{Binding AddRow_Command}"
|
||||
Grid.Column="2"
|
||||
Margin="2.5,0,2.5,0"
|
||||
Style="{StaticResource EgtWPFLib5_InputButton}"/>
|
||||
<Button Content="{Binding DeleteRowMsg}"
|
||||
Command="{Binding DeleteRow_Command}"
|
||||
Grid.Column="3"
|
||||
Margin="2.5,0,2.5,0"
|
||||
Style="{StaticResource EgtWPFLib5_InputButton}"/>
|
||||
<Button Content="{Binding SaveMsg}"
|
||||
Command="{Binding Save_Command}"
|
||||
Grid.Column="4"
|
||||
Margin="2.5,0,0,0"
|
||||
Style="{StaticResource EgtWPFLib5_InputButton}"/>
|
||||
|
||||
</Grid>
|
||||
|
||||
</Grid>
|
||||
|
||||
</EgtWPFLib5:EgtCustomWindow>
|
||||
@@ -0,0 +1,20 @@
|
||||
Imports EgtBEAMWALL.Core
|
||||
|
||||
Public Class BeamMachiningsWindowV
|
||||
|
||||
Private WithEvents m_BeamMachiningsWindowVM As MyBeamMachiningsWindowVM
|
||||
|
||||
Sub New(Owner As Window, BeamMachiningsWindowVM As MyBeamMachiningsWindowVM)
|
||||
MyBase.New(Owner)
|
||||
' This call is required by the designer.
|
||||
InitializeComponent()
|
||||
Me.DataContext = BeamMachiningsWindowVM
|
||||
' Assegno al riferimento locale al VM il VM preso dal DataContext
|
||||
m_BeamMachiningsWindowVM = BeamMachiningsWindowVM
|
||||
End Sub
|
||||
|
||||
Private Sub CloseWindow(bDialogResult As Boolean) Handles m_BeamMachiningsWindowVM.m_CloseWindow
|
||||
Me.DialogResult = bDialogResult
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
@@ -0,0 +1,36 @@
|
||||
Imports System.Collections.ObjectModel
|
||||
Imports EgtBEAMWALL.Core
|
||||
Imports EgtWPFLib5
|
||||
|
||||
Public Class MyBeamMachiningsWindowVM
|
||||
Inherits BeamMachiningsWindowVM
|
||||
|
||||
#Region "FIELDS & PROPERTIES"
|
||||
|
||||
Private m_BeamMachiningsColumns As New ObservableCollection(Of EgtDataGridColumn)
|
||||
Public Property BeamMachiningsColumns As ObservableCollection(Of EgtDataGridColumn)
|
||||
Get
|
||||
Return m_BeamMachiningsColumns
|
||||
End Get
|
||||
Set(value As ObservableCollection(Of EgtDataGridColumn))
|
||||
m_BeamMachiningsColumns = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
#End Region ' FIELDS & PROPERTIES
|
||||
|
||||
#Region "CONSTRUCTOR"
|
||||
|
||||
Sub New(sTitle As String, sBaseDir As String, sMachTypePath As String, sTabTemplPath As String, Optional bIsBeam As Boolean = True)
|
||||
MyBase.New(sTitle, sBaseDir, sMachTypePath, sTabTemplPath, bIsBeam)
|
||||
' carico le colonne della datagrid
|
||||
GetPrivateProfileColumns(S_BEAMMACHININGS, BeamMachiningsColumns)
|
||||
' aggiorno la visibilità delle colonne
|
||||
For Each col In BeamMachiningsColumns
|
||||
col.ColumnVisibility = If(col.Visible, Visibility.Visible, Visibility.Collapsed)
|
||||
Next
|
||||
End Sub
|
||||
|
||||
#End Region ' CONSTRUCTOR
|
||||
|
||||
End Class
|
||||
@@ -0,0 +1,91 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace EgtBEAMWALL.EgtBEAMWALL.ViewerOptimizer.Behavior
|
||||
{
|
||||
public class DataGridColumnsBehavior
|
||||
{
|
||||
public static readonly DependencyProperty BindableColumnsProperty = DependencyProperty.RegisterAttached("BindableColumns", typeof(ObservableCollection<DataGridColumn>), typeof(DataGridColumnsBehavior), new UIPropertyMetadata(null, BindableColumnsPropertyChanged));
|
||||
/// <summary>Collection to store collection change handlers - to be able to unsubscribe later.</summary>
|
||||
private static readonly Dictionary<DataGrid, NotifyCollectionChangedEventHandler> _handlers;
|
||||
|
||||
static DataGridColumnsBehavior()
|
||||
{
|
||||
_handlers = new Dictionary<DataGrid, NotifyCollectionChangedEventHandler>();
|
||||
}
|
||||
private static void BindableColumnsPropertyChanged(DependencyObject source, DependencyPropertyChangedEventArgs e)
|
||||
{
|
||||
if (!(source is DataGrid dataGrid)) return;
|
||||
if (e.OldValue is ObservableCollection<DataGridColumn> oldColumns)
|
||||
{
|
||||
// Remove all columns.
|
||||
dataGrid.Columns.Clear();
|
||||
|
||||
// Unsubscribe from old collection.
|
||||
if (_handlers.TryGetValue(dataGrid, out var h))
|
||||
{
|
||||
oldColumns.CollectionChanged -= h;
|
||||
_handlers.Remove(dataGrid);
|
||||
}
|
||||
}
|
||||
|
||||
var newColumns = e.NewValue as ObservableCollection<DataGridColumn>;
|
||||
dataGrid.Columns.Clear();
|
||||
if (newColumns != null)
|
||||
{
|
||||
// Add columns from this source.
|
||||
foreach (var column in newColumns)
|
||||
if (column != null)
|
||||
{
|
||||
var dg = (DataGrid)column.GetType().GetProperty("DataGridOwner", BindingFlags.Instance | BindingFlags.NonPublic)?.GetValue(column, null);
|
||||
dg?.Columns.Clear();
|
||||
dataGrid.Columns.Add(column);
|
||||
}
|
||||
|
||||
|
||||
// Subscribe to future changes.
|
||||
NotifyCollectionChangedEventHandler h = (_, ne) => OnCollectionChanged(ne, dataGrid);
|
||||
_handlers[dataGrid] = h;
|
||||
newColumns.CollectionChanged += h;
|
||||
}
|
||||
}
|
||||
|
||||
private static void OnCollectionChanged(NotifyCollectionChangedEventArgs ne, DataGrid dataGrid)
|
||||
{
|
||||
switch (ne.Action)
|
||||
{
|
||||
case NotifyCollectionChangedAction.Reset:
|
||||
dataGrid.Columns.Clear();
|
||||
if (ne.NewItems != null && ne.NewItems.Count > 0)
|
||||
foreach (DataGridColumn column in ne.NewItems)
|
||||
dataGrid.Columns.Add(column);
|
||||
break;
|
||||
case NotifyCollectionChangedAction.Add:
|
||||
foreach (DataGridColumn column in ne.NewItems)
|
||||
dataGrid.Columns.Add(column);
|
||||
break;
|
||||
case NotifyCollectionChangedAction.Move:
|
||||
dataGrid.Columns.Move(ne.OldStartingIndex, ne.NewStartingIndex);
|
||||
break;
|
||||
case NotifyCollectionChangedAction.Remove:
|
||||
foreach (DataGridColumn column in ne.OldItems)
|
||||
dataGrid.Columns.Remove(column);
|
||||
break;
|
||||
case NotifyCollectionChangedAction.Replace:
|
||||
dataGrid.Columns[ne.NewStartingIndex] = ne.NewItems[0] as DataGridColumn;
|
||||
break;
|
||||
}
|
||||
}
|
||||
public static void SetBindableColumns(DependencyObject element, ObservableCollection<DataGridColumn> value)
|
||||
{
|
||||
element.SetValue(BindableColumnsProperty, value);
|
||||
}
|
||||
public static ObservableCollection<DataGridColumn> GetBindableColumns(DependencyObject element)
|
||||
{
|
||||
return (ObservableCollection<DataGridColumn>)element.GetValue(BindableColumnsProperty);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,94 @@
|
||||
Imports System.Collections.ObjectModel
|
||||
Imports System.Collections.Specialized
|
||||
Imports System.Reflection
|
||||
|
||||
Public Class DataGridColumnsBehavior
|
||||
Public Shared ReadOnly BindableColumnsProperty As DependencyProperty = DependencyProperty.RegisterAttached("BindableColumns", GetType(ObservableCollection(Of DataGridColumn)), GetType(DataGridColumnsBehavior), New UIPropertyMetadata(Nothing, AddressOf BindableColumnsPropertyChanged))
|
||||
Private Shared ReadOnly _handlers As Dictionary(Of DataGrid, NotifyCollectionChangedEventHandler)
|
||||
|
||||
Shared Sub New()
|
||||
_handlers = New Dictionary(Of DataGrid, NotifyCollectionChangedEventHandler)()
|
||||
End Sub
|
||||
|
||||
Private Shared Sub BindableColumnsPropertyChanged(ByVal source As DependencyObject, ByVal e As DependencyPropertyChangedEventArgs)
|
||||
Dim dataGrid As DataGrid = Nothing
|
||||
If Not (source Is dataGrid) Then Return
|
||||
Dim h = Nothing, oldColumns As ObservableCollection(Of DataGridColumn) = Nothing
|
||||
|
||||
If e.OldValue Is oldColumns Then
|
||||
dataGrid.Columns.Clear()
|
||||
|
||||
If _handlers.TryGetValue(dataGrid, h) Then
|
||||
RemoveHandler oldColumns.CollectionChanged, h
|
||||
_handlers.Remove(dataGrid)
|
||||
End If
|
||||
End If
|
||||
|
||||
Dim newColumns = TryCast(e.NewValue, ObservableCollection(Of DataGridColumn))
|
||||
dataGrid.Columns.Clear()
|
||||
|
||||
If newColumns IsNot Nothing Then
|
||||
|
||||
For Each column In newColumns
|
||||
|
||||
If column IsNot Nothing Then
|
||||
Dim dg = CType(column.[GetType]().GetProperty("DataGridOwner", BindingFlags.Instance Or BindingFlags.NonPublic)?.GetValue(column, Nothing), DataGrid)
|
||||
dg?.Columns.Clear()
|
||||
dataGrid.Columns.Add(column)
|
||||
End If
|
||||
Next
|
||||
|
||||
Dim h As NotifyCollectionChangedEventHandler = Function(__, ne) OnCollectionChanged(ne, dataGrid)
|
||||
_handlers(dataGrid) = h
|
||||
AddHandler newColumns.CollectionChanged, h
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Shared Sub OnCollectionChanged(ByVal ne As NotifyCollectionChangedEventArgs, ByVal dataGrid As DataGrid)
|
||||
Select Case ne.Action
|
||||
Case NotifyCollectionChangedAction.Reset
|
||||
dataGrid.Columns.Clear()
|
||||
|
||||
If ne.NewItems IsNot Nothing AndAlso ne.NewItems.Count > 0 Then
|
||||
|
||||
For Each column As DataGridColumn In ne.NewItems
|
||||
dataGrid.Columns.Add(column)
|
||||
Next
|
||||
End If
|
||||
|
||||
Case NotifyCollectionChangedAction.Add
|
||||
|
||||
For Each column As DataGridColumn In ne.NewItems
|
||||
dataGrid.Columns.Add(column)
|
||||
Next
|
||||
|
||||
Case NotifyCollectionChangedAction.Move
|
||||
dataGrid.Columns.Move(ne.OldStartingIndex, ne.NewStartingIndex)
|
||||
Case NotifyCollectionChangedAction.Remove
|
||||
|
||||
For Each column As DataGridColumn In ne.OldItems
|
||||
dataGrid.Columns.Remove(column)
|
||||
Next
|
||||
|
||||
Case NotifyCollectionChangedAction.Replace
|
||||
dataGrid.Columns(ne.NewStartingIndex) = TryCast(ne.NewItems(0), DataGridColumn)
|
||||
End Select
|
||||
End Sub
|
||||
|
||||
Public Shared Sub SetBindableColumns(ByVal element As DependencyObject, ByVal value As ObservableCollection(Of DataGridColumn))
|
||||
element.SetValue(BindableColumnsProperty, value)
|
||||
End Sub
|
||||
|
||||
Public Shared Function GetBindableColumns(ByVal element As DependencyObject) As ObservableCollection(Of DataGridColumn)
|
||||
Return CType(element.GetValue(BindableColumnsProperty), ObservableCollection(Of DataGridColumn))
|
||||
End Function
|
||||
|
||||
Private Class CSharpImpl
|
||||
<Obsolete("Please refactor calling code to use normal Visual Basic assignment")>
|
||||
Shared Function __Assign(Of T)(ByRef target As T, value As T) As T
|
||||
target = value
|
||||
Return value
|
||||
End Function
|
||||
End Class
|
||||
|
||||
End Class
|
||||
@@ -0,0 +1,45 @@
|
||||
<EgtWPFLib5:EgtCustomWindow x:Class="BlockedWndV"
|
||||
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"
|
||||
Style="{DynamicResource {x:Type EgtWPFLib5:EgtCustomWindow}}"
|
||||
Title="{Binding Title}" WindowStartupLocation="CenterOwner"
|
||||
Height="200" Width="400">
|
||||
|
||||
<Grid>
|
||||
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
</Grid.RowDefinitions>
|
||||
<TextBlock Grid.Row="1"
|
||||
Text="{Binding Msg_Text}"
|
||||
TextAlignment="Center"
|
||||
Margin="40,0,40,0"/>
|
||||
<Grid Grid.Row="5">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Button Grid.Column="1" Content="{Binding Save_Msg}"
|
||||
IsDefault="True"
|
||||
Command="{Binding Save_Command}"
|
||||
Visibility="{Binding Buttons_Visibility}"
|
||||
Style="{StaticResource EgtWPFLib5_InputButton}"/>
|
||||
<Button Grid.Column="3" Content="{Binding DoNotSave_Msg}"
|
||||
Command="{Binding DoNotSave_Command}"
|
||||
Visibility="{Binding Buttons_Visibility}"
|
||||
Style="{StaticResource EgtWPFLib5_InputButton}"/>
|
||||
</Grid>
|
||||
|
||||
</Grid>
|
||||
|
||||
</EgtWPFLib5:EgtCustomWindow>
|
||||
@@ -0,0 +1,18 @@
|
||||
Public Class BlockedWndV
|
||||
|
||||
Private WithEvents m_BlockedWndVM As BlockedWndVM
|
||||
|
||||
Sub New(Owner As Window, BlockedWndVM As BlockedWndVM)
|
||||
MyBase.New(Owner)
|
||||
' This call is required by the designer.
|
||||
InitializeComponent()
|
||||
Me.DataContext = BlockedWndVM
|
||||
' Assegno al riferimento locale al VM il VM preso dal DataContext
|
||||
m_BlockedWndVM = BlockedWndVM
|
||||
End Sub
|
||||
|
||||
Private Sub CloseWindow(bDialogResult As Boolean) Handles m_BlockedWndVM.m_CloseWindow
|
||||
Me.DialogResult = bDialogResult
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
@@ -0,0 +1,160 @@
|
||||
Imports System.Windows.Threading
|
||||
Imports EgtBEAMWALL.Core
|
||||
Imports EgtUILib
|
||||
Imports EgtWPFLib5
|
||||
|
||||
Public Class BlockedWndVM
|
||||
Inherits VMBase
|
||||
|
||||
#Region "FIELDS & PROPERTIES"
|
||||
|
||||
Friend Event m_CloseWindow(bDialogResult As Boolean)
|
||||
|
||||
Private m_Waiting_Timer As New DispatcherTimer
|
||||
|
||||
Private WaitingTimer_TickHandler As New EventHandler(AddressOf WaitingTimer_Tick)
|
||||
|
||||
Private m_Buttons_Visibility As Visibility = Visibility.Visible
|
||||
Public ReadOnly Property Buttons_Visibility As Visibility
|
||||
Get
|
||||
Return m_Buttons_Visibility
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_nIndex As Integer = 0
|
||||
|
||||
#Region "Messages"
|
||||
|
||||
Private m_Msg_Text As String
|
||||
Public ReadOnly Property Msg_Text As String
|
||||
Get
|
||||
Return m_Msg_Text
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property Save_Msg As String
|
||||
Get
|
||||
Return EgtMsg(61966)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property DoNotSave_Msg As String
|
||||
Get
|
||||
Return EgtMsg(61967)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
#End Region ' Messages
|
||||
|
||||
' Definizione comandi
|
||||
Private m_cmdSave As ICommand
|
||||
Private m_cmdDoNotSave As ICommand
|
||||
|
||||
#End Region ' FIELDS & PROPERTIES
|
||||
|
||||
Sub New()
|
||||
If DbControllers.bNetwork Then
|
||||
m_Buttons_Visibility = Visibility.Visible
|
||||
m_Msg_Text = "Ottimizzatore bloccato per ricalcolo trave. Salvare le modifiche apportate al progetto?"
|
||||
Else
|
||||
m_Msg_Text = "In attesa del ricalcolo da parte del supervisore."
|
||||
m_Buttons_Visibility = Visibility.Collapsed
|
||||
Save()
|
||||
End If
|
||||
NotifyPropertyChanged(NameOf(Msg_Text))
|
||||
NotifyPropertyChanged(NameOf(Buttons_Visibility))
|
||||
' avvio contatore
|
||||
m_Waiting_Timer.Interval = TimeSpan.FromMilliseconds(500)
|
||||
AddHandler m_Waiting_Timer.Tick, WaitingTimer_TickHandler
|
||||
m_Waiting_Timer.Start()
|
||||
End Sub
|
||||
|
||||
Private Sub WaitingTimer_Tick()
|
||||
' se notifica di chiusura da supervisor, esco
|
||||
If Not SupervisorCommThread.bViewerOptimizerBlocked And Map.refMainWindowVM.m_ManagingSupervisorStop Then
|
||||
If m_Waiting_Timer.IsEnabled Then
|
||||
m_Waiting_Timer.Stop()
|
||||
RemoveHandler m_Waiting_Timer.Tick, WaitingTimer_TickHandler
|
||||
End If
|
||||
' se mi viene passato un Id di MachGroup aggiunto
|
||||
If SupervisorCommThread.m_AddedMachGroupId > 0 Then
|
||||
' ricarico progetto
|
||||
Dim sCurrFilePath As String = ""
|
||||
EgtGetCurrFilePath(sCurrFilePath)
|
||||
EgtOpenFile(sCurrFilePath)
|
||||
' aggiungo a lista nuovo MachGroup
|
||||
Map.refProjectVM.MachGroupPanelVM.AddMachGroupToList(SupervisorCommThread.m_AddedMachGroupId)
|
||||
End If
|
||||
Map.refMainWindowVM.m_ManagingSupervisorStop = False
|
||||
RaiseEvent m_CloseWindow(True)
|
||||
End If
|
||||
' incremento contatore
|
||||
m_nIndex += 1
|
||||
' se passata attesa per risposta utente
|
||||
If m_nIndex = 17 Then
|
||||
' aggiorno finestra con attesa fine calcolo
|
||||
m_Msg_Text = "In attesa del ricalcolo da parte del supervisore."
|
||||
m_Buttons_Visibility = Visibility.Collapsed
|
||||
NotifyPropertyChanged(NameOf(Buttons_Visibility))
|
||||
NotifyPropertyChanged(NameOf(Msg_Text))
|
||||
' mando messaggio di blocco avvenuto
|
||||
DbControllers.m_StatusMapController.UpdateAction("", ProjectManagerVM.CurrProd.nProdId, ProjectManagerVM.CurrProd.nProdId, StatusMapItemType.Comm, StatusMapOpType.ViewOptimStoped, "")
|
||||
End If
|
||||
End Sub
|
||||
|
||||
#Region "COMMANDS"
|
||||
|
||||
#Region "Save"
|
||||
|
||||
''' <summary>
|
||||
''' Returns a command that do Exec.
|
||||
''' </summary>
|
||||
Public ReadOnly Property Save_Command As ICommand
|
||||
Get
|
||||
If m_cmdSave Is Nothing Then
|
||||
m_cmdSave = New Command(AddressOf Save)
|
||||
End If
|
||||
Return m_cmdSave
|
||||
End Get
|
||||
End Property
|
||||
|
||||
''' <summary>
|
||||
''' Execute the Exec. This method is invoked by the ExecCommand.
|
||||
''' </summary>
|
||||
Public Sub Save()
|
||||
' salvo progetto
|
||||
'Map.refProdManagerVM.Save()
|
||||
Map.refOnlyProdManagerVM.Save()
|
||||
' mando messaggio di blocco avvenuto
|
||||
DbControllers.m_StatusMapController.UpdateAction("", ProjectManagerVM.CurrProd.nProdId, ProjectManagerVM.CurrProd.nProdId, StatusMapItemType.Comm, StatusMapOpType.ViewOptimStoped, "")
|
||||
End Sub
|
||||
|
||||
#End Region ' Save
|
||||
|
||||
#Region "DoNotSave"
|
||||
|
||||
''' <summary>
|
||||
''' Returns a command that do Exec.
|
||||
''' </summary>
|
||||
Public ReadOnly Property DoNotSave_Command As ICommand
|
||||
Get
|
||||
If m_cmdDoNotSave Is Nothing Then
|
||||
m_cmdDoNotSave = New Command(AddressOf DoNotSave)
|
||||
End If
|
||||
Return m_cmdDoNotSave
|
||||
End Get
|
||||
End Property
|
||||
|
||||
''' <summary>
|
||||
''' Execute the Exec. This method is invoked by the ExecCommand.
|
||||
''' </summary>
|
||||
Public Sub DoNotSave()
|
||||
' mando messaggio di blocco avvenuto
|
||||
DbControllers.m_StatusMapController.UpdateAction("", ProjectManagerVM.CurrProd.nProdId, ProjectManagerVM.CurrProd.nProdId, StatusMapItemType.Comm, StatusMapOpType.ViewOptimStoped, "")
|
||||
End Sub
|
||||
|
||||
#End Region ' DoNotSave
|
||||
|
||||
#End Region ' COMMANDS
|
||||
|
||||
End Class
|
||||
@@ -0,0 +1,106 @@
|
||||
<Grid x:Class="BottomPanelV"
|
||||
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:EgtBEAMWALL="clr-namespace:EgtBEAMWALL.Optimizer"
|
||||
Height="350"
|
||||
Visibility="{Binding BottomPanel_Visibility}">
|
||||
|
||||
<TabControl SelectedIndex="{Binding SelPartFeatureTab}"
|
||||
TabStripPlacement="Right"
|
||||
Margin="5">
|
||||
<TabControl.ItemContainerStyle>
|
||||
<Style TargetType="{x:Type TabItem}">
|
||||
<Setter Property="Visibility" Value="Collapsed"/>
|
||||
</Style>
|
||||
</TabControl.ItemContainerStyle>
|
||||
<TabItem Header="STRUCTURE">
|
||||
<TabItem.Content>
|
||||
<EgtWPFLib5:EgtScrollViewer Focusable="False">
|
||||
<EgtBEAMWALL:BTLDataV DataContext="{StaticResource BTLDataWndVM}"
|
||||
Tag="{Binding Tag, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:BottomPanelV}}}"
|
||||
Margin="5"/>
|
||||
</EgtWPFLib5:EgtScrollViewer>
|
||||
</TabItem.Content>
|
||||
</TabItem>
|
||||
<TabItem Header="PART">
|
||||
<TabItem.Content>
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
<EgtWPFLib5:EgtScrollViewer Focusable="False">
|
||||
<EgtBEAMWALL:PartParametersV DataContext="{StaticResource PartParametersVM}"
|
||||
Tag="{Binding Tag.SelBTLPart, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:BottomPanelV}}}"
|
||||
Margin="5"/>
|
||||
</EgtWPFLib5:EgtScrollViewer>
|
||||
<TextBlock Grid.Row="1"
|
||||
Text="{Binding Tag.SelBTLPart.sCALC_MSG, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:BottomPanelV}}}"
|
||||
Foreground="{Binding Tag.SelBTLPart.CALC_ERR_Foreground, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:BottomPanelV}}}"
|
||||
Margin="5,0,5,0"
|
||||
Visibility="{Binding Tag.SelBTLPart.CALC_MSG_Visibility, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:BottomPanelV}}}"/>
|
||||
</Grid>
|
||||
</TabItem.Content>
|
||||
</TabItem>
|
||||
<TabItem Header="FEATURE">
|
||||
<TabItem.Content>
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="300"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.Resources>
|
||||
<Style TargetType="TextBlock">
|
||||
<Style.Triggers>
|
||||
<Trigger Property="Text" Value="">
|
||||
<Setter Property="Visibility" Value="Collapsed"/>
|
||||
</Trigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</Grid.Resources>
|
||||
<EgtBEAMWALL:FeatureManagerV DataContext="{StaticResource FeatureManagerVM}"
|
||||
Tag="{Binding Tag.SelBTLPart.SelBTLFeatureVM, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:BottomPanelV}}}"/>
|
||||
<TabControl Grid.Row="1"
|
||||
TabStripPlacement="Left"
|
||||
Margin="5,5,2.5,5">
|
||||
<TabItem Header="P">
|
||||
<TabItem.Content>
|
||||
<EgtBEAMWALL:PParameterListV DataContext="{StaticResource PParameterListVM}"
|
||||
Tag="{Binding Tag.SelBTLPart.SelBTLFeatureVM, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:BottomPanelV}}}"
|
||||
Margin="5"/>
|
||||
</TabItem.Content>
|
||||
</TabItem>
|
||||
<TabItem Header="Q">
|
||||
<TabItem.Content>
|
||||
<EgtBEAMWALL:QParameterListV DataContext="{StaticResource QParameterListVM}"
|
||||
Tag="{Binding Tag.SelBTLPart.SelBTLFeatureVM, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:BottomPanelV}}}"
|
||||
Margin="5"/>
|
||||
</TabItem.Content>
|
||||
</TabItem>
|
||||
</TabControl>
|
||||
<Image Grid.Column="1"
|
||||
Grid.Row="1"
|
||||
Source="{Binding sCurrDraw}"
|
||||
Margin="5"/>
|
||||
<TextBlock Grid.Row="2" Grid.ColumnSpan="2"
|
||||
Text="{Binding Tag.SelBTLPart.SelBTLFeatureVM.sCALC_MSG, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:BottomPanelV}}}"
|
||||
Foreground="{Binding Tag.SelBTLPart.SelBTLFeatureVM.Calc_Background, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:BottomPanelV}}}"
|
||||
Margin="5,0,5,0"/>
|
||||
</Grid>
|
||||
</TabItem.Content>
|
||||
</TabItem>
|
||||
<TabItem Header="STATISTICS">
|
||||
<TabItem.Content>
|
||||
<EgtBEAMWALL:StatisticsV DataContext="{StaticResource StatisticsVM}"
|
||||
Tag="{Binding Tag, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:BottomPanelV}}}"
|
||||
Margin="5"/>
|
||||
</TabItem.Content>
|
||||
</TabItem>
|
||||
</TabControl>
|
||||
</Grid>
|
||||
@@ -0,0 +1,3 @@
|
||||
Public Class BottomPanelV
|
||||
|
||||
End Class
|
||||
@@ -0,0 +1,51 @@
|
||||
Imports EgtWPFLib5
|
||||
|
||||
Public Class BottomPanelVM
|
||||
Inherits VMBase
|
||||
|
||||
Friend Enum PartFeatureTab As Integer
|
||||
NULL = -1
|
||||
STRUCTURE_ = 0
|
||||
PART = 1
|
||||
FEATURE = 2
|
||||
STATISTICS = 3
|
||||
End Enum
|
||||
|
||||
Private m_SelPartFeatureTab As PartFeatureTab
|
||||
Public Property SelPartFeatureTab As Integer
|
||||
Get
|
||||
Return m_SelPartFeatureTab
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
m_SelPartFeatureTab = value
|
||||
End Set
|
||||
End Property
|
||||
Friend Sub SetSelPartFeatureTab(SelPartFeatureTab As PartFeatureTab)
|
||||
If m_SelPartFeatureTab = PartFeatureTab.STATISTICS Then
|
||||
Map.refInstrumentPanelVM.SetStatisticsIsChecked(False)
|
||||
End If
|
||||
m_SelPartFeatureTab = SelPartFeatureTab
|
||||
NotifyPropertyChanged(NameOf(SelPartFeatureTab))
|
||||
End Sub
|
||||
|
||||
Private m_sCurrDraw As String
|
||||
Public ReadOnly Property sCurrDraw As String
|
||||
Get
|
||||
Return m_sCurrDraw
|
||||
End Get
|
||||
End Property
|
||||
Friend Sub SetCurrDraw(sCurrDraw As String)
|
||||
m_sCurrDraw = sCurrDraw
|
||||
NotifyPropertyChanged(NameOf(sCurrDraw))
|
||||
End Sub
|
||||
|
||||
#Region "CONSTRUCTOR"
|
||||
|
||||
Sub New()
|
||||
' Creo riferimento a questa classe in EgtCAM5Map
|
||||
Map.SetRefBottomPanelVM(Me)
|
||||
End Sub
|
||||
|
||||
#End Region ' CONSTRUCTOR
|
||||
|
||||
End Class
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,69 @@
|
||||
<EgtFloating:EgtFloatingPanel x:Class="CalcPanelV"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:EgtFloating="clr-namespace:EgtWPFLib5.EgtFloating;assembly=EgtWPFLib5"
|
||||
IsTopDockable="True" IsBottomDockable="False" IsLeftDockable="False"
|
||||
IsRightDockable="False" Style="{StaticResource ToolBar_EgtFloatingPanel}">
|
||||
|
||||
<Button FontSize="20"
|
||||
FontWeight="Light"
|
||||
ToolTip="{Binding Verify_ToolTip}"
|
||||
Style="{StaticResource ToolBar_Button}"
|
||||
Command="{Binding Verify_Command}"
|
||||
IsEnabled="{Binding Verify_IsEnabled}">
|
||||
<Image Source="/Resources/CALCPanel/Verify.png" Stretch="Uniform"/>
|
||||
</Button>
|
||||
<Button FontSize="20"
|
||||
FontWeight="Light"
|
||||
ToolTip="{Binding VerifyAll_ToolTip}"
|
||||
Style="{StaticResource ToolBar_Button}"
|
||||
Command="{Binding VerifyAll_Command}"
|
||||
IsEnabled="{Binding VerifyAll_IsEnabled}">
|
||||
<Image Source="/Resources/CALCPanel/VerifyAll.png" Stretch="Uniform"/>
|
||||
</Button>
|
||||
<Button Command="{Binding ResetCalc_Command}"
|
||||
ToolTip="{Binding ResetCalc_ToolTip}"
|
||||
IsEnabled="{Binding CALCPanel_IsEnabled}"
|
||||
Style="{StaticResource ToolBar_Button}">
|
||||
<Image Source="/Resources/CALCPanel/ResetCalc.png" Stretch="Uniform"/>
|
||||
</Button>
|
||||
<Button ToolTip="{Binding Simulate_ToolTip}"
|
||||
Style="{StaticResource ToolBar_Button}"
|
||||
Command="{Binding Simulate_Command}"
|
||||
IsEnabled="{Binding Simulate_IsEnabled}">
|
||||
<Image Source="/Resources/CALCPanel/Simulate.png" Stretch="Uniform"/>
|
||||
</Button>
|
||||
<Button ToolTip="{Binding Edit_ToolTip}"
|
||||
Style="{StaticResource ToolBar_Button}"
|
||||
Command="{Binding Edit_Command}"
|
||||
IsEnabled="{Binding Edit_IsEnabled}"
|
||||
Visibility="{Binding Edit_Visibility}">
|
||||
<Image Source="/Resources/CALCPanel/Edit.png" Stretch="Uniform"/>
|
||||
</Button>
|
||||
<Button ToolTip="{Binding ChooseMachine_ToolTip}"
|
||||
Style="{StaticResource ToolBar_Button}"
|
||||
Command="{Binding ChooseMachine_Command}"
|
||||
IsEnabled="{Binding CALCPanel_IsEnabled}"
|
||||
Visibility="{Binding ChooseMachineBtn_Visibility}">
|
||||
<Image Source="/Resources/CALCPanel/ChooseMachine.png" Stretch="Uniform"/>
|
||||
</Button>
|
||||
|
||||
<Grid Margin="0,0,5,0" Visibility="{Binding ChooseMachine_Visibility}">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<!--Combobox per selezionare la macchina corrente-->
|
||||
<ComboBox ItemsSource="{Binding Path=MachineList}" DisplayMemberPath="Name"
|
||||
SelectedItem="{Binding Path=SelectedMachine}" SelectedValuePath="Name"
|
||||
Height="22" Width="150"
|
||||
Grid.Column="0"/>
|
||||
<Button Content="OK"
|
||||
FontSize="10"
|
||||
FontWeight="Light"
|
||||
Style="{StaticResource ToolBar_Button}"
|
||||
Command="{Binding Ok_Command}"
|
||||
Grid.Column="1"/>
|
||||
</Grid>
|
||||
|
||||
</EgtFloating:EgtFloatingPanel>
|
||||
@@ -0,0 +1,3 @@
|
||||
Public Class CalcPanelV
|
||||
|
||||
End Class
|
||||
@@ -0,0 +1,64 @@
|
||||
<StackPanel x:Class="OnlyProdCalcPanelV"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:EgtFloating="clr-namespace:EgtWPFLib5.EgtFloating;assembly=EgtWPFLib5"
|
||||
Style="{StaticResource OnlyProdPartManager_StackPanel}">
|
||||
|
||||
<!--<Button ToolTip="{Binding Verify_ToolTip}"
|
||||
Command="{Binding Verify_Command}"
|
||||
IsEnabled="{Binding Verify_IsEnabled}"
|
||||
Style="{StaticResource ToolBarViewPanel_Button}">
|
||||
<Image Source="/Resources/CALCPanel/Verify.png" Stretch="Uniform"/>
|
||||
</Button>
|
||||
<Button ToolTip="{Binding VerifyAll_ToolTip}"
|
||||
Command="{Binding VerifyAll_Command}"
|
||||
IsEnabled="{Binding VerifyAll_IsEnabled}"
|
||||
Style="{StaticResource ToolBarViewPanel_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 ToolBarViewPanel_Button}">
|
||||
<Image Source="/Resources/CALCPanel/ResetCalc.png" Stretch="Uniform"/>
|
||||
</Button>-->
|
||||
<!--<Button ToolTip="{Binding Simulate_ToolTip}"
|
||||
Command="{Binding Simulate_Command}"
|
||||
IsEnabled="{Binding Simulate_IsEnabled}"
|
||||
Style="{StaticResource ToolBarViewPanel_Button}">
|
||||
<Image Source="/Resources/CALCPanel/Simulate.png" Stretch="Uniform"/>
|
||||
</Button>-->
|
||||
<!--<Button ToolTip="{Binding Edit_ToolTip}"
|
||||
Command="{Binding Edit_Command}"
|
||||
IsEnabled="{Binding Edit_IsEnabled}"
|
||||
Visibility="{Binding Edit_Visibility}"
|
||||
Style="{StaticResource ToolBarViewPanel_Button}">
|
||||
<Image Source="/Resources/CALCPanel/Edit.png" Stretch="Uniform"/>
|
||||
</Button>-->
|
||||
<Button ToolTip="{Binding ChooseMachine_ToolTip}"
|
||||
Command="{Binding ChooseMachine_Command}"
|
||||
IsEnabled="{Binding CALCPanel_IsEnabled}"
|
||||
Visibility="{Binding ChooseMachineBtn_Visibility}"
|
||||
Style="{StaticResource ToolBarViewPanel_Button}">
|
||||
<Image Source="/Resources/CALCPanel/ChooseMachine.png" Stretch="Uniform"/>
|
||||
</Button>
|
||||
|
||||
<Grid Margin="0,0,5,0" Visibility="{Binding ChooseMachine_Visibility}">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<!--Combobox per selezionare la macchina corrente-->
|
||||
<ComboBox Grid.Column="0"
|
||||
ItemsSource="{Binding Path=MachineList}"
|
||||
DisplayMemberPath="Name"
|
||||
SelectedItem="{Binding Path=SelectedMachine}"
|
||||
SelectedValuePath="Name"
|
||||
Style="{StaticResource OnlyProdCalcPanel_ComboBox}"/>
|
||||
<Button Grid.Column="1"
|
||||
Content="OK"
|
||||
Command="{Binding Ok_Command}"
|
||||
Style="{StaticResource ToolBarOnlyProdCalcPanel_Button}"/>
|
||||
</Grid>
|
||||
|
||||
</StackPanel>
|
||||
@@ -0,0 +1,3 @@
|
||||
Public Class OnlyProdCalcPanelV
|
||||
|
||||
End Class
|
||||
@@ -0,0 +1,77 @@
|
||||
<EgtWPFLib5:EgtCustomWindow x:Class="ChangeMaterialWndV"
|
||||
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:EgtBEAMWALL="clr-namespace:EgtBEAMWALL.Optimizer"
|
||||
Style="{DynamicResource {x:Type EgtWPFLib5:EgtCustomWindow}}"
|
||||
WindowStyle="None" ResizeMode="NoResize"
|
||||
SizeToContent="WidthAndHeight"
|
||||
WindowStartupLocation="CenterOwner"
|
||||
IsClosable="False"
|
||||
IsMinimizable="False"
|
||||
IsResizable="False"
|
||||
Title="ChangeMaterialWnd">
|
||||
|
||||
<Grid Margin="5,5,5,0">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<Grid HorizontalAlignment="Center"
|
||||
Grid.Row="0"
|
||||
Margin="0,0,0,5">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
<TextBlock Text="{Binding ProjMaterial_Msg}"
|
||||
Style="{StaticResource OptionTextBlock}"/>
|
||||
<ComboBox ItemsSource="{Binding ProjMaterialList}"
|
||||
SelectedItem="{Binding SelProjMaterial}"
|
||||
Grid.Column="1"
|
||||
Width="150"
|
||||
Style="{StaticResource FeatureComboBox}"/>
|
||||
</Grid>
|
||||
<Grid HorizontalAlignment="Center"
|
||||
Grid.Row="1"
|
||||
Margin="0,0,0,5">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock Text="{Binding WjMaterial_Msg}"
|
||||
Style="{StaticResource OptionTextBlock}"/>
|
||||
<ComboBox ItemsSource="{Binding WhMaterialList}"
|
||||
SelectedItem="{Binding SelWhMaterial}"
|
||||
Grid.Column="1"
|
||||
Width="150"
|
||||
Style="{StaticResource FeatureComboBox}"/>
|
||||
</Grid>
|
||||
|
||||
<Grid Grid.Row="2"
|
||||
Margin="0,0,0,5">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Button Content="{Binding Ok_Msg}"
|
||||
Command="{Binding Ok_Command}"
|
||||
IsDefault="True"
|
||||
Grid.Column="1"
|
||||
Style="{StaticResource EgtWPFLib5_InputButton}"/>
|
||||
<Button Content="{Binding Cancel_Msg}"
|
||||
IsCancel="True"
|
||||
Grid.Column="3"
|
||||
Style="{StaticResource EgtWPFLib5_InputButton}"/>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</EgtWPFLib5:EgtCustomWindow>
|
||||
@@ -0,0 +1,18 @@
|
||||
Public Class ChangeMaterialWndV
|
||||
|
||||
Private WithEvents m_ChangeMaterialWndVM As ChangeMaterialWndVM
|
||||
|
||||
Sub New(Owner As Window, ChangeMaterialWndVM As ChangeMaterialWndVM)
|
||||
MyBase.New(Owner)
|
||||
' This call is required by the designer.
|
||||
InitializeComponent()
|
||||
Me.DataContext = ChangeMaterialWndVM
|
||||
' Assegno al riferimento locale al VM il VM preso dal DataContext
|
||||
m_ChangeMaterialWndVM = ChangeMaterialWndVM
|
||||
End Sub
|
||||
|
||||
Private Sub CloseWindow(bDialogResult As Boolean) Handles m_ChangeMaterialWndVM.m_CloseWindow
|
||||
Me.DialogResult = bDialogResult
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
@@ -0,0 +1,140 @@
|
||||
Imports System.Collections.ObjectModel
|
||||
Imports EgtUILib
|
||||
Imports EgtWPFLib5
|
||||
Imports EgtBEAMWALL.Core
|
||||
|
||||
Public Class ChangeMaterialWndVM
|
||||
Inherits VMBase
|
||||
|
||||
#Region "FIELDS & PROPERTIES"
|
||||
|
||||
Friend Event m_CloseWindow(bDialogResult As Boolean)
|
||||
|
||||
Private m_ProjMaterialList As New ObservableCollection(Of String)
|
||||
Public Property ProjMaterialList As ObservableCollection(Of String)
|
||||
Get
|
||||
Return m_ProjMaterialList
|
||||
End Get
|
||||
Set(value As ObservableCollection(Of String))
|
||||
m_ProjMaterialList = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_SelProjMaterial As String
|
||||
Public Property SelProjMaterial As String
|
||||
Get
|
||||
Return m_SelProjMaterial
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_SelProjMaterial = value
|
||||
NotifyPropertyChanged(NameOf(SelProjMaterial))
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_WhMaterialList As New ObservableCollection(Of String)
|
||||
Public Property WhMaterialList As ObservableCollection(Of String)
|
||||
Get
|
||||
Return m_WhMaterialList
|
||||
End Get
|
||||
Set(value As ObservableCollection(Of String))
|
||||
m_WhMaterialList = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_SelWhMaterial As String
|
||||
Public Property SelWhMaterial As String
|
||||
Get
|
||||
Return m_SelWhMaterial
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_SelWhMaterial = value
|
||||
NotifyPropertyChanged(NameOf(SelWhMaterial))
|
||||
End Set
|
||||
End Property
|
||||
|
||||
' Definizione comandi
|
||||
Private m_cmdOk As ICommand
|
||||
|
||||
#End Region ' FIELDS & PROPERTIES
|
||||
|
||||
#Region "MESSAGES"
|
||||
|
||||
Public ReadOnly Property ProjMaterial_Msg As String
|
||||
Get
|
||||
Return EgtMsg(61962)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property WjMaterial_Msg As String
|
||||
Get
|
||||
Return EgtMsg(61963)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property Ok_Msg As String
|
||||
Get
|
||||
Return EgtMsg(61761)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property Cancel_Msg As String
|
||||
Get
|
||||
Return EgtMsg(61763)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
#End Region ' MESSAGES
|
||||
|
||||
#Region "CONSTRUCTOR"
|
||||
|
||||
Sub New()
|
||||
' recupero i materiali del progetto
|
||||
m_ProjMaterialList.Clear()
|
||||
For Each BTLPart In Map.refProjectVM.BTLStructureVM.BTLPartVMList
|
||||
If Not m_ProjMaterialList.Contains(BTLPart.sMATERIAL) Then
|
||||
m_ProjMaterialList.Add(BTLPart.sMATERIAL)
|
||||
End If
|
||||
Next
|
||||
' recupero la lista dei SectionXMaterial presenti in Warehouse
|
||||
Dim WhSectXMatList As List(Of SectionXMaterial) = WarehouseWndVM.GetSectionXMaterialsFromWarehouse()
|
||||
' ricavo la lista dei materiali presenti in Warehouse
|
||||
m_WhMaterialList.Clear()
|
||||
For Each WhSectXMat In WhSectXMatList
|
||||
For Each sMatItem In WhSectXMat.sMaterial
|
||||
If Not m_WhMaterialList.Contains(sMatItem) Then
|
||||
m_WhMaterialList.Add(sMatItem)
|
||||
End If
|
||||
Next
|
||||
Next
|
||||
End Sub
|
||||
|
||||
#End Region ' CONSTRUCTOR
|
||||
|
||||
#Region "COMMANDS"
|
||||
|
||||
#Region "Ok"
|
||||
|
||||
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()
|
||||
'verifico che tutti i campi contengano un valore valido
|
||||
If Not IsNothing(m_SelProjMaterial) AndAlso m_SelProjMaterial <> "" AndAlso
|
||||
Not IsNothing(m_SelWhMaterial) AndAlso m_SelWhMaterial <> "" Then
|
||||
RaiseEvent m_CloseWindow(True)
|
||||
Else
|
||||
MessageBox.Show(EgtMsg(61858), EgtMsg(30007))
|
||||
End If
|
||||
End Sub
|
||||
|
||||
#End Region ' Ok
|
||||
|
||||
#End Region ' COMMANDS
|
||||
|
||||
End Class
|
||||
@@ -0,0 +1,95 @@
|
||||
<EgtWPFLib5:EgtCustomWindow x:Class="ChangeParameterWndV"
|
||||
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:EgtBEAMWALL="clr-namespace:EgtBEAMWALL.Optimizer"
|
||||
Style="{DynamicResource {x:Type EgtWPFLib5:EgtCustomWindow}}"
|
||||
WindowStyle="None" ResizeMode="NoResize"
|
||||
SizeToContent="Height"
|
||||
Width="300"
|
||||
WindowStartupLocation="CenterOwner"
|
||||
IsClosable="False"
|
||||
IsMinimizable="False"
|
||||
IsResizable="False"
|
||||
Title="ChangeParameterWnd">
|
||||
|
||||
<Grid Margin="5,5,5,0">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="2*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="5"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="5"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="5"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="5"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<TextBlock Text="Process"
|
||||
Style="{StaticResource OptionTextBlock}"/>
|
||||
<ComboBox Grid.Column="1"
|
||||
ItemsSource="{Binding PRCList}"
|
||||
SelectedItem="{Binding SelPRC}"
|
||||
DisplayMemberPath="ghDesc"
|
||||
HorizontalAlignment="Stretch"
|
||||
Style="{StaticResource FeatureComboBox}"/>
|
||||
|
||||
<TextBlock Grid.Row="2"
|
||||
Text="Parameter"
|
||||
Style="{StaticResource OptionTextBlock}"/>
|
||||
<ComboBox Grid.Row="2" Grid.Column="1"
|
||||
ItemsSource="{Binding ParamList}"
|
||||
SelectedItem="{Binding SelParam}"
|
||||
DisplayMemberPath="sNameAndDescription"
|
||||
HorizontalAlignment="Stretch"
|
||||
Style="{StaticResource FeatureComboBox}"/>
|
||||
|
||||
<TextBlock Grid.Row="4"
|
||||
Text="Actual value"
|
||||
Style="{StaticResource OptionTextBlock}"/>
|
||||
<EgtWPFLib5:EgtTextBox Grid.Row="4" Grid.Column="1"
|
||||
Text="{Binding SelParam.sActualValue}"
|
||||
Visibility="{Binding SelParam.IsTextBox_Visibility}"/>
|
||||
<CheckBox Grid.Row="4" Grid.Column="1"
|
||||
IsChecked="{Binding SelParam.bActualValue}"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
Visibility="{Binding SelParam.IsCheckBox_Visibility}"/>
|
||||
|
||||
<TextBlock Grid.Row="6" Text="New Value"
|
||||
Style="{StaticResource OptionTextBlock}"/>
|
||||
<EgtWPFLib5:EgtTextBox Grid.Row="6" Grid.Column="1"
|
||||
Text="{Binding SelParam.sNewValue}"
|
||||
Visibility="{Binding SelParam.IsTextBox_Visibility}"/>
|
||||
<CheckBox Grid.Row="6" Grid.Column="1"
|
||||
IsChecked="{Binding SelParam.bNewValue}"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
Visibility="{Binding SelParam.IsCheckBox_Visibility}"/>
|
||||
|
||||
<Grid Grid.Row="8" Grid.ColumnSpan="2"
|
||||
Margin="0,0,0,5">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Button Content="Ok"
|
||||
Command="{Binding Ok_Command}"
|
||||
IsDefault="True"
|
||||
Grid.Column="1"
|
||||
Style="{StaticResource EgtWPFLib5_InputButton}"/>
|
||||
<Button Content="Cancel"
|
||||
IsCancel="True"
|
||||
Grid.Column="3"
|
||||
Style="{StaticResource EgtWPFLib5_InputButton}"/>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</EgtWPFLib5:EgtCustomWindow>
|
||||
@@ -0,0 +1,18 @@
|
||||
Public Class ChangeParameterWndV
|
||||
|
||||
Private WithEvents m_ChangeParameterWndVM As ChangeParameterWndVM
|
||||
|
||||
Sub New(Owner As Window, ChangeParameterWndVM As ChangeParameterWndVM)
|
||||
MyBase.New(Owner)
|
||||
' This call is required by the designer.
|
||||
InitializeComponent()
|
||||
Me.DataContext = ChangeParameterWndVM
|
||||
' Assegno al riferimento locale al VM il VM preso dal DataContext
|
||||
m_ChangeParameterWndVM = ChangeParameterWndVM
|
||||
End Sub
|
||||
|
||||
Private Sub CloseWindow(bDialogResult As Boolean) Handles m_ChangeParameterWndVM.m_CloseWindow
|
||||
Me.DialogResult = bDialogResult
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
@@ -0,0 +1,234 @@
|
||||
Imports System.Collections.ObjectModel
|
||||
Imports EgtUILib
|
||||
Imports EgtWPFLib5
|
||||
Imports EgtBEAMWALL.Core
|
||||
|
||||
Public Class ChangeParameterWndVM
|
||||
Inherits VMBase
|
||||
|
||||
#Region "FIELDS & PROPERTIES"
|
||||
|
||||
Friend Event m_CloseWindow(bDialogResult As Boolean)
|
||||
|
||||
Private m_PRCList As New ObservableCollection(Of PRC)
|
||||
Public ReadOnly Property PRCList As ObservableCollection(Of PRC)
|
||||
Get
|
||||
Return m_PRCList
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_SelPRC As PRC = Nothing
|
||||
Public Property SelPRC As PRC
|
||||
Get
|
||||
Return m_SelPRC
|
||||
End Get
|
||||
Set(value As PRC)
|
||||
If value IsNot m_SelPRC Then
|
||||
m_SelPRC = value
|
||||
' aggiorno lista parametri
|
||||
m_ParamList.Clear()
|
||||
Dim ParamIndex As Integer = 1
|
||||
Dim NewBTLParam As BTLParamM = Nothing
|
||||
' leggo tutti i P della feature
|
||||
While BTLIniFile.GetBeamPrivateProfileParam(m_SelPRC.nGRP, m_SelPRC.nPRC, m_SelPRC.nVARIANT, True, ParamIndex, Nothing, NewBTLParam)
|
||||
m_ParamList.Add(New Parameters(NewBTLParam))
|
||||
ParamIndex += 1
|
||||
End While
|
||||
' aggiungo bDO come parametro
|
||||
m_ParamList.Add(New Parameters(BTLParamM.CreateNewBTLParam(), True))
|
||||
' seleziono parametro vuoto per dargli un valore iniziale ed evitare che visualizzi sia text che check
|
||||
m_SelParam = New Parameters(BTLParamM.CreateNewBTLParam())
|
||||
NotifyPropertyChanged(NameOf(SelParam))
|
||||
End If
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_ParamList As New ObservableCollection(Of Parameters)
|
||||
Public Property ParamList As ObservableCollection(Of Parameters)
|
||||
Get
|
||||
Return m_ParamList
|
||||
End Get
|
||||
Set(value As ObservableCollection(Of Parameters))
|
||||
m_ParamList = value
|
||||
End Set
|
||||
End Property
|
||||
Private m_SelParam As Parameters = New Parameters(BTLParamM.CreateNewBTLParam()) ' False, BTLParamType.STRING_, "") ' per dargli un valore iniziale ed evitare che visualizzi sia text che check
|
||||
Public Property SelParam As Parameters
|
||||
Get
|
||||
Return m_SelParam
|
||||
End Get
|
||||
Set(value As Parameters)
|
||||
m_SelParam = value
|
||||
NotifyPropertyChanged(NameOf(SelParam))
|
||||
End Set
|
||||
End Property
|
||||
|
||||
' Definizione comandi
|
||||
Private m_cmdOk As ICommand
|
||||
|
||||
#End Region ' FIELDS & PROPERTIES
|
||||
|
||||
#Region "CONSTRUCTOR"
|
||||
|
||||
Sub New()
|
||||
Dim TempPRCList As New ObservableCollection(Of Integer)
|
||||
GetBeamPrivateProfileProcessList(GRPType.T, TempPRCList)
|
||||
m_PRCList.Clear()
|
||||
For Each PRC In TempPRCList
|
||||
If Not IsNothing(Map.refProjectVM.BTLStructureVM) AndAlso Map.refProjectVM.BTLStructureVM.BTLPartVMList.Any(Function(x) x.BTLFeatureVMList.Any(Function(y) y.nPRC = PRC AndAlso CalcBeamPrivateProfileGRP(y.nSelGRP) = 1)) Then
|
||||
m_PRCList.Add(New PRC(GRPType.T, PRC, GetBeamPrivateProfileName(GRPType.T, PRC)))
|
||||
End If
|
||||
Next
|
||||
GetBeamPrivateProfileProcessList(GRPType.L, TempPRCList)
|
||||
For Each PRC In TempPRCList
|
||||
If Not IsNothing(Map.refProjectVM.BTLStructureVM) AndAlso Map.refProjectVM.BTLStructureVM.BTLPartVMList.Any(Function(x) x.BTLFeatureVMList.Any(Function(y) y.nPRC = PRC AndAlso CalcBeamPrivateProfileGRP(y.nSelGRP) = 0)) Then
|
||||
m_PRCList.Add(New PRC(GRPType.L, PRC, GetBeamPrivateProfileName(GRPType.L, PRC)))
|
||||
End If
|
||||
Next
|
||||
End Sub
|
||||
|
||||
#End Region ' CONSTRUCTOR
|
||||
|
||||
#Region "COMMANDS"
|
||||
|
||||
#Region "Ok"
|
||||
|
||||
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()
|
||||
'verifico che tutti i campi contengano un valore valido
|
||||
If Not IsNothing(m_SelPRC) AndAlso
|
||||
Not IsNothing(m_SelParam) AndAlso m_SelParam.sName <> "" Then
|
||||
RaiseEvent m_CloseWindow(True)
|
||||
Else
|
||||
MessageBox.Show(EgtMsg(61858), EgtMsg(30007))
|
||||
End If
|
||||
End Sub
|
||||
|
||||
#End Region ' Ok
|
||||
|
||||
#End Region ' COMMANDS
|
||||
|
||||
End Class
|
||||
|
||||
Public Class Parameters
|
||||
Inherits BTLParamVM
|
||||
|
||||
Private m_dActualValue As Double
|
||||
Private m_sActualValue As String
|
||||
Public ReadOnly Property dActualValue As Double
|
||||
Get
|
||||
Return m_dActualValue
|
||||
End Get
|
||||
End Property
|
||||
Public Property sActualValue As String
|
||||
Get
|
||||
Select Case m_BTLParamM.nType
|
||||
Case BTLParamType.DOUBLE_
|
||||
Return DoubleToString(m_dActualValue, 3)
|
||||
Case BTLParamType.LENGTH
|
||||
Return LenToString(m_dActualValue, 3)
|
||||
Case Else ' BTLParamType.STRING_
|
||||
Return m_sActualValue
|
||||
End Select
|
||||
End Get
|
||||
Set(value As String)
|
||||
Select Case m_BTLParamM.nType
|
||||
Case BTLParamType.DOUBLE_
|
||||
StringToDoubleAdv(value, m_dActualValue, True)
|
||||
Case BTLParamType.LENGTH
|
||||
StringToLenAdv(value, m_dActualValue, True)
|
||||
Case Else ' BTLParamType.STRING_
|
||||
m_sActualValue = value
|
||||
End Select
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_dNewValue As Double
|
||||
Private m_sNewValue As String
|
||||
Public ReadOnly Property dNewValue As Double
|
||||
Get
|
||||
Return m_dNewValue
|
||||
End Get
|
||||
End Property
|
||||
Public Property sNewValue As String
|
||||
Get
|
||||
Select Case m_BTLParamM.nType
|
||||
Case BTLParamType.DOUBLE_
|
||||
Return DoubleToString(m_dNewValue, 3)
|
||||
Case BTLParamType.LENGTH
|
||||
Return LenToString(m_dNewValue, 3)
|
||||
Case Else ' BTLParamType.STRING_
|
||||
Return m_sNewValue
|
||||
End Select
|
||||
End Get
|
||||
Set(value As String)
|
||||
Select Case m_BTLParamM.nType
|
||||
Case BTLParamType.DOUBLE_
|
||||
StringToDoubleAdv(value, m_dNewValue, True)
|
||||
Case BTLParamType.LENGTH
|
||||
StringToLenAdv(value, m_dNewValue, True)
|
||||
Case Else ' BTLParamType.STRING_
|
||||
m_sNewValue = value
|
||||
End Select
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_bActualValue As Boolean
|
||||
Public Property bActualValue As Boolean
|
||||
Get
|
||||
Return m_bActualValue
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
m_bActualValue = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_bNewValue As Boolean
|
||||
Public Property bNewValue As Boolean
|
||||
Get
|
||||
Return m_bNewValue
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
m_bNewValue = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_bIsCheckBox As Boolean = False
|
||||
Public Property IsTextBox_Visibility As Visibility
|
||||
Get
|
||||
Return If(m_bIsCheckBox, Visibility.Collapsed, Visibility.Visible)
|
||||
End Get
|
||||
Set(value As Visibility)
|
||||
m_bIsCheckBox = Not value
|
||||
End Set
|
||||
End Property
|
||||
Public Property IsCheckBox_Visibility As Visibility
|
||||
Get
|
||||
Return If(m_bIsCheckBox, Visibility.Visible, Visibility.Collapsed)
|
||||
End Get
|
||||
Set(value As Visibility)
|
||||
m_bIsCheckBox = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property sNameAndDescription As String
|
||||
Get
|
||||
Return If(m_bIsCheckBox, "Attivazione", sName & " " & sDescription)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Sub New(BTLParamM As BTLParamM, Optional IsCheckBox As Boolean = False)
|
||||
MyBase.New(BTLParamM)
|
||||
m_bIsCheckBox = IsCheckBox
|
||||
If IsCheckBox Then m_BTLParamM.SetType(BTLParamType.CHECKBOX)
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
@@ -0,0 +1,83 @@
|
||||
<DockPanel x:Class="ConfigurationPageV"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:EgtBEAMWALLCORE="clr-namespace:EgtBEAMWALL.Core;assembly=EgtBEAMWALL.Core"
|
||||
xmlns:EgtBEAMWALL="clr-namespace:EgtBEAMWALL.Optimizer"
|
||||
DataContext="{StaticResource ConfigurationPageVM}">
|
||||
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="10*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="6*"/>
|
||||
</Grid.RowDefinitions>
|
||||
<TabControl Grid.Row="0" Grid.Column="0" Grid.RowSpan="2" Grid.ColumnSpan="2"
|
||||
SelectedIndex="{Binding SelConfigSubPage}">
|
||||
<TabItem>
|
||||
<TabItem.Header>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<TextBlock Text="{Binding General_Msg}"
|
||||
Style="{StaticResource OptionTextBlock}"/>
|
||||
<Button Command="{Binding SaveCommand}"
|
||||
ToolTip="{Binding SaveToolTip}"
|
||||
Visibility="{Binding General_Visibility}"
|
||||
Style="{StaticResource OptionPanel_Button}">
|
||||
<Image Source="/Resources/ProjectManager/Save.png" Stretch="Uniform"/>
|
||||
</Button>
|
||||
</StackPanel>
|
||||
</TabItem.Header>
|
||||
<TabItem.Content>
|
||||
<EgtBEAMWALLCORE:General_ConfigurationPageV/>
|
||||
</TabItem.Content>
|
||||
</TabItem>
|
||||
<TabItem>
|
||||
<TabItem.Header>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<TextBlock Text="{Binding ParameterQ_Msg}"
|
||||
Style="{StaticResource OptionTextBlock}"/>
|
||||
<Button Command="{Binding SaveCommand}"
|
||||
ToolTip="{Binding SaveToolTip}"
|
||||
Visibility="{Binding ParameterQ_Visibility}"
|
||||
Style="{StaticResource OptionPanel_Button}">
|
||||
<Image Source="/Resources/ProjectManager/Save.png" Stretch="Uniform"/>
|
||||
</Button>
|
||||
</StackPanel>
|
||||
</TabItem.Header>
|
||||
<TabItem.Content>
|
||||
<EgtBEAMWALLCORE:QParameter_ConfigurationPageV/>
|
||||
</TabItem.Content>
|
||||
</TabItem>
|
||||
<TabItem>
|
||||
<TabItem.Header>
|
||||
<TextBlock Text="{Binding Machine_Msg}"
|
||||
Style="{StaticResource Machine_TextBlock}"/>
|
||||
</TabItem.Header>
|
||||
<TabItem.Content>
|
||||
<EgtBEAMWALLCORE:Machine_ConfigurationPageV/>
|
||||
</TabItem.Content>
|
||||
</TabItem>
|
||||
<TabItem>
|
||||
<TabItem.Header>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<TextBlock Text="{Binding PDFEditor_Msg}"
|
||||
Style="{StaticResource OptionTextBlock}"/>
|
||||
<Button Command="{Binding SaveCommand}"
|
||||
ToolTip="{Binding SaveToolTip}"
|
||||
Visibility="{Binding PDFEditor_Visibility}"
|
||||
Style="{StaticResource OptionPanel_Button}">
|
||||
<Image Source="/Resources/ProjectManager/Save.png" Stretch="Uniform"/>
|
||||
</Button>
|
||||
</StackPanel>
|
||||
</TabItem.Header>
|
||||
|
||||
<TabItem.Content>
|
||||
<EgtBEAMWALL:PDFEditorV/>
|
||||
</TabItem.Content>
|
||||
</TabItem>
|
||||
|
||||
</TabControl>
|
||||
</Grid>
|
||||
</DockPanel>
|
||||
@@ -0,0 +1,5 @@
|
||||
Public Class ConfigurationPageV
|
||||
Private Sub ScrollViewer_Scroll(sender As Object, e As Primitives.ScrollEventArgs)
|
||||
|
||||
End Sub
|
||||
End Class
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,118 @@
|
||||
<Grid x:Class="General_ConfigurationPageV"
|
||||
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">
|
||||
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
</Grid.RowDefinitions>
|
||||
<StackPanel Grid.Row="0" Grid.Column="0" Margin="5,5,5,0">
|
||||
<GroupBox Header="{Binding CurrentLanguage_Msg}"
|
||||
Margin="0,0,0,5">
|
||||
<UniformGrid Rows="2" Margin="3,3,3,3">
|
||||
<ComboBox ItemsSource="{Binding LanguageList, Mode=OneWay}" Height="25"
|
||||
DisplayMemberPath="Name" SelectedItem="{Binding SelectedLanguage}"
|
||||
Margin="0,0,0,5"/>
|
||||
<TextBlock Text="{Binding LanguageAdvert_Msg}" TextWrapping="Wrap"
|
||||
TextAlignment="Center"/>
|
||||
</UniformGrid>
|
||||
</GroupBox>
|
||||
<UniformGrid Columns="2"
|
||||
Margin="0,0,0,5">
|
||||
<TextBlock Text="{Binding MMUnits_Msg}" VerticalAlignment="Center"/>
|
||||
<ComboBox ItemsSource="{Binding UnitMeasureList, Mode=OneWay}"
|
||||
SelectedIndex="{Binding SelMeasureUnit}" Height="25"
|
||||
Margin="0,5,0,0"/>
|
||||
</UniformGrid>
|
||||
<GroupBox Header="{Binding Nesting_Msg}"
|
||||
Margin="0,0,0,5">
|
||||
<StackPanel>
|
||||
<UniformGrid Columns="2"
|
||||
Margin="0,0,0,5">
|
||||
<TextBlock Text="{Binding SectionTime_Msg}"
|
||||
Grid.Row="0" Grid.Column="0"/>
|
||||
<EgtWPFLib5:EgtTextBox Text="{Binding SectionTime, UpdateSourceTrigger=Explicit}"
|
||||
Grid.Row="0" Grid.Column="1"/>
|
||||
</UniformGrid>
|
||||
<UniformGrid Columns="2"
|
||||
Margin="0,0,0,5">
|
||||
<TextBlock Text="{Binding PartTime_Msg}"
|
||||
Grid.Row="1" Grid.Column="0"/>
|
||||
<EgtWPFLib5:EgtTextBox Text="{Binding PartTime, UpdateSourceTrigger=Explicit}"
|
||||
Grid.Row="1" Grid.Column="1"/>
|
||||
</UniformGrid>
|
||||
</StackPanel>
|
||||
</GroupBox>
|
||||
<UniformGrid Columns="2"
|
||||
Margin="0,0,0,5">
|
||||
<TextBlock Text="{Binding PrintLabel_Msg}" VerticalAlignment="Center"/>
|
||||
<CheckBox IsChecked="{Binding bPrintLabel_IsChecked}"
|
||||
Margin="0,5,0,0"/>
|
||||
</UniformGrid>
|
||||
<GroupBox Header="Backup And Restore">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
<Grid Grid.Row="0"
|
||||
Margin="0,2,0,5">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<CheckBox x:Name="ExternalBackup_CheckBox"
|
||||
IsChecked="{Binding bExternalBackupActive}"
|
||||
VerticalAlignment="Center"/>
|
||||
<TextBlock Grid.Column="1"
|
||||
Text="External file path:"
|
||||
VerticalAlignment="Center"/>
|
||||
</Grid>
|
||||
<Grid Grid.Row="1"
|
||||
Margin="0,2,0,5">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBox Text="{Binding ExternalBackupFolderPath}"
|
||||
IsEnabled="{Binding IsChecked, ElementName=ExternalBackup_CheckBox}"
|
||||
Margin="0,0,2.5,0"/>
|
||||
<Button Grid.Column="1"
|
||||
Content="..."
|
||||
Width="18"
|
||||
Command="{Binding ChooseExternalBackupFolderPath_Command}"
|
||||
IsEnabled="{Binding IsChecked, ElementName=ExternalBackup_CheckBox}"
|
||||
Margin="2.5,0,0,0"/>
|
||||
</Grid>
|
||||
<Grid Grid.Row="2">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock Text="Reminder Frequency"/>
|
||||
<ComboBox Grid.Column="1"
|
||||
ItemsSource="{Binding ReminderList}"
|
||||
SelectedItem="{Binding SelReminder}"/>
|
||||
</Grid>
|
||||
<StackPanel Grid.Row="3"
|
||||
Orientation="Horizontal">
|
||||
<Button Content="Backup"
|
||||
Command="{Binding Backup_Command}"
|
||||
Style="{StaticResource ToolBar_TextButton}"/>
|
||||
<Button Content="Restore"
|
||||
Command="{Binding Restore_Command}"
|
||||
Style="{StaticResource ToolBar_TextButton}"/>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</GroupBox>
|
||||
</StackPanel>
|
||||
|
||||
</Grid>
|
||||
@@ -0,0 +1,3 @@
|
||||
Public Class General_ConfigurationPageV
|
||||
|
||||
End Class
|
||||
@@ -0,0 +1,70 @@
|
||||
<Grid x:Class="Machine_ConfigurationPageV"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:EgtBEAMWALL="clr-namespace:EgtBEAMWALL.ViewerOptimizer"
|
||||
xmlns:EgtWPFLib5="clr-namespace:EgtWPFLib5;assembly=EgtWPFLib5">
|
||||
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="10*"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<StackPanel Grid.Row="0" Grid.Column="0" Orientation="Horizontal">
|
||||
<GroupBox Style="{StaticResource GroupBoxStyle_NoHeader}" Padding="5,10,5,5">
|
||||
<EgtBEAMWALL:MachinePanelV DataContext="{Binding MachinePanelVM}" VerticalAlignment="Center"/>
|
||||
</GroupBox>
|
||||
</StackPanel>
|
||||
|
||||
<StackPanel Grid.Row="1" Grid.Column="0" Orientation="Horizontal">
|
||||
<ItemsControl ItemsSource="{Binding ConfigMachTableList}">
|
||||
<ItemsControl.ItemsPanel>
|
||||
<ItemsPanelTemplate>
|
||||
<StackPanel x:Name="GroupStackPanel" Orientation="Horizontal"/>
|
||||
</ItemsPanelTemplate>
|
||||
</ItemsControl.ItemsPanel>
|
||||
<ItemsControl.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<GroupBox Header="{Binding sName}" Width="Auto" VerticalAlignment="Top" Height="Auto">
|
||||
<ItemsControl Name="MachParamsItemsControl" ItemsSource="{Binding MachParamList}" Margin="0,5,0,0">
|
||||
<ItemsControl.ItemsPanel>
|
||||
<ItemsPanelTemplate>
|
||||
<WrapPanel Orientation="Vertical"/>
|
||||
</ItemsPanelTemplate>
|
||||
</ItemsControl.ItemsPanel>
|
||||
<ItemsControl.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<Grid Margin="0,0,5,5">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock Text="{Binding sName}"
|
||||
TextWrapping="WrapWithOverflow"
|
||||
Width="100"
|
||||
Style="{StaticResource MachParamTextBlock}"/>
|
||||
<EgtWPFLib5:EgtTextBox Text="{Binding sValue, UpdateSourceTrigger=Explicit}"
|
||||
Grid.Column="1"
|
||||
Width="70"/>
|
||||
<TextBlock Text="{Binding sDescription}"
|
||||
TextWrapping="WrapWithOverflow"
|
||||
Width="200"
|
||||
Style="{StaticResource MachParamTextBlock}"
|
||||
Grid.Column="2"/>
|
||||
</Grid>
|
||||
</DataTemplate>
|
||||
</ItemsControl.ItemTemplate>
|
||||
</ItemsControl>
|
||||
</GroupBox>
|
||||
</DataTemplate>
|
||||
</ItemsControl.ItemTemplate>
|
||||
</ItemsControl>
|
||||
</StackPanel>
|
||||
|
||||
</Grid>
|
||||
@@ -0,0 +1,3 @@
|
||||
Public Class Machine_ConfigurationPageV
|
||||
|
||||
End Class
|
||||
@@ -0,0 +1,143 @@
|
||||
<Grid x:Class="OnlyProdCheckVersionV"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:EgtBEAMWALLCORE="clr-namespace:EgtBEAMWALL.Core;assembly=EgtBEAMWALL.Core"
|
||||
xmlns:EgtBEAMWALL="clr-namespace:EgtBEAMWALL.Optimizer">
|
||||
<Grid.Resources>
|
||||
<!--<EgtBEAMWALL:IsPermittedConverter x:Key="IsPermittedConverter"/>-->
|
||||
</Grid.Resources>
|
||||
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid Margin="10"
|
||||
VerticalAlignment="Top"
|
||||
HorizontalAlignment="Left">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
</Grid.RowDefinitions>
|
||||
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
|
||||
<TextBlock Text="{Binding ActVersion_Msg}"
|
||||
VerticalAlignment="Center"
|
||||
FontSize="15"
|
||||
FontWeight="Bold"
|
||||
Margin="10,0,0,0"
|
||||
Style="{StaticResource OptionTextBlock_OnlyProd}"/>
|
||||
<TextBlock Text="{Binding ActualVersion}"
|
||||
VerticalAlignment="Center"
|
||||
FontSize="15"
|
||||
FontWeight="Bold"
|
||||
Margin="10,0,0,0"
|
||||
Style="{StaticResource OptionTextBlock_OnlyProd}"/>
|
||||
</StackPanel>
|
||||
<UniformGrid Grid.Row="1"
|
||||
Columns="2"
|
||||
Margin="0,20,0,10">
|
||||
<Button Content="{Binding AllVersion_Msg}"
|
||||
Width="180"
|
||||
Command="{Binding GetAllReleaseCommand}"
|
||||
Style="{StaticResource OnlyProdEgtWPFLib5_InputButton}"/>
|
||||
<Button Content="{Binding VersionFrom_Msg}"
|
||||
Width="150"
|
||||
Command="{Binding GetVersionFromCommand}"
|
||||
Style="{StaticResource OnlyProdEgtWPFLib5_InputButton}"/>
|
||||
</UniformGrid>
|
||||
<Border Grid.Row="2"
|
||||
Margin="0,10,10,10"
|
||||
Visibility="{Binding ProgramVersionListVisibility}"
|
||||
Style="{StaticResource OnlyProdPage_Border}">
|
||||
<DataGrid ItemsSource="{Binding ProgramVersionList}"
|
||||
SelectedItem="{Binding ProgramVersionListItem}"
|
||||
AutoGenerateColumns="False"
|
||||
CanUserSortColumns="False"
|
||||
CanUserResizeColumns="False"
|
||||
CanUserResizeRows="False"
|
||||
CanUserReorderColumns="False"
|
||||
SelectionMode="Single"
|
||||
ScrollViewer.CanContentScroll="True"
|
||||
ScrollViewer.VerticalScrollBarVisibility="Auto"
|
||||
ScrollViewer.HorizontalScrollBarVisibility="Hidden"
|
||||
AlternatingRowBackground="{StaticResource BeamWall_LinkWater}"
|
||||
AlternationCount="2"
|
||||
CellStyle="{StaticResource CellDataGrid_CustomHighLight}"
|
||||
RowStyle="{StaticResource RowDataGrid_CustomHighLight}"
|
||||
Style="{StaticResource DataGrid_OnlyProd}">
|
||||
<DataGrid.ColumnHeaderStyle>
|
||||
<Style TargetType="{x:Type DataGridColumnHeader}">
|
||||
<Setter Property="Background" Value="{StaticResource BeamWall_Teal}"/>
|
||||
<Setter Property="Foreground" Value="{StaticResource BeamWall_White}"/>
|
||||
<Setter Property="HorizontalContentAlignment" Value="Center"/>
|
||||
<Setter Property="FontWeight" Value="Bold"/>
|
||||
<Setter Property="FontSize" Value="15"/>
|
||||
</Style>
|
||||
</DataGrid.ColumnHeaderStyle>
|
||||
<DataGrid.Columns>
|
||||
<!--Numero Versione-->
|
||||
<DataGridTemplateColumn Width="170">
|
||||
<DataGridTemplateColumn.HeaderTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding DataContext.NumVersion_Msg, RelativeSource={RelativeSource AncestorType=DataGrid}}"/>
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.HeaderTemplate>
|
||||
<DataGridTemplateColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding VersNum}"/>
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
<!--Versione-->
|
||||
<DataGridTemplateColumn Width="110">
|
||||
<DataGridTemplateColumn.HeaderTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding DataContext.Version_Msg, RelativeSource={RelativeSource AncestorType=DataGrid}}"/>
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.HeaderTemplate>
|
||||
<DataGridTemplateColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding VersText}"/>
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
<!--Data di Rilascio-->
|
||||
<DataGridTemplateColumn Width="160">
|
||||
<DataGridTemplateColumn.HeaderTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding DataContext.DateVersion_Msg, RelativeSource={RelativeSource AncestorType=DataGrid}}"/>
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.HeaderTemplate>
|
||||
<DataGridTemplateColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding ReleaseDate, StringFormat=dd/MM/yyyy}"/>
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
<!--Stato Versione-->
|
||||
<DataGridTemplateColumn Width="150">
|
||||
<DataGridTemplateColumn.HeaderTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding DataContext.StateVersion_Msg, RelativeSource={RelativeSource AncestorType=DataGrid}}"/>
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.HeaderTemplate>
|
||||
<!--<DataGridTemplateColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding Converter={StaticResource IsPermittedConverter}}"/>
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellTemplate>-->
|
||||
</DataGridTemplateColumn>
|
||||
</DataGrid.Columns>
|
||||
</DataGrid>
|
||||
</Border>
|
||||
</Grid>
|
||||
<Border Grid.Column="1"
|
||||
Margin="0,10,10,10"
|
||||
Style="{StaticResource OnlyProdPage_Border}">
|
||||
<!--<WebView:WebView2 Grid.Column="1"
|
||||
Source="{Binding LinkVersionView}"/>-->
|
||||
</Border>
|
||||
|
||||
</Grid>
|
||||
@@ -0,0 +1,3 @@
|
||||
Public Class OnlyProdCheckVersionV
|
||||
|
||||
End Class
|
||||
@@ -0,0 +1,112 @@
|
||||
<DockPanel x:Class="OnlyProdConfigurationPageV"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:EgtBEAMWALLCORE="clr-namespace:EgtBEAMWALL.Core;assembly=EgtBEAMWALL.Core"
|
||||
xmlns:EgtBEAMWALL="clr-namespace:EgtBEAMWALL.Optimizer"
|
||||
DataContext="{StaticResource ConfigurationPageVM}">
|
||||
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="10*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="6*"/>
|
||||
</Grid.RowDefinitions>
|
||||
<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">
|
||||
<TextBlock Text="{Binding General_Msg}"
|
||||
FontSize="15"/>
|
||||
<Button Command="{Binding SaveCommand}"
|
||||
ToolTip="{Binding SaveToolTip}"
|
||||
Visibility="{Binding General_Visibility}"
|
||||
Style="{StaticResource SaveOptionPanel_Button}">
|
||||
<Image Source="/Resources/ProjectManager/Save.png" Stretch="Uniform"/>
|
||||
</Button>
|
||||
</StackPanel>
|
||||
</TabItem.Header>
|
||||
<TabItem.Content>
|
||||
<EgtBEAMWALLCORE:OnlyProdGeneral_ConfigurationPageV/>
|
||||
</TabItem.Content>
|
||||
</TabItem>
|
||||
<!--<TabItem>
|
||||
<TabItem.Header>
|
||||
<StackPanel Orientation="Horizontal" Margin="5">
|
||||
<TextBlock Text="{Binding ParameterQ_Msg}"
|
||||
FontSize="15"/>
|
||||
<Button Command="{Binding SaveCommand}"
|
||||
ToolTip="{Binding SaveToolTip}"
|
||||
Visibility="{Binding ParameterQ_Visibility}"
|
||||
Style="{StaticResource SaveOptionPanel_Button}">
|
||||
<Image Source="/Resources/ProjectManager/Save.png" Stretch="Uniform"/>
|
||||
</Button>
|
||||
</StackPanel>
|
||||
</TabItem.Header>
|
||||
<TabItem.Content>
|
||||
<EgtBEAMWALLCORE:OnlyProdQParameter_ConfigurationPageV/>
|
||||
</TabItem.Content>
|
||||
</TabItem>-->
|
||||
<TabItem>
|
||||
<TabItem.Header>
|
||||
<StackPanel Orientation="Horizontal" Margin="5">
|
||||
<TextBlock Text="{Binding Machine_Msg}"
|
||||
FontSize="15"/>
|
||||
</StackPanel>
|
||||
</TabItem.Header>
|
||||
<TabItem.Content>
|
||||
<EgtBEAMWALLCORE:OnlyProdMachine_ConfigurationPageV/>
|
||||
</TabItem.Content>
|
||||
</TabItem>
|
||||
<TabItem>
|
||||
<TabItem.Header>
|
||||
<StackPanel Orientation="Horizontal" Margin="5">
|
||||
<TextBlock Text="{Binding PDFEditor_Msg}"
|
||||
FontSize="15"/>
|
||||
<Button Command="{Binding SaveCommand}"
|
||||
ToolTip="{Binding SaveToolTip}"
|
||||
Visibility="{Binding PDFEditor_Visibility}"
|
||||
Style="{StaticResource SaveOptionPanel_Button}">
|
||||
<Image Source="/Resources/ProjectManager/Save.png" Stretch="Uniform"/>
|
||||
</Button>
|
||||
</StackPanel>
|
||||
</TabItem.Header>
|
||||
<TabItem.Content>
|
||||
<EgtBEAMWALL:OnlyProdPDFEditorV/>
|
||||
</TabItem.Content>
|
||||
</TabItem>
|
||||
<!--<TabItem>
|
||||
<TabItem.Header>
|
||||
<StackPanel Orientation="Horizontal" Margin="5">
|
||||
<TextBlock Text="{Binding CtrlVersion_Msg}"
|
||||
FontSize="15"/>
|
||||
</StackPanel>
|
||||
</TabItem.Header>
|
||||
<TabItem.Content>
|
||||
<EgtBEAMWALL:OnlyProdCheckVersionV/>
|
||||
</TabItem.Content>
|
||||
</TabItem>-->
|
||||
</TabControl>
|
||||
</Grid>
|
||||
</DockPanel>
|
||||
@@ -0,0 +1,2 @@
|
||||
Public Class OnlyProdConfigurationPageV
|
||||
End Class
|
||||
@@ -0,0 +1,80 @@
|
||||
<Grid x:Class="QParameter_ConfigurationPageV"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:EgtBEAMWALL="clr-namespace:EgtBEAMWALL.ViewerOptimizer">
|
||||
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="2*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="1*"/>
|
||||
</Grid.RowDefinitions>
|
||||
<EgtBEAMWALL:QParamListV DataContext="{Binding}"
|
||||
ItemsSource="{Binding QBTLParamVMList}"
|
||||
SelectedItem="{Binding SelQParam}"
|
||||
Grid.Column="0"
|
||||
Margin="5">
|
||||
<DataGrid.GroupStyle>
|
||||
<GroupStyle>
|
||||
<GroupStyle.Panel>
|
||||
<ItemsPanelTemplate>
|
||||
<DataGridRowsPresenter/>
|
||||
</ItemsPanelTemplate>
|
||||
</GroupStyle.Panel>
|
||||
<GroupStyle.HeaderTemplate>
|
||||
<DataTemplate>
|
||||
<StackPanel>
|
||||
<TextBlock Text="{Binding Path=Name}"/>
|
||||
</StackPanel>
|
||||
</DataTemplate>
|
||||
</GroupStyle.HeaderTemplate>
|
||||
<GroupStyle.ContainerStyle>
|
||||
<Style TargetType="{x:Type GroupItem}">
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="{x:Type GroupItem}">
|
||||
<Expander IsExpanded="True">
|
||||
<Expander.Background>
|
||||
<SolidColorBrush Color="#FFBABABA"></SolidColorBrush>
|
||||
</Expander.Background>
|
||||
<Expander.Header>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<TextBlock Text="{Binding Path=Name}" />
|
||||
</StackPanel>
|
||||
</Expander.Header>
|
||||
<ItemsPresenter />
|
||||
</Expander>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
</GroupStyle.ContainerStyle>
|
||||
</GroupStyle>
|
||||
<GroupStyle>
|
||||
<GroupStyle.ContainerStyle>
|
||||
<Style TargetType="{x:Type GroupItem}">
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="{x:Type GroupItem}">
|
||||
<Expander IsExpanded="True">
|
||||
<Expander.Background>
|
||||
<SolidColorBrush Color="LightGray"></SolidColorBrush>
|
||||
</Expander.Background>
|
||||
<Expander.Header>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<TextBlock Text="{Binding Path=Name}" />
|
||||
</StackPanel>
|
||||
</Expander.Header>
|
||||
<ItemsPresenter />
|
||||
</Expander>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
</GroupStyle.ContainerStyle>
|
||||
</GroupStyle>
|
||||
</DataGrid.GroupStyle>
|
||||
</EgtBEAMWALL:QParamListV>
|
||||
|
||||
</Grid>
|
||||
@@ -0,0 +1,3 @@
|
||||
Public Class QParameter_ConfigurationPageV
|
||||
|
||||
End Class
|
||||
@@ -0,0 +1,16 @@
|
||||
Module ConstWarehouseIni
|
||||
|
||||
Public Const WH_BASIC_INI_FILE_NAME As String = "Basic.ini"
|
||||
Public Const WH_MEDIUM_INI_FILE_NAME As String = "Medium.ini"
|
||||
|
||||
Public Const K_CURRENTL As String = "CurrentL"
|
||||
Public Const K_CURRENTS As String = "CurrentS"
|
||||
Public Const K_STARTOFFSET As String = "StartOffset"
|
||||
Public Const K_KERF As String = "Kerf"
|
||||
Public Const K_OFFSET As String = "Offset"
|
||||
Public Const K_QUANTITY As String = "Quantity"
|
||||
Public Const K_L As String = "L"
|
||||
Public Const K_S As String = "S"
|
||||
Public Const K_RANGE As String = "Range"
|
||||
|
||||
End Module
|
||||
@@ -0,0 +1,4 @@
|
||||
Public Interface IListItemConverter
|
||||
Function Convert(ByVal masterListItem As Object) As Object
|
||||
Function ConvertBack(ByVal targetListItem As Object) As Object
|
||||
End Interface
|
||||
@@ -0,0 +1,78 @@
|
||||
Imports System.Windows.Controls.Primitives
|
||||
|
||||
Public Class MultiSelectorBehaviours
|
||||
|
||||
Public Shared ReadOnly SynchronizedSelectedItemsProperty As DependencyProperty = DependencyProperty.RegisterAttached("SynchronizedSelectedItems", GetType(IList), GetType(MultiSelectorBehaviours), New PropertyMetadata(Nothing, AddressOf OnSynchronizedSelectedItemsChanged))
|
||||
Public Shared ReadOnly SynchronizationManagerProperty As DependencyProperty = DependencyProperty.RegisterAttached("SynchronizationManager", GetType(SynchronizationManager), GetType(MultiSelectorBehaviours), New PropertyMetadata(Nothing))
|
||||
|
||||
|
||||
Public Shared Function GetSynchronizedSelectedItems(ByVal dependencyObject As DependencyObject) As IList
|
||||
Return CType(dependencyObject.GetValue(SynchronizedSelectedItemsProperty), IList)
|
||||
End Function
|
||||
|
||||
Public Shared Sub SetSynchronizedSelectedItems(ByVal dependencyObject As DependencyObject, ByVal value As IList)
|
||||
dependencyObject.SetValue(SynchronizedSelectedItemsProperty, value)
|
||||
End Sub
|
||||
|
||||
Private Shared Function GetSynchronizationManager(ByVal dependencyObject As DependencyObject) As SynchronizationManager
|
||||
Return CType(dependencyObject.GetValue(SynchronizationManagerProperty), SynchronizationManager)
|
||||
End Function
|
||||
|
||||
Private Shared Sub SetSynchronizationManager(ByVal dependencyObject As DependencyObject, ByVal value As SynchronizationManager)
|
||||
dependencyObject.SetValue(SynchronizationManagerProperty, value)
|
||||
End Sub
|
||||
|
||||
Private Shared Sub OnSynchronizedSelectedItemsChanged(ByVal dependencyObject As DependencyObject, ByVal e As DependencyPropertyChangedEventArgs)
|
||||
If e.OldValue IsNot Nothing Then
|
||||
Dim synchronizer As SynchronizationManager = GetSynchronizationManager(dependencyObject)
|
||||
synchronizer.StopSynchronizing()
|
||||
SetSynchronizationManager(dependencyObject, Nothing)
|
||||
End If
|
||||
|
||||
Dim list As IList = TryCast(e.NewValue, IList)
|
||||
Dim selector As Selector = TryCast(dependencyObject, Selector)
|
||||
|
||||
If list IsNot Nothing AndAlso selector IsNot Nothing Then
|
||||
Dim synchronizer As SynchronizationManager = GetSynchronizationManager(dependencyObject)
|
||||
|
||||
If synchronizer Is Nothing Then
|
||||
synchronizer = New SynchronizationManager(selector)
|
||||
SetSynchronizationManager(dependencyObject, synchronizer)
|
||||
End If
|
||||
|
||||
synchronizer.StartSynchronizingList()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Class SynchronizationManager
|
||||
Private ReadOnly _multiSelector As Selector
|
||||
Private _synchronizer As TwoListSynchronizer
|
||||
|
||||
Friend Sub New(ByVal selector As Selector)
|
||||
_multiSelector = selector
|
||||
End Sub
|
||||
|
||||
Public Sub StartSynchronizingList()
|
||||
Dim list As IList = GetSynchronizedSelectedItems(_multiSelector)
|
||||
|
||||
If list IsNot Nothing Then
|
||||
_synchronizer = New TwoListSynchronizer(GetSelectedItemsCollection(_multiSelector), list)
|
||||
_synchronizer.StartSynchronizing()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Public Sub StopSynchronizing()
|
||||
_synchronizer.StopSynchronizing()
|
||||
End Sub
|
||||
|
||||
Public Shared Function GetSelectedItemsCollection(ByVal selector As Selector) As IList
|
||||
If TypeOf selector Is MultiSelector Then
|
||||
Return (TryCast(selector, MultiSelector)).SelectedItems
|
||||
ElseIf TypeOf selector Is ListBox Then
|
||||
Return (TryCast(selector, ListBox)).SelectedItems
|
||||
Else
|
||||
Throw New InvalidOperationException("Target object has no SelectedItems property to bind.")
|
||||
End If
|
||||
End Function
|
||||
End Class
|
||||
End Class
|
||||
@@ -0,0 +1,164 @@
|
||||
Imports System.Collections.Specialized
|
||||
|
||||
Public Class TwoListSynchronizer
|
||||
Implements IWeakEventListener
|
||||
|
||||
Private Shared ReadOnly DefaultConverter As IListItemConverter = New DoNothingListItemConverter()
|
||||
Private ReadOnly _masterList As IList
|
||||
Private ReadOnly _masterTargetConverter As IListItemConverter
|
||||
Private ReadOnly _targetList As IList
|
||||
|
||||
Public Sub New(ByVal masterList As IList, ByVal targetList As IList, ByVal masterTargetConverter As IListItemConverter)
|
||||
_masterList = masterList
|
||||
_targetList = targetList
|
||||
_masterTargetConverter = masterTargetConverter
|
||||
End Sub
|
||||
|
||||
Public Sub New(ByVal masterList As IList, ByVal targetList As IList)
|
||||
Me.New(masterList, targetList, DefaultConverter)
|
||||
End Sub
|
||||
|
||||
Private Delegate Sub ChangeListAction(ByVal list As IList, ByVal e As NotifyCollectionChangedEventArgs, ByVal converter As Converter(Of Object, Object))
|
||||
|
||||
Public Sub StartSynchronizing()
|
||||
ListenForChangeEvents(_masterList)
|
||||
ListenForChangeEvents(_targetList)
|
||||
SetListValuesFromSource(_masterList, _targetList, New Converter(Of Object, Object)(AddressOf ConvertFromMasterToTarget))
|
||||
|
||||
If Not TargetAndMasterCollectionsAreEqual() Then
|
||||
SetListValuesFromSource(_targetList, _masterList, New Converter(Of Object, Object)(AddressOf ConvertFromTargetToMaster))
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Public Sub StopSynchronizing()
|
||||
StopListeningForChangeEvents(_masterList)
|
||||
StopListeningForChangeEvents(_targetList)
|
||||
End Sub
|
||||
|
||||
Public Function ReceiveWeakEvent(ByVal managerType As Type, ByVal sender As Object, ByVal e As EventArgs) As Boolean Implements IWeakEventListener.ReceiveWeakEvent
|
||||
HandleCollectionChanged(TryCast(sender, IList), TryCast(e, NotifyCollectionChangedEventArgs))
|
||||
Return True
|
||||
End Function
|
||||
|
||||
Protected Sub ListenForChangeEvents(ByVal list As IList)
|
||||
If TypeOf list Is INotifyCollectionChanged Then
|
||||
CollectionChangedEventManager.AddListener(TryCast(list, INotifyCollectionChanged), Me)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Protected Sub StopListeningForChangeEvents(ByVal list As IList)
|
||||
If TypeOf list Is INotifyCollectionChanged Then
|
||||
CollectionChangedEventManager.RemoveListener(TryCast(list, INotifyCollectionChanged), Me)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub AddItems(ByVal list As IList, ByVal e As NotifyCollectionChangedEventArgs, ByVal converter As Converter(Of Object, Object))
|
||||
Dim itemCount As Integer = e.NewItems.Count
|
||||
|
||||
For i As Integer = 0 To itemCount - 1
|
||||
Dim insertionPoint As Integer = e.NewStartingIndex + i
|
||||
|
||||
If insertionPoint > list.Count Then
|
||||
list.Add(converter(e.NewItems(i)))
|
||||
Else
|
||||
list.Insert(insertionPoint, converter(e.NewItems(i)))
|
||||
End If
|
||||
Next
|
||||
End Sub
|
||||
|
||||
Private Function ConvertFromMasterToTarget(ByVal masterListItem As Object) As Object
|
||||
Return If(_masterTargetConverter Is Nothing, masterListItem, _masterTargetConverter.Convert(masterListItem))
|
||||
End Function
|
||||
|
||||
Private Function ConvertFromTargetToMaster(ByVal targetListItem As Object) As Object
|
||||
Return If(_masterTargetConverter Is Nothing, targetListItem, _masterTargetConverter.ConvertBack(targetListItem))
|
||||
End Function
|
||||
|
||||
Private Sub HandleCollectionChanged(ByVal sender As Object, ByVal e As NotifyCollectionChangedEventArgs)
|
||||
Dim sourceList As IList = TryCast(sender, IList)
|
||||
|
||||
Select Case e.Action
|
||||
Case NotifyCollectionChangedAction.Add
|
||||
PerformActionOnAllLists(AddressOf AddItems, sourceList, e)
|
||||
Case NotifyCollectionChangedAction.Move
|
||||
PerformActionOnAllLists(AddressOf MoveItems, sourceList, e)
|
||||
Case NotifyCollectionChangedAction.Remove
|
||||
PerformActionOnAllLists(AddressOf RemoveItems, sourceList, e)
|
||||
Case NotifyCollectionChangedAction.Replace
|
||||
PerformActionOnAllLists(AddressOf ReplaceItems, sourceList, e)
|
||||
Case NotifyCollectionChangedAction.Reset
|
||||
UpdateListsFromSource(TryCast(sender, IList))
|
||||
Case Else
|
||||
End Select
|
||||
End Sub
|
||||
|
||||
Private Sub MoveItems(ByVal list As IList, ByVal e As NotifyCollectionChangedEventArgs, ByVal converter As Converter(Of Object, Object))
|
||||
RemoveItems(list, e, converter)
|
||||
AddItems(list, e, converter)
|
||||
End Sub
|
||||
|
||||
Private Sub PerformActionOnAllLists(ByVal action As ChangeListAction, ByVal sourceList As IList, ByVal collectionChangedArgs As NotifyCollectionChangedEventArgs)
|
||||
If sourceList Is _masterList Then
|
||||
PerformActionOnList(_targetList, action, collectionChangedArgs, New Converter(Of Object, Object)(AddressOf ConvertFromMasterToTarget))
|
||||
Else
|
||||
PerformActionOnList(_masterList, action, collectionChangedArgs, New Converter(Of Object, Object)(AddressOf ConvertFromTargetToMaster))
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub PerformActionOnList(ByVal list As IList, ByVal action As ChangeListAction, ByVal collectionChangedArgs As NotifyCollectionChangedEventArgs, ByVal converter As Converter(Of Object, Object))
|
||||
StopListeningForChangeEvents(list)
|
||||
action(list, collectionChangedArgs, converter)
|
||||
ListenForChangeEvents(list)
|
||||
End Sub
|
||||
|
||||
Private Sub RemoveItems(ByVal list As IList, ByVal e As NotifyCollectionChangedEventArgs, ByVal converter As Converter(Of Object, Object))
|
||||
If e.OldItems.Count = 1 AndAlso e.OldStartingIndex <= list.Count - 1 Then
|
||||
list.RemoveAt(e.OldStartingIndex)
|
||||
Else
|
||||
For Each Item In e.OldItems
|
||||
list.Remove(Item)
|
||||
Next
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub ReplaceItems(ByVal list As IList, ByVal e As NotifyCollectionChangedEventArgs, ByVal converter As Converter(Of Object, Object))
|
||||
RemoveItems(list, e, converter)
|
||||
AddItems(list, e, converter)
|
||||
End Sub
|
||||
|
||||
Private Sub SetListValuesFromSource(ByVal sourceList As IList, ByVal targetList As IList, ByVal converter As Converter(Of Object, Object))
|
||||
StopListeningForChangeEvents(targetList)
|
||||
targetList.Clear()
|
||||
|
||||
For Each o As Object In sourceList
|
||||
targetList.Add(converter(o))
|
||||
Next
|
||||
|
||||
ListenForChangeEvents(targetList)
|
||||
End Sub
|
||||
|
||||
Private Function TargetAndMasterCollectionsAreEqual() As Boolean
|
||||
Return _masterList.Cast(Of Object)().SequenceEqual(_targetList.Cast(Of Object)().[Select](Function(item) ConvertFromTargetToMaster(item)))
|
||||
End Function
|
||||
|
||||
Private Sub UpdateListsFromSource(ByVal sourceList As IList)
|
||||
If sourceList Is _masterList Then
|
||||
SetListValuesFromSource(_masterList, _targetList, New Converter(Of Object, Object)(AddressOf ConvertFromMasterToTarget))
|
||||
Else
|
||||
SetListValuesFromSource(_targetList, _masterList, New Converter(Of Object, Object)(AddressOf ConvertFromTargetToMaster))
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Friend Class DoNothingListItemConverter
|
||||
Implements IListItemConverter
|
||||
|
||||
Public Function Convert(ByVal masterListItem As Object) As Object Implements IListItemConverter.Convert
|
||||
Return masterListItem
|
||||
End Function
|
||||
|
||||
Public Function ConvertBack(ByVal targetListItem As Object) As Object Implements IListItemConverter.ConvertBack
|
||||
Return targetListItem
|
||||
End Function
|
||||
End Class
|
||||
|
||||
End Class
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,36 @@
|
||||
<StackPanel x:Class="FeatureListManagerV"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
Orientation="Horizontal"
|
||||
HorizontalAlignment="Right"
|
||||
DataContext="{StaticResource FeatureListManagerVM}">
|
||||
|
||||
<Button Command="{Binding CopyFeature_Command}"
|
||||
Visibility="{Binding ViewPage_Visibility}"
|
||||
ToolTip="{Binding CopyFeature_ToolTip}"
|
||||
IsEnabled="{Binding CopyFeature_IsEnabled}"
|
||||
Style="{StaticResource LeftPanel_Button}">
|
||||
<Image Source="/Resources/LeftPanel/CopyFeature.png" Stretch="Uniform"/>
|
||||
</Button>
|
||||
<Button Command="{Binding MacroFeature_Command}"
|
||||
Visibility="{Binding ViewPage_Visibility}"
|
||||
ToolTip="{Binding MacroFeature_ToolTip}"
|
||||
IsEnabled="{Binding MacroFeature_IsEnabled}"
|
||||
Style="{StaticResource LeftPanel_Button}">
|
||||
<Image Source="/Resources/LeftPanel/MacroFeature.png" Stretch="Uniform"/>
|
||||
</Button>
|
||||
<Button Command="{Binding AddFeature_Command}"
|
||||
Visibility="{Binding ViewPage_Visibility}"
|
||||
ToolTip="{Binding AddFeature_ToolTip}"
|
||||
IsEnabled="{Binding AddFeature_IsEnabled}"
|
||||
Style="{StaticResource LeftPanel_Button}">
|
||||
<Image Source="/Resources/LeftPanel/AddFeature.png" Stretch="Uniform"/>
|
||||
</Button>
|
||||
<Button Command="{Binding RemoveFeature_Command}"
|
||||
Visibility="{Binding ViewPage_Visibility}"
|
||||
ToolTip="{Binding RemoveFeature_ToolTip}"
|
||||
IsEnabled="{Binding RemoveFeature_IsEnabled}"
|
||||
Style="{StaticResource LeftPanel_Button}">
|
||||
<Image Source="/Resources/LeftPanel/RemoveFeature.png" Stretch="Uniform"/>
|
||||
</Button>
|
||||
</StackPanel>
|
||||
@@ -0,0 +1,3 @@
|
||||
Public Class FeatureListManagerV
|
||||
|
||||
End Class
|
||||
@@ -0,0 +1,357 @@
|
||||
Imports EgtBEAMWALL.Core
|
||||
Imports EgtUILib.EgtInterface
|
||||
Imports EgtWPFLib5
|
||||
|
||||
Public Class FeatureListManagerVM
|
||||
Inherits VMBase
|
||||
|
||||
#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 PartIsSelected As Boolean
|
||||
Get
|
||||
Return Not IsNothing(Map.refProjectVM) AndAlso Not IsNothing(Map.refProjectVM.BTLStructureVM) AndAlso Not IsNothing(Map.refProjectVM.BTLStructureVM.SelBTLPart)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property FeatureIsSelected As Boolean
|
||||
Get
|
||||
Return PartIsSelected AndAlso Not IsNothing(Map.refProjectVM.BTLStructureVM.SelBTLPart.SelBTLFeatureVM)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
|
||||
Public ReadOnly Property CopyFeature_IsEnabled As Boolean
|
||||
Get
|
||||
Return PartIsSelected AndAlso FeatureIsSelected
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property MacroFeature_IsEnabled As Boolean
|
||||
Get
|
||||
Return PartIsSelected AndAlso FeatureIsSelected
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property AddFeature_IsEnabled As Boolean
|
||||
Get
|
||||
Return PartIsSelected AndAlso Not IsNothing(Map.refProjectVM.BTLStructureVM) AndAlso Not Map.refProjectVM.BTLStructureVM.SelBTLPartsCnt > 1
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property RemoveFeature_IsEnabled As Boolean
|
||||
Get
|
||||
Return PartIsSelected AndAlso FeatureIsSelected
|
||||
End Get
|
||||
End Property
|
||||
|
||||
|
||||
Private m_cmdCopyFeature As ICommand
|
||||
Private m_cmdMacroFeature As ICommand
|
||||
Private m_cmdAddFeature As ICommand
|
||||
Private m_cmdRemoveFeature As ICommand
|
||||
|
||||
#End Region ' Fields & Properties
|
||||
|
||||
#Region "Messages"
|
||||
|
||||
Public ReadOnly Property CopyFeature_ToolTip As String
|
||||
Get
|
||||
Return EgtMsg(61908)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property MacroFeature_ToolTip As String
|
||||
Get
|
||||
Return EgtMsg(61909)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property AddFeature_ToolTip As String
|
||||
Get
|
||||
Return EgtMsg(61910)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property RemoveFeature_ToolTip As String
|
||||
Get
|
||||
Return EgtMsg(61911)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
|
||||
#End Region ' Messages
|
||||
|
||||
#Region "CONSTRUCTOR"
|
||||
|
||||
Sub New()
|
||||
Map.SetRefFeatureListManagerVM(Me)
|
||||
End Sub
|
||||
|
||||
#End Region ' Constructor
|
||||
|
||||
#Region "METHODS"
|
||||
|
||||
Friend Sub UpdateView()
|
||||
NotifyPropertyChanged(NameOf(ViewPage_Visibility))
|
||||
End Sub
|
||||
|
||||
Friend Sub SetLeftPanelIsEnabled(bIsEnabled As Boolean)
|
||||
NotifyPropertyChanged(NameOf(CopyFeature_IsEnabled))
|
||||
NotifyPropertyChanged(NameOf(AddFeature_IsEnabled))
|
||||
NotifyPropertyChanged(NameOf(RemoveFeature_IsEnabled))
|
||||
NotifyPropertyChanged(NameOf(MacroFeature_IsEnabled))
|
||||
End Sub
|
||||
|
||||
Friend Sub PartShowAllChanged()
|
||||
NotifyPropertyChanged(NameOf(AddFeature_IsEnabled))
|
||||
End Sub
|
||||
|
||||
Friend Sub FeatureSelectionChanged()
|
||||
NotifyPropertyChanged(NameOf(CopyFeature_IsEnabled))
|
||||
NotifyPropertyChanged(NameOf(MacroFeature_IsEnabled))
|
||||
NotifyPropertyChanged(NameOf(RemoveFeature_IsEnabled))
|
||||
End Sub
|
||||
|
||||
Private Sub CreateNewFeature(MacroListCount As Integer, nSelMacro As Integer, AddFeatureWndVM As AddFeatureWndVM, nNewFeatureId As Integer, bMacroFlag As Boolean, NewFeat As BTLFeatureM)
|
||||
' verifico se una Macro è selezionata
|
||||
If MacroListCount > 0 AndAlso nSelMacro >= 0 Then
|
||||
' Creo nuova feature sulla base della Macro selezionata
|
||||
' Creo table e setto variabili
|
||||
CreateMacroTable()
|
||||
Dim bOk As Boolean
|
||||
If AddFeatureWndVM.nSelMacroDefault >= 0 Then
|
||||
bOk = EgtLuaExecFile(AddFeatureWndVM.m_MacroCustomFilePathList(nSelMacro))
|
||||
Else
|
||||
bOk = EgtLuaExecFile(AddFeatureWndVM.m_MacroFilePathList(nSelMacro))
|
||||
End If
|
||||
' Leggo variabili
|
||||
EgtLuaGetGlobIntVar("MACRO.FEATUREID", nNewFeatureId)
|
||||
' Reset lua
|
||||
EgtLuaResetGlobVar("MACRO")
|
||||
If Not bOk Then
|
||||
MessageBox.Show(EgtMsg(61869), EgtMsg(30007))
|
||||
Return
|
||||
End If
|
||||
bMacroFlag = True
|
||||
Else
|
||||
' Creo nuova feature (Macro non selezionata)
|
||||
NewFeat = BTLFeatureM.CreateBTLFeature(AddFeatureWndVM.nSelPRC.nPRC, AddFeatureWndVM.nSelPRC.nGRP, AddFeatureWndVM.nSelPRC.nSIDE)
|
||||
NewFeat.SetDefaultValues()
|
||||
Dim vPar() As Double = Nothing
|
||||
Dim sPar As String = String.Empty
|
||||
Dim vParQ() As String = Nothing
|
||||
NewFeat.CalcParamArray(vPar, sPar, vParQ)
|
||||
If NewFeat.nPRC = 900 Then NewFeat.sDES = "2"
|
||||
' aggiorno la feature con nuovo valore
|
||||
EgtBeamSetPart(Map.refProjectVM.BTLStructureVM.SelBTLPart.nPartId)
|
||||
nNewFeatureId = EgtBeamAddProcess(NewFeat.nSelGRP, NewFeat.nPRC, NewFeat.nSelSIDE, NewFeat.sDES,
|
||||
Map.refProjectVM.BTLStructureVM.SelBTLPart.BTLPartM.NewProcId(),
|
||||
New Frame3d(), vPar, sPar, vParQ, GDB_ID.NULL, GDB_ID.NULL)
|
||||
bMacroFlag = False
|
||||
End If
|
||||
' se è stata creata
|
||||
If nNewFeatureId <> GDB_ID.NULL Then
|
||||
MyMachGroupPanelM.SetDuploModified(Map.refProjectVM.BTLStructureVM.SelBTLPart.nPartId)
|
||||
' la aggiungo a struttura BTL corrente
|
||||
NewFeat = BTLFeatureM.CreateBTLFeature(Map.refProjectVM.BTLStructureVM.SelBTLPart.BTLPartM, nNewFeatureId)
|
||||
If Not bMacroFlag Then NewFeat.SetDefaultValues()
|
||||
Map.refProjectVM.BTLStructureVM.SelBTLPart.BTLPartM.AddBTLFeature(NewFeat)
|
||||
Map.refProjectVM.BTLStructureVM.SelBTLPart.SelBTLFeatureVM = Map.refProjectVM.BTLStructureVM.SelBTLPart.BTLFeatureVMList.FirstOrDefault(Function(x) x.BTLFeatureM Is NewFeat)
|
||||
Map.refProjectVM.BTLStructureVM.SelBTLPart.ResetCalcPart()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub CreateMacroTable()
|
||||
Dim nMacroW, nMacroH As Integer
|
||||
If Not IsNothing(Map.refProjectVM.BTLStructureVM) AndAlso Not IsNothing(Map.refProjectVM.BTLStructureVM.SelBTLPart) AndAlso Not IsNothing(Map.refProjectVM.BTLStructureVM.SelBTLPart.m_SelBTLFeatureVM) Then
|
||||
If Map.refProjectVM.BTLStructureVM.SelBTLPart.nROTATED = 0 OrElse Map.refProjectVM.BTLStructureVM.SelBTLPart.nROTATED = 180 Then
|
||||
If Map.refProjectVM.BTLStructureVM.SelBTLPart.m_SelBTLFeatureVM.nSelSIDE = 1 OrElse Map.refProjectVM.BTLStructureVM.SelBTLPart.m_SelBTLFeatureVM.nSelSIDE = 3 Then
|
||||
nMacroW = Map.refProjectVM.BTLStructureVM.SelBTLPart.dBtlW
|
||||
nMacroH = Map.refProjectVM.BTLStructureVM.SelBTLPart.dBtlH
|
||||
Else
|
||||
nMacroW = Map.refProjectVM.BTLStructureVM.SelBTLPart.dBtlH
|
||||
nMacroH = Map.refProjectVM.BTLStructureVM.SelBTLPart.dBtlW
|
||||
End If
|
||||
ElseIf Map.refProjectVM.BTLStructureVM.SelBTLPart.nROTATED = 90 OrElse Map.refProjectVM.BTLStructureVM.SelBTLPart.nROTATED = 270 Then
|
||||
If Map.refProjectVM.BTLStructureVM.SelBTLPart.m_SelBTLFeatureVM.nSelSIDE = 1 OrElse Map.refProjectVM.BTLStructureVM.SelBTLPart.m_SelBTLFeatureVM.nSelSIDE = 3 Then
|
||||
nMacroW = Map.refProjectVM.BTLStructureVM.SelBTLPart.dBtlH
|
||||
nMacroH = Map.refProjectVM.BTLStructureVM.SelBTLPart.dBtlW
|
||||
Else
|
||||
nMacroW = Map.refProjectVM.BTLStructureVM.SelBTLPart.dBtlW
|
||||
nMacroH = Map.refProjectVM.BTLStructureVM.SelBTLPart.dBtlH
|
||||
End If
|
||||
Else
|
||||
nMacroW = Map.refProjectVM.BTLStructureVM.SelBTLPart.dBtlW
|
||||
nMacroH = Map.refProjectVM.BTLStructureVM.SelBTLPart.dBtlH
|
||||
End If
|
||||
End If
|
||||
|
||||
EgtLuaCreateGlobTable("MACRO")
|
||||
EgtLuaSetGlobNumVar("MACRO.L", Map.refProjectVM.BTLStructureVM.SelBTLPart.dBtlL)
|
||||
EgtLuaSetGlobNumVar("MACRO.W", nMacroW)
|
||||
EgtLuaSetGlobNumVar("MACRO.H", nMacroH)
|
||||
EgtLuaSetGlobIntVar("MACRO.PROCID", Map.refProjectVM.BTLStructureVM.SelBTLPart.BTLPartM.NewProcId())
|
||||
End Sub
|
||||
|
||||
#End Region ' Methods
|
||||
|
||||
#Region "COMMANDS"
|
||||
|
||||
#Region "CopyFeature"
|
||||
|
||||
''' <summary>
|
||||
''' Returns a command that do Exec.
|
||||
''' </summary>
|
||||
Public ReadOnly Property CopyFeature_Command As ICommand
|
||||
Get
|
||||
If m_cmdCopyFeature Is Nothing Then
|
||||
m_cmdCopyFeature = New Command(AddressOf CopyFeature)
|
||||
End If
|
||||
Return m_cmdCopyFeature
|
||||
End Get
|
||||
End Property
|
||||
|
||||
''' <summary>
|
||||
''' Execute the Exec. This method is invoked by the ExecCommand.
|
||||
''' </summary>
|
||||
Public Sub CopyFeature()
|
||||
If IsNothing(ProjectManagerVM.CurrProj) Then Return
|
||||
Dim SelPart As BTLPartVM = Map.refProjectVM.BTLStructureVM.SelBTLPart
|
||||
If IsNothing(SelPart) Then Return
|
||||
Dim SelFeature As BTLFeatureVM = SelPart.SelBTLFeatureVM
|
||||
If IsNothing(SelFeature) Then Return
|
||||
' creo copia
|
||||
Dim NewFeature = SelFeature.Copy()
|
||||
If Not IsNothing(NewFeature) Then
|
||||
SelPart.SelBTLFeatureVM = Map.refProjectVM.BTLStructureVM.SelBTLPart.BTLFeatureVMList.FirstOrDefault(Function(x) x.BTLFeatureM Is NewFeature)
|
||||
MyMachGroupPanelM.SetDuploModified(SelPart.nPartId)
|
||||
End If
|
||||
SelPart.ResetCalcPart()
|
||||
End Sub
|
||||
|
||||
#End Region ' CopyFeature
|
||||
|
||||
#Region "MacroFeature"
|
||||
|
||||
''' <summary>
|
||||
''' Returns a command that do Exec.
|
||||
''' </summary>
|
||||
Public ReadOnly Property MacroFeature_Command As ICommand
|
||||
Get
|
||||
If m_cmdMacroFeature Is Nothing Then
|
||||
m_cmdMacroFeature = New Command(AddressOf MacroFeature)
|
||||
End If
|
||||
Return m_cmdMacroFeature
|
||||
End Get
|
||||
End Property
|
||||
|
||||
''' <summary>
|
||||
''' Execute the Exec. This method is invoked by the ExecCommand.
|
||||
''' </summary>
|
||||
Public Sub MacroFeature()
|
||||
If IsNothing(ProjectManagerVM.CurrProj) Then Return
|
||||
If IsNothing(Map.refProjectVM.BTLStructureVM.SelBTLPart) Then Return
|
||||
' apro finestra di creazione macro
|
||||
Dim MacroFeatureWndVM As New MacroFeatureWndVM()
|
||||
Dim NewMacroFeatureWnd As New NewMacroFeatureWnd(Application.Current.MainWindow, MacroFeatureWndVM)
|
||||
If NewMacroFeatureWnd.ShowDialog() Then
|
||||
End If
|
||||
End Sub
|
||||
|
||||
#End Region ' MacroFeature
|
||||
|
||||
#Region "AddFeature"
|
||||
|
||||
''' <summary>
|
||||
''' Returns a command that do Exec.
|
||||
''' </summary>
|
||||
Public ReadOnly Property AddFeature_Command As ICommand
|
||||
Get
|
||||
If m_cmdAddFeature Is Nothing Then
|
||||
m_cmdAddFeature = New Command(AddressOf AddFeature)
|
||||
End If
|
||||
Return m_cmdAddFeature
|
||||
End Get
|
||||
End Property
|
||||
|
||||
''' <summary>
|
||||
''' Execute the Exec. This method is invoked by the ExecCommand.
|
||||
''' </summary>
|
||||
Public Sub AddFeature(ByVal param As Object)
|
||||
If IsNothing(ProjectManagerVM.CurrProj) Then Return
|
||||
If IsNothing(Map.refProjectVM.BTLStructureVM.SelBTLPart) Then Return
|
||||
' apro finestra di definizione nuova feature
|
||||
Dim AddFeatureWndVM As New AddFeatureWndVM()
|
||||
Dim NewFeat As BTLFeatureM = Nothing
|
||||
Dim nNewFeatureId As Integer = 0
|
||||
Dim bMacroFlag As Boolean = False
|
||||
Dim AddNewFeatureWnd As New NewAddFeatureWndV(Application.Current.MainWindow, AddFeatureWndVM)
|
||||
If AddNewFeatureWnd.ShowDialog() Then
|
||||
' verifico se una Macro è selezionata
|
||||
If AddFeatureWndVM.nSelMacroDefault >= 0 Then
|
||||
CreateNewFeature(AddFeatureWndVM.MacroDefaultList.Count, AddFeatureWndVM.nSelMacroDefault, AddFeatureWndVM, nNewFeatureId, bMacroFlag, NewFeat)
|
||||
Else
|
||||
CreateNewFeature(AddFeatureWndVM.MacroCustomList.Count, AddFeatureWndVM.nSelMacroCustom, AddFeatureWndVM, nNewFeatureId, bMacroFlag, NewFeat)
|
||||
End If
|
||||
End If
|
||||
End Sub
|
||||
|
||||
#End Region ' AddFeature
|
||||
|
||||
#Region "RemoveFeature"
|
||||
|
||||
''' <summary>
|
||||
''' Returns a command that do Exec.
|
||||
''' </summary>
|
||||
Public ReadOnly Property RemoveFeature_Command As ICommand
|
||||
Get
|
||||
If m_cmdRemoveFeature Is Nothing Then
|
||||
m_cmdRemoveFeature = New Command(AddressOf RemoveFeature)
|
||||
End If
|
||||
Return m_cmdRemoveFeature
|
||||
End Get
|
||||
End Property
|
||||
|
||||
''' <summary>
|
||||
''' Execute the Exec. This method is invoked by the ExecCommand.
|
||||
''' </summary>
|
||||
Public Sub RemoveFeature()
|
||||
If IsNothing(ProjectManagerVM.CurrProj) Then Return
|
||||
If IsNothing(Map.refProjectVM.BTLStructureVM.SelBTLPart) Then Return
|
||||
If IsNothing(Map.refProjectVM.BTLStructureVM.SelBTLPart.SelBTLFeatureVM) Then Return
|
||||
If EgtBeamEraseProcess(Map.refProjectVM.BTLStructureVM.SelBTLPart.SelBTLFeatureVM.nFeatureId) Then
|
||||
MyMachGroupPanelM.SetDuploModified(Map.refProjectVM.BTLStructureVM.SelBTLPart.nPartId)
|
||||
' rimuovo dalla lista feature
|
||||
Dim Index As Integer = Map.refProjectVM.BTLStructureVM.SelBTLPart.BTLFeatureVMList.IndexOf(Map.refProjectVM.BTLStructureVM.SelBTLPart.SelBTLFeatureVM)
|
||||
If Index = 0 Then
|
||||
If Map.refProjectVM.BTLStructureVM.SelBTLPart.BTLFeatureVMList.Count > 0 Then
|
||||
Map.refProjectVM.BTLStructureVM.SelBTLPart.SelBTLFeatureVM = Map.refProjectVM.BTLStructureVM.SelBTLPart.BTLFeatureVMList(0)
|
||||
Else
|
||||
Map.refProjectVM.BTLStructureVM.SelBTLPart.SelBTLFeatureVM = Nothing
|
||||
End If
|
||||
ElseIf Index = Map.refProjectVM.BTLStructureVM.SelBTLPart.BTLFeatureVMList.Count - 1 Then
|
||||
If Map.refProjectVM.BTLStructureVM.SelBTLPart.BTLFeatureVMList.Count > 1 Then
|
||||
Map.refProjectVM.BTLStructureVM.SelBTLPart.SelBTLFeatureVM = Map.refProjectVM.BTLStructureVM.SelBTLPart.BTLFeatureVMList(Map.refProjectVM.BTLStructureVM.SelBTLPart.BTLFeatureVMList.Count - 2)
|
||||
Else
|
||||
Map.refProjectVM.BTLStructureVM.SelBTLPart.SelBTLFeatureVM = Nothing
|
||||
End If
|
||||
Else
|
||||
Map.refProjectVM.BTLStructureVM.SelBTLPart.SelBTLFeatureVM = Map.refProjectVM.BTLStructureVM.SelBTLPart.BTLFeatureVMList(Index - 1)
|
||||
End If
|
||||
Map.refProjectVM.BTLStructureVM.SelBTLPart.BTLFeatureVMList.RemoveAt(Index)
|
||||
EgtDraw()
|
||||
Map.refProjectVM.BTLStructureVM.SelBTLPart.ResetCalcPart()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
#End Region ' RemoveFeature
|
||||
|
||||
#End Region ' Commands
|
||||
|
||||
End Class
|
||||
@@ -0,0 +1,33 @@
|
||||
<StackPanel x:Class="OnlyProdFeatureListManagerV"
|
||||
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}"
|
||||
ToolTip="{Binding CopyFeature_ToolTip}"
|
||||
IsEnabled="{Binding CopyFeature_IsEnabled}"
|
||||
Style="{StaticResource OnlyProdLeftPanel_Button}">
|
||||
<Image Source="/Resources/LeftPanel/CopyFeature.png" Stretch="Uniform"/>
|
||||
</Button>
|
||||
<Button Command="{Binding MacroFeature_Command}"
|
||||
ToolTip="{Binding MacroFeature_ToolTip}"
|
||||
IsEnabled="{Binding MacroFeature_IsEnabled}"
|
||||
Style="{StaticResource OnlyProdLeftPanel_Button}">
|
||||
<Image Source="/Resources/LeftPanel/MacroFeature.png" Stretch="Uniform"/>
|
||||
</Button>
|
||||
<Button Command="{Binding AddFeature_Command}"
|
||||
ToolTip="{Binding AddFeature_ToolTip}"
|
||||
IsEnabled="{Binding AddFeature_IsEnabled}"
|
||||
Style="{StaticResource OnlyProdLeftPanel_Button}">
|
||||
<Image Source="/Resources/LeftPanel/AddFeature.png" Stretch="Uniform"/>
|
||||
</Button>
|
||||
<Button Command="{Binding RemoveFeature_Command}"
|
||||
ToolTip="{Binding RemoveFeature_ToolTip}"
|
||||
IsEnabled="{Binding RemoveFeature_IsEnabled}"
|
||||
Style="{StaticResource OnlyProdLeftPanel_Button}">
|
||||
<Image Source="/Resources/NewPage/Remove.png" Stretch="Uniform"/>
|
||||
</Button>
|
||||
|
||||
</StackPanel>
|
||||
@@ -0,0 +1,3 @@
|
||||
Public Class OnlyProdFeatureListManagerV
|
||||
|
||||
End Class
|
||||
@@ -0,0 +1,55 @@
|
||||
<StackPanel x:Class="FeatureManagerV"
|
||||
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:EgtBEAMWALL="clr-namespace:EgtBEAMWALL.Optimizer"
|
||||
Orientation="Horizontal"
|
||||
Height="32">
|
||||
|
||||
<TextBlock Text="{Binding Face_Msg}"
|
||||
IsEnabled="{Binding FeatureManager_IsEnabled}"
|
||||
Style="{StaticResource OptionTextBlock}"/>
|
||||
<ComboBox ItemsSource="{Binding Tag.SIDEList, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:FeatureManagerV}}}"
|
||||
SelectedItem="{Binding Tag.nSelSIDE, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:FeatureManagerV}}}"
|
||||
IsEnabled="{Binding FeatureManager_IsEnabled}"
|
||||
Style="{StaticResource FeatureComboBox}"/>
|
||||
<TextBlock Text="{Binding Group_Msg}"
|
||||
IsEnabled="{Binding FeatureManager_IsEnabled}"
|
||||
Style="{StaticResource OptionTextBlock}"/>
|
||||
<ComboBox ItemsSource="{Binding Tag.GRPList, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:FeatureManagerV}}}"
|
||||
SelectedItem="{Binding Tag.nSelGRP, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:FeatureManagerV}}}"
|
||||
IsEnabled="{Binding FeatureManager_IsEnabled}"
|
||||
Style="{StaticResource FeatureComboBox}"/>
|
||||
<TextBlock Text="{Binding Priority_Msg}"
|
||||
IsEnabled="{Binding FeatureManager_IsEnabled}"
|
||||
Visibility="{Binding Priority_Visibility}"
|
||||
Style="{StaticResource OptionTextBlock}"/>
|
||||
<EgtWPFLib5:EgtTextBox Text="{Binding Tag.sPriority,
|
||||
RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:FeatureManagerV}},
|
||||
UpdateSourceTrigger=Explicit}"
|
||||
IsEnabled="{Binding FeatureManager_IsEnabled}"
|
||||
Visibility="{Binding Priority_Visibility}"
|
||||
Width="45"/>
|
||||
<TextBlock Text="{Binding Tag.sName, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:FeatureManagerV}}}"
|
||||
Style="{StaticResource OptionTextBlock}"/>
|
||||
<ComboBox ItemsSource="{Binding Tag.VARIANTList, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:FeatureManagerV}}}"
|
||||
SelectedItem="{Binding Tag.nSelVARIANT, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:FeatureManagerV}}}"
|
||||
IsEnabled="{Binding FeatureManager_IsEnabled}"
|
||||
Visibility="{Binding Variant_Visibility}"
|
||||
Style="{StaticResource FeatureComboBox}"/>
|
||||
|
||||
<Button Content="{Binding Edit_Msg}"
|
||||
Command="{Binding Tag.Edit_Command, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:FeatureManagerV}}}"
|
||||
Visibility="{Binding Tag.Edit_Visibility, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:FeatureManagerV}}}"
|
||||
IsEnabled="{Binding Edit_IsEnabled}"
|
||||
Style="{StaticResource EgtWPFLib5_InputButton}"/>
|
||||
<Button Content="{Binding Save_Msg}"
|
||||
Command="{Binding Tag.Save_Command, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:FeatureManagerV}}}"
|
||||
Visibility="{Binding Tag.SaveCancel_Visibility, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:FeatureManagerV}}}"
|
||||
Style="{StaticResource EgtWPFLib5_InputButton}"/>
|
||||
<Button Content="{Binding Cancel_Msg}"
|
||||
Command="{Binding Tag.Cancel_Command, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:FeatureManagerV}}}"
|
||||
Visibility="{Binding Tag.SaveCancel_Visibility, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:FeatureManagerV}}}"
|
||||
Style="{StaticResource EgtWPFLib5_InputButton}"/>
|
||||
|
||||
</StackPanel>
|
||||
@@ -0,0 +1,3 @@
|
||||
Public Class FeatureManagerV
|
||||
|
||||
End Class
|
||||
@@ -0,0 +1,115 @@
|
||||
Imports EgtBEAMWALL.Core
|
||||
Imports EgtUILib
|
||||
Imports EgtWPFLib5
|
||||
|
||||
Public Class FeatureManagerVM
|
||||
Inherits VMBase
|
||||
|
||||
#Region "FIELDS & PROPERTIES"
|
||||
|
||||
Private m_FeatureManager_IsEnabled As Boolean = True
|
||||
Public Property FeatureManager_IsEnabled As Boolean
|
||||
Get
|
||||
Return m_FeatureManager_IsEnabled
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
m_FeatureManager_IsEnabled = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Private m_Variant_Visibility As Visibility = Visibility.Collapsed
|
||||
Public ReadOnly Property Variant_Visibility As Visibility
|
||||
Get
|
||||
Return m_Variant_Visibility
|
||||
End Get
|
||||
End Property
|
||||
Public Sub SetVariant_Visibility(value As Visibility)
|
||||
m_Variant_Visibility = value
|
||||
NotifyPropertyChanged(NameOf(Variant_Visibility))
|
||||
End Sub
|
||||
|
||||
Public ReadOnly Property Edit_IsEnabled As Boolean
|
||||
Get
|
||||
Return m_FeatureManager_IsEnabled AndAlso Not IsNothing(Map.refProjectVM.BTLStructureVM) AndAlso
|
||||
Map.refProjectVM.BTLStructureVM.SelBTLParts.Count > 0 AndAlso
|
||||
Not IsNothing(Map.refProjectVM.BTLStructureVM.SelBTLParts(0)) AndAlso
|
||||
Not IsNothing(Map.refProjectVM.BTLStructureVM.SelBTLParts(0).SelBTLFeatureVM) AndAlso
|
||||
Map.refProjectVM.BTLStructureVM.SelBTLParts(0).SelBTLFeatureVM.BTLFeatureM.IsFreeContour() AndAlso
|
||||
Map.refProjectVM.BTLStructureVM.SelBTLParts(0).SelBTLFeatureVM.bDO
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property Priority_Visibility As Visibility
|
||||
Get
|
||||
Return If(CurrentMachine.nType = Core.ConstBeam.MachineType.WALL AndAlso CurrentMachine.bIsEnabledPriority, Visibility.Visible, Visibility.Collapsed)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
#Region "Messages"
|
||||
|
||||
Public ReadOnly Property Face_Msg As String
|
||||
Get
|
||||
Return EgtMsg(61824)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property Group_Msg As String
|
||||
Get
|
||||
Return EgtMsg(61825)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property Priority_Msg As String
|
||||
Get
|
||||
Return EgtMsg(61895)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property Edit_Msg As String
|
||||
Get
|
||||
Return EgtMsg(61826)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property Save_Msg As String
|
||||
Get
|
||||
Return EgtMsg(61827)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property Cancel_Msg As String
|
||||
Get
|
||||
Return EgtMsg(61828)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
#End Region ' Messages
|
||||
|
||||
#End Region ' FIELDS & PROPERTIES
|
||||
|
||||
#Region "CONSTRUCTORS"
|
||||
|
||||
Sub New()
|
||||
' imposto riferimento in Map
|
||||
Map.SetRefFeatureManagerVM(Me)
|
||||
End Sub
|
||||
|
||||
#End Region ' CONSTRUCTORS
|
||||
|
||||
#Region "METHODS"
|
||||
|
||||
Friend Sub SetFeatureManagerIsEnabled(bIsEnabled As Boolean)
|
||||
m_FeatureManager_IsEnabled = bIsEnabled
|
||||
NotifyPropertyChanged(NameOf(FeatureManager_IsEnabled))
|
||||
NotifyPropertyChanged(NameOf(Edit_IsEnabled))
|
||||
End Sub
|
||||
|
||||
Friend Sub SetEditIsEnabled()
|
||||
' aggiorno stato abilitazione del bottone modifica free contour
|
||||
NotifyPropertyChanged(NameOf(Edit_IsEnabled))
|
||||
End Sub
|
||||
|
||||
#End Region ' METHODS
|
||||
|
||||
End Class
|
||||
@@ -0,0 +1,70 @@
|
||||
<Grid x:Class="OnlyProdFeatureManagerV"
|
||||
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:EgtBEAMWALL="clr-namespace:EgtBEAMWALL.Optimizer"
|
||||
Margin="30,4,0,2">
|
||||
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<Expander Header="{Binding Face_Msg}"
|
||||
IsEnabled="{Binding FeatureManager_IsEnabled}"
|
||||
Width="80">
|
||||
<ListBox ItemsSource="{Binding Tag.SIDEList, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdFeatureManagerV}}}"
|
||||
SelectedItem="{Binding Tag.nSelSIDE, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdFeatureManagerV}}}"
|
||||
IsEnabled="{Binding FeatureManager_IsEnabled}"
|
||||
Style="{StaticResource FeatureManager_ListBox}"
|
||||
ItemContainerStyle="{StaticResource AlternationIndex_ListBoxItem}"/>
|
||||
</Expander>
|
||||
<Expander Grid.Column="1"
|
||||
Header="{Binding Group_Msg}"
|
||||
IsEnabled="{Binding FeatureManager_IsEnabled}"
|
||||
Width="80">
|
||||
<ListBox ItemsSource="{Binding Tag.GRPList, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdFeatureManagerV}}}"
|
||||
SelectedItem="{Binding Tag.nSelGRP, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdFeatureManagerV}}}"
|
||||
IsEnabled="{Binding FeatureManager_IsEnabled}"
|
||||
Style="{StaticResource FeatureManager_ListBox}"
|
||||
ItemContainerStyle="{StaticResource AlternationIndex_ListBoxItem}"/>
|
||||
</Expander>
|
||||
<TextBlock Grid.Column="2"
|
||||
Text="{Binding Priority_Msg}"
|
||||
IsEnabled="{Binding FeatureManager_IsEnabled}"
|
||||
Visibility="{Binding Priority_Visibility}"
|
||||
Style="{StaticResource OptionTextBlock}"/>
|
||||
<EgtWPFLib5:EgtTextBox Grid.Column="3"
|
||||
Text="{Binding Tag.sPriority,
|
||||
RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdFeatureManagerV}},
|
||||
UpdateSourceTrigger=Explicit}"
|
||||
IsEnabled="{Binding FeatureManager_IsEnabled}"
|
||||
Visibility="{Binding Priority_Visibility}"
|
||||
Style="{StaticResource Dimension_TextBox}"/>
|
||||
<TextBlock Grid.Column="4"
|
||||
Text="{Binding Tag.sName, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdFeatureManagerV}}}"
|
||||
Style="{StaticResource OnlyProdFeatureManager_OnlyProd}"/>
|
||||
<Button Grid.Column="5"
|
||||
Content="{Binding Edit_Msg}"
|
||||
Command="{Binding Tag.Edit_Command, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdFeatureManagerV}}}"
|
||||
Visibility="{Binding Tag.Edit_Visibility, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdFeatureManagerV}}}"
|
||||
IsEnabled="{Binding Edit_IsEnabled}"
|
||||
Style="{StaticResource GeneralConfigurationToolBar_TextButton}"/>
|
||||
<Button Grid.Column="6"
|
||||
Content="{Binding Save_Msg}"
|
||||
Command="{Binding Tag.Save_Command, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdFeatureManagerV}}}"
|
||||
Visibility="{Binding Tag.SaveCancel_Visibility, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdFeatureManagerV}}}"
|
||||
Style="{StaticResource GeneralConfigurationToolBar_TextButton}"/>
|
||||
<Button Grid.Column="7"
|
||||
Content="{Binding Cancel_Msg}"
|
||||
Command="{Binding Tag.Cancel_Command, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdFeatureManagerV}}}"
|
||||
Visibility="{Binding Tag.SaveCancel_Visibility, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdFeatureManagerV}}}"
|
||||
Style="{StaticResource GeneralConfigurationToolBar_TextButton}"/>
|
||||
|
||||
</Grid>
|
||||
@@ -0,0 +1,3 @@
|
||||
Public Class OnlyProdFeatureManagerV
|
||||
|
||||
End Class
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user