Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 2309920d96 | |||
| 934cfa55c1 | |||
| 6879eed34b |
@@ -163,7 +163,7 @@ Public Class BTLFeatureVM
|
||||
|
||||
Public ReadOnly Property CALC_ROT_Visibility As Visibility
|
||||
Get
|
||||
Return If(m_BTLFeatureM.nCALC_ROT <> 0, Visibility.Visible, Visibility.Collapsed)
|
||||
Return If(m_BTLFeatureM.nCALC_ROT <> 0, Visibility.Visible, Visibility.Hidden)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
|
||||
@@ -102,6 +102,8 @@ Public Module ConstIni
|
||||
Public Const K_ENABLE As String = "Enable"
|
||||
Public Const K_ZEBRAUTILITIES As String = "ZebraUtilities"
|
||||
Public Const K_TEMPLATE As String = "Template"
|
||||
Public Const K_PRINTERMODE As String = "Mode"
|
||||
Public Const K_NETWORKADDRESS As String = "NetworkAddress"
|
||||
|
||||
Public Const S_BEAM_LIST As String = "Beam_List"
|
||||
Public Const S_WALL_LIST As String = "Wall_List"
|
||||
|
||||
@@ -267,13 +267,13 @@ Public MustInherit Class MyMachGroupVM
|
||||
|
||||
Public ReadOnly Property CALC_ROT_Visibility As Visibility
|
||||
Get
|
||||
Return If(MyMachGroupM.nCALC_ROT <> 0, Visibility.Visible, Visibility.Collapsed)
|
||||
Return If(MyMachGroupM.nCALC_ROT <> 0, Visibility.Visible, Visibility.Hidden)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property CALC_FALL_Visibility As Visibility
|
||||
Get
|
||||
Return If(MyMachGroupM.nCALC_FALL <> 0, Visibility.Visible, Visibility.Collapsed)
|
||||
Return If(MyMachGroupM.nCALC_FALL <> 0, Visibility.Visible, Visibility.Hidden)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
|
||||
@@ -319,13 +319,13 @@ Public MustInherit Class PartVM
|
||||
|
||||
Public ReadOnly Property CALC_ROT_Visibility As Visibility
|
||||
Get
|
||||
Return If(m_PartM.nCALC_ROT <> 0, Visibility.Visible, Visibility.Collapsed)
|
||||
Return If(m_PartM.nCALC_ROT <> 0, Visibility.Visible, Visibility.Hidden)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property CALC_FALL_Visibility As Visibility
|
||||
Get
|
||||
Return If(m_PartM.nCALC_FALL <> 0, Visibility.Visible, Visibility.Collapsed)
|
||||
Return If(m_PartM.nCALC_FALL <> 0, Visibility.Visible, Visibility.Hidden)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
|
||||
@@ -107,24 +107,20 @@ Public Class BTLPartListV
|
||||
End Function
|
||||
|
||||
Private Sub Root_PreviewKeyDown(sender As Object, e As KeyEventArgs)
|
||||
If e.Key <> Key.Delete Then Return
|
||||
If e.Key = Key.Delete Then
|
||||
Dim BTLStructureVM As BTLStructureVM = TryCast(Me.Tag, BTLStructureVM)
|
||||
If IsNothing(BTLStructureVM) Then Return
|
||||
|
||||
Dim BTLStructureVM As BTLStructureVM = TryCast(Me.Tag, BTLStructureVM)
|
||||
If IsNothing(BTLStructureVM) Then Return
|
||||
Dim BTLPartVM As BTLPartVM = BTLStructureVM.SelBTLPart
|
||||
Dim BTLFeatureVM As BTLFeatureVM = BTLPartVM?.SelBTLFeatureVM
|
||||
|
||||
Dim BTLPartVM As BTLPartVM = BTLStructureVM.SelBTLPart
|
||||
Dim BTLFeatureVM As BTLFeatureVM = BTLPartVM?.SelBTLFeatureVM
|
||||
|
||||
If bSelOnFeature AndAlso Not IsNothing(BTLFeatureVM) Then
|
||||
If Not IsNothing(BTLFeatureVM.DeleteFeature_Command) AndAlso BTLFeatureVM.DeleteFeature_Command.CanExecute(Nothing) Then
|
||||
BTLFeatureVM.DeleteFeature_Command.Execute(Nothing)
|
||||
If bSelOnFeature AndAlso Not IsNothing(BTLFeatureVM) Then
|
||||
BTLFeatureVM.DeleteFeature()
|
||||
e.Handled = True
|
||||
Return
|
||||
End If
|
||||
Return
|
||||
End If
|
||||
|
||||
If Not IsNothing(BTLStructureVM.DeletePart_Command) AndAlso BTLStructureVM.DeletePart_Command.CanExecute(Nothing) Then
|
||||
BTLStructureVM.DeletePart_Command.Execute(Nothing)
|
||||
BTLStructureVM.DeletePart()
|
||||
e.Handled = True
|
||||
End If
|
||||
End Sub
|
||||
|
||||
@@ -50,7 +50,7 @@
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="10"/>
|
||||
<ColumnDefinition Width="12"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Border Width="{Binding ActualHeight, RelativeSource={RelativeSource self}}"
|
||||
Background="{Binding Calc_Background}"/>
|
||||
@@ -60,12 +60,13 @@
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
<TextBlock Visibility="{Binding CALC_ROT_Visibility}"
|
||||
<TextBlock Text="⭯"
|
||||
Visibility="{Binding CALC_ROT_Visibility}"
|
||||
Style="{StaticResource CALC_ROT_TextBlock}"/>
|
||||
<TextBlock Grid.Row="1"
|
||||
Text="{Binding CALC_ERR_Letter}"
|
||||
Foreground="{Binding CALC_ERR_Foreground}"
|
||||
Style="{StaticResource FeatureInPartInRawPartList_TextBlock}"/>
|
||||
Style="{StaticResource CALC_ERR_TextBlock}"/>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</DataTemplate>
|
||||
|
||||
@@ -2,7 +2,8 @@
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:OPTIMIZER="clr-namespace:EgtBEAMWALL.Optimizer"
|
||||
xmlns:EgwWPFBaseLib="clr-namespace:EgwWPFBaseLib;assembly=EgwWPFBaseLib">
|
||||
xmlns:EgwWPFBaseLib="clr-namespace:EgwWPFBaseLib;assembly=EgwWPFBaseLib"
|
||||
PreviewKeyDown="Root_PreviewKeyDown">
|
||||
|
||||
<EgwWPFBaseLib:EgwDataGrid ItemsSource="{Binding Tag.MachGroupVMList,
|
||||
RelativeSource={RelativeSource AncestorType={x:Type OPTIMIZER:RawPartListV}}}"
|
||||
@@ -69,7 +70,8 @@
|
||||
Style="{StaticResource RawPartList_TextBlock}"/>
|
||||
<Border Grid.Column="1"
|
||||
Width="{Binding ActualHeight, RelativeSource={RelativeSource self}}"
|
||||
Background="{Binding Calc_Background}"/>
|
||||
Background="{Binding Calc_Background}"
|
||||
Style="{StaticResource Calc_Border}"/>
|
||||
<Grid Grid.Column="2"
|
||||
Style="{StaticResource FeatureInPartInRawPartList_Grid}">
|
||||
<Grid.RowDefinitions>
|
||||
@@ -78,11 +80,11 @@
|
||||
</Grid.RowDefinitions>
|
||||
<TextBlock Text="⭯"
|
||||
Visibility="{Binding CALC_ROT_Visibility}"
|
||||
Style="{StaticResource CALC_ROTRawPartList_TextBlock}"/>
|
||||
Style="{StaticResource CALC_ROT_TextBlock}"/>
|
||||
<TextBlock Grid.Row="1"
|
||||
Text="{Binding CALC_ERR_Letter}"
|
||||
Foreground="{Binding CALC_ERR_Foreground}"
|
||||
Style="{StaticResource FeatureInPartInRawPartList_TextBlock}"/>
|
||||
Style="{StaticResource CALC_ERR_TextBlock}"/>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</DataTemplate>
|
||||
@@ -343,11 +345,11 @@
|
||||
<TextBlock Grid.ColumnSpan="2"
|
||||
Text="⭯"
|
||||
Visibility="{Binding CALC_ROT_Visibility}"
|
||||
Style="{StaticResource CALC_ROTFeatureRawPartList_TextBlock}"/>
|
||||
Style="{StaticResource CALC_ROT_TextBlock}"/>
|
||||
<TextBlock Grid.Column="1"
|
||||
Text="{Binding CALC_ERR_Letter}"
|
||||
Foreground="{Binding CALC_ERR_Foreground}"
|
||||
Style="{StaticResource CALC_ERRRawPartList_TextBlock}"/>
|
||||
Style="{StaticResource CALC_ERR_TextBlock}"/>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</DataTemplate>
|
||||
|
||||
@@ -81,4 +81,23 @@ Public Class RawPartListV
|
||||
.Source = sender})
|
||||
End Sub
|
||||
|
||||
Private Sub Root_PreviewKeyDown(sender As Object, e As KeyEventArgs)
|
||||
If e.Key = Key.Delete Then
|
||||
Dim MyMachGroupPanelVM As MyMachGroupPanelVM = TryCast(Me.Tag, MyMachGroupPanelVM)
|
||||
If IsNothing(MyMachGroupPanelVM) Then Return
|
||||
|
||||
Dim SelectedMachGroup As MyMachGroupVM = MyMachGroupPanelVM.SelectedMachGroup
|
||||
Dim SelPart As PartVM = SelectedMachGroup?.SelPart
|
||||
|
||||
If MyMachGroupPanelVM.bSelOnPart AndAlso Not IsNothing(SelPart) Then
|
||||
SelPart.RemovePart()
|
||||
e.Handled = True
|
||||
Return
|
||||
End If
|
||||
|
||||
SelectedMachGroup.RemoveRawPartCmd()
|
||||
e.Handled = True
|
||||
End If
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
|
||||
@@ -7,6 +7,17 @@ Public Class MyMachGroupPanelVM
|
||||
|
||||
#Region "FIELDS & PROPERTIES"
|
||||
|
||||
Private m_bSelOnPart As Boolean = False
|
||||
Public ReadOnly Property bSelOnPart As Boolean
|
||||
Get
|
||||
Return m_bSelOnPart
|
||||
End Get
|
||||
End Property
|
||||
Friend Sub SetbSelOnPart(value As Boolean)
|
||||
m_bSelOnPart = value
|
||||
NotifyPropertyChanged(NameOf(bSelOnPart))
|
||||
End Sub
|
||||
|
||||
Public Shadows Property SelectedMachGroup As MyMachGroupVM
|
||||
Get
|
||||
Return m_SelectedMachGroup
|
||||
@@ -42,6 +53,7 @@ Public Class MyMachGroupPanelVM
|
||||
End If
|
||||
Map.refMyStatusBarVM.SetLoadingProgress(0)
|
||||
Map.refMyStatusBarVM.SetOutputMessage("")
|
||||
SetbSelOnPart(False)
|
||||
NotifyPropertyChanged(NameOf(SelectedMachGroup))
|
||||
End Set
|
||||
End Property
|
||||
|
||||
@@ -86,6 +86,7 @@ Public Class MyMachGroupVM
|
||||
Map.refProjectVM.SetManagerTabVisibility(True)
|
||||
If Not IsNothing(Map.refProjectVM.MachGroupPanelVM) Then Map.refProjectVM.SetFeatureListVisibility(True)
|
||||
End If
|
||||
Map.refMachGroupPanelVM.SetbSelOnPart(True)
|
||||
End Set
|
||||
End Property
|
||||
Friend Sub SetSelPart(value As Core.PartVM)
|
||||
@@ -1156,7 +1157,7 @@ Public Class MyMachGroupVM
|
||||
End Property
|
||||
|
||||
Public Sub RemoveRawPartCmd()
|
||||
If EgtBEAMWALL.Core.EgtMessageBoxV.Show(Application.Current.MainWindow, EgtMsg(62574) & Map.refProjectVM.MachGroupPanelVM.SelectedMachGroup.Name & " ?", EgtMsg(30009), MessageBoxButton.OKCancel, MessageBoxImage.Exclamation) = MessageBoxResult.OK Then
|
||||
If EgtBEAMWALL.Core.EgtMessageBoxV.Show(Application.Current.MainWindow, EgtMsg(62574) & " " & Map.refProjectVM.MachGroupPanelVM.SelectedMachGroup.Name & " ?", EgtMsg(30009), MessageBoxButton.OKCancel, MessageBoxImage.Exclamation) = MessageBoxResult.OK Then
|
||||
RemoveRawPart()
|
||||
Else
|
||||
Return
|
||||
|
||||
@@ -2619,6 +2619,11 @@
|
||||
|
||||
<!--#endregion TopPanel_Border-->
|
||||
|
||||
<Style x:Key="Calc_Border" TargetType="{x:Type Border}">
|
||||
<Setter Property="Height" Value="20"/>
|
||||
<Setter Property="Width" Value="20"/>
|
||||
</Style>
|
||||
|
||||
<!--#endregion Border-->
|
||||
|
||||
<!-- ______________________________________________________________________________________________________________________________________________ -->
|
||||
|
||||
@@ -997,17 +997,31 @@ Public Class LeftPanelVM
|
||||
' recupero file template
|
||||
Dim TemplateFilePath As String = ""
|
||||
GetMainPrivateProfileString(S_PRINTER, K_TEMPLATE, "", TemplateFilePath)
|
||||
' recupero file dati
|
||||
Dim FileName As String = DateTime.Now.ToString
|
||||
FileName = FileName.Replace("/"c, "_")
|
||||
FileName = FileName.Replace(":"c, "_")
|
||||
FileName = FileName.Replace(" "c, "&")
|
||||
Dim FileINI As String = Map.refMainWindowVM.MainWindowM.sTempDir & "\" & FileName & ".ini"
|
||||
' creo stringa argomenti
|
||||
Dim sArguments As String = ""
|
||||
Dim PrinterMode As Integer = GetMainPrivateProfileInt(S_PRINTER, K_PRINTERMODE, 0)
|
||||
If PrinterMode = 0 Then
|
||||
sArguments = TemplateFilePath & " " & FileINI
|
||||
ElseIf PrinterMode = 1 Then
|
||||
sArguments = "1 " & TemplateFilePath & " " & FileINI
|
||||
ElseIf PrinterMode = 2 Then
|
||||
Dim PrinterAddress As String = ""
|
||||
GetMainPrivateProfileString(S_PRINTER, K_NETWORKADDRESS, "", PrinterAddress)
|
||||
sArguments = "2 " & PrinterAddress & " " & TemplateFilePath & " " & FileINI
|
||||
End If
|
||||
|
||||
' creo file dati
|
||||
CreateDataFile(FileINI, SelPart, SelMachGroup)
|
||||
|
||||
Dim Proc = New Process()
|
||||
Proc.StartInfo.FileName = Map.refMainWindowVM.MainWindowM.sZebraPrinterExe
|
||||
Proc.StartInfo.Arguments = TemplateFilePath & " " & FileINI
|
||||
Proc.StartInfo.Arguments = sArguments
|
||||
Proc.StartInfo.CreateNoWindow = True
|
||||
Proc.StartInfo.UseShellExecute = False
|
||||
AddHandler Proc.Exited, AddressOf Proc_Exited
|
||||
|
||||
Reference in New Issue
Block a user