-suddiviso xaml strategymanager
This commit is contained in:
@@ -211,10 +211,16 @@
|
||||
<Compile Include="StatusBar\StatusBarV.xaml.vb">
|
||||
<DependentUpon>StatusBarV.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="StrategyManager\ParameterStrategyV.xaml.vb">
|
||||
<DependentUpon>ParameterStrategyV.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="StrategyManager\StrategyManagerV.xaml.vb">
|
||||
<DependentUpon>StrategyManagerV.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="StrategyManager\StrategyManagerVM.vb" />
|
||||
<Compile Include="StrategyManager\StrategyV.xaml.vb">
|
||||
<DependentUpon>StrategyV.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="SupervisorCommThread\SupervisorComm.vb" />
|
||||
<Compile Include="SupervisorCommThread\SupervisorCommThread.vb" />
|
||||
<Compile Include="ToolsDbWindow\MyToolDbWindowVM.vb" />
|
||||
@@ -675,10 +681,18 @@
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Include="StrategyManager\ParameterStrategyV.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="StrategyManager\StrategyManagerV.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="StrategyManager\StrategyV.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="UpdateBTLWnd\OnlyProdUpdateBTLWndV.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
<ItemsControl x:Class="ParameterStrategyV"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
Foreground="Black"
|
||||
Width="900"
|
||||
xmlns:Optmizer="clr-namespace:EgtBEAMWALL.Optimizer"
|
||||
ItemsSource="{Binding SelectedStrategyParamList.ParameterList}">
|
||||
|
||||
<ItemsControl.Resources>
|
||||
<DataTemplate DataType="{x:Type Optmizer:GenericParameter}">
|
||||
<UniformGrid Columns="2">
|
||||
<TextBlock Text="{Binding sName}" HorizontalAlignment="Left"
|
||||
Style="{StaticResource DialogWindow_TextBlock}"/>
|
||||
<TextBox Text="{Binding sValue}"
|
||||
Style="{StaticResource ColorPicker_TextBox}"/>
|
||||
</UniformGrid>
|
||||
</DataTemplate>
|
||||
</ItemsControl.Resources>
|
||||
</ItemsControl>
|
||||
@@ -0,0 +1,3 @@
|
||||
Public Class ParameterStrategyV
|
||||
|
||||
End Class
|
||||
@@ -37,74 +37,12 @@
|
||||
</TreeView.ItemContainerStyle>
|
||||
</TreeView>
|
||||
|
||||
<Grid Grid.Column="1"
|
||||
Grid.RowSpan="2"
|
||||
Width="900"
|
||||
Height="900">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Optmizer:StrategyV Grid.Column="1"
|
||||
Grid.RowSpan="2"/>
|
||||
|
||||
<ListBox ItemsSource="{Binding DeactivateStrategyList, Mode=TwoWay}"
|
||||
SelectedItem="{Binding SelectedStrategy, Mode=TwoWay}"
|
||||
Width="Auto"
|
||||
Height="Auto"
|
||||
IsSynchronizedWithCurrentItem="True"
|
||||
Style="{StaticResource NewAddFeature_ListBox}">
|
||||
<ListBox.Resources>
|
||||
<DataTemplate DataType="{x:Type Optmizer:StrategyConfiguration}">
|
||||
<TextBlock Text="{Binding sStrategyID}"
|
||||
Style="{StaticResource DialogWindow_TextBlock}"/>
|
||||
</DataTemplate>
|
||||
</ListBox.Resources>
|
||||
</ListBox>
|
||||
|
||||
<StackPanel Grid.Column="1"
|
||||
Orientation="Vertical"
|
||||
Background="White"
|
||||
Width="100"
|
||||
VerticalAlignment="Center">
|
||||
<Button Content="→"
|
||||
Command="{Binding AddSelectedStrategyCommand}"/>
|
||||
<Button Content="←"
|
||||
Command="{Binding RemoveSelectedStrategyCommand}"/>
|
||||
</StackPanel>
|
||||
|
||||
<ListBox Grid.Column="2"
|
||||
ItemsSource="{Binding ActiveStrategyList, Mode=TwoWay}"
|
||||
SelectedItem="{Binding SelectedActiveStrategy, Mode=TwoWay}"
|
||||
Width="Auto"
|
||||
Height="Auto"
|
||||
IsSynchronizedWithCurrentItem="True"
|
||||
Style="{StaticResource NewAddFeature_ListBox}">
|
||||
<ListBox.Resources>
|
||||
<DataTemplate DataType="{x:Type Optmizer:StrategyConfiguration}">
|
||||
<TextBlock Text="{Binding sStrategyID}"
|
||||
Style="{StaticResource DialogWindow_TextBlock}"/>
|
||||
</DataTemplate>
|
||||
</ListBox.Resources>
|
||||
</ListBox>
|
||||
</Grid>
|
||||
|
||||
<ItemsControl Grid.Column="2" Foreground="Black"
|
||||
Width="900"
|
||||
ItemsSource="{Binding SelectedStrategy.ParameterList}">
|
||||
<ItemsControl.Resources>
|
||||
<DataTemplate DataType="{x:Type Optmizer:GenericParameter}">
|
||||
<UniformGrid Columns="2">
|
||||
<TextBlock Text="{Binding sName}" HorizontalAlignment="Left"
|
||||
Style="{StaticResource DialogWindow_TextBlock}"/>
|
||||
<TextBox Text="{Binding sValue}"
|
||||
Style="{StaticResource ColorPicker_TextBox}"/>
|
||||
</UniformGrid>
|
||||
</DataTemplate>
|
||||
</ItemsControl.Resources>
|
||||
</ItemsControl>
|
||||
<Optmizer:ParameterStrategyV Grid.Column="2"/>
|
||||
|
||||
<StackPanel Grid.Row="1"
|
||||
Grid.Column="2"
|
||||
Width="900"
|
||||
Background="Blue"/>
|
||||
Width="900"/>
|
||||
</Grid>
|
||||
|
||||
@@ -9,6 +9,18 @@ Public Class StrategyManagerVM
|
||||
|
||||
#Region "FIELDS & PROPERTIES"
|
||||
|
||||
' Lista che contiene il file json AvailableStrategyList
|
||||
Private m_JsonStrategyFeatureList As New ObservableCollection(Of JsonAvailableStrategy)
|
||||
Public Property JsonStrategyFeatureList As ObservableCollection(Of JsonAvailableStrategy)
|
||||
Get
|
||||
Return m_JsonStrategyFeatureList
|
||||
End Get
|
||||
Set(value As ObservableCollection(Of JsonAvailableStrategy))
|
||||
m_JsonStrategyFeatureList = value
|
||||
NotifyPropertyChanged(NameOf(JsonStrategyFeatureList))
|
||||
End Set
|
||||
End Property
|
||||
|
||||
' Lista che contiene il file json AvailableStrategyList
|
||||
Private m_AvailableStrategyList As New ObservableCollection(Of AvailableStrategy)
|
||||
Public Property AvailableStrategyList As ObservableCollection(Of AvailableStrategy)
|
||||
@@ -21,6 +33,18 @@ Public Class StrategyManagerVM
|
||||
End Set
|
||||
End Property
|
||||
|
||||
' Lista che contiene il file json AvailableStrategyList
|
||||
Private m_CustomerConfigurationList As New ObservableCollection(Of AvailableStrategy)
|
||||
Public Property CustomerConfigurationList As ObservableCollection(Of AvailableStrategy)
|
||||
Get
|
||||
Return m_CustomerConfigurationList
|
||||
End Get
|
||||
Set(value As ObservableCollection(Of AvailableStrategy))
|
||||
m_CustomerConfigurationList = value
|
||||
NotifyPropertyChanged(NameOf(CustomerConfigurationList))
|
||||
End Set
|
||||
End Property
|
||||
|
||||
' Seleziona l'elemento della lista StrategyList
|
||||
Public m_SelectedStrategy As StrategyConfiguration
|
||||
Public Property SelectedStrategy As StrategyConfiguration
|
||||
@@ -29,7 +53,21 @@ Public Class StrategyManagerVM
|
||||
End Get
|
||||
Set(value As StrategyConfiguration)
|
||||
m_SelectedStrategy = value
|
||||
m_SelectedStrategyParamList = m_SelectedStrategy
|
||||
NotifyPropertyChanged(NameOf(SelectedStrategy))
|
||||
NotifyPropertyChanged(NameOf(SelectedStrategyParamList))
|
||||
End Set
|
||||
End Property
|
||||
|
||||
' Seleziona l'elemento della lista StrategyList
|
||||
Public m_SelectedStrategyParamList As StrategyConfiguration
|
||||
Public Property SelectedStrategyParamList As StrategyConfiguration
|
||||
Get
|
||||
Return m_SelectedStrategyParamList
|
||||
End Get
|
||||
Set(value As StrategyConfiguration)
|
||||
m_SelectedStrategyParamList = value
|
||||
NotifyPropertyChanged(NameOf(SelectedStrategyParamList))
|
||||
End Set
|
||||
End Property
|
||||
|
||||
@@ -59,7 +97,7 @@ Public Class StrategyManagerVM
|
||||
|
||||
#Region "ActiveStrategy"
|
||||
|
||||
' Lista che contiene le strategie che vengono rese attive
|
||||
' Lista che contiene le strategie che vengono rese non attive
|
||||
Private m_DeactivateStrategyList As New ObservableCollection(Of StrategyConfiguration)
|
||||
Public Property DeactivateStrategyList As ObservableCollection(Of StrategyConfiguration)
|
||||
Get
|
||||
@@ -91,7 +129,9 @@ Public Class StrategyManagerVM
|
||||
End Get
|
||||
Set(value As StrategyConfiguration)
|
||||
m_SelectedActiveStrategy = value
|
||||
m_SelectedStrategyParamList = m_SelectedActiveStrategy
|
||||
NotifyPropertyChanged(NameOf(SelectedActiveStrategy))
|
||||
NotifyPropertyChanged(NameOf(SelectedStrategyParamList))
|
||||
End Set
|
||||
End Property
|
||||
|
||||
@@ -129,7 +169,10 @@ Public Class StrategyManagerVM
|
||||
' Leggo il contenuto del file JSON
|
||||
Dim AvailableStrategyPathJson As String = File.ReadAllText(AvailableStrategyPath)
|
||||
' Deserializza il JSON in un oggetto
|
||||
m_AvailableStrategyList = JsonConvert.DeserializeObject(Of ObservableCollection(Of AvailableStrategy))(AvailableStrategyPathJson)
|
||||
m_JsonStrategyFeatureList = JsonConvert.DeserializeObject(Of ObservableCollection(Of JsonAvailableStrategy))(AvailableStrategyPathJson)
|
||||
' Aggiungo file alla lista
|
||||
m_AvailableStrategyList = New ObservableCollection(Of AvailableStrategy)((From JsonStrategyFeature In JsonStrategyFeatureList
|
||||
Select New AvailableStrategy(JsonStrategyFeature)).ToList())
|
||||
' Leggo tutte le strategie presenti nelle feature
|
||||
For Each AvailableStrategy As AvailableStrategy In m_AvailableStrategyList
|
||||
For Each TopologyStrategy As Topology In AvailableStrategy.TopologyList
|
||||
@@ -138,7 +181,31 @@ Public Class StrategyManagerVM
|
||||
Next
|
||||
Next
|
||||
Next
|
||||
' Leggo tutte le strategie presenti nelle feature per il file json
|
||||
For Each JsonStrategyFeature As JsonAvailableStrategy In m_JsonStrategyFeatureList
|
||||
For Each JsonTopologyStrategy As JsonTopology In JsonStrategyFeature.TopologyList
|
||||
For Each JsonStrategyItem As JsonStrategyConfiguration In JsonTopologyStrategy.StrategyList
|
||||
ReadConfigurationJsonStrategyJson(JsonStrategyItem)
|
||||
Next
|
||||
Next
|
||||
Next
|
||||
End If
|
||||
' Carico CustomConfigJson
|
||||
Dim sAISetupDirPath As String = Map.refMainWindowVM.MainWindowM.GetAISetupDirPath()
|
||||
Dim sCustomerConfigurationFilePath As String = sAISetupDirPath & "\" & CUSTOMERCONFIG_FILE & ".json"
|
||||
If File.Exists(sCustomerConfigurationFilePath) Then
|
||||
Dim sReadedFile As String = File.ReadAllText(sCustomerConfigurationFilePath)
|
||||
m_CustomerConfigurationList = JsonConvert.DeserializeObject(Of ObservableCollection(Of AvailableStrategy))(sReadedFile)
|
||||
End If
|
||||
' Controllo se le due liste sono uguali
|
||||
If m_AvailableStrategyList.Select(Function(x) x.sName).SequenceEqual(m_CustomerConfigurationList.Select(Function(x) x.sName)) Then
|
||||
MessageBox.Show("OK")
|
||||
Else
|
||||
' Devo aggiornare la lista
|
||||
End If
|
||||
' Aggiorno la lista
|
||||
m_AvailableStrategyList = m_CustomerConfigurationList
|
||||
NotifyPropertyChanged(NameOf(AvailableStrategyList))
|
||||
End Sub
|
||||
|
||||
''' <summary>
|
||||
@@ -153,17 +220,36 @@ Public Class StrategyManagerVM
|
||||
' Leggo il contenuto del file JSON
|
||||
Dim StrategyJson As String = File.ReadAllText(StrategyPath)
|
||||
' Deserializza il JSON in un oggetto
|
||||
Dim strategyConfig As StrategyConfiguration = JsonConvert.DeserializeObject(Of StrategyConfiguration)(StrategyJson)
|
||||
Dim strategyConfig As JsonStrategyConfiguration = JsonConvert.DeserializeObject(Of JsonStrategyConfiguration)(StrategyJson)
|
||||
' Assegno ParamList per poter visualizzarla da interfaccia
|
||||
SelectedStrategyItem.ParameterList = New ObservableCollection(Of GenericParameter)((From Parameter In strategyConfig.ParameterList
|
||||
Select New GenericParameter(Parameter)).ToList())
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub ReadConfigurationJsonStrategyJson(SelectedStrategyItem As JsonStrategyConfiguration)
|
||||
' Recupero file StrategyJson
|
||||
Dim StrategyPath As String = Map.refMainWindowVM.MainWindowM.GetStandardDirPath() & "\" & SelectedStrategyItem.sStrategyID & "\" & SelectedStrategyItem.sStrategyID & ".json"
|
||||
' Controllo se il file esiste
|
||||
If File.Exists(StrategyPath) Then
|
||||
' Leggo il contenuto del file JSON
|
||||
Dim StrategyJson As String = File.ReadAllText(StrategyPath)
|
||||
' Deserializza il JSON in un oggetto
|
||||
Dim strategyConfig As JsonStrategyConfiguration = JsonConvert.DeserializeObject(Of JsonStrategyConfiguration)(StrategyJson)
|
||||
' Assegno ParamList per poter visualizzarla da interfaccia
|
||||
SelectedStrategyItem.ParameterList = strategyConfig.ParameterList
|
||||
End If
|
||||
End Sub
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' Funzione per creare file json
|
||||
''' </summary>
|
||||
Friend Sub CreateCustumerConfigJsonFile()
|
||||
' Serializzazione in JSON
|
||||
Dim AvailableStrategyListjsonFile As String = JsonConvert.SerializeObject(m_AvailableStrategyList, Formatting.Indented)
|
||||
Dim AvailableStrategyListjsonFile As String = JsonConvert.SerializeObject(m_JsonStrategyFeatureList, Formatting.Indented)
|
||||
' Scrittura su file
|
||||
File.WriteAllText(Map.refMainWindowVM.MainWindowM.GetAISetupDirPath() & "\" & CUSTOMERCONFIG_FILE & ".json", AvailableStrategyListjsonFile)
|
||||
File.WriteAllText(Map.refMainWindowVM.MainWindowM.GetAISetupDirPath() & "\" & CUSTOMERCONFIG_FILE & "_1.json", AvailableStrategyListjsonFile)
|
||||
End Sub
|
||||
|
||||
#End Region ' Methods
|
||||
@@ -288,6 +374,21 @@ Public Class AvailableStrategy
|
||||
|
||||
#End Region ' Fields & Propeties
|
||||
|
||||
#Region "CONSTRUCTOR"
|
||||
|
||||
Sub New(JsonAvailableStrategy As JsonAvailableStrategy)
|
||||
If Not IsNothing(JsonAvailableStrategy) Then
|
||||
m_sName = JsonAvailableStrategy.sName
|
||||
m_nPRC = JsonAvailableStrategy.nPRC
|
||||
m_nGRP = JsonAvailableStrategy.nGRP
|
||||
m_TopologyList = New ObservableCollection(Of Topology)((From JsonTopology In JsonAvailableStrategy.TopologyList
|
||||
Select New Topology(JsonTopology)).ToList())
|
||||
End If
|
||||
NotifyPropertyChanged(NameOf(TopologyList))
|
||||
End Sub
|
||||
|
||||
#End Region ' Constructor
|
||||
|
||||
End Class
|
||||
|
||||
'----------- Classe che fa riferimento alle Topologie delle Feature -----------
|
||||
@@ -356,6 +457,19 @@ Public Class Topology
|
||||
|
||||
#End Region ' Fields & Propeties
|
||||
|
||||
#Region "CONSTRUCTOR"
|
||||
|
||||
Sub New(JsonTopology As JsonTopology)
|
||||
If Not IsNothing(JsonTopology) Then
|
||||
m_sName = JsonTopology.sName
|
||||
m_StrategyList = New ObservableCollection(Of StrategyConfiguration)((From JsonStrategy In JsonTopology.StrategyList
|
||||
Select New StrategyConfiguration(Me, JsonStrategy)).ToList())
|
||||
End If
|
||||
NotifyPropertyChanged(NameOf(StrategyList))
|
||||
End Sub
|
||||
|
||||
#End Region ' Constructor
|
||||
|
||||
End Class
|
||||
|
||||
'----------- Classe che fa alle Strategie delle Topologie delle Feature -----------
|
||||
@@ -364,6 +478,8 @@ Public Class StrategyConfiguration
|
||||
|
||||
#Region "FIELDS & PROPETIES"
|
||||
|
||||
Private m_ParentTopology As Topology
|
||||
|
||||
Private m_sStrategyID As String
|
||||
Public Property sStrategyID As String
|
||||
Get
|
||||
@@ -416,6 +532,32 @@ Public Class StrategyConfiguration
|
||||
|
||||
#End Region ' Fields & Propeties
|
||||
|
||||
#Region "CONSTRUCTOR"
|
||||
|
||||
Sub New(ParentTopology As Topology, JsonStrategyConfiguration As JsonStrategyConfiguration)
|
||||
m_ParentTopology = ParentTopology
|
||||
If Not IsNothing(JsonStrategyConfiguration) Then
|
||||
m_sStrategyID = JsonStrategyConfiguration.sStrategyID
|
||||
m_nIndexInList = JsonStrategyConfiguration.nIndexInList
|
||||
m_bActive = JsonStrategyConfiguration.bActive
|
||||
m_ParameterList = New ObservableCollection(Of GenericParameter)((From JsonParameter In JsonStrategyConfiguration.ParameterList
|
||||
Select New GenericParameter(JsonParameter)).ToList())
|
||||
End If
|
||||
NotifyPropertyChanged(NameOf(ParameterList))
|
||||
End Sub
|
||||
|
||||
#End Region ' Constructor
|
||||
|
||||
|
||||
#Region "METHODS"
|
||||
|
||||
Friend Sub ReadConfiguration(ConfigurationStrategy As JsonStrategyConfiguration)
|
||||
m_nIndexInList = ConfigurationStrategy.nIndexInList
|
||||
NotifyPropertyChanged(NameOf(nIndexInList))
|
||||
End Sub
|
||||
|
||||
#End Region ' Methods
|
||||
|
||||
End Class
|
||||
|
||||
'----------- Classe che fa riferimento ai parametri delle Strategie -----------
|
||||
@@ -514,4 +656,260 @@ Public Class GenericParameter
|
||||
|
||||
#End Region ' Fields & Propeties
|
||||
|
||||
End Class
|
||||
#Region "CONSTRUCTOR"
|
||||
|
||||
Sub New(JsonGenericParameter As JsonGenericParameter)
|
||||
If Not IsNothing(JsonGenericParameter) Then
|
||||
m_sName = JsonGenericParameter.sName
|
||||
m_sNameNge = JsonGenericParameter.sNameNge
|
||||
m_sValue = JsonGenericParameter.sValue
|
||||
m_sDescriptionShort = JsonGenericParameter.sDescriptionShort
|
||||
m_sDescriptionLong = JsonGenericParameter.sDescriptionLong
|
||||
m_sType = JsonGenericParameter.sType
|
||||
m_sMessageId = JsonGenericParameter.sMessageId
|
||||
m_sMinUserLevel = JsonGenericParameter.sMinUserLevel
|
||||
End If
|
||||
End Sub
|
||||
|
||||
#End Region ' Constructor
|
||||
|
||||
End Class
|
||||
|
||||
'----------- Classe che fa riferimento alle Feature del file Json -----------
|
||||
Public Class JsonAvailableStrategy
|
||||
Inherits VMBase
|
||||
|
||||
#Region "FIELDS & PROPETIES"
|
||||
|
||||
Private m_sName As String
|
||||
Public Property sName As String
|
||||
Get
|
||||
Return m_sName
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_sName = value
|
||||
NotifyPropertyChanged(NameOf(sName))
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_nPRC As Integer
|
||||
Public Property nPRC As Integer
|
||||
Get
|
||||
Return m_nPRC
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
m_nPRC = value
|
||||
NotifyPropertyChanged(NameOf(nPRC))
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_nGRP As Integer
|
||||
Public Property nGRP As Integer
|
||||
Get
|
||||
Return m_nGRP
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
m_nGRP = value
|
||||
NotifyPropertyChanged(NameOf(nGRP))
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_TopologyList As New ObservableCollection(Of JsonTopology)
|
||||
Public Property TopologyList As ObservableCollection(Of JsonTopology)
|
||||
Get
|
||||
Return m_TopologyList
|
||||
End Get
|
||||
Set(value As ObservableCollection(Of JsonTopology))
|
||||
m_TopologyList = value
|
||||
NotifyPropertyChanged(NameOf(TopologyList))
|
||||
End Set
|
||||
End Property
|
||||
|
||||
#End Region ' Fields & Propeties
|
||||
|
||||
End Class
|
||||
|
||||
'----------- Classe che fa riferimento alle Topologie delle Feature del file Json -----------
|
||||
Public Class JsonTopology
|
||||
Inherits VMBase
|
||||
|
||||
#Region "FIELDS & PROPETIES"
|
||||
|
||||
Private m_sName As String
|
||||
Public Property sName As String
|
||||
Get
|
||||
Return m_sName
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_sName = value
|
||||
NotifyPropertyChanged(NameOf(sName))
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_StrategyList As New ObservableCollection(Of JsonStrategyConfiguration)
|
||||
Public Property StrategyList As ObservableCollection(Of JsonStrategyConfiguration)
|
||||
Get
|
||||
Return m_StrategyList
|
||||
End Get
|
||||
Set(value As ObservableCollection(Of JsonStrategyConfiguration))
|
||||
m_StrategyList = value
|
||||
NotifyPropertyChanged(NameOf(StrategyList))
|
||||
End Set
|
||||
End Property
|
||||
|
||||
#End Region ' Fields & Propeties
|
||||
|
||||
End Class
|
||||
|
||||
'----------- Classe che fa alle Strategie delle Topologie delle Feature del file Json -----------
|
||||
Public Class JsonStrategyConfiguration
|
||||
Inherits VMBase
|
||||
|
||||
#Region "FIELDS & PROPETIES"
|
||||
|
||||
Private m_sStrategyID As String
|
||||
Public Property sStrategyID As String
|
||||
Get
|
||||
Return m_sStrategyID
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_sStrategyID = value
|
||||
NotifyPropertyChanged(NameOf(sStrategyID))
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_nIndexInList As Integer = -1
|
||||
Public Property nIndexInList As Integer
|
||||
Get
|
||||
Return m_nIndexInList
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
m_nIndexInList = value
|
||||
NotifyPropertyChanged(NameOf(nIndexInList))
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_bActive As Boolean
|
||||
Public Property bActive As Boolean
|
||||
Get
|
||||
Return m_bActive
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
m_bActive = value
|
||||
NotifyPropertyChanged(NameOf(bActive))
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_ParameterList As New ObservableCollection(Of JsonGenericParameter)
|
||||
Public Property ParameterList As ObservableCollection(Of JsonGenericParameter)
|
||||
Get
|
||||
Return m_ParameterList
|
||||
End Get
|
||||
Set(value As ObservableCollection(Of JsonGenericParameter))
|
||||
m_ParameterList = value
|
||||
NotifyPropertyChanged(NameOf(ParameterList))
|
||||
End Set
|
||||
End Property
|
||||
|
||||
#End Region ' Fields & Propeties
|
||||
|
||||
End Class
|
||||
|
||||
'----------- Classe che fa riferimento ai parametri delle Strategie nel file Json -----------
|
||||
Public Class JsonGenericParameter
|
||||
Inherits VMBase
|
||||
|
||||
#Region "FIELDS & PROPETIES"
|
||||
|
||||
Private m_sName As String
|
||||
Public Property sName As String
|
||||
Get
|
||||
Return m_sName
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_sName = value
|
||||
NotifyPropertyChanged(NameOf(sName))
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_sNameNge As String
|
||||
Public Property sNameNge As String
|
||||
Get
|
||||
Return m_sNameNge
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_sNameNge = value
|
||||
NotifyPropertyChanged(NameOf(sNameNge))
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_sValue As String
|
||||
Public Property sValue As String
|
||||
Get
|
||||
Return m_sValue
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_sValue = value
|
||||
NotifyPropertyChanged(NameOf(sValue))
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_sDescriptionShort As String
|
||||
Public Property sDescriptionShort As String
|
||||
Get
|
||||
Return m_sDescriptionShort
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_sDescriptionShort = value
|
||||
NotifyPropertyChanged(NameOf(sDescriptionShort))
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_sDescriptionLong As String
|
||||
Public Property sDescriptionLong As String
|
||||
Get
|
||||
Return m_sDescriptionLong
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_sDescriptionLong = value
|
||||
NotifyPropertyChanged(NameOf(sDescriptionLong))
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_sType As String
|
||||
Public Property sType As String
|
||||
Get
|
||||
Return m_sType
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_sType = value
|
||||
NotifyPropertyChanged(NameOf(sType))
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_sMessageId As String
|
||||
Public Property sMessageId As String
|
||||
Get
|
||||
Return m_sMessageId
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_sMessageId = value
|
||||
NotifyPropertyChanged(NameOf(sMessageId))
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_sMinUserLevel As Integer
|
||||
Public Property sMinUserLevel As Integer
|
||||
Get
|
||||
Return m_sMinUserLevel
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
m_sMinUserLevel = value
|
||||
NotifyPropertyChanged(NameOf(sMinUserLevel))
|
||||
End Set
|
||||
End Property
|
||||
|
||||
#End Region ' Fields & Propeties
|
||||
|
||||
End Class
|
||||
|
||||
|
||||
@@ -0,0 +1,57 @@
|
||||
<Grid x:Class="StrategyV"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
Width="900"
|
||||
Height="900"
|
||||
xmlns:Optmizer="clr-namespace:EgtBEAMWALL.Optimizer">
|
||||
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<ListBox Name="DeactivateStrategyListBox"
|
||||
ItemsSource="{Binding DeactivateStrategyList, Mode=TwoWay}"
|
||||
SelectedItem="{Binding SelectedStrategy, Mode=TwoWay}"
|
||||
Width="Auto"
|
||||
Height="Auto"
|
||||
IsSynchronizedWithCurrentItem="True"
|
||||
PreviewMouseDown="DeactivateStrategyList_PreviewMouseDown"
|
||||
Style="{StaticResource NewAddFeature_ListBox}">
|
||||
<ListBox.Resources>
|
||||
<DataTemplate DataType="{x:Type Optmizer:StrategyConfiguration}">
|
||||
<TextBlock Text="{Binding sStrategyID}"
|
||||
Style="{StaticResource DialogWindow_TextBlock}"/>
|
||||
</DataTemplate>
|
||||
</ListBox.Resources>
|
||||
</ListBox>
|
||||
|
||||
<StackPanel Grid.Column="1"
|
||||
Orientation="Vertical"
|
||||
Background="White"
|
||||
Width="100"
|
||||
VerticalAlignment="Center">
|
||||
<Button Content="→"
|
||||
Command="{Binding AddSelectedStrategyCommand}"/>
|
||||
<Button Content="←"
|
||||
Command="{Binding RemoveSelectedStrategyCommand}"/>
|
||||
</StackPanel>
|
||||
|
||||
<ListBox Grid.Column="2"
|
||||
Name="ActiveStrategyListBox"
|
||||
ItemsSource="{Binding ActiveStrategyList, Mode=TwoWay}"
|
||||
SelectedItem="{Binding SelectedActiveStrategy, Mode=TwoWay}"
|
||||
Width="Auto"
|
||||
Height="Auto"
|
||||
IsSynchronizedWithCurrentItem="True"
|
||||
PreviewMouseDown="ActiveStrategyList_PreviewMouseDown"
|
||||
Style="{StaticResource NewAddFeature_ListBox}">
|
||||
<ListBox.Resources>
|
||||
<DataTemplate DataType="{x:Type Optmizer:StrategyConfiguration}">
|
||||
<TextBlock Text="{Binding sStrategyID}"
|
||||
Style="{StaticResource DialogWindow_TextBlock}"/>
|
||||
</DataTemplate>
|
||||
</ListBox.Resources>
|
||||
</ListBox>
|
||||
</Grid>
|
||||
@@ -0,0 +1,26 @@
|
||||
Public Class StrategyV
|
||||
|
||||
''' <summary>
|
||||
''' Funzione che permette di riselezionare l'elemento DeactivateStrategyList della lista già selezionato
|
||||
''' </summary>
|
||||
''' <param name="sender"></param>
|
||||
''' <param name="e"></param>
|
||||
Private Sub DeactivateStrategyList_PreviewMouseDown(sender As Object, e As MouseButtonEventArgs)
|
||||
Dim item As Object = DeactivateStrategyListBox.SelectedItem
|
||||
DeactivateStrategyListBox.SelectedItem = Nothing
|
||||
DeactivateStrategyListBox.SelectedItem = item
|
||||
End Sub
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' Funzione che permette di riselezionare l'elemento ActiveStrategyList della lista già selezionato
|
||||
''' </summary>
|
||||
''' <param name="sender"></param>
|
||||
''' <param name="e"></param>
|
||||
Private Sub ActiveStrategyList_PreviewMouseDown(sender As Object, e As MouseButtonEventArgs)
|
||||
Dim item As Object = ActiveStrategyListBox.SelectedItem
|
||||
ActiveStrategyListBox.SelectedItem = Nothing
|
||||
ActiveStrategyListBox.SelectedItem = item
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
Reference in New Issue
Block a user