- modifiche per allineamento a versione DoorArreda

- miglioramento grafico
This commit is contained in:
Emmanuele Sassi
2025-01-20 17:27:45 +01:00
parent 388fc51a37
commit 2079fe7707
32 changed files with 2116 additions and 291 deletions
+14
View File
@@ -9,6 +9,8 @@ Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "Effector.Plugin.Interface",
EndProject
Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "Effector.Plugin.FiveLakes", "Effector.Plugin.FiveLakes\Effector.Plugin.FiveLakes.vbproj", "{7C77F537-8235-40AB-B24A-4E71CFB96D2C}"
EndProject
Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "Effector.Plugin.Lib", "..\Effector.Plugin.Lib\Effector.Plugin.Lib\Effector.Plugin.Lib.vbproj", "{E5ECC5E1-EA7B-447D-9A07-F5EE25D27779}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@@ -55,6 +57,18 @@ Global
{7C77F537-8235-40AB-B24A-4E71CFB96D2C}.Release|x64.Build.0 = Release|Any CPU
{7C77F537-8235-40AB-B24A-4E71CFB96D2C}.Release|x86.ActiveCfg = Release|Any CPU
{7C77F537-8235-40AB-B24A-4E71CFB96D2C}.Release|x86.Build.0 = Release|Any CPU
{E5ECC5E1-EA7B-447D-9A07-F5EE25D27779}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E5ECC5E1-EA7B-447D-9A07-F5EE25D27779}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E5ECC5E1-EA7B-447D-9A07-F5EE25D27779}.Debug|x64.ActiveCfg = Debug|Any CPU
{E5ECC5E1-EA7B-447D-9A07-F5EE25D27779}.Debug|x64.Build.0 = Debug|Any CPU
{E5ECC5E1-EA7B-447D-9A07-F5EE25D27779}.Debug|x86.ActiveCfg = Debug|Any CPU
{E5ECC5E1-EA7B-447D-9A07-F5EE25D27779}.Debug|x86.Build.0 = Debug|Any CPU
{E5ECC5E1-EA7B-447D-9A07-F5EE25D27779}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E5ECC5E1-EA7B-447D-9A07-F5EE25D27779}.Release|Any CPU.Build.0 = Release|Any CPU
{E5ECC5E1-EA7B-447D-9A07-F5EE25D27779}.Release|x64.ActiveCfg = Release|Any CPU
{E5ECC5E1-EA7B-447D-9A07-F5EE25D27779}.Release|x64.Build.0 = Release|Any CPU
{E5ECC5E1-EA7B-447D-9A07-F5EE25D27779}.Release|x86.ActiveCfg = Release|Any CPU
{E5ECC5E1-EA7B-447D-9A07-F5EE25D27779}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@@ -15,10 +15,12 @@ Module ConstIni
Public Const INI_FILE_NAME As String = "Effector.Plugin.FiveLakes.ini"
Public Const S_GENERAL As String = "General"
Public Const K_CAMEXEPATH As String = "CAMExePath"
Public Const K_BACKUPDIR As String = "BackupDir"
Public Const K_RESOURCESDIR As String = "ResourcesDir"
Public Const K_DDFDIR As String = "DDFDir"
Public Const K_GENDDFDIR As String = "GenDDFDir"
Public Const K_CSVOUTPUT As String = "CSVOutput"
Public Const S_CSV As String = "CSV"
Public Const K_DDFNAME As String = "DDFName"
@@ -26,6 +28,11 @@ Module ConstIni
Public Const K_HEIGHT As String = "Height"
Public Const K_WIDTH As String = "Width"
Public Const K_THICKNESS As String = "Thickness"
Public Const K_STATE As String = "State"
Public Const K_PROGRAMSENT As String = "ProgramSent"
Public Const K_PROGRAMSTART As String = "ProgramStart"
Public Const K_PROGRAMEND As String = "ProgramEnd"
Public Const K_MANUALADDEDDOORNAME As String = "ManualAddedDoorName"
Public Const K_DELIMITER As String = "Delimiter"
Public Const S_DEBUG As String = "Debug"
@@ -1,103 +1,246 @@
<Grid x:Class="DoorListPageV"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:Effector.Plugin.FiveLakes">
<Grid.Resources>
<local:StateToSelColorConverter x:Key="StateToSelColorConverter"/>
</Grid.Resources>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="3"/>
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
<StackPanel Orientation="Horizontal">
<Button Content="CSV"
ToolTip="Open CSV file"
Command="{Binding OpenCSV_Command}"
IsEnabled="{Binding bExecButton_IsEnabled}"/>
<Button Content="Skip Door"
ToolTip="Skip Door"
Command="{Binding SkipDoor_Command}"/>
<Button Content="↑"
ToolTip="Move Up"
Command="{Binding MoveUp_Command}"/>
<Button Content="↓"
ToolTip="Move Down"
Command="{Binding MoveDown_Command}"/>
<Button Content="Delete"
ToolTip="Delete"
Command="{Binding Delete_Command}"/>
<Button Content="Delete All"
ToolTip="Delete All"
Command="{Binding DeleteAll_Command}"/>
<Button Content="Produce"
ToolTip="Send to production"
Command="{Binding Produce_Command}"/>
<Button Content="Produce All"
ToolTip="Send all to production"
Command="{Binding ProduceAll_Command}"/>
<Button Content="Reset Production Queue"
ToolTip="Take all the door ready for production back to Verify state"
Command="{Binding ResetProductionQueue_Command}"/>
<Button Content="Verify"
ToolTip="Verify all the doors that are in state Not Verified"
Command="{Binding Verify_Command}"
IsEnabled="{Binding bExecButton_IsEnabled}"/>
</StackPanel>
<DataGrid Grid.Row="1"
<Border BorderThickness="0"
Padding="3"
BorderBrush="Transparent"
Background="{StaticResource Effector_DarkBlue}">
<StackPanel Orientation="Horizontal"
Background="{StaticResource Effector_DarkBlue}">
<Button ToolTip="Open CSV file"
Command="{Binding OpenCSV_Command}"
IsEnabled="{Binding bExecButton_IsEnabled}"
Style="{StaticResource DoorList_Button}">
<Image Source="../Resources/DoorListPage/OpenCsv.png"
Style="{StaticResource Button_Image}"/>
</Button>
<Button ToolTip="Delete CSV file"
Command="{Binding DeleteAll_Command}"
Style="{StaticResource DoorList_Button}">
<Image Source="../Resources/DoorListPage/DeleteCsv.png"
Style="{StaticResource Button_Image}"/>
</Button>
<Button ToolTip="Send selected door to production"
Command="{Binding Produce_Command}"
Style="{StaticResource DoorList_Button}">
<Image Source="../Resources/DoorListPage/Produce.png"
Style="{StaticResource Button_Image}"/>
</Button>
<Button ToolTip="Send all to production"
Command="{Binding ProduceAll_Command}"
Style="{StaticResource DoorList_Button}">
<Image Source="../Resources/DoorListPage/ProduceAll.png"
Style="{StaticResource Button_Image}"/>
</Button>
<Button ToolTip="Take all the door ready for production back to Verify state"
Command="{Binding ResetProductionQueue_Command}"
Style="{StaticResource DoorList_Button}">
<Image Source="../Resources/DoorListPage/ResetProduction.png"
Style="{StaticResource Button_Image}"/>
</Button>
<Button ToolTip="Move Up"
Command="{Binding MoveUp_Command}"
Style="{StaticResource DoorList_Button}">
<Image Source="../Resources/DoorListPage/MoveUp.png"
Style="{StaticResource Button_Image}"/>
</Button>
<Button ToolTip="Move Down"
Command="{Binding MoveDown_Command}"
Style="{StaticResource DoorList_Button}">
<Image Source="../Resources/DoorListPage/MoveDown.png"
Style="{StaticResource Button_Image}"/>
</Button>
<!--<Button ToolTip="Skip selected door, which will not be sent to production"
Command="{Binding SkipDoor_Command}"
Style="{StaticResource DoorList_Button}">
<Image Source="../Resources/DoorListPage/SkipDoor.png"
Style="{StaticResource Button_Image}"/>
</Button>-->
<Button ToolTip="Mark the selected door as not to be produced"
Command="{Binding NotProduceDoor_Command}"
Style="{StaticResource DoorList_Button}">
<Image Source="../Resources/DoorListPage/NotProduce.png"
Style="{StaticResource Button_Image}"/>
</Button>
<Button ToolTip="Add a new door to the list"
Command="{Binding AddDoor_Command}"
Style="{StaticResource DoorList_Button}">
<Image Source="../Resources/DoorListPage/Add.png"
Style="{StaticResource Button_Image}"/>
</Button>
<Button ToolTip="Copy the selected door"
Command="{Binding CopyDoor_Command}"
Style="{StaticResource DoorList_Button}">
<Image Source="../Resources/DoorListPage/Copy.png"
Style="{StaticResource Button_Image}"/>
</Button>
<Button ToolTip="Multiple copy the selected door"
Command="{Binding MultipleCopyDoor_Command}"
Style="{StaticResource DoorList_Button}">
<Image Source="../Resources/DoorListPage/MultipleCopy.png"
Style="{StaticResource Button_Image}"/>
</Button>
<Button ToolTip="Delete door"
Command="{Binding Delete_Command}"
Style="{StaticResource DoorList_Button}">
<Image Source="../Resources/DoorListPage/Delete.png"
Style="{StaticResource Button_Image}"/>
</Button>
<Button ToolTip="Verify all the doors that are in state Not Verified"
Command="{Binding Verify_Command}"
IsEnabled="{Binding bExecButton_IsEnabled}"
Style="{StaticResource DoorList_Button}">
<Image Source="../Resources/DoorListPage/Verify.png"
Style="{StaticResource Button_Image}"/>
</Button>
<TextBlock Text="{Binding sExecPercentage}"
VerticalAlignment="Center"
Margin="10,0,5,0"
Visibility="{Binding ExecPercentage_Visibility, Mode=OneWay}"/>
<ProgressBar Minimum="0"
Maximum="100"
Value="{Binding dExecPercentage, Mode=OneWay}"
Height="15"
Width="100"
Margin="5,0,0,0"
Visibility="{Binding ExecPercentage_Visibility}"/>
</StackPanel>
</Border>
<DataGrid Grid.Row="2"
ItemsSource="{Binding DoorList}"
SelectedItem="{Binding SelDoor}"
AutoGenerateColumns="False"
CanUserDeleteRows="False"
CanUserResizeRows="False"
SelectionMode="Single"
SelectionUnit="FullRow"
CanUserSortColumns="False"
SelectionMode="Single">
ScrollViewer.VerticalScrollBarVisibility="Auto"
ScrollViewer.HorizontalScrollBarVisibility="Disabled"
HorizontalGridLinesBrush="Transparent"
VerticalGridLinesBrush="Transparent"
ColumnHeaderHeight="32"
HeadersVisibility="Column"
FontSize="12"
FontFamily="/Resources/Fonts/#Roboto"
FontWeight="Regular"
RowHeight="32"
BorderThickness="0">
<DataGrid.ColumnHeaderStyle>
<Style TargetType="{x:Type DataGridColumnHeader}">
<Setter Property="Background" Value="{StaticResource Effector_DarkBlue}"/>
<Setter Property="Foreground" Value="White"/>
<Setter Property="HorizontalContentAlignment" Value="Center"/>
<Setter Property="FontSize" Value="15"/>
<Setter Property="Padding" Value="10,0,10,0"/>
</Style>
</DataGrid.ColumnHeaderStyle>
<DataGrid.Columns>
<DataGridTextColumn Header=""
<DataGridTextColumn Header="ID"
Binding="{Binding nId}"
Width="Auto"/>
<DataGridTextColumn Header="Line"
Binding="{Binding nCSVLine}"
Width="Auto"/>
<DataGridTextColumn Header="DDF"
Width="Auto"
IsReadOnly="True"
ElementStyle="{StaticResource DataGridTextColumn_TextBlock}"
EditingElementStyle="{StaticResource DataGridTextColumn_TextBox}"/>
<DataGridTextColumn Header="DDF File Name"
Binding="{Binding sDDFName}"
Width="Auto"/>
<!--<DataGridTextColumn Header="Quantity"
Binding="{Binding nQuantity}"
Width="Auto"/>-->
<DataGridTextColumn Header="State"
Binding="{Binding nState}"
Width="Auto"/>
<DataGridTextColumn Header="Height"
Binding="{Binding dHeight}"
Width="Auto"/>
Width="1*"
MinWidth="100"
IsReadOnly="True"
ElementStyle="{StaticResource DataGridTextColumn_TextBlock}"
EditingElementStyle="{StaticResource DataGridTextColumn_TextBox}"/>
<DataGridTextColumn Header="Width"
Binding="{Binding dWidth}"
Width="Auto"/>
Width="Auto"
IsReadOnly="True"
ElementStyle="{StaticResource DataGridTextColumn_TextBlock}"
EditingElementStyle="{StaticResource DataGridTextColumn_TextBox}"/>
<DataGridTextColumn Header="Height"
Binding="{Binding dHeight}"
Width="Auto"
IsReadOnly="True"
ElementStyle="{StaticResource DataGridTextColumn_TextBlock}"
EditingElementStyle="{StaticResource DataGridTextColumn_TextBox}"/>
<DataGridTextColumn Header="Thickness"
Binding="{Binding dThickness}"
Width="Auto"/>
<DataGridTextColumn Header="Csv"
Width="Auto"
IsReadOnly="True"
ElementStyle="{StaticResource DataGridTextColumn_TextBlock}"
EditingElementStyle="{StaticResource DataGridTextColumn_TextBox}"/>
<DataGridTextColumn Header="State"
Binding="{Binding nState}"
Width="Auto"
IsReadOnly="True"
ElementStyle="{StaticResource DataGridTextColumn_TextBlock}"
EditingElementStyle="{StaticResource DataGridTextColumn_TextBox}"/>
<DataGridTextColumn Header="CSV"
Binding="{Binding sCSVName}"
Width="Auto"/>
Width="Auto"
IsReadOnly="True"
ElementStyle="{StaticResource DataGridTextColumn_TextBlock}"
EditingElementStyle="{StaticResource DataGridTextColumn_TextBox}"/>
<DataGridTextColumn Header="CSV Line"
Binding="{Binding nCSVLine}"
Width="Auto"
IsReadOnly="True"
ElementStyle="{StaticResource DataGridTextColumn_TextBlock}"
EditingElementStyle="{StaticResource DataGridTextColumn_TextBox}"/>
<DataGridTextColumn Header="Production State"
Binding="{Binding nProdState}"
Width="Auto"/>
Width="Auto"
IsReadOnly="True"
ElementStyle="{StaticResource DataGridTextColumn_TextBlock}"
EditingElementStyle="{StaticResource DataGridTextColumn_TextBox}"/>
<DataGridTextColumn Header="Load Time"
Binding="{Binding sLoadTime}"
Width="Auto"/>
Width="Auto"
IsReadOnly="True"
ElementStyle="{StaticResource DataGridTextColumn_TextBlock}"
EditingElementStyle="{StaticResource DataGridTextColumn_TextBox}"/>
<DataGridTextColumn Header="Machining 1 Start"
Binding="{Binding sMachining1Start}"
Width="Auto"/>
Width="Auto"
IsReadOnly="True"
ElementStyle="{StaticResource DataGridTextColumn_TextBlock}"
EditingElementStyle="{StaticResource DataGridTextColumn_TextBox}"/>
<DataGridTextColumn Header="Machining 1 End"
Binding="{Binding sMachining1End}"
Width="Auto"/>
Width="Auto"
IsReadOnly="True"
ElementStyle="{StaticResource DataGridTextColumn_TextBlock}"
EditingElementStyle="{StaticResource DataGridTextColumn_TextBox}"/>
<DataGridTextColumn Header="Machining 2 Start"
Binding="{Binding sMachining2Start}"
Width="Auto"/>
Width="Auto"
IsReadOnly="True"
ElementStyle="{StaticResource DataGridTextColumn_TextBlock}"
EditingElementStyle="{StaticResource DataGridTextColumn_TextBox}"/>
<DataGridTextColumn Header="Machining 2 End"
Binding="{Binding sMachining2End}"
Width="Auto"/>
Width="Auto"
IsReadOnly="True"
ElementStyle="{StaticResource DataGridTextColumn_TextBlock}"
EditingElementStyle="{StaticResource DataGridTextColumn_TextBox}"/>
<DataGridTextColumn Header="Unload Time"
Binding="{Binding sUnloadTime}"
Width="Auto"/>
Width="Auto"
IsReadOnly="True"
ElementStyle="{StaticResource DataGridTextColumn_TextBlock}"
EditingElementStyle="{StaticResource DataGridTextColumn_TextBox}"/>
</DataGrid.Columns>
<DataGrid.RowStyle>
<Style TargetType="DataGridRow">
<Style TargetType="DataGridRow" BasedOn="{StaticResource RowDataGrid_CustomHighLight}">
<Setter Property="Background" Value="{Binding Background}"/>
<Setter Property="BorderBrush" Value="{Binding nState, Converter={StaticResource StateToSelColorConverter}}" />
</Style>
</DataGrid.RowStyle>
</DataGrid>
@@ -3,6 +3,9 @@ Imports System.IO
Imports Newtonsoft.Json
Imports System.Windows.Threading
Imports System.Text.RegularExpressions
Imports Effector.Plugin.FiveLakes.Door
Imports System.Globalization
Imports Effector.Plugin.Lib
Public Class DoorListPageVM
Inherits VMBase
@@ -41,9 +44,38 @@ Public Class DoorListPageVM
Private m_nBackupindex As Integer = 0
Private m_bWritingBackup As Boolean = False
Private m_sCSVOutDirPath As String = ""
Private m_nExecIncrement As Integer = 0
Private m_nExecutedArgsCount As Integer = 0
Public ReadOnly Property dExecPercentage As Double
Get
Dim dExecIncrement As Double = If(IsNothing(m_ExecProcessManager) OrElse m_ExecProcessManager.nArgsInQueue = 0, 0, Math.Min(28, m_nExecIncrement) / 34)
Return If(IsNothing(m_ExecProcessManager), 0, (m_ExecProcessManager.nExecutedArgsCounter + dExecIncrement) / (m_ExecProcessManager.nExecutedArgsCounter + m_ExecProcessManager.nArgsInQueue)) * 100
End Get
End Property
Public ReadOnly Property sExecPercentage As String
Get
Return DoubleToString(dExecPercentage, 1) & "%"
End Get
End Property
Public ReadOnly Property ExecPercentage_Visibility As Visibility
Get
Dim x = If(Not IsNothing(m_ExecProcessManager) AndAlso m_ExecProcessManager.ExecutionThreadStatus = ExecProcessManager.ExecutionThreadStatuses.RUNNING, Visibility.Visible, Visibility.Collapsed)
Return If(Not IsNothing(m_ExecProcessManager) AndAlso m_ExecProcessManager.ExecutionThreadStatus = ExecProcessManager.ExecutionThreadStatuses.RUNNING, Visibility.Visible, Visibility.Collapsed)
End Get
End Property
' Definizione comandi
Private m_cmdOpenCSV As ICommand
Private m_cmdSaveCSV As ICommand
Private m_cmdSkipDoor As ICommand
Private m_cmdNotProduceDoor As ICommand
Private m_cmdAddDoor As ICommand
Private m_cmdCopyDoor As ICommand
Private m_cmdMultipleCopyDoor As ICommand
Private m_cmdMoveUp As ICommand
Private m_cmdMoveDown As ICommand
Private m_cmdDelete As ICommand
@@ -58,6 +90,7 @@ Public Class DoorListPageVM
Sub New()
' imposto riferimento in Map
Map.SetRefDoorListPageVM(Me)
' leggo backup
Dim sBackupDirPath As String = ""
GetPluginPrivateProfileString(S_GENERAL, "BackupDir", "", sBackupDirPath)
Dim sBackupFilePath As String = sBackupDirPath & "\Backup.json"
@@ -67,6 +100,16 @@ Public Class DoorListPageVM
m_RefreshGraphicsTimer.Interval = New TimeSpan(0, 0, 1)
AddHandler m_RefreshGraphicsTimer.Tick, AddressOf RefreshGraphicsTimer_Tick
m_BackupTimer.Start()
' verifico path salvataggio CSV
Dim bStartWriteCSV As Boolean = True
If GetPluginPrivateProfileString(S_GENERAL, K_CSVOUTPUT, "", m_sCSVOutDirPath) = 0 Then
bStartWriteCSV = False
MessageBox.Show("Path di salvataggio CSV non impostata! Impossibile creare file CSV!", "Errore!", MessageBoxButton.OK, MessageBoxImage.Error)
End If
If bStartWriteCSV AndAlso Not Directory.Exists(m_sCSVOutDirPath) Then
bStartWriteCSV = False
MessageBox.Show("Path di salvataggio CSV impostata non esiste! Impossibile creare file CSV!", "Errore!", MessageBoxButton.OK, MessageBoxImage.Error)
End If
m_RefreshGraphicsTimer.Start()
End Sub
#End Region ' CONSTRUCTOR
@@ -103,8 +146,15 @@ Public Class DoorListPageVM
Dim JsonDoorList As List(Of JsonDoor) = JsonConvert.DeserializeObject(Of List(Of JsonDoor))(sReadedFile)
JsonDoorList = JsonDoorList.OrderBy(Of Integer)(Function(x) x.nListIndex).ToList()
m_DoorList = New ObservableCollection(Of Door)((From JsonDoor In JsonDoorList
Select New Door(JsonDoor)).ToList())
Dim TempDoorList As ObservableCollection(Of Door) = New ObservableCollection(Of Door)((From JsonDoor In JsonDoorList
Select New Door(JsonDoor)).ToList())
For Each CurrDoor In TempDoorList
If CurrDoor.nState >= Door.DoorStates.READY_FOR_PRODUCTION Then
CurrDoor.SetState(Door.DoorStates.VERIFIED, False)
End If
Next
WriteBackup()
m_DoorList = TempDoorList
End Sub
Public Sub Write(FilePath As String)
@@ -190,9 +240,20 @@ Public Class DoorListPageVM
WriteBackup()
ArgumentsResult = m_ExecProcessManager.ArgumentsResultDequeue
End While
' aggiorno grafica
If Not bExecButton_IsEnabled AndAlso m_ExecProcessManager.ExecutionThreadStatus = ExecProcessManager.ExecutionThreadStatuses.RUNNING Then
NotifyPropertyChanged(NameOf(dExecPercentage))
NotifyPropertyChanged(NameOf(sExecPercentage))
End If
If Not bExecButton_IsEnabled AndAlso m_ExecProcessManager.ExecutionThreadStatus = ExecProcessManager.ExecutionThreadStatuses.STOPPED Then
SetExecButtonIsEnabled(True)
End If
If m_nExecutedArgsCount <> m_ExecProcessManager.nExecutedArgsCounter Then
m_nExecutedArgsCount = m_ExecProcessManager.nExecutedArgsCounter
m_nExecIncrement = 0
End If
m_nExecIncrement += 1
NotifyPropertyChanged(NameOf(ExecPercentage_Visibility))
End Sub
Friend Function GetNextDoor() As Door
@@ -205,13 +266,14 @@ Public Class DoorListPageVM
Return NextDoor
End Function
Public Sub ResetProductionQueue()
For Each Door In m_DoorList
If Door.nState = Door.DoorStates.READY_FOR_PRODUCTION Then
Door.SetState(Door.DoorStates.VERIFIED, False)
End If
Next
End Sub
Friend Function NewDoorId() As Integer
Dim nId As Integer = 1
If m_DoorList.Count > 0 Then
Dim nMaxId As Integer = m_DoorList.Max(Of Integer)(Function(x) x.nId)
nId = nMaxId + 1
End If
Return nId
End Function
#End Region ' METHODS
@@ -281,7 +343,7 @@ Public Class DoorListPageVM
For nValueIndex = 0 To Values.Count - 1
sLine &= Values(nValueIndex) & If(nValueIndex < Values.Count, ";", "")
Next
sLineErrorList &= "Quantity not readable in line " & sLine & ". This line will be skipped"
sLineErrorList &= "Quantity not readable in line " & sLine & ". This line will be skipped" & Environment.NewLine
Continue While
End If
End If
@@ -304,13 +366,7 @@ Public Class DoorListPageVM
End If
End If
For nQuantityIndex = 1 To nQuantity
Dim nId As Integer = 1
If m_DoorList.Count > 0 Then
Dim nMaxId As Integer = m_DoorList.Max(Of Integer)(Function(x) x.nId)
'If nMaxId < 100 Then
nId = nMaxId + 1
'End If
End If
Dim nId As Integer = NewDoorId()
Dim NewDoor As New Door(nId, nLineIndex, Values(nDDFNameIndex), Path.GetFileName(sCSVPath),
1, dWidth, dHeight, dThickness, Headers, Values)
m_DoorList.Add(NewDoor)
@@ -392,6 +448,161 @@ Public Class DoorListPageVM
#End Region ' OpenCSV
#Region "SaveCSV"
Public ReadOnly Property SaveCSV_Command As ICommand
Get
If m_cmdSaveCSV Is Nothing Then
m_cmdSaveCSV = New Command(AddressOf SaveCSV)
End If
Return m_cmdSaveCSV
End Get
End Property
Public Sub SaveCSV()
' leggo nomi intestazioni da ini
Dim sDDFName As String = ""
Dim sQuantityName As String = ""
Dim sHeightName As String = ""
Dim sWidthName As String = ""
Dim sThicknessName As String = ""
Dim sStateName As String = ""
Dim sProgramSentName As String = ""
Dim sProgramStartName As String = ""
Dim sProgramEndName As String = ""
GetPluginPrivateProfileString(S_CSV, K_DDFNAME, K_DDFNAME, sDDFName)
GetPluginPrivateProfileString(S_CSV, K_QUANTITY, "", sQuantityName)
GetPluginPrivateProfileString(S_CSV, K_HEIGHT, "", sHeightName)
GetPluginPrivateProfileString(S_CSV, K_WIDTH, "", sWidthName)
GetPluginPrivateProfileString(S_CSV, K_THICKNESS, "", sThicknessName)
GetPluginPrivateProfileString(S_CSV, K_STATE, "", sStateName)
GetPluginPrivateProfileString(S_CSV, K_PROGRAMSENT, "", sProgramSentName)
GetPluginPrivateProfileString(S_CSV, K_PROGRAMSTART, "", sProgramStartName)
GetPluginPrivateProfileString(S_CSV, K_PROGRAMEND, "", sProgramEndName)
' recupero nomi csv presenti
Dim CSVFileList As List(Of String) = DoorList.Select(Function(x) x.sCSVName).Distinct().ToList()
Dim sCSVName As String = ""
GetPluginPrivateProfileString(S_CSV, K_MANUALADDEDDOORNAME, "Manual", sCSVName)
CSVFileList.Remove(sCSVName)
For Each CSVFile In CSVFileList
Dim CSVDoorList As List(Of Door) = (From Door In m_DoorList
Where Door.sCSVName = CSVFile).ToList()
Dim sCSVOutPath = m_sCSVOutDirPath & "\Output_" & DateTime.Now().ToString("yy-MM-dd-HH-mm-ss") & ".csv"
Dim sCSVFileList As New List(Of String)
Dim sHeaderRow As String = ""
For Each Parameter In CSVDoorList(0).CustomerParameters
' evito di scrivere la quantita'
If Parameter.sHeader <> sQuantityName Then
sHeaderRow &= Parameter.sHeader & ";"
End If
Next
' aggiungo titoli per tempi di produzione
sHeaderRow &= sStateName & ";" & sProgramSentName & ";" & sProgramStartName & ";" & sProgramEndName
sHeaderRow.TrimEnd(";"c)
sCSVFileList.Add(sHeaderRow)
For Each Door In CSVDoorList
Dim DDFNameParameter As CustomerParameter = Door.CustomerParameters.FirstOrDefault(Function(x) x.sHeader = sDDFName)
If Not IsNothing(DDFNameParameter) Then
DDFNameParameter.SetValue(Door.sDDFName)
End If
Dim HeightNameParameter As CustomerParameter = Door.CustomerParameters.FirstOrDefault(Function(x) x.sHeader = sHeightName)
If Not IsNothing(HeightNameParameter) Then
HeightNameParameter.SetValue(DoubleToString(Door.dHeight, 2))
End If
Dim WidthNameParameter As CustomerParameter = Door.CustomerParameters.FirstOrDefault(Function(x) x.sHeader = sWidthName)
If Not IsNothing(WidthNameParameter) Then
WidthNameParameter.SetValue(DoubleToString(Door.dWidth, 2))
End If
Dim ThicknessNameParameter As CustomerParameter = Door.CustomerParameters.FirstOrDefault(Function(x) x.sHeader = sThicknessName)
If Not IsNothing(ThicknessNameParameter) Then
ThicknessNameParameter.SetValue(DoubleToString(Door.dThickness, 2))
End If
Dim sDoorRow As String = ""
For Each Parameter In Door.CustomerParameters
' evito di scrivere la quantita'
If Parameter.sHeader <> sQuantityName Then
sDoorRow &= Parameter.sValue & ";"
End If
Next
' aggiungo valori per tempi di produzione
Dim sState As String = ""
If Door.nState < DoorStates.MACHINE_1_START Then
sState = "DaProdurre"
ElseIf Door.nState = DoorStates.MACHINE_1_START Then
sState = "InProduzione"
Else
sState = "Prodotto"
End If
sDoorRow &= sState & ";" & Door.sLoadTime & ";" & Door.sMachining1Start & ";" & Door.sMachining1End
sCSVFileList.Add(sDoorRow)
Next
Try
File.WriteAllLines(sCSVOutPath, sCSVFileList)
'MessageBox.Show("Csv salvato in " & m_sCSVOutDirPath, "Info", MessageBoxButton.OK, MessageBoxImage.Information)
Catch ex As Exception
MessageBox.Show("Creazione file csv fallita!" & Environment.NewLine & ex.Message, "Errore", MessageBoxButton.OK, MessageBoxImage.Error)
End Try
Next
'Dim CSVDoorList As List(Of Door) = (From Door In m_DoorList
' Where Door.sCSVName = m_SelDoor.sCSVName).ToList()
'sCSVOutPath &= "\" & m_SelDoor.sCSVName
'Dim sCSVFileList As New List(Of String)
'Dim sHeaderRow As String = ""
'For Each Parameter In m_SelDoor.CustomerParameters
' ' evito di scrivere la quantita'
' If Parameter.sHeader <> sQuantityName Then
' sHeaderRow &= Parameter.sHeader & ";"
' End If
'Next
'sHeaderRow.TrimEnd(";"c)
'sCSVFileList.Add(sHeaderRow)
'For Each Door In CSVDoorList
' Dim DDFNameParameter As CustomerParameter = Door.CustomerParameters.FirstOrDefault(Function(x) x.sHeader = sDDFName)
' If Not IsNothing(DDFNameParameter) Then
' DDFNameParameter.SetValue(Door.sDDFName)
' End If
' Dim HeightNameParameter As CustomerParameter = Door.CustomerParameters.FirstOrDefault(Function(x) x.sHeader = sHeightName)
' If Not IsNothing(HeightNameParameter) Then
' HeightNameParameter.SetValue(DoubleToString(Door.dHeight, 2))
' End If
' Dim WidthNameParameter As CustomerParameter = Door.CustomerParameters.FirstOrDefault(Function(x) x.sHeader = sWidthName)
' If Not IsNothing(WidthNameParameter) Then
' WidthNameParameter.SetValue(DoubleToString(Door.dWidth, 2))
' End If
' Dim ThicknessNameParameter As CustomerParameter = Door.CustomerParameters.FirstOrDefault(Function(x) x.sHeader = sThicknessName)
' If Not IsNothing(ThicknessNameParameter) Then
' ThicknessNameParameter.SetValue(DoubleToString(Door.dThickness, 2))
' End If
' Dim SwingNameParameter As CustomerParameter = Door.CustomerParameters.FirstOrDefault(Function(x) x.sHeader = sSwingName)
' If Not IsNothing(SwingNameParameter) Then
' SwingNameParameter.SetValue(If(Door.nSwing = SWINGTYPE.LEFT, "S", "D"))
' End If
' Dim sDoorRow As String = ""
' For Each Parameter In Door.CustomerParameters
' ' evito di scrivere la quantita'
' If Parameter.sHeader <> sQuantityName Then
' sDoorRow &= Parameter.sValue & ";"
' End If
' Next
' sCSVFileList.Add(sDoorRow)
'Next
'Try
' File.WriteAllLines(sCSVOutPath, sCSVFileList)
' MessageBox.Show("Csv salvato in " & sCSVOutPath, "Info", MessageBoxButton.OK, MessageBoxImage.Information)
'Catch ex As Exception
' MessageBox.Show("Creazione file csv fallita!", "Errore", MessageBoxButton.OK, MessageBoxImage.Error)
'End Try
End Sub
#End Region ' SaveCSV
#Region "SkipDoor"
Public ReadOnly Property SkipDoor_Command As ICommand
@@ -411,6 +622,114 @@ Public Class DoorListPageVM
#End Region ' SkipDoor
#Region "NotProduceDoor"
Public ReadOnly Property NotProduceDoor_Command As ICommand
Get
If m_cmdNotProduceDoor Is Nothing Then
m_cmdNotProduceDoor = New Command(AddressOf NotProduceDoor)
End If
Return m_cmdNotProduceDoor
End Get
End Property
Public Sub NotProduceDoor()
If Not IsNothing(SelDoor) Then
If (Keyboard.Modifiers And ModifierKeys.Shift) = ModifierKeys.Shift Then
If (SelDoor.nState <> Door.DoorStates.VERIFIED AndAlso SelDoor.nState <> Door.DoorStates.NOTPRODUCE) Then Return
Dim sSelCSVName As String = SelDoor.sCSVName
Dim SelDoorState As Door.DoorStates = SelDoor.nState
For Each CsvDoor In m_DoorList
If String.Compare(sSelCSVName, CsvDoor.sCSVName, True) = 0 Then
If CsvDoor.nState = DoorStates.VERIFIED OrElse CsvDoor.nState = DoorStates.NOTPRODUCE Then
CsvDoor.SetState(If(SelDoorState = Door.DoorStates.VERIFIED, Door.DoorStates.NOTPRODUCE, Door.DoorStates.VERIFIED))
End If
End If
Next
Else
If (SelDoor.nState <> Door.DoorStates.VERIFIED AndAlso SelDoor.nState <> Door.DoorStates.NOTPRODUCE) Then Return
SelDoor.SetState(If(SelDoor.nState = Door.DoorStates.VERIFIED, Door.DoorStates.NOTPRODUCE, Door.DoorStates.VERIFIED))
End If
End If
WriteBackup()
End Sub
#End Region ' NotProduceDoor
#Region "AddDoor"
Public ReadOnly Property AddDoor_Command As ICommand
Get
If m_cmdAddDoor Is Nothing Then
m_cmdAddDoor = New Command(AddressOf AddDoor)
End If
Return m_cmdAddDoor
End Get
End Property
Public Sub AddDoor()
Dim nId As Integer = NewDoorId()
Dim sCSVName As String = ""
GetPluginPrivateProfileString(S_CSV, K_MANUALADDEDDOORNAME, "Manual", sCSVName)
m_DoorList.Add(New Door(nId, 0, "", sCSVName, 1, 0, 0, 0, {}, {}))
End Sub
#End Region ' AddDoor
#Region "CopyDoor"
Public ReadOnly Property CopyDoor_Command As ICommand
Get
If m_cmdCopyDoor Is Nothing Then
m_cmdCopyDoor = New Command(AddressOf CopyDoorCmd)
End If
Return m_cmdCopyDoor
End Get
End Property
Public Sub CopyDoorCmd()
If IsNothing(SelDoor) Then
MessageBox.Show("Nessuna porta selezionata!" & Environment.NewLine & "Selezionare la porta da copiare", "Errore!", MessageBoxButton.OK, MessageBoxImage.Error)
Return
End If
CopyDoor()
End Sub
Public Sub CopyDoor()
Dim nId As Integer = NewDoorId()
m_DoorList.Add(SelDoor.Copy(nId))
End Sub
#End Region ' CopyDoor
#Region "MultipleCopyDoor"
Public ReadOnly Property MultipleCopyDoor_Command As ICommand
Get
If m_cmdMultipleCopyDoor Is Nothing Then
m_cmdMultipleCopyDoor = New Command(AddressOf MultipleCopyDoor)
End If
Return m_cmdMultipleCopyDoor
End Get
End Property
Public Sub MultipleCopyDoor()
If IsNothing(SelDoor) Then
MessageBox.Show("Nessuna porta selezionata!" & Environment.NewLine & "Selezionare la porta da copiare", "Errore!", MessageBoxButton.OK, MessageBoxImage.Error)
Return
End If
' apro finestra quantita'
Dim MultipleCopyWndVM As New MultipleCopyWndVM
Dim MultipleCopyWnd As New MultipleCopyWndV(Application.Current.MainWindow, MultipleCopyWndVM)
If MultipleCopyWnd.ShowDialog() Then
For Index = 1 To MultipleCopyWndVM.nCopyNumber
CopyDoor()
Next
End If
End Sub
#End Region ' MultipleCopyDoor
#Region "MoveUp"
Public ReadOnly Property MoveUp_Command As ICommand
@@ -466,7 +785,13 @@ Public Class DoorListPageVM
End Property
Public Sub Delete()
If IsNothing(SelDoor) OrElse SelDoor.nState >= Door.DoorStates.READY_FOR_PRODUCTION Then Return
Dim sCSVName As String = ""
GetPluginPrivateProfileString(S_CSV, K_MANUALADDEDDOORNAME, "Manual", sCSVName)
If m_DoorList.Count = 0 OrElse IsNothing(SelDoor) OrElse String.Compare(SelDoor.sCSVName, sCSVName, True) <> 0 Then Return
Dim bReset As Boolean = True
If Not LuaGetGlobVar("bReset", bReset) OrElse Not bReset Then
If (SelDoor.nState >= Door.DoorStates.READY_FOR_PRODUCTION AndAlso SelDoor.nState < Door.DoorStates.MACHINE_1_END) Then Return
End If
If MessageBox.Show("Are you sure you want to delete the selected door?", "Info", MessageBoxButton.YesNo, MessageBoxImage.Information) = MessageBoxResult.Yes Then
m_DoorList.Remove(SelDoor)
WriteBackup()
@@ -487,12 +812,29 @@ Public Class DoorListPageVM
End Property
Public Sub DeleteAll()
If m_DoorList.Count = 0 Then Return
Dim sCSVName As String = ""
GetPluginPrivateProfileString(S_CSV, K_MANUALADDEDDOORNAME, "Manual", sCSVName)
If m_DoorList.Count = 0 OrElse IsNothing(SelDoor) OrElse String.Compare(SelDoor.sCSVName, sCSVName, True) = 0 Then Return
Dim sSelCSVName As String = SelDoor.sCSVName
' verifico che tutte le porte del csv siano in stato prodotto o da non produrre
Dim bAllProduced As Boolean = True
For Each CsvDoor In m_DoorList
If String.Compare(sSelCSVName, CsvDoor.sCSVName, True) = 0 Then
If CsvDoor.nState <> DoorStates.MACHINE_2_END AndAlso CsvDoor.nState <> DoorStates.PRODUCED AndAlso CsvDoor.nState <> DoorStates.NOTPRODUCE Then
bAllProduced = False
End If
End If
Next
If Not bAllProduced Then
MessageBox.Show("Selected CSV delete impossible!" & Environment.NewLine & "To be able to delete it all the lines needs to be in state Produced or NotProduced", "Warning", MessageBoxButton.OK, MessageBoxImage.Warning)
Return
End If
If MessageBox.Show("Are you sure you want to delete all the doors?", "Info", MessageBoxButton.YesNo, MessageBoxImage.Information) = MessageBoxResult.Yes Then
For nDoorIndex = m_DoorList.Count - 1 To 0 Step -1
Dim Door As Door = m_DoorList(nDoorIndex)
If Door.nState >= Door.DoorStates.READY_FOR_PRODUCTION Then Continue For
m_DoorList.Remove(Door)
For CsvDoorIndex = m_DoorList.Count - 1 To 0 Step -1
Dim CsvDoor As Door = m_DoorList(CsvDoorIndex)
If String.Compare(sSelCSVName, CsvDoor.sCSVName, True) = 0 Then
m_DoorList.Remove(CsvDoor)
End If
Next
WriteBackup()
End If
@@ -518,6 +860,7 @@ Public Class DoorListPageVM
Public Sub ProduceDoor(DoorToProduce As Door, Optional bWriteBackup As Boolean = True)
If IsNothing(DoorToProduce) OrElse DoorToProduce.nState = Door.DoorStates.SKIPPED OrElse
DoorToProduce.nState = Door.DoorStates.NOTPRODUCE OrElse
DoorToProduce.nState = Door.DoorStates.VERIFICATION_FAILED OrElse
DoorToProduce.nState >= Door.DoorStates.READY_FOR_PRODUCTION Then Return
' la sposto dopo l'ultima da produrre
@@ -567,6 +910,14 @@ Public Class DoorListPageVM
WriteBackup()
End Sub
Public Sub ResetProductionQueue()
For Each Door In m_DoorList
If Door.nState = Door.DoorStates.READY_FOR_PRODUCTION Then
Door.SetState(Door.DoorStates.VERIFIED)
End If
Next
End Sub
#End Region ' ResetProductionQueue
#Region "Verify"
@@ -623,6 +974,7 @@ Public Class Door
VERIFIED = 10
VERIFICATION_FAILED = 11
SKIPPED = 20
NOTPRODUCE = 21
READY_FOR_PRODUCTION = 30
ON_LOAD_STATION = 31
MACHINE_1_START = 33
@@ -853,22 +1205,22 @@ Public Class Door
Select Case m_nState
Case DoorStates.LOADED_FROM_CSV
Return Brushes.White
Case DoorStates.VERIFIED
Return Dictionary.Effector_Green_Status
Case DoorStates.VERIFICATION_FAILED
Return Brushes.Red
Case DoorStates.SKIPPED
Return Brushes.Orange
Case DoorStates.READY_FOR_PRODUCTION
Return Brushes.LightSkyBlue
Case DoorStates.ON_LOAD_STATION
Return Brushes.SkyBlue
Return Dictionary.Effector_Red_Status
Case DoorStates.SKIPPED, DoorStates.NOTPRODUCE
Return Dictionary.Effector_Yellow_Status
Case DoorStates.READY_FOR_PRODUCTION, DoorStates.ON_LOAD_STATION
Return Dictionary.Effector_LightBlue_Status
Case DoorStates.MACHINE_1_START
Return Brushes.DodgerBlue
Return Dictionary.Effector_Blue_Status
Case DoorStates.MACHINE_1_END
Return Brushes.Yellow
Case DoorStates.MACHINE_2_START
Return Brushes.DodgerBlue
Return Dictionary.Effector_Blue_Status
Case DoorStates.MACHINE_2_END, DoorStates.PRODUCED
Return Brushes.LightGray
Return Dictionary.Effector_Gray_Status
Case DoorStates.SCRAP
Return Brushes.MediumPurple
Case Else
@@ -893,6 +1245,18 @@ Public Class Door
End If
End Sub
Sub New(nId As Integer, nCSVLine As Integer, sDDFName As String, sCSVName As String, nQuantity As Integer, dWidth As Double, dHeight As Double, dThickness As Double, CustomerParameters As List(Of CustomerParameter))
m_nId = nId
m_nCSVLine = nCSVLine
m_sDDFName = sDDFName
m_sCSVName = sCSVName
m_nQuantity = nQuantity
m_dHeight = dHeight
m_dWidth = dWidth
m_dThickness = dThickness
m_CustomerParameters = CustomerParameters
End Sub
Sub New(JsonDoor As JsonDoor)
m_nId = JsonDoor.nId
m_nCSVLine = JsonDoor.nCSVLine
@@ -913,6 +1277,16 @@ Public Class Door
m_dtUnloadTime = JsonDoor.dtUnloadTime
End Sub
#Region "METHODS"
Friend Function Copy(nId As Integer) As Door
Dim sCSVName As String = ""
GetPluginPrivateProfileString(S_CSV, K_MANUALADDEDDOORNAME, "Manual", sCSVName)
Return New Door(nId, m_nCSVLine, m_sDDFName, sCSVName, m_nQuantity, m_dWidth, m_dHeight, m_dThickness, m_CustomerParameters)
End Function
#End Region ' METHODS
End Class
Public Class CustomerParameter
@@ -930,10 +1304,48 @@ Public Class CustomerParameter
Return m_sValue
End Get
End Property
Friend Sub SetValue(value As String)
m_sValue = value
End Sub
Sub New(sHeader As String, sValue As String)
m_sHeader = sHeader
m_sValue = sValue
End Sub
End Class
Public Class StateToSelColorConverter
Implements IValueConverter
Public Function Convert(value As Object, targetType As Type, parameter As Object, culture As CultureInfo) As Object Implements IValueConverter.Convert
If Not TypeOf value Is DoorStates Then Return Brushes.Aqua
Select Case value
Case DoorStates.LOADED_FROM_CSV
Return Dictionary.Effector_White_SelStatus
Case DoorStates.VERIFIED
Return Dictionary.Effector_Green_SelStatus
Case DoorStates.VERIFICATION_FAILED
Return Dictionary.Effector_Red_SelStatus
Case DoorStates.SKIPPED
Return Dictionary.Effector_Yellow_SelStatus
Case DoorStates.READY_FOR_PRODUCTION, DoorStates.ON_LOAD_STATION
Return Dictionary.Effector_LightBlue_SelStatus
Case DoorStates.MACHINE_1_START, DoorStates.MACHINE_2_START
Return Dictionary.Effector_Blue_SelStatus
Case DoorStates.MACHINE_1_END
Return Dictionary.Effector_Blue_SelStatus
Case DoorStates.MACHINE_2_END, DoorStates.PRODUCED
Return Dictionary.Effector_Gray_SelStatus
Case DoorStates.SCRAP
Return Dictionary.Effector_White_SelStatus
Case Else
Return Dictionary.Effector_White_SelStatus
End Select
End Function
Public Function ConvertBack(value As Object, targetType As Type, parameter As Object, culture As CultureInfo) As Object Implements IValueConverter.ConvertBack
Throw New NotImplementedException()
End Function
End Class
@@ -0,0 +1,977 @@
Imports System.Collections.ObjectModel
Imports System.IO
Imports Newtonsoft.Json
Imports System.Windows.Threading
Imports System.Text.RegularExpressions
Imports Effector.Plugin.FiveLakes.Door
Imports System.Globalization
Public Class DoorListPageVM
Inherits VMBase
Private m_BackupTimer As New DispatcherTimer
Private m_RefreshGraphicsTimer As New DispatcherTimer
Private m_ExecProcessManager As ExecProcessManager
Private m_DoorList As New ObservableCollection(Of Door)
Public ReadOnly Property DoorList As ObservableCollection(Of Door)
Get
Return m_DoorList
End Get
End Property
Private m_SelDoor As Door
Public Property SelDoor As Door
Get
Return m_SelDoor
End Get
Set(value As Door)
m_SelDoor = value
End Set
End Property
Private m_bExecButton_IsEnabled As Boolean = True
Public ReadOnly Property bExecButton_IsEnabled As Boolean
Get
Return m_bExecButton_IsEnabled
End Get
End Property
Private Sub SetExecButtonIsEnabled(bValue As Boolean)
m_bExecButton_IsEnabled = bValue
NotifyPropertyChanged(NameOf(bExecButton_IsEnabled))
End Sub
Private m_nModifyIndex As Integer = 0
Private m_nBackupindex As Integer = 0
Private m_bWritingBackup As Boolean = False
' Definizione comandi
Private m_cmdOpenCSV As ICommand
Private m_cmdSkipDoor As ICommand
Private m_cmdMoveUp As ICommand
Private m_cmdMoveDown As ICommand
Private m_cmdDelete As ICommand
Private m_cmdDeleteAll As ICommand
Private m_cmdProduce As ICommand
Private m_cmdProduceAll As ICommand
Private m_cmdResetProductionQueue As ICommand
Private m_cmdVerify As ICommand
#Region "CONSTRUCTOR"
Sub New()
' imposto riferimento in Map
Map.SetRefDoorListPageVM(Me)
Dim sBackupDirPath As String = ""
GetPluginPrivateProfileString(S_GENERAL, "BackupDir", "", sBackupDirPath)
Dim sBackupFilePath As String = sBackupDirPath & "\Backup.json"
Read(sBackupFilePath)
m_BackupTimer.Interval = New TimeSpan(0, 0, 1)
AddHandler m_BackupTimer.Tick, AddressOf BackupTimer_Tick
m_RefreshGraphicsTimer.Interval = New TimeSpan(0, 0, 1)
AddHandler m_RefreshGraphicsTimer.Tick, AddressOf RefreshGraphicsTimer_Tick
m_BackupTimer.Start()
m_RefreshGraphicsTimer.Start()
End Sub
#End Region ' CONSTRUCTOR
#Region "METHODS"
Friend Function ExecCAMProcess(sDDFName As String) As Boolean
' lancio esecuzione programma
Dim sCamExePath As String = ""
GetPluginPrivateProfileString(S_GENERAL, "CAMExePath", "", sCamExePath)
Dim sMainLuaPath As String = ""
GetPluginPrivateProfileString(S_GENERAL, "MainLUA", "", sMainLuaPath)
Dim sGenDDFDirPath As String = ""
GetPluginPrivateProfileString(S_GENERAL, K_GENDDFDIR, "", sGenDDFDirPath)
Dim sDDFFilePath As String = sGenDDFDirPath & "\" & sDDFName
Return Map.refSupervisorFunction.PlgExecProcess(sCamExePath, sMainLuaPath, sDDFFilePath)
End Function
Friend Function ExecCAMProcessAsync(sDDFName As String) As Boolean
' lancio esecuzione programma
Dim sCamExePath As String = ""
GetPluginPrivateProfileString(S_GENERAL, "CAMExePath", "", sCamExePath)
Dim sMainLuaPath As String = ""
GetPluginPrivateProfileString(S_GENERAL, "MainLUA", "", sMainLuaPath)
Dim sGenDDFDirPath As String = ""
GetPluginPrivateProfileString(S_GENERAL, K_GENDDFDIR, "", sGenDDFDirPath)
Dim sDDFFilePath As String = sGenDDFDirPath & "\" & sDDFName
Return Map.refSupervisorFunction.PlgExecProcessAsync(sCamExePath, sMainLuaPath, sDDFFilePath)
End Function
Public Sub Read(FilePath As String)
If Not File.Exists(FilePath) Then Return
Dim sReadedFile As String = File.ReadAllText(FilePath)
Dim JsonDoorList As List(Of JsonDoor) = JsonConvert.DeserializeObject(Of List(Of JsonDoor))(sReadedFile)
JsonDoorList = JsonDoorList.OrderBy(Of Integer)(Function(x) x.nListIndex).ToList()
m_DoorList = New ObservableCollection(Of Door)((From JsonDoor In JsonDoorList
Select New Door(JsonDoor)).ToList())
End Sub
Public Sub Write(FilePath As String)
Dim JsonDoorList As New List(Of JsonDoor)
For nDoorIndex As Integer = 0 To m_DoorList.Count - 1
JsonDoorList.Add(New JsonDoor(nDoorIndex + 1, m_DoorList(nDoorIndex)))
Next
Dim JsonFromWindow As String = JsonConvert.SerializeObject(JsonDoorList, Formatting.Indented)
If File.Exists(FilePath) Then
Dim sBackupFilePath As String = Path.ChangeExtension(FilePath, ".bck")
If File.Exists(sBackupFilePath) Then
Try
File.Delete(sBackupFilePath)
Catch ex As Exception
Map.refSupervisorFunction.PlgOutLog("Error! Impossible deleting backup file!")
End Try
End If
Try
File.Move(FilePath, sBackupFilePath)
Catch ex As Exception
Map.refSupervisorFunction.PlgOutLog("Error! Impossible renaming backup file!")
End Try
End If
File.WriteAllText(FilePath, JsonFromWindow)
End Sub
Private Sub WriteBackupCmd()
If m_bWritingBackup Then Return
m_bWritingBackup = True
m_nBackupindex = m_nModifyIndex
Dim sBackupDirPath As String = ""
GetPluginPrivateProfileString(S_GENERAL, K_BACKUPDIR, "", sBackupDirPath)
Dim sBackupFilePath As String = sBackupDirPath & "\Backup.json"
Write(sBackupFilePath)
m_bWritingBackup = False
End Sub
Friend Sub WriteBackup()
m_nModifyIndex += 1
End Sub
Private Sub BackupTimer_Tick(sender As Object, e As EventArgs)
If m_nBackupindex < m_nModifyIndex Then
WriteBackupCmd()
End If
End Sub
Private Sub RefreshGraphicsTimer_Tick(sender As Object, e As EventArgs)
If IsNothing(m_ExecProcessManager) Then Return
' ciclo su coda risultati
Dim ArgumentsResult As ProcessArgsResult = m_ExecProcessManager.ArgumentsResultDequeue
While Not IsNothing(ArgumentsResult)
' aggiorno risultato sulla porta
Dim CurrRequestDoor As Door = m_DoorList.FirstOrDefault(Function(x) x.nId = ArgumentsResult.ProcessArgs.nId)
If Not IsNothing(CurrRequestDoor) Then
CurrRequestDoor.SetState(If(ArgumentsResult.nResult = 0, Door.DoorStates.VERIFIED, Door.DoorStates.VERIFICATION_FAILED))
' elimino file generati
Dim sGenDDFDirPath As String = ""
GetPluginPrivateProfileString(S_GENERAL, K_GENDDFDIR, "", sGenDDFDirPath)
Dim sDoorFileName As String = CurrRequestDoor.sDDFName & "_" & CurrRequestDoor.nId
Try
File.Delete(sGenDDFDirPath & "\" & sDoorFileName & ".tok")
File.Delete(sGenDDFDirPath & "\" & sDoorFileName & "_2.tok")
File.Delete(sGenDDFDirPath & "\" & sDoorFileName & ".cnc")
File.Delete(sGenDDFDirPath & "\" & sDoorFileName & "_a.cnc")
File.Delete(sGenDDFDirPath & "\" & sDoorFileName & "_b.cnc")
File.Delete(sGenDDFDirPath & "\" & sDoorFileName & "_2.cnc")
File.Delete(sGenDDFDirPath & "\" & sDoorFileName & "_2_a.cnc")
File.Delete(sGenDDFDirPath & "\" & sDoorFileName & ".html")
File.Delete(sGenDDFDirPath & "\" & sDoorFileName & "_2.html")
File.Delete(sGenDDFDirPath & "\" & sDoorFileName & ".log")
File.Delete(sGenDDFDirPath & "\" & CurrRequestDoor.sDDFName & ".nge")
File.Delete(sGenDDFDirPath & "\" & sDoorFileName & ".nge")
File.Delete(sGenDDFDirPath & "\" & sDoorFileName & ".sest")
File.Delete(sGenDDFDirPath & "\" & sDoorFileName & "_2.sest")
File.Delete(sGenDDFDirPath & "\" & CurrRequestDoor.sDDFName & ".txt")
File.Delete(sGenDDFDirPath & "\" & sDoorFileName & ".txt")
File.Delete(sGenDDFDirPath & "\" & sDoorFileName & "_2.txt")
Catch ex As Exception
End Try
End If
WriteBackup()
ArgumentsResult = m_ExecProcessManager.ArgumentsResultDequeue
End While
If Not bExecButton_IsEnabled AndAlso m_ExecProcessManager.ExecutionThreadStatus = ExecProcessManager.ExecutionThreadStatuses.STOPPED Then
SetExecButtonIsEnabled(True)
End If
End Sub
Friend Function GetNextDoor() As Door
Dim NextDoor As Door = m_DoorList.FirstOrDefault(Function(x) x.nState = Door.DoorStates.READY_FOR_PRODUCTION)
If Not IsNothing(NextDoor) Then
Map.refSupervisorFunction.PlgOutLog("GetNextDoor: door " & NextDoor.nId & " set at ON_LOAD_STATION")
NextDoor.SetState(Door.DoorStates.ON_LOAD_STATION)
WriteBackup()
End If
Return NextDoor
End Function
Public Sub ResetProductionQueue()
For Each Door In m_DoorList
If Door.nState = Door.DoorStates.READY_FOR_PRODUCTION Then
Door.SetState(Door.DoorStates.VERIFIED, False)
End If
Next
End Sub
#End Region ' METHODS
#Region "COMMANDS"
#Region "OpenCSV"
Public ReadOnly Property OpenCSV_Command As ICommand
Get
If m_cmdOpenCSV Is Nothing Then
m_cmdOpenCSV = New Command(AddressOf OpenCSV)
End If
Return m_cmdOpenCSV
End Get
End Property
Public Sub OpenCSV()
Dim sDir As String = String.Empty
'GetMainPrivateProfileString(S_GENERAL, K_LASTIMPDIR, "", sDir)
Dim OpenFileDialog As New Microsoft.Win32.OpenFileDialog() With {
.DefaultExt = ".csv",
.Filter = "CSV (*.csv)|*.csv",
.InitialDirectory = If(Directory.Exists(sDir), sDir, ""),
.CheckFileExists = True,
.ValidateNames = True}
If OpenFileDialog.ShowDialog() Then
Dim sCSVPath As String = OpenFileDialog.FileName
Using MyReader As New Microsoft.VisualBasic.FileIO.TextFieldParser(sCSVPath)
MyReader.TextFieldType = FileIO.FieldType.Delimited
Dim sDelimiter As String = ""
GetPluginPrivateProfileString(S_CSV, K_DELIMITER, ";", sDelimiter)
MyReader.SetDelimiters(sDelimiter)
' leggo intestazione
Dim Headers As String() = MyReader.ReadFields()
Dim sDDFName As String = ""
Dim sQuantityName As String = ""
Dim sHeightName As String = ""
Dim sWidthName As String = ""
Dim sThicknessName As String = ""
GetPluginPrivateProfileString(S_CSV, K_DDFNAME, K_DDFNAME, sDDFName)
GetPluginPrivateProfileString(S_CSV, K_QUANTITY, "", sQuantityName)
GetPluginPrivateProfileString(S_CSV, K_HEIGHT, "", sHeightName)
GetPluginPrivateProfileString(S_CSV, K_WIDTH, "", sWidthName)
GetPluginPrivateProfileString(S_CSV, K_THICKNESS, "", sThicknessName)
Dim nDDFNameIndex As Integer = Array.IndexOf(Headers, sDDFName)
Dim nQuantityNameIndex As Integer = Array.IndexOf(Headers, sQuantityName)
Dim nHeightNameIndex As Integer = Array.IndexOf(Headers, sHeightName)
Dim nWidthNameIndex As Integer = Array.IndexOf(Headers, sWidthName)
Dim nThicknessNameIndex As Integer = Array.IndexOf(Headers, sThicknessName)
If nDDFNameIndex = -1 Then
Dim sMessage As String = "Error! DDFName column not found! Csv file will not be read!"
' egtoutlog(sMessage)
MessageBox.Show(sMessage, "Error", MessageBoxButton.OK, MessageBoxImage.Error)
Return
End If
Dim Values As String()
Dim nLineIndex As Integer = 1
Dim sLineErrorList As String = ""
While Not MyReader.EndOfData
Try
Values = MyReader.ReadFields()
Dim nQuantity As Integer = 1
If nQuantityNameIndex >= 0 AndAlso nQuantityNameIndex < Values.Count Then
If Not Integer.TryParse(Values(nQuantityNameIndex), nQuantity) OrElse nQuantity < 1 Then
nQuantity = 1
Dim sLine As String = ""
For nValueIndex = 0 To Values.Count - 1
sLine &= Values(nValueIndex) & If(nValueIndex < Values.Count, ";", "")
Next
sLineErrorList &= "Quantity not readable in line " & sLine & ". This line will be skipped"
Continue While
End If
End If
Dim dWidth As Double = 0
If nWidthNameIndex >= 0 AndAlso nWidthNameIndex < Values.Count Then
If Not StringToDouble(Values(nWidthNameIndex), dWidth) OrElse dWidth < 0 Then
dWidth = 0
End If
End If
Dim dHeight As Double = 0
If nHeightNameIndex >= 0 AndAlso nHeightNameIndex < Values.Count Then
If Not StringToDouble(Values(nHeightNameIndex), dHeight) OrElse dHeight < 0 Then
dHeight = 0
End If
End If
Dim dThickness As Double = 0
If nThicknessNameIndex >= 0 AndAlso nThicknessNameIndex < Values.Count Then
If Not StringToDouble(Values(nThicknessNameIndex), dThickness) OrElse dThickness < 0 Then
dThickness = 0
End If
End If
For nQuantityIndex = 1 To nQuantity
Dim nId As Integer = 1
If m_DoorList.Count > 0 Then
Dim nMaxId As Integer = m_DoorList.Max(Of Integer)(Function(x) x.nId)
'If nMaxId < 100 Then
nId = nMaxId + 1
'End If
End If
Dim NewDoor As New Door(nId, nLineIndex, Values(nDDFNameIndex), Path.GetFileName(sCSVPath),
1, dWidth, dHeight, dThickness, Headers, Values)
m_DoorList.Add(NewDoor)
Next
nLineIndex += 1
Catch ex As Microsoft.VisualBasic.FileIO.MalformedLineException
Dim sMessage As String = "Line " & ex.Message & "is not valid and will be skipped."
' egtoutlog(sMessage)
sLineErrorList &= Environment.NewLine & ex.Message
End Try
End While
If Not String.IsNullOrWhiteSpace(sLineErrorList) Then
MessageBox.Show("The following lines are not valid and have been skipped:" & sLineErrorList, "Error", MessageBoxButton.OK, MessageBoxImage.Error)
End If
End Using
Dim sCamExePath As String = ""
GetPluginPrivateProfileString(S_GENERAL, "CAMExePath", "", sCamExePath)
Dim sMainLuaPath As String = ""
GetPluginPrivateProfileString(S_GENERAL, "MainPipeLUA", "", sMainLuaPath)
Dim bStartExecProcessManager As Boolean = False
If IsNothing(m_ExecProcessManager) Then
bStartExecProcessManager = True
m_ExecProcessManager = New ExecProcessManager(sCamExePath, """" & sMainLuaPath & """")
AddHandler m_ExecProcessManager.m_AllArgsProcessed, AddressOf ExecProcessManager_AllArgsProcessed
m_ExecProcessManager.SetMaxCamInstances(3)
End If
Dim sDDFDirPath As String = ""
GetPluginPrivateProfileString(S_GENERAL, K_DDFDIR, "", sDDFDirPath)
Dim sGenDDFDirPath As String = ""
GetPluginPrivateProfileString(S_GENERAL, K_GENDDFDIR, "", sGenDDFDirPath)
For Each Door In m_DoorList
If Door.nState = Door.DoorStates.LOADED_FROM_CSV Then
Dim sDDFFilePath As String = sDDFDirPath & "\" & Door.sDDFName & ".ddf"
Dim sGenDDFFilePath As String = sGenDDFDirPath & "\" & Door.sDDFName & "_" & Door.nId & ".ddf"
Try
File.Copy(sDDFFilePath, sGenDDFFilePath, True)
Catch ex As Exception
Map.refSupervisorFunction.PlgOutLog("Error: Copy file from " & sDDFFilePath & " to " & sGenDDFFilePath & " failed!")
End Try
m_ExecProcessManager.ArgumentsEnqueue(New ProcessArgs(Door.nId, sGenDDFFilePath))
End If
Next
If bStartExecProcessManager OrElse m_ExecProcessManager.ExecutionThreadStatus = ExecProcessManager.ExecutionThreadStatuses.STOPPED Then
m_ExecProcessManager.StartExecutionThread()
SetExecButtonIsEnabled(False)
End If
End If
WriteBackup()
End Sub
Public Sub ExecProcessManager_AllArgsProcessed()
m_ExecProcessManager.StopExecutionThread()
End Sub
Public Sub ExecProcessManager_PostProcess(ProcessArgsResult As ProcessArgsResult)
' verifico file di risultati
Dim sDDFDirPath As String = ""
GetPluginPrivateProfileString(S_GENERAL, "DDFDir", "", sDDFDirPath)
Dim sDDFFilePath As String = sDDFDirPath & "\" & ProcessArgsResult.ProcessArgs.sArgs
Dim sTxtFilePath As String = Path.ChangeExtension(sDDFDirPath, ".txt")
If Not File.Exists(sTxtFilePath) Then
ProcessArgsResult.SetResult(-1)
Return
End If
Dim TxtFileLines As String() = File.ReadAllLines(sTxtFilePath)
For nLineIndex As Integer = 0 To TxtFileLines.Count - 1
Dim Match As Match = Regex.Match(TxtFileLines(nLineIndex), "\s*Err\s*=\s*(\d*)\s*")
If Not IsNothing(Match) AndAlso Not IsNothing(Match.Groups(1)) Then
Dim sResult As String = Match.Groups(1).Value
Dim nResult As Integer = -2
If Integer.TryParse(sResult, nResult) Then
ProcessArgsResult.SetResult(nResult)
Else
ProcessArgsResult.SetResult(-2)
End If
End If
Next
End Sub
#End Region ' OpenCSV
#Region "SkipDoor"
Public ReadOnly Property SkipDoor_Command As ICommand
Get
If m_cmdSkipDoor Is Nothing Then
m_cmdSkipDoor = New Command(AddressOf SkipDoor)
End If
Return m_cmdSkipDoor
End Get
End Property
Public Sub SkipDoor()
If IsNothing(SelDoor) OrElse (SelDoor.nState <> Door.DoorStates.VERIFIED AndAlso SelDoor.nState <> Door.DoorStates.SKIPPED) Then Return
SelDoor.SetState(If(SelDoor.nState = Door.DoorStates.VERIFIED, Door.DoorStates.SKIPPED, Door.DoorStates.VERIFIED))
WriteBackup()
End Sub
#End Region ' SkipDoor
#Region "MoveUp"
Public ReadOnly Property MoveUp_Command As ICommand
Get
If m_cmdMoveUp Is Nothing Then
m_cmdMoveUp = New Command(AddressOf MoveUp)
End If
Return m_cmdMoveUp
End Get
End Property
Public Sub MoveUp()
If IsNothing(SelDoor) Then Return
Dim nOldIndex As Integer = m_DoorList.IndexOf(SelDoor)
If nOldIndex = 0 Then Return
If m_DoorList(nOldIndex - 1).nState >= Door.DoorStates.READY_FOR_PRODUCTION Then Return
m_DoorList.Move(nOldIndex, nOldIndex - 1)
WriteBackup()
End Sub
#End Region ' MoveUp
#Region "MoveDown"
Public ReadOnly Property MoveDown_Command As ICommand
Get
If m_cmdMoveDown Is Nothing Then
m_cmdMoveDown = New Command(AddressOf MoveDown)
End If
Return m_cmdMoveDown
End Get
End Property
Public Sub MoveDown()
If IsNothing(SelDoor) OrElse SelDoor.nState >= Door.DoorStates.READY_FOR_PRODUCTION Then Return
Dim nOldIndex As Integer = m_DoorList.IndexOf(SelDoor)
If nOldIndex = m_DoorList.Count - 1 Then Return
m_DoorList.Move(nOldIndex, nOldIndex + 1)
WriteBackup()
End Sub
#End Region ' MoveDown
#Region "Delete"
Public ReadOnly Property Delete_Command As ICommand
Get
If m_cmdDelete Is Nothing Then
m_cmdDelete = New Command(AddressOf Delete)
End If
Return m_cmdDelete
End Get
End Property
Public Sub Delete()
If IsNothing(SelDoor) OrElse SelDoor.nState >= Door.DoorStates.READY_FOR_PRODUCTION Then Return
If MessageBox.Show("Are you sure you want to delete the selected door?", "Info", MessageBoxButton.YesNo, MessageBoxImage.Information) = MessageBoxResult.Yes Then
m_DoorList.Remove(SelDoor)
WriteBackup()
End If
End Sub
#End Region ' Delete
#Region "DeleteAll"
Public ReadOnly Property DeleteAll_Command As ICommand
Get
If m_cmdDeleteAll Is Nothing Then
m_cmdDeleteAll = New Command(AddressOf DeleteAll)
End If
Return m_cmdDeleteAll
End Get
End Property
Public Sub DeleteAll()
If m_DoorList.Count = 0 Then Return
If MessageBox.Show("Are you sure you want to delete all the doors?", "Info", MessageBoxButton.YesNo, MessageBoxImage.Information) = MessageBoxResult.Yes Then
For nDoorIndex = m_DoorList.Count - 1 To 0 Step -1
Dim Door As Door = m_DoorList(nDoorIndex)
If Door.nState >= Door.DoorStates.READY_FOR_PRODUCTION Then Continue For
m_DoorList.Remove(Door)
Next
WriteBackup()
End If
End Sub
#End Region ' DeleteAll
#Region "Produce"
Public ReadOnly Property Produce_Command As ICommand
Get
If m_cmdProduce Is Nothing Then
m_cmdProduce = New Command(AddressOf Produce)
End If
Return m_cmdProduce
End Get
End Property
Public Sub Produce()
ProduceDoor(m_SelDoor)
WriteBackup()
End Sub
Public Sub ProduceDoor(DoorToProduce As Door, Optional bWriteBackup As Boolean = True)
If IsNothing(DoorToProduce) OrElse DoorToProduce.nState = Door.DoorStates.SKIPPED OrElse
DoorToProduce.nState = Door.DoorStates.VERIFICATION_FAILED OrElse
DoorToProduce.nState >= Door.DoorStates.READY_FOR_PRODUCTION Then Return
' la sposto dopo l'ultima da produrre
Dim nNewIndex As Integer = m_DoorList.IndexOf(m_DoorList.FirstOrDefault(Function(x) x.nState < Door.DoorStates.READY_FOR_PRODUCTION))
Dim nOldIndex As Integer = m_DoorList.IndexOf(DoorToProduce)
m_DoorList.Move(nOldIndex, nNewIndex)
DoorToProduce.SetState(Door.DoorStates.READY_FOR_PRODUCTION, bWriteBackup)
End Sub
#End Region ' Produce
#Region "ProduceAll"
Public ReadOnly Property ProduceAll_Command As ICommand
Get
If m_cmdProduceAll Is Nothing Then
m_cmdProduceAll = New Command(AddressOf ProduceAll)
End If
Return m_cmdProduceAll
End Get
End Property
Public Sub ProduceAll()
If m_DoorList.Count = 0 Then Return
For nDoorIndex = 0 To m_DoorList.Count - 1
Dim CurrDoor As Door = m_DoorList(nDoorIndex)
ProduceDoor(CurrDoor, False)
Next
WriteBackup()
End Sub
#End Region ' ProduceAll
#Region "ResetProductionQueue"
Public ReadOnly Property ResetProductionQueue_Command As ICommand
Get
If m_cmdResetProductionQueue Is Nothing Then
m_cmdResetProductionQueue = New Command(AddressOf ResetProductionQueueCmd)
End If
Return m_cmdResetProductionQueue
End Get
End Property
Public Sub ResetProductionQueueCmd()
ResetProductionQueue()
WriteBackup()
End Sub
#End Region ' ResetProductionQueue
#Region "Verify"
Public ReadOnly Property Verify_Command As ICommand
Get
If m_cmdVerify Is Nothing Then
m_cmdVerify = New Command(AddressOf Verify)
End If
Return m_cmdVerify
End Get
End Property
Public Sub Verify()
Dim sCamExePath As String = ""
GetPluginPrivateProfileString(S_GENERAL, "CAMExePath", "", sCamExePath)
Dim sMainLuaPath As String = ""
GetPluginPrivateProfileString(S_GENERAL, "MainPipeLUA", "", sMainLuaPath)
Dim bStartExecProcessManager As Boolean = False
If IsNothing(m_ExecProcessManager) Then
bStartExecProcessManager = True
m_ExecProcessManager = New ExecProcessManager(sCamExePath, """" & sMainLuaPath & """")
'm_ExecProcessManager.SetPostProcess(AddressOf ExecProcessManager_PostProcess)
AddHandler m_ExecProcessManager.m_AllArgsProcessed, AddressOf ExecProcessManager_AllArgsProcessed
m_ExecProcessManager.SetMaxCamInstances(3)
End If
Dim sDDFDirPath As String = ""
GetPluginPrivateProfileString(S_GENERAL, "DDFDir", "", sDDFDirPath)
For Each Door In m_DoorList
If Door.nState = Door.DoorStates.LOADED_FROM_CSV Or Door.nState = Door.DoorStates.VERIFICATION_FAILED Then
Dim sDDFFilePath As String = sDDFDirPath & "\" & Door.sDDFName & ".ddf"
m_ExecProcessManager.ArgumentsEnqueue(New ProcessArgs(Door.nId, sDDFFilePath))
End If
Next
If bStartExecProcessManager OrElse m_ExecProcessManager.ExecutionThreadStatus = ExecProcessManager.ExecutionThreadStatuses.STOPPED Then
m_ExecProcessManager.StartExecutionThread()
SetExecButtonIsEnabled(False)
End If
WriteBackup()
End Sub
#End Region ' Verify
#End Region ' COMMANDS
End Class
Public Class Door
Inherits VMBase
Public Enum DoorStates As Integer
NULL = 0
LOADED_FROM_CSV = 1
VERIFIED = 10
VERIFICATION_FAILED = 11
SKIPPED = 20
NOTPRODUCE = 21
READY_FOR_PRODUCTION = 30
ON_LOAD_STATION = 31
MACHINE_1_START = 33
MACHINE_1_END = 34
MACHINE_2_START = 35
MACHINE_2_END = 36
PRODUCED = 37
SCRAP = 40
End Enum
Public Enum DoorProdStates As Integer
NOT_INIT = 0
IMPORTED = 1
SENT_1 = 2
START_MACHINING_1 = 3
MACHINED_1 = 4
SENT_2 = 5
START_MACHINING_2 = 6
MACHINED_2 = 7
UNLOADED = 8
End Enum
Private m_nId As Integer
Public ReadOnly Property nId As Integer
Get
Return m_nId
End Get
End Property
Private m_nCSVLine As Integer
Public ReadOnly Property nCSVLine As Integer
Get
Return m_nCSVLine
End Get
End Property
Private m_sDDFName As String
Public ReadOnly Property sDDFName As String
Get
Return m_sDDFName
End Get
End Property
Private m_nQuantity As Integer
Public ReadOnly Property nQuantity As Integer
Get
Return m_nQuantity
End Get
End Property
Private m_dWidth As Double
Public ReadOnly Property dWidth As Double
Get
Return m_dWidth
End Get
End Property
Private m_dHeight As Double
Public ReadOnly Property dHeight As Double
Get
Return m_dHeight
End Get
End Property
Private m_dThickness As Double
Public ReadOnly Property dThickness As Double
Get
Return m_dThickness
End Get
End Property
Private m_sCSVName As String
Public ReadOnly Property sCSVName As String
Get
Return m_sCSVName
End Get
End Property
Private m_CustomerParameters As New List(Of CustomerParameter)
Public ReadOnly Property CustomerParameters As List(Of CustomerParameter)
Get
Return m_CustomerParameters
End Get
End Property
Private m_nState As DoorStates = DoorStates.LOADED_FROM_CSV
Public ReadOnly Property nState As DoorStates
Get
Return m_nState
End Get
End Property
Friend Sub SetState(value As DoorStates, Optional bWriteBackup As Boolean = True, Optional bUpdate As Boolean = True)
m_nState = value
If bWriteBackup Then Map.refDoorListPageVM.WriteBackup()
If bUpdate Then
NotifyPropertyChanged(NameOf(nState))
NotifyPropertyChanged(NameOf(Background))
End If
End Sub
#Region "Statistics"
Private m_nProdState As DoorProdStates = DoorProdStates.NOT_INIT
Public ReadOnly Property nProdState As DoorProdStates
Get
Return m_nProdState
End Get
End Property
Friend Sub SetProdState(value As DoorProdStates)
m_nProdState = value
Select Case value
Case DoorProdStates.SENT_1
SetState(DoorStates.ON_LOAD_STATION)
Case DoorProdStates.START_MACHINING_1
SetState(DoorStates.MACHINE_1_START)
Case DoorProdStates.MACHINED_1
SetState(DoorStates.MACHINE_1_END)
Case DoorProdStates.START_MACHINING_2
SetState(DoorStates.MACHINE_2_START)
Case DoorProdStates.MACHINED_2
SetState(DoorStates.MACHINE_2_END)
Case DoorProdStates.UNLOADED
SetState(DoorStates.PRODUCED)
End Select
NotifyPropertyChanged(NameOf(nProdState))
End Sub
Private m_dtLoadTime As DateTime = DateTime.MinValue
Friend ReadOnly Property dtLoadTime As DateTime
Get
Return m_dtLoadTime
End Get
End Property
Public ReadOnly Property sLoadTime As String
Get
Return If(m_dtLoadTime <> DateTime.MinValue, m_dtLoadTime.ToString("yy/MM/dd hh:mm:ss"), "")
End Get
End Property
Friend Sub SetLoadTime(LoadTime As Long)
m_dtLoadTime = New DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc).AddSeconds(LoadTime).ToLocalTime()
NotifyPropertyChanged(NameOf(sLoadTime))
End Sub
Private m_dtMachining1Start As DateTime = DateTime.MinValue
Friend ReadOnly Property dtMachining1Start As DateTime
Get
Return m_dtMachining1Start
End Get
End Property
Public ReadOnly Property sMachining1Start As String
Get
Return If(m_dtMachining1Start <> DateTime.MinValue, m_dtMachining1Start.ToString("yy/MM/dd hh:mm:ss"), "")
End Get
End Property
Friend Sub SetMachining1Start(Machining1Start As Long)
m_dtMachining1Start = New DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc).AddSeconds(Machining1Start).ToLocalTime()
NotifyPropertyChanged(NameOf(sMachining1Start))
End Sub
Private m_dtMachining1End As DateTime = DateTime.MinValue
Friend ReadOnly Property dtMachining1End As DateTime
Get
Return m_dtMachining1End
End Get
End Property
Public ReadOnly Property sMachining1End As String
Get
Return If(m_dtMachining1End <> DateTime.MinValue, m_dtMachining1End.ToString("yy/MM/dd hh:mm:ss"), "")
End Get
End Property
Friend Sub SetMachining1End(Machining1End As Long)
m_dtMachining1End = New DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc).AddSeconds(Machining1End).ToLocalTime()
NotifyPropertyChanged(NameOf(sMachining1End))
End Sub
Private m_dtMachining2Start As DateTime = DateTime.MinValue
Friend ReadOnly Property dtMachining2Start As DateTime
Get
Return m_dtMachining2Start
End Get
End Property
Public ReadOnly Property sMachining2Start As String
Get
Return If(m_dtMachining2Start <> DateTime.MinValue, m_dtMachining2Start.ToString("yy/MM/dd hh:mm:ss"), "")
End Get
End Property
Friend Sub SetMachining2Start(Machining2Start As Long)
m_dtMachining2Start = New DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc).AddSeconds(Machining2Start).ToLocalTime()
NotifyPropertyChanged(NameOf(sMachining2Start))
End Sub
Private m_dtMachining2End As DateTime = DateTime.MinValue
Friend ReadOnly Property dtMachining2End As DateTime
Get
Return m_dtMachining2End
End Get
End Property
Public ReadOnly Property sMachining2End As String
Get
Return If(m_dtMachining2End <> DateTime.MinValue, m_dtMachining2End.ToString("yy/MM/dd hh:mm:ss"), "")
End Get
End Property
Friend Sub SetMachining2End(Machining2End As Long)
m_dtMachining2End = New DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc).AddSeconds(Machining2End).ToLocalTime()
NotifyPropertyChanged(NameOf(sMachining2End))
End Sub
Private m_dtUnloadTime As DateTime = DateTime.MinValue
Friend ReadOnly Property dtUnloadTime As DateTime
Get
Return m_dtUnloadTime
End Get
End Property
Public ReadOnly Property sUnloadTime As String
Get
Return If(m_dtUnloadTime <> DateTime.MinValue, m_dtUnloadTime.ToString("yy/MM/dd hh:mm:ss"), "")
End Get
End Property
Friend Sub SetUnloadTime(UnloadTime As Long)
m_dtUnloadTime = New DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc).AddSeconds(UnloadTime).ToLocalTime()
NotifyPropertyChanged(NameOf(sUnloadTime))
End Sub
#End Region ' Statistics
Public ReadOnly Property Background As SolidColorBrush
Get
Select Case m_nState
Case DoorStates.LOADED_FROM_CSV
Return Brushes.White
Case DoorStates.VERIFIED
Return Dictionary.Effector_Green_Status
Case DoorStates.VERIFICATION_FAILED
Return Dictionary.Effector_Red_Status
Case DoorStates.SKIPPED, DoorStates.NOTPRODUCE
Return Dictionary.Effector_Yellow_Status
Case DoorStates.READY_FOR_PRODUCTION, DoorStates.ON_LOAD_STATION
Return Dictionary.Effector_LightBlue_Status
Case DoorStates.MACHINE_1_START
Return Dictionary.Effector_Blue_Status
Case DoorStates.MACHINE_1_END
Return Brushes.Yellow
Case DoorStates.MACHINE_2_START
Return Dictionary.Effector_Blue_Status
Case DoorStates.MACHINE_2_END, DoorStates.PRODUCED
Return Dictionary.Effector_Gray_Status
Case DoorStates.SCRAP
Return Brushes.MediumPurple
Case Else
Return Brushes.White
End Select
End Get
End Property
Sub New(nId As Integer, nCSVLine As Integer, sDDFName As String, sCSVName As String, nQuantity As Integer, dWidth As Double, dHeight As Double, dThickness As Double, HeaderList As String(), ValueList As String())
m_nId = nId
m_nCSVLine = nCSVLine
m_sDDFName = sDDFName
m_sCSVName = sCSVName
m_nQuantity = nQuantity
m_dHeight = dHeight
m_dWidth = dWidth
m_dThickness = dThickness
If Not IsNothing(HeaderList) AndAlso HeaderList.Count > 0 AndAlso Not IsNothing(ValueList) AndAlso ValueList.Count > 0 Then
For nParamIndex = 0 To Math.Max(HeaderList.Count, ValueList.Count) - 1
m_CustomerParameters.Add(New CustomerParameter(If(HeaderList.Count > nParamIndex, HeaderList(nParamIndex), ""), If(ValueList.Count > nParamIndex, ValueList(nParamIndex), "")))
Next
End If
End Sub
Sub New(JsonDoor As JsonDoor)
m_nId = JsonDoor.nId
m_nCSVLine = JsonDoor.nCSVLine
m_sDDFName = JsonDoor.sDDFName
m_sCSVName = JsonDoor.sCSVName
m_nQuantity = JsonDoor.nQuantity
m_dHeight = JsonDoor.dHeight
m_dWidth = JsonDoor.dWidth
m_dThickness = JsonDoor.dThickness
m_nState = JsonDoor.nState
m_CustomerParameters = JsonDoor.CustomerParameters
m_nProdState = JsonDoor.nProdState
m_dtLoadTime = JsonDoor.dtLoadTime
m_dtMachining1Start = JsonDoor.dtMachining1Start
m_dtMachining1End = JsonDoor.dtMachining1End
m_dtMachining2Start = JsonDoor.dtMachining2Start
m_dtMachining2End = JsonDoor.dtMachining2End
m_dtUnloadTime = JsonDoor.dtUnloadTime
End Sub
End Class
Public Class CustomerParameter
Private m_sHeader As String
Public ReadOnly Property sHeader As String
Get
Return m_sHeader
End Get
End Property
Private m_sValue As String
Public ReadOnly Property sValue As String
Get
Return m_sValue
End Get
End Property
Sub New(sHeader As String, sValue As String)
m_sHeader = sHeader
m_sValue = sValue
End Sub
End Class
Public Class StateToSelColorConverter
Implements IValueConverter
Public Function Convert(value As Object, targetType As Type, parameter As Object, culture As CultureInfo) As Object Implements IValueConverter.Convert
If Not TypeOf value Is DoorStates Then Return Brushes.Aqua
Select Case value
Case DoorStates.LOADED_FROM_CSV
Return Dictionary.Effector_White_SelStatus
Case DoorStates.VERIFIED
Return Dictionary.Effector_Green_SelStatus
Case DoorStates.VERIFICATION_FAILED
Return Dictionary.Effector_Red_SelStatus
Case DoorStates.SKIPPED
Return Dictionary.Effector_Yellow_SelStatus
Case DoorStates.READY_FOR_PRODUCTION, DoorStates.ON_LOAD_STATION
Return Dictionary.Effector_LightBlue_SelStatus
Case DoorStates.MACHINE_1_START, DoorStates.MACHINE_2_START
Return Dictionary.Effector_Blue_SelStatus
Case DoorStates.MACHINE_1_END
Return Dictionary.Effector_Blue_SelStatus
Case DoorStates.MACHINE_2_END, DoorStates.PRODUCED
Return Dictionary.Effector_Gray_SelStatus
Case DoorStates.SCRAP
Return Dictionary.Effector_White_SelStatus
Case Else
Return Dictionary.Effector_White_SelStatus
End Select
End Function
Public Function ConvertBack(value As Object, targetType As Type, parameter As Object, culture As CultureInfo) As Object Implements IValueConverter.ConvertBack
Throw New NotImplementedException()
End Function
End Class
@@ -51,6 +51,9 @@
<Reference Include="Effector.Plugin.Interface">
<HintPath>..\..\Effector.Main\Effector.Plugin.Interface\bin\Debug\Effector.Plugin.Interface.dll</HintPath>
</Reference>
<Reference Include="Effector.Plugin.Lib">
<HintPath>..\..\Effector.Plugin.Lib\Effector.Plugin.Lib\bin\Debug\Effector.Plugin.Lib.dll</HintPath>
</Reference>
<Reference Include="KeraLua, Version=1.4.1.0, Culture=neutral, PublicKeyToken=6a194c04b9c89217, processorArchitecture=MSIL">
<HintPath>..\packages\KeraLua.1.4.1\lib\net46\KeraLua.dll</HintPath>
</Reference>
@@ -98,9 +101,6 @@
<DependentUpon>DoorListPageV.xaml</DependentUpon>
</Compile>
<Compile Include="DoorListPage\DoorListPageVM.vb" />
<Compile Include="ProcessManager\ProcessManagerV.xaml.vb">
<DependentUpon>ProcessManagerV.xaml</DependentUpon>
</Compile>
<Compile Include="FiveLakesUI.xaml.vb">
<DependentUpon>FiveLakesUI.xaml</DependentUpon>
</Compile>
@@ -116,7 +116,6 @@
<DependentUpon>MainMenuV.xaml</DependentUpon>
</Compile>
<Compile Include="MainMenu\MainMenuVM.vb" />
<Compile Include="ProcessManager\ProcessManagerVM.vb" />
<Compile Include="RestartWnd\RestartWndV.xaml.vb">
<DependentUpon>RestartWndV.xaml</DependentUpon>
</Compile>
@@ -142,7 +141,6 @@
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
<Compile Include="Utility\Command.vb" />
<Compile Include="Utility\ExecProcessManager.vb" />
<Compile Include="Utility\GenInterface.vb" />
<Compile Include="Utility\IdNameStruct.vb" />
<Compile Include="Utility\IniFile.vb" />
@@ -160,16 +158,14 @@
<LastGenOutput>Settings.Designer.vb</LastGenOutput>
</None>
<None Include="packages.config" />
<Resource Include="Resources\Fonts\Roboto-Light.ttf" />
<Resource Include="Resources\Fonts\Roboto-Regular.ttf" />
</ItemGroup>
<ItemGroup>
<Page Include="DoorListPage\DoorListPageV.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="ProcessManager\ProcessManagerV.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="FiveLakesUI.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
@@ -195,6 +191,27 @@
<Generator>MSBuild:Compile</Generator>
</Page>
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\DoorListPage\Add.png" />
<Resource Include="Resources\DoorListPage\Copy.png" />
<Resource Include="Resources\DoorListPage\MultipleCopy.png" />
<Resource Include="Resources\DoorListPage\OpenCsv.png" />
<Resource Include="Resources\DoorListPage\Produce.png" />
<Resource Include="Resources\DoorListPage\ProduceAll.png" />
<Resource Include="Resources\DoorListPage\ResetProduction.png" />
<Resource Include="Resources\DoorListPage\SaveCsv.png" />
<Resource Include="Resources\DoorListPage\SkipDoor.png" />
<Resource Include="Resources\DoorListPage\Verify.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\DoorListPage\Delete.png" />
<Resource Include="Resources\DoorListPage\DeleteCsv.png" />
<Resource Include="Resources\DoorListPage\MoveDown.png" />
<Resource Include="Resources\DoorListPage\MoveUp.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\DoorListPage\NotProduce.png" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />
<PropertyGroup>
<PreBuildEvent>powershell.exe -ExecutionPolicy Unrestricted -NoProfile -NonInteractive -File $(ProjectDir)\pre-build.ps1 -ProjectDir $(ProjectDir) -ProjectPath $(ProjectPath)</PreBuildEvent>
+2 -13
View File
@@ -3,12 +3,8 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:Effector.Plugin.FiveLakes"
DataContext="{StaticResource FiveLakesUIVM}">
<TabControl SelectedIndex="{Binding SelPage}">
<TabControl.ItemContainerStyle>
<Style TargetType="TabItem">
<Setter Property="Visibility" Value="Collapsed" />
</Style>
</TabControl.ItemContainerStyle>
<TabControl SelectedIndex="{Binding SelPage}"
Style="{StaticResource NoHeader_TabControl}">
<TabItem Name="DoorList"
Header="DoorList">
<local:DoorListPageV DataContext="{StaticResource DoorListVM}"/>
@@ -22,11 +18,4 @@
<local:StatisticsPageV DataContext="{StaticResource StatisticsPageVM}"/>
</TabItem>
</TabControl>
<!--<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<TextBlock Text="{Binding TextTest}" Background="Green"/>
<Button Grid.Column="1"
x:Name="Button1"/>-->
</Grid>
@@ -53,6 +53,7 @@ Public Class FiveLakesUIVM
m_sConfigDir = m_sDataRoot & "\" & CONF_DIR
' Impostazione path Ini file
IniFile.SetIniFile(m_sConfigDir & "\" & INI_FILE_NAME)
Effector.Plugin.Lib.PluginIniFile.SetIniFile(m_sConfigDir & "\" & INI_FILE_NAME)
' Impostazione path resources dir
m_sResourcesRoot = m_sDataRoot & "\" & RES_DIR
End Sub
@@ -14,19 +14,19 @@
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<RadioButton Content="Door List"
<RadioButton Content="DOOR LIST"
Command="{Binding Page_Command}"
CommandParameter="{StaticResource Door_List}"
IsChecked="True"
Style="{StaticResource {x:Type ToggleButton}}"/>
Style="{StaticResource MainMenu_ToggleButton}"/>
<RadioButton Grid.Column="1"
Content="Machine Status"
Content="MACHINE STATUS"
Command="{Binding Page_Command}"
CommandParameter="{StaticResource Machine_State}"
Style="{StaticResource {x:Type ToggleButton}}"/>
<RadioButton Grid.Column="2"
Style="{StaticResource MainMenu_ToggleButton}"/>
<!--<RadioButton Grid.Column="2"
Content="Statistics"
Command="{Binding Page_Command}"
CommandParameter="{StaticResource Statistics}"
Style="{StaticResource {x:Type ToggleButton}}"/>
Style="{StaticResource MainMenu_ToggleButton}"/>-->
</Grid>
@@ -1,57 +1,67 @@
<Window x:Class="ProcessManagerV"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Height="200"
Width="300">
<StackPanel>
<Grid HorizontalAlignment="Center">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="30"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<TextBlock Text="Arguments Queue Count: "/>
<TextBlock Grid.Column="1"
Text="{Binding ArgumentsQueue}"/>
<TextBlock Grid.Row="1"
Text="ResultQueue: "/>
<TextBlock Grid.Column="1"
Grid.Row="1"
Text="{Binding ResultQueue}"/>
</Grid>
<!--<DataGrid ItemsSource="{Binding ThreadList}"
AutoGenerateColumns="False">
<DataGrid.Columns>
<DataGridTextColumn Header="Process Status"
Binding="{Binding ProcessStatus}"/>
<DataGridTextColumn Header="Curr Request Id"
Binding="{Binding CurrRequest.nId}"/>
<DataGridTextColumn Header="Curr Request Args"
Binding="{Binding CurrRequest.sArgs}"/>
<DataGridTextColumn Header="Process Result"
Binding="{Binding nProcResult}"/>
</DataGrid.Columns>
</DataGrid>-->
<ItemsControl ItemsSource="{Binding ThreadList}">
<ItemsControl.ItemTemplate>
<DataTemplate>
<StackPanel Orientation="Horizontal">
<TextBlock Text="{Binding ProcessStatus}"/>
<TextBlock Text="{Binding CurrRequest.nId}"/>
<TextBlock Text="{Binding CurrRequest.sArgs}"/>
<TextBlock Text="{Binding nProcResult}"/>
</StackPanel>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
<ProgressBar Value="{Binding dProgress_Value, Mode=OneWay}"
Minimum="0"
Maximum="{Binding dProgress_Maximum}"
Height="20"
Width="250"/>
<Lib:EgtWindow x:Class="ProcessManagerV"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:Lib="clr-namespace:Effector.Plugin.Lib;assembly=Effector.Plugin.Lib"
TitleBarHeight="30"
WindowStartupLocation="CenterOwner"
ShowInTaskbar="False"
SizeToContent="WidthAndHeight">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="{Binding TitleBarHeight, RelativeSource={RelativeSource AncestorType={x:Type Lib:EgtWindow}}}"/>
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
<Lib:TitleBar/>
<StackPanel Grid.Row="1">
<Grid HorizontalAlignment="Center">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="30"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<TextBlock Text="Arguments Queue Count: "/>
<TextBlock Grid.Column="1"
Text="{Binding ArgumentsQueue}"/>
<TextBlock Grid.Row="1"
Text="ResultQueue: "/>
<TextBlock Grid.Column="1"
Grid.Row="1"
Text="{Binding ResultQueue}"/>
</Grid>
<!--<DataGrid ItemsSource="{Binding ThreadList}"
AutoGenerateColumns="False">
<DataGrid.Columns>
<DataGridTextColumn Header="Process Status"
Binding="{Binding ProcessStatus}"/>
<DataGridTextColumn Header="Curr Request Id"
Binding="{Binding CurrRequest.nId}"/>
<DataGridTextColumn Header="Curr Request Args"
Binding="{Binding CurrRequest.sArgs}"/>
<DataGridTextColumn Header="Process Result"
Binding="{Binding nProcResult}"/>
</DataGrid.Columns>
</DataGrid>-->
<ItemsControl ItemsSource="{Binding ThreadList}">
<ItemsControl.ItemTemplate>
<DataTemplate>
<StackPanel Orientation="Horizontal">
<TextBlock Text="{Binding ProcessStatus}"/>
<TextBlock Text="{Binding CurrRequest.nId}"/>
<TextBlock Text="{Binding CurrRequest.sArgs}"/>
<TextBlock Text="{Binding nProcResult}"/>
</StackPanel>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
<ProgressBar Value="{Binding dProgress_Value, Mode=OneWay}"
Minimum="0"
Maximum="{Binding dProgress_Maximum}"
Height="20"
Width="250"/>
</StackPanel>
</Window>
</StackPanel>
</Grid>
</Lib:EgtWindow>
@@ -1,5 +1,6 @@
Imports System.Windows.Threading
Imports System.Collections.ObjectModel
Imports Effector.Plugin.Lib
Public Class ProcessManagerVM
Inherits VMBase
Binary file not shown.

After

Width:  |  Height:  |  Size: 542 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 484 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 608 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 773 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 358 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 328 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 547 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 730 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 626 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 452 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 767 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 390 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 175 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 685 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 237 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 668 B

+246 -41
View File
@@ -16,43 +16,88 @@
<local:StatisticsPageVM x:Key="StatisticsPageVM"/>
<!--Colori predefiniti-->
<SolidColorBrush x:Key="EgaltechBlue1" Color="#FF4D84C4" />
<SolidColorBrush x:Key="EgaltechBlue2" Color="#FF7096CE" />
<SolidColorBrush x:Key="EgaltechBlue3" Color="#FF90ABD9" />
<SolidColorBrush x:Key="EgaltechBlue4" Color="#FFB2C3E4" />
<SolidColorBrush x:Key="EgaltechWhite" Color="#FFFFFFFF" />
<SolidColorBrush x:Key="EgaltechGray" Color="#FF585858" />
<SolidColorBrush x:Key="EgaltechLightGray" Color="LightGray" />
<SolidColorBrush x:Key="EgaltechUltralightGray" Color="#FFF2F2F2" />
<SolidColorBrush x:Key="EgaltechGreen" Color="#FF00FF00" />
<SolidColorBrush x:Key="Roller" Color="#FF585858" />
<SolidColorBrush x:Key="TableFrame" Color="LightGray" />
<SolidColorBrush x:Key="Structure" Color="#61b0ff" />
<SolidColorBrush x:Key="Bridge" Color="LightBlue" />
<SolidColorBrush x:Key="Shuttle" Color="DarkGray" />
<!--#92908d-->
<Color x:Key="Icarus_Gray_Color" R="146" G="144" B="141" A="255"/>
<SolidColorBrush x:Key="Icarus_Gray" Color="{StaticResource Icarus_Gray_Color}" />
<!--#3c89c9-->
<Color x:Key="Icarus_LightBlue_Color" R="60" G="137" B="201" A="255"/>
<SolidColorBrush x:Key="Icarus_LightBlue" Color="{StaticResource Icarus_LightBlue_Color}" />
<!--#2e5a81-->
<Color x:Key="Icarus_Blue_Color" R="46" G="90" B="129" A="255"/>
<SolidColorBrush x:Key="Icarus_Blue" Color="{StaticResource Icarus_Blue_Color}" />
<!--#50A388-->
<Color x:Key="Icarus_Green_Color" R="80" G="163" B="136" A="255"/>
<SolidColorBrush x:Key="Icarus_Green" Color="{StaticResource Icarus_Green_Color}" />
<!--#e8eef5-->
<Color x:Key="Effector_LightBlue_Color" R="232" G="238" B="245" A="255"/>
<SolidColorBrush x:Key="Effector_LightBlue" Color="{StaticResource Effector_LightBlue_Color}" />
<!--#afc5d6-->
<Color x:Key="Effector_Blue_Color" R="175" G="197" B="214" A="255"/>
<SolidColorBrush x:Key="Effector_Blue" Color="{StaticResource Effector_Blue_Color}" />
<!--#749fc4-->
<Color x:Key="Effector_DarkBlue_Color" R="116" G="159" B="196" A="255"/>
<SolidColorBrush x:Key="Effector_DarkBlue" Color="{StaticResource Effector_DarkBlue_Color}" />
<!--#92bde3-->
<Color x:Key="Effector_LightBlue_Status_Color" R="146" G="189" B="227" A="255"/>
<SolidColorBrush x:Key="Effector_LightBlue_Status" Color="{StaticResource Effector_LightBlue_Status_Color}" />
<!--#5682a6-->
<Color x:Key="Effector_Blue_Status_Color" R="86" G="130" B="166" A="255"/>
<SolidColorBrush x:Key="Effector_Blue_Status" Color="{StaticResource Effector_Blue_Status_Color}" />
<!--#cd5c5c-->
<Color x:Key="Effector_Red_Status_Color" R="205" G="92" B="92" A="255"/>
<SolidColorBrush x:Key="Effector_Red_Status" Color="{StaticResource Effector_Red_Status_Color}" />
<!--#b1cbaa-->
<Color x:Key="Effector_Green_Status_Color" R="177" G="203" B="170" A="255"/>
<SolidColorBrush x:Key="Effector_Green_Status" Color="{StaticResource Effector_Green_Status_Color}" />
<!--#9c9c9c-->
<Color x:Key="Effector_Gray_Status_Color" R="156" G="156" B="156" A="255"/>
<SolidColorBrush x:Key="Effector_Gray_Status" Color="{StaticResource Effector_Gray_Status_Color}" />
<!--#ffd932-->
<Color x:Key="Effector_Yellow_Status_Color" R="255" G="217" B="50" A="255"/>
<SolidColorBrush x:Key="Effector_Yellow_Status" Color="{StaticResource Effector_Yellow_Status_Color}" />
<!--#6398c7-->
<Color x:Key="Effector_LightBlue_SelStatus_Color" R="99" G="152" B="199" A="255"/>
<SolidColorBrush x:Key="Effector_LightBlue_SelStatus" Color="{StaticResource Effector_LightBlue_SelStatus_Color}" />
<!--#4b677e-->
<Color x:Key="Effector_Blue_SelStatus_Color" R="75" G="103" B="126" A="255"/>
<SolidColorBrush x:Key="Effector_Blue_SelStatus" Color="{StaticResource Effector_Blue_SelStatus_Color}" />
<!--#a94444-->
<Color x:Key="Effector_Red_SelStatus_Color" R="169" G="68" B="68" A="255"/>
<SolidColorBrush x:Key="Effector_Red_SelStatus" Color="{StaticResource Effector_Red_SelStatus_Color}" />
<!--#89aa81-->
<Color x:Key="Effector_Green_SelStatus_Color" R="137" G="170" B="129" A="255"/>
<SolidColorBrush x:Key="Effector_Green_SelStatus" Color="{StaticResource Effector_Green_SelStatus_Color}" />
<!--#7d7d7d-->
<Color x:Key="Effector_Gray_SelStatus_Color" R="125" G="125" B="125" A="255"/>
<SolidColorBrush x:Key="Effector_Gray_SelStatus" Color="{StaticResource Effector_Gray_SelStatus_Color}" />
<!--#dcb718-->
<Color x:Key="Effector_Yellow_SelStatus_Color" R="220" G="183" B="24" A="255"/>
<SolidColorBrush x:Key="Effector_Yellow_SelStatus" Color="{StaticResource Effector_Yellow_SelStatus_Color}" />
<!--#e5ebf1-->
<Color x:Key="Effector_White_SelStatus_Color" R="229" G="235" B="241" A="255"/>
<SolidColorBrush x:Key="Effector_White_SelStatus" Color="{StaticResource Effector_Yellow_SelStatus_Color}" />
<!--#BC373E-->
<Color x:Key="Icarus_Orange_Color" R="188" G="55" B="62" A="255"/>
<SolidColorBrush x:Key="Icarus_Orange" Color="{StaticResource Icarus_Orange_Color}" />
<!--
<Color x:Key="Effector_Orange_Color" R="188" G="55" B="62" A="255"/>
<SolidColorBrush x:Key="Effector_Orange" Color="{StaticResource Effector_Orange_Color}" />-->
<!--#A74C77-->
<Color x:Key="Icarus_Purple_Color" R="167" G="76" B="119" A="255"/>
<SolidColorBrush x:Key="Icarus_Purple" Color="{StaticResource Icarus_Purple_Color}" />
<!--
<Color x:Key="Effector_Purple_Color" R="167" G="76" B="119" A="255"/>
<SolidColorBrush x:Key="Effector_Purple" Color="{StaticResource Effector_Purple_Color}" />-->
<!--Colori per EgtWPFLib5-->
<SolidColorBrush x:Key="TextBox.Static.Border" Color="#FFABAdB3"/>
<!--Colori default dei controlli-->
<SolidColorBrush x:Key="Button.Static.Background" Color="#FFDDDDDD"/>
<SolidColorBrush x:Key="Button.Static.Border" Color="#FF707070"/>
<SolidColorBrush x:Key="Button.MouseOver.Background" Color="#FFBEE6FD"/>
<SolidColorBrush x:Key="Button.MouseOver.Border" Color="#FF3C7FB1"/>
<SolidColorBrush x:Key="Button.Pressed.Background" Color="#FFC4E5F6"/>
<SolidColorBrush x:Key="Button.Pressed.Border" Color="#FF2C628B"/>
<SolidColorBrush x:Key="Button.Disabled.Background" Color="#FFF4F4F4"/>
<SolidColorBrush x:Key="Button.Disabled.Border" Color="#FFADB2B5"/>
<SolidColorBrush x:Key="Button.Disabled.Foreground" Color="#FF838383"/>
<Style x:Key="FocusVisual">
<Setter Property="Control.Template">
<Setter.Value>
<ControlTemplate>
<Rectangle Margin="2" StrokeDashArray="1 2" Stroke="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" SnapsToDevicePixels="true" StrokeThickness="1"/>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<!--Risorsa che toglie le animazioni dai menù popup per evitare che i menù mru di scelta dei file rimangano aperti se il file è grosso -->
<!--o viene eseguito un lua che non aggiorna l'interfaccia-->
@@ -65,6 +110,174 @@
<Thickness x:Key="WindowBorder_Thickness">2</Thickness>
<sys:Double x:Key="WindowBorder_Height">2</sys:Double>
<!--Button-->
<Style TargetType="{x:Type Button}">
<Setter Property="FocusVisualStyle" Value="{StaticResource FocusVisual}"/>
<Setter Property="Background" Value="{StaticResource Button.Static.Background}"/>
<Setter Property="BorderBrush" Value="{StaticResource Button.Static.Border}"/>
<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
<Setter Property="BorderThickness" Value="1"/>
<Setter Property="HorizontalContentAlignment" Value="Center"/>
<Setter Property="VerticalContentAlignment" Value="Center"/>
<Setter Property="Padding" Value="1"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type Button}">
<Border x:Name="border" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" SnapsToDevicePixels="true">
<ContentPresenter x:Name="contentPresenter" Focusable="False" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsDefaulted" Value="true">
<Setter Property="BorderBrush" TargetName="border" Value="{DynamicResource {x:Static SystemColors.HighlightBrushKey}}"/>
</Trigger>
<Trigger Property="IsMouseOver" Value="true">
<Setter Property="Background" TargetName="border" Value="{StaticResource Button.MouseOver.Background}"/>
<Setter Property="BorderBrush" TargetName="border" Value="{StaticResource Button.MouseOver.Border}"/>
</Trigger>
<Trigger Property="IsPressed" Value="true">
<Setter Property="Background" TargetName="border" Value="{StaticResource Button.Pressed.Background}"/>
<Setter Property="BorderBrush" TargetName="border" Value="{StaticResource Button.Pressed.Border}"/>
</Trigger>
<Trigger Property="IsEnabled" Value="false">
<Setter Property="Background" TargetName="border" Value="{StaticResource Button.Disabled.Background}"/>
<Setter Property="BorderBrush" TargetName="border" Value="{StaticResource Button.Disabled.Border}"/>
<Setter Property="TextElement.Foreground" TargetName="contentPresenter" Value="{StaticResource Button.Disabled.Foreground}"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="DoorList_Button" TargetType="{x:Type Button}" BasedOn="{StaticResource {x:Type Button}}">
<Setter Property="Height" Value="40"/>
<Setter Property="Background" Value="Transparent"/>
<Setter Property="BorderThickness" Value="0"/>
<Setter Property="Padding" Value="2"/>
</Style>
<!--ToggleButton-->
<Style TargetType="{x:Type ToggleButton}">
<Setter Property="FocusVisualStyle" Value="{StaticResource FocusVisual}"/>
<Setter Property="Background" Value="{StaticResource Effector_Blue}"/>
<Setter Property="BorderBrush" Value="{StaticResource Button.Static.Border}"/>
<Setter Property="Foreground" Value="White"/>
<Setter Property="BorderThickness" Value="0"/>
<Setter Property="HorizontalContentAlignment" Value="Center"/>
<Setter Property="VerticalContentAlignment" Value="Center"/>
<Setter Property="Padding" Value="1"/>
<Setter Property="FontFamily" Value="/Resources/Fonts/#Roboto"/>
<Setter Property="FontWeight" Value="Medium"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type ToggleButton}">
<Border x:Name="border" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" SnapsToDevicePixels="true">
<ContentPresenter x:Name="contentPresenter" Focusable="False" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="Button.IsDefaulted" Value="true">
<Setter Property="BorderBrush" TargetName="border" Value="{DynamicResource {x:Static SystemColors.HighlightBrushKey}}"/>
</Trigger>
<Trigger Property="IsMouseOver" Value="true">
<Setter Property="Background" TargetName="border" Value="{StaticResource Button.MouseOver.Background}"/>
<Setter Property="BorderBrush" TargetName="border" Value="{StaticResource Button.MouseOver.Border}"/>
</Trigger>
<Trigger Property="IsPressed" Value="true">
<Setter Property="Background" TargetName="border" Value="{StaticResource Button.Pressed.Background}"/>
<Setter Property="BorderBrush" TargetName="border" Value="{StaticResource Button.Pressed.Border}"/>
</Trigger>
<Trigger Property="IsChecked" Value="true">
<Setter Property="Background" TargetName="border" Value="{StaticResource Effector_DarkBlue}"/>
<Setter Property="TextElement.Foreground" TargetName="contentPresenter" Value="White"/>
</Trigger>
<Trigger Property="IsEnabled" Value="false">
<Setter Property="Background" TargetName="border" Value="{StaticResource Button.Disabled.Background}"/>
<Setter Property="BorderBrush" TargetName="border" Value="{StaticResource Button.Disabled.Border}"/>
<Setter Property="TextElement.Foreground" TargetName="contentPresenter" Value="{StaticResource Button.Disabled.Foreground}"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="MainMenu_ToggleButton" TargetType="{x:Type ToggleButton}" BasedOn="{StaticResource {x:Type ToggleButton}}">
<Setter Property="Padding" Value="25,0,25,0"/>
</Style>
<!--Border-->
<Style x:Key="Parameter_MachinePage_Border" TargetType="{x:Type GroupBox}">
<Setter Property="BorderThickness" Value="1"/>
<Setter Property="BorderBrush" Value="DarkGray"/>
<Setter Property="HorizontalAlignment" Value="Center"/>
</Style>
<!-- Custom SelectedItem colors for DataGrid -->
<Style x:Key="RowDataGrid_CustomHighLight" TargetType="{x:Type DataGridRow}">
<Setter Property="BorderBrush" Value="LightGray" />
<Style.Triggers>
<Trigger Property="IsSelected" Value="True">
<Setter Property="BorderThickness" Value="2,2,2,2" />
<!--<Setter Property="BorderBrush" Value="Cyan" />-->
<Setter Property="Padding" Value="0,0,0,0" />
<Setter Property="Margin" Value="-2,0,-2,0" />
<Setter Property="Foreground" Value="Blue" />
</Trigger>
</Style.Triggers>
<Style.Resources>
<SolidColorBrush x:Key="{x:Static SystemColors.HighlightBrushKey}" Color="Transparent" />
<SolidColorBrush x:Key="{x:Static SystemColors.HighlightTextBrushKey}" Color="Black" />
<SolidColorBrush x:Key="{x:Static SystemColors.InactiveSelectionHighlightBrushKey}" Color="Transparent" />
<SolidColorBrush x:Key="{x:Static SystemColors.InactiveSelectionHighlightTextBrushKey}" Color="Black" />
</Style.Resources>
</Style>
<!--Styles for DataGrid columns-->
<Style x:Key="DataGridTextColumn_TextBlock" TargetType="{x:Type TextBlock}">
<Setter Property="TextAlignment" Value="Center"/>
<Setter Property="VerticalAlignment" Value="Center"/>
</Style>
<Style x:Key="DataGridTextColumn_TextBox" TargetType="{x:Type TextBox}">
<Setter Property="TextAlignment" Value="Center"/>
<Setter Property="VerticalContentAlignment" Value="Center"/>
</Style>
<Style x:Key="DataGridTemplateColumn_ComboBox" TargetType="{x:Type ComboBox}">
<Setter Property="HorizontalContentAlignment" Value="Center"/>
<Setter Property="VerticalContentAlignment" Value="Center"/>
</Style>
<!--Style for page tabcontrol-->
<ControlTemplate x:Key="NoHeader_TabControl_ControlTemplate" TargetType="{x:Type TabControl}">
<Grid x:Name="templateRoot" ClipToBounds="true" SnapsToDevicePixels="true" KeyboardNavigation.TabNavigation="Local">
<Border x:Name="contentPanel" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" KeyboardNavigation.DirectionalNavigation="Contained" KeyboardNavigation.TabIndex="1" KeyboardNavigation.TabNavigation="Local">
<ContentPresenter x:Name="PART_SelectedContentHost" ContentSource="SelectedContent" Margin="{TemplateBinding Padding}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
</Border>
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="IsEnabled" Value="false">
<Setter Property="TextElement.Foreground" TargetName="templateRoot" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
<Style x:Key="NoHeader_TabControl" TargetType="{x:Type TabControl}">
<Setter Property="BorderThickness" Value="0"/>
<Setter Property="Padding" Value="0"/>
<Setter Property="Template" Value="{StaticResource NoHeader_TabControl_ControlTemplate}"/>
</Style>
<!-- Image -->
<Style x:Key="Button_Image" TargetType="{x:Type Image}">
<Setter Property="Stretch" Value="Uniform" />
</Style>
<!--Stili per disegno macchina con porte-->
<Style x:Key="Table" TargetType="Border">
@@ -98,13 +311,5 @@
<Setter Property="Focusable" Value="False"/>
<Setter Property="BorderThickness" Value="0"/>
</Style>
<!--Border-->
<Style x:Key="Parameter_MachinePage_Border" TargetType="{x:Type GroupBox}">
<Setter Property="BorderThickness" Value="1"/>
<Setter Property="BorderBrush" Value="DarkGray"/>
<Setter Property="HorizontalAlignment" Value="Center"/>
</Style>
</ResourceDictionary>
@@ -12,77 +12,125 @@ Public Class Dictionary
#Region "Colors"
'Private m_Omag_Red As SolidColorBrush = Brushes.Red
'Public ReadOnly Property Omag_Red As SolidColorBrush
Private Shared m_Effector_LightBlue As SolidColorBrush = Application.Current.FindResource("Effector_LightBlue")
Public Shared ReadOnly Property Effector_LightBlue As SolidColorBrush
Get
Return m_Effector_LightBlue
End Get
End Property
Private Shared m_Effector_Blue As SolidColorBrush = Application.Current.FindResource("Effector_Blue")
Public Shared ReadOnly Property Effector_Blue As SolidColorBrush
Get
Return m_Effector_Blue
End Get
End Property
Private Shared m_Effector_DarkBlue As SolidColorBrush = Application.Current.FindResource("Effector_DarkBlue")
Public Shared ReadOnly Property Effector_DarkBlue As SolidColorBrush
Get
Return m_Effector_DarkBlue
End Get
End Property
Private Shared m_Effector_LightBlue_Status As SolidColorBrush = Application.Current.FindResource("Effector_LightBlue_Status")
Public Shared ReadOnly Property Effector_LightBlue_Status As SolidColorBrush
Get
Return m_Effector_LightBlue_Status
End Get
End Property
Private Shared m_Effector_Blue_Status As SolidColorBrush = Application.Current.FindResource("Effector_Blue_Status")
Public Shared ReadOnly Property Effector_Blue_Status As SolidColorBrush
Get
Return m_Effector_Blue_Status
End Get
End Property
Private Shared m_Effector_Red_Status As SolidColorBrush = Application.Current.FindResource("Effector_Red_Status")
Public Shared ReadOnly Property Effector_Red_Status As SolidColorBrush
Get
Return m_Effector_Red_Status
End Get
End Property
Private Shared m_Effector_Green_Status As SolidColorBrush = Application.Current.FindResource("Effector_Green_Status")
Public Shared ReadOnly Property Effector_Green_Status As SolidColorBrush
Get
Return m_Effector_Green_Status
End Get
End Property
Private Shared m_Effector_Gray_Status As SolidColorBrush = Application.Current.FindResource("Effector_Gray_Status")
Public Shared ReadOnly Property Effector_Gray_Status As SolidColorBrush
Get
Return m_Effector_Gray_Status
End Get
End Property
Private Shared m_Effector_Yellow_Status As SolidColorBrush = Application.Current.FindResource("Effector_Yellow_Status")
Public Shared ReadOnly Property Effector_Yellow_Status As SolidColorBrush
Get
Return m_Effector_Yellow_Status
End Get
End Property
Private Shared m_Effector_LightBlue_SelStatus As SolidColorBrush = Application.Current.FindResource("Effector_LightBlue_SelStatus")
Public Shared ReadOnly Property Effector_LightBlue_SelStatus As SolidColorBrush
Get
Return m_Effector_LightBlue_SelStatus
End Get
End Property
Private Shared m_Effector_Blue_SelStatus As SolidColorBrush = Application.Current.FindResource("Effector_Blue_SelStatus")
Public Shared ReadOnly Property Effector_Blue_SelStatus As SolidColorBrush
Get
Return m_Effector_Blue_SelStatus
End Get
End Property
Private Shared m_Effector_Red_SelStatus As SolidColorBrush = Application.Current.FindResource("Effector_Red_SelStatus")
Public Shared ReadOnly Property Effector_Red_SelStatus As SolidColorBrush
Get
Return m_Effector_Red_SelStatus
End Get
End Property
Private Shared m_Effector_Green_SelStatus As SolidColorBrush = Application.Current.FindResource("Effector_Green_SelStatus")
Public Shared ReadOnly Property Effector_Green_SelStatus As SolidColorBrush
Get
Return m_Effector_Green_SelStatus
End Get
End Property
Private Shared m_Effector_Gray_SelStatus As SolidColorBrush = Application.Current.FindResource("Effector_Gray_SelStatus")
Public Shared ReadOnly Property Effector_Gray_SelStatus As SolidColorBrush
Get
Return m_Effector_Gray_SelStatus
End Get
End Property
Private Shared m_Effector_Yellow_SelStatus As SolidColorBrush = Application.Current.FindResource("Effector_Yellow_SelStatus")
Public Shared ReadOnly Property Effector_Yellow_SelStatus As SolidColorBrush
Get
Return m_Effector_Yellow_SelStatus
End Get
End Property
Private Shared m_Effector_White_SelStatus As SolidColorBrush = Application.Current.FindResource("Effector_White_SelStatus")
Public Shared ReadOnly Property Effector_White_SelStatus As SolidColorBrush
Get
Return m_Effector_White_SelStatus
End Get
End Property
'Private Shared m_Effector_Orange As SolidColorBrush = Application.Current.FindResource("Effector_Orange")
'Public Shared ReadOnly Property Effector_Orange As SolidColorBrush
' Get
' Return m_Omag_Red
' Return m_Effector_Orange
' End Get
'End Property
'Private Shared m_Button_Static_Background As SolidColorBrush = New BrushConverter().ConvertFrom("#FFDDDDDD")
'Public Shared ReadOnly Property Button_Static_Background As SolidColorBrush
' Get
' Return m_Button_Static_Background
' End Get
'End Property
'Private Shared m_TabControl_Header_Background As LinearGradientBrush = Application.Current.FindResource("TabItem.Static.Background")
'Public Shared ReadOnly Property TabControl_Header_Background As LinearGradientBrush
' Get
' Return m_TabControl_Header_Background
' End Get
'End Property
'Private Shared m_Icarus_Gray As SolidColorBrush = Application.Current.FindResource("Icarus_Gray")
'Public Shared ReadOnly Property Icarus_Gray As SolidColorBrush
' Get
' Return m_Icarus_Gray
' End Get
'End Property
'Private Shared m_Icarus_LightBlue As SolidColorBrush = Application.Current.FindResource("Icarus_LightBlue")
'Public Shared ReadOnly Property Icarus_LightBlue As SolidColorBrush
' Get
' Return m_Icarus_LightBlue
' End Get
'End Property
'Private Shared m_Icarus_Blue As SolidColorBrush = Application.Current.FindResource("Icarus_Blue")
'Public Shared ReadOnly Property Icarus_Blue As SolidColorBrush
' Get
' Return m_Icarus_Blue
' End Get
'End Property
'Private Shared m_Icarus_Green As SolidColorBrush = Application.Current.FindResource("Icarus_Green")
'Public Shared ReadOnly Property Icarus_Green As SolidColorBrush
' Get
' Return m_Icarus_Green
' End Get
'End Property
'Private Shared m_Icarus_Orange As SolidColorBrush = Application.Current.FindResource("Icarus_Orange")
'Public Shared ReadOnly Property Icarus_Orange As SolidColorBrush
' Get
' Return m_Icarus_Orange
' End Get
'End Property
'Private Shared m_Icarus_Purple As SolidColorBrush = Application.Current.FindResource("Icarus_Purple")
'Public Shared ReadOnly Property Icarus_Purple As SolidColorBrush
' Get
' Return m_Icarus_Purple
' End Get
'End Property
'<SolidColorBrush x : Key="Icarus_Gray" Color="#92908d" />
'<SolidColorBrush x : Key="Icarus_LightBlue" Color="#3c89c9" />
'<SolidColorBrush x : Key="Icarus_Blue" Color="#2e5a81" />
'<SolidColorBrush x : Key="Icarus_Green" Color="#40826d" />
'<SolidColorBrush x : Key="Icarus_Orange" Color="#C37636" />
'<SolidColorBrush x : Key="Icarus_Purple" Color="#990066" />
#End Region ' Colors
End Class
@@ -3,6 +3,7 @@ Imports System.Threading
Imports MS.Internal
Imports Effector.Plugin.FiveLakes.ThreadData
Imports System.Windows.Threading
Imports Effector.Plugin.Lib
Public Class ExecProcessManager