Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 48699ea740 | |||
| 0352b53972 | |||
| 3d4609aea4 |
@@ -22,8 +22,10 @@ Module ConstIni
|
||||
Public Const K_DDFDIR As String = "DDFDir"
|
||||
Public Const K_DDTDIR As String = "DDTDir"
|
||||
Public Const K_GENDDFDIR As String = "GenDDFDir"
|
||||
Public Const K_CSVOUTPUT As String = "CSVOutput"
|
||||
|
||||
Public Const K_CSV As String = "CSV"
|
||||
Public Const K_ISCSVOUTPUTENABLED As String = "IsCSVOutputEnabled"
|
||||
Public Const K_CSVOUTPUTPATH As String = "CSVOutputPath"
|
||||
Public Const K_LASTCSVDIR As String = "LastCsvDir"
|
||||
|
||||
Public Const S_CSV As String = "CSV"
|
||||
Public Const K_DDFNAME As String = "DDFName"
|
||||
@@ -45,6 +47,8 @@ Module ConstIni
|
||||
Public Const K_VARIABLEONDRAW As String = "VariableOnDraw"
|
||||
Public Const K_MACHINECOMMANDS As String = "MachineCommands"
|
||||
Public Const K_DOORCIRCLIST As String = "DoorCircList"
|
||||
Public Const K_DOORPRESENCE As String = "DoorPresence"
|
||||
Public Const K_DOORINDEX As String = "DoorIndex"
|
||||
|
||||
Public Const S_NC As String = "NC"
|
||||
Public Const K_NC_SIMULATE As String = "NcSimulate"
|
||||
|
||||
@@ -1,80 +1,131 @@
|
||||
<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.DoorArreda">
|
||||
<Grid.Resources>
|
||||
<local:StateToSelColorConverter x:Key="StateToSelColorConverter"/>
|
||||
<local:DDTListToBooleanConverter x:Key="DDTListToBooleanConverter"/>
|
||||
</Grid.Resources>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="3"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
</Grid.RowDefinitions>
|
||||
<StackPanel Orientation="Horizontal"
|
||||
IsEnabled="{Binding bExecButton_IsEnabled}">
|
||||
<Button Content="CSV"
|
||||
ToolTip="Apri file CSV"
|
||||
Command="{Binding OpenCSV_Command}"
|
||||
IsEnabled="{Binding bExecButton_IsEnabled}"
|
||||
Style="{StaticResource DoorList_Button}"/>
|
||||
<Button Content="Salta Porta"
|
||||
ToolTip="Blocca Porta selezionata, che non verrà mandata in produzione"
|
||||
Command="{Binding SkipDoor_Command}"
|
||||
Style="{StaticResource DoorList_Button}"/>
|
||||
<Button Content="Porta da non produrre"
|
||||
ToolTip="Segna la Porta selezionatacome da non produrre"
|
||||
Command="{Binding NotProduceDoor_Command}"
|
||||
Style="{StaticResource DoorList_Button}"/>
|
||||
<Button Content="↑"
|
||||
ToolTip="Sposta su"
|
||||
Command="{Binding MoveUp_Command}"
|
||||
Style="{StaticResource DoorList_Button}"/>
|
||||
<Button Content="↓"
|
||||
ToolTip="Sposta giù"
|
||||
Command="{Binding MoveDown_Command}"
|
||||
Style="{StaticResource DoorList_Button}"/>
|
||||
<Button Content="Cancella porta"
|
||||
ToolTip="Cancella porta selezionata (se non appartenente ad un csv)"
|
||||
Command="{Binding Delete_Command}"
|
||||
Style="{StaticResource DoorList_Button}"/>
|
||||
<Button Content="Cancella csv"
|
||||
ToolTip="Cancella tutte le porte del csv della porta selezionata"
|
||||
Command="{Binding DeleteAll_Command}"
|
||||
Style="{StaticResource DoorList_Button}"/>
|
||||
<Button Content="Produci"
|
||||
ToolTip="Mette in coda di produzione la porta selezionata"
|
||||
Command="{Binding Produce_Command}"
|
||||
Style="{StaticResource DoorList_Button}"/>
|
||||
<Button Content="Produci Tutte"
|
||||
ToolTip="Mette in coda di produzione tutte le porte"
|
||||
Command="{Binding ProduceAll_Command}"
|
||||
Style="{StaticResource DoorList_Button}"/>
|
||||
<Button Content="Reset Coda di Produzione"
|
||||
ToolTip="Riporta tutte le porte pronte per essere lavorate allo stato Verificate state"
|
||||
Command="{Binding ResetProductionQueue_Command}"
|
||||
Style="{StaticResource DoorList_Button}"/>
|
||||
<Button Content="Verifica"
|
||||
ToolTip="Verifica tutte le porte in stato Non Verificata"
|
||||
Command="{Binding Verify_Command}"
|
||||
IsEnabled="{Binding bExecButton_IsEnabled}"
|
||||
Style="{StaticResource DoorList_Button}"/>
|
||||
<Button Content="Aggiungi"
|
||||
ToolTip="Aggiunge una porta alla lista"
|
||||
Command="{Binding AddDoor_Command}"
|
||||
Style="{StaticResource DoorList_Button}"/>
|
||||
<Button Content="Copia"
|
||||
ToolTip="Copia la porta selezionata"
|
||||
Command="{Binding CopyDoor_Command}"
|
||||
Style="{StaticResource DoorList_Button}"/>
|
||||
<Button Content="Copia Multipla"
|
||||
ToolTip="Copia Multipla della porta selezionata"
|
||||
Command="{Binding MultipleCopyDoor_Command}"
|
||||
Style="{StaticResource DoorList_Button}"/>
|
||||
<Button Content="Salva CSV"
|
||||
ToolTip="Salva un csv di produzione"
|
||||
Command="{Binding SaveCSV_Command}"
|
||||
Style="{StaticResource DoorList_Button}"/>
|
||||
</StackPanel>
|
||||
<DataGrid Grid.Row="1"
|
||||
<Border BorderThickness="0"
|
||||
Padding="3"
|
||||
BorderBrush="Transparent"
|
||||
Background="{StaticResource Effector_DarkBlue}">
|
||||
<StackPanel Orientation="Horizontal"
|
||||
IsEnabled="{Binding bExecButton_IsEnabled}">
|
||||
<Button ToolTip="Apri file CSV"
|
||||
Command="{Binding OpenCSV_Command}"
|
||||
IsEnabled="{Binding bExecButton_IsEnabled}"
|
||||
Style="{StaticResource Button.DoorList}">
|
||||
<Image Source="../Resources/DoorListPage/OpenCsv.png"
|
||||
Style="{StaticResource Button.Image.DoorList}"/>
|
||||
</Button>
|
||||
<Button ToolTip="Cancella tutte le porte del csv della porta selezionata"
|
||||
Command="{Binding DeleteCSV_Command}"
|
||||
IsEnabled="{Binding bExecButton_IsEnabled}"
|
||||
Style="{StaticResource Button.DoorList}">
|
||||
<Image Source="../Resources/DoorListPage/DeleteCsv.png"
|
||||
Style="{StaticResource Button.Image.DoorList}"/>
|
||||
</Button>
|
||||
<Button ToolTip="Cancella tutte le porte presenti in lista"
|
||||
Command="{Binding DeleteAll_Command}"
|
||||
IsEnabled="{Binding bExecButton_IsEnabled}"
|
||||
Style="{StaticResource Button.DoorList}">
|
||||
<Image Source="../Resources/DoorListPage/DeleteAll.png"
|
||||
Style="{StaticResource Button.Image.DoorList}"/>
|
||||
</Button>
|
||||
<Button ToolTip="Mette in coda di produzione la porta selezionata"
|
||||
Command="{Binding Produce_Command}"
|
||||
Style="{StaticResource Button.DoorList}">
|
||||
<Image Source="../Resources/DoorListPage/Produce.png"
|
||||
Style="{StaticResource Button.Image.DoorList}"/>
|
||||
</Button>
|
||||
<Button ToolTip="Mette in coda di produzione tutte le porte"
|
||||
Command="{Binding ProduceAll_Command}"
|
||||
IsEnabled="{Binding bExecButton_IsEnabled}"
|
||||
Style="{StaticResource Button.DoorList}">
|
||||
<Image Source="../Resources/DoorListPage/ProduceAll.png"
|
||||
Style="{StaticResource Button.Image.DoorList}"/>
|
||||
</Button>
|
||||
<Button ToolTip="Riporta tutte le porte pronte per essere lavorate allo stato Verificate state"
|
||||
Command="{Binding ResetProductionQueue_Command}"
|
||||
Style="{StaticResource Button.DoorList}">
|
||||
<Image Source="../Resources/DoorListPage/ResetProduction.png"
|
||||
Style="{StaticResource Button.Image.DoorList}"/>
|
||||
</Button>
|
||||
<Button ToolTip="Sposta su"
|
||||
Command="{Binding MoveUp_Command}"
|
||||
Style="{StaticResource Button.DoorList}">
|
||||
<Image Source="../Resources/DoorListPage/MoveUp.png"
|
||||
Style="{StaticResource Button.Image.DoorList}"/>
|
||||
</Button>
|
||||
<Button ToolTip="Sposta giù"
|
||||
Command="{Binding MoveDown_Command}"
|
||||
Style="{StaticResource Button.DoorList}">
|
||||
<Image Source="../Resources/DoorListPage/MoveDown.png"
|
||||
Style="{StaticResource Button.Image.DoorList}"/>
|
||||
</Button>
|
||||
<Button ToolTip="Mark the selected door as not to be produced"
|
||||
Command="{Binding NotProduceDoor_Command}"
|
||||
IsEnabled="{Binding bExecButton_IsEnabled}"
|
||||
Style="{StaticResource Button.DoorList}">
|
||||
<Image Source="../Resources/DoorListPage/NotProduce.png"
|
||||
Style="{StaticResource Button.Image.DoorList}"/>
|
||||
</Button>
|
||||
<Button ToolTip="Aggiunge una porta alla lista"
|
||||
Command="{Binding AddDoor_Command}"
|
||||
IsEnabled="{Binding bExecButton_IsEnabled}"
|
||||
Style="{StaticResource Button.DoorList}">
|
||||
<Image Source="../Resources/DoorListPage/Add.png"
|
||||
Style="{StaticResource Button.Image.DoorList}"/>
|
||||
</Button>
|
||||
<Button ToolTip="Copia la porta selezionata"
|
||||
Command="{Binding CopyDoor_Command}"
|
||||
IsEnabled="{Binding bExecButton_IsEnabled}"
|
||||
Style="{StaticResource Button.DoorList}">
|
||||
<Image Source="../Resources/DoorListPage/Copy.png"
|
||||
Style="{StaticResource Button.Image.DoorList}"/>
|
||||
</Button>
|
||||
<Button ToolTip="Copia Multipla della porta selezionata"
|
||||
Command="{Binding MultipleCopyDoor_Command}"
|
||||
IsEnabled="{Binding bExecButton_IsEnabled}"
|
||||
Style="{StaticResource Button.DoorList}">
|
||||
<Image Source="../Resources/DoorListPage/MultipleCopy.png"
|
||||
Style="{StaticResource Button.Image.DoorList}"/>
|
||||
</Button>
|
||||
<Button ToolTip="Cancella porta selezionata (se non appartenente ad un csv)"
|
||||
Command="{Binding Delete_Command}"
|
||||
IsEnabled="{Binding bExecButton_IsEnabled}"
|
||||
Style="{StaticResource Button.DoorList}">
|
||||
<Image Source="../Resources/DoorListPage/Delete.png"
|
||||
Style="{StaticResource Button.Image.DoorList}"/>
|
||||
</Button>
|
||||
<Button ToolTip="Verifica tutte le porte in stato Non Verificata"
|
||||
Command="{Binding Verify_Command}"
|
||||
IsEnabled="{Binding bExecButton_IsEnabled}"
|
||||
Style="{StaticResource Button.DoorList}">
|
||||
<Image Source="../Resources/DoorListPage/Verify.png"
|
||||
Style="{StaticResource Button.Image.DoorList}"/>
|
||||
</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>
|
||||
<FrameworkElement x:Name="dummyElement" Visibility="Collapsed"/>
|
||||
<DataGrid Grid.Row="2"
|
||||
ItemsSource="{Binding DoorList}"
|
||||
SelectedItem="{Binding SelDoor}"
|
||||
AutoGenerateColumns="False"
|
||||
@@ -93,7 +144,32 @@
|
||||
FontSize="12"
|
||||
FontFamily="/Resources/Fonts/#Roboto"
|
||||
FontWeight="Regular"
|
||||
RowHeight="32">
|
||||
RowHeight="32"
|
||||
BorderThickness="0">
|
||||
<DataGrid.Resources>
|
||||
<DataTemplate x:Key="DDTTemplate">
|
||||
<ComboBox IsEditable="True"
|
||||
Text="{Binding DataContext.sDDFName, RelativeSource={RelativeSource AncestorType={x:Type ContentControl}}, UpdateSourceTrigger=LostFocus}"
|
||||
ItemsSource="{Binding DataContext.DDTList, RelativeSource={RelativeSource AncestorType={x:Type local:DoorListPageV}}}"
|
||||
Style="{StaticResource ComboBox.DataGridTemplateColumn.DoorList}"/>
|
||||
</DataTemplate>
|
||||
<DataTemplate x:Key="NoDDTTemplate">
|
||||
<TextBox Text="{Binding DataContext.sDDFName, RelativeSource={RelativeSource AncestorType={x:Type ContentControl}}}"
|
||||
Style="{StaticResource TextBox.DataGridTextColumn.DoorList}"/>
|
||||
</DataTemplate>
|
||||
<Style x:Key="DDTContentControl" TargetType="{x:Type ContentControl}">
|
||||
<Style.Triggers>
|
||||
<DataTrigger Binding="{Binding Path=DataContext.DDTList, Source={x:Reference dummyElement}, Converter={StaticResource DDTListToBooleanConverter}}"
|
||||
Value="True">
|
||||
<Setter Property="ContentTemplate" Value="{StaticResource NoDDTTemplate}" />
|
||||
</DataTrigger>
|
||||
<DataTrigger Binding="{Binding Path=DataContext.DDTList, Source={x:Reference dummyElement}, Converter={StaticResource DDTListToBooleanConverter}}"
|
||||
Value="False">
|
||||
<Setter Property="ContentTemplate" Value="{StaticResource DDTTemplate}" />
|
||||
</DataTrigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</DataGrid.Resources>
|
||||
<DataGrid.ColumnHeaderStyle>
|
||||
<Style TargetType="{x:Type DataGridColumnHeader}">
|
||||
<Setter Property="Background" Value="{StaticResource Effector_DarkBlue}"/>
|
||||
@@ -108,46 +184,47 @@
|
||||
Binding="{Binding nId}"
|
||||
Width="Auto"
|
||||
IsReadOnly="True"
|
||||
ElementStyle="{StaticResource DataGridTextColumn_TextBlock}"
|
||||
EditingElementStyle="{StaticResource DataGridTextColumn_TextBox}"/>
|
||||
ElementStyle="{StaticResource TextBlock.DataGridTextColumn.DoorList}"
|
||||
EditingElementStyle="{StaticResource TextBox.DataGridTextColumn.DoorList}"/>
|
||||
<DataGridTemplateColumn Header="DDF/DDT File Name"
|
||||
Width="Auto">
|
||||
Width="1*">
|
||||
<DataGridTemplateColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding sDDFName}"
|
||||
Style="{StaticResource DataGridTextColumn_TextBlock}"/>
|
||||
Style="{StaticResource TextBlock.DataGridTextColumn.DoorList}"/>
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
<DataGridTemplateColumn.CellEditingTemplate>
|
||||
<DataTemplate>
|
||||
<ComboBox IsEditable="True"
|
||||
<!--<ComboBox IsEditable="True"
|
||||
Text="{Binding sDDFName}"
|
||||
ItemsSource="{Binding DataContext.DDTList, RelativeSource={RelativeSource AncestorType={x:Type local:DoorListPageV}}}"
|
||||
Style="{StaticResource DataGridTemplateColumn_ComboBox}"/>
|
||||
Style="{StaticResource ComboBox.DataGridTemplateColumn.DoorList}"/>-->
|
||||
<ContentControl Style="{StaticResource DDTContentControl}"/>
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellEditingTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
<DataGridTextColumn Header="Larghezza"
|
||||
Binding="{Binding dWidth}"
|
||||
Width="Auto"
|
||||
ElementStyle="{StaticResource DataGridTextColumn_TextBlock}"
|
||||
EditingElementStyle="{StaticResource DataGridTextColumn_TextBox}"/>
|
||||
ElementStyle="{StaticResource TextBlock.DataGridTextColumn.DoorList}"
|
||||
EditingElementStyle="{StaticResource TextBox.DataGridTextColumn.DoorList}"/>
|
||||
<DataGridTextColumn Header="Altezza"
|
||||
Binding="{Binding dHeight}"
|
||||
Width="Auto"
|
||||
ElementStyle="{StaticResource DataGridTextColumn_TextBlock}"
|
||||
EditingElementStyle="{StaticResource DataGridTextColumn_TextBox}"/>
|
||||
ElementStyle="{StaticResource TextBlock.DataGridTextColumn.DoorList}"
|
||||
EditingElementStyle="{StaticResource TextBox.DataGridTextColumn.DoorList}"/>
|
||||
<DataGridTextColumn Header="Spessore"
|
||||
Binding="{Binding dThickness}"
|
||||
Width="Auto"
|
||||
ElementStyle="{StaticResource DataGridTextColumn_TextBlock}"
|
||||
EditingElementStyle="{StaticResource DataGridTextColumn_TextBox}"/>
|
||||
ElementStyle="{StaticResource TextBlock.DataGridTextColumn.DoorList}"
|
||||
EditingElementStyle="{StaticResource TextBox.DataGridTextColumn.DoorList}"/>
|
||||
<DataGridTemplateColumn Header="Apertura"
|
||||
Width="Auto">
|
||||
<DataGridTemplateColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding SelSwing.Name}"
|
||||
Style="{StaticResource DataGridTextColumn_TextBlock}"/>
|
||||
Style="{StaticResource TextBlock.DataGridTextColumn.DoorList}"/>
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
<DataGridTemplateColumn.CellEditingTemplate>
|
||||
@@ -155,7 +232,7 @@
|
||||
<ComboBox ItemsSource="{Binding SwingList}"
|
||||
SelectedItem="{Binding SelSwing}"
|
||||
SelectedValuePath="Name"
|
||||
Style="{StaticResource DataGridTemplateColumn_ComboBox}"/>
|
||||
Style="{StaticResource ComboBox.DataGridTemplateColumn.DoorList}"/>
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellEditingTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
@@ -163,50 +240,50 @@
|
||||
Binding="{Binding nState}"
|
||||
Width="Auto"
|
||||
IsReadOnly="True"
|
||||
ElementStyle="{StaticResource DataGridTextColumn_TextBlock}"
|
||||
EditingElementStyle="{StaticResource DataGridTextColumn_TextBox}"/>
|
||||
ElementStyle="{StaticResource TextBlock.DataGridTextColumn.DoorList}"
|
||||
EditingElementStyle="{StaticResource TextBox.DataGridTextColumn.DoorList}"/>
|
||||
<DataGridTextColumn Header="CSV"
|
||||
Binding="{Binding sCSVName}"
|
||||
Width="Auto"
|
||||
IsReadOnly="True"
|
||||
ElementStyle="{StaticResource DataGridTextColumn_TextBlock}"
|
||||
EditingElementStyle="{StaticResource DataGridTextColumn_TextBox}"/>
|
||||
ElementStyle="{StaticResource TextBlock.DataGridTextColumn.DoorList}"
|
||||
EditingElementStyle="{StaticResource TextBox.DataGridTextColumn.DoorList}"/>
|
||||
<DataGridTextColumn Header="Linea del CSV"
|
||||
Binding="{Binding nCSVLine}"
|
||||
Width="Auto"
|
||||
IsReadOnly="True"
|
||||
ElementStyle="{StaticResource DataGridTextColumn_TextBlock}"
|
||||
EditingElementStyle="{StaticResource DataGridTextColumn_TextBox}"/>
|
||||
ElementStyle="{StaticResource TextBlock.DataGridTextColumn.DoorList}"
|
||||
EditingElementStyle="{StaticResource TextBox.DataGridTextColumn.DoorList}"/>
|
||||
<DataGridTextColumn Header="Stato di produzione"
|
||||
Binding="{Binding nProdState}"
|
||||
Width="Auto"
|
||||
IsReadOnly="True"
|
||||
ElementStyle="{StaticResource DataGridTextColumn_TextBlock}"
|
||||
EditingElementStyle="{StaticResource DataGridTextColumn_TextBox}"/>
|
||||
ElementStyle="{StaticResource TextBlock.DataGridTextColumn.DoorList}"
|
||||
EditingElementStyle="{StaticResource TextBox.DataGridTextColumn.DoorList}"/>
|
||||
<DataGridTextColumn Header="Carico"
|
||||
Binding="{Binding sLoadTime}"
|
||||
Width="Auto"
|
||||
IsReadOnly="True"
|
||||
ElementStyle="{StaticResource DataGridTextColumn_TextBlock}"
|
||||
EditingElementStyle="{StaticResource DataGridTextColumn_TextBox}"/>
|
||||
ElementStyle="{StaticResource TextBlock.DataGridTextColumn.DoorList}"
|
||||
EditingElementStyle="{StaticResource TextBox.DataGridTextColumn.DoorList}"/>
|
||||
<DataGridTextColumn Header="Inizio lavorazione"
|
||||
Binding="{Binding sMachining1Start}"
|
||||
Width="Auto"
|
||||
IsReadOnly="True"
|
||||
ElementStyle="{StaticResource DataGridTextColumn_TextBlock}"
|
||||
EditingElementStyle="{StaticResource DataGridTextColumn_TextBox}"/>
|
||||
ElementStyle="{StaticResource TextBlock.DataGridTextColumn.DoorList}"
|
||||
EditingElementStyle="{StaticResource TextBox.DataGridTextColumn.DoorList}"/>
|
||||
<DataGridTextColumn Header="Fine lavorazione"
|
||||
Binding="{Binding sMachining1End}"
|
||||
Width="Auto"
|
||||
IsReadOnly="True"
|
||||
ElementStyle="{StaticResource DataGridTextColumn_TextBlock}"
|
||||
EditingElementStyle="{StaticResource DataGridTextColumn_TextBox}"/>
|
||||
ElementStyle="{StaticResource TextBlock.DataGridTextColumn.DoorList}"
|
||||
EditingElementStyle="{StaticResource TextBox.DataGridTextColumn.DoorList}"/>
|
||||
<!--<DataGridTextColumn Header="Scarico"
|
||||
Binding="{Binding sUnloadTime}"
|
||||
Width="Auto"
|
||||
IsReadOnly="True"
|
||||
ElementStyle="{StaticResource DataGridTextColumn_TextBlock}"
|
||||
EditingElementStyle="{StaticResource DataGridTextColumn_TextBox}"/>-->
|
||||
ElementStyle="{StaticResource TextBlock.DataGridTextColumn.DoorList}"
|
||||
EditingElementStyle="{StaticResource TextBox.DataGridTextColumn.DoorList}"/>-->
|
||||
</DataGrid.Columns>
|
||||
<!--<DataGrid.InputBindings>
|
||||
<KeyBinding Key="Delete" Command="{Binding Tag.SelectedMachGroup.DeleteMachGroup_Command,
|
||||
@@ -218,72 +295,5 @@
|
||||
<Setter Property="BorderBrush" Value="{Binding nState, Converter={StaticResource StateToSelColorConverter}}" />
|
||||
</Style>
|
||||
</DataGrid.RowStyle>
|
||||
<DataGrid.CellStyle>
|
||||
<Style TargetType="{x:Type DataGridCell}">
|
||||
<!--<Setter Property="VerticalAlignment" Value="Stretch"/>
|
||||
--><!--<Setter Property="VerticalContentAlignment" Value="Center"/>-->
|
||||
<!--<Setter Property="TextBlock.TextAlignment" Value="Center"/>
|
||||
<Setter Property="TextBox.VerticalAlignment" Value="Stretch"/>--><!--
|
||||
<Setter Property="TextBox.VerticalContentAlignment" Value="Center"/>-->
|
||||
<!--<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="{x:Type DataGridCell}">
|
||||
<Grid>
|
||||
<TextBox Text="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Content.Text}"
|
||||
VerticalAlignment="Stretch"
|
||||
HorizontalAlignment="Stretch"
|
||||
HorizontalContentAlignment="Center"
|
||||
BorderThickness="0"
|
||||
Background="{Binding RelativeSource={RelativeSource TemplatedParent},Path=Background}"
|
||||
VerticalContentAlignment="Center">
|
||||
<TextBox.Style>
|
||||
<Style TargetType="{x:Type TextBox}">
|
||||
</Style>
|
||||
</TextBox.Style>
|
||||
</TextBox>
|
||||
</Grid>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>-->
|
||||
<!--<Setter Property="TextBlock.TextAlignment" Value="Center"/>
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="{x:Type DataGridCell}">
|
||||
<Grid Background="{TemplateBinding Background}">
|
||||
<ContentPresenter>
|
||||
<ContentPresenter.Style>
|
||||
<Style TargetType="ContentPresenter">
|
||||
<Setter Property="TextBox.VerticalAlignment" Value="Stretch"/>
|
||||
<Setter Property="TextBox.VerticalContentAlignment" Value="Center"/>
|
||||
</Style>
|
||||
</ContentPresenter.Style>
|
||||
</ContentPresenter>
|
||||
</Grid>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>-->
|
||||
<!--<Setter Property="VerticalContentAlignment" Value="Center" />
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="{x:Type DataGridCell}">
|
||||
<Border VerticalAlignment="Stretch"
|
||||
HorizontalAlignment="Stretch">
|
||||
<ContentPresenter VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
|
||||
</Border>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>-->
|
||||
<!--<Style.Resources>
|
||||
<Style TargetType="ContentPresenter">
|
||||
<Setter Property="VerticalAlignment" Value="Stretch" />
|
||||
<Setter Property="TextBox.VerticalAlignment" Value="Center" />
|
||||
</Style>
|
||||
</Style.Resources>
|
||||
<Style.Triggers>
|
||||
<Trigger Property="IsSelected" Value="True">
|
||||
</Trigger>
|
||||
</Style.Triggers>-->
|
||||
</Style>
|
||||
</DataGrid.CellStyle>
|
||||
</DataGrid>
|
||||
</Grid>
|
||||
|
||||
@@ -7,12 +7,12 @@ Imports System.Security.Cryptography
|
||||
Imports Newtonsoft.Json.Linq
|
||||
Imports Effector.Plugin.DoorArreda.Door
|
||||
Imports System.Globalization
|
||||
Imports System.Diagnostics
|
||||
Imports Effector.Plugin.Lib
|
||||
|
||||
Public Class DoorListPageVM
|
||||
Inherits VMBase
|
||||
|
||||
Private m_ManualAddedDoorName As String = "ManualAddedDoor"
|
||||
|
||||
Private m_BackupTimer As New DispatcherTimer
|
||||
Private m_WriteCSVTimer As New DispatcherTimer
|
||||
Private m_RefreshGraphicsTimer As New DispatcherTimer
|
||||
@@ -41,6 +41,13 @@ Public Class DoorListPageVM
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_ManualAddedDoorName As String = "Manual"
|
||||
Public ReadOnly Property ManualAddedDoorName As String
|
||||
Get
|
||||
Return m_ManualAddedDoorName
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_bExecButton_IsEnabled As Boolean = True
|
||||
Public ReadOnly Property bExecButton_IsEnabled As Boolean
|
||||
Get
|
||||
@@ -57,6 +64,35 @@ Public Class DoorListPageVM
|
||||
|
||||
Private m_sCSVOutDirPath As String = ""
|
||||
|
||||
Private m_nExecIncrement As Integer = 0
|
||||
Private m_nExecutedArgsCount As Integer = 0
|
||||
Public ReadOnly Property dExecPercentage As Double
|
||||
Get
|
||||
If m_bCreatingDdfs Then
|
||||
Return 5 / m_nTotCreatingDdf * m_nCurrCreatingDdf
|
||||
End If
|
||||
If IsNothing(m_ExecProcessManager) Then Return 0
|
||||
Dim dExecIncrement As Double = If(m_ExecProcessManager.nArgsInQueue = 0, 0, Math.Min(28, m_nExecIncrement) / 34)
|
||||
Return (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
|
||||
Return If((Not IsNothing(m_ExecProcessManager) AndAlso m_ExecProcessManager.ExecutionThreadStatus = ExecProcessManager.ExecutionThreadStatuses.RUNNING) OrElse m_bCreatingDdfs, Visibility.Visible, Visibility.Collapsed)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_bCreatingDdfs As Boolean
|
||||
Private m_nTotCreatingDdf As Integer
|
||||
Private m_nCurrCreatingDdf As Integer
|
||||
|
||||
' Definizione comandi
|
||||
Private m_cmdOpenCSV As ICommand
|
||||
Private m_cmdSaveCSV As ICommand
|
||||
@@ -68,6 +104,7 @@ Public Class DoorListPageVM
|
||||
Private m_cmdMoveUp As ICommand
|
||||
Private m_cmdMoveDown As ICommand
|
||||
Private m_cmdDelete As ICommand
|
||||
Private m_cmdDeleteCSV As ICommand
|
||||
Private m_cmdDeleteAll As ICommand
|
||||
Private m_cmdProduce As ICommand
|
||||
Private m_cmdProduceAll As ICommand
|
||||
@@ -107,17 +144,20 @@ Public Class DoorListPageVM
|
||||
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
|
||||
If bStartWriteCSV Then
|
||||
m_WriteCSVTimer.Start()
|
||||
Dim bStartWriteCSV As Boolean = False
|
||||
If GetPluginPrivateProfileInt(S_GENERAL, K_ISCSVOUTPUTENABLED, 0) = 1 Then
|
||||
bStartWriteCSV = True
|
||||
If GetPluginPrivateProfileString(S_GENERAL, K_CSVOUTPUTPATH, "", 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
|
||||
If bStartWriteCSV Then
|
||||
m_WriteCSVTimer.Start()
|
||||
End If
|
||||
End If
|
||||
m_RefreshGraphicsTimer.Start()
|
||||
End Sub
|
||||
@@ -224,13 +264,68 @@ Public Class DoorListPageVM
|
||||
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 = Path.GetFileNameWithoutExtension(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")
|
||||
'If ArgumentsResult.nResult = 0 Then
|
||||
File.Delete(sGenDDFDirPath & "\" & sDoorFileName & ".log")
|
||||
'End If
|
||||
''File.Delete(sGenDDFDirPath & "\" & CurrRequestDoor.sDDFName & ".nge")
|
||||
File.Delete(sGenDDFDirPath & "\" & sDoorFileName & ".nge")
|
||||
'File.Delete(sGenDDFDirPath & "\" & sDoorFileName & ".sest")
|
||||
'File.Delete(sGenDDFDirPath & "\" & sDoorFileName & "_2.sest")
|
||||
'Dim SestFiles() As String = System.IO.Directory.GetFiles(sGenDDFDirPath & "\", sDoorFileName & "*.sest")
|
||||
'For Each FilePath In SestFiles
|
||||
' File.Delete(FilePath)
|
||||
'Next
|
||||
''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
|
||||
' verifico se ci sono altre porte dello stesso tipo da aggiornare
|
||||
If m_AssociationList.ContainsKey(CurrRequestDoor.nId) Then
|
||||
Dim SameDoorList As List(Of Integer) = m_AssociationList(CurrRequestDoor.nId)
|
||||
For Each CurrDoorId In SameDoorList
|
||||
Dim CurrDoor As Door = m_DoorList.FirstOrDefault(Function(x) x.nId = CurrDoorId)
|
||||
If Not IsNothing(CurrDoor) Then
|
||||
If CopyGenDdfFile(CurrRequestDoor, CurrDoor) Then
|
||||
CurrDoor.SetState(If(ArgumentsResult.nResult = 0, Door.DoorStates.VERIFIED, Door.DoorStates.VERIFICATION_FAILED))
|
||||
End If
|
||||
End If
|
||||
Next
|
||||
End If
|
||||
WriteBackup()
|
||||
ArgumentsResult = m_ExecProcessManager.ArgumentsResultDequeue
|
||||
End While
|
||||
' aggiorno grafica
|
||||
If m_nExecutedArgsCount <> m_ExecProcessManager.nExecutedArgsCounter Then
|
||||
m_nExecutedArgsCount = m_ExecProcessManager.nExecutedArgsCounter
|
||||
m_nExecIncrement = 0
|
||||
ElseIf m_ExecProcessManager.nCalculatingProcesses > 0 Then
|
||||
m_nExecIncrement += 1
|
||||
End If
|
||||
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
|
||||
NotifyPropertyChanged(NameOf(ExecPercentage_Visibility))
|
||||
End Sub
|
||||
|
||||
Friend Function GetNextDoor() As Door
|
||||
@@ -277,7 +372,7 @@ Public Class DoorListPageVM
|
||||
|
||||
Public Sub OpenCSV()
|
||||
Dim sDir As String = String.Empty
|
||||
'GetMainPrivateProfileString(S_GENERAL, K_LASTIMPDIR, "", sDir)
|
||||
GetPluginPrivateProfileString(S_GENERAL, K_LASTCSVDIR, "", sDir)
|
||||
Dim OpenFileDialog As New Microsoft.Win32.OpenFileDialog() With {
|
||||
.DefaultExt = ".csv",
|
||||
.Filter = "CSV (*.csv)|*.csv",
|
||||
@@ -285,6 +380,7 @@ Public Class DoorListPageVM
|
||||
.CheckFileExists = True,
|
||||
.ValidateNames = True}
|
||||
If OpenFileDialog.ShowDialog() Then
|
||||
WritePluginPrivateProfileString(S_GENERAL, K_LASTCSVDIR, Path.GetDirectoryName(OpenFileDialog.FileName))
|
||||
Dim sCSVPath As String = OpenFileDialog.FileName
|
||||
Using MyReader As New Microsoft.VisualBasic.FileIO.TextFieldParser(sCSVPath)
|
||||
MyReader.TextFieldType = FileIO.FieldType.Delimited
|
||||
@@ -360,6 +456,8 @@ Public Class DoorListPageVM
|
||||
Else
|
||||
nSwing = SWINGTYPE.RIGHT
|
||||
End If
|
||||
Else
|
||||
nSwing = SWINGTYPE.UNDEFINED
|
||||
End If
|
||||
'Dim sErrMessage As String = ""
|
||||
'Dim sGDDFDirPath As String = ""
|
||||
@@ -395,7 +493,7 @@ Public Class DoorListPageVM
|
||||
Catch ex As Microsoft.VisualBasic.FileIO.MalformedLineException
|
||||
Dim sMessage As String = "Line " & ex.Message & "is not valid and will be skipped."
|
||||
' egtoutlog(sMessage)
|
||||
sLineErrorList &= ex.Message & Environment.NewLine
|
||||
sLineErrorList &= Environment.NewLine & ex.Message
|
||||
End Try
|
||||
End While
|
||||
If Not String.IsNullOrWhiteSpace(sLineErrorList) Then
|
||||
@@ -442,7 +540,20 @@ Public Class DoorListPageVM
|
||||
WriteBackup()
|
||||
End Sub
|
||||
|
||||
Private Function CreateGenDdfFile(nId As Integer, sDDFName As String, dWidth As Double, dHeight As Double, dThickness As Double, nSwing As Integer, sErrMessage As String) As Boolean
|
||||
Private Function CopyGenDdfFile(SouDoor As Door, CopyDoor As Door) As Boolean
|
||||
Dim sGenDDFDirPath As String = ""
|
||||
GetPluginPrivateProfileString(S_GENERAL, K_GENDDFDIR, "", sGenDDFDirPath)
|
||||
Dim sGenDDFFilePath As String = sGenDDFDirPath & "\" & If(Not String.IsNullOrWhiteSpace(Path.GetDirectoryName(SouDoor.sDDFName)), Path.GetDirectoryName(SouDoor.sDDFName) & "_", "") & Path.GetFileNameWithoutExtension(SouDoor.sDDFName) & "_"
|
||||
Try
|
||||
File.Copy(sGenDDFFilePath & SouDoor.nId & ".ddf", sGenDDFFilePath & CopyDoor.nId & ".ddf", True)
|
||||
Catch ex As Exception
|
||||
Map.refSupervisorFunction.PlgOutLog("Error! Copy ddf file from " & sGenDDFFilePath & SouDoor.nId & ".ddf" & " to " & sGenDDFFilePath & CopyDoor.nId & ".ddf" & " failed!")
|
||||
Return False
|
||||
End Try
|
||||
Return True
|
||||
End Function
|
||||
|
||||
Private Function CreateGenDdfFile(nId As Integer, sDDFName As String, dWidth As Double, dHeight As Double, dThickness As Double, nSwing As Integer, ByRef sErrMessage As String) As Boolean
|
||||
' verifico che ci sia il file ddf
|
||||
Dim sDDTDirPath As String = ""
|
||||
GetPluginPrivateProfileString(S_GENERAL, K_DDTDIR, "", sDDTDirPath)
|
||||
@@ -454,7 +565,13 @@ Public Class DoorListPageVM
|
||||
If sExtension.ToLower() = ".ddf" Then
|
||||
Dim sDDFFilePath As String = sDDFDirPath & "\" & sDDFName
|
||||
If Not File.Exists(sDDFFilePath) Then
|
||||
sErrMessage &= "Il nome inserito non corrisponde a nessun file nella cartella dei Ddf (" & sDDFDirPath & ")" & Environment.NewLine
|
||||
Dim sErr As String = "Il nome inserito non corrisponde a nessun file nella cartella dei Ddf (" & sDDFDirPath & ")" & Environment.NewLine
|
||||
Map.refSupervisorFunction.PlgOutLog(sErr)
|
||||
sErrMessage &= "- " & sErr & Environment.NewLine
|
||||
Dim ErrDoor As Door = m_DoorList.FirstOrDefault(Function(x) x.nId = nId)
|
||||
If Not IsNothing(ErrDoor) Then
|
||||
ErrDoor.SetState(DoorStates.VERIFICATION_FAILED)
|
||||
End If
|
||||
NotifyPropertyChanged(NameOf(sDDFName))
|
||||
Return False
|
||||
End If
|
||||
@@ -465,18 +582,34 @@ Public Class DoorListPageVM
|
||||
File.Copy(sDDFFilePath, sGenDDFFilePath, True)
|
||||
bCopy = True
|
||||
Catch ex As Exception
|
||||
sErrMessage &= "Error: Copy file from " & sDDFFilePath & " to " & sGenDDFFilePath & " failed!"
|
||||
Dim sErr As String = "Error: Copy file from " & sDDFFilePath & " to " & sGenDDFFilePath & " failed!"
|
||||
Map.refSupervisorFunction.PlgOutLog(sErr)
|
||||
sErrMessage &= "- " & sErr & Environment.NewLine
|
||||
Dim ErrDoor As Door = m_DoorList.FirstOrDefault(Function(x) x.nId = nId)
|
||||
If Not IsNothing(ErrDoor) Then
|
||||
ErrDoor.SetState(DoorStates.VERIFICATION_FAILED)
|
||||
End If
|
||||
End Try
|
||||
If Not bCopy Then
|
||||
Return False
|
||||
End If
|
||||
ElseIf sExtension.ToLower() = ".ddt" Then
|
||||
' se file generato
|
||||
If Not Door.CreateDdfFromDdt(nId, sDDFName, dWidth, dHeight, dThickness, nSwing) Then
|
||||
If Not Door.CreateDdfFromDdt(nId, sDDFName, dWidth, dHeight, dThickness, nSwing, sErrMessage) Then
|
||||
Dim ErrDoor As Door = m_DoorList.FirstOrDefault(Function(x) x.nId = nId)
|
||||
If Not IsNothing(ErrDoor) Then
|
||||
ErrDoor.SetState(DoorStates.VERIFICATION_FAILED)
|
||||
End If
|
||||
Return False
|
||||
End If
|
||||
Else
|
||||
sErrMessage &= "Estensione del file non riconosciuta!"
|
||||
Dim sErr As String = "Estensione del file non riconosciuta!"
|
||||
Map.refSupervisorFunction.PlgOutLog(sErr)
|
||||
sErrMessage &= "- " & sErr & Environment.NewLine
|
||||
Dim ErrDoor As Door = m_DoorList.FirstOrDefault(Function(x) x.nId = nId)
|
||||
If Not IsNothing(ErrDoor) Then
|
||||
ErrDoor.SetState(DoorStates.VERIFICATION_FAILED)
|
||||
End If
|
||||
Return False
|
||||
End If
|
||||
Return True
|
||||
@@ -704,8 +837,23 @@ Public Class DoorListPageVM
|
||||
End Property
|
||||
|
||||
Public Sub NotProduceDoor()
|
||||
If IsNothing(SelDoor) OrElse (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))
|
||||
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
|
||||
|
||||
@@ -771,7 +919,7 @@ Public Class DoorListPageVM
|
||||
MessageBox.Show("Nessuna porta selezionata!" & Environment.NewLine & "Selezionare la porta da copiare", "Errore!", MessageBoxButton.OK, MessageBoxImage.Error)
|
||||
Return
|
||||
End If
|
||||
' apro finestra quanitita'
|
||||
' apro finestra quantita'
|
||||
Dim MultipleCopyWndVM As New MultipleCopyWndVM
|
||||
Dim MultipleCopyWnd As New MultipleCopyWndV(Application.Current.MainWindow, MultipleCopyWndVM)
|
||||
If MultipleCopyWnd.ShowDialog() Then
|
||||
@@ -851,25 +999,29 @@ Public Class DoorListPageVM
|
||||
|
||||
#End Region ' Delete
|
||||
|
||||
#Region "DeleteAll"
|
||||
#Region "DeleteCSV"
|
||||
|
||||
Public ReadOnly Property DeleteAll_Command As ICommand
|
||||
Public ReadOnly Property DeleteCSV_Command As ICommand
|
||||
Get
|
||||
If m_cmdDeleteAll Is Nothing Then
|
||||
m_cmdDeleteAll = New Command(AddressOf DeleteAll)
|
||||
If m_cmdDeleteCSV Is Nothing Then
|
||||
m_cmdDeleteCSV = New Command(AddressOf DeleteCSV)
|
||||
End If
|
||||
Return m_cmdDeleteAll
|
||||
Return m_cmdDeleteCSV
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Sub DeleteAll()
|
||||
Public Sub DeleteCSV()
|
||||
If m_DoorList.Count = 0 OrElse IsNothing(SelDoor) OrElse String.Compare(SelDoor.sCSVName, m_ManualAddedDoorName, 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_2_END) Then Return
|
||||
End If
|
||||
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_1_END AndAlso CsvDoor.nState <> DoorStates.PRODUCED AndAlso CsvDoor.nState <> DoorStates.NOTPRODUCE Then
|
||||
If CsvDoor.nState <> DoorStates.MACHINE_1_END AndAlso CsvDoor.nState <> DoorStates.PRODUCED AndAlso CsvDoor.nState <> DoorStates.NOTPRODUCE AndAlso CsvDoor.nState <> DoorStates.VERIFICATION_FAILED Then
|
||||
bAllProduced = False
|
||||
End If
|
||||
End If
|
||||
@@ -889,6 +1041,55 @@ Public Class DoorListPageVM
|
||||
End If
|
||||
End Sub
|
||||
|
||||
#End Region ' DeleteCSV
|
||||
|
||||
#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
|
||||
Dim bReset As Boolean = True
|
||||
If Not LuaGetGlobVar("bReset", bReset) OrElse Not bReset Then
|
||||
MessageBox.Show("Impossibile cancellare tutte le porte!" & Environment.NewLine & "La macchina deve essere in stato Reset per poter cancellare tutte le porte!", "Warning", MessageBoxButton.OK, MessageBoxImage.Warning)
|
||||
Return
|
||||
End If
|
||||
' verifico che tutte le porte siano in stato prodotto o da non produrre
|
||||
Dim bAllProduced As Boolean = True
|
||||
For Each CsvDoor In m_DoorList
|
||||
If CsvDoor.nState <> DoorStates.MACHINE_1_END AndAlso CsvDoor.nState <> DoorStates.PRODUCED AndAlso CsvDoor.nState <> DoorStates.NOTPRODUCE AndAlso CsvDoor.nState <> DoorStates.VERIFICATION_FAILED AndAlso CsvDoor.nState <> DoorStates.VERIFIED Then
|
||||
bAllProduced = False
|
||||
End If
|
||||
Next
|
||||
If Not bAllProduced Then
|
||||
MessageBox.Show("Impossibile cancellare tutte le porte!" & Environment.NewLine & "Per cancellare tutte le porte, devono essere tutte non in lavorazione!", "Warning", MessageBoxButton.OK, MessageBoxImage.Warning)
|
||||
Return
|
||||
End If
|
||||
If MessageBox.Show("Sei sicuro di voler cancellare tutte le porte?", "Info", MessageBoxButton.YesNo, MessageBoxImage.Information) = MessageBoxResult.Yes Then
|
||||
For CsvDoorIndex = m_DoorList.Count - 1 To 0 Step -1
|
||||
Dim CsvDoor As Door = m_DoorList(CsvDoorIndex)
|
||||
m_DoorList.Remove(CsvDoor)
|
||||
Next
|
||||
WriteBackup()
|
||||
' cancello backup lua per ripartire pulito
|
||||
Try
|
||||
Dim sBackupDirPath As String = ""
|
||||
GetPluginPrivateProfileString(S_GENERAL, K_BACKUPDIR, "", sBackupDirPath)
|
||||
Dim sLuaBackupFilePath As String = sBackupDirPath & "\LuaBackup.json"
|
||||
File.Delete(sLuaBackupFilePath)
|
||||
Catch ex As Exception
|
||||
Map.refSupervisorFunction.PlgOutLog("Fallita cancellazione del file LuaBackup!")
|
||||
End Try
|
||||
End If
|
||||
End Sub
|
||||
|
||||
#End Region ' DeleteAll
|
||||
|
||||
#Region "Produce"
|
||||
@@ -908,10 +1109,7 @@ Public Class DoorListPageVM
|
||||
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.NOTPRODUCE OrElse
|
||||
DoorToProduce.nState = Door.DoorStates.VERIFICATION_FAILED OrElse
|
||||
DoorToProduce.nState >= Door.DoorStates.READY_FOR_PRODUCTION Then Return
|
||||
If IsNothing(DoorToProduce) OrElse DoorToProduce.nState <> Door.DoorStates.VERIFIED 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)
|
||||
@@ -980,6 +1178,9 @@ Public Class DoorListPageVM
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_DifferentDoorList As New List(Of Door)
|
||||
Private m_AssociationList As New Dictionary(Of Integer, List(Of Integer))
|
||||
|
||||
Public Sub Verify()
|
||||
|
||||
Dim sCamExePath As String = ""
|
||||
@@ -997,21 +1198,63 @@ Public Class DoorListPageVM
|
||||
Dim sGenDDFDirPath As String = ""
|
||||
GetPluginPrivateProfileString(S_GENERAL, K_GENDDFDIR, "", sGenDDFDirPath)
|
||||
Dim sErrMessage As String = ""
|
||||
For Each Door In m_DoorList
|
||||
m_DifferentDoorList.Clear()
|
||||
m_AssociationList.Clear()
|
||||
' inizio Creazione ddf e quindi mostro caricamento
|
||||
m_bCreatingDdfs = True
|
||||
m_nTotCreatingDdf = m_DoorList.Count
|
||||
For nDoorIndex = 0 To m_DoorList.Count - 1
|
||||
Dim Door As Door = m_DoorList(nDoorIndex)
|
||||
m_nCurrCreatingDdf = nDoorIndex
|
||||
NotifyPropertyChanged(NameOf(dExecPercentage))
|
||||
NotifyPropertyChanged(NameOf(sExecPercentage))
|
||||
If Door.nState = Door.DoorStates.LOADED_FROM_CSV Or Door.nState = Door.DoorStates.VERIFICATION_FAILED Then
|
||||
' creo file ddf
|
||||
If CreateGenDdfFile(Door.nId, Door.sDDFName, Door.dWidth, Door.dHeight, Door.dThickness, Door.nSwing, sErrMessage) Then
|
||||
Dim sGenDDFFilePath As String = sGenDDFDirPath & "\" & If(Not String.IsNullOrWhiteSpace(Path.GetDirectoryName(Door.sDDFName)), Path.GetDirectoryName(Door.sDDFName) & "_", "") & Path.GetFileNameWithoutExtension(Door.sDDFName) & "_" & Door.nId & ".ddf"
|
||||
m_ExecProcessManager.ArgumentsEnqueue(New ProcessArgs(Door.nId, sGenDDFFilePath))
|
||||
' verifico se ho gia' lanciato una porta con le stesse caratteristiche
|
||||
Dim DifferentDoor As Door = Nothing
|
||||
If Path.GetExtension(Door.sDDFName).ToLower() = ".ddf" Then
|
||||
DifferentDoor = m_DifferentDoorList.FirstOrDefault(Function(x) Door.sDDFName = x.sDDFName)
|
||||
ElseIf Path.GetExtension(Door.sDDFName).ToLower() = ".ddt" Then
|
||||
DifferentDoor = m_DifferentDoorList.FirstOrDefault(Function(x) Door.sDDFName = x.sDDFName AndAlso Door.dWidth = x.dWidth AndAlso Door.dHeight = x.dHeight AndAlso Door.dThickness = x.dThickness AndAlso Door.nSwing = x.nSwing)
|
||||
End If
|
||||
If Not IsNothing(DifferentDoor) Then
|
||||
m_AssociationList(DifferentDoor.nId).Add(Door.nId)
|
||||
Else
|
||||
m_DifferentDoorList.Add(Door)
|
||||
m_AssociationList.Add(Door.nId, New List(Of Integer))
|
||||
' creo file ddf
|
||||
If CreateGenDdfFile(Door.nId, Door.sDDFName, Door.dWidth, Door.dHeight, Door.dThickness, Door.nSwing, sErrMessage) Then
|
||||
Dim sGenDDFFilePath As String = sGenDDFDirPath & "\" & If(Not String.IsNullOrWhiteSpace(Path.GetDirectoryName(Door.sDDFName)), Path.GetDirectoryName(Door.sDDFName) & "_", "") & Path.GetFileNameWithoutExtension(Door.sDDFName) & "_" & Door.nId & ".ddf"
|
||||
m_ExecProcessManager.ArgumentsEnqueue(New ProcessArgs(Door.nId, sGenDDFFilePath))
|
||||
End If
|
||||
End If
|
||||
|
||||
'' creo file ddf
|
||||
'If CreateGenDdfFile(Door.nId, Door.sDDFName, Door.dWidth, Door.dHeight, Door.dThickness, Door.nSwing, sErrMessage) Then
|
||||
' ' verifico se ho gia' lanciato una porta con le stesse caratteristiche
|
||||
' Dim DifferentDoor As Door = Nothing
|
||||
' If Path.GetExtension(Door.sDDFName).ToLower() = ".ddf" Then
|
||||
' DifferentDoor = m_DifferentDoorList.FirstOrDefault(Function(x) Door.sDDFName = x.sDDFName)
|
||||
' ElseIf Path.GetExtension(Door.sDDFName).ToLower() = ".ddt" Then
|
||||
' DifferentDoor = m_DifferentDoorList.FirstOrDefault(Function(x) Door.sDDFName = x.sDDFName AndAlso Door.dWidth = x.dWidth AndAlso Door.dHeight = x.dHeight AndAlso Door.dThickness = x.dThickness AndAlso Door.nSwing = x.nSwing)
|
||||
' End If
|
||||
' If Not IsNothing(DifferentDoor) Then
|
||||
' m_AssociationList(DifferentDoor.nId).Add(Door.nId)
|
||||
' Else
|
||||
' m_DifferentDoorList.Add(Door)
|
||||
' m_AssociationList.Add(Door.nId, New List(Of Integer))
|
||||
' Dim sGenDDFFilePath As String = sGenDDFDirPath & "\" & If(Not String.IsNullOrWhiteSpace(Path.GetDirectoryName(Door.sDDFName)), Path.GetDirectoryName(Door.sDDFName) & "_", "") & Path.GetFileNameWithoutExtension(Door.sDDFName) & "_" & Door.nId & ".ddf"
|
||||
' m_ExecProcessManager.ArgumentsEnqueue(New ProcessArgs(Door.nId, sGenDDFFilePath))
|
||||
' End If
|
||||
'End If
|
||||
End If
|
||||
Next
|
||||
m_bCreatingDdfs = False
|
||||
If bStartExecProcessManager OrElse m_ExecProcessManager.ExecutionThreadStatus = ExecProcessManager.ExecutionThreadStatuses.STOPPED Then
|
||||
m_ExecProcessManager.StartExecutionThread()
|
||||
SetExecButtonIsEnabled(False)
|
||||
End If
|
||||
If Not String.IsNullOrWhiteSpace(sErrMessage) Then
|
||||
MessageBox.Show("Impossible creating Ddf files for this doors:" & sErrMessage, "Error", MessageBoxButton.OK, MessageBoxImage.Error)
|
||||
MessageBox.Show("Impossible creating Ddf files for this doors:" & Environment.NewLine & sErrMessage, "Error", MessageBoxButton.OK, MessageBoxImage.Error)
|
||||
End If
|
||||
WriteBackup()
|
||||
End Sub
|
||||
@@ -1026,6 +1269,7 @@ Public Class Door
|
||||
Inherits VMBase
|
||||
|
||||
Public Enum SWINGTYPE As Integer
|
||||
UNDEFINED = 0
|
||||
RIGHT = 1
|
||||
LEFT = 2
|
||||
End Enum
|
||||
@@ -1044,8 +1288,8 @@ Public Class Door
|
||||
MACHINE_1_START = 33
|
||||
MACHINE_1_END = 34
|
||||
MACHINE_2_START = 35
|
||||
MACHINE_2_END = 35
|
||||
PRODUCED = 36
|
||||
MACHINE_2_END = 36
|
||||
PRODUCED = 37
|
||||
SCRAP = 40
|
||||
End Enum
|
||||
|
||||
@@ -1151,6 +1395,8 @@ Public Class Door
|
||||
NotifyPropertyChanged(NameOf(sDDFName))
|
||||
Return
|
||||
End If
|
||||
NotifyPropertyChanged(NameOf(nState))
|
||||
NotifyPropertyChanged(NameOf(Background))
|
||||
End Set
|
||||
End Property
|
||||
|
||||
@@ -1206,6 +1452,8 @@ Public Class Door
|
||||
' Return
|
||||
'End If
|
||||
End If
|
||||
NotifyPropertyChanged(NameOf(nState))
|
||||
NotifyPropertyChanged(NameOf(Background))
|
||||
End Set
|
||||
End Property
|
||||
|
||||
@@ -1254,6 +1502,8 @@ Public Class Door
|
||||
' Return
|
||||
'End If
|
||||
End If
|
||||
NotifyPropertyChanged(NameOf(nState))
|
||||
NotifyPropertyChanged(NameOf(Background))
|
||||
End Set
|
||||
End Property
|
||||
|
||||
@@ -1302,6 +1552,8 @@ Public Class Door
|
||||
' Return
|
||||
'End If
|
||||
End If
|
||||
NotifyPropertyChanged(NameOf(nState))
|
||||
NotifyPropertyChanged(NameOf(Background))
|
||||
End Set
|
||||
End Property
|
||||
|
||||
@@ -1356,6 +1608,8 @@ Public Class Door
|
||||
' Return
|
||||
'End If
|
||||
End If
|
||||
NotifyPropertyChanged(NameOf(nState))
|
||||
NotifyPropertyChanged(NameOf(Background))
|
||||
End Set
|
||||
End Property
|
||||
|
||||
@@ -1421,7 +1675,7 @@ Public Class Door
|
||||
End Property
|
||||
Public ReadOnly Property sLoadTime As String
|
||||
Get
|
||||
Return If(m_dtLoadTime <> DateTime.MinValue, m_dtLoadTime.ToString("yy/MM/dd HH:mm:ss"), "")
|
||||
Return ConvertDateTimeToString(m_dtLoadTime)
|
||||
End Get
|
||||
End Property
|
||||
Friend Sub SetLoadTime(LoadTime As Long)
|
||||
@@ -1437,7 +1691,7 @@ Public Class Door
|
||||
End Property
|
||||
Public ReadOnly Property sMachining1Start As String
|
||||
Get
|
||||
Return If(m_dtMachining1Start <> DateTime.MinValue, m_dtMachining1Start.ToString("yy/MM/dd HH:mm:ss"), "")
|
||||
Return ConvertDateTimeToString(m_dtMachining1Start)
|
||||
End Get
|
||||
End Property
|
||||
Friend Sub SetMachining1Start(Machining1Start As Long)
|
||||
@@ -1453,7 +1707,7 @@ Public Class Door
|
||||
End Property
|
||||
Public ReadOnly Property sMachining1End As String
|
||||
Get
|
||||
Return If(m_dtMachining1End <> DateTime.MinValue, m_dtMachining1End.ToString("yy/MM/dd HH:mm:ss"), "")
|
||||
Return ConvertDateTimeToString(m_dtMachining1End)
|
||||
End Get
|
||||
End Property
|
||||
Friend Sub SetMachining1End(Machining1End As Long)
|
||||
@@ -1469,7 +1723,7 @@ Public Class Door
|
||||
End Property
|
||||
Public ReadOnly Property sMachining2Start As String
|
||||
Get
|
||||
Return If(m_dtMachining2Start <> DateTime.MinValue, m_dtMachining2Start.ToString("yy/MM/dd HH:mm:ss"), "")
|
||||
Return ConvertDateTimeToString(m_dtMachining2Start)
|
||||
End Get
|
||||
End Property
|
||||
Friend Sub SetMachining2Start(Machining2Start As Long)
|
||||
@@ -1485,7 +1739,7 @@ Public Class Door
|
||||
End Property
|
||||
Public ReadOnly Property sMachining2End As String
|
||||
Get
|
||||
Return If(m_dtMachining2End <> DateTime.MinValue, m_dtMachining2End.ToString("yy/MM/dd HH:mm:ss"), "")
|
||||
Return ConvertDateTimeToString(m_dtMachining2End)
|
||||
End Get
|
||||
End Property
|
||||
Friend Sub SetMachining2End(Machining2End As Long)
|
||||
@@ -1501,7 +1755,7 @@ Public Class Door
|
||||
End Property
|
||||
Public ReadOnly Property sUnloadTime As String
|
||||
Get
|
||||
Return If(m_dtUnloadTime <> DateTime.MinValue, m_dtUnloadTime.ToString("yy/MM/dd HH:mm:ss"), "")
|
||||
Return ConvertDateTimeToString(m_dtUnloadTime)
|
||||
End Get
|
||||
End Property
|
||||
Friend Sub SetUnloadTime(UnloadTime As Long)
|
||||
@@ -1592,10 +1846,10 @@ Public Class Door
|
||||
#Region "METHODS"
|
||||
|
||||
Friend Function Copy(nId As Integer) As Door
|
||||
Return New Door(nId, m_nCSVLine, m_sDDFName, m_sCSVName, m_nQuantity, m_dWidth, m_dHeight, m_dThickness, m_nSwing, m_CustomerParameters)
|
||||
Return New Door(nId, m_nCSVLine, m_sDDFName, Map.refDoorListPageVM.ManualAddedDoorName, m_nQuantity, m_dWidth, m_dHeight, m_dThickness, m_nSwing, m_CustomerParameters)
|
||||
End Function
|
||||
|
||||
Friend Shared Function CreateDdfFromDdt(nId As Integer, sDDFName As String, dWidth As Double, dHeight As Double, dThickness As Double, nSwing As Integer) As Boolean
|
||||
Friend Shared Function CreateDdfFromDdt(nId As Integer, sDDFName As String, dWidth As Double, dHeight As Double, dThickness As Double, nSwing As Integer, ByRef sErrMessage As String) As Boolean
|
||||
Dim sDoorCreatorExePath As String = ""
|
||||
GetPluginPrivateProfileString(S_GENERAL, K_DOORCREATOREXEPATH, "", sDoorCreatorExePath)
|
||||
Dim sDDTDirPath As String = ""
|
||||
@@ -1607,32 +1861,48 @@ Public Class Door
|
||||
MessageBox.Show("Path del programma di calcolo del ddf mancante o errata!", "Errore!", MessageBoxButton.OK, MessageBoxImage.Error)
|
||||
Return False
|
||||
ElseIf Not File.Exists(sDDTFilePath) Then
|
||||
MessageBox.Show("Il nome inserito non corrisponde a nessun file nella cartella dei Ddt (" & sDDTDirPath & ") ", "File non trovato!", MessageBoxButton.OK, MessageBoxImage.Error)
|
||||
Dim sErr As String = "File non trovato! Il nome inserito non corrisponde a nessun file nella cartella dei Ddt (" & sDDTDirPath & ")"
|
||||
Map.refSupervisorFunction.PlgOutLog(sErr)
|
||||
sErrMessage &= "- " & sErr & Environment.NewLine
|
||||
Return False
|
||||
End If
|
||||
' creo il ddf
|
||||
Dim sGenDDFFilePath As String = sGenDDFDirPath & "\" & If(Not String.IsNullOrWhiteSpace(Path.GetDirectoryName(sDDFName)), Path.GetDirectoryName(sDDFName) & "_", "") & Path.GetFileNameWithoutExtension(sDDFName) & "_" & nId & ".ddf"
|
||||
Dim Proc As New Process()
|
||||
Proc.StartInfo.FileName = """" & sDoorCreatorExePath & """"
|
||||
Proc.StartInfo.RedirectStandardInput = False
|
||||
Proc.StartInfo.RedirectStandardOutput = False
|
||||
Proc.StartInfo.Arguments = """" & sDDTFilePath & ";" & DoubleToString(dWidth, 2) & ";" & DoubleToString(dHeight, 2) & ";" & DoubleToString(dThickness, 2) & ";" & sGenDDFFilePath & ";" & If(nSwing = SWINGTYPE.LEFT, "L", "R") & """"
|
||||
Proc.StartInfo.UseShellExecute = False
|
||||
Proc.StartInfo.CreateNoWindow = True
|
||||
Dim ExecCounter = 0
|
||||
If Proc.Start Then
|
||||
While Not Proc.HasExited
|
||||
If ExecCounter >= 30 Then
|
||||
Proc.Kill()
|
||||
Exit While
|
||||
End If
|
||||
Threading.Thread.Sleep(100)
|
||||
ExecCounter += 1
|
||||
End While
|
||||
' elimino eventuale vecchio file
|
||||
If File.Exists(sGenDDFFilePath) Then
|
||||
File.Delete(sGenDDFFilePath)
|
||||
End If
|
||||
Try
|
||||
' creo il ddf
|
||||
Dim Proc As New Process()
|
||||
Proc.StartInfo.FileName = """" & sDoorCreatorExePath & """"
|
||||
Proc.StartInfo.RedirectStandardInput = False
|
||||
Proc.StartInfo.RedirectStandardOutput = False
|
||||
Map.refSupervisorFunction.PlgOutLog("""" & sDDTFilePath & ";" & DoubleToString(dWidth, 2) & ";" & DoubleToString(dHeight, 2) & ";" & DoubleToString(dThickness, 2) & ";" & sGenDDFFilePath & ";" & If(nSwing = SWINGTYPE.LEFT, "L", "R") & """")
|
||||
Proc.StartInfo.Arguments = """" & sDDTFilePath & ";" & DoubleToString(dWidth, 2) & ";" & DoubleToString(dHeight, 2) & ";" & DoubleToString(dThickness, 2) & ";" & sGenDDFFilePath & ";" & If(nSwing = SWINGTYPE.LEFT, "L", "R") & """"
|
||||
Proc.StartInfo.UseShellExecute = False
|
||||
Proc.StartInfo.CreateNoWindow = True
|
||||
Dim ExecCounter = 0
|
||||
If Proc.Start Then
|
||||
While Not Proc.HasExited
|
||||
If ExecCounter >= 300 Then
|
||||
Map.refSupervisorFunction.PlgOutLog("Kill del processo!!")
|
||||
Proc.Kill()
|
||||
Exit While
|
||||
End If
|
||||
Threading.Thread.Sleep(100)
|
||||
ExecCounter += 1
|
||||
End While
|
||||
End If
|
||||
Map.refSupervisorFunction.PlgOutLog(Proc.ExitCode)
|
||||
Catch ex As Exception
|
||||
Map.refSupervisorFunction.PlgOutLog(ex.Message)
|
||||
End Try
|
||||
' se file generato
|
||||
If Not File.Exists(sGenDDFFilePath) Then
|
||||
MessageBox.Show("Generazione file ddf fallita!", "Errore!", MessageBoxButton.OK, MessageBoxImage.Error)
|
||||
Dim sErr As String = "Errore! Generazione file ddf fallita! (" & sDDTDirPath & ")"
|
||||
Map.refSupervisorFunction.PlgOutLog(sErr)
|
||||
sErrMessage &= "- " & sErr & Environment.NewLine
|
||||
Return False
|
||||
End If
|
||||
Return True
|
||||
@@ -1697,4 +1967,18 @@ Public Class StateToSelColorConverter
|
||||
Throw New NotImplementedException()
|
||||
End Function
|
||||
|
||||
End Class
|
||||
|
||||
Public Class DDTListToBooleanConverter
|
||||
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 ObservableCollection(Of String) Then Return False
|
||||
Return DirectCast(value, ObservableCollection(Of String)).Count = 0
|
||||
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,12 @@
|
||||
<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="EgwWPFBaseLib">
|
||||
<HintPath>..\..\..\EgwWPFBaseLib\EgwWPFBaseLib\bin\Debug\EgwWPFBaseLib.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,13 +104,6 @@
|
||||
<DependentUpon>DoorListPageV.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="DoorListPage\DoorListPageVM.vb" />
|
||||
<Compile Include="MultipleCopyWnd\MultipleCopyWndV.xaml.vb">
|
||||
<DependentUpon>MultipleCopyWndV.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="MultipleCopyWnd\MultipleCopyWndVM.vb" />
|
||||
<Compile Include="ProcessManager\ProcessManagerV.xaml.vb">
|
||||
<DependentUpon>ProcessManagerV.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="FiveLakesUI.xaml.vb">
|
||||
<DependentUpon>FiveLakesUI.xaml</DependentUpon>
|
||||
</Compile>
|
||||
@@ -120,7 +119,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>
|
||||
@@ -145,15 +143,8 @@
|
||||
<DependentUpon>Settings.settings</DependentUpon>
|
||||
<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" />
|
||||
<Compile Include="Utility\JsonUtility.vb" />
|
||||
<Compile Include="Utility\Map.vb" />
|
||||
<Compile Include="Utility\StringConversion.vb" />
|
||||
<Compile Include="Utility\VMBase.vb" />
|
||||
<EmbeddedResource Include="My Project\Resources.resx">
|
||||
<Generator>VbMyResourcesResXFileCodeGenerator</Generator>
|
||||
<LastGenOutput>Resources.Designer.vb</LastGenOutput>
|
||||
@@ -172,14 +163,6 @@
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="MultipleCopyWnd\MultipleCopyWndV.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>
|
||||
@@ -205,6 +188,28 @@
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Resource Include="Resources\DoorListPage\Add.png" />
|
||||
<Resource Include="Resources\DoorListPage\Copy.png" />
|
||||
<Resource Include="Resources\DoorListPage\Delete.png" />
|
||||
<Resource Include="Resources\DoorListPage\DeleteCsv.png" />
|
||||
<Resource Include="Resources\DoorListPage\MoveDown.png" />
|
||||
<Resource Include="Resources\DoorListPage\MoveUp.png" />
|
||||
<Resource Include="Resources\DoorListPage\MultipleCopy.png" />
|
||||
<Resource Include="Resources\DoorListPage\NotProduce.png" />
|
||||
<Resource Include="Resources\DoorListPage\OpenCsv.png" />
|
||||
<Resource Include="Resources\DoorListPage\OpenProduction.png" />
|
||||
<Resource Include="Resources\DoorListPage\Produce.png" />
|
||||
<Resource Include="Resources\DoorListPage\ProduceAll.old.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\DeleteAll.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>
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
Imports System.ComponentModel.Composition
|
||||
Imports Effector.Plugin.Interface
|
||||
Imports Effector.Plugin.Lib
|
||||
|
||||
Public Class FiveLakesUIVM
|
||||
Inherits VMBase
|
||||
@@ -52,10 +53,9 @@ Public Class FiveLakesUIVM
|
||||
' Impostazione direttorio di configurazione
|
||||
m_sConfigDir = m_sDataRoot & "\" & CONF_DIR
|
||||
' Impostazione path Ini file
|
||||
IniFile.SetIniFile(m_sConfigDir & "\" & INI_FILE_NAME)
|
||||
PluginIniFile.SetIniFile(m_sConfigDir & "\" & INI_FILE_NAME)
|
||||
' Impostazione path resources dir
|
||||
m_sResourcesRoot = m_sDataRoot & "\" & RES_DIR
|
||||
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
Imports System.IO
|
||||
Imports KeraLua
|
||||
Imports Effector.Plugin.Lib
|
||||
|
||||
Public Module Lua_General
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@ Imports System.Windows.Threading
|
||||
Imports Newtonsoft.Json.Linq
|
||||
Imports Effector.Plugin.DoorArreda.Variable
|
||||
Imports Effector.Plugin.Interface
|
||||
Imports Effector.Plugin.Lib
|
||||
|
||||
Public Class MachinePageVM
|
||||
Inherits VMBase
|
||||
@@ -44,6 +45,13 @@ Public Class MachinePageVM
|
||||
NotifyPropertyChanged(NameOf(nDDfCalcState))
|
||||
End Sub
|
||||
|
||||
Private m_dDdfCalcValue As Double = 0
|
||||
Public ReadOnly Property dDdfCalcValue As Double
|
||||
Get
|
||||
Return m_dDdfCalcValue
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_nNewDoorState As Integer = -1
|
||||
Public ReadOnly Property nNewDoorState As Integer
|
||||
Get
|
||||
@@ -222,6 +230,14 @@ Public Class MachinePageVM
|
||||
Dim nState As Integer = -1
|
||||
If LuaGetGlobVar("MACHINE1.DDfCalcState", nState) Then
|
||||
SetDDfCalcState(nState)
|
||||
If nState = 1 Then
|
||||
m_dDdfCalcValue += 100 / 250
|
||||
m_dDdfCalcValue = Math.Min(100, m_dDdfCalcValue)
|
||||
ElseIf m_dDdfCalcValue <> 0 Then
|
||||
m_dDdfCalcValue = 0
|
||||
End If
|
||||
NotifyPropertyChanged(NameOf(dDdfCalcValue))
|
||||
NotifyPropertyChanged(NameOf(nDDfCalcState))
|
||||
End If
|
||||
If LuaGetGlobVar("MACHINE1.NewDoorState", nState) Then
|
||||
SetNewDoorState(nState)
|
||||
@@ -778,42 +794,42 @@ Public Class LuaDoor
|
||||
Private m_dtLoadTime As DateTime
|
||||
Public ReadOnly Property sLoadTime As String
|
||||
Get
|
||||
Return m_dtLoadTime.ToString("yy/MM/dd HH:mm:ss")
|
||||
Return ConvertDateTimeToString(m_dtLoadTime)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_dtMachining1Start As DateTime
|
||||
Public ReadOnly Property sMachining1Start As String
|
||||
Get
|
||||
Return m_dtMachining1Start.ToString("yy/MM/dd HH:mm:ss")
|
||||
Return ConvertDateTimeToString(m_dtMachining1Start)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_dtMachining1End As DateTime
|
||||
Public ReadOnly Property sMachining1End As String
|
||||
Get
|
||||
Return m_dtMachining1End.ToString("yy/MM/dd HH:mm:ss")
|
||||
Return ConvertDateTimeToString(m_dtMachining1End)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_dtMachining2Start As DateTime
|
||||
Public ReadOnly Property sMachining2Start As String
|
||||
Get
|
||||
Return m_dtMachining2Start.ToString("yy/MM/dd HH:mm:ss")
|
||||
Return ConvertDateTimeToString(m_dtMachining2Start)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_dtMachining2End As DateTime
|
||||
Public ReadOnly Property sMachining2End As String
|
||||
Get
|
||||
Return m_dtMachining2End.ToString("yy/MM/dd HH:mm:ss")
|
||||
Return ConvertDateTimeToString(m_dtMachining2End)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_dtUnloadTime As DateTime
|
||||
Public ReadOnly Property sUnloadTime As String
|
||||
Get
|
||||
Return m_dtUnloadTime.ToString("yy/MM/dd HH:mm:ss")
|
||||
Return ConvertDateTimeToString(m_dtUnloadTime)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
Public Class MainMenuVM
|
||||
Imports Effector.Plugin.Lib
|
||||
|
||||
Public Class MainMenuVM
|
||||
Inherits VMBase
|
||||
|
||||
' Definizione comandi
|
||||
|
||||
|
After Width: | Height: | Size: 542 B |
|
After Width: | Height: | Size: 484 B |
|
After Width: | Height: | Size: 608 B |
|
After Width: | Height: | Size: 2.1 KiB |
|
After Width: | Height: | Size: 773 B |
|
After Width: | Height: | Size: 358 B |
|
After Width: | Height: | Size: 328 B |
|
After Width: | Height: | Size: 547 B |
|
After Width: | Height: | Size: 730 B |
|
After Width: | Height: | Size: 626 B |
|
After Width: | Height: | Size: 424 B |
|
After Width: | Height: | Size: 452 B |
|
After Width: | Height: | Size: 767 B |
|
After Width: | Height: | Size: 390 B |
|
After Width: | Height: | Size: 175 B |
|
After Width: | Height: | Size: 685 B |
|
After Width: | Height: | Size: 237 B |
|
After Width: | Height: | Size: 668 B |
@@ -1,4 +1,5 @@
|
||||
Imports Newtonsoft.Json
|
||||
Imports Effector.Plugin.Lib
|
||||
Imports Newtonsoft.Json
|
||||
Imports System.Collections.ObjectModel
|
||||
Imports System.Globalization
|
||||
Imports System.IO
|
||||
|
||||
@@ -4,6 +4,10 @@
|
||||
xmlns:local="clr-namespace:Effector.Plugin.DoorArreda"
|
||||
xmlns:sys="clr-namespace:System;assembly=mscorlib">
|
||||
|
||||
<!--<ResourceDictionary.MergedDictionaries>
|
||||
<ResourceDictionary Source="pack://application:,,,/Effector.Plugin.Lib;component/Themes/Generic.xaml" />
|
||||
</ResourceDictionary.MergedDictionaries>-->
|
||||
|
||||
<!--
|
||||
Assign a Key to every Panel ViewModel to use
|
||||
it in xaml file(ProjectView.xaml).
|
||||
@@ -110,7 +114,7 @@
|
||||
|
||||
<!--Button-->
|
||||
|
||||
<Style TargetType="{x:Type 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}"/>
|
||||
@@ -146,12 +150,12 @@
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
</Style>-->
|
||||
|
||||
<Style x:Key="DoorList_Button" TargetType="{x:Type Button}">
|
||||
<!--<Style x:Key="DoorList_Button" TargetType="{x:Type Button}">
|
||||
<Setter Property="Height" Value="30"/>
|
||||
<Setter Property="Padding" Value="10,0,10,0"/>
|
||||
</Style>
|
||||
</Style>-->
|
||||
|
||||
<!--ToggleButton-->
|
||||
|
||||
@@ -213,12 +217,12 @@
|
||||
|
||||
<!-- Custom SelectedItem colors for DataGrid -->
|
||||
|
||||
<Style x:Key="RowDataGrid_CustomHighLight" TargetType="{x:Type DataGridRow}">
|
||||
<!--<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="BorderBrush" Value="Cyan" />--><!--
|
||||
<Setter Property="Padding" Value="0,0,0,0" />
|
||||
<Setter Property="Margin" Value="-2,0,-2,0" />
|
||||
<Setter Property="Foreground" Value="Blue" />
|
||||
@@ -230,7 +234,7 @@
|
||||
<SolidColorBrush x:Key="{x:Static SystemColors.InactiveSelectionHighlightBrushKey}" Color="Transparent" />
|
||||
<SolidColorBrush x:Key="{x:Static SystemColors.InactiveSelectionHighlightTextBrushKey}" Color="Black" />
|
||||
</Style.Resources>
|
||||
</Style>
|
||||
</Style>-->
|
||||
|
||||
<!--Styles for DataGrid columns-->
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
Imports Newtonsoft.Json
|
||||
Imports Newtonsoft.Json.Converters
|
||||
Imports Effector.Plugin.DoorArreda.Door
|
||||
Imports Effector.Plugin.Lib
|
||||
|
||||
Public Class JsonDoor
|
||||
|
||||
|
||||