Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 25af98b6e8 |
@@ -78,6 +78,12 @@ Public Module ConstGen
|
|||||||
Public Const BEAM_DIR As String = "Beam"
|
Public Const BEAM_DIR As String = "Beam"
|
||||||
' Sottodirettorio per lavorazioni pareti
|
' Sottodirettorio per lavorazioni pareti
|
||||||
Public Const WALL_DIR As String = "Wall"
|
Public Const WALL_DIR As String = "Wall"
|
||||||
|
' Sottodirettorio per setup strategie
|
||||||
|
Public Const AISETUP_DIR As String = "AISetup"
|
||||||
|
' Sottodirettorio per automarismo strategie
|
||||||
|
Public Const STRATEGIES_DIR As String = "Strategies"
|
||||||
|
' File contenente lista strategie per feature/topologia
|
||||||
|
Public Const AVAILABLESTRATEGYLIST_FILE As String = "AvailableStrategyList"
|
||||||
' Sottodirettorio di default per il salvataggio con nome
|
' Sottodirettorio di default per il salvataggio con nome
|
||||||
Public Const SAVE_DFL_NAMEDIR As String = "MyProjects"
|
Public Const SAVE_DFL_NAMEDIR As String = "MyProjects"
|
||||||
' Sottodirettorio di default per le macchine
|
' Sottodirettorio di default per le macchine
|
||||||
|
|||||||
@@ -361,6 +361,7 @@ Public Class ConfigurationPageVM
|
|||||||
Private m_cmdGetAllRelease As ICommand
|
Private m_cmdGetAllRelease As ICommand
|
||||||
Private m_cmdLinkVersion As ICommand
|
Private m_cmdLinkVersion As ICommand
|
||||||
Private m_cmdGetVersionFrom As ICommand
|
Private m_cmdGetVersionFrom As ICommand
|
||||||
|
Private m_cmdStrategyManager As ICommand
|
||||||
|
|
||||||
#Region "Messages"
|
#Region "Messages"
|
||||||
|
|
||||||
@@ -995,6 +996,30 @@ Public Class ConfigurationPageVM
|
|||||||
|
|
||||||
#End Region ' Restore
|
#End Region ' Restore
|
||||||
|
|
||||||
|
#Region "StrategyManager"
|
||||||
|
|
||||||
|
''' <summary>
|
||||||
|
''' Returns a command that do Save.
|
||||||
|
''' </summary>
|
||||||
|
Public ReadOnly Property StrategyManager_Command As ICommand
|
||||||
|
Get
|
||||||
|
If m_cmdStrategyManager Is Nothing Then
|
||||||
|
m_cmdStrategyManager = New Command(AddressOf StrategyManager)
|
||||||
|
End If
|
||||||
|
Return m_cmdStrategyManager
|
||||||
|
End Get
|
||||||
|
End Property
|
||||||
|
|
||||||
|
''' <summary>
|
||||||
|
''' Execute the Save. This method is invoked by the SaveCommand.
|
||||||
|
''' </summary>
|
||||||
|
Public Sub StrategyManager()
|
||||||
|
Dim StrategyManagerWnd As New StrategyManagerWndV
|
||||||
|
StrategyManagerWnd.ShowDialog()
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
#End Region ' StrategyManager
|
||||||
|
|
||||||
'#Region "GetAllReleaseCommand"
|
'#Region "GetAllReleaseCommand"
|
||||||
|
|
||||||
' ''' <summary>
|
' ''' <summary>
|
||||||
|
|||||||
@@ -59,7 +59,11 @@
|
|||||||
</StackPanel>
|
</StackPanel>
|
||||||
</TabItem.Header>
|
</TabItem.Header>
|
||||||
<TabItem.Content>
|
<TabItem.Content>
|
||||||
<EgtBEAMWALLCORE:OnlyProdMachine_ConfigurationPageV/>
|
<StackPanel>
|
||||||
|
<Button Content="Strategies"
|
||||||
|
Command="{Binding StrategyManager_Command}"/>
|
||||||
|
<EgtBEAMWALLCORE:OnlyProdMachine_ConfigurationPageV/>
|
||||||
|
</StackPanel>
|
||||||
</TabItem.Content>
|
</TabItem.Content>
|
||||||
</TabItem>
|
</TabItem>
|
||||||
<TabItem>
|
<TabItem>
|
||||||
|
|||||||
@@ -211,6 +211,10 @@
|
|||||||
<Compile Include="StatusBar\StatusBarV.xaml.vb">
|
<Compile Include="StatusBar\StatusBarV.xaml.vb">
|
||||||
<DependentUpon>StatusBarV.xaml</DependentUpon>
|
<DependentUpon>StatusBarV.xaml</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
|
<Compile Include="StrategyManagerWnd\StrategyManagerWndV.xaml.vb">
|
||||||
|
<DependentUpon>StrategyManagerWndV.xaml</DependentUpon>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="StrategyManagerWnd\StrategyManagerWndVM.vb" />
|
||||||
<Compile Include="SupervisorCommThread\SupervisorComm.vb" />
|
<Compile Include="SupervisorCommThread\SupervisorComm.vb" />
|
||||||
<Compile Include="SupervisorCommThread\SupervisorCommThread.vb" />
|
<Compile Include="SupervisorCommThread\SupervisorCommThread.vb" />
|
||||||
<Compile Include="ToolsDbWindow\MyToolDbWindowVM.vb" />
|
<Compile Include="ToolsDbWindow\MyToolDbWindowVM.vb" />
|
||||||
@@ -671,6 +675,10 @@
|
|||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
</Page>
|
</Page>
|
||||||
|
<Page Include="StrategyManagerWnd\StrategyManagerWndV.xaml">
|
||||||
|
<SubType>Designer</SubType>
|
||||||
|
<Generator>MSBuild:Compile</Generator>
|
||||||
|
</Page>
|
||||||
<Page Include="UpdateBTLWnd\OnlyProdUpdateBTLWndV.xaml">
|
<Page Include="UpdateBTLWnd\OnlyProdUpdateBTLWndV.xaml">
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
|
|||||||
@@ -462,6 +462,22 @@ Public Class MainWindowM
|
|||||||
Return -1
|
Return -1
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
|
Friend Function GetAISetupDirPath() As String
|
||||||
|
If Map.refOnlyProdManagerVM.nProdType = BWType.BEAM Then
|
||||||
|
Return sBeamRoot & "\" & AISETUP_DIR
|
||||||
|
ElseIf Map.refOnlyProdManagerVM.nProdType = BWType.WALL Then
|
||||||
|
Return sWallRoot & "\" & AISETUP_DIR
|
||||||
|
End If
|
||||||
|
End Function
|
||||||
|
|
||||||
|
Friend Function GetStrategiesDirPath() As String
|
||||||
|
If Map.refOnlyProdManagerVM.nProdType = BWType.BEAM Then
|
||||||
|
Return sBeamRoot & "\" & STRATEGIES_DIR
|
||||||
|
ElseIf Map.refOnlyProdManagerVM.nProdType = BWType.WALL Then
|
||||||
|
Return sWallRoot & "\" & STRATEGIES_DIR
|
||||||
|
End If
|
||||||
|
End Function
|
||||||
|
|
||||||
Friend Sub Close()
|
Friend Sub Close()
|
||||||
' Terminazione generale di EgtInterface
|
' Terminazione generale di EgtInterface
|
||||||
EgtExit()
|
EgtExit()
|
||||||
|
|||||||
@@ -0,0 +1,50 @@
|
|||||||
|
<Window x:Class="StrategyManagerWndV"
|
||||||
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
DataContext="{StaticResource StrategyManagerWndVM}"
|
||||||
|
Title="StartegyManagerWndV">
|
||||||
|
<Grid>
|
||||||
|
<Grid.RowDefinitions>
|
||||||
|
<RowDefinition Height="Auto"/>
|
||||||
|
<RowDefinition Height="1*"/>
|
||||||
|
</Grid.RowDefinitions>
|
||||||
|
<ComboBox ItemsSource="{Binding StrategySetupList}"
|
||||||
|
SelectedItem="{Binding SelStrategySetup}"
|
||||||
|
DisplayMemberPath="sName"/>
|
||||||
|
<Grid Grid.Row="1">
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="1*"/>
|
||||||
|
<ColumnDefinition Width="1*"/>
|
||||||
|
<ColumnDefinition Width="1*"/>
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
<ListBox ItemsSource="{Binding SelStrategySetup.StrategyFeatureList}"
|
||||||
|
SelectedItem="{Binding SelStrategySetup.SelStrategyFeature}"
|
||||||
|
DisplayMemberPath="sName"/>
|
||||||
|
<Grid Grid.Column="1">
|
||||||
|
<Grid.RowDefinitions>
|
||||||
|
<RowDefinition Height="1*"/>
|
||||||
|
<RowDefinition Height="1*"/>
|
||||||
|
</Grid.RowDefinitions>
|
||||||
|
<ListBox ItemsSource="{Binding SelStrategySetup.SelStrategyFeature.TopologyList}"
|
||||||
|
SelectedItem="{Binding SelStrategySetup.SelStrategyFeature.SelTopology}"
|
||||||
|
DisplayMemberPath="sName"/>
|
||||||
|
<!--<Image Grid.Row="1"
|
||||||
|
Source="{Binding TopologyImage}"/>-->
|
||||||
|
</Grid>
|
||||||
|
<Grid Grid.Column="2">
|
||||||
|
<Grid.RowDefinitions>
|
||||||
|
<RowDefinition Height="1*"/>
|
||||||
|
<RowDefinition Height="1*"/>
|
||||||
|
</Grid.RowDefinitions>
|
||||||
|
<ListBox ItemsSource="{Binding SelStrategySetup.SelStrategyFeature.SelTopology.ActiveStrategyList_View}"
|
||||||
|
SelectedItem="{Binding SelActiveStrategy}"
|
||||||
|
DisplayMemberPath="sStrategyID"/>
|
||||||
|
<ListBox Grid.Row="1"
|
||||||
|
ItemsSource="{Binding SelStrategySetup.SelStrategyFeature.SelTopology.AvailableStrategyList_View}"
|
||||||
|
SelectedItem="{Binding SelAvailableStrategy}"
|
||||||
|
DisplayMemberPath="sStrategyID"/>
|
||||||
|
</Grid>
|
||||||
|
|
||||||
|
</Grid>
|
||||||
|
</Grid>
|
||||||
|
</Window>
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
Public Class StrategyManagerWndV
|
||||||
|
Inherits Window
|
||||||
|
|
||||||
|
End Class
|
||||||
@@ -0,0 +1,399 @@
|
|||||||
|
Imports System.Collections.ObjectModel
|
||||||
|
Imports System.ComponentModel
|
||||||
|
Imports System.IO
|
||||||
|
Imports EgtBEAMWALL.Core
|
||||||
|
Imports EgtWPFLib5
|
||||||
|
Imports Newtonsoft.Json
|
||||||
|
|
||||||
|
Public Class StrategyManagerWndVM
|
||||||
|
Inherits VMBase
|
||||||
|
|
||||||
|
Private m_StrategySetupList As New ObservableCollection(Of StrategySetup)
|
||||||
|
Public ReadOnly Property StrategySetupList As ObservableCollection(Of StrategySetup)
|
||||||
|
Get
|
||||||
|
Return m_StrategySetupList
|
||||||
|
End Get
|
||||||
|
End Property
|
||||||
|
|
||||||
|
Private m_SelStrategySetup As StrategySetup
|
||||||
|
Public Property SelStrategySetup As StrategySetup
|
||||||
|
Get
|
||||||
|
Return m_SelStrategySetup
|
||||||
|
End Get
|
||||||
|
Set(value As StrategySetup)
|
||||||
|
m_SelStrategySetup = value
|
||||||
|
m_SelStrategySetup.Read()
|
||||||
|
NotifyPropertyChanged(NameOf(SelStrategySetup))
|
||||||
|
End Set
|
||||||
|
End Property
|
||||||
|
|
||||||
|
Sub New()
|
||||||
|
' 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(New StrategySetup(Path.GetFileNameWithoutExtension(AiSetup)))
|
||||||
|
Next
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
End Class
|
||||||
|
|
||||||
|
Public Class StrategySetup
|
||||||
|
Inherits VMBase
|
||||||
|
|
||||||
|
Private m_sName As String
|
||||||
|
Public Property sName As String
|
||||||
|
Get
|
||||||
|
Return m_sName
|
||||||
|
End Get
|
||||||
|
Set(value As String)
|
||||||
|
m_sName = value
|
||||||
|
End Set
|
||||||
|
End Property
|
||||||
|
|
||||||
|
Private m_StrategyFeatureList As New ObservableCollection(Of StrategyFeature)
|
||||||
|
Public Property StrategyFeatureList As ObservableCollection(Of StrategyFeature)
|
||||||
|
Get
|
||||||
|
Return m_StrategyFeatureList
|
||||||
|
End Get
|
||||||
|
Set(value As ObservableCollection(Of StrategyFeature))
|
||||||
|
m_StrategyFeatureList = value
|
||||||
|
End Set
|
||||||
|
End Property
|
||||||
|
Sub New(sName As String)
|
||||||
|
m_sName = sName
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Private m_SelStrategyFeature As StrategyFeature
|
||||||
|
Public Property SelStrategyFeature As StrategyFeature
|
||||||
|
Get
|
||||||
|
Return m_SelStrategyFeature
|
||||||
|
End Get
|
||||||
|
Set(value As StrategyFeature)
|
||||||
|
m_SelStrategyFeature = value
|
||||||
|
NotifyPropertyChanged(NameOf(SelStrategyFeature))
|
||||||
|
End Set
|
||||||
|
End Property
|
||||||
|
|
||||||
|
Friend Sub Read()
|
||||||
|
' carico default
|
||||||
|
Dim sStrategiesDirPath As String = Map.refMainWindowVM.MainWindowM.GetStrategiesDirPath()
|
||||||
|
Dim sAvailableStrategiesFilePath As String = sStrategiesDirPath & "\" & AVAILABLESTRATEGYLIST_FILE & ".json"
|
||||||
|
If File.Exists(sAvailableStrategiesFilePath) Then
|
||||||
|
Dim sReadedFile As String = File.ReadAllText(sAvailableStrategiesFilePath)
|
||||||
|
Dim JsonStrategyFeatureList As List(Of JsonStrategyFeature) = JsonConvert.DeserializeObject(Of List(Of JsonStrategyFeature))(sReadedFile)
|
||||||
|
m_StrategyFeatureList = New ObservableCollection(Of StrategyFeature)((From JsonStrategyFeature In JsonStrategyFeatureList
|
||||||
|
Select New StrategyFeature(JsonStrategyFeature)).ToList())
|
||||||
|
' NotifyPropertyChanged(NameOf(StrategyFeatureList))
|
||||||
|
|
||||||
|
End If
|
||||||
|
' carico custom
|
||||||
|
Dim sAISetupDirPath As String = Map.refMainWindowVM.MainWindowM.GetAISetupDirPath()
|
||||||
|
Dim sStrategyConfigurationFilePath As String = sAISetupDirPath & "\" & sName & ".json"
|
||||||
|
If File.Exists(sStrategyConfigurationFilePath) Then
|
||||||
|
Dim sReadedFile As String = File.ReadAllText(sStrategyConfigurationFilePath)
|
||||||
|
Dim JsonStrategyFeatureList As List(Of JsonStrategyFeature) = JsonConvert.DeserializeObject(Of List(Of JsonStrategyFeature))(sReadedFile)
|
||||||
|
For Each Feature In JsonStrategyFeatureList
|
||||||
|
Dim DefaultFeature As StrategyFeature = m_StrategyFeatureList.FirstOrDefault(Function(x) x.nPRC = Feature.nPRC AndAlso x.nGRP = Feature.nGRP)
|
||||||
|
' gestire caso non venga trovata perchè non esiste più in default??'
|
||||||
|
If Not IsNothing(DefaultFeature) Then
|
||||||
|
For Each Topology In Feature.TopologyList
|
||||||
|
Dim DefaultTopology As Topology = DefaultFeature.TopologyList.FirstOrDefault(Function(x) x.sName = Topology.sName)
|
||||||
|
' gestire caso non venga trovata perchè non esiste più in default??'
|
||||||
|
For Each Strategy In Topology.StrategyList
|
||||||
|
Dim DefaultStrategy As Strategy = DefaultTopology.StrategyList.FirstOrDefault(Function(x) x.sStrategyID = Strategy.sStrategyID)
|
||||||
|
If IsNothing(DefaultStrategy) Then
|
||||||
|
DefaultTopology.StrategyList.Add(New Strategy(DefaultTopology, Strategy))
|
||||||
|
' verifico indici!!
|
||||||
|
Else
|
||||||
|
DefaultStrategy.ReadConfiguration(Strategy)
|
||||||
|
End If
|
||||||
|
Next
|
||||||
|
Next
|
||||||
|
End If
|
||||||
|
Next
|
||||||
|
End If
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
End Class
|
||||||
|
|
||||||
|
Public Class StrategyFeature
|
||||||
|
Inherits VMBase
|
||||||
|
|
||||||
|
Private m_sName As String
|
||||||
|
Public Property sName As String
|
||||||
|
Get
|
||||||
|
Return m_sName
|
||||||
|
End Get
|
||||||
|
Set(value As String)
|
||||||
|
m_sName = value
|
||||||
|
End Set
|
||||||
|
End Property
|
||||||
|
|
||||||
|
Private m_nPRC As Integer
|
||||||
|
Public Property nPRC As Integer
|
||||||
|
Get
|
||||||
|
Return m_nPRC
|
||||||
|
End Get
|
||||||
|
Set(value As Integer)
|
||||||
|
m_nPRC = value
|
||||||
|
End Set
|
||||||
|
End Property
|
||||||
|
|
||||||
|
Private m_nGRP As Integer
|
||||||
|
Public Property nGRP As Integer
|
||||||
|
Get
|
||||||
|
Return m_nGRP
|
||||||
|
End Get
|
||||||
|
Set(value As Integer)
|
||||||
|
m_nGRP = value
|
||||||
|
End Set
|
||||||
|
End Property
|
||||||
|
|
||||||
|
Private m_TopologyList As New ObservableCollection(Of Topology)
|
||||||
|
Public Property TopologyList As ObservableCollection(Of Topology)
|
||||||
|
Get
|
||||||
|
Return m_TopologyList
|
||||||
|
End Get
|
||||||
|
Set(value As ObservableCollection(Of Topology))
|
||||||
|
m_TopologyList = value
|
||||||
|
End Set
|
||||||
|
End Property
|
||||||
|
|
||||||
|
Private m_SelTopology As Topology
|
||||||
|
Public Property SelTopology As Topology
|
||||||
|
Get
|
||||||
|
Return m_SelTopology
|
||||||
|
End Get
|
||||||
|
Set(value As Topology)
|
||||||
|
m_SelTopology = value
|
||||||
|
NotifyPropertyChanged(NameOf(SelTopology))
|
||||||
|
End Set
|
||||||
|
End Property
|
||||||
|
|
||||||
|
Sub New(JsonStrategyFeature As JsonStrategyFeature)
|
||||||
|
m_sName = JsonStrategyFeature.sName
|
||||||
|
m_nPRC = JsonStrategyFeature.nPRC
|
||||||
|
m_nGRP = JsonStrategyFeature.nGRP
|
||||||
|
m_TopologyList = New ObservableCollection(Of Topology)((From JsonTopology In JsonStrategyFeature.TopologyList
|
||||||
|
Select New Topology(JsonTopology)).ToList())
|
||||||
|
NotifyPropertyChanged(NameOf(TopologyList))
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
End Class
|
||||||
|
|
||||||
|
Public Class Topology
|
||||||
|
Inherits VMBase
|
||||||
|
|
||||||
|
Private m_sName As String
|
||||||
|
Public Property sName As String
|
||||||
|
Get
|
||||||
|
Return m_sName
|
||||||
|
End Get
|
||||||
|
Set(value As String)
|
||||||
|
m_sName = value
|
||||||
|
End Set
|
||||||
|
End Property
|
||||||
|
|
||||||
|
Private m_AvailableStrategyList_View As ICollectionView = Nothing
|
||||||
|
Public Property AvailableStrategyList_View As ICollectionView
|
||||||
|
Get
|
||||||
|
Return m_AvailableStrategyList_View
|
||||||
|
End Get
|
||||||
|
Set(value As ICollectionView)
|
||||||
|
|
||||||
|
End Set
|
||||||
|
End Property
|
||||||
|
|
||||||
|
Private m_ActiveStrategyList_View As ICollectionView = Nothing
|
||||||
|
Public ReadOnly Property ActiveStrategyList_View As ICollectionView
|
||||||
|
Get
|
||||||
|
Return m_ActiveStrategyList_View
|
||||||
|
End Get
|
||||||
|
End Property
|
||||||
|
|
||||||
|
Private m_StrategyList As New ObservableCollection(Of Strategy)
|
||||||
|
Public Property StrategyList As ObservableCollection(Of Strategy)
|
||||||
|
Get
|
||||||
|
Return m_StrategyList
|
||||||
|
End Get
|
||||||
|
Set(value As ObservableCollection(Of Strategy))
|
||||||
|
m_StrategyList = value
|
||||||
|
End Set
|
||||||
|
End Property
|
||||||
|
|
||||||
|
Private m_SelActiveStrategy As Strategy
|
||||||
|
Public Property SelActiveStrategy As Strategy
|
||||||
|
Get
|
||||||
|
Return m_SelActiveStrategy
|
||||||
|
End Get
|
||||||
|
Set(value As Strategy)
|
||||||
|
m_SelActiveStrategy = value
|
||||||
|
End Set
|
||||||
|
End Property
|
||||||
|
|
||||||
|
Private m_SelAvailableStrategy As Strategy
|
||||||
|
Public Property SelAvailableStrategy As Strategy
|
||||||
|
Get
|
||||||
|
Return m_SelAvailableStrategy
|
||||||
|
End Get
|
||||||
|
Set(value As Strategy)
|
||||||
|
m_SelAvailableStrategy = value
|
||||||
|
End Set
|
||||||
|
End Property
|
||||||
|
|
||||||
|
Sub New(JsonTopology As JsonTopology)
|
||||||
|
m_sName = JsonTopology.sName
|
||||||
|
m_StrategyList = New ObservableCollection(Of Strategy)((From JsonStrategy In JsonTopology.StrategyList
|
||||||
|
Select New Strategy(Me, JsonStrategy)).ToList())
|
||||||
|
m_AvailableStrategyList_View = New ListCollectionView(StrategyList)
|
||||||
|
m_AvailableStrategyList_View.Filter = AddressOf AvailableStrategyFilter
|
||||||
|
m_ActiveStrategyList_View = New ListCollectionView(StrategyList)
|
||||||
|
m_ActiveStrategyList_View.Filter = AddressOf ActiveStrategyFilter
|
||||||
|
NotifyPropertyChanged(NameOf(StrategyList))
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Private Function AvailableStrategyFilter(Strategy As Object) As Boolean
|
||||||
|
Return DirectCast(Strategy, Strategy).nIndexInList < 0
|
||||||
|
End Function
|
||||||
|
|
||||||
|
Private Function ActiveStrategyFilter(Strategy As Object) As Boolean
|
||||||
|
Return DirectCast(Strategy, Strategy).nIndexInList >= 0
|
||||||
|
End Function
|
||||||
|
|
||||||
|
End Class
|
||||||
|
|
||||||
|
Public Class Strategy
|
||||||
|
Inherits VMBase
|
||||||
|
|
||||||
|
Private m_ParentTopology As Topology
|
||||||
|
|
||||||
|
Private m_sStrategyID As String
|
||||||
|
Public Property sStrategyID As String
|
||||||
|
Get
|
||||||
|
Return m_sStrategyID
|
||||||
|
End Get
|
||||||
|
Set(value As String)
|
||||||
|
m_sStrategyID = value
|
||||||
|
End Set
|
||||||
|
End Property
|
||||||
|
|
||||||
|
Private m_nIndexInList As Integer = -1
|
||||||
|
Public Property nIndexInList As Integer
|
||||||
|
Get
|
||||||
|
Return m_nIndexInList
|
||||||
|
End Get
|
||||||
|
Set(value As Integer)
|
||||||
|
m_nIndexInList = value
|
||||||
|
End Set
|
||||||
|
End Property
|
||||||
|
|
||||||
|
Sub New(ParentTopology As Topology, JsonStrategy As JsonStrategy)
|
||||||
|
m_ParentTopology = ParentTopology
|
||||||
|
m_sStrategyID = JsonStrategy.sStrategyID
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Friend Sub ReadConfiguration(ConfigurationStrategy As JsonStrategy)
|
||||||
|
m_nIndexInList = ConfigurationStrategy.nIndexInList
|
||||||
|
NotifyPropertyChanged(NameOf(nIndexInList))
|
||||||
|
m_ParentTopology.NotifyPropertyChanged(NameOf(m_ParentTopology.AvailableStrategyList_View))
|
||||||
|
m_ParentTopology.NotifyPropertyChanged(NameOf(m_ParentTopology.ActiveStrategyList_View))
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
End Class
|
||||||
|
|
||||||
|
Public Class JsonStrategyFeature
|
||||||
|
|
||||||
|
Private m_sName As String
|
||||||
|
Public Property sName As String
|
||||||
|
Get
|
||||||
|
Return m_sName
|
||||||
|
End Get
|
||||||
|
Set(value As String)
|
||||||
|
m_sName = value
|
||||||
|
End Set
|
||||||
|
End Property
|
||||||
|
|
||||||
|
Private m_nPRC As Integer
|
||||||
|
Public Property nPRC As Integer
|
||||||
|
Get
|
||||||
|
Return m_nPRC
|
||||||
|
End Get
|
||||||
|
Set(value As Integer)
|
||||||
|
m_nPRC = value
|
||||||
|
End Set
|
||||||
|
End Property
|
||||||
|
|
||||||
|
Private m_nGRP As Integer
|
||||||
|
Public Property nGRP As Integer
|
||||||
|
Get
|
||||||
|
Return m_nGRP
|
||||||
|
End Get
|
||||||
|
Set(value As Integer)
|
||||||
|
m_nGRP = value
|
||||||
|
End Set
|
||||||
|
End Property
|
||||||
|
|
||||||
|
Private m_TopologyList As New ObservableCollection(Of JsonTopology)
|
||||||
|
Public Property TopologyList As ObservableCollection(Of JsonTopology)
|
||||||
|
Get
|
||||||
|
Return m_TopologyList
|
||||||
|
End Get
|
||||||
|
Set(value As ObservableCollection(Of JsonTopology))
|
||||||
|
m_TopologyList = value
|
||||||
|
End Set
|
||||||
|
End Property
|
||||||
|
|
||||||
|
End Class
|
||||||
|
|
||||||
|
Public Class JsonTopology
|
||||||
|
|
||||||
|
Private m_sName As String
|
||||||
|
Public Property sName As String
|
||||||
|
Get
|
||||||
|
Return m_sName
|
||||||
|
End Get
|
||||||
|
Set(value As String)
|
||||||
|
m_sName = value
|
||||||
|
End Set
|
||||||
|
End Property
|
||||||
|
|
||||||
|
Private m_StrategyList As New ObservableCollection(Of JsonStrategy)
|
||||||
|
Public Property StrategyList As ObservableCollection(Of JsonStrategy)
|
||||||
|
Get
|
||||||
|
Return m_StrategyList
|
||||||
|
End Get
|
||||||
|
Set(value As ObservableCollection(Of JsonStrategy))
|
||||||
|
m_StrategyList = value
|
||||||
|
End Set
|
||||||
|
End Property
|
||||||
|
|
||||||
|
End Class
|
||||||
|
|
||||||
|
Public Class JsonStrategy
|
||||||
|
|
||||||
|
Private m_sStrategyID As String
|
||||||
|
Public Property sStrategyID As String
|
||||||
|
Get
|
||||||
|
Return m_sStrategyID
|
||||||
|
End Get
|
||||||
|
Set(value As String)
|
||||||
|
m_sStrategyID = value
|
||||||
|
End Set
|
||||||
|
End Property
|
||||||
|
|
||||||
|
Private m_nIndexInList As Integer = -1
|
||||||
|
Public Property nIndexInList As Integer
|
||||||
|
Get
|
||||||
|
Return m_nIndexInList
|
||||||
|
End Get
|
||||||
|
Set(value As Integer)
|
||||||
|
m_nIndexInList = value
|
||||||
|
End Set
|
||||||
|
End Property
|
||||||
|
|
||||||
|
End Class
|
||||||
@@ -51,6 +51,7 @@
|
|||||||
<EgtBEAMWALL:FeatureListManagerVM x:Key="FeatureListManagerVM"/>
|
<EgtBEAMWALL:FeatureListManagerVM x:Key="FeatureListManagerVM"/>
|
||||||
<EgtBEAMWALL:RawPartManagerVM x:Key="RawPartManagerVM"/>
|
<EgtBEAMWALL:RawPartManagerVM x:Key="RawPartManagerVM"/>
|
||||||
<EgtBEAMWALL:SpecialPanelVM x:Key="SpecialPanelVM"/>
|
<EgtBEAMWALL:SpecialPanelVM x:Key="SpecialPanelVM"/>
|
||||||
|
<EgtBEAMWALL:StrategyManagerWndVM x:Key="StrategyManagerWndVM"/>
|
||||||
|
|
||||||
<!--#endregion Panel ViewModel-->
|
<!--#endregion Panel ViewModel-->
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user