Compare commits

..

3 Commits

Author SHA1 Message Date
Emmanuele Sassi 9233d3f6f2 - apertura file pdf come risorsa di progetto 2023-02-17 13:05:24 +01:00
Emmanuele Sassi 58febf7d4b - primi test implementazione manuale come risorsa e apertura 2023-01-30 16:37:17 +01:00
Emmanuele Sassi 725cb6e3cc - Aperta finestra con webviewer da path completa 2023-01-27 18:18:37 +01:00
1426 changed files with 118338 additions and 14819 deletions
+31 -60
View File
@@ -1,81 +1,52 @@
<Window x:Class="AboutBoxV" <Window x:Class="AboutBoxV"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="AboutBox" Title="AboutBox" Height="400" Width="360" WindowStyle="None" ResizeMode="NoResize"
Height="486" ShowInTaskbar="False" WindowStartupLocation="CenterOwner">
Width="735"
WindowStyle="None"
ResizeMode="NoResize"
AllowsTransparency="True"
Background="Transparent"
ShowInTaskbar="False"
WindowStartupLocation="CenterOwner">
<Border Style="{StaticResource WhiteBottomBlueRow_Border}"> <Border BorderThickness="2" BorderBrush="LightBlue">
<Grid > <Grid >
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
<ColumnDefinition Width="0.5*"/> <ColumnDefinition Width="0.5*"/>
<ColumnDefinition Width="Auto"/> <ColumnDefinition Width="5*"/>
<ColumnDefinition Width="0.5*"/>
<ColumnDefinition Width="2*"/>
<ColumnDefinition Width="0.5*"/> <ColumnDefinition Width="0.5*"/>
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<Grid.RowDefinitions> <Grid.RowDefinitions>
<RowDefinition Height="0.5*"/> <RowDefinition Height="0.5*"/>
<RowDefinition Height="Auto"/> <RowDefinition Height="1*"/>
<RowDefinition Height="0.25*"/>
<RowDefinition Height="0.5*"/> <RowDefinition Height="0.5*"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="0.5*"/> <RowDefinition Height="0.5*"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="0.5*"/> <RowDefinition Height="0.5*"/>
<RowDefinition Height="Auto"/> <RowDefinition Height="2.5*"/>
<RowDefinition Height="0.35*"/>
<RowDefinition Height="0.5*"/>
<RowDefinition Height="0.35*"/>
</Grid.RowDefinitions> </Grid.RowDefinitions>
<Grid Grid.Column="3" Grid.Row="1"> <Grid Grid.Column="1" Grid.Row="1">
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/> <ColumnDefinition Width="1*"/>
<ColumnDefinition Width="50"/> <ColumnDefinition Width="3*"/>
<ColumnDefinition Width="1*"/> <ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<Grid.RowDefinitions> <Border Name="LogoBrd" Grid.Column="1" Background="White">
<RowDefinition Height="0.5*"/> <Image Source="/Resources/AboutBoxImage.png" Stretch="Uniform"/>
<RowDefinition Height="0.5*"/> </Border>
</Grid.RowDefinitions>
<Image Grid.RowSpan="2"
Source="/Resources/AboutBox/IcarusLogo.png"
Height="65"
Style="{StaticResource Button_Image}"/>
<TextBlock Grid.Column="2"
Name="DescriptionLbl"
VerticalAlignment="Bottom"
Style="{StaticResource Version_AboutBox_TextBlock}"/>
<TextBlock Grid.Column="2"
Grid.Row="1"
Name="VersionLbl"
VerticalAlignment="Top"
Style="{StaticResource Version_AboutBox_TextBlock}"/>
</Grid> </Grid>
<Image Grid.Column="1" <TextBlock Name="DescriptionLbl" Grid.Column="1" Grid.Row="3" HorizontalAlignment="Center"
Grid.Row="3" VerticalAlignment="Center" FontSize="18" />
Source="/Resources/AboutBox/EgalwareLogo.png" <TextBlock Name="VersionLbl" Grid.Column="1" Grid.Row="4" HorizontalAlignment="Center"
Height="190" VerticalAlignment="Center" FontSize="18"/>
Style="{StaticResource Button_Image}"/> <TextBlock Name="CopyrightLbl" Grid.Column="1" Grid.Row="5" HorizontalAlignment="Center"
<TextBox Name="InfoLbl" VerticalAlignment="Center" FontSize="12" />
Grid.Column="3" <TextBox Name="InfoLbl" Grid.Column="1" Grid.Row="6" HorizontalAlignment="Stretch"
Grid.Row="3" VerticalAlignment="Stretch" FontSize="12" IsReadOnly="True" TextWrapping="Wrap"/>
Style="{StaticResource AboutBox_TextBox}"/> <Button Name="ExitBtn" Grid.Column="1" Grid.Row="8" IsCancel="True"
<TextBlock Name="CopyrightLbl" Margin="100,0"/>
Grid.Column="3"
Grid.Row="5"
Style="{StaticResource Copyright_AboutBox_TextBlock}"/>
<Button Grid.Column="3"
Grid.Row="7"
IsCancel="True"
HorizontalAlignment="Right"
Style="{StaticResource RightPanel_HalfRound_Button}">
<Image Source="\Resources\Common\Ok.png"
Style="{StaticResource Button_Image}"/>
</Button>
</Grid> </Grid>
</Border> </Border>
</Window> </Window>
+8 -7
View File
@@ -16,29 +16,30 @@ Public Class AboutBoxV
Dim sKlev As String = Map.refMainWindowVM.MainWindowM.nKeyLevel.ToString() Dim sKlev As String = Map.refMainWindowVM.MainWindowM.nKeyLevel.ToString()
Dim sOpts As String = Map.refMainWindowVM.MainWindowM.nKeyOptions.ToString() Dim sOpts As String = Map.refMainWindowVM.MainWindowM.nKeyOptions.ToString()
Dim sLeftDays As String = "" Dim sLeftDays As String = ""
Dim nLeftDays As Integer Dim nLeftDays As Integer
If EgtGetKeyLeftDays(nLeftDays) AndAlso nLeftDays < 500 Then sLeftDays = " (" & nLeftDays.ToString() & ")" if EgtGetKeyLeftDays( nLeftDays) AndAlso nLeftDays < 500 Then sLeftDays= " (" & nLeftDays.ToString() & ")"
sInfo = If(EgtIsDebug(), "*** Debug Libraries ***" & Environment.NewLine, "") sInfo = If( EgtIsDebug(), "*** Debug Libraries ***" & Environment.NewLine, "")
sInfo &= "User " & Environment.MachineName & "\" & Environment.UserName & sInfo &= "User " & Environment.MachineName & "\" & Environment.UserName &
" Inst" & Map.refMainWindowVM.MainWindowM.nInstance.ToString() & " Inst" & Map.refMainWindowVM.MainWindowM.nInstance.ToString() &
" Ulv" & Map.refMainWindowVM.MainWindowM.nUserLevel.ToString() & " Ulv" & Map.refMainWindowVM.MainWindowM.nUserLevel.ToString() &
" Dbg" & Map.refMainWindowVM.MainWindowM.DebugLevel().ToString() & Environment.NewLine " Dbg" & Map.refMainWindowVM.MainWindowM.DebugLevel().ToString() & Environment.NewLine
sInfo &= sKey & " - " & sKlev & " - " & sOpts & sLeftDays & Environment.NewLine sInfo &= sKey & " - " & sKlev & " - " & sOpts & sLeftDays & Environment.NewLine
sInfo &= "DataRoot " & Map.refMainWindowVM.MainWindowM.sDataRoot & Environment.NewLine sInfo &= "DataRoot " & Map.refMainWindowVM.MainWindowM.sDataRoot & Environment.NewLine
sInfo &= "MachinesRoot " & Map.refMainWindowVM.MainWindowM.sMachinesRoot & Environment.NewLine sInfo &= "MachinesRoot " & Map.refMainWindowVM.MainWindowM.sMachinesRoot & Environment.NewLine
Dim sOpSys As String = String.Empty Dim sOpSys As String = String.Empty
EgtGetOsInfo(sOpSys) EgtGetOsInfo( sOpSys)
sInfo &= sOpSys & Environment.NewLine sInfo &= sOpSys & Environment.NewLine
Dim sCPU As String = String.Empty Dim sCPU As String = String.Empty
EgtGetCpuInfo(sCPU) EgtGetCpuInfo( sCPU)
sInfo &= sCPU & Environment.NewLine sInfo &= sCPU & Environment.NewLine
Dim sMem As String = String.Empty Dim sMem As String = String.Empty
EgtGetMemoryInfo(sMem) EgtGetMemoryInfo( sMem)
sInfo &= sMem & Environment.NewLine sInfo &= sMem & Environment.NewLine
Dim sScene As String = String.Empty Dim sScene As String = String.Empty
EgtGetSceneInfo(sScene) EgtGetSceneInfo(sScene)
sInfo &= sScene sInfo &= sScene
InfoLbl.Text = sInfo InfoLbl.Text = sInfo
ExitBtn.Content = EgtMsg(MSG_MISSINGKEYWD + 4) 'Ok
End Sub End Sub
End Class End Class
@@ -1,165 +0,0 @@
Imports System.Globalization
Imports System.Windows.Forms.VisualStyles.VisualStyleElement.TextBox
Imports System.Windows.Media.Media3D
Public Module TreeViewItemHelper
' Gestione MouseOver come in ListBox
Private CurrentItem As TreeViewItem
Private ReadOnly UpdateOverItemEvent As RoutedEvent = EventManager.RegisterRoutedEvent("UpdateOverItem", RoutingStrategy.Bubble, GetType(RoutedEventHandler), GetType(TreeViewItemHelper))
Private ReadOnly IsMouseDirectlyOverItemKey As DependencyPropertyKey = DependencyProperty.RegisterAttachedReadOnly("IsMouseDirectlyOverItem", GetType(Boolean), GetType(TreeViewItemHelper), New FrameworkPropertyMetadata(Nothing, New CoerceValueCallback(AddressOf CalculateIsMouseDirectlyOverItem)))
Public ReadOnly IsMouseDirectlyOverItemProperty As DependencyProperty = IsMouseDirectlyOverItemKey.DependencyProperty
Sub New()
EventManager.RegisterClassHandler(GetType(TreeViewItem), UIElement.MouseEnterEvent, New MouseEventHandler(AddressOf OnMouseTransition), True)
EventManager.RegisterClassHandler(GetType(TreeViewItem), UIElement.MouseLeaveEvent, New MouseEventHandler(AddressOf OnMouseTransition), True)
EventManager.RegisterClassHandler(GetType(TreeViewItem), UpdateOverItemEvent, New RoutedEventHandler(AddressOf OnUpdateOverItem))
End Sub
Function GetIsMouseDirectlyOverItem(ByVal obj As DependencyObject) As Boolean
Return CBool(obj.GetValue(IsMouseDirectlyOverItemProperty))
End Function
Private Function CalculateIsMouseDirectlyOverItem(ByVal item As DependencyObject, ByVal value As Object) As Object
Return item Is CurrentItem
End Function
Private Sub OnUpdateOverItem(ByVal sender As Object, ByVal e As RoutedEventArgs)
CurrentItem = TryCast(sender, TreeViewItem)
CurrentItem.InvalidateProperty(IsMouseDirectlyOverItemProperty)
e.Handled = True
End Sub
Private Sub OnMouseTransition(ByVal sender As Object, ByVal e As MouseEventArgs)
SyncLock IsMouseDirectlyOverItemProperty
If Not IsNothing(CurrentItem) Then
Dim oldItem As DependencyObject = CurrentItem
CurrentItem = Nothing
oldItem.InvalidateProperty(IsMouseDirectlyOverItemProperty)
End If
Mouse.DirectlyOver?.RaiseEvent(New RoutedEventArgs(UpdateOverItemEvent))
End SyncLock
End Sub
' Gestione click destro del mouse che seleziona l'elemento
Public ReadOnly SelectItemOnRightClickProperty As DependencyProperty = DependencyProperty.RegisterAttached("SelectItemOnRightClick", GetType(Boolean), GetType(TreeViewItemHelper), New UIPropertyMetadata(False, AddressOf OnSelectItemOnRightClickChanged))
Public Function GetSelectItemOnRightClick(ByVal d As DependencyObject) As Boolean
Return CBool(d.GetValue(SelectItemOnRightClickProperty))
End Function
Public Sub SetSelectItemOnRightClick(ByVal d As DependencyObject, ByVal value As Boolean)
d.SetValue(SelectItemOnRightClickProperty, value)
End Sub
Private Sub OnSelectItemOnRightClickChanged(ByVal d As DependencyObject, ByVal e As DependencyPropertyChangedEventArgs)
Dim selectItemOnRightClick As Boolean = CBool(e.NewValue)
Dim treeView As TreeView = TryCast(d, TreeView)
If treeView IsNot Nothing Then
If selectItemOnRightClick Then
AddHandler treeView.PreviewMouseRightButtonDown, AddressOf OnPreviewMouseRightButtonDown
Else
RemoveHandler treeView.PreviewMouseRightButtonDown, AddressOf OnPreviewMouseRightButtonDown
End If
End If
End Sub
Private Sub OnPreviewMouseRightButtonDown(ByVal sender As Object, ByVal e As MouseButtonEventArgs)
Dim treeViewItem As TreeViewItem = VisualUpwardSearch(Of TreeViewItem)(TryCast(e.OriginalSource, DependencyObject))
If treeViewItem IsNot Nothing Then
treeViewItem.IsSelected = True
Dim Tree As TreeView = VisualUpwardSearch(Of TreeView)(TryCast(treeViewItem, DependencyObject))
If Not IsNothing(Tree) Then
Dim myTransform As GeneralTransform = treeViewItem.TransformToAncestor(Tree)
Dim myOffset As Point = myTransform.Transform(New Point(0, 0))
treeViewItem.ContextMenu.HorizontalOffset = -treeViewItem.ActualWidth + (-myOffset.X) + Tree.ActualWidth - 3
treeViewItem.ContextMenu.VerticalOffset = -3
End If
e.Handled = True
End If
End Sub
Private Function VisualUpwardSearch(Of T As DependencyObject)(ByVal source As DependencyObject) As T
Dim returnVal As DependencyObject = source
While returnVal IsNot Nothing AndAlso Not (TypeOf returnVal Is T)
Dim tempReturnVal As DependencyObject = Nothing
If TypeOf returnVal Is Visual OrElse TypeOf returnVal Is Visual3D Then
tempReturnVal = VisualTreeHelper.GetParent(returnVal)
End If
If tempReturnVal Is Nothing Then
returnVal = LogicalTreeHelper.GetParent(returnVal)
Else
returnVal = tempReturnVal
End If
End While
Return TryCast(returnVal, T)
End Function
' Gestione indentazione sottoelementi
Public Function GetDepth(item As TreeViewItem) As Integer
Dim parent As TreeViewItem = GetParent(item)
If Not IsNothing(parent) Then Return GetDepth(parent) + 1
Return 0
End Function
Private Function GetParent(item As TreeViewItem) As TreeViewItem
Dim parent As DependencyObject = If(Not IsNothing(item), VisualTreeHelper.GetParent(item), Nothing)
While Not IsNothing(parent) AndAlso Not (TypeOf parent Is TreeViewItem OrElse TypeOf parent Is TreeView)
parent = VisualTreeHelper.GetParent(parent)
End While
Return TryCast(parent, TreeViewItem)
End Function
Private Function GetTreeParent(item As TreeViewItem) As TreeViewItem
Dim parent As DependencyObject = If(Not IsNothing(item), VisualTreeHelper.GetParent(item), Nothing)
While Not IsNothing(parent) AndAlso Not (TypeOf parent Is TreeViewItem OrElse TypeOf parent Is TreeView)
parent = VisualTreeHelper.GetParent(parent)
End While
Return TryCast(parent, TreeViewItem)
End Function
' Gestione indentazione sottoelementi
Public Function GetHeight(Item As TreeViewItem, SearchedItem As TreeViewItem, ByRef nHeight As Integer) As Boolean
Dim Index As Integer = 0
While Index <= Item.Items.Count - 1
If GetHeight(Item.Items(Index), SearchedItem, nHeight) Then
nHeight += 1
Return True
End If
Index += 1
End While
Return False
End Function
End Module
Public Class LeftMarginMultiplierConverter
Implements IValueConverter
Public Property Length As Double
Public Function Convert(ByVal value As Object, ByVal targetType As Type, ByVal parameter As Object, ByVal culture As CultureInfo) As Object Implements IValueConverter.Convert
Dim item As TreeViewItem = TryCast(value, TreeViewItem)
If item Is Nothing Then Return New Thickness(0)
Return New Thickness(Length * GetDepth(item), 0, 0, 0)
End Function
Public Function ConvertBack(ByVal value As Object, ByVal targetType As Type, ByVal parameter As Object, ByVal culture As CultureInfo) As Object Implements IValueConverter.ConvertBack
Throw New System.NotImplementedException()
End Function
End Class
+68 -47
View File
@@ -1,50 +1,71 @@
<EgtWPFLib5:EgtMainWindow x:Class="ChooseMachineWndV" <EgtWPFLib5:EgtCustomWindow x:Class="ChooseMachineWndV"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:EgtWPFLib5="clr-namespace:EgtWPFLib5;assembly=EgtWPFLib5" xmlns:EgtWPFLib5="clr-namespace:EgtWPFLib5;assembly=EgtWPFLib5"
xmlns:Icarus="clr-namespace:Icarus" xmlns:Icarus="clr-namespace:Icarus"
Title="New Project" Style="{DynamicResource {x:Type EgtWPFLib5:EgtCustomWindow}}"
SizeToContent="WidthAndHeight" WindowStyle="None" ResizeMode="NoResize"
WindowStartupLocation="CenterOwner" SizeToContent="WidthAndHeight"
Style="{StaticResource Dialog_Window}"> MinWidth="500"
<Grid Margin="2.5,2.5,2.5,0"> WindowStartupLocation="CenterOwner"
<Grid.RowDefinitions> IsClosable="False"
<RowDefinition Height="Auto"/> IsMinimizable="False"
<RowDefinition Height="Auto"/> IsResizable="False"
<RowDefinition Height="Auto"/> Title="ProjectType">
</Grid.RowDefinitions> <StackPanel Margin="5,5,5,0">
<Border Grid.Row="1"
BorderThickness="1"
BorderBrush="DarkGray"
Background="White"
Margin="5">
<Grid Margin="5">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<TextBlock Text="{Binding ChooseMachine_Msg}" <Grid HorizontalAlignment="Center"
Margin="20,20,20,2.5" Grid.Row="0"
Style="{StaticResource DialogWindow_TextBlock}"/> Margin="15">
<ComboBox Grid.Row="1" <Grid.RowDefinitions>
ItemsSource="{Binding MachineList}" <RowDefinition Height="Auto"/>
SelectedItem="{Binding SelMachine}" <RowDefinition Height="1*"/>
DisplayMemberPath="Name" <RowDefinition Height="Auto"/>
SelectedValuePath="Name" </Grid.RowDefinitions>
Width="160" <Grid.ColumnDefinitions>
HorizontalAlignment="Center" <ColumnDefinition Width="Auto"/>
HorizontalContentAlignment="Center" </Grid.ColumnDefinitions>
Margin="2.5,10,2.5,2.5" <TextBlock Text="{Binding ChooseMachine_Msg}"
Style="{StaticResource RightPanel_ComboBox}"/> Style="{StaticResource OptionTextBlock}"
Grid.Row="0" Grid.ColumnSpan="2"/>
<Rectangle Height="22" Grid.Row="1"/>
<ComboBox ItemsSource="{Binding MachineList}" DisplayMemberPath="Name"
SelectedItem="{Binding SelMachine}" SelectedValuePath="Name"
Grid.Row="2"
Style="{StaticResource BtlData_ComboBox}"/>
</Grid>
<UniformGrid Grid.Row="2" <Grid Grid.Row="2" Margin="5">
Rows="1" <Grid.ColumnDefinitions>
Margin="0,20,0,0"> <ColumnDefinition Width="1*"/>
<Button Command="{Binding Ok_Command}" <ColumnDefinition Width="Auto"/>
IsDefault="True" <ColumnDefinition Width="1*"/>
Margin="0,0,2.5,0" <ColumnDefinition Width="Auto"/>
Style="{StaticResource RightPanel_HalfRound_Button}"> <ColumnDefinition Width="1*"/>
<Image Source="\Resources\Common\Ok.png" </Grid.ColumnDefinitions>
Style="{StaticResource Button_Image}"/> <Button Content="Ok"
</Button> Command="{Binding Ok_Command}"
<Button IsCancel="True" IsDefault="True"
Margin="0,0,2.5,0" Grid.Column="1"
Style="{StaticResource RightPanel_HalfRound_Button}"> Style="{StaticResource EgtWPFLib5_InputButton}"/>
<Image Source="\Resources\Common\Cancel.png" <Button Content="Cancel"
Style="{StaticResource Button_Image}"/> IsCancel="True"
</Button> Grid.Column="3"
</UniformGrid> Style="{StaticResource EgtWPFLib5_InputButton}"/>
</Grid>
</Grid> </Grid>
</EgtWPFLib5:EgtMainWindow> </Border>
</StackPanel>
</EgtWPFLib5:EgtCustomWindow>
@@ -40,7 +40,7 @@ Public Class ChooseMachineWndVM
Public ReadOnly Property ChooseMachine_Msg As String Public ReadOnly Property ChooseMachine_Msg As String
Get Get
Return "Select the new project machine from the list" Return "Macchina: "
End Get End Get
End Property End Property
@@ -66,8 +66,7 @@ Public Class ChooseMachineWndVM
RaiseEvent m_CloseWindow(True) RaiseEvent m_CloseWindow(True)
Else Else
' se non seleziono nessuna macchina lo segnalo con un MessageBox ' se non seleziono nessuna macchina lo segnalo con un MessageBox
' MessageBox.Show("No machine selected", "Error", MessageBoxButton.OK, MessageBoxImage.Error) MessageBox.Show("No machine selected", "Error", MessageBoxButton.OK, MessageBoxImage.Error)
EgtMessageBoxV.Show(Application.Current.MainWindow, "No machine selected", "Error", MessageBoxButton.OK, MessageBoxImage.Error)
End If End If
End Sub End Sub
-17
View File
@@ -2,11 +2,9 @@
Public Const TABLE = "Table" Public Const TABLE = "Table"
Public Const TABLE_OUTLINE = "TableOutline" Public Const TABLE_OUTLINE = "TableOutline"
Public Const EXTRUSION_AREA = "ExtrusionArea"
Public Const PART = "Part" Public Const PART = "Part"
Public Const PRINT_SOLID = "PrintSolid" Public Const PRINT_SOLID = "PrintSolid"
Public Const LAY_MACH_START = "MachStart" Public Const LAY_MACH_START = "MachStart"
Public Const LAY_PARTREFERENCE = "PartFrame"
Public Const LAY_REFERENCE = "Frame" Public Const LAY_REFERENCE = "Frame"
Public Const LAY_OTHERS = "Aux" Public Const LAY_OTHERS = "Aux"
Public Const LAY_RIBS = "Ribs" Public Const LAY_RIBS = "Ribs"
@@ -17,8 +15,6 @@
Public Const RIB_EXTRUSION = "RibExtrusion" Public Const RIB_EXTRUSION = "RibExtrusion"
Public Const RIB_CURVE = "RibCurve" Public Const RIB_CURVE = "RibCurve"
Public Const RIB_ID = "RibId" Public Const RIB_ID = "RibId"
Public Const SHELLNUMBER_ID = "ShellNumberId"
Public Const FILLEDSOLID_ID = "FilledSolidId"
Public Const VIEWPARAMS = "ViewParams" Public Const VIEWPARAMS = "ViewParams"
Public Const IMPORTED_SOLID = "ImportedSolid" Public Const IMPORTED_SOLID = "ImportedSolid"
Public Const RESULT_READ_PROG = "ResultReadProg" Public Const RESULT_READ_PROG = "ResultReadProg"
@@ -105,16 +101,12 @@
Public Const MAC_G0FEED = "G0Feed" Public Const MAC_G0FEED = "G0Feed"
Public Const MAC_G0FEEDZ = "G0FeedZ" Public Const MAC_G0FEEDZ = "G0FeedZ"
Public Const MAC_TOOLDIAM = "ToolDiam" Public Const MAC_TOOLDIAM = "ToolDiam"
Public Const MAC_PREFLOWDELAY = "PreFlowDelay"
Public Const MAC_POSTFLOWDELAY = "PostFlowDelay"
Public Const MAC_SCREWBACK = "ScrewBack"
Public Const MAC_RIBSTYPE = "RibsType" Public Const MAC_RIBSTYPE = "RibsType"
Public Const MAC_RIBSOVERLAP = "RibsOverlap" Public Const MAC_RIBSOVERLAP = "RibsOverlap"
Public Const MAC_RIBSSTRANDCOUNT = "RibsStrandCount" Public Const MAC_RIBSSTRANDCOUNT = "RibsStrandCount"
Public Const MAC_RIBSLINK = "RibsLink" Public Const MAC_RIBSLINK = "RibsLink"
Public Const MAC_RIBSINVERTORDER = "RibsInvertOrder" Public Const MAC_RIBSINVERTORDER = "RibsInvertOrder"
Public Const MAC_RIBSINVERTDIRECTION = "RibsInvertDirection" Public Const MAC_RIBSINVERTDIRECTION = "RibsInvertDirection"
Public Const MAC_RIBSINVERTSTRANDORDER = "RibsInvertStrandOrder"
Public Const MAC_RIBSLEADININVERT = "RibsLeadInInvert" Public Const MAC_RIBSLEADININVERT = "RibsLeadInInvert"
Public Const MAC_RIBSLEADINLEN = "RibsLeadInLen" Public Const MAC_RIBSLEADINLEN = "RibsLeadInLen"
Public Const MAC_RIBSLEADOUTINVERT = "RibsLeadOutInvert" Public Const MAC_RIBSLEADOUTINVERT = "RibsLeadOutInvert"
@@ -122,7 +114,6 @@
Public Const MAC_RIBSLEADOUTCOASTING = "RibsLeadOutCoasting" Public Const MAC_RIBSLEADOUTCOASTING = "RibsLeadOutCoasting"
Public Const MAC_RIBSLEADOUTWIPE = "RibsLeadOutWipe" Public Const MAC_RIBSLEADOUTWIPE = "RibsLeadOutWipe"
Public Const MAC_RIBSLEADOUTWIPEDIR = "RibsLeadOutWipeDir" Public Const MAC_RIBSLEADOUTWIPEDIR = "RibsLeadOutWipeDir"
Public Const MAC_RIBSLIMITUNBOUNDEDWITHSOLID = "LimitUnboundedRibsWithSolid"
Public Const MAC_SHELLNBRDIFFERENCE = "ShellNbrDifference" Public Const MAC_SHELLNBRDIFFERENCE = "ShellNbrDifference"
Public Const MAC_SHELLNBRCOASTING = "ShellNbrCoasting" Public Const MAC_SHELLNBRCOASTING = "ShellNbrCoasting"
Public Const MAC_SHELLNBRWIPE = "ShellNbrWipe" Public Const MAC_SHELLNBRWIPE = "ShellNbrWipe"
@@ -162,19 +153,11 @@
' materiale in progetto ' materiale in progetto
Public Const KEY_MATERIAL_GUID = "MaterialGuid" Public Const KEY_MATERIAL_GUID = "MaterialGuid"
Public Const KEY_MATERIAL_NAME = "MaterialName" Public Const KEY_MATERIAL_NAME = "MaterialName"
' nome file cn in progetto ' nome file cn in progetto
Public Const KEY_ISOFILE_PATH = "IsoFilePath" Public Const KEY_ISOFILE_PATH = "IsoFilePath"
' info di spostamento pezzo per 45 gradi
Public Const KEY_MOVEDPART = "MovedPart"
Public Const KEY_MOVEDPART2 = "MovedPart2"
Public Const FILE_PATH = "FilePath" Public Const FILE_PATH = "FilePath"
Public Const PART_NAME = "PartName" Public Const PART_NAME = "PartName"
Public Const ENTITY_NAME = "EntityName" Public Const ENTITY_NAME = "EntityName"
' stringa che identifica il materiale come originale del costruttore
Public Const ORIG_MATERIAL As String = "***"
End Module End Module
-1
View File
@@ -105,7 +105,6 @@ Public Module ConstIni
'Public Const S_SIMUL As String = "Simul" 'Public Const S_SIMUL As String = "Simul"
'Public Const K_SLIDERX As String = "SliderX" 'Public Const K_SLIDERX As String = "SliderX"
'Public Const K_SLIDERVAL As String = "SliderVal" 'Public Const K_SLIDERVAL As String = "SliderVal"
Public Const K_MACHVIEWMODE As String = "MachViewMode"
Public Const S_PRINTING3D As String = "3dPrinting" Public Const S_PRINTING3D As String = "3dPrinting"
Public Const K_3PRNBASEDIR As String = "BaseDir" Public Const K_3PRNBASEDIR As String = "BaseDir"
-35
View File
@@ -1,35 +0,0 @@
'----------------------------------------------------------------------------
' EgalTech 2015-2015
'----------------------------------------------------------------------------
' File : ConstIni.vb Data : 12.02.15 Versione : 1.6b3
' Contenuto : Modulo costanti sezione e chiavi per file Ini.
'
'
'
' Modifiche : 12.02.15 DS Creazione modulo.
'
'
'----------------------------------------------------------------------------
Public Module ConstMachDataIni
Public Const MACHDATA_INI_FILE_NAME As String = "Data.ini"
Public Const S_TABLE As String = "Table"
Public Const K_DIMX As String = "DimX"
Public Const K_DIMY As String = "DimY"
Public Const K_POSX As String = "PosX"
Public Const K_POSY As String = "PosY"
Public Const K_POSZ As String = "PosZ"
Public Const S_VERTICAL As String = "Vertical"
Public Const S_45DEGX As String = "45DegX"
Public Const S_45DEGY As String = "45DegY"
Public Const S_HORIZONTAL As String = "Horizontal"
Public Const K_MINX As String = "MinX"
Public Const K_MAXX As String = "MaxX"
Public Const K_MINY As String = "MinY"
Public Const K_MAXY As String = "MaxY"
End Module
+25 -2
View File
@@ -1,6 +1,31 @@
Public Module ConstMachIni Public Module ConstMachIni
Public Const MACH_INI_FILE_NAME As String = "MachData.ini" Public Const MACH_INI_FILE_NAME As String = "MachData.ini"
Public Const GETWALLDATA_FILE_NAME As String = "GetWallData.lua"
Public Const GETTS3DATA_FILE_NAME As String = "GetTs3Data.lua"
Public Const K_NCTYPE As String = "NCType"
Public Const K_CONNECTIONSTRING As String = "ConnectionString"
Public Const S_CHANNELS As String = "Channels"
Public Const S_PARTPROGRAM As String = "PartProgram"
Public Const S_EXTENSION As String = "Extension"
' Variables della macchina corrente
Public Const S_MAINVARIABLES As String = "MainVariables"
Public Const S_VARIABLES As String = "Variables"
Public Const S_INPUTVARIABLES As String = "InputVariables"
Public Const S_OUTPUTVARIABLES As String = "OutputVariables"
Public Const S_MDI As String = "MDI"
Public Const K_BEAM As String = "Beam"
Public Const K_WALL As String = "Wall"
Public Const K_SCRIPT As String = "Scripts"
Public Const K_SETUP As String = "Setup"
Public Const K_FLOW As String = "Flow"
Public Const TS3DATA_FILE As String = "Ts3Data.lua"
Public Const S_MACHINING As String = "Machining" Public Const S_MACHINING As String = "Machining"
Public Const K_MACH_INITSCRIPT As String = "InitScript" Public Const K_MACH_INITSCRIPT As String = "InitScript"
@@ -11,6 +36,4 @@
Public Const K_SPEED_MIN As String = "SpeedMin" Public Const K_SPEED_MIN As String = "SpeedMin"
Public Const K_SPEED_MAX As String = "SpeedMax" Public Const K_SPEED_MAX As String = "SpeedMax"
Public Const S_MINMAX As String = "MinMax"
End Module End Module
@@ -1,16 +1,10 @@
<Border x:Class="ControllerInputPanelV" <UserControl x:Class="ControllerInputPanelV"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:EgtWPFLib5="clr-namespace:EgtWPFLib5;assembly=EgtWPFLib5" xmlns:EgtWPFLib5="clr-namespace:EgtWPFLib5;assembly=EgtWPFLib5"
Height="38" Height="32">
Visibility="{Binding Message_Visibility}"
HorizontalAlignment="Left"
Margin="45,0,0,0"
Padding="0"
Style="{StaticResource ViewLayerManager_Border}">
<StackPanel Orientation="Horizontal" <StackPanel Orientation="Horizontal">
Margin="2.5">
<StackPanel.Style> <StackPanel.Style>
<Style TargetType="{x:Type StackPanel}"> <Style TargetType="{x:Type StackPanel}">
<Style.Triggers> <Style.Triggers>
@@ -22,46 +16,31 @@
</StackPanel.Style> </StackPanel.Style>
<TextBlock Text="{Binding Message}" <TextBlock Text="{Binding Message}"
Visibility="{Binding Message_Visibility}" Visibility="{Binding Message_Visibility}"
Margin="2.5,0,2.5,0" Style="{StaticResource OptionTextBlock}"/>
Style="{StaticResource ControllerInput_TextBlock}"/>
<TextBox Text="{Binding Text, UpdateSourceTrigger=PropertyChanged}" <TextBox Text="{Binding Text, UpdateSourceTrigger=PropertyChanged}"
Width="150" Width="200"
Visibility="{Binding Text_Visibility}" Visibility="{Binding Text_Visibility}" Margin="5,0,5,0"
Margin="2.5,0,2.5,0"
Style="{StaticResource ControllerInputPanel_TextBox}"> Style="{StaticResource ControllerInputPanel_TextBox}">
<TextBox.InputBindings> <TextBox.InputBindings>
<KeyBinding Key="Enter" Command="{Binding Done_Command, UpdateSourceTrigger=PropertyChanged}"/> <KeyBinding Key="Enter" Command="{Binding Done_Command, UpdateSourceTrigger=PropertyChanged}"/>
<KeyBinding Key="S" Modifiers="Control" Command="{Binding Show_Command}"/> <KeyBinding Key="S" Modifiers="Control" Command="{Binding Show_Command}"/>
</TextBox.InputBindings> </TextBox.InputBindings>
</TextBox> </TextBox>
<CheckBox Content="{Binding CheckBoxText}" <CheckBox Content="{Binding CheckBoxText}" IsChecked="{Binding IsChecked}"
IsChecked="{Binding IsChecked}" Visibility="{Binding Check_Visibility}" Margin="5,0,5,0"
Visibility="{Binding Check_Visibility}"
Margin="2.5,0,2.5,0"
VerticalAlignment="Center"/> VerticalAlignment="Center"/>
<ComboBox ItemsSource="{Binding ComboItemsList}" <ComboBox ItemsSource="{Binding ComboItemsList}" SelectedIndex="{Binding ComboSelectedIndex}"
SelectedIndex="{Binding ComboSelectedIndex}" Visibility="{Binding Combo_Visibility}" Margin="5,0,5,0"/>
Visibility="{Binding Combo_Visibility}" <Grid Margin="5,0,5,0">
Margin="2.5,0,2.5,0"/>
<Grid>
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/> <ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/> <ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<Button Command="{Binding Show_Command}" <Button Command="{Binding Show_Command}" Visibility="{Binding ShowBtn_Visibility}"
Visibility="{Binding ShowBtn_Visibility}" Content="{Binding ShowMsg}" Style="{StaticResource EgtWPFLib5_InputButton}"/>
Content="{Binding ShowMsg}" <Button Command="{Binding Done_Command}" Visibility="{Binding DoneBtn_Visibility}"
Margin="2.5,0,2.5,0" Grid.Column="1"
Style="{StaticResource RightPanel_Button}"/> Content="{Binding OkMsg}" Style="{StaticResource EgtWPFLib5_InputButton}"/>
<Button Grid.Column="1"
Command="{Binding Done_Command}"
Visibility="{Binding DoneBtn_Visibility}"
Margin="2.5,0,2.5,0"
Style="{StaticResource RightPanel_Button}">
<Image Source="\Resources\Common\Ok.png"
Style="{StaticResource Button_Image}"/>
</Button>
</Grid> </Grid>
</StackPanel> </StackPanel>
</UserControl>
</Border>
+81 -165
View File
@@ -163,21 +163,6 @@ Public Class CurrMachining
End Select End Select
End Sub End Sub
Friend Overrides Sub Save()
If bIsModified Then
' salvo tutti i parametri su orig
SaveParams()
' resetto stato di modificata
UpdateIsModified()
End If
End Sub
Protected Overrides Sub SaveParams()
For Each Cathegory In m_CathegoryList
Cathegory.SaveParams()
Next
End Sub
Friend Sub WriteCurrParamInPart(nPartId As Integer) Friend Sub WriteCurrParamInPart(nPartId As Integer)
EgtSetInfo(nPartId, MAC_GUID, m_sCurrGUID.ToString()) EgtSetInfo(nPartId, MAC_GUID, m_sCurrGUID.ToString())
For Each Cathegory As CurrMachiningCathegory In m_CathegoryList For Each Cathegory As CurrMachiningCathegory In m_CathegoryList
@@ -199,98 +184,81 @@ Public Class CurrMachiningCathegory
Select Case m_Type Select Case m_Type
Case Cathegories.GENERAL Case Cathegories.GENERAL
m_sName = "General" m_sName = "General"
m_MachiningParamList = New List(Of MachiningParam)({New CurrComboMachiningParam(MachiningParam.Params.SLICINGTYPE, nPartId, nIndex, bForceFromDb, Me), m_MachiningParamList = New List(Of MachiningParam)({New CurrComboMachiningParam(MachiningParam.Params.SLICINGTYPE, nPartId, nIndex, bForceFromDb),
New CurrCheckMachiningParam(MachiningParam.Params.SPIRALVASE, nPartId, nIndex, bForceFromDb, Me), New CurrCheckMachiningParam(MachiningParam.Params.SPIRALVASE, nPartId, nIndex, bForceFromDb),
New CurrNumericMachiningParam(MachiningParam.Params.STRANDH, nPartId, nIndex, bForceFromDb, Me), New CurrNumericMachiningParam(MachiningParam.Params.STRANDH, nPartId, nIndex, bForceFromDb),
New CurrNumericMachiningParam(MachiningParam.Params.STRANDW, nPartId, nIndex, bForceFromDb, Me), New CurrNumericMachiningParam(MachiningParam.Params.STRANDW, nPartId, nIndex, bForceFromDb),
New CurrNumericMachiningParam(MachiningParam.Params.STRANDCOUNT, nPartId, nIndex, bForceFromDb, Me), New CurrNumericMachiningParam(MachiningParam.Params.STRANDCOUNT, nPartId, nIndex, bForceFromDb),
New CurrNumericMachiningParam(MachiningParam.Params.OFFSET, nPartId, nIndex, bForceFromDb, Me), New CurrNumericMachiningParam(MachiningParam.Params.OFFSET, nPartId, nIndex, bForceFromDb),
New CurrNumericMachiningParam(MachiningParam.Params.STRANDOVERLAP, nPartId, nIndex, bForceFromDb, Me), New CurrNumericMachiningParam(MachiningParam.Params.STRANDOVERLAP, nPartId, nIndex, bForceFromDb),
New CurrNumericMachiningParam(MachiningParam.Params.STARTPOINTOFFSETONSLICE, nPartId, nIndex, bForceFromDb, Me), New CurrNumericMachiningParam(MachiningParam.Params.STARTPOINTOFFSETONSLICE, nPartId, nIndex, bForceFromDb),
New CurrComboMachiningParam(MachiningParam.Params.STRANDORDER, nPartId, nIndex, bForceFromDb, Me), New CurrComboMachiningParam(MachiningParam.Params.STRANDORDER, nPartId, nIndex, bForceFromDb),
New CurrComboMachiningParam(MachiningParam.Params.DIRECTION, nPartId, nIndex, bForceFromDb, Me), New CurrComboMachiningParam(MachiningParam.Params.DIRECTION, nPartId, nIndex, bForceFromDb),
New CurrNumericMachiningParam(MachiningParam.Params.FLOORCOUNT, nPartId, nIndex, bForceFromDb, Me), New CurrNumericMachiningParam(MachiningParam.Params.FLOORCOUNT, nPartId, nIndex, bForceFromDb),
New CurrNumericMachiningParam(MachiningParam.Params.G0FEED, nPartId, nIndex, bForceFromDb, Me), New CurrNumericMachiningParam(MachiningParam.Params.G0FEED, nPartId, nIndex, bForceFromDb),
New CurrNumericMachiningParam(MachiningParam.Params.G0FEEDZ, nPartId, nIndex, bForceFromDb, Me), New CurrNumericMachiningParam(MachiningParam.Params.G0FEEDZ, nPartId, nIndex, bForceFromDb),
New CurrNumericMachiningParam(MachiningParam.Params.LINKZUP, nPartId, nIndex, bForceFromDb, Me), New CurrNumericMachiningParam(MachiningParam.Params.TOOLDIAM, nPartId, nIndex, bForceFromDb),
New CurrNumericMachiningParam(MachiningParam.Params.TOOLDIAM, nPartId, nIndex, bForceFromDb, Me), New CurrNumericMachiningParam(MachiningParam.Params.FLOWRATE_PC, nPartId, nIndex, bForceFromDb),
New CurrNumericMachiningParam(MachiningParam.Params.FLOWRATE_PC, nPartId, nIndex, bForceFromDb, Me), New CurrComboMachiningParam(MachiningParam.Params.DYNAMIC_MODE, nPartId, nIndex, bForceFromDb),
New CurrComboMachiningParam(MachiningParam.Params.DYNAMIC_MODE, nPartId, nIndex, bForceFromDb, Me), New CurrOrderedMachiningParam(MachiningParam.Params.PRINT_ORDER, nPartId, nIndex, bForceFromDb)})
New CurrOrderedMachiningParam(MachiningParam.Params.PRINT_ORDER, nPartId, nIndex, bForceFromDb, Me),
New CurrNumericMachiningParam(MachiningParam.Params.PREFLOWDELAY, nPartId, nIndex, bForceFromDb, Me),
New CurrNumericMachiningParam(MachiningParam.Params.POSTFLOWDELAY, nPartId, nIndex, bForceFromDb, Me),
New CurrNumericMachiningParam(MachiningParam.Params.SCREWBACK, nPartId, nIndex, bForceFromDb, Me)})
Case Cathegories.LINK Case Cathegories.LINK
m_sName = "Shell" m_sName = "Shell"
m_MachiningParamList = New List(Of MachiningParam)({New CurrComboMachiningParam(MachiningParam.Params.LINKTYPE, nPartId, nIndex, bForceFromDb, Me), m_MachiningParamList = New List(Of MachiningParam)({New CurrComboMachiningParam(MachiningParam.Params.LINKTYPE, nPartId, nIndex, bForceFromDb),
New CurrNumericMachiningParam(MachiningParam.Params.LINKPARAM, nPartId, nIndex, bForceFromDb, Me), New CurrNumericMachiningParam(MachiningParam.Params.LINKPARAM, nPartId, nIndex, bForceFromDb),
New CurrComboMachiningParam(MachiningParam.Params.LEADIN, nPartId, nIndex, bForceFromDb, Me), New CurrNumericMachiningParam(MachiningParam.Params.LINKZUP, nPartId, nIndex, bForceFromDb),
New CurrNumericMachiningParam(MachiningParam.Params.LEADINTANGDIST, nPartId, nIndex, bForceFromDb, Me), New CurrComboMachiningParam(MachiningParam.Params.LEADIN, nPartId, nIndex, bForceFromDb),
New CurrNumericMachiningParam(MachiningParam.Params.LEADINORTHODIST, nPartId, nIndex, bForceFromDb, Me), New CurrNumericMachiningParam(MachiningParam.Params.LEADINTANGDIST, nPartId, nIndex, bForceFromDb),
New CurrNumericMachiningParam(MachiningParam.Params.OFFSETLEADPOINT, nPartId, nIndex, bForceFromDb, Me), New CurrNumericMachiningParam(MachiningParam.Params.LEADINORTHODIST, nPartId, nIndex, bForceFromDb),
New CurrComboMachiningParam(MachiningParam.Params.LEADOUT, nPartId, nIndex, bForceFromDb, Me), New CurrNumericMachiningParam(MachiningParam.Params.OFFSETLEADPOINT, nPartId, nIndex, bForceFromDb),
New CurrNumericMachiningParam(MachiningParam.Params.LEADOUTTANGDIST, nPartId, nIndex, bForceFromDb, Me), New CurrComboMachiningParam(MachiningParam.Params.LEADOUT, nPartId, nIndex, bForceFromDb),
New CurrNumericMachiningParam(MachiningParam.Params.LEADOUTORTHODIST, nPartId, nIndex, bForceFromDb, Me), New CurrNumericMachiningParam(MachiningParam.Params.LEADOUTTANGDIST, nPartId, nIndex, bForceFromDb),
New CurrNumericMachiningParam(MachiningParam.Params.COASTINGLEN, nPartId, nIndex, bForceFromDb, Me), New CurrNumericMachiningParam(MachiningParam.Params.LEADOUTORTHODIST, nPartId, nIndex, bForceFromDb),
New CurrNumericMachiningParam(MachiningParam.Params.COASTINGFEED_PC, nPartId, nIndex, bForceFromDb, Me), New CurrNumericMachiningParam(MachiningParam.Params.COASTINGLEN, nPartId, nIndex, bForceFromDb),
New CurrNumericMachiningParam(MachiningParam.Params.WIPELEN, nPartId, nIndex, bForceFromDb, Me), New CurrNumericMachiningParam(MachiningParam.Params.COASTINGFEED_PC, nPartId, nIndex, bForceFromDb),
New CurrNumericMachiningParam(MachiningParam.Params.WIPEFEED_PC, nPartId, nIndex, bForceFromDb, Me)}) New CurrNumericMachiningParam(MachiningParam.Params.WIPELEN, nPartId, nIndex, bForceFromDb),
'New CurrNumericMachiningParam(MachiningParam.Params.WIPEDIR, nPartId, nIndex, bForceFromDb, Me)}) New CurrNumericMachiningParam(MachiningParam.Params.WIPEFEED_PC, nPartId, nIndex, bForceFromDb)})
'New CurrNumericMachiningParam(MachiningParam.Params.WIPEDIR, nPartId, nIndex, bForceFromDb)})
Case Cathegories.RIBS Case Cathegories.RIBS
m_sName = "Ribs" m_sName = "Ribs"
m_MachiningParamList = New List(Of MachiningParam)({New CurrComboMachiningParam(MachiningParam.Params.RIBSTYPE, nPartId, nIndex, bForceFromDb, Me), m_MachiningParamList = New List(Of MachiningParam)({New CurrComboMachiningParam(MachiningParam.Params.RIBSTYPE, nPartId, nIndex, bForceFromDb),
New CurrCheckMachiningParam(MachiningParam.Params.RIBSLIMITUNBOUNDEDWITHSOLID, nPartId, nIndex, bForceFromDb, Me), New CurrNumericMachiningParam(MachiningParam.Params.RIBSOVERLAP, nPartId, nIndex, bForceFromDb),
New CurrNumericMachiningParam(MachiningParam.Params.RIBSOVERLAP, nPartId, nIndex, bForceFromDb, Me), New CurrNumericMachiningParam(MachiningParam.Params.RIBSSTRANDCOUNT, nPartId, nIndex, bForceFromDb),
New CurrNumericMachiningParam(MachiningParam.Params.RIBSSTRANDCOUNT, nPartId, nIndex, bForceFromDb, Me), New CurrCheckMachiningParam(MachiningParam.Params.RIBSLINK, nPartId, nIndex, bForceFromDb),
New CurrCheckMachiningParam(MachiningParam.Params.RIBSLINK, nPartId, nIndex, bForceFromDb, Me), New CurrCheckMachiningParam(MachiningParam.Params.RIBSINVERTORDER, nPartId, nIndex, bForceFromDb),
New CurrCheckMachiningParam(MachiningParam.Params.RIBSINVERTORDER, nPartId, nIndex, bForceFromDb, Me), New CurrCheckMachiningParam(MachiningParam.Params.RIBSINVERTDIRECTION, nPartId, nIndex, bForceFromDb),
New CurrCheckMachiningParam(MachiningParam.Params.RIBSINVERTDIRECTION, nPartId, nIndex, bForceFromDb, Me), New CurrCheckMachiningParam(MachiningParam.Params.RIBSLEADININVERT, nPartId, nIndex, bForceFromDb),
New CurrCheckMachiningParam(MachiningParam.Params.RIBSINVERTSTRANDORDER, nPartId, nIndex, bForceFromDb, Me), New CurrNumericMachiningParam(MachiningParam.Params.RIBSLEADINLEN, nPartId, nIndex, bForceFromDb),
New CurrCheckMachiningParam(MachiningParam.Params.RIBSLEADININVERT, nPartId, nIndex, bForceFromDb, Me), New CurrCheckMachiningParam(MachiningParam.Params.RIBSLEADOUTINVERT, nPartId, nIndex, bForceFromDb),
New CurrNumericMachiningParam(MachiningParam.Params.RIBSLEADINLEN, nPartId, nIndex, bForceFromDb, Me), New CurrNumericMachiningParam(MachiningParam.Params.RIBSLEADOUTLEN, nPartId, nIndex, bForceFromDb),
New CurrCheckMachiningParam(MachiningParam.Params.RIBSLEADOUTINVERT, nPartId, nIndex, bForceFromDb, Me), New CurrNumericMachiningParam(MachiningParam.Params.RIBSLEADOUTCOASTING, nPartId, nIndex, bForceFromDb),
New CurrNumericMachiningParam(MachiningParam.Params.RIBSLEADOUTLEN, nPartId, nIndex, bForceFromDb, Me), New CurrNumericMachiningParam(MachiningParam.Params.RIBSLEADOUTWIPE, nPartId, nIndex, bForceFromDb),
New CurrNumericMachiningParam(MachiningParam.Params.RIBSLEADOUTCOASTING, nPartId, nIndex, bForceFromDb, Me), New CurrNumericMachiningParam(MachiningParam.Params.RIBSLEADOUTWIPEDIR, nPartId, nIndex, bForceFromDb)})
New CurrNumericMachiningParam(MachiningParam.Params.RIBSLEADOUTWIPE, nPartId, nIndex, bForceFromDb, Me),
New CurrNumericMachiningParam(MachiningParam.Params.RIBSLEADOUTWIPEDIR, nPartId, nIndex, bForceFromDb, Me)})
Case Cathegories.SHELL_NUMBER Case Cathegories.SHELL_NUMBER
m_sName = "Reduce Shell Number" m_sName = "Reduce Shell Number"
m_MachiningParamList = New List(Of MachiningParam)({New CurrNumericMachiningParam(MachiningParam.Params.SHELLNBRDIFFERENCE, nPartId, nIndex, bForceFromDb, Me), m_MachiningParamList = New List(Of MachiningParam)({New CurrNumericMachiningParam(MachiningParam.Params.SHELLNBRDIFFERENCE, nPartId, nIndex, bForceFromDb),
New CurrNumericMachiningParam(MachiningParam.Params.SHELLNBRCOASTING, nPartId, nIndex, bForceFromDb, Me), New CurrNumericMachiningParam(MachiningParam.Params.SHELLNBRCOASTING, nPartId, nIndex, bForceFromDb),
New CurrNumericMachiningParam(MachiningParam.Params.SHELLNBRWIPE, nPartId, nIndex, bForceFromDb, Me), New CurrNumericMachiningParam(MachiningParam.Params.SHELLNBRWIPE, nPartId, nIndex, bForceFromDb),
New CurrNumericMachiningParam(MachiningParam.Params.SHELLNBRWIPEDIR, nPartId, nIndex, bForceFromDb, Me)}) New CurrNumericMachiningParam(MachiningParam.Params.SHELLNBRWIPEDIR, nPartId, nIndex, bForceFromDb)})
Case Cathegories.AUX_SOLID Case Cathegories.AUX_SOLID
m_sName = "Filled Solid" m_sName = "Filled Solid"
m_MachiningParamList = New List(Of MachiningParam)({New CurrNumericMachiningParam(MachiningParam.Params.AUXSOLIDSOVERLAP, nPartId, nIndex, bForceFromDb, Me), m_MachiningParamList = New List(Of MachiningParam)({New CurrNumericMachiningParam(MachiningParam.Params.AUXSOLIDSOVERLAP, nPartId, nIndex, bForceFromDb),
New CurrComboMachiningParam(MachiningParam.Params.AUXSOLIDSINFILL, nPartId, nIndex, bForceFromDb, Me), New CurrComboMachiningParam(MachiningParam.Params.AUXSOLIDSINFILL, nPartId, nIndex, bForceFromDb),
New CurrComboMachiningParam(MachiningParam.Params.AUXSOLIDSSTRANDORDER, nPartId, nIndex, bForceFromDb, Me), New CurrComboMachiningParam(MachiningParam.Params.AUXSOLIDSSTRANDORDER, nPartId, nIndex, bForceFromDb),
New CurrComboMachiningParam(MachiningParam.Params.AUXSOLIDSLINKTYPE, nPartId, nIndex, bForceFromDb, Me), New CurrComboMachiningParam(MachiningParam.Params.AUXSOLIDSLINKTYPE, nPartId, nIndex, bForceFromDb),
New CurrNumericMachiningParam(MachiningParam.Params.AUXSOLIDSLINKPARAM, nPartId, nIndex, bForceFromDb, Me), New CurrNumericMachiningParam(MachiningParam.Params.AUXSOLIDSLINKPARAM, nPartId, nIndex, bForceFromDb),
New CurrNumericMachiningParam(MachiningParam.Params.AUXSOLIDSSTARTPOINTOFFSETONSLICE, nPartId, nIndex, bForceFromDb, Me), New CurrNumericMachiningParam(MachiningParam.Params.AUXSOLIDSSTARTPOINTOFFSETONSLICE, nPartId, nIndex, bForceFromDb),
New CurrNumericMachiningParam(MachiningParam.Params.AUXSOLIDSCOASTINGLEN, nPartId, nIndex, bForceFromDb, Me), New CurrNumericMachiningParam(MachiningParam.Params.AUXSOLIDSCOASTINGLEN, nPartId, nIndex, bForceFromDb),
New CurrNumericMachiningParam(MachiningParam.Params.AUXSOLIDSWIPELEN, nPartId, nIndex, bForceFromDb, Me), New CurrNumericMachiningParam(MachiningParam.Params.AUXSOLIDSWIPELEN, nPartId, nIndex, bForceFromDb),
New CurrNumericMachiningParam(MachiningParam.Params.AUXSOLIDSWIPEDIR, nPartId, nIndex, bForceFromDb, Me)}) New CurrNumericMachiningParam(MachiningParam.Params.AUXSOLIDSWIPEDIR, nPartId, nIndex, bForceFromDb)})
End Select
' verifico dipendenze tra parametri
Select Case m_Type
Case Cathegories.LINK
For Each Param In {MachiningParam.Params.LINKTYPE, MachiningParam.Params.LEADIN, MachiningParam.Params.LEADOUT}
Dim MachiningParam As ComboMachiningParam = MachiningParamList.FirstOrDefault(Function(z) z.Type = Param)
MachiningParam.ManageDependencyParam()
Next
Case Cathegories.RIBS
For Each Param In {MachiningParam.Params.RIBSTYPE}
Dim MachiningParam As ComboMachiningParam = MachiningParamList.FirstOrDefault(Function(z) z.Type = Param)
MachiningParam.ManageDependencyParam()
Next
Case Cathegories.AUX_SOLID
For Each Param In {MachiningParam.Params.AUXSOLIDSINFILL}
Dim MachiningParam As ComboMachiningParam = MachiningParamList.FirstOrDefault(Function(z) z.Type = Param)
MachiningParam.ManageDependencyParam()
Next
End Select End Select
End Sub End Sub
Friend Sub SaveCurrParams()
For Each Param In m_MachiningParamList
Param.SaveParam()
Next
End Sub
Friend Sub ResetCurrParams() Friend Sub ResetCurrParams()
For Each Param In m_MachiningParamList For Each Param In m_MachiningParamList
Param.ResetParam() Param.ResetParam()
@@ -313,18 +281,10 @@ Public Class CurrNumericMachiningParam
Return If(m_bIsLen, LenToString(m_dValue, 1), DoubleToString(m_dValue, 2)) Return If(m_bIsLen, LenToString(m_dValue, 1), DoubleToString(m_dValue, 2))
End Get End Get
Set(value As String) Set(value As String)
Dim dTempValue As Double = 0
If m_bIsLen Then If m_bIsLen Then
StringToLen(value, dTempValue) StringToLen(value, m_dValue)
Else Else
StringToDouble(value, dTempValue) StringToDouble(value, m_dValue)
End If
If m_bIsActiveMinMax Then
If dTempValue >= m_dMinValue AndAlso dTempValue <= m_dMaxValue Then
m_dValue = dTempValue
End If
Else
m_dValue = dTempValue
End If End If
NotifyPropertyChanged(NameOf(sValue)) NotifyPropertyChanged(NameOf(sValue))
NotifyPropertyChanged(NameOf(bIsModifiedFromDb)) NotifyPropertyChanged(NameOf(bIsModifiedFromDb))
@@ -347,8 +307,8 @@ Public Class CurrNumericMachiningParam
' Definizione comandi ' Definizione comandi
Private m_cmdResetParam As ICommand Private m_cmdResetParam As ICommand
Sub New(Type As Params, nPartId As Integer, nIndex As Integer, bForceFromDb As Boolean, Cathegory As MachiningCathegory) Sub New(Type As Params, nPartId As Integer, nIndex As Integer, bForceFromDb As Boolean)
MyBase.New(Type, nIndex, Cathegory) MyBase.New(Type, nIndex)
Dim bReadFromPart As Boolean = False Dim bReadFromPart As Boolean = False
Select Case Type Select Case Type
Case Params.STRANDH Case Params.STRANDH
@@ -417,15 +377,6 @@ Public Class CurrNumericMachiningParam
Case Params.TOOLDIAM Case Params.TOOLDIAM
bReadFromPart = EgtGetInfo(nPartId, MAC_TOOLDIAM, m_dValue) bReadFromPart = EgtGetInfo(nPartId, MAC_TOOLDIAM, m_dValue)
m_bIsLen = True m_bIsLen = True
Case Params.PREFLOWDELAY
bReadFromPart = EgtGetInfo(nPartId, MAC_PREFLOWDELAY, m_dValue)
m_bIsLen = True
Case Params.POSTFLOWDELAY
bReadFromPart = EgtGetInfo(nPartId, MAC_POSTFLOWDELAY, m_dValue)
m_bIsLen = True
Case Params.SCREWBACK
bReadFromPart = EgtGetInfo(nPartId, MAC_SCREWBACK, m_dValue)
m_bIsLen = True
Case Params.RIBSOVERLAP Case Params.RIBSOVERLAP
bReadFromPart = EgtGetInfo(nPartId, MAC_RIBSOVERLAP, m_dValue) bReadFromPart = EgtGetInfo(nPartId, MAC_RIBSOVERLAP, m_dValue)
m_bIsLen = False m_bIsLen = False
@@ -486,9 +437,9 @@ Public Class CurrNumericMachiningParam
Dim DbMachining As Machining = Map.refMachiningDbVM.MachiningList.FirstOrDefault(Function(x) x.nIndex = nIndex) Dim DbMachining As Machining = Map.refMachiningDbVM.MachiningList.FirstOrDefault(Function(x) x.nIndex = nIndex)
Select Case Type Select Case Type
Case Params.STRANDH, Params.STRANDW, Params.STRANDCOUNT, Params.OFFSET, Params.STRANDOVERLAP, Params.STARTPOINTOFFSETONSLICE, Case Params.STRANDH, Params.STRANDW, Params.STRANDCOUNT, Params.OFFSET, Params.STRANDOVERLAP, Params.STARTPOINTOFFSETONSLICE,
Params.FLOORCOUNT, Params.G0FEED, Params.G0FEEDZ, Params.LINKZUP, Params.TOOLDIAM, Params.FLOWRATE_PC, Params.PREFLOWDELAY, Params.POSTFLOWDELAY, Params.SCREWBACK Params.FLOORCOUNT, Params.G0FEED, Params.G0FEEDZ, Params.TOOLDIAM, Params.FLOWRATE_PC
m_DbParam = DbMachining.CathegoryList.FirstOrDefault(Function(y) y.Type = MachiningCathegory.Cathegories.GENERAL).MachiningParamList.FirstOrDefault(Function(z) z.Type = m_Type) m_DbParam = DbMachining.CathegoryList.FirstOrDefault(Function(y) y.Type = MachiningCathegory.Cathegories.GENERAL).MachiningParamList.FirstOrDefault(Function(z) z.Type = m_Type)
Case Params.LINKPARAM, Params.OFFSETLEADPOINT, Params.LEADINTANGDIST, Params.LEADINORTHODIST, Case Params.LINKPARAM, Params.LINKZUP, Params.OFFSETLEADPOINT, Params.LEADINTANGDIST, Params.LEADINORTHODIST,
Params.LEADOUTTANGDIST, Params.LEADOUTORTHODIST, Params.COASTINGLEN, Params.COASTINGFEED_PC, Params.LEADOUTTANGDIST, Params.LEADOUTORTHODIST, Params.COASTINGLEN, Params.COASTINGFEED_PC,
Params.WIPELEN, Params.WIPEFEED_PC ' Params.WIPEDIR Params.WIPELEN, Params.WIPEFEED_PC ' Params.WIPEDIR
m_DbParam = DbMachining.CathegoryList.FirstOrDefault(Function(y) y.Type = MachiningCathegory.Cathegories.LINK).MachiningParamList.FirstOrDefault(Function(z) z.Type = m_Type) m_DbParam = DbMachining.CathegoryList.FirstOrDefault(Function(y) y.Type = MachiningCathegory.Cathegories.LINK).MachiningParamList.FirstOrDefault(Function(z) z.Type = m_Type)
@@ -567,12 +518,6 @@ Public Class CurrNumericMachiningParam
EgtSetInfo(nPartId, MAC_G0FEEDZ, sWriteValue) EgtSetInfo(nPartId, MAC_G0FEEDZ, sWriteValue)
Case Params.TOOLDIAM Case Params.TOOLDIAM
EgtSetInfo(nPartId, MAC_TOOLDIAM, sWriteValue) EgtSetInfo(nPartId, MAC_TOOLDIAM, sWriteValue)
Case Params.PREFLOWDELAY
EgtSetInfo(nPartId, MAC_PREFLOWDELAY, sWriteValue)
Case Params.POSTFLOWDELAY
EgtSetInfo(nPartId, MAC_POSTFLOWDELAY, sWriteValue)
Case Params.SCREWBACK
EgtSetInfo(nPartId, MAC_SCREWBACK, sWriteValue)
Case Params.RIBSOVERLAP Case Params.RIBSOVERLAP
EgtSetInfo(nPartId, MAC_RIBSOVERLAP, sWriteValue) EgtSetInfo(nPartId, MAC_RIBSOVERLAP, sWriteValue)
Case Params.RIBSSTRANDCOUNT Case Params.RIBSSTRANDCOUNT
@@ -665,8 +610,8 @@ Public Class CurrStringMachiningParam
' Definizione comandi ' Definizione comandi
Private m_cmdResetParam As ICommand Private m_cmdResetParam As ICommand
Sub New(Type As Params, nIndex As Integer, Cathegory As MachiningCathegory) Sub New(Type As Params, nIndex As Integer)
MyBase.New(Type, nIndex, Cathegory) MyBase.New(Type, nIndex)
m_sValue = sValue m_sValue = sValue
m_sOrigValue = m_sValue m_sOrigValue = m_sValue
End Sub End Sub
@@ -721,11 +666,6 @@ Public Class CurrComboMachiningParam
m_SelValue = value m_SelValue = value
NotifyPropertyChanged(NameOf(SelValue)) NotifyPropertyChanged(NameOf(SelValue))
NotifyPropertyChanged(NameOf(bIsModifiedFromDb)) NotifyPropertyChanged(NameOf(bIsModifiedFromDb))
ManageDependencyParam()
' se aggiorno SlicingType
If m_Type = Params.SLICINGTYPE Then
CurrentMachine.UpdateExtrusionArea()
End If
End Set End Set
End Property End Property
@@ -745,8 +685,8 @@ Public Class CurrComboMachiningParam
' Definizione comandi ' Definizione comandi
Private m_cmdResetParam As ICommand Private m_cmdResetParam As ICommand
Sub New(Type As Params, nPartId As Integer, nIndex As Integer, bForceFromDb As Boolean, Cathegory As MachiningCathegory) Sub New(Type As Params, nPartId As Integer, nIndex As Integer, bForceFromDb As Boolean)
MyBase.New(Type, nIndex, Cathegory) MyBase.New(Type, nIndex)
Dim bReadFromPart As Boolean = False Dim bReadFromPart As Boolean = False
Select Case Type Select Case Type
Case Params.SLICINGTYPE Case Params.SLICINGTYPE
@@ -897,7 +837,6 @@ Public Class CurrComboMachiningParam
Friend Overrides Sub ResetParam() Friend Overrides Sub ResetParam()
m_SelValue = m_OrigSelValue m_SelValue = m_OrigSelValue
NotifyPropertyChanged(NameOf(SelValue)) NotifyPropertyChanged(NameOf(SelValue))
CurrentMachine.UpdateExtrusionArea()
End Sub End Sub
#Region "COMMANDS" #Region "COMMANDS"
@@ -917,7 +856,6 @@ Public Class CurrComboMachiningParam
m_SelValue = DbParam.OrigSelValue m_SelValue = DbParam.OrigSelValue
NotifyPropertyChanged(NameOf(SelValue)) NotifyPropertyChanged(NameOf(SelValue))
NotifyPropertyChanged(NameOf(bIsModifiedFromDb)) NotifyPropertyChanged(NameOf(bIsModifiedFromDb))
CurrentMachine.UpdateExtrusionArea()
End Sub End Sub
#End Region ' ResetParam #End Region ' ResetParam
@@ -956,8 +894,8 @@ Public Class CurrCheckMachiningParam
' Definizione comandi ' Definizione comandi
Private m_cmdResetParam As ICommand Private m_cmdResetParam As ICommand
Sub New(Type As Params, nPartId As Integer, nIndex As Integer, bForceFromDb As Boolean, Cathegory As MachiningCathegory) Sub New(Type As Params, nPartId As Integer, nIndex As Integer, bForceFromDb As Boolean)
MyBase.New(Type, nIndex, Cathegory) MyBase.New(Type, nIndex)
Dim bReadFromPart As Boolean = False Dim bReadFromPart As Boolean = False
Select Case Type Select Case Type
Case Params.SPIRALVASE Case Params.SPIRALVASE
@@ -968,14 +906,10 @@ Public Class CurrCheckMachiningParam
bReadFromPart = EgtGetInfo(nPartId, MAC_RIBSINVERTORDER, m_bValue) bReadFromPart = EgtGetInfo(nPartId, MAC_RIBSINVERTORDER, m_bValue)
Case Params.RIBSINVERTDIRECTION Case Params.RIBSINVERTDIRECTION
bReadFromPart = EgtGetInfo(nPartId, MAC_RIBSINVERTDIRECTION, m_bValue) bReadFromPart = EgtGetInfo(nPartId, MAC_RIBSINVERTDIRECTION, m_bValue)
Case Params.RIBSINVERTSTRANDORDER
bReadFromPart = EgtGetInfo(nPartId, MAC_RIBSINVERTSTRANDORDER, m_bValue)
Case Params.RIBSLEADININVERT Case Params.RIBSLEADININVERT
bReadFromPart = EgtGetInfo(nPartId, MAC_RIBSLEADININVERT, m_bValue) bReadFromPart = EgtGetInfo(nPartId, MAC_RIBSLEADININVERT, m_bValue)
Case Params.RIBSLEADOUTINVERT Case Params.RIBSLEADOUTINVERT
bReadFromPart = EgtGetInfo(nPartId, MAC_RIBSLEADOUTINVERT, m_bValue) bReadFromPart = EgtGetInfo(nPartId, MAC_RIBSLEADOUTINVERT, m_bValue)
Case Params.RIBSLIMITUNBOUNDEDWITHSOLID
bReadFromPart = EgtGetInfo(nPartId, MAC_RIBSLIMITUNBOUNDEDWITHSOLID, m_bValue)
End Select End Select
m_bOrigValue = m_bValue m_bOrigValue = m_bValue
If nIndex > 0 Then If nIndex > 0 Then
@@ -983,7 +917,7 @@ Public Class CurrCheckMachiningParam
Select Case Type Select Case Type
Case Params.SPIRALVASE Case Params.SPIRALVASE
m_DbParam = DbMachining.CathegoryList.FirstOrDefault(Function(y) y.Type = MachiningCathegory.Cathegories.GENERAL).MachiningParamList.FirstOrDefault(Function(z) z.Type = m_Type) m_DbParam = DbMachining.CathegoryList.FirstOrDefault(Function(y) y.Type = MachiningCathegory.Cathegories.GENERAL).MachiningParamList.FirstOrDefault(Function(z) z.Type = m_Type)
Case Params.RIBSLINK, Params.RIBSINVERTORDER, Params.RIBSINVERTDIRECTION, Params.RIBSINVERTSTRANDORDER, Params.RIBSLEADININVERT, Params.RIBSLEADOUTINVERT, Params.RIBSLIMITUNBOUNDEDWITHSOLID Case Params.RIBSLINK, Params.RIBSINVERTORDER, Params.RIBSINVERTDIRECTION, Params.RIBSLEADININVERT, Params.RIBSLEADOUTINVERT
m_DbParam = DbMachining.CathegoryList.FirstOrDefault(Function(y) y.Type = MachiningCathegory.Cathegories.RIBS).MachiningParamList.FirstOrDefault(Function(z) z.Type = m_Type) m_DbParam = DbMachining.CathegoryList.FirstOrDefault(Function(y) y.Type = MachiningCathegory.Cathegories.RIBS).MachiningParamList.FirstOrDefault(Function(z) z.Type = m_Type)
End Select End Select
If bForceFromDb OrElse Not bReadFromPart Then If bForceFromDb OrElse Not bReadFromPart Then
@@ -1003,14 +937,10 @@ Public Class CurrCheckMachiningParam
EgtSetInfo(nPartId, MAC_RIBSINVERTORDER, If(m_bValue, 1, 0)) EgtSetInfo(nPartId, MAC_RIBSINVERTORDER, If(m_bValue, 1, 0))
Case Params.RIBSINVERTDIRECTION Case Params.RIBSINVERTDIRECTION
EgtSetInfo(nPartId, MAC_RIBSINVERTDIRECTION, If(m_bValue, 1, 0)) EgtSetInfo(nPartId, MAC_RIBSINVERTDIRECTION, If(m_bValue, 1, 0))
Case Params.RIBSINVERTSTRANDORDER
EgtSetInfo(nPartId, MAC_RIBSINVERTSTRANDORDER, If(m_bValue, 1, 0))
Case Params.RIBSLEADININVERT Case Params.RIBSLEADININVERT
EgtSetInfo(nPartId, MAC_RIBSLEADININVERT, If(m_bValue, 1, 0)) EgtSetInfo(nPartId, MAC_RIBSLEADININVERT, If(m_bValue, 1, 0))
Case Params.RIBSLEADOUTINVERT Case Params.RIBSLEADOUTINVERT
EgtSetInfo(nPartId, MAC_RIBSLEADOUTINVERT, If(m_bValue, 1, 0)) EgtSetInfo(nPartId, MAC_RIBSLEADOUTINVERT, If(m_bValue, 1, 0))
Case Params.RIBSLIMITUNBOUNDEDWITHSOLID
EgtSetInfo(nPartId, MAC_RIBSLIMITUNBOUNDEDWITHSOLID, If(m_bValue, 1, 0))
End Select End Select
End Sub End Sub
@@ -1067,27 +997,12 @@ Public Class CurrOrderedMachiningParam
' Definizione comandi ' Definizione comandi
Private m_cmdResetParam As ICommand Private m_cmdResetParam As ICommand
Sub New(Type As Params, nPartId As Integer, nIndex As Integer, bForceFromDb As Boolean, Cathegory As MachiningCathegory) Sub New(Type As Params, nPartId As Integer, nIndex As Integer, bForceFromDb As Boolean)
MyBase.New(Type, nIndex, Cathegory) MyBase.New(Type, nIndex)
Dim bReadFromPart As Boolean = False Dim bReadFromPart As Boolean = False
Select Case Type Select Case Type
Case Params.PRINT_ORDER Case Params.PRINT_ORDER
m_StandardValueOrderList = New List(Of Integer)({Machining.MPAR_PRINT_ORDER.SHELL, m_ValueList = New ObservableCollection(Of IdNameStruct)
Machining.MPAR_PRINT_ORDER.EXTRA_SHELL,
Machining.MPAR_PRINT_ORDER.INFILL,
Machining.MPAR_PRINT_ORDER.AUX_SOLID,
Machining.MPAR_PRINT_ORDER.RIB_UNBOUNDED,
Machining.MPAR_PRINT_ORDER.RIB_EXTERNAL,
Machining.MPAR_PRINT_ORDER.RIB_INTERNAL,
Machining.MPAR_PRINT_ORDER.RIB_SUPPORT})
m_ValueList = New ObservableCollection(Of IdNameStruct)({New IdNameStruct(Machining.MPAR_PRINT_ORDER.SHELL, "Shell"),
New IdNameStruct(Machining.MPAR_PRINT_ORDER.EXTRA_SHELL, "Extra Shell"),
New IdNameStruct(Machining.MPAR_PRINT_ORDER.INFILL, "Infill"),
New IdNameStruct(Machining.MPAR_PRINT_ORDER.AUX_SOLID, "Filled Solid"),
New IdNameStruct(Machining.MPAR_PRINT_ORDER.RIB_UNBOUNDED, "Unbounded Rib"),
New IdNameStruct(Machining.MPAR_PRINT_ORDER.RIB_EXTERNAL, "External Rib"),
New IdNameStruct(Machining.MPAR_PRINT_ORDER.RIB_INTERNAL, "Internal Rib"),
New IdNameStruct(Machining.MPAR_PRINT_ORDER.RIB_SUPPORT, "Support Rib")})
Dim sValue As String = "" Dim sValue As String = ""
bReadFromPart = EgtGetInfo(nPartId, MAC_PRINTORDER, sValue) bReadFromPart = EgtGetInfo(nPartId, MAC_PRINTORDER, sValue)
Value = sValue Value = sValue
@@ -1141,6 +1056,7 @@ Public Class CurrOrderedMachiningParam
End Property End Property
Public Sub ResetParamCmd() Public Sub ResetParamCmd()
m_SelValue = Nothing
Value = DbParam.OrigValue Value = DbParam.OrigValue
NotifyPropertyChanged(NameOf(Value)) NotifyPropertyChanged(NameOf(Value))
NotifyPropertyChanged(NameOf(SelValue)) NotifyPropertyChanged(NameOf(SelValue))
@@ -1,31 +1,17 @@
<Grid x:Class="CurrMachiningPanelV" <UserControl x:Class="CurrMachiningPanelV"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:EgtWPFLib5="clr-namespace:EgtWPFLib5;assembly=EgtWPFLib5" xmlns:PrintApp="clr-namespace:Icarus"
xmlns:PrintApp="clr-namespace:Icarus" Width="300">
Width="310" <Border VerticalAlignment="Center"
VerticalAlignment="Center"> Style="{StaticResource RightPanel_Border}">
<Grid.RowDefinitions> <Grid>
<RowDefinition Height="Auto"/>
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
<Border Margin="0,0,0,2.5"
Style="{StaticResource Title_Border}">
<TextBlock Text="CURRENT MACHINING"
Style="{StaticResource Title_TextBlock}"/>
</Border>
<Border Grid.Row="1"
VerticalAlignment="Center"
Margin="0,2.5,0,0"
Style="{StaticResource BottomGrayRow_Border}">
<Grid Margin="2.5,2.5,2.5,0">
<Grid.RowDefinitions> <Grid.RowDefinitions>
<RowDefinition Height="1*"/> <RowDefinition Height="1*"/>
<RowDefinition Height="Auto"/> <RowDefinition Height="Auto"/>
</Grid.RowDefinitions> </Grid.RowDefinitions>
<ScrollViewer VerticalScrollBarVisibility="Auto" <ScrollViewer VerticalScrollBarVisibility="Auto"
HorizontalScrollBarVisibility="Disabled" HorizontalScrollBarVisibility="Disabled">
Margin="1,0,0,2.5">
<ItemsControl Grid.Row="1" <ItemsControl Grid.Row="1"
ItemsSource="{Binding CurrMachining.CathegoryList}"> ItemsSource="{Binding CurrMachining.CathegoryList}">
<ItemsControl.ItemsPanel> <ItemsControl.ItemsPanel>
@@ -41,157 +27,134 @@
<ItemsControl ItemsSource="{Binding MachiningParamList}"> <ItemsControl ItemsSource="{Binding MachiningParamList}">
<ItemsControl.ItemsPanel> <ItemsControl.ItemsPanel>
<ItemsPanelTemplate> <ItemsPanelTemplate>
<StackPanel Orientation="Vertical" <StackPanel Orientation="Vertical"/>
Margin="0"/>
</ItemsPanelTemplate> </ItemsPanelTemplate>
</ItemsControl.ItemsPanel> </ItemsControl.ItemsPanel>
<ItemsControl.Resources> <ItemsControl.Resources>
<DataTemplate DataType="{x:Type PrintApp:NumericMachiningParam}"> <DataTemplate DataType="{x:Type PrintApp:NumericMachiningParam}">
<Grid Margin="0,1,2.5,1" <Grid>
IsEnabled="{Binding bIsActive}">
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
<ColumnDefinition Width="2*"/> <ColumnDefinition Width="2*"/>
<ColumnDefinition Width="1*"/> <ColumnDefinition Width="1*"/>
<ColumnDefinition Width="Auto"/> <ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<TextBlock Text="{Binding sName}" <TextBlock Text="{Binding sName}"/>
Margin="0,0,2.5,0" <TextBox Grid.Column="1"
Style="{StaticResource ParameterList_TextBlock}"/> Text="{Binding sValue}"/>
<EgtWPFLib5:EgtTextBox2 Grid.Column="1"
Text="{Binding sValue, UpdateSourceTrigger=Explicit}"
Margin="2.5,0,2.5,0"
Style="{StaticResource ParameterList_TextBox2}"/>
<Button Grid.Column="2" <Button Grid.Column="2"
Content="R" Content="R"
Command="{Binding ResetParam_Command}" Command="{Binding ResetParam_Command}"
IsEnabled="{Binding bIsModifiedFromDb}" IsEnabled="{Binding bIsModifiedFromDb}"
VerticalContentAlignment="Center" VerticalContentAlignment="Center"
HorizontalContentAlignment="Center" HorizontalContentAlignment="Center"
Margin="2.5,0,0,0" Margin="5,0,0,0"
Style="{StaticResource ToolBar_SmallButton}"/> Style="{StaticResource ToolBar_SmallButton}"/>
</Grid> </Grid>
</DataTemplate> </DataTemplate>
<DataTemplate DataType="{x:Type PrintApp:ComboMachiningParam}"> <DataTemplate DataType="{x:Type PrintApp:ComboMachiningParam}">
<Grid Margin="0,1,2.5,1" <Grid>
IsEnabled="{Binding bIsActive}">
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/> <ColumnDefinition Width="2*"/>
<ColumnDefinition Width="1*"/> <ColumnDefinition Width="1*"/>
<ColumnDefinition Width="Auto"/> <ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<TextBlock Text="{Binding sName}" <TextBlock Text="{Binding sName}"/>
Margin="0,0,2.5,0"
Style="{StaticResource ParameterList_TextBlock}"/>
<ComboBox Grid.Column="1" <ComboBox Grid.Column="1"
ItemsSource="{Binding ValueList}" ItemsSource="{Binding ValueList}"
SelectedItem="{Binding SelValue}" SelectedItem="{Binding SelValue}"
HorizontalAlignment="Stretch" HorizontalAlignment="Stretch"/>
Margin="2.5,0,2.5,0"
Style="{StaticResource RightPanel_ComboBox}"/>
<Button Grid.Column="2" <Button Grid.Column="2"
Content="R" Content="R"
Command="{Binding ResetParam_Command}" Command="{Binding ResetParam_Command}"
IsEnabled="{Binding bIsModifiedFromDb}" IsEnabled="{Binding bIsModifiedFromDb}"
VerticalContentAlignment="Center" VerticalContentAlignment="Center"
HorizontalContentAlignment="Center" HorizontalContentAlignment="Center"
Margin="2.5,0,0,0" Margin="5,0,0,0"
Style="{StaticResource ToolBar_SmallButton}"/> Style="{StaticResource ToolBar_SmallButton}"/>
</Grid> </Grid>
</DataTemplate> </DataTemplate>
<DataTemplate DataType="{x:Type PrintApp:CheckMachiningParam}"> <DataTemplate DataType="{x:Type PrintApp:CheckMachiningParam}">
<Grid Height="22" <Grid>
Margin="0,1,2.5,1"
IsEnabled="{Binding bIsActive}">
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
<ColumnDefinition Width="2*"/> <ColumnDefinition Width="2*"/>
<ColumnDefinition Width="1*"/> <ColumnDefinition Width="1*"/>
<ColumnDefinition Width="Auto"/> <ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<TextBlock Text="{Binding sName}" <TextBlock Text="{Binding sName}"/>
Margin="0,0,2.5,0"
Style="{StaticResource ParameterList_TextBlock}"/>
<CheckBox Grid.Column="1" <CheckBox Grid.Column="1"
IsChecked="{Binding bValue}" IsChecked="{Binding bValue}"
HorizontalAlignment="Center" HorizontalAlignment="Center"
VerticalAlignment="Center" VerticalAlignment="Center"/>
Margin="2.5,0,0,0"/>
<Button Grid.Column="2" <Button Grid.Column="2"
Content="R" Content="R"
Command="{Binding ResetParam_Command}" Command="{Binding ResetParam_Command}"
IsEnabled="{Binding bIsModifiedFromDb}" IsEnabled="{Binding bIsModifiedFromDb}"
VerticalContentAlignment="Center" VerticalContentAlignment="Center"
HorizontalContentAlignment="Center" HorizontalContentAlignment="Center"
Margin="2.5,0,0,0" Margin="5,0,0,0"
Style="{StaticResource ToolBar_SmallButton}"/> Style="{StaticResource ToolBar_SmallButton}"/>
</Grid> </Grid>
</DataTemplate> </DataTemplate>
<DataTemplate DataType="{x:Type PrintApp:MaterialMachiningParam}"> <DataTemplate DataType="{x:Type PrintApp:MaterialMachiningParam}">
<Grid Height="22" <Grid>
Margin="0,1,2.5,1">
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
<ColumnDefinition Width="2*"/> <ColumnDefinition Width="2*"/>
<ColumnDefinition Width="1*"/> <ColumnDefinition Width="1*"/>
<ColumnDefinition Width="Auto"/> <ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<TextBlock Text="{Binding sName}" <TextBlock Text="{Binding sName}"/>
Margin="0,0,2.5,0"
Style="{StaticResource ParameterList_TextBlock}"/>
<CheckBox Grid.Column="1" <CheckBox Grid.Column="1"
IsChecked="{Binding bValue}" IsChecked="{Binding bValue}"
HorizontalAlignment="Center" HorizontalAlignment="Center"
VerticalAlignment="Center" VerticalAlignment="Center"/>
Margin="2.5,0,2.5,0"/>
<Button Grid.Column="2" <Button Grid.Column="2"
Content="R" Content="R"
Command="{Binding ResetParam_Command}" Command="{Binding ResetParam_Command}"
IsEnabled="{Binding bIsModifiedFromDb}" IsEnabled="{Binding bIsModifiedFromDb}"
VerticalContentAlignment="Center" VerticalContentAlignment="Center"
HorizontalContentAlignment="Center" HorizontalContentAlignment="Center"
Margin="2.5,0,0,0" Margin="5,0,0,0"
Style="{StaticResource ToolBar_SmallButton}"/> Style="{StaticResource ToolBar_SmallButton}"/>
</Grid> </Grid>
</DataTemplate> </DataTemplate>
<DataTemplate DataType="{x:Type PrintApp:OrderedMachiningParam}"> <DataTemplate DataType="{x:Type PrintApp:OrderedMachiningParam}">
<Grid Margin="0,1,2.5,1"> <Grid>
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/> <ColumnDefinition Width="1*"/>
<ColumnDefinition Width="Auto"/> <ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<TextBlock Text="{Binding sName}" <Grid.RowDefinitions>
Margin="0,0,2.5,0" <RowDefinition Height="Auto"/>
Style="{StaticResource ParameterList_TextBlock}"/> <RowDefinition Height="Auto"/>
<ListBox Grid.Column="1" </Grid.RowDefinitions>
ItemsSource="{Binding ValueList}" <TextBlock Text="{Binding sName}"/>
SelectedItem="{Binding SelValue}" <StackPanel Grid.Column="1"
Margin="2.5,0,2.5,0"/> Orientation="Horizontal"
<StackPanel Grid.Column="2" HorizontalAlignment="Right">
Orientation="Vertical"
VerticalAlignment="Center"
Margin="2.5,0,0,0">
<Button Content="˄"
Command="{Binding MoveUpOrder_Command}"
Margin="0,0,0,2.5"
Style="{StaticResource ToolBar_SmallButton}"/>
<Button Content="˅"
Command="{Binding MoveDownOrder_Command}"
Margin="0,2.5,0,2.5"
Style="{StaticResource ToolBar_SmallButton}"/>
<Button Content="&lt;>" <Button Content="&lt;>"
Command="{Binding ResetOrder_Command}" Command="{Binding ResetOrder_Command}"
Margin="0,2.5,0,2.5" Style="{StaticResource ToolBar_SmallButton}"/>
Style="{StaticResource ToolBar_SmallButton}"/> <Button Content="˄"
<Button Content="R" Command="{Binding MoveUpOrder_Command}"
Command="{Binding ResetParam_Command}" Style="{StaticResource ToolBar_SmallButton}"/>
IsEnabled="{Binding bIsModifiedFromDb}" <Button Content="˅"
VerticalContentAlignment="Center" Command="{Binding MoveDownOrder_Command}"
HorizontalContentAlignment="Center" Style="{StaticResource ToolBar_SmallButton}"/>
Margin="0,2.5,0,0" <Button Grid.Column="2"
Style="{StaticResource ToolBar_SmallButton}"/> Content="R"
Command="{Binding ResetParam_Command}"
IsEnabled="{Binding bIsModifiedFromDb}"
VerticalContentAlignment="Center"
HorizontalContentAlignment="Center"
Margin="5,0,0,0"
Style="{StaticResource ToolBar_SmallButton}"/>
</StackPanel> </StackPanel>
<ListBox Grid.ColumnSpan="2"
Grid.Row="1"
ItemsSource="{Binding ValueList}"
SelectedItem="{Binding SelValue}"/>
</Grid> </Grid>
</DataTemplate> </DataTemplate>
</ItemsControl.Resources> </ItemsControl.Resources>
</ItemsControl> </ItemsControl>
</Expander> </Expander>
@@ -199,29 +162,17 @@
</ItemsControl.ItemTemplate> </ItemsControl.ItemTemplate>
</ItemsControl> </ItemsControl>
</ScrollViewer> </ScrollViewer>
<UniformGrid Grid.Row="1" <UniformGrid Grid.Row="1" Rows="1">
Rows="1" <Button Content="Ok"
Margin="0,2.5,0,0"> Command="{Binding Ok_Command}"
<Button Command="{Binding Ok_Command}" Style="{StaticResource ToolBar_TextButton}"/>
Margin="0,0,2.5,0" <Button Content="Cancel"
Style="{StaticResource RightPanel_HalfRound_Button}"> Command="{Binding Cancel_Command}"
<Image Source="\Resources\Common\Ok.png" Style="{StaticResource ToolBar_TextButton}"/>
Style="{StaticResource Button_Image}"/> <Button Content="Save in Db"
</Button> Command="{Binding SaveInDb_Command}"
<Button Command="{Binding Cancel_Command}" Style="{StaticResource ToolBar_TextButton}"/>
Margin="0,0,2.5,0"
Style="{StaticResource RightPanel_HalfRound_Button}">
<Image Source="\Resources\Common\Cancel.png"
Style="{StaticResource Button_Image}"/>
</Button>
<Button Command="{Binding SaveInDb_Command}"
ToolTip="{Binding SaveInDb_ToolTip}"
Margin="0,0,2.5,0"
Style="{StaticResource RightPanel_HalfRound_Button}">
<Image Source="\Resources\CurrMachining\SaveInDb.png"
Style="{StaticResource Button_Image}"/>
</Button>
</UniformGrid> </UniformGrid>
</Grid> </Grid>
</Border> </Border>
</Grid> </UserControl>
@@ -18,16 +18,6 @@ Public Class CurrMachiningPanelVM
Map.refTopPanelVM.UpdateCurrMachining() Map.refTopPanelVM.UpdateCurrMachining()
End Sub End Sub
#Region "Tooltip"
Public ReadOnly Property SaveInDb_ToolTip As String
Get
Return "Save in Db"
End Get
End Property
#End Region ' Tooltip
' Definizione comandi ' Definizione comandi
Private m_cmdOk As ICommand Private m_cmdOk As ICommand
Private m_cmdCancel As ICommand Private m_cmdCancel As ICommand
@@ -69,24 +59,8 @@ Public Class CurrMachiningPanelVM
End Property End Property
Public Sub Ok() Public Sub Ok()
' verifico se modificata tipologia Ribs
Dim bIsModifiedRibsType As Boolean = False
Dim RibsCathegory As MachiningCathegory = CurrMachining.CathegoryList.FirstOrDefault(Function(x) x.Type = MachiningCathegory.Cathegories.RIBS)
If Not IsNothing(RibsCathegory) Then
Dim RibsTypeParam As MachiningParam = RibsCathegory.MachiningParamList.FirstOrDefault(Function(y) y.Type = MachiningParam.Params.RIBSTYPE)
If Not IsNothing(RibsTypeParam) Then
bIsModifiedRibsType = RibsTypeParam.bIsModified
End If
End If
' scrivo i parametri modificati ' scrivo i parametri modificati
m_CurrMachining.WriteCurrParamInPart(Map.refTopPanelVM.SelPart.nPartId) m_CurrMachining.WriteCurrParamInPart(Map.refTopPanelVM.SelPart.nPartId)
m_CurrMachining.Save()
' se modificata tipologia Ribs, aggiorno posizione riferimento
If bIsModifiedRibsType Then
Map.refReferencePanelVM.UpdateFramePosition()
Map.refDispositionPanelVM.UpdateZPos()
Map.refSliceManagerVM.UpdateDimensions()
End If
' ripristino modalita' standard ' ripristino modalita' standard
Map.refTopPanelVM.SelPage = Pages.MODIFY Map.refTopPanelVM.SelPage = Pages.MODIFY
End Sub End Sub
@@ -1,49 +0,0 @@
<RadioButton x:Class="CheckedImageRadioButton"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<RadioButton.Resources>
<SolidColorBrush x:Key="RadioButton.MouseOver.Background" Color="White"/>
<SolidColorBrush x:Key="RadioButton.MouseOver.Border" Color="#FF5593FF"/>
<SolidColorBrush x:Key="RadioButton.Pressed.Background" Color="#afcfe9"/>
<SolidColorBrush x:Key="RadioButton.Pressed.Border" Color="#FF3C77DD"/>
<SolidColorBrush x:Key="RadioButton.Disabled.Background" Color="#FFE6E6E6"/>
<SolidColorBrush x:Key="RadioButton.Disabled.Border" Color="#FFBCBCBC"/>
</RadioButton.Resources>
<RadioButton.Template>
<ControlTemplate TargetType="{x:Type RadioButton}">
<Border x:Name="RadioButtonBorder"
CornerRadius="4"
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
SnapsToDevicePixels="True">
<Image x:Name="RadioButtonImage"
Source="{Binding ImageSource, RelativeSource={RelativeSource AncestorType={x:Type ToggleButton}}}"
Stretch="Uniform"
Focusable="False"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
Margin="{TemplateBinding Padding}"
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="true">
<Setter Property="Background" TargetName="RadioButtonBorder" Value="{StaticResource RadioButton.MouseOver.Background}"/>
<Setter Property="BorderBrush" TargetName="RadioButtonBorder" Value="{StaticResource RadioButton.MouseOver.Border}"/>
</Trigger>
<Trigger Property="IsEnabled" Value="false">
<Setter Property="Background" TargetName="RadioButtonBorder" Value="{StaticResource RadioButton.Disabled.Background}"/>
<Setter Property="BorderBrush" TargetName="RadioButtonBorder" Value="{StaticResource RadioButton.Disabled.Border}"/>
</Trigger>
<Trigger Property="IsPressed" Value="true">
<Setter Property="Background" TargetName="RadioButtonBorder" Value="{StaticResource RadioButton.Pressed.Background}"/>
<Setter Property="BorderBrush" TargetName="RadioButtonBorder" Value="{StaticResource RadioButton.Pressed.Border}"/>
</Trigger>
<Trigger Property="IsChecked" Value="true">
<Setter Property="Source" TargetName="RadioButtonImage" Value="{Binding CheckedImageSource, RelativeSource={RelativeSource AncestorType={x:Type ToggleButton}}}"/>
<Setter Property="Background" TargetName="RadioButtonBorder" Value="{StaticResource Icarus_Gray}"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</RadioButton.Template>
</RadioButton>
@@ -1,25 +0,0 @@
Public Class CheckedImageRadioButton
Public Shared ReadOnly ImageSourceProperty As DependencyProperty = DependencyProperty.Register("ImageSource", GetType(String), GetType(CheckedImageRadioButton), New FrameworkPropertyMetadata(""))
Public Shadows Property ImageSource As String
Get
Return CStr(MyBase.GetValue(ImageSourceProperty))
End Get
Set(value As String)
MyBase.SetValue(ImageSourceProperty, value)
End Set
End Property
Public Shared ReadOnly CheckedImageSourceProperty As DependencyProperty = DependencyProperty.Register("CheckedImageSource", GetType(String), GetType(CheckedImageRadioButton), New FrameworkPropertyMetadata(""))
Public Shadows Property CheckedImageSource As String
Get
Return CStr(MyBase.GetValue(CheckedImageSourceProperty))
End Get
Set(value As String)
MyBase.SetValue(ImageSourceProperty, value)
End Set
End Property
End Class
@@ -1,47 +0,0 @@
<ToggleButton x:Class="CheckedImageToggleButton"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<ToggleButton.Template>
<ControlTemplate TargetType="{x:Type ToggleButton}">
<Border Name="ToggleButtonBorder"
CornerRadius="4"
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
SnapsToDevicePixels="true">
<Image Name="ToggleButtonImage"
Height="{DynamicResource ToggleButton.Image.Height}"
Width="{DynamicResource ToggleButton.Image.Width}"
Stretch="Uniform"
Source="{Binding ImageSource, RelativeSource={RelativeSource AncestorType={x:Type ToggleButton}}}"
Focusable="False"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
Margin="{TemplateBinding Padding}"
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="Button.IsDefaulted" Value="true">
<Setter Property="BorderBrush" TargetName="ToggleButtonBorder" Value="{DynamicResource {x:Static SystemColors.HighlightBrushKey}}"/>
</Trigger>
<Trigger Property="IsMouseOver" Value="true">
<Setter Property="Background" TargetName="ToggleButtonBorder" Value="{StaticResource Button.NoBackground.MouseOver.Background}"/>
<Setter Property="BorderBrush" TargetName="ToggleButtonBorder" Value="{StaticResource Button.NoBackground.MouseOver.Border}"/>
</Trigger>
<Trigger Property="IsPressed" Value="true">
<Setter Property="Background" TargetName="ToggleButtonBorder" Value="{StaticResource Button.NoBackground.Pressed.Background}"/>
<Setter Property="BorderBrush" TargetName="ToggleButtonBorder" Value="{StaticResource Button.NoBackground.Pressed.Border}"/>
</Trigger>
<Trigger Property="IsChecked" Value="true">
<Setter Property="Source" TargetName="ToggleButtonImage" Value="{Binding CheckedImageSource, RelativeSource={RelativeSource AncestorType={x:Type ToggleButton}}}"/>
<Setter Property="Background" TargetName="ToggleButtonBorder" Value="{StaticResource Icarus_Gray}"/>
</Trigger>
<Trigger Property="IsEnabled" Value="false">
<!--<Setter Property="Background" TargetName="ToggleButtonBorder" Value="{StaticResource Button.NoBackground.Disabled.Background}"/>-->
<Setter Property="BorderBrush" TargetName="ToggleButtonBorder" Value="{StaticResource Button.NoBackground.Disabled.Border}"/>
<Setter Property="OpacityMask" Value="#54707070"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</ToggleButton.Template>
</ToggleButton>
@@ -1,25 +0,0 @@
Public Class CheckedImageToggleButton
Public Shared ReadOnly ImageSourceProperty As DependencyProperty = DependencyProperty.Register("ImageSource", GetType(String), GetType(CheckedImageToggleButton), New FrameworkPropertyMetadata(""))
Public Shadows Property ImageSource As String
Get
Return CStr(MyBase.GetValue(ImageSourceProperty))
End Get
Set(value As String)
MyBase.SetValue(ImageSourceProperty, value)
End Set
End Property
Public Shared ReadOnly CheckedImageSourceProperty As DependencyProperty = DependencyProperty.Register("CheckedImageSource", GetType(String), GetType(CheckedImageToggleButton), New FrameworkPropertyMetadata(""))
Public Shadows Property CheckedImageSource As String
Get
Return CStr(MyBase.GetValue(CheckedImageSourceProperty))
End Get
Set(value As String)
MyBase.SetValue(ImageSourceProperty, value)
End Set
End Property
End Class
+149 -41
View File
@@ -1,15 +1,14 @@
<Grid x:Class="DispositionPanelV" <Grid x:Class="DispositionPanelV"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:EgtWPFLib5="clr-namespace:EgtWPFLib5;assembly=EgtWPFLib5" xmlns:EgtWPFLib5="clr-namespace:EgtWPFLib5;assembly=EgtWPFLib5"
xmlns:PrintApp="clr-namespace:Icarus" xmlns:PrintApp="clr-namespace:Icarus"
VerticalAlignment="Stretch" VerticalAlignment="Stretch"
Margin="5,0,0,0"> Margin="5">
<Grid.Resources> <Grid.Resources>
<PrintApp:CenterToolTipConverter x:Key="CenterToolTipConverter"/>
<PrintApp:FromBooleanToVisibility x:Key="FromBooleanToVisibility"/> <PrintApp:FromBooleanToVisibility x:Key="FromBooleanToVisibility"/>
</Grid.Resources> </Grid.Resources>
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/> <ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/> <ColumnDefinition Width="Auto"/>
@@ -24,21 +23,26 @@
<RowDefinition Height="{Binding ActualHeight, ElementName=MoveBtn}"/> <RowDefinition Height="{Binding ActualHeight, ElementName=MoveBtn}"/>
<RowDefinition Height="1*"/> <RowDefinition Height="1*"/>
</Grid.RowDefinitions> </Grid.RowDefinitions>
<ToggleButton x:Name="MoveBtn" <ToggleButton x:Name="MoveBtn"
Grid.Row="3" Grid.Row="3"
Content="Move" Content="Move"
IsChecked="{Binding bMove_IsChecked}" IsChecked="{Binding bMove_IsChecked}"
Margin="0,0,0,2.5" Style="{StaticResource ToolBar_TextToggleButton}"/>
Style="{StaticResource LeftPanel_ToggleButton}"/> <!--<Border Background="Red"
Grid.Column="1"
Grid.Row="1"
Grid.RowSpan="5"
Width="50"
VerticalAlignment="Stretch"/>-->
<Border x:Name="PopupBrd" <Border x:Name="PopupBrd"
Grid.Column="1" Grid.Column="1"
Grid.Row="1" Grid.Row="1"
Grid.RowSpan="5" Grid.RowSpan="5"
VerticalAlignment="Center" VerticalAlignment="Center"
Margin="5,0,0,0"
Visibility="{Binding IsChecked, ElementName=MoveBtn, Converter={StaticResource FromBooleanToVisibility}}" Visibility="{Binding IsChecked, ElementName=MoveBtn, Converter={StaticResource FromBooleanToVisibility}}"
Style="{StaticResource LeftPanel_Popup_Border}"> Style="{StaticResource LeftPanelPopup_Border}">
<Grid> <Grid>
<Grid.RowDefinitions> <Grid.RowDefinitions>
<RowDefinition Height="Auto"/> <RowDefinition Height="Auto"/>
@@ -52,65 +56,132 @@
<ColumnDefinition Width="1*"/> <ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<TextBlock Text="X" <TextBlock Text="X"
Style="{StaticResource Move_TextBlock}"/> VerticalAlignment="Center"/>
<EgtWPFLib5:EgtTextBox2 Text="{Binding sXPos, UpdateSourceTrigger=Explicit}" <EgtWPFLib5:EgtTextBox Text="{Binding sXPos, UpdateSourceTrigger=Explicit}"
Grid.Column="1" Grid.Column="1"
Margin="5,0,0,0" Margin="5,0,0,0"
Style="{StaticResource LeftPanel_TextBox2}"/> Style="{StaticResource LeftPanel_TextBox}"/>
</Grid> </Grid>
<Grid Grid.Row="1" <Grid Grid.Row="1"
Margin="0,2.5,0,2.5"> Margin="0,2.5,0,2.5">
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/> <ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="1*"/> <ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<TextBlock Text="Y" <TextBlock Text="Y"
Style="{StaticResource Move_TextBlock}"/> VerticalAlignment="Center"/>
<EgtWPFLib5:EgtTextBox2 Text="{Binding sYPos, UpdateSourceTrigger=Explicit}" <EgtWPFLib5:EgtTextBox Text="{Binding sYPos, UpdateSourceTrigger=Explicit}"
Grid.Column="1" Grid.Column="1"
Margin="5,0,0,0" Margin="5,0,0,0"
Style="{StaticResource LeftPanel_TextBox2}"/> Style="{StaticResource LeftPanel_TextBox}"/>
</Grid> </Grid>
<Grid Grid.Row="2" <Grid Grid.Row="2"
Margin="0,2.5,0,2.5"> Margin="0,2.5,0,0">
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/> <ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="1*"/> <ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<TextBlock Text="Z" <TextBlock Text="Z"
Style="{StaticResource Move_TextBlock}"/> VerticalAlignment="Center"/>
<EgtWPFLib5:EgtTextBox2 Text="{Binding sZPos, UpdateSourceTrigger=Explicit}" <EgtWPFLib5:EgtTextBox Text="{Binding sZPos, UpdateSourceTrigger=Explicit}"
Grid.Column="1" Grid.Column="1"
Margin="5,0,0,0" Margin="5,0,0,0"
Style="{StaticResource LeftPanel_TextBox2}"/> Style="{StaticResource LeftPanel_TextBox}"/>
</Grid> </Grid>
<Grid Grid.Row="3" <Grid Grid.Row="3"
Margin="0,2.5,0,0"> Margin="0,2.5,0,0">
<Button Content="Drag" <Button Content="Drag"
Command="{Binding DragMove_Command}" Command="{Binding DragMove_Command}"
Style="{StaticResource LeftPanel_TextButton}"/> Style="{StaticResource LeftPanel_TextButton}"/>
</Grid> </Grid>
</Grid> </Grid>
</Border> </Border>
<!--<Popup IsOpen="{Binding IsChecked, ElementName=MoveBtn}"
PlacementTarget="{Binding ElementName=MoveBtn}"
Style="{StaticResource LeftPanel_Popup}">
<Border x:Name="PopupBrd" Style="{StaticResource LeftPanelPopup_Border}">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Grid Margin="0,0,0,2.5">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<TextBlock Text="X"
VerticalAlignment="Center"/>
<EgtWPFLib5:EgtTextBox Text="{Binding sXPos, UpdateSourceTrigger=Explicit}"
Grid.Column="1"
Margin="5,0,0,0"
Style="{StaticResource LeftPanel_TextBox}"/>
</Grid>
<Grid Grid.Row="1"
Margin="0,2.5,0,2.5">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<TextBlock Text="Y"
VerticalAlignment="Center"/>
<EgtWPFLib5:EgtTextBox Text="{Binding sYPos, UpdateSourceTrigger=Explicit}"
Grid.Column="1"
Margin="5,0,0,0"
Style="{StaticResource LeftPanel_TextBox}"/>
</Grid>
<Grid Grid.Row="2"
Margin="0,2.5,0,0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<TextBlock Text="Z"
VerticalAlignment="Center"/>
<EgtWPFLib5:EgtTextBox Text="{Binding sZPos, UpdateSourceTrigger=Explicit}"
Grid.Column="1"
Margin="5,0,0,0"
Style="{StaticResource LeftPanel_TextBox}"/>
</Grid>
<Grid Grid.Row="3"
Margin="0,2.5,0,0">
<Button Content="Drag"
Command="{Binding DragMove_Command}"
Style="{StaticResource LeftPanel_TextButton}"/>
</Grid>
</Grid>
</Border>
</Popup>-->
<ToggleButton x:Name="RotateBtn" <ToggleButton x:Name="RotateBtn"
Grid.Row="4" Grid.Row="4"
Content="Rotate" Content="Rotate"
IsChecked="{Binding bRotate_IsChecked}" IsChecked="{Binding bRotate_IsChecked}"
Margin="0,2.5,0,0" Style="{StaticResource ToolBar_TextToggleButton}"/>
Style="{StaticResource LeftPanel_ToggleButton}"/> <!--<Border Background="Blue"
Grid.Column="2"
Grid.Row="2"
Grid.RowSpan="5"
Width="50"
VerticalAlignment="Stretch"
HorizontalAlignment="Stretch"/>-->
<Border Grid.Column="1" <Border Grid.Column="1"
Grid.Row="2" Grid.Row="2"
Grid.RowSpan="5" Grid.RowSpan="5"
VerticalAlignment="Center" VerticalAlignment="Center"
Margin="5,0,0,0"
Visibility="{Binding IsChecked, ElementName=RotateBtn, Converter={StaticResource FromBooleanToVisibility}}" Visibility="{Binding IsChecked, ElementName=RotateBtn, Converter={StaticResource FromBooleanToVisibility}}"
Style="{StaticResource LeftPanel_Popup_Border}"> Style="{StaticResource LeftPanelPopup_Border}">
<Grid> <Grid>
<Grid.RowDefinitions> <Grid.RowDefinitions>
<RowDefinition Height="Auto"/> <RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/> <RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/> <RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions> </Grid.RowDefinitions>
<UniformGrid Columns="3"> <UniformGrid Columns="3">
<RadioButton Content="X" <RadioButton Content="X"
@@ -126,17 +197,54 @@
IsChecked="{Binding RotZ}" IsChecked="{Binding RotZ}"
Style="{StaticResource ToolBar_ToggleButton}"/> Style="{StaticResource ToolBar_ToggleButton}"/>
</UniformGrid> </UniformGrid>
<EgtWPFLib5:EgtTextBox2 Grid.Row="1" <EgtWPFLib5:EgtTextBox Grid.Row="1"
Text="{Binding sRotAngle, UpdateSourceTrigger=Explicit}" Text="{Binding sRotAngle, UpdateSourceTrigger=Explicit}"
ResetValueOnLostFocus="False" Margin="0,5,0,0"/>
Margin="0,5,0,2.5"/>
<Grid Grid.Row="2" <Grid Grid.Row="2"
Margin="0,2.5,0,0"> Margin="0,2.5,0,0">
<Button Content="Drag" <Button Content="Drag"
Command="{Binding DragRotate_Command}" Command="{Binding DragRotate_Command}"
Style="{StaticResource LeftPanel_TextButton}"/> Style="{StaticResource LeftPanel_TextButton}"/>
</Grid> </Grid>
</Grid> </Grid>
</Border> </Border>
<!--<Popup IsOpen="{Binding IsChecked, ElementName=RotateBtn}"
Grid.Column="1"
PlacementTarget="{Binding ElementName=RotateBtn}"
Style="{StaticResource LeftPanel_Popup}">
<Border Style="{StaticResource LeftPanelPopup_Border}">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<UniformGrid Columns="3">
<RadioButton Content="X"
GroupName="Axes"
IsChecked="{Binding RotAxes[0]}"
Style="{StaticResource ToolBar_ToggleButton}"/>
<RadioButton Content="Y"
GroupName="Axes"
IsChecked="{Binding RotAxes[1]}"
Style="{StaticResource ToolBar_ToggleButton}"/>
<RadioButton Content="Z"
GroupName="Axes"
IsChecked="{Binding RotAxes[2]}"
Style="{StaticResource ToolBar_ToggleButton}"/>
</UniformGrid>
<EgtWPFLib5:EgtTextBox Grid.Row="1"
Text="{Binding sRotAngle, UpdateSourceTrigger=Explicit}"
Margin="0,5,0,0"/>
<Grid Grid.Row="2"
Margin="0,2.5,0,0">
<Button Content="Drag"
Command="{Binding DragRotate_Command}"
Style="{StaticResource LeftPanel_TextButton}"/>
</Grid>
</Grid>
</Border>
</Popup>-->
</Grid> </Grid>
+82 -93
View File
@@ -20,7 +20,25 @@ Public Class DispositionPanelVM
EgtStartPoint(Map.refTopPanelVM.SelPart.nReferenceId, GDB_ID.ROOT, ptReference) EgtStartPoint(Map.refTopPanelVM.SelPart.nReferenceId, GDB_ID.ROOT, ptReference)
Dim dNewXPos As Double = ptReference.x Dim dNewXPos As Double = ptReference.x
StringToLen(value, dNewXPos) StringToLen(value, dNewXPos)
Dim b3Print As BBox3d = GetSolidForReferenceBBox(Map.refTopPanelVM.SelPart) Dim b3Print As New BBox3d
EgtGetBBoxGlob(Map.refTopPanelVM.SelPart.nPrintSolidId, GDB_BB.EXACT, b3Print)
If EgtGetGroupObjs(Map.refTopPanelVM.SelPart.nRibsLayerId) > 0 Then
Dim b3Ribs As New BBox3d()
Dim nRibId As Integer = EgtGetFirstInGroup(Map.refTopPanelVM.SelPart.nRibsLayerId)
While nRibId <> GDB_ID.NULL
Dim nRibType As Integer = Machining.MPAR_RIBSTYPE.INTERNAL
EgtGetInfo(nRibId, MAC_RIBSTYPE, nRibType)
If nRibType = Machining.MPAR_RIBSTYPE.EXTERNAL OrElse nRibType = Machining.MPAR_RIBSTYPE.UNBOUNDED Then
Dim b3Rib As New BBox3d
EgtGetBBoxGlob(nRibId, GDB_BB.EXACT, b3Rib)
b3Ribs.Add(b3Rib)
End If
nRibId = EgtGetNext(nRibId)
End While
If b3Ribs.Min.x <> INFINITO Then
b3Print.Add(b3Ribs)
End If
End If
Dim dMin As Double = 0 Dim dMin As Double = 0
Dim dMax As Double = CurrentMachine.b3Tab.DimX Dim dMax As Double = CurrentMachine.b3Tab.DimX
If b3Print.Max.x > ptReference.x Then If b3Print.Max.x > ptReference.x Then
@@ -29,18 +47,13 @@ Public Class DispositionPanelVM
If b3Print.Min.x < ptReference.x Then If b3Print.Min.x < ptReference.x Then
dMin += ptReference.x - b3Print.Min.x dMin += ptReference.x - b3Print.Min.x
End If End If
' riduco a spostamento massimo If dNewXPos >= dMin AndAlso dNewXPos <= dMax Then
If dNewXPos < dMin Then EgtMove(Map.refTopPanelVM.SelPart.nPartId, New Point3d(dNewXPos, ptReference.y, ptReference.z) - ptReference, GDB_RT.GLOB)
dNewXPos = dMin Map.refReferencePanelVM.UpdateFramePosition()
ElseIf dNewXPos > dMax Then EgtDraw()
dNewXPos = dMax Else
NotifyPropertyChanged(NameOf(sXPos))
End If End If
EgtMove(Map.refTopPanelVM.SelPart.nPartId, New Point3d(dNewXPos, ptReference.y, ptReference.z) - ptReference, GDB_RT.GLOB)
Map.refReferencePanelVM.UpdateFramePosition()
EgtDraw()
NotifyPropertyChanged(NameOf(sXPos))
' Imposto flag di ricalcolo part-program
EgtSetInfo(Map.refTopPanelVM.SelPart.nPartId, MAC_TORECALC_GENERATE, True)
End Set End Set
End Property End Property
@@ -59,7 +72,25 @@ Public Class DispositionPanelVM
EgtStartPoint(Map.refTopPanelVM.SelPart.nReferenceId, GDB_ID.ROOT, ptReference) EgtStartPoint(Map.refTopPanelVM.SelPart.nReferenceId, GDB_ID.ROOT, ptReference)
Dim dNewYPos As Double = ptReference.y Dim dNewYPos As Double = ptReference.y
StringToLen(value, dNewYPos) StringToLen(value, dNewYPos)
Dim b3Print As BBox3d = GetSolidForReferenceBBox(Map.refTopPanelVM.SelPart) Dim b3Print As New BBox3d
EgtGetBBoxGlob(Map.refTopPanelVM.SelPart.nPrintSolidId, GDB_BB.EXACT, b3Print)
If EgtGetGroupObjs(Map.refTopPanelVM.SelPart.nRibsLayerId) > 0 Then
Dim b3Ribs As New BBox3d()
Dim nRibId As Integer = EgtGetFirstInGroup(Map.refTopPanelVM.SelPart.nRibsLayerId)
While nRibId <> GDB_ID.NULL
Dim nRibType As Integer = Machining.MPAR_RIBSTYPE.INTERNAL
EgtGetInfo(nRibId, MAC_RIBSTYPE, nRibType)
If nRibType = Machining.MPAR_RIBSTYPE.EXTERNAL OrElse nRibType = Machining.MPAR_RIBSTYPE.UNBOUNDED Then
Dim b3Rib As New BBox3d
EgtGetBBoxGlob(nRibId, GDB_BB.EXACT, b3Rib)
b3Ribs.Add(b3Rib)
End If
nRibId = EgtGetNext(nRibId)
End While
If b3Ribs.Min.x <> INFINITO Then
b3Print.Add(b3Ribs)
End If
End If
Dim dMin As Double = 0 Dim dMin As Double = 0
Dim dMax As Double = CurrentMachine.b3Tab.DimY Dim dMax As Double = CurrentMachine.b3Tab.DimY
If b3Print.Max.y > ptReference.y Then If b3Print.Max.y > ptReference.y Then
@@ -68,18 +99,13 @@ Public Class DispositionPanelVM
If b3Print.Min.y < ptReference.y Then If b3Print.Min.y < ptReference.y Then
dMin += ptReference.y - b3Print.Min.y dMin += ptReference.y - b3Print.Min.y
End If End If
' riduco a spostamento massimo If dNewYPos >= dMin AndAlso dNewYPos <= dMax Then
If dNewYPos < dMin Then EgtMove(Map.refTopPanelVM.SelPart.nPartId, New Point3d(ptReference.x, dNewYPos, ptReference.z) - ptReference, GDB_RT.GLOB)
dNewYPos = dMin Map.refReferencePanelVM.UpdateFramePosition()
ElseIf dNewyPos > dMax Then EgtDraw()
dNewYPos = dMax Else
NotifyPropertyChanged(NameOf(sYPos))
End If End If
EgtMove(Map.refTopPanelVM.SelPart.nPartId, New Point3d(ptReference.x, dNewYPos, ptReference.z) - ptReference, GDB_RT.GLOB)
Map.refReferencePanelVM.UpdateFramePosition()
EgtDraw()
NotifyPropertyChanged(NameOf(sYPos))
' Imposto flag di ricalcolo part-program
EgtSetInfo(Map.refTopPanelVM.SelPart.nPartId, MAC_TORECALC_GENERATE, True)
End Set End Set
End Property End Property
@@ -87,7 +113,7 @@ Public Class DispositionPanelVM
Get Get
If Not IsNothing(Map.refTopPanelVM.SelPart) Then If Not IsNothing(Map.refTopPanelVM.SelPart) Then
Dim ptReference As New Point3d Dim ptReference As New Point3d
EgtStartPoint(Map.refTopPanelVM.SelPart.nPartReferenceId, GDB_ID.ROOT, ptReference) EgtStartPoint(Map.refTopPanelVM.SelPart.nReferenceId, GDB_ID.ROOT, ptReference)
Return LenToString(ptReference.z, 1) Return LenToString(ptReference.z, 1)
Else Else
Return "" Return ""
@@ -95,70 +121,19 @@ Public Class DispositionPanelVM
End Get End Get
Set(value As String) Set(value As String)
Dim ptReference As New Point3d Dim ptReference As New Point3d
EgtStartPoint(Map.refTopPanelVM.SelPart.nPartReferenceId, GDB_ID.ROOT, ptReference) EgtStartPoint(Map.refTopPanelVM.SelPart.nReferenceId, GDB_ID.ROOT, ptReference)
Dim dNewZPos As Double = ptReference.z Dim dNewZPos As Double = ptReference.z
StringToLen(value, dNewZPos) StringToLen(value, dNewZPos)
Dim b3Print As BBox3d = GetSolidForReferenceBBox(Map.refTopPanelVM.SelPart) If dNewZPos >= 0 Then
Dim dMin As Double = 0 EgtMove(Map.refTopPanelVM.SelPart.nPartId, New Point3d(ptReference.x, ptReference.y, dNewZPos) - ptReference, GDB_RT.GLOB)
If b3Print.Min.z < ptReference.z Then Map.refReferencePanelVM.UpdateFramePosition()
dMin += ptReference.z - b3Print.Min.z EgtDraw()
Else
NotifyPropertyChanged(NameOf(sZPos))
End If End If
' riduco a spostamento massimo
If dNewZPos < dMin Then
dNewZPos = dMin
End If
EgtMove(Map.refTopPanelVM.SelPart.nPartId, New Point3d(ptReference.x, ptReference.y, dNewZPos) - ptReference, GDB_RT.GLOB)
Map.refReferencePanelVM.UpdateFramePosition()
EgtDraw()
NotifyPropertyChanged(NameOf(sZPos))
' Imposto flag di ricalcolo part-program
EgtSetInfo(Map.refTopPanelVM.SelPart.nPartId, MAC_TORECALC_GENERATE, True)
End Set End Set
End Property End Property
Friend Sub UpdateZPos()
Dim ptReference As New Point3d
EgtStartPoint(Map.refTopPanelVM.SelPart.nPartReferenceId, GDB_ID.ROOT, ptReference)
Dim dNewZPos As Double = ptReference.z
Dim b3Print As BBox3d = GetSolidForReferenceBBox(Map.refTopPanelVM.SelPart)
Dim dMin As Double = 0
If b3Print.Min.z < ptReference.z Then
dMin += ptReference.z - b3Print.Min.z
End If
If ptReference.z < dMin Then
EgtMove(Map.refTopPanelVM.SelPart.nPartId, New Point3d(ptReference.x, ptReference.y, dMin) - ptReference, GDB_RT.GLOB)
Map.refDispositionPanelVM.RefreshPos()
EgtDraw()
End If
NotifyPropertyChanged(NameOf(sZPos))
End Sub
' funzione che calcola il box totale del solido da stampare piu' ribs esterne ed unbounded
Friend Function GetSolidForReferenceBBox(SelPart As Print3dPartVM) As BBox3d
Dim b3Print As New BBox3d
EgtGetBBoxGlob(SelPart.nPrintSolidId, GDB_BB.EXACT, b3Print)
If EgtGetGroupObjs(SelPart.nRibsLayerId) > 0 Then
Dim b3Ribs As New BBox3d()
Dim nRibId As Integer = EgtGetFirstInGroup(SelPart.nRibsLayerId)
While nRibId <> GDB_ID.NULL
Dim nRibType As Integer = Machining.MPAR_RIBSTYPE.INTERNAL
If Not EgtGetInfo(nRibId, MAC_RIBSTYPE, nRibType) Then
EgtGetInfo(SelPart.nPartId, MAC_RIBSTYPE, nRibType)
End If
If nRibType = Machining.MPAR_RIBSTYPE.EXTERNAL OrElse nRibType = Machining.MPAR_RIBSTYPE.UNBOUNDED Then
Dim b3Rib As New BBox3d
EgtGetBBoxGlob(nRibId, GDB_BB.EXACT, b3Rib)
b3Ribs.Add(b3Rib)
End If
nRibId = EgtGetNext(nRibId)
End While
If Not b3Ribs.IsEmpty() Then
b3Print.Add(b3Ribs)
End If
End If
Return b3Print
End Function
Private m_RotAxes As Boolean() = { False, False, False} Private m_RotAxes As Boolean() = { False, False, False}
Public Property RotX As Boolean Public Property RotX As Boolean
Get Get
@@ -210,25 +185,19 @@ Public Class DispositionPanelVM
Return Return
End If End If
Dim vtMovedPart As Vector3d Dim vtMovedPart As Vector3d
If EgtGetInfo(Map.refTopPanelVM.SelPart.nPartId, KEY_MOVEDPART, vtMovedPart) Then if EgtGetInfo(Map.refTopPanelVM.SelPart.nPartId, "MovedPart", vtMovedPart) Then
Dim nEntId = EgtGetFirstInGroup(Map.refTopPanelVM.SelPart.nPrintSolidLayerId) Dim nEntId = EgtGetFirstInGroup( Map.refTopPanelVM.SelPart.nPrintSolidLayerId)
While nEntId <> GDB_ID.NULL While nEntId <> GDB_ID.NULL
EgtMove(nEntId, -vtMovedPart, GDB_RT.GLOB) EgtMove(nEntId, -vtMovedPart, GDB_RT.GLOB)
nEntId = EgtGetNext(nEntId) nEntId = EgtGetNext( nEntId)
End While End While
EgtRemoveInfo(Map.refTopPanelVM.SelPart.nPartId, KEY_MOVEDPART) EgtRemoveInfo(Map.refTopPanelVM.SelPart.nPartId, "MovedPart")
End If
If EgtGetInfo(Map.refTopPanelVM.SelPart.nPartId, KEY_MOVEDPART2, vtMovedPart) Then
EgtMove(Map.refTopPanelVM.SelPart.nPartId, -vtMovedPart, GDB_RT.GLOB)
EgtMove(Map.refTopPanelVM.SelPart.nReferenceId, vtMovedPart, GDB_RT.GLOB)
EgtRemoveInfo(Map.refTopPanelVM.SelPart.nPartId, KEY_MOVEDPART2)
End If End If
Dim b3PrintSolid As New BBox3d Dim b3PrintSolid As New BBox3d
EgtGetBBoxGlob(Map.refTopPanelVM.SelPart.nPartId, GDB_BB.STANDARD, b3PrintSolid) EgtGetBBoxGlob(Map.refTopPanelVM.SelPart.nPartId, GDB_BB.STANDARD, b3PrintSolid)
If EgtRotate(Map.refTopPanelVM.SelPart.nPartId, b3PrintSolid.Center, vtSelRotAxes, dNewAngle, GDB_RT.GLOB) Then If EgtRotate(Map.refTopPanelVM.SelPart.nPartId, b3PrintSolid.Center, vtSelRotAxes, dNewAngle, GDB_RT.GLOB) Then
m_sRotAngle = 0 m_sRotAngle = 0
Map.refReferencePanelVM.UpdateFramePosition() Map.refReferencePanelVM.UpdateFramePosition()
Map.refDispositionPanelVM.UpdateZPos()
RefreshPos() RefreshPos()
EgtDraw() EgtDraw()
NotifyPropertyChanged(NameOf(sRotAngle)) NotifyPropertyChanged(NameOf(sRotAngle))
@@ -395,6 +364,26 @@ Public Class DispositionPanelVM
End Class End Class
Public Class CenterToolTipConverter
Implements IMultiValueConverter
Public Function Convert(ByVal values As Object(), ByVal targetType As Type, ByVal parameter As Object, ByVal culture As CultureInfo) As Object Implements IMultiValueConverter.Convert
For Each value In values
If TypeOf (value) IsNot Double Then
Return Double.NaN
End If
Next
Dim placementTargetHeight As Double = CDbl(values(0))
Dim toolTipHeight As Double = CDbl(values(1))
Return (placementTargetHeight / 2.0) - (toolTipHeight / 2.0)
End Function
Public Function ConvertBack(ByVal value As Object, ByVal targetTypes As Type(), ByVal parameter As Object, ByVal culture As CultureInfo) As Object() Implements IMultiValueConverter.ConvertBack
Throw New NotSupportedException()
End Function
End Class
Public Class FromBooleanToVisibility Public Class FromBooleanToVisibility
Implements IValueConverter Implements IValueConverter
-55
View File
@@ -1,55 +0,0 @@
<EgtWPFLib5:EgtMainWindow x:Class="EgtMessageBoxV"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:EgtWPFLib5="clr-namespace:EgtWPFLib5;assembly=EgtWPFLib5"
Title="{Binding sTitle}"
SizeToContent="WidthAndHeight"
WindowStartupLocation="CenterOwner"
Style="{StaticResource Dialog_Window}">
<Grid Margin="2.5,2.5,2.5,0">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Grid Margin="20,20,20,20">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<Image Source="{Binding sIconSource}"
Margin="0,0,0,0"/>
<TextBlock Grid.Column="1"
Text="{Binding sMessage}"
Margin="5,0,5,0"
Style="{StaticResource DialogWindow_TextBlock}"/>
</Grid>
<ItemsControl Grid.Row="1"
ItemsSource="{Binding ButtonList}"
HorizontalAlignment="Center">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<UniformGrid Rows="1"/>
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate>
<DataTemplate>
<Button IsDefault="{Binding bIsDefault}"
Content="{Binding sMessage}"
Command="{Binding Command_Command}"
Margin="2.5,0,2.5,0"
Style="{StaticResource RightPanel_HalfRound_Button}"/>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
<!--<UniformGrid Grid.Column="1"
Grid.Row="1"
Rows="1">
<Button IsCancel="True"
Content="Ok"
Command="{Binding Ok_Command}"
Style="{StaticResource RightPanel_HalfRound_Button}"/>
</UniformGrid>-->
</Grid>
</EgtWPFLib5:EgtMainWindow>
-107
View File
@@ -1,107 +0,0 @@
Public Class EgtMessageBoxV
#Region "FIELDS & PROPERTIES"
Private WithEvents m_EgtMessageBoxVM As EgtMessageBoxVM
Private Shadows DialogResult As MessageBoxResult
#End Region ' FIELDS & PROPERTIES
#Region "CONTRUCTORS"
Sub New(Owner As Window, EgtMessageBoxVM As EgtMessageBoxVM)
MyBase.New(Owner)
' This call is required by the designer.
InitializeComponent()
Me.DataContext = EgtMessageBoxVM
' Assegno al riferimento locale al VM il VM preso dal DataContext
m_EgtMessageBoxVM = EgtMessageBoxVM
End Sub
#End Region
#Region "METHODS"
''' <summary>
''' Apre una EgtMessageBox con un messaggio che ritorna un risultato
''' </summary>
''' <param name="Owner">Finestra di appartenenza</param>
''' <param name="sMessageBoxText">Stringa che specifica il messaggio da mostrare</param>
''' <returns>Valore che specifica quale bottone e' stato premuto dall'utente</returns>
Public Overloads Shared Function Show(Owner As Window, sMessageBoxText As String) As MessageBoxResult
Dim NewMessagebox As New EgtMessageBoxV(Owner, New EgtMessageBoxVM(sMessageBoxText))
NewMessagebox.ShowDialog()
Return NewMessagebox.DialogResult
End Function
''' <summary>
''' Apre una EgtMessageBox con un titolo ed un messaggio che ritorna un risultato
''' </summary>
''' <param name="Owner">Finestra di appartenenza</param>
''' <param name="sMessageBoxText">Stringa che specifica il messaggio da mostrare</param>
''' <param name="sCaption">Stringa che specifica il titolo da mostrare</param>
''' <returns>Valore che specifica quale bottone e' stato premuto dall'utente</returns>
Public Overloads Shared Function Show(Owner As Window, sMessageBoxText As String, sCaption As String) As MessageBoxResult
Dim NewMessagebox As New EgtMessageBoxV(Owner, New EgtMessageBoxVM(sMessageBoxText, sCaption))
NewMessagebox.ShowDialog()
Return NewMessagebox.DialogResult
End Function
''' <summary>
''' Apre una EgtMessageBox con un titolo ed un messaggio che ritorna un risultato
''' </summary>
''' <param name="Owner">Finestra di appartenenza</param>
''' <param name="sMessageBoxText">Stringa che specifica il messaggio da mostrare</param>
''' <param name="sCaption">Stringa che specifica il titolo da mostrare</param>
''' <param name="Button">Valore che specifica quali bottoni mostrare</param>
''' <returns>Valore che specifica quale bottone e' stato premuto dall'utente</returns>
Public Overloads Shared Function Show(Owner As Window, sMessageBoxText As String, sCaption As String, Button As MessageBoxButton) As MessageBoxResult
Dim NewMessagebox As New EgtMessageBoxV(Owner, New EgtMessageBoxVM(sMessageBoxText, sCaption, Button))
NewMessagebox.ShowDialog()
Return NewMessagebox.DialogResult
End Function
''' <summary>
''' Apre una EgtMessageBox con un titolo ed un messaggio che ritorna un risultato
''' </summary>
''' <param name="Owner">Finestra di appartenenza</param>
''' <param name="sMessageBoxText">Stringa che specifica il messaggio da mostrare</param>
''' <param name="sCaption">Stringa che specifica il titolo da mostrare</param>
''' <param name="Button">Valore che specifica quali bottoni mostrare</param>
''' <param name="Icon">Valore che specifica quale icona mostrare</param>
''' <returns>Valore che specifica quale bottone e' stato premuto dall'utente</returns>
Public Overloads Shared Function Show(Owner As Window, sMessageBoxText As String, sCaption As String, Button As MessageBoxButton, Icon As MessageBoxImage) As MessageBoxResult
Dim NewMessagebox As New EgtMessageBoxV(Owner, New EgtMessageBoxVM(sMessageBoxText, sCaption, Button, Icon))
NewMessagebox.ShowDialog()
Return NewMessagebox.DialogResult
End Function
''' <summary>
''' Apre una EgtMessageBox con un titolo ed un messaggio che ritorna un risultato
''' </summary>
''' <param name="Owner">Finestra di appartenenza</param>
''' <param name="sMessageBoxText">Stringa che specifica il messaggio da mostrare</param>
''' <param name="sCaption">Stringa che specifica il titolo da mostrare</param>
''' <param name="Button">Valore che specifica quali bottoni mostrare</param>
''' <param name="Icon">Valore che specifica quale icona mostrare</param>
''' <param name="DefaultResult">Valore che specifica il bottone di default</param>
''' <returns>Valore che specifica quale bottone e' stato premuto dall'utente</returns>
Public Overloads Shared Function Show(Owner As Window, sMessageBoxText As String, sCaption As String, Button As MessageBoxButton, Icon As MessageBoxImage, DefaultResult As MessageBoxResult) As MessageBoxResult
Dim NewMessagebox As New EgtMessageBoxV(Owner, New EgtMessageBoxVM(sMessageBoxText, sCaption, Button, Icon, DefaultResult))
NewMessagebox.ShowDialog()
Return NewMessagebox.DialogResult
End Function
#End Region ' METHODS
#Region "EVENTS"
Private Sub CloseWindow(DialogResult As MessageBoxResult) Handles m_EgtMessageBoxVM.m_CloseWindow
Me.DialogResult = DialogResult
Me.Close()
End Sub
#End Region
End Class
-234
View File
@@ -1,234 +0,0 @@
Imports EgtUILib
Imports EgtWPFLib5
Public Class EgtMessageBoxVM
Inherits VMBase
#Region "FIELDS & PROPERTIES"
Friend Event m_CloseWindow(DialogResult As MessageBoxResult)
Private m_sTitle As String = ""
Public ReadOnly Property sTitle As String
Get
Return m_sTitle
End Get
End Property
Private m_sMessage As String = ""
Public ReadOnly Property sMessage As String
Get
Return m_sMessage
End Get
End Property
Private m_Button As MessageBoxButton
Private m_Icon As MessageBoxImage
Public ReadOnly Property sIconSource As String
Get
Select Case m_Icon
Case MessageBoxImage.Hand
Return "\Resources\EgtMessageBox\Error.png"
Case MessageBoxImage.Question
Return "\Resources\EgtMessageBox\Question.png"
Case MessageBoxImage.Exclamation
Return "\Resources\EgtMessageBox\Warning.png"
Case MessageBoxImage.Asterisk
Return "\Resources\EgtMessageBox\Information.png"
Case MessageBoxImage.Stop
Return "\Resources\EgtMessageBox\Error.png"
Case MessageBoxImage.Error
Return "\Resources\EgtMessageBox\Error.png"
Case MessageBoxImage.Warning
Return "\Resources\EgtMessageBox\Warning.png"
Case MessageBoxImage.Information
Return "\Resources\EgtMessageBox\Information.png"
Case Else ' MessageBoxImage.None
Return ""
End Select
End Get
End Property
Private m_ButtonList As New List(Of EgtMsgBoxButton)
Public Property ButtonList As List(Of EgtMsgBoxButton)
Get
Return m_ButtonList
End Get
Set(value As List(Of EgtMsgBoxButton))
m_ButtonList = value
End Set
End Property
#End Region ' FIELDS & PROPERTIES
#Region "CONTRUCTORS"
Sub New(sMessageBoxText As String)
EgtMsgBoxButton.SetOwner(Me)
m_sMessage = sMessageBoxText
m_Button = MessageBoxButton.OK
m_Icon = MessageBoxImage.None
NotifyPropertyChanged(NameOf(ButtonList))
NotifyPropertyChanged(NameOf(sIconSource))
End Sub
Sub New(sMessageBoxText As String, sCaption As String)
MyClass.New(sMessageBoxText)
m_sTitle = sCaption
End Sub
Sub New(sMessageBoxText As String, sCaption As String, Button As MessageBoxButton)
MyClass.New(sMessageBoxText, sCaption)
m_Button = Button
Select Case m_Button
Case MessageBoxButton.OK
m_ButtonList.Add(New EgtMsgBoxButton(EgtMsgBoxButton.Types.OK))
Case MessageBoxButton.OKCancel
m_ButtonList.Add(New EgtMsgBoxButton(EgtMsgBoxButton.Types.OK))
m_ButtonList.Add(New EgtMsgBoxButton(EgtMsgBoxButton.Types.CANCEL))
Case MessageBoxButton.YesNoCancel
m_ButtonList.Add(New EgtMsgBoxButton(EgtMsgBoxButton.Types.YES))
m_ButtonList.Add(New EgtMsgBoxButton(EgtMsgBoxButton.Types.NO))
m_ButtonList.Add(New EgtMsgBoxButton(EgtMsgBoxButton.Types.CANCEL))
Case MessageBoxButton.YesNo
m_ButtonList.Add(New EgtMsgBoxButton(EgtMsgBoxButton.Types.YES))
m_ButtonList.Add(New EgtMsgBoxButton(EgtMsgBoxButton.Types.NO))
End Select
NotifyPropertyChanged(NameOf(ButtonList))
End Sub
Sub New(sMessageBoxText As String, sCaption As String, Button As MessageBoxButton, Icon As MessageBoxImage)
MyClass.New(sMessageBoxText, sCaption, Button)
m_Icon = Icon
NotifyPropertyChanged(NameOf(sIconSource))
End Sub
Sub New(sMessageBoxText As String, sCaption As String, Button As MessageBoxButton, Icon As MessageBoxImage, DefaultResult As MessageBoxResult)
MyClass.New(sMessageBoxText, sCaption, Button, Icon)
Dim DefaultBtn As EgtMsgBoxButton = m_ButtonList.FirstOrDefault(Function(x) (x.Type = EgtMsgBoxButton.Types.OK AndAlso DefaultResult = MessageBoxResult.OK) OrElse
(x.Type = EgtMsgBoxButton.Types.CANCEL AndAlso DefaultResult = MessageBoxResult.Cancel) OrElse
(x.Type = EgtMsgBoxButton.Types.YES AndAlso DefaultResult = MessageBoxResult.Yes) OrElse
(x.Type = EgtMsgBoxButton.Types.NO AndAlso DefaultResult = MessageBoxResult.No))
If Not IsNothing(DefaultBtn) Then
DefaultBtn.SetIsDefault(True)
End If
NotifyPropertyChanged(NameOf(ButtonList))
End Sub
#End Region ' CONTRUCTORS
#Region "METHODS"
Friend Sub CloseWindow(DialogResult As MessageBoxResult)
RaiseEvent m_CloseWindow(DialogResult)
End Sub
#End Region ' METHODS
End Class
Public Class EgtMsgBoxButton
Inherits VMBase
#Region "FIELDS & PROPERTIES"
Public Enum Types As Integer
OK = 1
CANCEL = 2
YES = 3
NO = 4
End Enum
Private Shared Owner As EgtMessageBoxVM
Private m_Type As Types
Public ReadOnly Property Type As Types
Get
Return m_Type
End Get
End Property
Private m_sMessage As String
Public ReadOnly Property sMessage As String
Get
Return m_sMessage
End Get
End Property
Private m_bIsDefault As Boolean = False
Public ReadOnly Property bIsDefault As Boolean
Get
Return m_bIsDefault
End Get
End Property
Friend Sub SetIsDefault(bValue As Boolean)
m_bIsDefault = bValue
End Sub
' Definizione comandi
Private m_cmdCommand As ICommand
#End Region ' FIELDS & PROPERTIES
#Region "CONTRUCTORS"
Sub New(Type As Types)
m_Type = Type
Select Case m_Type
Case Types.OK
m_sMessage = EgtMsg(35001)
Case Types.CANCEL
m_sMessage = EgtMsg(35002)
Case Types.YES
m_sMessage = EgtMsg(35003)
Case Types.NO
m_sMessage = EgtMsg(35004)
End Select
End Sub
Sub New(Type As Types, bIsDefault As Boolean)
MyClass.New(Type)
m_bIsDefault = bIsDefault
End Sub
#End Region ' CONTRUCTORS
#Region "METHODS"
Friend Shared Sub SetOwner(value As EgtMessageBoxVM)
Owner = value
End Sub
#End Region ' METHODS
#Region "COMMANDS"
#Region "Command"
Public ReadOnly Property Command_Command As ICommand
Get
If m_cmdCommand Is Nothing Then
m_cmdCommand = New Command(AddressOf Command)
End If
Return m_cmdCommand
End Get
End Property
Public Sub Command()
Select Case m_Type
Case Types.OK
Owner.CloseWindow(MessageBoxResult.OK)
Case Types.CANCEL
Owner.CloseWindow(MessageBoxResult.Cancel)
Case Types.YES
Owner.CloseWindow(MessageBoxResult.Yes)
Case Types.NO
Owner.CloseWindow(MessageBoxResult.No)
End Select
End Sub
#End Region ' Ok
#End Region ' COMMANDS
End Class
@@ -1,361 +0,0 @@
<Grid x:Class="FilledSolidPanelV"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:EgtWPFLib5="clr-namespace:EgtWPFLib5;assembly=EgtWPFLib5"
xmlns:PrintApp="clr-namespace:Icarus"
Margin="5">
<Grid.Resources>
<PrintApp:FromBooleanToVisibility x:Key="FromBooleanToVisibility"/>
</Grid.Resources>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="1*"/>
<RowDefinition Height="{Binding ActualHeight, ElementName=MoveBtn}"/>
<RowDefinition Height="{Binding ActualHeight, ElementName=MoveBtn}"/>
<RowDefinition Height="{Binding ActualHeight, ElementName=MoveBtn}"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="{Binding ActualHeight, ElementName=MoveBtn}"/>
<RowDefinition Height="{Binding ActualHeight, ElementName=MoveBtn}"/>
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
<ComboBox Grid.Row="3"
ItemsSource="{Binding FilledSolidList}"
SelectedItem="{Binding SelFilledSolid}"
IsEnabled="{Binding FilledSolidList_IsEnabled}"
DisplayMemberPath="ghName"
Style="{StaticResource LeftPanel_ComboBox}"/>
<!--Add Button-->
<ToggleButton x:Name="AddBtn"
Grid.Row="4"
Content="Add"
IsChecked="{Binding bAdd_IsChecked}"
Margin="0,2.5,0,2.5"
Style="{StaticResource LeftPanel_ToggleButton}"/>
<Border Grid.Column="1"
Grid.Row="3"
Grid.RowSpan="3"
VerticalAlignment="Center"
Visibility="{Binding IsChecked, ElementName=AddBtn, Converter={StaticResource FromBooleanToVisibility}}"
Style="{StaticResource LeftPanel_PopupButton_Border}">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<Button Grid.Column="0"
Command="{Binding Import_Command}"
ToolTip="{Binding Import_ToolTip}"
Margin="2.5,0,2.5,0"
Style="{StaticResource ToolBar_Button}">
<Image Source="/Resources/ProjectManager/Import.png"
Style="{StaticResource Button_Image}"/>
</Button>
<Button Grid.Column="1"
Command="{Binding Line2P_Command}"
ToolTip="{Binding Line2P_ToolTip}"
Margin="2.5,0,2.5,0"
Style="{StaticResource ToolBar_Button}">
<Image Source="/Resources/DrawPanel/Line2P.png"
Style="{StaticResource Button_Image}"/>
</Button>
</Grid>
</Border>
<!--Edit Button-->
<ToggleButton x:Name="EditBtn"
Grid.Row="5"
Content="Edit"
IsChecked="{Binding bEdit_IsChecked}"
Margin="0,2.5,0,2.5"
Style="{StaticResource LeftPanel_ToggleButton}"/>
<Border Grid.Column="1"
Grid.Row="4"
Grid.RowSpan="3"
VerticalAlignment="Center"
Visibility="{Binding IsChecked, ElementName=EditBtn, Converter={StaticResource FromBooleanToVisibility}}"
Style="{StaticResource LeftPanel_PopupButton_Border}">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<Button Grid.Column="0"
Command="{Binding Delete_Command}"
ToolTip="{Binding Delete_ToolTip}"
Margin="2.5,0,2.5,0"
Style="{StaticResource ToolBar_Button}">
<Image Source="/Resources/DrawPanel/Delete.png"
Style="{StaticResource Button_Image}"/>
</Button>
<Button Grid.Column="1"
Command="{Binding ModifyCurve_Command}"
ToolTip="{Binding ModifyCurve_ToolTip}"
Visibility="{Binding Compo_Visibility}"
Margin="2.5,0,2.5,0"
Style="{StaticResource ToolBar_Button}">
<Image Source="/Resources/DrawPanel/ModifyCurve.png"
Style="{StaticResource Button_Image}"/>
</Button>
<Button Grid.Column="2"
Command="{Binding AddPointCurve_Command}"
ToolTip="{Binding AddPointCurve_ToolTip}"
Visibility="{Binding Compo_Visibility}"
Margin="2.5,0,2.5,0"
Style="{StaticResource ToolBar_Button}">
<Image Source="/Resources/DrawPanel/AddPointCurve.png"
Style="{StaticResource Button_Image}"/>
</Button>
<Button Grid.Column="3"
Command="{Binding RemovePointCurve_Command}"
ToolTip="{Binding RemovePointCurve_ToolTip}"
Visibility="{Binding Compo_Visibility}"
Margin="2.5,0,2.5,0"
Style="{StaticResource ToolBar_Button}">
<Image Source="/Resources/DrawPanel/RemovePointCurve.png"
Style="{StaticResource Button_Image}"/>
</Button>
<Button Grid.Column="4"
Command="{Binding Extrude_Command}"
ToolTip="{Binding Extrude_ToolTip}"
Visibility="{Binding Compo_Visibility}"
Margin="2.5,0,2.5,0"
Style="{StaticResource ToolBar_Button}">
<Image Source="/Resources/DrawPanel/Extrude.png"
Style="{StaticResource Button_Image}"/>
</Button>
</Grid>
</Border>
<!--Grid Button-->
<ToggleButton x:Name="GridBtn"
Grid.Row="6"
Content="Grid"
IsChecked="{Binding bGrid_IsChecked}"
IsEnabled="{Binding bGrid_IsEnabled}"
Margin="0,2.5,0,2.5"
Style="{StaticResource LeftPanel_ToggleButton}"/>
<Border Grid.Column="1"
Grid.Row="5"
Grid.RowSpan="3"
VerticalAlignment="Center"
Visibility="{Binding IsChecked, ElementName=GridBtn, Converter={StaticResource FromBooleanToVisibility}}"
Style="{StaticResource LeftPanel_PopupButton_Border}">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<Button Command="{Binding CPlaneTop_Command}"
ToolTip="{Binding CPlaneTop_ToolTip}"
Margin="2.5,0,2.5,0"
Style="{StaticResource ToolBar_Button}">
<Image Source="/Resources/GridViewPanel/CplaneTOP.png"
Style="{StaticResource Button_Image}"/>
</Button>
<Button Grid.Column="1"
Command="{Binding CPlaneFront_Command}"
ToolTip="{Binding CPlaneFront_ToolTip}"
Margin="2.5,0,2.5,0"
Style="{StaticResource ToolBar_Button}">
<Image Source="/Resources/GridViewPanel/CplaneFRONT.png"
Style="{StaticResource Button_Image}"/>
</Button>
<Button Grid.Column="2"
Command="{Binding CPlaneRight_Command}"
ToolTip="{Binding CPlaneRight_ToolTip}"
Margin="2.5,0,2.5,0"
Style="{StaticResource ToolBar_Button}">
<Image Source="/Resources/GridViewPanel/CplaneRIGHT.png"
Style="{StaticResource Button_Image}"/>
</Button>
<Button Grid.Column="3"
Command="{Binding CPlaneBack_Command}"
ToolTip="{Binding CPlaneBack_ToolTip}"
Margin="2.5,0,2.5,0"
Style="{StaticResource ToolBar_Button}">
<Image Source="/Resources/GridViewPanel/CplaneBACK.png"
Style="{StaticResource Button_Image}"/>
</Button>
<Button Grid.Column="4"
Command="{Binding CPlaneLeft_Command}"
ToolTip="{Binding CPlaneLeft_ToolTip}"
Margin="2.5,0,2.5,0"
Style="{StaticResource ToolBar_Button}">
<Image Source="/Resources/GridViewPanel/CplaneLEFT.png"
Style="{StaticResource Button_Image}"/>
</Button>
<Button Grid.Column="5"
Command="{Binding CPlaneBottom_Command}"
ToolTip="{Binding CPlaneBottom_ToolTip}"
Margin="2.5,0,2.5,0"
Style="{StaticResource ToolBar_Button}">
<Image Source="/Resources/GridViewPanel/CplaneBOTTOM.png"
Style="{StaticResource Button_Image}"/>
</Button>
<Button Grid.Column="6"
Command="{Binding CPlaneElevation_Command}"
ToolTip="{Binding CPlaneElevation_ToolTip}"
Margin="2.5,0,2.5,0"
Style="{StaticResource ToolBar_Button}">
<Image Source="/Resources/GridViewPanel/CplaneELEVATION.png"
Style="{StaticResource Button_Image}"/>
</Button>
<Button Grid.Column="7"
Command="{Binding CPlaneOrigin_Command}"
ToolTip="{Binding CPlaneOrigin_ToolTip}"
Margin="2.5,0,2.5,0"
Style="{StaticResource ToolBar_Button}">
<Image Source="/Resources/GridViewPanel/CPlaneORIGIN.png"
Style="{StaticResource Button_Image}"/>
</Button>
<Button Grid.Column="8"
Command="{Binding CPlaneObj_Command}"
ToolTip="{Binding CPlaneObj_ToolTip}"
Margin="2.5,0,2.5,0"
Style="{StaticResource ToolBar_Button}">
<Image Source="/Resources/GridViewPanel/CplaneOBJECT.png"
Style="{StaticResource Button_Image}"/>
</Button>
</Grid>
</Border>
<!--Move Button-->
<ToggleButton x:Name="MoveBtn"
Grid.Row="7"
Content="Move"
IsChecked="{Binding bMove_IsChecked}"
Margin="0,2.5,0,2.5"
Style="{StaticResource LeftPanel_ToggleButton}"/>
<Border Grid.Column="1"
Grid.Row="5"
Grid.RowSpan="5"
VerticalAlignment="Center"
Visibility="{Binding IsChecked, ElementName=MoveBtn, Converter={StaticResource FromBooleanToVisibility}}"
Style="{StaticResource LeftPanel_Popup_Border}">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Grid Margin="0,0,0,2.5">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<TextBlock Text="X"
Style="{StaticResource Move_TextBlock}"/>
<EgtWPFLib5:EgtTextBox2 Text="{Binding sXPos, UpdateSourceTrigger=Explicit}"
Grid.Column="1"
Margin="5,0,0,0"
Style="{StaticResource LeftPanel_TextBox2}"/>
</Grid>
<Grid Grid.Row="1"
Margin="0,2.5,0,2.5">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<TextBlock Text="Y"
Style="{StaticResource Move_TextBlock}"/>
<EgtWPFLib5:EgtTextBox2 Text="{Binding sYPos, UpdateSourceTrigger=Explicit}"
Grid.Column="1"
Margin="5,0,0,0"
Style="{StaticResource LeftPanel_TextBox2}"/>
</Grid>
<Grid Grid.Row="2"
Margin="0,2.5,0,2.5">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<TextBlock Text="Z"
Style="{StaticResource Move_TextBlock}"/>
<EgtWPFLib5:EgtTextBox2 Text="{Binding sZPos, UpdateSourceTrigger=Explicit}"
Grid.Column="1"
Margin="5,0,0,0"
Style="{StaticResource LeftPanel_TextBox2}"/>
</Grid>
<Grid Grid.Row="3"
Margin="0,2.5,0,0">
<Button Content="Drag"
Command="{Binding DragMove_Command}"
Style="{StaticResource LeftPanel_TextButton}"/>
</Grid>
</Grid>
</Border>
<!--Rotate Button-->
<ToggleButton x:Name="RotateBtn"
Grid.Row="8"
Content="Rotate"
IsChecked="{Binding bRotate_IsChecked}"
Margin="0,2.5,0,2.5"
Style="{StaticResource LeftPanel_ToggleButton}"/>
<Border Grid.Column="1"
Grid.Row="6"
Grid.RowSpan="5"
VerticalAlignment="Center"
Visibility="{Binding IsChecked, ElementName=RotateBtn, Converter={StaticResource FromBooleanToVisibility}}"
Style="{StaticResource LeftPanel_Popup_Border}">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<UniformGrid Columns="3">
<RadioButton Content="X"
GroupName="Axes"
IsChecked="{Binding RotX}"
Style="{StaticResource ToolBar_ToggleButton}"/>
<RadioButton Content="Y"
GroupName="Axes"
IsChecked="{Binding RotY}"
Style="{StaticResource ToolBar_ToggleButton}"/>
<RadioButton Content="Z"
GroupName="Axes"
IsChecked="{Binding RotZ}"
Style="{StaticResource ToolBar_ToggleButton}"/>
</UniformGrid>
<EgtWPFLib5:EgtTextBox2 Grid.Row="1"
Text="{Binding sRotAngle, UpdateSourceTrigger=Explicit}"
ResetValueOnLostFocus="False"
Margin="0,5,0,2.5"/>
<Grid Grid.Row="2"
Margin="0,2.5,0,0">
<Button Content="Drag"
Command="{Binding DragRotate_Command}"
Style="{StaticResource LeftPanel_TextButton}"/>
</Grid>
</Grid>
</Border>
<!--Parameters Button-->
<ToggleButton Content="Parameters"
Grid.Row="9"
IsChecked="{Binding bMachParam_IsChecked}"
Margin="0,2.5,0,2.5"
Style="{StaticResource LeftPanel_Parameters_ToggleButton}"/>
</Grid>
@@ -1,3 +0,0 @@
Public Class FilledSolidPanelV
End Class
File diff suppressed because it is too large Load Diff
@@ -1,109 +0,0 @@
<Grid x:Class="FilledSolidParamPanelV"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:PrintApp="clr-namespace:Icarus"
Width="310"
VerticalAlignment="Center">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
<Border Margin="0,0,0,2.5"
Style="{StaticResource Title_Border}">
<TextBlock Text="REDUCE SHELL NUMBER PARAMETERS"
Style="{StaticResource Title_TextBlock}"/>
</Border>
<Border Grid.Row="1"
Padding="0,2.5,0,0"
Margin="0,2.5,0,0"
Style="{StaticResource BottomGrayRow_Border}">
<Grid Margin="2.5,2.5,2.5,0">
<Grid.RowDefinitions>
<RowDefinition Height="1*"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<ScrollViewer VerticalScrollBarVisibility="Auto"
HorizontalScrollBarVisibility="Disabled">
<ItemsControl ItemsSource="{Binding MachiningParamList}">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<UniformGrid Columns="1"
HorizontalAlignment="Stretch"/>
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.Resources>
<DataTemplate DataType="{x:Type PrintApp:NumericMachiningParam}">
<Grid Margin="0,1,2.5,1"
IsEnabled="{Binding bIsActive}">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="2*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<TextBlock Text="{Binding sName}"
Margin="0,0,2.5,0"
Style="{StaticResource ParameterList_TextBlock}"/>
<TextBox Grid.Column="1"
Text="{Binding sValue}"
Margin="2.5,0,2.5,0"
Style="{StaticResource ParameterList_TextBox}"/>
<Button Grid.Column="2"
Content="R"
Command="{Binding ResetParam_Command}"
IsEnabled="{Binding bIsModifiedFromPart}"
VerticalContentAlignment="Center"
HorizontalContentAlignment="Center"
Margin="2.5,0,0,0"
Style="{StaticResource ToolBar_SmallButton}"/>
</Grid>
</DataTemplate>
<DataTemplate DataType="{x:Type PrintApp:ComboMachiningParam}">
<Grid Margin="0,1,2.5,1"
IsEnabled="{Binding bIsActive}">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="2*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<TextBlock Text="{Binding sName}"
Margin="0,0,2.5,0"
Style="{StaticResource ParameterList_TextBlock}"/>
<ComboBox Grid.Column="1"
ItemsSource="{Binding ValueList}"
SelectedItem="{Binding SelValue}"
HorizontalAlignment="Stretch"
Margin="2.5,0,2.5,0"
Style="{StaticResource RightPanel_ComboBox}"/>
<Button Grid.Column="2"
Content="R"
Command="{Binding ResetParam_Command}"
IsEnabled="{Binding bIsModifiedFromPart}"
VerticalContentAlignment="Center"
HorizontalContentAlignment="Center"
Margin="2.5,0,0,0"
Style="{StaticResource ToolBar_SmallButton}"/>
</Grid>
</DataTemplate>
</ItemsControl.Resources>
</ItemsControl>
</ScrollViewer>
<UniformGrid Grid.Row="1"
Rows="1"
Margin="0,2.5,0,0">
<Button Command="{Binding Ok_Command}"
IsDefault="True"
Margin="0,0,2.5,0"
Style="{StaticResource RightPanel_HalfRound_Button}">
<Image Source="\Resources\Common\Ok.png"
Style="{StaticResource Button_Image}"/>
</Button>
<Button Command="{Binding Cancel_Command}"
Margin="0,0,2.5,0"
Style="{StaticResource RightPanel_HalfRound_Button}">
<Image Source="\Resources\Common\Cancel.png"
Style="{StaticResource Button_Image}"/>
</Button>
</UniformGrid>
</Grid>
</Border>
</Grid>
@@ -1,3 +0,0 @@
Public Class FilledSolidParamPanelV
End Class
@@ -1,450 +0,0 @@
Imports System.Collections.ObjectModel
Imports System.Reflection
Imports EgtUILib
Imports EgtWPFLib5
Public Class FilledSolidParamPanelVM
Inherits MachiningCathegory
#Region "FIELDS & PROPERTIES"
' Definizione comandi
Private m_cmdOk As ICommand
Private m_cmdCancel As ICommand
#End Region ' FIELDS & PROPERTIES
#Region "CONSTRUCTORS"
Sub New()
' Creo riferimento a questa classe in EgtCAM5Map
Map.SetRefFilledSolidParamPanelVM(Me)
End Sub
#End Region ' CONSTRUCTORS
#Region "METHODS"
Friend Sub Init()
If IsNothing(Map.refFilledSolidPanelVM.SelFilledSolid) Then
' ripristino modalita' standard
Map.refRightPanelVM.SetSelPanel(RightPanelVM.Panels.NULL)
Return
End If
Dim nPartId As Integer = Map.refTopPanelVM.SelPart.nPartId
Dim nFilledSolidId As Integer = GDB_ID.NULL
Select Case Map.refFilledSolidPanelVM.SelFilledSolid.Type
Case RibEntity.RibTypes.FROMDRAW
nFilledSolidId = Map.refFilledSolidPanelVM.SelFilledSolid.nCurveId
Case RibEntity.RibTypes.FROMIMPORT
nFilledSolidId = Map.refFilledSolidPanelVM.SelFilledSolid.nExtrusionId
End Select
m_Type = Cathegories.AUX_SOLID
m_sName = "Filled Solid"
m_MachiningParamList = New List(Of MachiningParam)({New FilledSolidNumericMachiningParam(MachiningParam.Params.AUXSOLIDSOVERLAP, nFilledSolidId, nPartId, Me),
New FilledSolidComboMachiningParam(MachiningParam.Params.AUXSOLIDSINFILL, nFilledSolidId, nPartId, Me),
New FilledSolidComboMachiningParam(MachiningParam.Params.AUXSOLIDSSTRANDORDER, nFilledSolidId, nPartId, Me),
New FilledSolidComboMachiningParam(MachiningParam.Params.AUXSOLIDSLINKTYPE, nFilledSolidId, nPartId, Me),
New FilledSolidNumericMachiningParam(MachiningParam.Params.AUXSOLIDSLINKPARAM, nFilledSolidId, nPartId, Me),
New FilledSolidNumericMachiningParam(MachiningParam.Params.AUXSOLIDSSTARTPOINTOFFSETONSLICE, nFilledSolidId, nPartId, Me),
New FilledSolidNumericMachiningParam(MachiningParam.Params.AUXSOLIDSCOASTINGLEN, nFilledSolidId, nPartId, Me),
New FilledSolidNumericMachiningParam(MachiningParam.Params.AUXSOLIDSWIPELEN, nFilledSolidId, nPartId, Me),
New FilledSolidNumericMachiningParam(MachiningParam.Params.AUXSOLIDSWIPEDIR, nFilledSolidId, nPartId, Me)})
NotifyPropertyChanged(NameOf(MachiningParamList))
NotifyPropertyChanged(NameOf(sName))
' verifico dipendenze tra parametri
Select Case m_Type
Case Cathegories.AUX_SOLID
For Each Param In {MachiningParam.Params.AUXSOLIDSINFILL}
Dim MachiningParam As ComboMachiningParam = MachiningParamList.FirstOrDefault(Function(z) z.Type = Param)
MachiningParam.ManageDependencyParam()
Next
End Select
End Sub
Friend Sub SaveCurrParams()
For Each Param In m_MachiningParamList
Param.SaveParam()
Next
End Sub
Friend Sub ResetCurrParams()
For Each Param In m_MachiningParamList
Param.ResetParam()
Next
End Sub
Friend Sub WriteParamsInFilledSolid(nRibId As Integer)
' se parametri modificati
Dim bModified As Boolean = False
For Each Param In m_MachiningParamList
Select Case Param.GetType()
Case GetType(FilledSolidNumericMachiningParam)
Dim NumericParam As FilledSolidNumericMachiningParam = TryCast(Param, FilledSolidNumericMachiningParam)
If NumericParam.bIsModified AndAlso Not bModified Then bModified = True
NumericParam.WriteParamInFilledSolid(nRibId)
Case GetType(FilledSolidComboMachiningParam)
Dim NumericParam As FilledSolidComboMachiningParam = TryCast(Param, FilledSolidComboMachiningParam)
If NumericParam.bIsModified AndAlso Not bModified Then bModified = True
NumericParam.WriteParamInFilledSolid(nRibId)
End Select
Next
If bModified Then
' Imposto flag di ricalcolo slice
EgtSetInfo(Map.refTopPanelVM.SelPart.nPartId, MAC_TORECALC_SLICE, True)
End If
End Sub
#End Region ' METHODS
#Region "COMMANDS"
#Region "Ok"
Public ReadOnly Property Ok_Command As ICommand
Get
If m_cmdOk Is Nothing Then
m_cmdOk = New Command(AddressOf Ok)
End If
Return m_cmdOk
End Get
End Property
Public Sub Ok()
If Not IsNothing(Map.refFilledSolidPanelVM.SelFilledSolid) Then
' scrivo i parametri modificati
Select Case Map.refFilledSolidPanelVM.SelFilledSolid.Type
Case FilledSolidEntity.FilledSolidTypes.FROMDRAW
WriteParamsInFilledSolid(Map.refFilledSolidPanelVM.SelFilledSolid.nCurveId)
WriteParamsInFilledSolid(Map.refFilledSolidPanelVM.SelFilledSolid.nExtrusionId)
Case FilledSolidEntity.FilledSolidTypes.FROMIMPORT
WriteParamsInFilledSolid(Map.refFilledSolidPanelVM.SelFilledSolid.nExtrusionId)
End Select
End If
' ripristino modalita' standard
Map.refRightPanelVM.SetSelPanel(RightPanelVM.Panels.NULL)
Map.refFilledSolidPanelVM.ResetMachParamIsChecked()
End Sub
#End Region ' Ok
#Region "Cancel"
Public ReadOnly Property Cancel_Command As ICommand
Get
If m_cmdCancel Is Nothing Then
m_cmdCancel = New Command(AddressOf Cancel)
End If
Return m_cmdCancel
End Get
End Property
Public Sub Cancel()
' ripristino modalita' standard
Map.refRightPanelVM.SetSelPanel(RightPanelVM.Panels.NULL)
Map.refFilledSolidPanelVM.ResetMachParamIsChecked()
End Sub
#End Region ' Cancel
#End Region ' COMMANDS
End Class
Public Class FilledSolidNumericMachiningParam
Inherits NumericMachiningParam
Public Overrides Property sValue As String
Get
Return If(m_bIsLen, LenToString(m_dValue, 1), m_dValue)
End Get
Set(value As String)
If m_bIsLen Then
StringToLen(value, m_dValue)
Else
m_dValue = value
End If
NotifyPropertyChanged(NameOf(sValue))
NotifyPropertyChanged(NameOf(bIsModifiedFromPart))
End Set
End Property
Private m_dPartValue As Double
Public ReadOnly Property dPartValue As Double
Get
Return m_dPartValue
End Get
End Property
Public ReadOnly Property bIsModifiedFromPart As Boolean
Get
Return m_dValue <> m_dPartValue
End Get
End Property
' Definizione comandi
Private m_cmdResetParam As ICommand
Sub New(Type As Params, nFilledSolidId As Integer, nPartId As Integer, Cathegory As MachiningCathegory)
MyBase.New(Type, Cathegory)
Dim bReadFromPart As Boolean = False
Select Case Type
Case Params.AUXSOLIDSOVERLAP
bReadFromPart = EgtGetInfo(nFilledSolidId, MAC_AUXSOLIDSOVERLAP, m_dValue)
EgtGetInfo(nPartId, MAC_AUXSOLIDSOVERLAP, m_dPartValue)
m_bIsLen = True
Case Params.AUXSOLIDSLINKPARAM
bReadFromPart = EgtGetInfo(nFilledSolidId, MAC_AUXSOLIDSLINKPARAM, m_dValue)
EgtGetInfo(nPartId, MAC_AUXSOLIDSLINKPARAM, m_dPartValue)
m_bIsLen = True
Case Params.AUXSOLIDSSTARTPOINTOFFSETONSLICE
bReadFromPart = EgtGetInfo(nFilledSolidId, MAC_AUXSOLIDSSTARTPOINTOFFSETONSLICE, m_dValue)
EgtGetInfo(nPartId, MAC_AUXSOLIDSSTARTPOINTOFFSETONSLICE, m_dPartValue)
m_bIsLen = True
Case Params.AUXSOLIDSCOASTINGLEN
bReadFromPart = EgtGetInfo(nFilledSolidId, MAC_AUXSOLIDSCOASTINGLEN, m_dValue)
EgtGetInfo(nPartId, MAC_AUXSOLIDSCOASTINGLEN, m_dPartValue)
m_bIsLen = True
Case Params.AUXSOLIDSWIPELEN
bReadFromPart = EgtGetInfo(nFilledSolidId, MAC_AUXSOLIDSWIPELEN, m_dValue)
EgtGetInfo(nPartId, MAC_AUXSOLIDSWIPELEN, m_dPartValue)
m_bIsLen = True
Case Params.AUXSOLIDSWIPEDIR
bReadFromPart = EgtGetInfo(nFilledSolidId, MAC_AUXSOLIDSWIPEDIR, m_dValue)
EgtGetInfo(nPartId, MAC_AUXSOLIDSWIPEDIR, m_dPartValue)
m_bIsLen = True
End Select
m_dOrigValue = m_dValue
If Not bReadFromPart Then
m_dValue = m_dPartValue
m_dOrigValue = m_dPartValue
End If
End Sub
Friend Sub WriteParamInFilledSolid(nFilledSolidId As Integer)
Dim sWriteValue As String = ""
If m_bIsLen Then
sWriteValue = LenToString(m_dValue, 2)
Else
sWriteValue = DoubleToString(m_dValue, 2)
End If
Select Case Type
Case Params.AUXSOLIDSOVERLAP
If bIsModifiedFromPart Then
EgtSetInfo(nFilledSolidId, MAC_AUXSOLIDSOVERLAP, sWriteValue)
Else
EgtRemoveInfo(nFilledSolidId, MAC_AUXSOLIDSOVERLAP)
End If
Case Params.AUXSOLIDSLINKPARAM
If bIsModifiedFromPart Then
EgtSetInfo(nFilledSolidId, MAC_AUXSOLIDSLINKPARAM, sWriteValue)
Else
EgtRemoveInfo(nFilledSolidId, MAC_AUXSOLIDSLINKPARAM)
End If
Case Params.AUXSOLIDSSTARTPOINTOFFSETONSLICE
If bIsModifiedFromPart Then
EgtSetInfo(nFilledSolidId, MAC_AUXSOLIDSSTARTPOINTOFFSETONSLICE, sWriteValue)
Else
EgtRemoveInfo(nFilledSolidId, MAC_AUXSOLIDSSTARTPOINTOFFSETONSLICE)
End If
Case Params.AUXSOLIDSCOASTINGLEN
If bIsModifiedFromPart Then
EgtSetInfo(nFilledSolidId, MAC_AUXSOLIDSCOASTINGLEN, sWriteValue)
Else
EgtRemoveInfo(nFilledSolidId, MAC_AUXSOLIDSCOASTINGLEN)
End If
Case Params.AUXSOLIDSWIPELEN
If bIsModifiedFromPart Then
EgtSetInfo(nFilledSolidId, MAC_AUXSOLIDSWIPELEN, sWriteValue)
Else
EgtRemoveInfo(nFilledSolidId, MAC_AUXSOLIDSWIPELEN)
End If
Case Params.AUXSOLIDSWIPEDIR
If bIsModifiedFromPart Then
EgtSetInfo(nFilledSolidId, MAC_AUXSOLIDSWIPEDIR, sWriteValue)
Else
EgtRemoveInfo(nFilledSolidId, MAC_AUXSOLIDSWIPEDIR)
End If
End Select
End Sub
Friend Overrides Sub SaveParam()
m_dOrigValue = m_dValue
End Sub
Friend Overrides Sub ResetParam()
m_dValue = m_dOrigValue
End Sub
#Region "COMMANDS"
#Region "ResetParam"
Public ReadOnly Property ResetParam_Command As ICommand
Get
If m_cmdResetParam Is Nothing Then
m_cmdResetParam = New Command(AddressOf ResetParamCmd)
End If
Return m_cmdResetParam
End Get
End Property
Public Sub ResetParamCmd()
m_dValue = m_dPartValue
NotifyPropertyChanged(NameOf(sValue))
NotifyPropertyChanged(NameOf(bIsModifiedFromPart))
End Sub
#End Region ' ResetParam
#End Region ' COMMANDS
End Class
Public Class FilledSolidComboMachiningParam
Inherits ComboMachiningParam
Public Overrides Property SelValue As IdNameStruct
Get
Return m_SelValue
End Get
Set(value As IdNameStruct)
m_SelValue = value
NotifyPropertyChanged(NameOf(SelValue))
NotifyPropertyChanged(NameOf(bIsModifiedFromPart))
ManageDependencyParam()
End Set
End Property
Protected m_PartSelValue As IdNameStruct
Public ReadOnly Property PartSelValue As IdNameStruct
Get
Return m_PartSelValue
End Get
End Property
Public ReadOnly Property bIsModifiedFromPart As Boolean
Get
Return m_SelValue.Id <> m_PartSelValue.Id
End Get
End Property
' Definizione comandi
Private m_cmdResetParam As ICommand
Sub New(Type As Params, nRibId As Integer, nPartId As Integer, Cathegory As MachiningCathegory)
MyBase.New(Type, Cathegory)
Dim bReadFromRib As Boolean = False
Dim bReadFromPart As Boolean = False
Select Case Type
Case Params.AUXSOLIDSINFILL
m_ValueList = New List(Of IdNameStruct)({New IdNameStruct(Machining.MPAR_INFILL.NONE, "None"),
New IdNameStruct(Machining.MPAR_INFILL.OFFSET, "Offset"),
New IdNameStruct(Machining.MPAR_INFILL.ZIGZAG, "ZigZag")})
Dim nSelValue As Integer = 1
bReadFromRib = EgtGetInfo(nRibId, MAC_AUXSOLIDSINFILL, nSelValue)
If bReadFromRib Then
m_SelValue = m_ValueList.FirstOrDefault(Function(x) x.Id = nSelValue)
End If
bReadFromPart = EgtGetInfo(nPartId, MAC_AUXSOLIDSINFILL, nSelValue)
m_PartSelValue = m_ValueList.FirstOrDefault(Function(x) x.Id = nSelValue)
Case Params.AUXSOLIDSSTRANDORDER
m_ValueList = New List(Of IdNameStruct)({New IdNameStruct(Machining.MPAR_STRANDORDERS.OUTTOIN, "From Outside To Inside"),
New IdNameStruct(Machining.MPAR_STRANDORDERS.INTOOUT, "From Inside To Outside")})
Dim nSelValue As Integer = 1
bReadFromRib = EgtGetInfo(nRibId, MAC_AUXSOLIDSSTRANDORDER, nSelValue)
If bReadFromRib Then
m_SelValue = m_ValueList.FirstOrDefault(Function(x) x.Id = nSelValue)
End If
bReadFromPart = EgtGetInfo(nPartId, MAC_AUXSOLIDSSTRANDORDER, nSelValue)
m_PartSelValue = m_ValueList.FirstOrDefault(Function(x) x.Id = nSelValue)
Case Params.AUXSOLIDSLINKTYPE
m_ValueList = New List(Of IdNameStruct)({New IdNameStruct(Machining.MPAR_LINKTYPES.NONE, "None"),
New IdNameStruct(Machining.MPAR_LINKTYPES.LINEAR, "Linear"),
New IdNameStruct(Machining.MPAR_LINKTYPES.BIARC, "Biarc")})
Dim nSelValue As Integer = 1
bReadFromRib = EgtGetInfo(nRibId, MAC_AUXSOLIDSLINKTYPE, nSelValue)
If bReadFromRib Then
m_SelValue = m_ValueList.FirstOrDefault(Function(x) x.Id = nSelValue)
End If
bReadFromPart = EgtGetInfo(nPartId, MAC_AUXSOLIDSLINKTYPE, nSelValue)
m_PartSelValue = m_ValueList.FirstOrDefault(Function(x) x.Id = nSelValue)
End Select
m_OrigSelValue = m_SelValue
If Not bReadFromRib Then
If bReadFromPart Then
m_SelValue = m_PartSelValue
m_OrigSelValue = m_PartSelValue
Else
Select Case Type
Case Params.AUXSOLIDSINFILL
m_OrigSelValue = m_ValueList.FirstOrDefault(Function(x) x.Id = Machining.MPAR_INFILL.NONE)
m_SelValue = m_OrigSelValue
Case Params.AUXSOLIDSSTRANDORDER
m_OrigSelValue = m_ValueList.FirstOrDefault(Function(x) x.Id = Machining.MPAR_STRANDORDERS.OUTTOIN)
m_SelValue = m_OrigSelValue
Case Params.AUXSOLIDSLINKTYPE
m_OrigSelValue = m_ValueList.FirstOrDefault(Function(x) x.Id = Machining.MPAR_LINKTYPES.NONE)
m_SelValue = m_OrigSelValue
End Select
End If
End If
End Sub
Friend Sub WriteParamInFilledSolid(nRibId As Integer)
Select Case Type
Case Params.AUXSOLIDSINFILL
If bIsModifiedFromPart Then
EgtSetInfo(nRibId, MAC_AUXSOLIDSINFILL, m_SelValue.Id)
Else
EgtRemoveInfo(nRibId, MAC_AUXSOLIDSINFILL)
End If
Case Params.AUXSOLIDSSTRANDORDER
If bIsModifiedFromPart Then
EgtSetInfo(nRibId, MAC_AUXSOLIDSSTRANDORDER, m_SelValue.Id)
Else
EgtRemoveInfo(nRibId, MAC_AUXSOLIDSSTRANDORDER)
End If
Case Params.AUXSOLIDSLINKTYPE
If bIsModifiedFromPart Then
EgtSetInfo(nRibId, MAC_AUXSOLIDSLINKTYPE, m_SelValue.Id)
Else
EgtRemoveInfo(nRibId, MAC_AUXSOLIDSLINKTYPE)
End If
End Select
End Sub
Friend Overrides Sub SaveParam()
m_OrigSelValue = m_SelValue
End Sub
Friend Overrides Sub ResetParam()
m_SelValue = m_OrigSelValue
End Sub
#Region "COMMANDS"
#Region "ResetParam"
Public ReadOnly Property ResetParam_Command As ICommand
Get
If m_cmdResetParam Is Nothing Then
m_cmdResetParam = New Command(AddressOf ResetParamCmd)
End If
Return m_cmdResetParam
End Get
End Property
Public Sub ResetParamCmd()
m_SelValue = m_PartSelValue
NotifyPropertyChanged(NameOf(SelValue))
NotifyPropertyChanged(NameOf(bIsModifiedFromPart))
End Sub
#End Region ' ResetParam
#End Region ' COMMANDS
End Class
+19
View File
@@ -0,0 +1,19 @@
<EgtWPFLib5:EgtCustomWindow x:Class="HelpWndV"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:CefSharpWpf="clr-namespace:CefSharp.Wpf;assembly=CefSharp.Wpf"
xmlns:EgtWPFLib5="clr-namespace:EgtWPFLib5;assembly=EgtWPFLib5"
xmlns:local="clr-namespace:Icarus"
Style="{DynamicResource {x:Type EgtWPFLib5:EgtCustomWindow}}"
Title="{Binding sTitle}" Icon="/Resources/Icarus.ico"
MinHeight="600" MinWidth="800" WindowStyle="None" ResizeMode="NoResize">
<EgtWPFLib5:EgtCustomWindow.Resources>
<local:CustomMenuHandler x:Key="CustomMenuHandler"/>
</EgtWPFLib5:EgtCustomWindow.Resources>
<CefSharpWpf:ChromiumWebBrowser x:Name="Browser"
MenuHandler="{StaticResource CustomMenuHandler}"/>
<!--<CefSharpWpf:ChromiumWebBrowser x:Name="Browser"
Address="c:\EgtData\Icarus\Help\lm_1170\\index.html"
MenuHandler="{StaticResource CustomMenuHandler}"/>-->
</EgtWPFLib5:EgtCustomWindow>
+26
View File
@@ -0,0 +1,26 @@
Imports System.Diagnostics.Eventing
Imports System.IO
Imports System.Reflection
Public Class HelpWndV
Private WithEvents m_HelpWndVM As HelpWndVM
Sub New(Owner As Window, HelpWndVM As HelpWndVM)
MyBase.New(Owner)
' This call is required by the designer.
InitializeComponent()
Me.DataContext = HelpWndVM
' Assegno al riferimento locale al VM il VM preso dal DataContext
m_HelpWndVM = HelpWndVM
'm_HelpWndVM.SetWebBrowser(WebBrowser)
Browser.ResourceRequestHandlerFactory = New ResourceHandlerFactory
Browser.Address = "Icarus.pdf#toolbar=0"
End Sub
'Private Sub CloseWindow(bDialogResult As Boolean) Handles m_HelpWndVM.m_CloseWindow
' Me.DialogResult = bDialogResult
'End Sub
End Class
+20
View File
@@ -0,0 +1,20 @@
Public Class HelpWndVM
'Private m_WebBrowser As WebBrowser
'Public ReadOnly Property WebBrowser As WebBrowser
' Get
' Return m_WebBrowser
' End Get
'End Property
'Friend Sub SetWebBrowser(value As WebBrowser)
' m_WebBrowser = value
'End Sub
Sub New()
End Sub
Friend Sub LoadHtml()
'm_WebBrowser.Source = New Uri("c:\EgtData\Icarus\Help\lm_1170\index.html")
End Sub
End Class
+145
View File
@@ -0,0 +1,145 @@
Imports System.Collections.Specialized
Imports System.IO
Imports System.Runtime.InteropServices
Imports System.Windows.Forms
Imports CefSharp
Imports CefSharp.Callback
Public Class ResourceHandler
Implements IResourceHandler
Public Const DefaultMimeType As String = "text/html"
Private tempBuffer As Byte()
Public Property Charset As String
Public Property MimeType As String
Public Property Stream As Stream
Public Property StatusCode As Integer
Public Property StatusText As String
Public Property m_ResponseLength As Long?
Public Property Headers As NameValueCollection
Public Property AutoDisposeStream As Boolean
Public Property ErrorCode As CefErrorCode?
Private disposedValue As Boolean
Public Sub New(ByVal Optional mimeType As String = DefaultMimeType, ByVal Optional stream As Stream = Nothing, ByVal Optional autoDisposeStream As Boolean = False, ByVal Optional charset As String = Nothing)
If String.IsNullOrEmpty(mimeType) Then
Throw New ArgumentNullException("mimeType", "Please provide a valid mimeType")
End If
StatusCode = 200
StatusText = "OK"
mimeType = "application/pdf"
Headers = New NameValueCollection()
stream = stream
autoDisposeStream = autoDisposeStream
charset = charset
Headers.Add("Access-Control-Allow-Origin", "*")
End Sub
Public Sub GetResponseHeaders(response As IResponse, ByRef responseLength As Long, ByRef redirectUrl As String) Implements IResourceHandler.GetResponseHeaders
redirectUrl = Nothing
responseLength = -1
'response.MimeType = MimeType
response.MimeType = "application/pdf"
response.StatusCode = StatusCode
response.StatusText = StatusText
response.Headers = Headers
If Not String.IsNullOrEmpty(Charset) Then
response.Charset = Charset
End If
If Not IsNothing(m_ResponseLength) Then
responseLength = m_ResponseLength
End If
If Stream IsNot Nothing AndAlso Stream.CanSeek Then
If m_ResponseLength Is Nothing OrElse responseLength = 0 Then
responseLength = Stream.Length
End If
Stream.Position = 0
End If
End Sub
Public Sub Cancel() Implements IResourceHandler.Cancel
Return
End Sub
Public Function Open(request As IRequest, ByRef handleRequest As Boolean, callback As ICallback) As Boolean Implements IResourceHandler.Open
Dim assembly = Reflection.Assembly.GetExecutingAssembly()
Dim resourceName = "Icarus.Icarus.pdf"
Stream = assembly.GetManifestResourceStream(resourceName)
callback.Continue()
Return True
End Function
Public Function ProcessRequest(request As IRequest, callback As ICallback) As Boolean Implements IResourceHandler.ProcessRequest
Return True
End Function
Public Function Skip(bytesToSkip As Long, ByRef bytesSkipped As Long, callback As IResourceSkipCallback) As Boolean Implements IResourceHandler.Skip
callback.Dispose()
If Stream Is Nothing OrElse Not Stream.CanSeek Then
bytesSkipped = -2
Return False
End If
bytesSkipped = bytesToSkip
Stream.Seek(bytesToSkip, SeekOrigin.Current)
Return True
End Function
Public Function Read(dataOut As Stream, ByRef bytesRead As Integer, callback As IResourceReadCallback) As Boolean Implements IResourceHandler.Read
bytesRead = 0
callback.Dispose()
If Stream Is Nothing Then
Return False
End If
If tempBuffer Is Nothing OrElse tempBuffer.Length < dataOut.Length Then
tempBuffer = New Byte(dataOut.Length - 1) {}
End If
bytesRead = Stream.Read(tempBuffer, 0, CInt(dataOut.Length))
If bytesRead = 0 Then
Return False
End If
dataOut.Write(tempBuffer, 0, bytesRead)
Return bytesRead > 0
End Function
Public Function ReadResponse(dataOut As Stream, ByRef bytesRead As Integer, callback As ICallback) As Boolean Implements IResourceHandler.ReadResponse
Throw New NotImplementedException()
End Function
Protected Overridable Sub Dispose(disposing As Boolean)
If Not disposedValue Then
If disposing Then
' TODO: dispose managed state (managed objects)
End If
' TODO: free unmanaged resources (unmanaged objects) and override finalizer
' TODO: set large fields to null
disposedValue = True
End If
End Sub
' ' TODO: override finalizer only if 'Dispose(disposing As Boolean)' has code to free unmanaged resources
' Protected Overrides Sub Finalize()
' ' Do not change this code. Put cleanup code in 'Dispose(disposing As Boolean)' method
' Dispose(disposing:=False)
' MyBase.Finalize()
' End Sub
Public Sub Dispose() Implements IDisposable.Dispose
' Do not change this code. Put cleanup code in 'Dispose(disposing As Boolean)' method
Dispose(disposing:=True)
GC.SuppressFinalize(Me)
End Sub
End Class
+16
View File
@@ -0,0 +1,16 @@
Imports CefSharp
Public Class ResourceHandlerFactory
Implements IResourceRequestHandlerFactory
Public ReadOnly Property HasHandlers As Boolean Implements IResourceRequestHandlerFactory.HasHandlers
Get
Return True
End Get
End Property
Public Function GetResourceRequestHandler(chromiumWebBrowser As IWebBrowser, browser As IBrowser, frame As IFrame, request As IRequest, isNavigation As Boolean, isDownload As Boolean, requestInitiator As String, ByRef disableDefaultHandling As Boolean) As IResourceRequestHandler Implements IResourceRequestHandlerFactory.GetResourceRequestHandler
Return New ResourceRequestHandler
End Function
End Class
+67
View File
@@ -0,0 +1,67 @@
Imports System.IO
Imports CefSharp
Imports CefSharp.Callback
Public Class ResourceRequestHandler
Implements IResourceRequestHandler
Private disposedValue As Boolean
Public Sub OnResourceRedirect(chromiumWebBrowser As IWebBrowser, browser As IBrowser, frame As IFrame, request As IRequest, response As IResponse, ByRef newUrl As String) Implements IResourceRequestHandler.OnResourceRedirect
Throw New NotImplementedException()
End Sub
Public Sub OnResourceLoadComplete(chromiumWebBrowser As IWebBrowser, browser As IBrowser, frame As IFrame, request As IRequest, response As IResponse, status As UrlRequestStatus, receivedContentLength As Long) Implements IResourceRequestHandler.OnResourceLoadComplete
End Sub
Public Function GetCookieAccessFilter(chromiumWebBrowser As IWebBrowser, browser As IBrowser, frame As IFrame, request As IRequest) As ICookieAccessFilter Implements IResourceRequestHandler.GetCookieAccessFilter
Return Nothing
End Function
Public Function OnBeforeResourceLoad(chromiumWebBrowser As IWebBrowser, browser As IBrowser, frame As IFrame, request As IRequest, callback As IRequestCallback) As CefReturnValue Implements IResourceRequestHandler.OnBeforeResourceLoad
Return CefReturnValue.Continue
End Function
Public Function GetResourceHandler(chromiumWebBrowser As IWebBrowser, browser As IBrowser, frame As IFrame, request As IRequest) As IResourceHandler Implements IResourceRequestHandler.GetResourceHandler
Return New ResourceHandler
End Function
Public Function OnResourceResponse(chromiumWebBrowser As IWebBrowser, browser As IBrowser, frame As IFrame, request As IRequest, response As IResponse) As Boolean Implements IResourceRequestHandler.OnResourceResponse
Return True
End Function
Public Function GetResourceResponseFilter(chromiumWebBrowser As IWebBrowser, browser As IBrowser, frame As IFrame, request As IRequest, response As IResponse) As IResponseFilter Implements IResourceRequestHandler.GetResourceResponseFilter
Return Nothing
End Function
Public Function OnProtocolExecution(chromiumWebBrowser As IWebBrowser, browser As IBrowser, frame As IFrame, request As IRequest) As Boolean Implements IResourceRequestHandler.OnProtocolExecution
Throw New NotImplementedException()
End Function
Protected Overridable Sub Dispose(disposing As Boolean)
'If Not disposedValue Then
' If disposing Then
' ' TODO: dispose managed state (managed objects)
' End If
' ' TODO: free unmanaged resources (unmanaged objects) and override finalizer
' ' TODO: set large fields to null
' disposedValue = True
'End If
End Sub
' ' TODO: override finalizer only if 'Dispose(disposing As Boolean)' has code to free unmanaged resources
' Protected Overrides Sub Finalize()
' ' Do not change this code. Put cleanup code in 'Dispose(disposing As Boolean)' method
' Dispose(disposing:=False)
' MyBase.Finalize()
' End Sub
Public Sub Dispose() Implements IDisposable.Dispose
' Do not change this code. Put cleanup code in 'Dispose(disposing As Boolean)' method
Dispose(disposing:=True)
GC.SuppressFinalize(Me)
End Sub
End Class
BIN
View File
Binary file not shown.
+163 -213
View File
@@ -1,4 +1,7 @@
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\packages\CefSharp.Common.109.1.110\build\CefSharp.Common.props" Condition="Exists('..\packages\CefSharp.Common.109.1.110\build\CefSharp.Common.props')" />
<Import Project="..\packages\cef.redist.x86.109.1.11\build\cef.redist.x86.props" Condition="Exists('..\packages\cef.redist.x86.109.1.11\build\cef.redist.x86.props')" />
<Import Project="..\packages\cef.redist.x64.109.1.11\build\cef.redist.x64.props" Condition="Exists('..\packages\cef.redist.x64.109.1.11\build\cef.redist.x64.props')" />
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" /> <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup> <PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
@@ -12,6 +15,8 @@
<MyType>Custom</MyType> <MyType>Custom</MyType>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects> <AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<Deterministic>true</Deterministic> <Deterministic>true</Deterministic>
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
</PropertyGroup> </PropertyGroup>
<PropertyGroup> <PropertyGroup>
<OptionExplicit>On</OptionExplicit> <OptionExplicit>On</OptionExplicit>
@@ -76,6 +81,15 @@
<Prefer32Bit>true</Prefer32Bit> <Prefer32Bit>true</Prefer32Bit>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="CefSharp, Version=109.1.110.0, Culture=neutral, PublicKeyToken=40c4b6fc221f4138, processorArchitecture=MSIL">
<HintPath>..\packages\CefSharp.Common.109.1.110\lib\net452\CefSharp.dll</HintPath>
</Reference>
<Reference Include="CefSharp.Core, Version=109.1.110.0, Culture=neutral, PublicKeyToken=40c4b6fc221f4138, processorArchitecture=MSIL">
<HintPath>..\packages\CefSharp.Common.109.1.110\lib\net452\CefSharp.Core.dll</HintPath>
</Reference>
<Reference Include="CefSharp.Wpf, Version=109.1.110.0, Culture=neutral, PublicKeyToken=40c4b6fc221f4138, processorArchitecture=MSIL">
<HintPath>..\packages\CefSharp.Wpf.109.1.110\lib\net462\CefSharp.Wpf.dll</HintPath>
</Reference>
<Reference Include="EgtUILib, Version=2.4.7.1, Culture=neutral, processorArchitecture=MSIL"> <Reference Include="EgtUILib, Version=2.4.7.1, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion> <SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\EgtProg\DllD32\EgtUILib.dll</HintPath> <HintPath>..\..\..\EgtProg\DllD32\EgtUILib.dll</HintPath>
@@ -87,7 +101,6 @@
<Reference Include="Ionic.Zip, Version=1.9.1.8, Culture=neutral, PublicKeyToken=edbe51ad942a3f5c, processorArchitecture=MSIL"> <Reference Include="Ionic.Zip, Version=1.9.1.8, Culture=neutral, PublicKeyToken=edbe51ad942a3f5c, processorArchitecture=MSIL">
<HintPath>..\packages\Ionic.Zip.1.9.1.8\lib\Ionic.Zip.dll</HintPath> <HintPath>..\packages\Ionic.Zip.1.9.1.8\lib\Ionic.Zip.dll</HintPath>
</Reference> </Reference>
<Reference Include="PresentationFramework.Aero2" />
<Reference Include="System.Core" /> <Reference Include="System.Core" />
<Reference Include="System.Drawing" /> <Reference Include="System.Drawing" />
<Reference Include="System.Windows.Forms" /> <Reference Include="System.Windows.Forms" />
@@ -113,18 +126,20 @@
<Compile Include="AboutBoxWindow\AboutBoxV.xaml.vb"> <Compile Include="AboutBoxWindow\AboutBoxV.xaml.vb">
<DependentUpon>AboutBoxV.xaml</DependentUpon> <DependentUpon>AboutBoxV.xaml</DependentUpon>
</Compile> </Compile>
<Compile Include="AttachedProperties\TreeViewItemHelper.vb" />
<Compile Include="ChooseMachineWnd\ChooseMachineWndV.xaml.vb"> <Compile Include="ChooseMachineWnd\ChooseMachineWndV.xaml.vb">
<DependentUpon>ChooseMachineWndV.xaml</DependentUpon> <DependentUpon>ChooseMachineWndV.xaml</DependentUpon>
</Compile> </Compile>
<Compile Include="ChooseMachineWnd\ChooseMachineWndVM.vb" /> <Compile Include="ChooseMachineWnd\ChooseMachineWndVM.vb" />
<Compile Include="ChooseReferenceWnd\ChooseReferenceWndV.xaml.vb">
<DependentUpon>ChooseReferenceWndV.xaml</DependentUpon>
</Compile>
<Compile Include="ChooseReferenceWnd\ChooseReferenceWndVM.vb" />
<Compile Include="Constants\Const3dPrint.vb" /> <Compile Include="Constants\Const3dPrint.vb" />
<Compile Include="Constants\ConstBeam.vb" /> <Compile Include="Constants\ConstBeam.vb" />
<Compile Include="Constants\ConstColumns.vb" /> <Compile Include="Constants\ConstColumns.vb" />
<Compile Include="Constants\ConstDataGridColumnsIni.vb" /> <Compile Include="Constants\ConstDataGridColumnsIni.vb" />
<Compile Include="Constants\ConstDims.vb" /> <Compile Include="Constants\ConstDims.vb" />
<Compile Include="Constants\ConstGen.vb" /> <Compile Include="Constants\ConstGen.vb" />
<Compile Include="Constants\ConstMachDataIni.vb" />
<Compile Include="Constants\ConstIni.vb" /> <Compile Include="Constants\ConstIni.vb" />
<Compile Include="Constants\ConstMachComm.vb" /> <Compile Include="Constants\ConstMachComm.vb" />
<Compile Include="Constants\ConstMachIni.vb" /> <Compile Include="Constants\ConstMachIni.vb" />
@@ -137,12 +152,6 @@
<DependentUpon>CurrLayerSliderV.xaml</DependentUpon> <DependentUpon>CurrLayerSliderV.xaml</DependentUpon>
</Compile> </Compile>
<Compile Include="CurrLayerSlider\CurrLayerSliderVM.vb" /> <Compile Include="CurrLayerSlider\CurrLayerSliderVM.vb" />
<Compile Include="CustomControls\CheckedImageRadioButton.xaml.vb">
<DependentUpon>CheckedImageRadioButton.xaml</DependentUpon>
</Compile>
<Compile Include="CustomControls\CheckedImageToggleButton.xaml.vb">
<DependentUpon>CheckedImageToggleButton.xaml</DependentUpon>
</Compile>
<Compile Include="DataGridMultiselectManaging\IListItemConverter.vb" /> <Compile Include="DataGridMultiselectManaging\IListItemConverter.vb" />
<Compile Include="DataGridMultiselectManaging\MultiSelectorBehaviours.vb" /> <Compile Include="DataGridMultiselectManaging\MultiSelectorBehaviours.vb" />
<Compile Include="DataGridMultiselectManaging\TwoListSynchronizer.vb" /> <Compile Include="DataGridMultiselectManaging\TwoListSynchronizer.vb" />
@@ -150,26 +159,17 @@
<DependentUpon>DispositionPanelV.xaml</DependentUpon> <DependentUpon>DispositionPanelV.xaml</DependentUpon>
</Compile> </Compile>
<Compile Include="DispositionPanel\DispositionPanelVM.vb" /> <Compile Include="DispositionPanel\DispositionPanelVM.vb" />
<Compile Include="EgtMessageBox\EgtMessageBoxV.xaml.vb"> <Compile Include="HelpWnd\HelpWndV.xaml.vb">
<DependentUpon>EgtMessageBoxV.xaml</DependentUpon> <DependentUpon>HelpWndV.xaml</DependentUpon>
</Compile> </Compile>
<Compile Include="EgtMessageBox\EgtMessageBoxVM.vb" /> <Compile Include="HelpWnd\HelpWndVM.vb" />
<Compile Include="FilledSolidPanel\FilledSolidPanelV.xaml.vb"> <Compile Include="HelpWnd\ResourceHandler.vb" />
<DependentUpon>FilledSolidPanelV.xaml</DependentUpon> <Compile Include="HelpWnd\ResourceRequestHandler.vb" />
</Compile> <Compile Include="HelpWnd\ResourceHandlerFactory.vb" />
<Compile Include="FilledSolidPanel\FilledSolidPanelVM.vb" />
<Compile Include="FilledSolidParamPanel\FilledSolidParamPanelV.xaml.vb">
<DependentUpon>FilledSolidParamPanelV.xaml</DependentUpon>
</Compile>
<Compile Include="FilledSolidParamPanel\FilledSolidParamPanelVM.vb" />
<Compile Include="ImportExportMachiningPanel\ImportExportMachiningPanelV.xaml.vb"> <Compile Include="ImportExportMachiningPanel\ImportExportMachiningPanelV.xaml.vb">
<DependentUpon>ImportExportMachiningPanelV.xaml</DependentUpon> <DependentUpon>ImportExportMachiningPanelV.xaml</DependentUpon>
</Compile> </Compile>
<Compile Include="ImportExportMachiningPanel\ImportExportMachiningPanelVM.vb" /> <Compile Include="ImportExportMachiningPanel\ImportExportMachiningPanelVM.vb" />
<Compile Include="ImportLoadingWnd\ImportLoadingWndV.xaml.vb">
<DependentUpon>ImportLoadingWndV.xaml</DependentUpon>
</Compile>
<Compile Include="ImportLoadingWnd\ImportLoadingWndVM.vb" />
<Compile Include="InstrumentPanel\InstrumentPanelV.xaml.vb"> <Compile Include="InstrumentPanel\InstrumentPanelV.xaml.vb">
<DependentUpon>InstrumentPanelV.xaml</DependentUpon> <DependentUpon>InstrumentPanelV.xaml</DependentUpon>
</Compile> </Compile>
@@ -182,10 +182,6 @@
<DependentUpon>MachinePanelV.xaml</DependentUpon> <DependentUpon>MachinePanelV.xaml</DependentUpon>
</Compile> </Compile>
<Compile Include="MachinePanel\MachinePanelVM.vb" /> <Compile Include="MachinePanel\MachinePanelVM.vb" />
<Compile Include="MachineViewPanel\MachineViewPanelV.xaml.vb">
<DependentUpon>MachineViewPanelV.xaml</DependentUpon>
</Compile>
<Compile Include="MachineViewPanel\MachineViewPanelVM.vb" />
<Compile Include="MachiningDb\MachiningDbV.xaml.vb"> <Compile Include="MachiningDb\MachiningDbV.xaml.vb">
<DependentUpon>MachiningDbV.xaml</DependentUpon> <DependentUpon>MachiningDbV.xaml</DependentUpon>
</Compile> </Compile>
@@ -210,11 +206,8 @@
<DependentUpon>MaterialDbV.xaml</DependentUpon> <DependentUpon>MaterialDbV.xaml</DependentUpon>
</Compile> </Compile>
<Compile Include="MaterialDb\MaterialDbVM.vb" /> <Compile Include="MaterialDb\MaterialDbVM.vb" />
<Compile Include="TSFEditor\ColumnHeader.xaml.vb"> <Compile Include="OptionsWindow\MachineBox.xaml.vb">
<DependentUpon>ColumnHeader.xaml</DependentUpon> <DependentUpon>MachineBox.xaml</DependentUpon>
</Compile>
<Compile Include="UpdateMachine\UpdateMachineV.xaml.vb">
<DependentUpon>UpdateMachineV.xaml</DependentUpon>
</Compile> </Compile>
<Compile Include="OptionsWindow\OptionModule.vb" /> <Compile Include="OptionsWindow\OptionModule.vb" />
<Compile Include="OptionsWindow\OptionWindowV.xaml.vb"> <Compile Include="OptionsWindow\OptionWindowV.xaml.vb">
@@ -268,7 +261,6 @@
<Compile Include="ShowPanel\ShowPanelV.xaml.vb"> <Compile Include="ShowPanel\ShowPanelV.xaml.vb">
<DependentUpon>ShowPanelV.xaml</DependentUpon> <DependentUpon>ShowPanelV.xaml</DependentUpon>
</Compile> </Compile>
<Compile Include="ShowPanel\ShowPanelVM.vb" />
<Compile Include="ShowValueSlider\ShowValueSlider.xaml.vb"> <Compile Include="ShowValueSlider\ShowValueSlider.xaml.vb">
<DependentUpon>ShowValueSlider.xaml</DependentUpon> <DependentUpon>ShowValueSlider.xaml</DependentUpon>
</Compile> </Compile>
@@ -301,9 +293,6 @@
<DependentUpon>StartMachPanelV.xaml</DependentUpon> <DependentUpon>StartMachPanelV.xaml</DependentUpon>
</Compile> </Compile>
<Compile Include="StartMachPanel\StartMachPanelVM.vb" /> <Compile Include="StartMachPanel\StartMachPanelVM.vb" />
<Compile Include="StatusBar\MessagePanelV.xaml.vb">
<DependentUpon>MessagePanelV.xaml</DependentUpon>
</Compile>
<Compile Include="StatusBar\MyStatusBarVM.vb" /> <Compile Include="StatusBar\MyStatusBarVM.vb" />
<Compile Include="StatusBar\StatusBarV.xaml.vb"> <Compile Include="StatusBar\StatusBarV.xaml.vb">
<DependentUpon>StatusBarV.xaml</DependentUpon> <DependentUpon>StatusBarV.xaml</DependentUpon>
@@ -316,8 +305,8 @@
<Compile Include="TSFEditor\TFSEditorV.xaml.vb"> <Compile Include="TSFEditor\TFSEditorV.xaml.vb">
<DependentUpon>TFSEditorV.xaml</DependentUpon> <DependentUpon>TFSEditorV.xaml</DependentUpon>
</Compile> </Compile>
<Compile Include="UpdateMachine\UpdateMachineVM.vb" />
<Compile Include="Utility\CurrentMachine.vb" /> <Compile Include="Utility\CurrentMachine.vb" />
<Compile Include="Utility\CustomMenuHandler.vb" />
<Compile Include="Utility\Dictionary.xaml.vb"> <Compile Include="Utility\Dictionary.xaml.vb">
<DependentUpon>Dictionary.xaml</DependentUpon> <DependentUpon>Dictionary.xaml</DependentUpon>
</Compile> </Compile>
@@ -346,6 +335,10 @@
<Generator>MSBuild:Compile</Generator> <Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType> <SubType>Designer</SubType>
</Page> </Page>
<Page Include="ChooseReferenceWnd\ChooseReferenceWndV.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="ControllerInputPanel\ControllerInputPanelV.xaml"> <Page Include="ControllerInputPanel\ControllerInputPanelV.xaml">
<Generator>MSBuild:Compile</Generator> <Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType> <SubType>Designer</SubType>
@@ -354,37 +347,17 @@
<SubType>Designer</SubType> <SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator> <Generator>MSBuild:Compile</Generator>
</Page> </Page>
<Page Include="CustomControls\CheckedImageRadioButton.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="CustomControls\CheckedImageToggleButton.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="DispositionPanel\DispositionPanelV.xaml"> <Page Include="DispositionPanel\DispositionPanelV.xaml">
<Generator>MSBuild:Compile</Generator> <Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType> <SubType>Designer</SubType>
</Page> </Page>
<Page Include="EgtMessageBox\EgtMessageBoxV.xaml"> <Page Include="HelpWnd\HelpWndV.xaml">
<SubType>Designer</SubType> <SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator> <Generator>MSBuild:Compile</Generator>
</Page> </Page>
<Page Include="FilledSolidPanel\FilledSolidPanelV.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="FilledSolidParamPanel\FilledSolidParamPanelV.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="ImportExportMachiningPanel\ImportExportMachiningPanelV.xaml"> <Page Include="ImportExportMachiningPanel\ImportExportMachiningPanelV.xaml">
<SubType>Designer</SubType>
<Generator>XamlIntelliSenseFileGenerator</Generator>
</Page>
<Page Include="ImportLoadingWnd\ImportLoadingWndV.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator> <Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page> </Page>
<Page Include="InstrumentPanel\InstrumentPanelV.xaml"> <Page Include="InstrumentPanel\InstrumentPanelV.xaml">
<Generator>MSBuild:Compile</Generator> <Generator>MSBuild:Compile</Generator>
@@ -398,10 +371,6 @@
<Generator>MSBuild:Compile</Generator> <Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType> <SubType>Designer</SubType>
</Page> </Page>
<Page Include="MachineViewPanel\MachineViewPanelV.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="MachiningDb\MachiningDbV.xaml"> <Page Include="MachiningDb\MachiningDbV.xaml">
<SubType>Designer</SubType> <SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator> <Generator>MSBuild:Compile</Generator>
@@ -438,11 +407,7 @@
<SubType>Designer</SubType> <SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator> <Generator>MSBuild:Compile</Generator>
</Page> </Page>
<Page Include="TSFEditor\ColumnHeader.xaml"> <Page Include="OptionsWindow\MachineBox.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="UpdateMachine\UpdateMachineV.xaml">
<Generator>MSBuild:Compile</Generator> <Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType> <SubType>Designer</SubType>
</Page> </Page>
@@ -530,10 +495,6 @@
<Generator>MSBuild:Compile</Generator> <Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType> <SubType>Designer</SubType>
</Page> </Page>
<Page Include="StatusBar\MessagePanelV.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="StatusBar\StatusBarV.xaml"> <Page Include="StatusBar\StatusBarV.xaml">
<Generator>MSBuild:Compile</Generator> <Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType> <SubType>Designer</SubType>
@@ -601,18 +562,98 @@
<DependentUpon>Settings.settings</DependentUpon> <DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput> <DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile> </Compile>
<EmbeddedResource Include="Icarus.pdf" />
<EmbeddedResource Include="My Project\Resources.resx"> <EmbeddedResource Include="My Project\Resources.resx">
<Generator>VbMyResourcesResXFileCodeGenerator</Generator> <Generator>VbMyResourcesResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.vb</LastGenOutput> <LastGenOutput>Resources.Designer.vb</LastGenOutput>
<CustomToolNamespace>My.Resources</CustomToolNamespace> <CustomToolNamespace>My.Resources</CustomToolNamespace>
</EmbeddedResource> </EmbeddedResource>
<Resource Include="Resources\Manual\Icarus.pdf" />
<None Include="app.manifest" /> <None Include="app.manifest" />
<None Include="My Project\Settings.settings"> <None Include="My Project\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator> <Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.vb</LastGenOutput> <LastGenOutput>Settings.Designer.vb</LastGenOutput>
</None> </None>
<None Include="packages.config" /> <None Include="packages.config" />
<Resource Include="Resources\EgtMessageBox\Error.png" /> <None Include="Resources\Manual\Demo\templates\default\delos.css.map" />
<None Include="Resources\Manual\Demo\templates\default\delos.less" />
<None Include="Resources\Manual\Demo\templates\default\less\bootstrap-variables.less" />
<None Include="Resources\Manual\Demo\templates\default\less\color.less" />
<None Include="Resources\Manual\Demo\templates\default\less\deprecated.less" />
<None Include="Resources\Manual\Demo\templates\default\less\focus-mixin.less" />
<None Include="Resources\Manual\Demo\templates\default\less\font.less" />
<None Include="Resources\Manual\Demo\templates\default\less\Modules\Bibliographic\delos.less" />
<None Include="Resources\Manual\Demo\templates\default\less\Modules\Blog\delos.less" />
<None Include="Resources\Manual\Demo\templates\default\less\Modules\BookingManager\delos.less" />
<None Include="Resources\Manual\Demo\templates\default\less\Modules\Chatroom\delos.less" />
<None Include="Resources\Manual\Demo\templates\default\less\Modules\Course\delos.less" />
<None Include="Resources\Manual\Demo\templates\default\less\Modules\DataCollection\delos.less" />
<None Include="Resources\Manual\Demo\templates\default\less\Modules\Excercise\delos.less" />
<None Include="Resources\Manual\Demo\templates\default\less\Modules\Forum\delos.less" />
<None Include="Resources\Manual\Demo\templates\default\less\Modules\LearningModule\delos.less" />
<None Include="Resources\Manual\Demo\templates\default\less\Modules\LearningSequence\delos.less" />
<None Include="Resources\Manual\Demo\templates\default\less\Modules\LTIConsumer\delos.less" />
<None Include="Resources\Manual\Demo\templates\default\less\Modules\MediaPool\delos.less" />
<None Include="Resources\Manual\Demo\templates\default\less\Modules\Poll\delos.less" />
<None Include="Resources\Manual\Demo\templates\default\less\Modules\Portfolio\delos.less" />
<None Include="Resources\Manual\Demo\templates\default\less\Modules\ScormAicc\delos.less" />
<None Include="Resources\Manual\Demo\templates\default\less\Modules\Survey\delos.less" />
<None Include="Resources\Manual\Demo\templates\default\less\Modules\Test\delos.less" />
<None Include="Resources\Manual\Demo\templates\default\less\Modules\Wiki\delos.less" />
<None Include="Resources\Manual\Demo\templates\default\less\Modules\WorkspaceFolder\delos.less" />
<None Include="Resources\Manual\Demo\templates\default\less\multi-line-cap.less" />
<None Include="Resources\Manual\Demo\templates\default\less\reset.less" />
<None Include="Resources\Manual\Demo\templates\default\less\screenreader-only-mixins.less" />
<None Include="Resources\Manual\Demo\templates\default\less\Services\Accordion\delos.less" />
<None Include="Resources\Manual\Demo\templates\default\less\Services\Awareness\delos.less" />
<None Include="Resources\Manual\Demo\templates\default\less\Services\Badge\delos.less" />
<None Include="Resources\Manual\Demo\templates\default\less\Services\Block\delos.less" />
<None Include="Resources\Manual\Demo\templates\default\less\Services\Bookmarks\delos.less" />
<None Include="Resources\Manual\Demo\templates\default\less\Services\Calendar\bootstrap-datetimepicker.less" />
<None Include="Resources\Manual\Demo\templates\default\less\Services\Calendar\delos.less" />
<None Include="Resources\Manual\Demo\templates\default\less\Services\Captcha\delos.less" />
<None Include="Resources\Manual\Demo\templates\default\less\Services\Certificate\delos.less" />
<None Include="Resources\Manual\Demo\templates\default\less\Services\Chart\delos.less" />
<None Include="Resources\Manual\Demo\templates\default\less\Services\Container\delos.less" />
<None Include="Resources\Manual\Demo\templates\default\less\Services\COPage\delos.less" />
<None Include="Resources\Manual\Demo\templates\default\less\Services\FileUpload\delos.less" />
<None Include="Resources\Manual\Demo\templates\default\less\Services\Form\delos.less" />
<None Include="Resources\Manual\Demo\templates\default\less\Services\Help\delos.less" />
<None Include="Resources\Manual\Demo\templates\default\less\Services\InfoScreen\delos.less" />
<None Include="Resources\Manual\Demo\templates\default\less\Services\Init\delos.less" />
<None Include="Resources\Manual\Demo\templates\default\less\Services\LearningHistory\delos.less" />
<None Include="Resources\Manual\Demo\templates\default\less\Services\Like\delos.less" />
<None Include="Resources\Manual\Demo\templates\default\less\Services\Mail\delos.less" />
<None Include="Resources\Manual\Demo\templates\default\less\Services\MainMenu\delos.less" />
<None Include="Resources\Manual\Demo\templates\default\less\Services\MediaObjects\delos.less" />
<None Include="Resources\Manual\Demo\templates\default\less\Services\Membership\delos.less" />
<None Include="Resources\Manual\Demo\templates\default\less\Services\Navigation\delos.less" />
<None Include="Resources\Manual\Demo\templates\default\less\Services\News\delos.less" />
<None Include="Resources\Manual\Demo\templates\default\less\Services\Notes\delos.less" />
<None Include="Resources\Manual\Demo\templates\default\less\Services\Object\delos.less" />
<None Include="Resources\Manual\Demo\templates\default\less\Services\OnScreenChat\delos.less" />
<None Include="Resources\Manual\Demo\templates\default\less\Services\Preview\delos.less" />
<None Include="Resources\Manual\Demo\templates\default\less\Services\Rating\delos.less" />
<None Include="Resources\Manual\Demo\templates\default\less\Services\Search\delos.less" />
<None Include="Resources\Manual\Demo\templates\default\less\Services\Skill\delos.less" />
<None Include="Resources\Manual\Demo\templates\default\less\Services\Style\delos.less" />
<None Include="Resources\Manual\Demo\templates\default\less\Services\Table\delos.less" />
<None Include="Resources\Manual\Demo\templates\default\less\Services\Tags\delos.less" />
<None Include="Resources\Manual\Demo\templates\default\less\Services\TermsOfService\delos.less" />
<None Include="Resources\Manual\Demo\templates\default\less\Services\UIComponent\AdvancedSelectionList\delos.less" />
<None Include="Resources\Manual\Demo\templates\default\less\Services\UIComponent\Button\delos.less" />
<None Include="Resources\Manual\Demo\templates\default\less\Services\UIComponent\Checklist\delos.less" />
<None Include="Resources\Manual\Demo\templates\default\less\Services\UIComponent\Explorer2\delos.less" />
<None Include="Resources\Manual\Demo\templates\default\less\Services\UIComponent\GroupedList\delos.less" />
<None Include="Resources\Manual\Demo\templates\default\less\Services\UIComponent\Lightbox\delos.less" />
<None Include="Resources\Manual\Demo\templates\default\less\Services\UIComponent\Modal\delos.less" />
<None Include="Resources\Manual\Demo\templates\default\less\Services\UIComponent\ProgressBar\delos.less" />
<None Include="Resources\Manual\Demo\templates\default\less\Services\UIComponent\Tabs\delos.less" />
<None Include="Resources\Manual\Demo\templates\default\less\Services\UIComponent\Toolbar\delos.less" />
<None Include="Resources\Manual\Demo\templates\default\less\Services\UIComponent\Tooltip\delos.less" />
<None Include="Resources\Manual\Demo\templates\default\less\Services\User\delos.less" />
<None Include="Resources\Manual\Demo\templates\default\less\Services\WebDAV\delos.less" />
<None Include="Resources\Manual\Demo\templates\default\less\variables.less" />
<Resource Include="Resources\Fonts\Roboto-Regular.ttf" /> <Resource Include="Resources\Fonts\Roboto-Regular.ttf" />
<Resource Include="Resources\Fonts\Roboto-Light.ttf" /> <Resource Include="Resources\Fonts\Roboto-Light.ttf" />
</ItemGroup> </ItemGroup>
@@ -624,12 +665,16 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Resource Include="Resources\ProjectManager\ExportProject.png" /> <Resource Include="Resources\ProjectManager\ExportProject.png" />
<Resource Include="Resources\ProjectManager\GoToProd.png" />
<Resource Include="Resources\ProjectManager\GoToProj.png" />
<Resource Include="Resources\ProjectManager\ImportBTL.png" />
<Resource Include="Resources\ProjectManager\ImportProject.png" /> <Resource Include="Resources\ProjectManager\ImportProject.png" />
<Resource Include="Resources\ProjectManager\New.png" /> <Resource Include="Resources\ProjectManager\New.png" />
<Resource Include="Resources\ProjectManager\Open.png" /> <Resource Include="Resources\ProjectManager\Open.png" />
<Resource Include="Resources\ProjectManager\Options.png" /> <Resource Include="Resources\ProjectManager\Options.png" />
<Resource Include="Resources\ProjectManager\Save.png" /> <Resource Include="Resources\ProjectManager\Save.png" />
<Resource Include="Resources\ProjectManager\SaveAs.png" /> <Resource Include="Resources\ProjectManager\SaveAs.png" />
<Resource Include="Resources\ProjectManager\UpdateBTL.png" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Resource Include="Resources\ProjectManager\Import.png" /> <Resource Include="Resources\ProjectManager\Import.png" />
@@ -641,11 +686,16 @@
<Resource Include="Resources\ViewPanel\LookFromBACK.png" /> <Resource Include="Resources\ViewPanel\LookFromBACK.png" />
<Resource Include="Resources\ViewPanel\LookFromBOTTOM.png" /> <Resource Include="Resources\ViewPanel\LookFromBOTTOM.png" />
<Resource Include="Resources\ViewPanel\LookFromFRONT.png" /> <Resource Include="Resources\ViewPanel\LookFromFRONT.png" />
<Resource Include="Resources\ViewPanel\LookFromISO_NE.png" />
<Resource Include="Resources\ViewPanel\LookFromISO_NW.png" />
<Resource Include="Resources\ViewPanel\LookFromISO_SE.png" />
<Resource Include="Resources\ViewPanel\LookFromISO_SW.png" /> <Resource Include="Resources\ViewPanel\LookFromISO_SW.png" />
<Resource Include="Resources\ViewPanel\LookFromLEFT.png" /> <Resource Include="Resources\ViewPanel\LookFromLEFT.png" />
<Resource Include="Resources\ViewPanel\LookFromRIGHT.png" /> <Resource Include="Resources\ViewPanel\LookFromRIGHT.png" />
<Resource Include="Resources\ViewPanel\LookFromTOP.png" /> <Resource Include="Resources\ViewPanel\LookFromTOP.png" />
<Resource Include="Resources\ViewPanel\ZoomAll.png" /> <Resource Include="Resources\ViewPanel\ZoomAll.png" />
<Resource Include="Resources\ViewPanel\ZoomIn.png" />
<Resource Include="Resources\ViewPanel\ZoomOut.png" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Resource Include="Resources\ShowPanel\CurveDir.png" /> <Resource Include="Resources\ShowPanel\CurveDir.png" />
@@ -654,7 +704,10 @@
<Resource Include="Resources\ShowPanel\RenderingWF.png" /> <Resource Include="Resources\ShowPanel\RenderingWF.png" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Resource Include="Resources\InstrumentPanel\Analyze.png" />
<Resource Include="Resources\InstrumentPanel\ChangeParam.png" />
<Resource Include="Resources\InstrumentPanel\GetDist.png" /> <Resource Include="Resources\InstrumentPanel\GetDist.png" />
<Resource Include="Resources\InstrumentPanel\Statistics.png" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Resource Include="Resources\TreeView\Folder.png" /> <Resource Include="Resources\TreeView\Folder.png" />
@@ -666,6 +719,7 @@
<Resource Include="Resources\DrawPanel\Line2P.png" /> <Resource Include="Resources\DrawPanel\Line2P.png" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Resource Include="Resources\GridViewPanel\Cplane3POINTS.png" />
<Resource Include="Resources\GridViewPanel\CplaneBACK.png" /> <Resource Include="Resources\GridViewPanel\CplaneBACK.png" />
<Resource Include="Resources\GridViewPanel\CplaneBOTTOM.png" /> <Resource Include="Resources\GridViewPanel\CplaneBOTTOM.png" />
<Resource Include="Resources\GridViewPanel\CplaneELEVATION.png" /> <Resource Include="Resources\GridViewPanel\CplaneELEVATION.png" />
@@ -673,8 +727,11 @@
<Resource Include="Resources\GridViewPanel\CplaneLEFT.png" /> <Resource Include="Resources\GridViewPanel\CplaneLEFT.png" />
<Resource Include="Resources\GridViewPanel\CplaneOBJECT.png" /> <Resource Include="Resources\GridViewPanel\CplaneOBJECT.png" />
<Resource Include="Resources\GridViewPanel\CplaneORIGIN.png" /> <Resource Include="Resources\GridViewPanel\CplaneORIGIN.png" />
<Resource Include="Resources\GridViewPanel\CplanePERPCURVE.png" />
<Resource Include="Resources\GridViewPanel\CplaneRIGHT.png" /> <Resource Include="Resources\GridViewPanel\CplaneRIGHT.png" />
<Resource Include="Resources\GridViewPanel\CplaneROTATE.png" />
<Resource Include="Resources\GridViewPanel\CplaneTOP.png" /> <Resource Include="Resources\GridViewPanel\CplaneTOP.png" />
<Resource Include="Resources\GridViewPanel\CplaneView.png" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Resource Include="Resources\DrawPanel\Delete.png" /> <Resource Include="Resources\DrawPanel\Delete.png" />
@@ -719,155 +776,38 @@
<ItemGroup> <ItemGroup>
<Resource Include="Resources\TopPanel\Edit.png" /> <Resource Include="Resources\TopPanel\Edit.png" />
</ItemGroup> </ItemGroup>
<ItemGroup>
<Resource Include="Resources\MachiningDb\Export.png" />
<Resource Include="Resources\MachiningDb\Import.png" />
</ItemGroup>
<ItemGroup> <ItemGroup>
<Resource Include="Resources\SplashScreen\GoldSplashscreen.png" /> <Resource Include="Resources\SplashScreen\GoldSplashscreen.png" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Resource Include="Resources\SplashScreen\LogoEgalware.png" /> <Resource Include="Resources\SplashScreen\LogoEgalware.png" />
</ItemGroup> </ItemGroup>
<ItemGroup>
<Resource Include="Resources\TopPanel\ManagePart.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\TopPanel\MaterialDb.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\TopPanel\MachiningDb.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\StatusBar\GridVisibility.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\InstrumentPanel\EdgeAnalysis.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\ViewPanel\CplaneView.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\StatusBar\GridVisibilityWhite.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\MachiningDb\MachiningExport.png" />
<Resource Include="Resources\MachiningDb\MachiningImport.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\TFSEditor\Expand.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\SliderManager\FromSelected.png" />
<Resource Include="Resources\SliderManager\OnlySelected.png" />
<Resource Include="Resources\SliderManager\UntilSelected.png" />
</ItemGroup>
<ItemGroup> <ItemGroup>
<Resource Include="Resources\ProjectManager\Export.png" /> <Resource Include="Resources\ProjectManager\Export.png" />
</ItemGroup> </ItemGroup>
<ItemGroup />
<ItemGroup> <ItemGroup>
<Resource Include="Resources\ShowPanel\CurveDir_White.png" /> <EmbeddedResource Include="Resources\Manual\Demo\index.html" />
</ItemGroup> <EmbeddedResource Include="Resources\Manual\Demo\templates\default\buttons.js" />
<ItemGroup> <EmbeddedResource Include="Resources\Manual\Demo\templates\default\default.css" />
<Resource Include="Resources\ShowPanel\RenderingHL_White.png" /> <EmbeddedResource Include="Resources\Manual\Demo\templates\default\delos.css" />
</ItemGroup> <EmbeddedResource Include="Resources\Manual\Demo\templates\default\delos_cont.css" />
<ItemGroup> <EmbeddedResource Include="Resources\Manual\Demo\templates\default\template.xml" />
<Resource Include="Resources\ShowPanel\RenderingSH_White.png" /> <EmbeddedResource Include="Resources\Manual\Demo\templates\default\tpl.adm_content.html" />
</ItemGroup> <EmbeddedResource Include="Resources\Manual\Demo\templates\default\tpl.buttons.html" />
<ItemGroup> <EmbeddedResource Include="Resources\Manual\Demo\templates\default\tpl.error.html" />
<Resource Include="Resources\ShowPanel\RenderingWF_White.png" /> <EmbeddedResource Include="Resources\Manual\Demo\templates\default\tpl.explorer.html" />
</ItemGroup> <EmbeddedResource Include="Resources\Manual\Demo\templates\default\tpl.frameset.html" />
<ItemGroup> <EmbeddedResource Include="Resources\Manual\Demo\templates\default\tpl.main.html" />
<Resource Include="Resources\InstrumentPanel\EdgeAnalysis_White.png" /> <EmbeddedResource Include="Resources\Manual\Demo\templates\default\tpl.obj_tbl_rows.html" />
</ItemGroup> <EmbeddedResource Include="Resources\Manual\Demo\templates\default\tpl.page_content.html" />
<ItemGroup> <EmbeddedResource Include="Resources\Manual\Demo\templates\default\tpl.page_content_bak.html" />
<Resource Include="Resources\InstrumentPanel\GetDist_White.png" /> <EmbeddedResource Include="Resources\Manual\Demo\templates\default\tpl.statusline.html" />
</ItemGroup> <EmbeddedResource Include="Resources\Manual\Demo\templates\default\tpl.table.html" />
<ItemGroup>
<Resource Include="Resources\MachiningDb\Edit.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\TopPanel\Offset.png" />
<Resource Include="Resources\TopPanel\SlicingDirection.png" />
<Resource Include="Resources\TopPanel\StrandCount.png" />
<Resource Include="Resources\TopPanel\StrandH.png" />
<Resource Include="Resources\TopPanel\StrandW.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\Common\Cancel.png" />
<Resource Include="Resources\Common\Ok.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\SimulationPanel\HeadMode.png" />
<Resource Include="Resources\SimulationPanel\MachMode.png" />
<Resource Include="Resources\SimulationPanel\ToolMode.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\AboutBox\EgalwareLogo.png" />
<Resource Include="Resources\AboutBox\IcarusLogo.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\CurrMachining\SaveInDb.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\MaterialDb\Edit.png" />
<Resource Include="Resources\MaterialDb\MaterialExport.png" />
<Resource Include="Resources\MaterialDb\MaterialImport.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\ViewPanel\LookFromISO_SE.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\Common\Close.png" />
<Resource Include="Resources\Common\Maximize.png" />
<Resource Include="Resources\Common\Minimize.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\Common\Restore.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\SliceManager\StopCalculation.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\SplashScreen\BlueSplashscreen.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\SliceManager\Dimensions.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\TFSEditor\Reduce.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\ReferencePanel\BC.png" />
<Resource Include="Resources\ReferencePanel\BL.png" />
<Resource Include="Resources\ReferencePanel\BR.png" />
<Resource Include="Resources\ReferencePanel\MC.png" />
<Resource Include="Resources\ReferencePanel\ML.png" />
<Resource Include="Resources\ReferencePanel\MR.png" />
<Resource Include="Resources\ReferencePanel\TC.png" />
<Resource Include="Resources\ReferencePanel\TL.png" />
<Resource Include="Resources\ReferencePanel\TR.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\ReferencePanel\White_BC.png" />
<Resource Include="Resources\ReferencePanel\White_BL.png" />
<Resource Include="Resources\ReferencePanel\White_BR.png" />
<Resource Include="Resources\ReferencePanel\White_MC.png" />
<Resource Include="Resources\ReferencePanel\White_ML.png" />
<Resource Include="Resources\ReferencePanel\White_MR.png" />
<Resource Include="Resources\ReferencePanel\White_TC.png" />
<Resource Include="Resources\ReferencePanel\White_TL.png" />
<Resource Include="Resources\ReferencePanel\White_TR.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\SliceManager\Mass.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\SliceManager\Time.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\RibParamPanel\CopyFrom.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\EgtMessageBox\Information.png" />
<Resource Include="Resources\EgtMessageBox\Question.png" />
<Resource Include="Resources\EgtMessageBox\Warning.png" />
</ItemGroup> </ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" /> <Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />
<PropertyGroup> <PropertyGroup>
@@ -876,4 +816,14 @@ IF "$(PlatformName)"=="x86" IF "$(ConfigurationName)" == "Debug" copy $(TargetPa
IF "$(PlatformName)"=="x64" IF "$(ConfigurationName)" == "Release" copy $(TargetPath) c:\EgtProg\Icarus\IcarusR64.exe IF "$(PlatformName)"=="x64" IF "$(ConfigurationName)" == "Release" copy $(TargetPath) c:\EgtProg\Icarus\IcarusR64.exe
IF "$(PlatformName)"=="x64" IF "$(ConfigurationName)" == "Debug" copy $(TargetPath) c:\EgtProg\Icarus\IcarusD64.exe</PostBuildEvent> IF "$(PlatformName)"=="x64" IF "$(ConfigurationName)" == "Debug" copy $(TargetPath) c:\EgtProg\Icarus\IcarusD64.exe</PostBuildEvent>
</PropertyGroup> </PropertyGroup>
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\packages\cef.redist.x64.109.1.11\build\cef.redist.x64.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\cef.redist.x64.109.1.11\build\cef.redist.x64.props'))" />
<Error Condition="!Exists('..\packages\cef.redist.x86.109.1.11\build\cef.redist.x86.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\cef.redist.x86.109.1.11\build\cef.redist.x86.props'))" />
<Error Condition="!Exists('..\packages\CefSharp.Common.109.1.110\build\CefSharp.Common.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\CefSharp.Common.109.1.110\build\CefSharp.Common.props'))" />
<Error Condition="!Exists('..\packages\CefSharp.Common.109.1.110\build\CefSharp.Common.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\CefSharp.Common.109.1.110\build\CefSharp.Common.targets'))" />
</Target>
<Import Project="..\packages\CefSharp.Common.109.1.110\build\CefSharp.Common.targets" Condition="Exists('..\packages\CefSharp.Common.109.1.110\build\CefSharp.Common.targets')" />
</Project> </Project>
@@ -1,21 +1,20 @@
<EgtWPFLib5:EgtMainWindow x:Class="ImportExportMachiningPanelV" <EgtWPFLib5:EgtCustomWindow x:Class="ImportExportMachiningPanelV"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:EgtWPFLib5="clr-namespace:EgtWPFLib5;assembly=EgtWPFLib5" xmlns:EgtWPFLib5="clr-namespace:EgtWPFLib5;assembly=EgtWPFLib5"
Title="{Binding OkMsg}" Title="{Binding OkMsg}"
SizeToContent="WidthAndHeight" Style="{DynamicResource {x:Type EgtWPFLib5:EgtCustomWindow}}"
WindowStartupLocation="CenterOwner" WindowStyle="None" ResizeMode="NoResize" TitleBarHeight="30" IsResizable="False"
Style="{StaticResource Dialog_Window}"> IsMinimizable="False" WindowStartupLocation="CenterOwner" ShowInTaskbar="False"
Width="400" Height="500">
<Grid Margin="2.5,2.5,2.5,0"> <Grid>
<Grid.RowDefinitions> <Grid.RowDefinitions>
<RowDefinition Height="Auto"/> <RowDefinition Height="7*"/>
<RowDefinition Height="Auto"/> <RowDefinition Height="1*"/>
</Grid.RowDefinitions> </Grid.RowDefinitions>
<ListBox ItemsSource="{Binding MachiningList}" <ListBox ItemsSource="{Binding MachiningList}">
Height="400"
Width="250">
<ListBox.ItemTemplate> <ListBox.ItemTemplate>
<DataTemplate DataType="{x:Type EgtWPFLib5:ImpExpMachiningItem}"> <DataTemplate DataType="{x:Type EgtWPFLib5:ImpExpMachiningItem}">
<Grid Height="20"> <Grid Height="20">
@@ -33,7 +32,7 @@
Margin="0,0,5,0" Margin="0,0,5,0"
VerticalContentAlignment="Center" VerticalContentAlignment="Center"
Visibility="{Binding Path=DataContext.Active_Visibility, Visibility="{Binding Path=DataContext.Active_Visibility,
RelativeSource={RelativeSource AncestorType={x:Type EgtWPFLib5:EgtMainWindow}}}"/> RelativeSource={RelativeSource AncestorType={x:Type EgtWPFLib5:EgtCustomWindow}}}"/>
<TextBlock Grid.Column="1" <TextBlock Grid.Column="1"
Text="{Binding sName}" Text="{Binding sName}"
FontSize="15" FontSize="15"
@@ -47,26 +46,17 @@
</Grid> </Grid>
</DataTemplate> </DataTemplate>
</ListBox.ItemTemplate> </ListBox.ItemTemplate>
</ListBox> </ListBox>
<UniformGrid Grid.Row="2"
Rows="1" <Button Command="{Binding OkCommand}"
Margin="0,20,0,0"> Content="{Binding OkMsg}"
<Button Command="{Binding OkCommand}" IsEnabled="{Binding IsEnabledOkBtn, Mode=OneWay}"
IsEnabled="{Binding IsEnabledOkBtn, Mode=OneWay}" Grid.Row="1"
Style="{StaticResource RightPanel_HalfRound_Button}"> Height="30" Width="100"
<Image Source="\Resources\Common\Ok.png" Margin="10" />
Style="{StaticResource Button_Image}"/>
</Button>
<Button IsCancel="True"
Margin="0,0,2.5,0"
Style="{StaticResource RightPanel_HalfRound_Button}">
<Image Source="\Resources\Common\Cancel.png"
Style="{StaticResource Button_Image}"/>
</Button>
</UniformGrid>
</Grid> </Grid>
</EgtWPFLib5:EgtMainWindow> </EgtWPFLib5:EgtCustomWindow>
@@ -1,45 +1,15 @@
Imports System.Collections.ObjectModel Imports System.Collections.ObjectModel
Imports System.Drawing
Imports System.IO Imports System.IO
Imports System.Reflection
Imports EgtUILib Imports EgtUILib
Imports EgtWPFLib5 Imports EgtWPFLib5
Imports Icarus.ImportExportMachiningPanelVM
Public Class ImportExportMachiningPanelVM Public Class ImportExportMachiningPanelVM
Inherits VMBase Inherits VMBase
Private Const m_MaterialDataExtension As String = ".mtd"
Public Shared ReadOnly Property MaterialDataExtension As String
Get
Return m_MaterialDataExtension
End Get
End Property
Private Const m_OriginalMaterialDataExtension As String = ".omtd"
Public Shared ReadOnly Property OriginalMaterialDataExtension As String
Get
Return m_OriginalMaterialDataExtension
End Get
End Property
Private Const m_MachiningDataExtension As String = ".mcd"
Public Shared ReadOnly Property MachiningDataExtension As String
Get
Return m_MachiningDataExtension
End Get
End Property
' Modalita' di apertura della finestra ' Modalita' di apertura della finestra
Public Enum WindowModeEnum As Integer Public Enum WindowModeEnum As Integer
IMPORT = 1 IMPORT
EXPORT = 2 EXPORT
IMPORT_ORIG = 3
EXPORT_ORIG = 4
End Enum
' Tipo da importare/esportare
Public Enum WindowTypeEnum As Integer
MATERIAL = 1
MACHINING = 2
End Enum End Enum
Private m_WindowMode As WindowModeEnum Private m_WindowMode As WindowModeEnum
@@ -49,13 +19,6 @@ Public Class ImportExportMachiningPanelVM
End Get End Get
End Property End Property
Private m_WindowType As WindowTypeEnum
Public ReadOnly Property WindowType As WindowTypeEnum
Get
Return m_WindowType
End Get
End Property
' Lista delle lavorazioni ' Lista delle lavorazioni
Private m_MachiningList As New ObservableCollection(Of ImpExpMachiningItem) Private m_MachiningList As New ObservableCollection(Of ImpExpMachiningItem)
Public Property MachiningList As ObservableCollection(Of ImpExpMachiningItem) Public Property MachiningList As ObservableCollection(Of ImpExpMachiningItem)
@@ -122,113 +85,22 @@ Public Class ImportExportMachiningPanelVM
#Region "CONSTRUCTOR" #Region "CONSTRUCTOR"
' export ' export
Sub New(Type As WindowTypeEnum, Mode As WindowModeEnum, Optional sImportFilePath As String = "") Sub New()
m_WindowType = Type m_WindowMode = WindowModeEnum.EXPORT
ImpExpMachiningItem.SetWindowType(m_WindowType)
m_WindowMode = Mode
' carico lista lavorazioni ' carico lista lavorazioni
MachiningList.Clear() MachiningList.Clear()
Select Case Mode ' leggo ed aggiungo le altre
Case WindowModeEnum.IMPORT Dim nIndex As Integer = 1
Select Case Type Dim sGUID As String = ""
Case WindowTypeEnum.MATERIAL Dim sName As String = ""
m_ImportFilePath = sImportFilePath Dim sMaterials As String = ""
' carico lista lavorazioni While ReadMachiningParamString(nIndex, MAC_GUID, "", sGUID) > 0
MachiningList.Clear() Dim Guid As Guid = Guid.Empty
' leggo ed aggiungo le altre Guid.TryParse(sGUID, Guid)
Dim nIndex As Integer = 1 ReadMachiningParamString(nIndex, MAC_NAME, "", sName)
Dim sGUID As String = "" MachiningList.Add(New ImpExpMachiningItem(nIndex, Guid, sName, False))
Dim sName As String = "" nIndex += 1
Dim sMaterials As String = "" End While
Dim bIsOriginal = False
Dim bIsCustom = False
While ReadMachiningParamString(nIndex, MAT_GUID, "", sGUID, sImportFilePath) > 0
Dim Guid As Guid = Guid.Empty
Guid.TryParse(sGUID, Guid)
ReadMachiningParamString(nIndex, MAT_NAME, "", sName, sImportFilePath)
Dim sOrigGUID As String = ""
ReadMachiningParamString(nIndex, MAT_ORIG, "", sOrigGUID, sImportFilePath)
If sOrigGUID = ORIG_MATERIAL Then
If Not bIsOriginal Then bIsOriginal = True
Else
If Not bIsCustom Then bIsCustom = True
End If
MachiningList.Add(New ImpExpMachiningItem(nIndex, Guid, sName, AlreadyExist(sName)))
nIndex += 1
End While
If bIsOriginal AndAlso bIsCustom Then
'MessageBox.Show("Corrupted file! Impossible to import it!")
EgtMessageBoxV.Show(Application.Current.MainWindow, "Corrupted file! Impossible to import it!")
ElseIf bIsOriginal Then
LoadOriginalMaterial()
End If
Case WindowTypeEnum.MACHINING
m_ImportFilePath = sImportFilePath
' carico lista lavorazioni
MachiningList.Clear()
' leggo ed aggiungo le altre
Dim nIndex As Integer = 1
Dim sGUID As String = ""
Dim sName As String = ""
Dim sMaterials As String = ""
While ReadMachiningParamString(nIndex, MAC_GUID, "", sGUID, sImportFilePath) > 0
Dim Guid As Guid = Guid.Empty
Guid.TryParse(sGUID, Guid)
ReadMachiningParamString(nIndex, MAC_NAME, "", sName, sImportFilePath)
MachiningList.Add(New ImpExpMachiningItem(nIndex, Guid, sName, AlreadyExist(sName)))
nIndex += 1
End While
End Select
Case WindowModeEnum.EXPORT
Select Case Type
Case WindowTypeEnum.MATERIAL
' leggo ed aggiungo le altre
Dim nIndex As Integer = 1
Dim sGUID As String = ""
Dim sName As String = ""
While ReadMaterialParamString(nIndex, MAC_GUID, "", sGUID) > 0
Dim sOrigGUID As String = ""
ReadMaterialParamString(nIndex, MAT_ORIG, "", sOrigGUID)
If sOrigGUID <> ORIG_MATERIAL Then
Dim Guid As Guid = Guid.Empty
Guid.TryParse(sGUID, Guid)
ReadMaterialParamString(nIndex, MAC_NAME, "", sName)
MachiningList.Add(New ImpExpMachiningItem(nIndex, Guid, sName, False))
End If
nIndex += 1
End While
Case WindowTypeEnum.MACHINING
' leggo ed aggiungo le altre
Dim nIndex As Integer = 1
Dim sGUID As String = ""
Dim sName As String = ""
While ReadMachiningParamString(nIndex, MAC_GUID, "", sGUID) > 0
Dim Guid As Guid = Guid.Empty
Guid.TryParse(sGUID, Guid)
ReadMachiningParamString(nIndex, MAC_NAME, "", sName)
MachiningList.Add(New ImpExpMachiningItem(nIndex, Guid, sName, False))
nIndex += 1
End While
End Select
Case WindowModeEnum.EXPORT_ORIG
If Type = WindowTypeEnum.MATERIAL Then
' leggo ed aggiungo le altre
Dim nIndex As Integer = 1
Dim sGUID As String = ""
Dim sName As String = ""
While ReadMaterialParamString(nIndex, MAC_GUID, "", sGUID) > 0
Dim sOrigGUID As String = ""
ReadMaterialParamString(nIndex, MAT_ORIG, "", sOrigGUID)
If sOrigGUID = ORIG_MATERIAL Then
Dim Guid As Guid = Guid.Empty
Guid.TryParse(sGUID, Guid)
ReadMaterialParamString(nIndex, MAC_NAME, "", sName)
MachiningList.Add(New ImpExpMachiningItem(nIndex, Guid, sName, False))
End If
nIndex += 1
End While
End If
End Select
ImpExpMachiningItem.m_delEnableOkBtn = AddressOf EnableOkBtn ImpExpMachiningItem.m_delEnableOkBtn = AddressOf EnableOkBtn
End Sub End Sub
@@ -262,110 +134,9 @@ Public Class ImportExportMachiningPanelVM
End Sub End Sub
Private Function AlreadyExist(MachiningName As String) As Boolean Private Function AlreadyExist(MachiningName As String) As Boolean
Select Case m_WindowType Return Map.refMachiningDbVM.MachiningList.Any(Function(x) x.sName = MachiningName)
Case WindowTypeEnum.MATERIAL
Return Map.refMaterialDbVM.MaterialList.Any(Function(x) x.sName = MachiningName)
Case Else ' WindowTypeEnum.MACHINING
Return Map.refMachiningDbVM.MachiningList.Any(Function(x) x.sName = MachiningName)
End Select
End Function End Function
Enum MaterialState As Integer
NOTFOUND = 1
FOUND = 2
NOTORIGSAMENAME = 3
End Enum
Private Sub LoadOriginalMaterial()
m_WindowMode = WindowModeEnum.IMPORT_ORIG
' verifico se esistono materiali con lo stesso nome ma non originali
Dim ImportedMaterialList As New List(Of MaterialState)
For Each ImpExpMaterial In m_MachiningList
Dim IsNotOrigSameName As MaterialState = MaterialState.NOTFOUND
For Each DbMaterial In Map.refMaterialDbVM.MaterialList
If DbMaterial.sName = ImpExpMaterial.sName Then
Dim sOrigGUID As String = ""
ReadMaterialParamString(DbMaterial.nIndex, MAT_ORIG, "", sOrigGUID)
If sOrigGUID <> ORIG_MATERIAL Then
If Not IsNotOrigSameName Then IsNotOrigSameName = MaterialState.NOTORIGSAMENAME
End If
Else
IsNotOrigSameName = MaterialState.FOUND
End If
Next
ImportedMaterialList.Add(IsNotOrigSameName)
Next
If ImportedMaterialList.Contains(True) Then
Dim sDuplicatedMaterialList As String = ""
For Index = 0 To ImportedMaterialList.Count - 1
If ImportedMaterialList(Index) = MaterialState.NOTORIGSAMENAME Then
sDuplicatedMaterialList &= " - " & m_MachiningList(Index).sName & Environment.NewLine
End If
Next
'MessageBox.Show("Impossible to import the package because materials named:" & Environment.NewLine &
' sDuplicatedMaterialList & Environment.NewLine &
' "Please modify the names of these machining and then retry to import the materials.")
EgtMessageBoxV.Show(Application.Current.MainWindow, "Impossible to import the package because materials named:" & Environment.NewLine &
sDuplicatedMaterialList & Environment.NewLine &
"Please modify the names of these machining and then retry to import the materials.")
Return
End If
' aggiorno/aggiungo materiali
Dim OrigFilePath As String = CurrentMachine.sMaterialFilePath
Dim NewMaterial As Material = Nothing
For Each Material In m_MachiningList
Dim nIndex As Integer = Map.refMaterialDbVM.MaterialList.Max(Function(x) x.nIndex) + 1
If Material.Active Then
CurrentMachine.SetMaterialFilePath(ImportFilePath)
' leggo lavorazione da file di import
NewMaterial = New Material(Material.nIndex)
' cambio guid, indice e verifico nome
NewMaterial.sGUID = Guid.NewGuid.ToString()
NewMaterial.SetIndex(nIndex)
If Material.AlreadyExist Then
If Material.ChangeName Then
NewMaterial.sName = Material.sName
Map.refMaterialDbVM.MaterialList.Add(NewMaterial)
Else
' sostituisco lavorazione gia' presente con stesso nome
Dim ToSubstituteMaterial As Material = Map.refMaterialDbVM.MaterialList.FirstOrDefault(Function(x) x.sName = Material.sName)
NewMaterial.SetIndex(ToSubstituteMaterial.nIndex)
NewMaterial.sGUID = ToSubstituteMaterial.sGUID
Dim nToReplaceIndex As Integer = Map.refMaterialDbVM.MaterialList.IndexOf(ToSubstituteMaterial)
Map.refMaterialDbVM.MaterialList(nToReplaceIndex) = NewMaterial
End If
Else
Map.refMaterialDbVM.MaterialList.Add(NewMaterial)
End If
' ripristino path corretta del Db
CurrentMachine.SetMaterialFilePath(OrigFilePath)
' salvo la lavorazione
NewMaterial.Save()
End If
Next
' ripristino path corretta del Db
CurrentMachine.SetMaterialFilePath(OrigFilePath)
' seleziono ultima importata
If Not IsNothing(NewMaterial) Then
Map.refMaterialDbVM.SelMaterial = NewMaterial
Map.refMaterialDbVM.NotifyPropertyChanged(NameOf(Map.refMaterialDbVM.SelMaterial))
End If
' imposto Db modificato
Map.refMaterialDbVM.SetIsModified(True)
' messaggio con modifiche
Dim sMaterialList As String = ""
For Index = 0 To ImportedMaterialList.Count - 1
sMaterialList &= " - " & m_MachiningList(Index).sName & " (" & If(ImportedMaterialList(Index) = MaterialState.NOTFOUND, "New", "Updated") & ")" & Environment.NewLine
Next
'MessageBox.Show("List of the materials:" & Environment.NewLine &
' sMaterialList & Environment.NewLine &
' "Import successfully completed.")
EgtMessageBoxV.Show(Application.Current.MainWindow, "List of the materials:" & Environment.NewLine &
sMaterialList & Environment.NewLine &
"Import successfully completed.")
Return
End Sub
#End Region ' METHODS #End Region ' METHODS
#Region "COMMANDS" #Region "COMMANDS"
@@ -388,109 +159,52 @@ Public Class ImportExportMachiningPanelVM
''' Manage the MachiningDb closing. This method is invoked by the CloseMachiningDbCommand. ''' Manage the MachiningDb closing. This method is invoked by the CloseMachiningDbCommand.
''' </summary> ''' </summary>
Public Sub ConfirmImpExpMachinings(param As Object) Public Sub ConfirmImpExpMachinings(param As Object)
Select Case m_WindowMode Select Case WindowMode
Case WindowModeEnum.IMPORT Case WindowModeEnum.IMPORT
Select Case m_WindowType Dim OrigFilePath As String = CurrentMachine.sMachiningFilePath
Case WindowTypeEnum.MATERIAL Dim NewMachining As Machining = Nothing
Dim OrigFilePath As String = CurrentMachine.sMaterialFilePath For Each Machining In m_MachiningList
Dim NewMaterial As Material = Nothing Dim nIndex As Integer = Map.refMachiningDbVM.MachiningList.Max(Function(x) x.nIndex) + 1
For Each Material In m_MachiningList If Machining.Active Then
Dim nIndex As Integer = Map.refMaterialDbVM.MaterialList.Max(Function(x) x.nIndex) + 1 CurrentMachine.SetMachiningFilePath(ImportFilePath)
If Material.Active Then ' leggo lavorazione da file di import
CurrentMachine.SetMaterialFilePath(ImportFilePath) NewMachining = New Machining(Machining.nIndex)
' leggo lavorazione da file di import ' cambio guid, indice e verifico nome
NewMaterial = New Material(Material.nIndex) NewMachining.sGUID = Guid.NewGuid.ToString()
' cambio guid, indice e verifico nome NewMachining.SetIndex(nIndex)
NewMaterial.sGUID = Guid.NewGuid.ToString() If Machining.AlreadyExist Then
NewMaterial.SetIndex(nIndex) If Machining.ChangeName Then
If Material.AlreadyExist Then NewMachining.sName = Machining.sName
If Material.ChangeName Then
NewMaterial.sName = Material.sName
Map.refMaterialDbVM.MaterialList.Add(NewMaterial)
Else
' sostituisco lavorazione gia' presente con stesso nome
Dim ToSubstituteMaterial As Material = Map.refMaterialDbVM.MaterialList.FirstOrDefault(Function(x) x.sName = Material.sName)
NewMaterial.SetIndex(ToSubstituteMaterial.nIndex)
NewMaterial.sGUID = ToSubstituteMaterial.sGUID
Dim nToReplaceIndex As Integer = Map.refMaterialDbVM.MaterialList.IndexOf(ToSubstituteMaterial)
Map.refMaterialDbVM.MaterialList(nToReplaceIndex) = NewMaterial
End If
Else
Map.refMaterialDbVM.MaterialList.Add(NewMaterial)
End If
' ripristino path corretta del Db
CurrentMachine.SetMaterialFilePath(OrigFilePath)
' salvo la lavorazione
NewMaterial.Save()
End If End If
Next
' ripristino path corretta del Db
CurrentMachine.SetMaterialFilePath(OrigFilePath)
' seleziono ultima importata
If Not IsNothing(NewMaterial) Then
Map.refMaterialDbVM.SelMaterial = NewMaterial
Map.refMaterialDbVM.NotifyPropertyChanged(NameOf(Map.refMaterialDbVM.SelMaterial))
End If End If
' imposto Db modificato Map.refMachiningDbVM.MachiningList.Add(NewMachining)
Map.refMaterialDbVM.SetIsModified(True)
Case WindowTypeEnum.MACHINING
Dim OrigFilePath As String = CurrentMachine.sMachiningFilePath
Dim NewMachining As Machining = Nothing
For Each Machining In m_MachiningList
Dim nIndex As Integer = Map.refMachiningDbVM.MachiningList.Max(Function(x) x.nIndex) + 1
If Machining.Active Then
CurrentMachine.SetMachiningFilePath(ImportFilePath)
' leggo lavorazione da file di import
NewMachining = New Machining(Machining.nIndex)
' cambio guid, indice e verifico nome
NewMachining.sGUID = Guid.NewGuid.ToString()
NewMachining.SetIndex(nIndex)
If Machining.AlreadyExist Then
If Machining.ChangeName Then
NewMachining.sName = Machining.sName
Map.refMachiningDbVM.MachiningList.Add(NewMachining)
Else
' sostituisco lavorazione gia' presente con stesso nome
Dim ToSubstituteMachining As Machining = Map.refMachiningDbVM.MachiningList.FirstOrDefault(Function(x) x.sName = Machining.sName)
NewMachining.SetIndex(ToSubstituteMachining.nIndex)
NewMachining.sGUID = ToSubstituteMachining.sGUID
Dim nToReplaceIndex As Integer = Map.refMachiningDbVM.MachiningList.IndexOf(ToSubstituteMachining)
Map.refMachiningDbVM.MachiningList(nToReplaceIndex) = NewMachining
End If
Else
Map.refMachiningDbVM.MachiningList.Add(NewMachining)
End If
' ripristino path corretta del Db
CurrentMachine.SetMachiningFilePath(OrigFilePath)
' salvo la lavorazione
NewMachining.Save()
End If
Next
' ripristino path corretta del Db ' ripristino path corretta del Db
CurrentMachine.SetMachiningFilePath(OrigFilePath) CurrentMachine.SetMachiningFilePath(OrigFilePath)
' seleziono ultima importata ' salvo la lavorazione
If Not IsNothing(NewMachining) Then NewMachining.Save()
Map.refMachiningDbVM.SelMachining = NewMachining
Map.refMachiningDbVM.NotifyPropertyChanged(NameOf(Map.refMachiningDbVM.SelMachining))
End If
' imposto Db modificato
Map.refMachiningDbVM.SetIsModified(True)
End Select
Case WindowModeEnum.EXPORT, WindowModeEnum.EXPORT_ORIG
' chiedo il nome con cui salvare il file
Dim sExtension As String = ""
If m_WindowType = WindowTypeEnum.MATERIAL Then
If m_WindowMode = WindowModeEnum.EXPORT_ORIG Then
sExtension = OriginalMaterialDataExtension
Else
sExtension = MaterialDataExtension
End If End If
Else Next
sExtension = MachiningDataExtension ' ripristino path corretta del Db
CurrentMachine.SetMachiningFilePath(OrigFilePath)
' seleziono ultima importata
If Not IsNothing(NewMachining) Then
Map.refMachiningDbVM.SelMachining = NewMachining
Map.refMachiningDbVM.NotifyPropertyChanged(NameOf(Map.refMachiningDbVM.SelMachining))
End If End If
Case WindowModeEnum.EXPORT
' recupero le lavorazioni checkate
Dim FinalNameList As New List(Of String)
For Each Machining In MachiningList
If Machining.Active Then
FinalNameList.Add(Machining.sName)
End If
Next
If FinalNameList.Count() = 0 Then Return
Dim FinalNameArray = FinalNameList.ToArray()
' chiedo il nome con cui salvare il file .data
Dim SaveFileDlg As New System.Windows.Forms.SaveFileDialog() With { Dim SaveFileDlg As New System.Windows.Forms.SaveFileDialog() With {
.Title = EgtMsg(31451) & " " & EgtMsg(31452), .Title = EgtMsg(31451) & " " & EgtMsg(31452),
.Filter = "File data (*" & sExtension & ")|*" & sExtension, .Filter = "File data (*.data)|*.data|Tutti i file (*.*)|*.*",
.FileName = String.Empty .FileName = String.Empty
} }
If SaveFileDlg.ShowDialog() <> System.Windows.Forms.DialogResult.OK Then Return If SaveFileDlg.ShowDialog() <> System.Windows.Forms.DialogResult.OK Then Return
@@ -510,25 +224,15 @@ Public Class ImportExportMachiningPanelVM
Catch ex As Exception Catch ex As Exception
End Try End Try
End If End If
Select Case m_WindowType Dim ActiveMachiningList As List(Of Machining) = (From Machining In Map.refMachiningDbVM.MachiningList
Case WindowTypeEnum.MATERIAL Select Machining
Dim ActiveMachiningList As List(Of Material) = (From Material In Map.refMaterialDbVM.MaterialList Where m_MachiningList.Any(Function(x) x.sGUID.ToString() = Machining.sGUID AndAlso x.Active)).ToList()
Select Material ' salvo tutte le lavorazioni sul Db
Where m_MachiningList.Any(Function(x) x.sGUID.ToString() = Material.sGUID AndAlso x.Active)).ToList() For Index = 0 To ActiveMachiningList.Count - 1
' salvo tutti i materiali sul Db ActiveMachiningList(Index).WriteParamsOnDb(Index + 1, sFilePath)
For Index = 0 To ActiveMachiningList.Count - 1 Next
ActiveMachiningList(Index).WriteParamsOnDb(Index + 1, sFilePath)
Next
Case WindowTypeEnum.MACHINING
Dim ActiveMachiningList As List(Of Machining) = (From Machining In Map.refMachiningDbVM.MachiningList
Select Machining
Where m_MachiningList.Any(Function(x) x.sGUID.ToString() = Machining.sGUID AndAlso x.Active)).ToList()
' salvo tutte le lavorazioni sul Db
For Index = 0 To ActiveMachiningList.Count - 1
ActiveMachiningList(Index).WriteParamsOnDb(Index + 1, sFilePath)
Next
End Select
End Select End Select
' Chiusura finestra ' Chiusura finestra
RaiseEvent m_CloseWindow(True) RaiseEvent m_CloseWindow(True)
End Sub End Sub
@@ -542,18 +246,13 @@ End Class
Public Class ImpExpMachiningItem Public Class ImpExpMachiningItem
Inherits VMBase Inherits VMBase
Public Const IMPEXPNAME As String = "_imp" Public Const IMPEXTNAME As String = "_imp"
' Actions ' Actions
Friend Shared m_delEnableOkBtn As Action Friend Shared m_delEnableOkBtn As Action
Private Shared m_Empty As New MachiningIndex(-1, Guid.Empty, "None") Private Shared m_Empty As New MachiningIndex(-1, Guid.Empty, "None")
Private Shared m_WindowType As WindowTypeEnum
Friend Shared Sub SetWindowType(value As WindowTypeEnum)
m_WindowType = value
End Sub
Private m_nIndex As Integer Private m_nIndex As Integer
Public ReadOnly Property nIndex As Integer Public ReadOnly Property nIndex As Integer
Get Get
@@ -585,55 +284,26 @@ Public Class ImpExpMachiningItem
' se esiste gia' chiedo se sovrascriverla ' se esiste gia' chiedo se sovrascriverla
If value Then If value Then
If m_AlreadyExist Then If m_AlreadyExist Then
Select Case m_WindowType Select Case System.Windows.MessageBox.Show(EgtMsg(31453), "", MessageBoxButton.YesNoCancel)
Case WindowTypeEnum.MATERIAL Case MessageBoxResult.Yes
Select Case EgtMessageBoxV.Show(Application.Current.MainWindow, "Material will be imported with the name: " & m_sName, "", MessageBoxButton.OK) m_ChangeName = False
'System.Windows.MessageBox.Show("Material already existing in Db. Overwrite it?", "", MessageBoxButton.YesNoCancel) m_Active = True
Case MessageBoxResult.Yes Case MessageBoxResult.No
m_ChangeName = False Dim bImpNameAlreadyInList = False
m_Active = True Dim nImpNameIndex As Integer = 0
Case MessageBoxResult.No If Map.refMachiningDbVM.MachiningList.Any(Function(x) x.sName = m_sOrigName & IMPEXTNAME) Then
Dim bImpNameAlreadyInList = False nImpNameIndex += 1
Dim nImpNameIndex As Integer = 0 While Map.refMachiningDbVM.MachiningList.Any(Function(x) x.sName = m_sOrigName & IMPEXTNAME & "_" & nImpNameIndex)
If Map.refMaterialDbVM.MaterialList.Any(Function(x) x.sName = m_sOrigName & IMPEXPNAME) Then nImpNameIndex += 1
nImpNameIndex += 1 End While
While Map.refMaterialDbVM.MaterialList.Any(Function(x) x.sName = m_sOrigName & IMPEXPNAME & "_" & nImpNameIndex) End If
nImpNameIndex += 1 m_sName = m_sOrigName & IMPEXTNAME & If(nImpNameIndex > 0, "_" & nImpNameIndex, "")
End While System.Windows.MessageBox.Show("Machining will be imported with the name: " & m_sName, "", MessageBoxButton.OK)
End If NotifyPropertyChanged(NameOf(sName))
m_sName = m_sOrigName & IMPEXPNAME & If(nImpNameIndex > 0, "_" & nImpNameIndex, "") m_ChangeName = True
'System.Windows.MessageBox.Show("Material will be imported with the name: " & m_sName, "", MessageBoxButton.OK) m_Active = True
EgtMessageBoxV.Show(Application.Current.MainWindow, "Material will be imported with the name: " & m_sName, "", MessageBoxButton.OK) Case Else
NotifyPropertyChanged(NameOf(sName)) m_Active = False
m_ChangeName = True
m_Active = True
Case Else
m_Active = False
End Select
Case WindowTypeEnum.MACHINING
Select Case EgtMessageBoxV.Show(Application.Current.MainWindow, "Machining already existing in Db. Overwrite it?", "", MessageBoxButton.YesNoCancel)
'System.Windows.MessageBox.Show("Machining already existing in Db. Overwrite it?", "", MessageBoxButton.YesNoCancel)
Case MessageBoxResult.Yes
m_ChangeName = False
m_Active = True
Case MessageBoxResult.No
Dim bImpNameAlreadyInList = False
Dim nImpNameIndex As Integer = 0
If Map.refMachiningDbVM.MachiningList.Any(Function(x) x.sName = m_sOrigName & IMPEXPNAME) Then
nImpNameIndex += 1
While Map.refMachiningDbVM.MachiningList.Any(Function(x) x.sName = m_sOrigName & IMPEXPNAME & "_" & nImpNameIndex)
nImpNameIndex += 1
End While
End If
m_sName = m_sOrigName & IMPEXPNAME & If(nImpNameIndex > 0, "_" & nImpNameIndex, "")
'System.Windows.MessageBox.Show("Machining will be imported with the name: " & m_sName, "", MessageBoxButton.OK)
EgtMessageBoxV.Show(Application.Current.MainWindow, "Machining will be imported with the name: " & m_sName, "", MessageBoxButton.OK)
NotifyPropertyChanged(NameOf(sName))
m_ChangeName = True
m_Active = True
Case Else
m_Active = False
End Select
End Select End Select
NotifyPropertyChanged(NameOf(Active)) NotifyPropertyChanged(NameOf(Active))
Else Else
@@ -690,3 +360,82 @@ Public Class ImpExpMachiningItem
End Function End Function
End Class End Class
Public Class MachiningItem
Inherits VMBase
' Actions
Friend Shared m_delEnableOkBtn As Action
Private m_Name As String
Public Property Name As String
Get
If m_ChangeName Then
Return m_Name & "_imp"
Else
Return m_Name
End If
End Get
Set(value As String)
m_Name = value
End Set
End Property
Private m_Active As Boolean
Public Property Active As Boolean
Get
Return m_Active
End Get
Set(value As Boolean)
' se esiste gia' chiedo se sovrascriverla
If value Then
If m_AlreadyExist Then
Select Case System.Windows.MessageBox.Show(EgtMsg(31453), "", MessageBoxButton.YesNoCancel)
Case MessageBoxResult.Yes
m_ChangeName = False
m_Active = True
Case MessageBoxResult.No
System.Windows.MessageBox.Show(EgtMsg(31454), "", MessageBoxButton.OK)
m_ChangeName = True
m_Active = True
Case Else
m_Active = False
End Select
NotifyPropertyChanged("Active")
Else
m_Active = True
End If
Else
m_ChangeName = False
m_Active = False
End If
If Not IsNothing(m_delEnableOkBtn) Then m_delEnableOkBtn()
End Set
End Property
' Parametro che indica se questo item da importare esiste gia'
Private m_AlreadyExist As Boolean
Friend ReadOnly Property AlreadyExist As Boolean
Get
Return m_AlreadyExist
End Get
End Property
' Parametro che indica se cambiare il nome di un item che esiste gia' o sovrascriverlo
Private m_ChangeName As Boolean
Friend Property ChangeName As Boolean
Get
Return m_ChangeName
End Get
Set(value As Boolean)
m_ChangeName = value
NotifyPropertyChanged("Name")
End Set
End Property
Sub New(Name As String, AlreadyExist As Boolean)
m_Name = Name
m_AlreadyExist = AlreadyExist
End Sub
End Class
@@ -1,38 +0,0 @@
<EgtWPFLib5:EgtMainWindow x:Class="ImportLoadingWndV"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:EgtWPFLib5="clr-namespace:EgtWPFLib5;assembly=EgtWPFLib5"
Title="New Project"
SizeToContent="WidthAndHeight"
WindowStartupLocation="CenterOwner"
Style="{StaticResource Dialog_Window}">
<Grid Margin="2.5,2.5,2.5,2.5">
<Grid.RowDefinitions>
<RowDefinition Height="1*"/>
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
<TextBlock Text="{Binding Loading_Msg}"
Margin="20,20,20,2.5"
Style="{StaticResource DialogWindow_TextBlock}"/>
<Grid Grid.Row="1"
Margin="2.5,2.5,2.5,2.5">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<ProgressBar Value="{Binding Loading_Value}"
Width="200"
Margin="0,0,2.5,20"
Style="{StaticResource Icarus_ProgressBar}"/>
<!--<Button Grid.Column="1"
Grid.RowSpan="2"
Command="{Binding Stop_Command}"
Margin="2.5,0,0,0"
Style="{StaticResource TopPanel_Button}">
<Image Source="\Resources\SliceManager\StopCalculation.png"
Style="{StaticResource Button_Image}"/>
</Button>-->
</Grid>
</Grid>
</EgtWPFLib5:EgtMainWindow>
@@ -1,14 +0,0 @@
Public Class ImportLoadingWndV
Private WithEvents m_ImportLoadingWndVM As ImportLoadingWndVM
Sub New(Owner As Window, ImportLoadingWndVM As ImportLoadingWndVM)
MyBase.New(Owner)
' This call is required by the designer.
InitializeComponent()
Me.DataContext = ImportLoadingWndVM
' Assegno al riferimento locale al VM il VM preso dal DataContext
m_ImportLoadingWndVM = ImportLoadingWndVM
End Sub
End Class
@@ -1,91 +0,0 @@
Imports System.Collections.ObjectModel
Imports EgtUILib.EgtInterface
Imports EgtWPFLib5
Public Class ImportLoadingWndVM
Inherits VMBase
#Region "FIELDS & PROPERTIES"
' Funzioni di callback per output in interfaccia da LUA
Private m_ProcEventsCallback As New ProcessEventsCallback(AddressOf ProcessEvents)
Private m_bStopLoading As Boolean = False
Private m_Loading_Value As Double
Public Property Loading_Value As Double
Get
Return m_Loading_Value
End Get
Set(value As Double)
m_Loading_Value = value
End Set
End Property
' Definizione comandi
Private m_cmdStop As ICommand
#End Region ' FIELDS & PROPERTIES
#Region "MESSAGES"
Public ReadOnly Property Loading_Msg As String
Get
Return "Importing file..."
End Get
End Property
#End Region ' MESSAGES
#Region "CONSTRUCTORS"
Sub New()
' Creo riferimento a questa classe in Map
Map.SetRefImportLoadingWndVM(Me)
End Sub
#End Region ' CONSTRUCTORS
#Region "METHODS"
Friend Function ProcessEvents(ByVal nProg As Integer, ByVal nPause As Integer) As Integer
m_Loading_Value = nProg
NotifyPropertyChanged(NameOf(Loading_Value))
' Costringo ad aggiornare
UpdateUI()
' Eventuale attesa
Threading.Thread.Sleep(nPause)
' Ritorno eventuale stop
If m_bStopLoading Then
m_bStopLoading = False
Return 1
Else
Return 0
End If
Return 0
End Function
#End Region ' METHODS
#Region "COMMANDS"
#Region "Stop"
Public ReadOnly Property Stop_Command As ICommand
Get
If m_cmdStop Is Nothing Then
m_cmdStop = New Command(AddressOf StopLoading)
End If
Return m_cmdStop
End Get
End Property
Public Sub StopLoading()
m_bStopLoading = True
End Sub
#End Region ' Stop
#End Region ' COMMANDS
End Class
+13 -29
View File
@@ -1,30 +1,14 @@
<StackPanel x:Class="InstrumentPanelV" <EgtFloating:EgtFloatingPanel x:Class="InstrumentPanelV"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:sys="clr-namespace:System;assembly=mscorlib" xmlns:EgtFloating="clr-namespace:EgtWPFLib5.EgtFloating;assembly=EgtWPFLib5"
xmlns:local="clr-namespace:Icarus" IsTopDockable="True" IsBottomDockable="False" IsLeftDockable="False"
IsEnabled="{Binding InstrumentPanel_IsEnabled}" IsRightDockable="False" Style="{StaticResource ToolBar_EgtFloatingPanel}">
Orientation="Horizontal">
<local:CheckedImageToggleButton ToolTip="{Binding GetDist_ToolTip}" <ToggleButton ToolTip="{Binding GetDistToolTip}"
IsChecked="{Binding GetDistIsChecked}" Style="{StaticResource ToolBar_ToggleButton}"
ImageSource="/Resources/InstrumentPanel/GetDist.png" IsChecked="{Binding GetDistIsChecked}">
CheckedImageSource="/Resources/InstrumentPanel/GetDist_White.png" <Image Source="/Resources/InstrumentPanel/GetDist.png" Stretch="Uniform"/>
Width="15" </ToggleButton>
Margin="2.5,0,2.5,0"
Style="{StaticResource BottomPanel_ToggleButton}"> </EgtFloating:EgtFloatingPanel>
<local:CheckedImageToggleButton.Resources>
<sys:Double x:Key="ToggleButton.Image.Height">25</sys:Double>
<sys:Double x:Key="ToggleButton.Image.Width">25</sys:Double>
</local:CheckedImageToggleButton.Resources>
</local:CheckedImageToggleButton>
<local:CheckedImageToggleButton ToolTip="{Binding EdgeAnalysis_ToolTip}"
IsChecked="{Binding bEdgeAnalysis_IsChecked}"
IsEnabled="{Binding bEdgeAnalysis_IsEnabled}"
ImageSource="/Resources/InstrumentPanel/EdgeAnalysis.png"
CheckedImageSource="/Resources/InstrumentPanel/EdgeAnalysis_White.png"
Margin="2.5,0,2.5,0"
Style="{StaticResource BottomPanel_ToggleButton}">
</local:CheckedImageToggleButton>
</StackPanel>
+2 -19
View File
@@ -96,9 +96,8 @@ Public Class MyInstrumentPanelVM
EgtDraw() EgtDraw()
' Ripristino stato segnalazione modifica ' Ripristino stato segnalazione modifica
DisableMgr.ReEnable() DisableMgr.ReEnable()
'MessageBox.Show(sResult) MessageBox.Show(sResult)
EgtMessageBoxV.Show(Application.Current.MainWindow, sResult) Else
Else
' Disabilito segnalazione modificato ' Disabilito segnalazione modificato
Dim DisableMgr As New DisableModifiedMgr Dim DisableMgr As New DisableModifiedMgr
' cancello tutti i gruppi con i chunk ' cancello tutti i gruppi con i chunk
@@ -140,22 +139,6 @@ Public Class MyInstrumentPanelVM
NotifyPropertyChanged(NameOf(bEdgeAnalysis_IsEnabled)) NotifyPropertyChanged(NameOf(bEdgeAnalysis_IsEnabled))
End Sub End Sub
#Region "Tooltip"
Public ReadOnly Property GetDist_ToolTip As String
Get
Return "Distance"
End Get
End Property
Public ReadOnly Property EdgeAnalysis_ToolTip As String
Get
Return "Edge Analysis"
End Get
End Property
#End Region ' Tooltip
#Region "CONSTRUCTORS" #Region "CONSTRUCTORS"
Sub New() Sub New()
+7 -9
View File
@@ -1,14 +1,12 @@
<UserControl x:Class="LeftPanelV" <UserControl x:Class="LeftPanelV"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:EgtWPFLib5="clr-namespace:EgtWPFLib5;assembly=EgtWPFLib5" xmlns:EgtWPFLib5="clr-namespace:EgtWPFLib5;assembly=EgtWPFLib5"
xmlns:PrintApp="clr-namespace:Icarus" xmlns:PrintApp="clr-namespace:Icarus"
Margin="5,0,5,0"> Margin="5">
<TabControl SelectedIndex="{Binding SelPanel}" <TabControl SelectedIndex="{Binding SelPanel}"
Background="Transparent" Background="Transparent"
BorderThickness="0" BorderThickness="0">
Margin="0"
Padding="0">
<TabControl.ItemContainerStyle> <TabControl.ItemContainerStyle>
<Style TargetType="{x:Type TabItem}"> <Style TargetType="{x:Type TabItem}">
<Setter Property="Visibility" Value="Collapsed"/> <Setter Property="Visibility" Value="Collapsed"/>
@@ -36,7 +34,7 @@
<PrintApp:ShellNumberPanelV DataContext="{StaticResource ShellNumberPanelVM}"/> <PrintApp:ShellNumberPanelV DataContext="{StaticResource ShellNumberPanelVM}"/>
</TabItem> </TabItem>
<TabItem Header="AUXSOLIDS"> <TabItem Header="AUXSOLIDS">
<PrintApp:FilledSolidPanelV DataContext="{StaticResource FilledSolidPanelVM}"/> <Button Height="100"/>
</TabItem> </TabItem>
<TabItem Header="MODIFYPART"> <TabItem Header="MODIFYPART">
<!--<PrintApp:ModifyPartPanelV DataContext="{StaticResource ModifyPartPanelVM}"/>--> <!--<PrintApp:ModifyPartPanelV DataContext="{StaticResource ModifyPartPanelVM}"/>-->
+2 -5
View File
@@ -39,8 +39,6 @@ Public Class LeftPanelVM
Map.refRibPanelVM.Dispose() Map.refRibPanelVM.Dispose()
Case Panels.SHELLNUMBER Case Panels.SHELLNUMBER
Map.refShellNumberPanelVM.Dispose() Map.refShellNumberPanelVM.Dispose()
Case Panels.AUXSOLIDS
Map.refFilledSolidPanelVM.Dispose()
End Select End Select
m_SelPanel = Panel m_SelPanel = Panel
Select Case Panel Select Case Panel
@@ -56,12 +54,11 @@ Public Class LeftPanelVM
Map.refRibPanelVM.Init() Map.refRibPanelVM.Init()
Case Panels.SHELLNUMBER Case Panels.SHELLNUMBER
Map.refShellNumberPanelVM.Init() Map.refShellNumberPanelVM.Init()
Case Panels.AUXSOLIDS
Map.refFilledSolidPanelVM.Init()
Case Panels.MODIFYPART Case Panels.MODIFYPART
''Map.refModifyPartPanelVM.Init()
Map.refManagePartPanelVM.Init(ManagePartPanelVM.ManagePartType.MODIFY) Map.refManagePartPanelVM.Init(ManagePartPanelVM.ManagePartType.MODIFY)
End Select End Select
If Not IsNothing(Map.refViewLayerManagerVM) Then Map.refViewLayerManagerVM.UpdateForced() Map.refViewLayerManagerVM.UpdateForced()
NotifyPropertyChanged(NameOf(SelPanel)) NotifyPropertyChanged(NameOf(SelPanel))
End Sub End Sub
+43 -35
View File
@@ -1,42 +1,50 @@
<EgtWPFLib5:EgtMainWindow x:Class="MachSaveInDbWndV" <EgtWPFLib5:EgtCustomWindow x:Class="MachSaveInDbWndV"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:EgtWPFLib5="clr-namespace:EgtWPFLib5;assembly=EgtWPFLib5" xmlns:EgtWPFLib5="clr-namespace:EgtWPFLib5;assembly=EgtWPFLib5"
Title="Save in Database" Style="{DynamicResource {x:Type EgtWPFLib5:EgtCustomWindow}}"
SizeToContent="WidthAndHeight" Title="Machining Param Name"
WindowStartupLocation="CenterOwner" Height="150" Width="300"
Style="{StaticResource Dialog_Window}"> WindowStartupLocation="CenterOwner"
<Grid Margin="2.5,2.5,2.5,0"> Icon="/Resources/Icarus.ico"
WindowStyle="None" ResizeMode="NoResize"
ShowInTaskbar="False"
IsMinimizable="False">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions> <Grid.RowDefinitions>
<RowDefinition Height="1*"/>
<RowDefinition Height="Auto"/> <RowDefinition Height="Auto"/>
<RowDefinition Height="10"/>
<RowDefinition Height="Auto"/> <RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/> <RowDefinition Height="1*"/>
</Grid.RowDefinitions> </Grid.RowDefinitions>
<TextBlock Text="Write the new Database machining name" <TextBlock Grid.Column="1"
Margin="20,20,20,2.5" Grid.Row="1"
Style="{StaticResource DialogWindow_TextBlock}"/> Text="Name"
<EgtWPFLib5:EgtTextBox2 Grid.Row="1" Margin="0,0,10,0"
Text="{Binding sName}" Style="{Binding OptionTextBlock}"/>
IsExplicitFocused="True" <EgtWPFLib5:EgtTextBox Grid.Column="2"
Width="160" Grid.Row="1"
Margin="20,10,20,2.5" Width="180"
Style="{StaticResource LeftPanel_TextBox2}"/> Text="{Binding sName}"
<UniformGrid Grid.Row="3" Style="{StaticResource LeftPanel_TextBox}"/>
Rows="1" <UniformGrid Grid.Column="1"
Margin="0,20,0,0"> Grid.ColumnSpan="2"
<Button Command="{Binding Ok_Command}" Grid.Row="3"
Rows="1">
<Button Content="Ok"
Command="{Binding Ok_Command}"
IsDefault="True" IsDefault="True"
Margin="0,0,2.5,0" Style="{StaticResource ToolBar_TextButton}"/>
Style="{StaticResource RightPanel_HalfRound_Button}"> <Button Content="Cancel"
<Image Source="\Resources\Common\Ok.png" Command="{Binding Cancel_Command}"
Style="{StaticResource Button_Image}"/> Style="{StaticResource ToolBar_TextButton}"/>
</Button>
<Button Command="{Binding Cancel_Command}"
Margin="0,0,2.5,0"
Style="{StaticResource RightPanel_HalfRound_Button}">
<Image Source="\Resources\Common\Cancel.png"
Style="{StaticResource Button_Image}"/>
</Button>
</UniformGrid> </UniformGrid>
</Grid> </Grid>
</EgtWPFLib5:EgtMainWindow> </EgtWPFLib5:EgtCustomWindow>
+1 -2
View File
@@ -48,8 +48,7 @@ Public Class MachSaveInDbWndVM
Public Sub Ok() Public Sub Ok()
If Map.refTopPanelVM.MachiningList.Any(Function(x As MachiningIndex) x.sName = m_sName) Then If Map.refTopPanelVM.MachiningList.Any(Function(x As MachiningIndex) x.sName = m_sName) Then
'MessageBox.Show("Name already used in Db! Please insert a different name.", "Warning", MessageBoxButton.OK, MessageBoxImage.Warning) MessageBox.Show("Name already used in Db! Please insert a different name.", "Warning", MessageBoxButton.OK, MessageBoxImage.Warning)
EgtMessageBoxV.Show(Application.Current.MainWindow, "Name already used in Db! Please insert a different name.", "Warning", MessageBoxButton.OK, MessageBoxImage.Warning)
Return Return
End If End If
RaiseEvent m_CloseWindow(True) RaiseEvent m_CloseWindow(True)
+46 -3
View File
@@ -4,9 +4,52 @@
xmlns:EgtFloating="clr-namespace:EgtWPFLib5.EgtFloating;assembly=EgtWPFLib5" xmlns:EgtFloating="clr-namespace:EgtWPFLib5.EgtFloating;assembly=EgtWPFLib5"
IsEnabled="{Binding MachPanel_IsEnabled}"> IsEnabled="{Binding MachPanel_IsEnabled}">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<Grid Margin="0,0,5,0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<!--<TextBlock Grid.Row="0" Grid.Column="0" Text="Macchina corrente" VerticalAlignment="Center" Margin="0,0,5,0"/>-->
<!--Combobox per selezionare la macchina corrente-->
<!--<ComboBox ItemsSource="{Binding Path=MachineList}"
SelectedItem="{Binding Path=SelectedMachine}"
DisplayMemberPath="Name"
SelectedValuePath="Name"
Height="22" Width="150"
Grid.Row="0" Grid.Column="1"/>-->
<!--<Rectangle HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"
Fill="LightGray"/>-->
<TextBlock Text="{Binding SelectedMachine.Name}" <TextBlock Text="{Binding SelectedMachine.Name}"
FontSize="18" Style="{StaticResource OptionTextBlock}"/>
HorizontalAlignment="Center" </Grid>
Style="{StaticResource BaseTextBlock}"/> <!--<StackPanel Grid.Column="1" Orientation="Horizontal" HorizontalAlignment="Center">
<Button Command="{Binding ToolDbCommand}" ToolTip="{Binding ToolDBToolTip}"
Style="{StaticResource ToolBar_TextButton}" Content="{Binding ToolDBMsg}"/>
<Button Command="{Binding MachDbCommand}" ToolTip="{Binding MachiningDbToolTip}"
Style="{StaticResource ToolBar_TextButton}" Content="{Binding MachiningDbMsg}"/>
--><!--<Button Command="{Binding SetUpCommand}" ToolTip="{Binding SetUpToolTip}"
Style="{StaticResource ToolBar_TextButton}" Content="{Binding SetUpMsg}"
Background="{Binding SetUp_Background}"/>--><!--
<Button ToolTip="{Binding BeamTable_ToolTip}"
Style="{StaticResource ToolBar_Button}"
Command="{Binding BeamTable_Command}"
Visibility="{Binding BeamTable_Visibility}">
<Image Source="/Resources/Configuration/MachiningsTable.png" Stretch="Uniform"/>
</Button>
<Button ToolTip="{Binding WallTable_ToolTip}"
Style="{StaticResource ToolBar_Button}"
Command="{Binding WallTable_Command}"
Visibility="{Binding WallTable_Visibility}">
<Image Source="/Resources/Configuration/MachiningsTable.png" Stretch="Uniform"/>
</Button>
--><!--<Button Command="{Binding MachOptionsCommand}" ToolTip="{Binding OptionsToolTip}">
<Image Source="/Resources/ProjectManager/Options.png" Height="22" />
</Button>--><!--
</StackPanel>-->
</Grid> </Grid>
@@ -1,22 +0,0 @@
<UserControl x:Class="MachineViewPanelV"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
VerticalContentAlignment="Top">
<ComboBox SelectedIndex="{Binding ghSelMachView}"
Height="40"
Width="40"
Style="{StaticResource SelViewSlider_ComboBox}">
<ComboBoxItem>
<Image Source="\Resources\SimulationPanel\ToolMode.png"
Style="{StaticResource ComboBox.Image}"/>
</ComboBoxItem>
<ComboBoxItem>
<Image Source="\Resources\SimulationPanel\HeadMode.png"
Style="{StaticResource ComboBox.Image}"/>
</ComboBoxItem>
<ComboBoxItem>
<Image Source="\Resources\SimulationPanel\MachMode.png"
Style="{StaticResource ComboBox.Image}"/>
</ComboBoxItem>
</ComboBox>
</UserControl>
@@ -1,3 +0,0 @@
Public Class MachineViewPanelV
End Class
@@ -1,30 +0,0 @@
Imports EgtUILib
Imports EgtWPFLib5
Public Class MachineViewPanelVM
Inherits VMBase
Public Property ghSelMachView As Integer
Get
Return If(Not IsNothing(Map.refSimulationPanelVM) AndAlso Not IsNothing(Map.refSimulationPanelVM.MySimul), Map.refSimulationPanelVM.MySimul.GetMachLook() - 1, Nothing)
End Get
Set(value As Integer)
If Not IsNothing(Map.refSimulationPanelVM) AndAlso Not IsNothing(Map.refSimulationPanelVM.MySimul) Then
Map.refSimulationPanelVM.MySimul.SetMachLook(value + 1)
' aggiorno lo stato della macchina e la sua visualizzazione
EgtSetMachineLook(Map.refSimulationPanelVM.MySimul.GetMachLook())
WriteMainPrivateProfileString(S_SIMUL, K_MACHVIEWMODE, value + 1)
End If
EgtDraw()
End Set
End Property
Friend Sub RefreshSelViewSlider()
NotifyPropertyChanged(NameOf(ghSelMachView))
End Sub
Sub New()
' Creo riferimento a questa classe in OmagOFFICEMap
Map.SetRefMachineViewPanelVM(Me)
End Sub
End Class
+181 -374
View File
@@ -1,10 +1,8 @@
Imports System.Collections.ObjectModel Imports System.Collections.ObjectModel
Imports System.Collections.Specialized Imports System.Collections.Specialized
Imports System.ComponentModel Imports System.ComponentModel
Imports System.Reflection
Imports EgtUILib Imports EgtUILib
Imports EgtWPFLib5 Imports EgtWPFLib5
Imports Icarus.Machining
Public Class Machining Public Class Machining
Inherits VMBase Inherits VMBase
@@ -61,10 +59,7 @@ Public Class Machining
EXTRA_SHELL = 2 EXTRA_SHELL = 2
INFILL = 3 INFILL = 3
AUX_SOLID = 4 AUX_SOLID = 4
RIB_UNBOUNDED = 5 RIB = 5
RIB_EXTERNAL = 6
RIB_INTERNAL = 7
RIB_SUPPORT = 8
End Enum End Enum
Protected m_CathegoryList As New ObservableCollection(Of MachiningCathegory) Protected m_CathegoryList As New ObservableCollection(Of MachiningCathegory)
@@ -139,7 +134,7 @@ Public Class Machining
Else Else
nIndex = -1 nIndex = -1
m_sGUID = Guid.NewGuid.ToString() m_sGUID = Guid.NewGuid.ToString()
m_sName = "New Machining" m_sName = "PrintingParam"
End If End If
m_sOrigName = m_sName m_sOrigName = m_sName
m_CathegoryList.Add(New MachiningCathegory(MachiningCathegory.Cathegories.GENERAL, nIndex)) m_CathegoryList.Add(New MachiningCathegory(MachiningCathegory.Cathegories.GENERAL, nIndex))
@@ -174,7 +169,7 @@ Public Class Machining
NotifyPropertyChanged(NameOf(ghName)) NotifyPropertyChanged(NameOf(ghName))
End Sub End Sub
Friend Overridable Sub Save() Friend Sub Save()
If bIsModified Then If bIsModified Then
' salvo tutti i parametri su orig ' salvo tutti i parametri su orig
SaveParams() SaveParams()
@@ -185,7 +180,7 @@ Public Class Machining
End If End If
End Sub End Sub
Protected Overridable Sub SaveParams() Private Sub SaveParams()
SaveName() SaveName()
For Each Cathegory In m_CathegoryList For Each Cathegory In m_CathegoryList
Cathegory.SaveParams() Cathegory.SaveParams()
@@ -316,77 +311,72 @@ Public Class MachiningCathegory
Select Case m_Type Select Case m_Type
Case Cathegories.GENERAL Case Cathegories.GENERAL
m_sName = "General" m_sName = "General"
m_MachiningParamList = New List(Of MachiningParam)({New ComboMachiningParam(MachiningParam.Params.SLICINGTYPE, nIndex, Me), m_MachiningParamList = New List(Of MachiningParam)({New ComboMachiningParam(MachiningParam.Params.SLICINGTYPE, nIndex),
New CheckMachiningParam(MachiningParam.Params.SPIRALVASE, nIndex, Me), New CheckMachiningParam(MachiningParam.Params.SPIRALVASE, nIndex),
New NumericMachiningParam(MachiningParam.Params.STRANDH, nIndex, Me), New NumericMachiningParam(MachiningParam.Params.STRANDH, nIndex),
New NumericMachiningParam(MachiningParam.Params.STRANDW, nIndex, Me), New NumericMachiningParam(MachiningParam.Params.STRANDW, nIndex),
New NumericMachiningParam(MachiningParam.Params.STRANDCOUNT, nIndex, Me), New NumericMachiningParam(MachiningParam.Params.STRANDCOUNT, nIndex),
New NumericMachiningParam(MachiningParam.Params.OFFSET, nIndex, Me), New NumericMachiningParam(MachiningParam.Params.OFFSET, nIndex),
New NumericMachiningParam(MachiningParam.Params.STRANDOVERLAP, nIndex, Me), New NumericMachiningParam(MachiningParam.Params.STRANDOVERLAP, nIndex),
New NumericMachiningParam(MachiningParam.Params.STARTPOINTOFFSETONSLICE, nIndex, Me), New NumericMachiningParam(MachiningParam.Params.STARTPOINTOFFSETONSLICE, nIndex),
New ComboMachiningParam(MachiningParam.Params.STRANDORDER, nIndex, Me), New ComboMachiningParam(MachiningParam.Params.STRANDORDER, nIndex),
New ComboMachiningParam(MachiningParam.Params.DIRECTION, nIndex, Me), New ComboMachiningParam(MachiningParam.Params.DIRECTION, nIndex),
New NumericMachiningParam(MachiningParam.Params.FLOORCOUNT, nIndex, Me), New NumericMachiningParam(MachiningParam.Params.FLOORCOUNT, nIndex),
New NumericMachiningParam(MachiningParam.Params.G0FEED, nIndex, Me), New NumericMachiningParam(MachiningParam.Params.G0FEED, nIndex),
New NumericMachiningParam(MachiningParam.Params.G0FEEDZ, nIndex, Me), New NumericMachiningParam(MachiningParam.Params.G0FEEDZ, nIndex),
New NumericMachiningParam(MachiningParam.Params.LINKZUP, nIndex, Me), New NumericMachiningParam(MachiningParam.Params.TOOLDIAM, nIndex),
New NumericMachiningParam(MachiningParam.Params.TOOLDIAM, nIndex, Me), New NumericMachiningParam(MachiningParam.Params.FLOWRATE_PC, nIndex),
New NumericMachiningParam(MachiningParam.Params.FLOWRATE_PC, nIndex, Me), New ComboMachiningParam(MachiningParam.Params.DYNAMIC_MODE, nIndex),
New ComboMachiningParam(MachiningParam.Params.DYNAMIC_MODE, nIndex, Me), New OrderedMachiningParam(MachiningParam.Params.PRINT_ORDER, nIndex)})
New OrderedMachiningParam(MachiningParam.Params.PRINT_ORDER, nIndex, Me),
New NumericMachiningParam(MachiningParam.Params.PREFLOWDELAY, nIndex, Me),
New NumericMachiningParam(MachiningParam.Params.POSTFLOWDELAY, nIndex, Me),
New NumericMachiningParam(MachiningParam.Params.SCREWBACK, nIndex, Me)})
Case Cathegories.LINK Case Cathegories.LINK
m_sName = "Shell" m_sName = "Shell"
m_MachiningParamList = New List(Of MachiningParam)({New NumericMachiningParam(MachiningParam.Params.OFFSETLEADPOINT, nIndex, Me), m_MachiningParamList = New List(Of MachiningParam)({New ComboMachiningParam(MachiningParam.Params.LINKTYPE, nIndex),
New ComboMachiningParam(MachiningParam.Params.LINKTYPE, nIndex, Me), New NumericMachiningParam(MachiningParam.Params.LINKPARAM, nIndex),
New NumericMachiningParam(MachiningParam.Params.LINKPARAM, nIndex, Me), New NumericMachiningParam(MachiningParam.Params.LINKZUP, nIndex),
New ComboMachiningParam(MachiningParam.Params.LEADIN, nIndex, Me), New ComboMachiningParam(MachiningParam.Params.LEADIN, nIndex),
New NumericMachiningParam(MachiningParam.Params.LEADINTANGDIST, nIndex, Me), New NumericMachiningParam(MachiningParam.Params.LEADINTANGDIST, nIndex),
New NumericMachiningParam(MachiningParam.Params.LEADINORTHODIST, nIndex, Me), New NumericMachiningParam(MachiningParam.Params.LEADINORTHODIST, nIndex),
New ComboMachiningParam(MachiningParam.Params.LEADOUT, nIndex, Me), New NumericMachiningParam(MachiningParam.Params.OFFSETLEADPOINT, nIndex),
New NumericMachiningParam(MachiningParam.Params.LEADOUTTANGDIST, nIndex, Me), New ComboMachiningParam(MachiningParam.Params.LEADOUT, nIndex),
New NumericMachiningParam(MachiningParam.Params.LEADOUTORTHODIST, nIndex, Me), New NumericMachiningParam(MachiningParam.Params.LEADOUTTANGDIST, nIndex),
New NumericMachiningParam(MachiningParam.Params.COASTINGLEN, nIndex, Me), New NumericMachiningParam(MachiningParam.Params.LEADOUTORTHODIST, nIndex),
New NumericMachiningParam(MachiningParam.Params.COASTINGFEED_PC, nIndex, Me), New NumericMachiningParam(MachiningParam.Params.COASTINGLEN, nIndex),
New NumericMachiningParam(MachiningParam.Params.WIPELEN, nIndex, Me), New NumericMachiningParam(MachiningParam.Params.COASTINGFEED_PC, nIndex),
New NumericMachiningParam(MachiningParam.Params.WIPEFEED_PC, nIndex, Me)}) New NumericMachiningParam(MachiningParam.Params.WIPELEN, nIndex),
'New NumericMachiningParam(MachiningParam.Params.WIPEDIR, nIndex, Me)}) New NumericMachiningParam(MachiningParam.Params.WIPEFEED_PC, nIndex)})
'New NumericMachiningParam(MachiningParam.Params.WIPEDIR, nIndex)})
Case Cathegories.RIBS Case Cathegories.RIBS
m_sName = "Ribs" m_sName = "Ribs"
m_MachiningParamList = New List(Of MachiningParam)({New ComboMachiningParam(MachiningParam.Params.RIBSTYPE, nIndex, Me), m_MachiningParamList = New List(Of MachiningParam)({New ComboMachiningParam(MachiningParam.Params.RIBSTYPE, nIndex),
New CheckMachiningParam(MachiningParam.Params.RIBSLIMITUNBOUNDEDWITHSOLID, nIndex, Me), New NumericMachiningParam(MachiningParam.Params.RIBSOVERLAP, nIndex),
New NumericMachiningParam(MachiningParam.Params.RIBSOVERLAP, nIndex, Me), New NumericMachiningParam(MachiningParam.Params.RIBSSTRANDCOUNT, nIndex),
New NumericMachiningParam(MachiningParam.Params.RIBSSTRANDCOUNT, nIndex, Me), New CheckMachiningParam(MachiningParam.Params.RIBSLINK, nIndex),
New CheckMachiningParam(MachiningParam.Params.RIBSLINK, nIndex, Me), New CheckMachiningParam(MachiningParam.Params.RIBSINVERTORDER, nIndex),
New CheckMachiningParam(MachiningParam.Params.RIBSINVERTORDER, nIndex, Me), New CheckMachiningParam(MachiningParam.Params.RIBSINVERTDIRECTION, nIndex),
New CheckMachiningParam(MachiningParam.Params.RIBSINVERTDIRECTION, nIndex, Me), New CheckMachiningParam(MachiningParam.Params.RIBSLEADININVERT, nIndex),
New CheckMachiningParam(MachiningParam.Params.RIBSINVERTSTRANDORDER, nIndex, Me), New NumericMachiningParam(MachiningParam.Params.RIBSLEADINLEN, nIndex),
New CheckMachiningParam(MachiningParam.Params.RIBSLEADININVERT, nIndex, Me), New CheckMachiningParam(MachiningParam.Params.RIBSLEADOUTINVERT, nIndex),
New NumericMachiningParam(MachiningParam.Params.RIBSLEADINLEN, nIndex, Me), New NumericMachiningParam(MachiningParam.Params.RIBSLEADOUTLEN, nIndex),
New CheckMachiningParam(MachiningParam.Params.RIBSLEADOUTINVERT, nIndex, Me), New NumericMachiningParam(MachiningParam.Params.RIBSLEADOUTCOASTING, nIndex),
New NumericMachiningParam(MachiningParam.Params.RIBSLEADOUTLEN, nIndex, Me), New NumericMachiningParam(MachiningParam.Params.RIBSLEADOUTWIPE, nIndex),
New NumericMachiningParam(MachiningParam.Params.RIBSLEADOUTCOASTING, nIndex, Me), New NumericMachiningParam(MachiningParam.Params.RIBSLEADOUTWIPEDIR, nIndex)})
New NumericMachiningParam(MachiningParam.Params.RIBSLEADOUTWIPE, nIndex, Me),
New NumericMachiningParam(MachiningParam.Params.RIBSLEADOUTWIPEDIR, nIndex, Me)})
Case Cathegories.SHELL_NUMBER Case Cathegories.SHELL_NUMBER
m_sName = "Reduce Shell Number" m_sName = "Reduce Shell Number"
m_MachiningParamList = New List(Of MachiningParam)({New NumericMachiningParam(MachiningParam.Params.SHELLNBRDIFFERENCE, nIndex, Me), m_MachiningParamList = New List(Of MachiningParam)({New NumericMachiningParam(MachiningParam.Params.SHELLNBRDIFFERENCE, nIndex),
New NumericMachiningParam(MachiningParam.Params.SHELLNBRCOASTING, nIndex, Me), New NumericMachiningParam(MachiningParam.Params.SHELLNBRCOASTING, nIndex),
New NumericMachiningParam(MachiningParam.Params.SHELLNBRWIPE, nIndex, Me), New NumericMachiningParam(MachiningParam.Params.SHELLNBRWIPE, nIndex),
New NumericMachiningParam(MachiningParam.Params.SHELLNBRWIPEDIR, nIndex, Me)}) New NumericMachiningParam(MachiningParam.Params.SHELLNBRWIPEDIR, nIndex)})
Case Cathegories.AUX_SOLID Case Cathegories.AUX_SOLID
m_sName = "Filled Solid" m_sName = "Filled Solid"
m_MachiningParamList = New List(Of MachiningParam)({New NumericMachiningParam(MachiningParam.Params.AUXSOLIDSOVERLAP, nIndex, Me), m_MachiningParamList = New List(Of MachiningParam)({New NumericMachiningParam(MachiningParam.Params.AUXSOLIDSOVERLAP, nIndex),
New ComboMachiningParam(MachiningParam.Params.AUXSOLIDSINFILL, nIndex, Me), New ComboMachiningParam(MachiningParam.Params.AUXSOLIDSINFILL, nIndex),
New ComboMachiningParam(MachiningParam.Params.AUXSOLIDSSTRANDORDER, nIndex, Me), New ComboMachiningParam(MachiningParam.Params.AUXSOLIDSSTRANDORDER, nIndex),
New ComboMachiningParam(MachiningParam.Params.AUXSOLIDSLINKTYPE, nIndex, Me), New ComboMachiningParam(MachiningParam.Params.AUXSOLIDSLINKTYPE, nIndex),
New NumericMachiningParam(MachiningParam.Params.AUXSOLIDSLINKPARAM, nIndex, Me), New NumericMachiningParam(MachiningParam.Params.AUXSOLIDSLINKPARAM, nIndex),
New NumericMachiningParam(MachiningParam.Params.AUXSOLIDSSTARTPOINTOFFSETONSLICE, nIndex, Me), New NumericMachiningParam(MachiningParam.Params.AUXSOLIDSSTARTPOINTOFFSETONSLICE, nIndex),
New NumericMachiningParam(MachiningParam.Params.AUXSOLIDSCOASTINGLEN, nIndex, Me), New NumericMachiningParam(MachiningParam.Params.AUXSOLIDSCOASTINGLEN, nIndex),
New NumericMachiningParam(MachiningParam.Params.AUXSOLIDSWIPELEN, nIndex, Me), New NumericMachiningParam(MachiningParam.Params.AUXSOLIDSWIPELEN, nIndex),
New NumericMachiningParam(MachiningParam.Params.AUXSOLIDSWIPEDIR, nIndex, Me)}) New NumericMachiningParam(MachiningParam.Params.AUXSOLIDSWIPEDIR, nIndex)})
Case Cathegories.MATERIALS Case Cathegories.MATERIALS
m_sName = "Materials" m_sName = "Materials"
Dim sMaterials As String = "" Dim sMaterials As String = ""
@@ -394,25 +384,7 @@ Public Class MachiningCathegory
Dim MaterialGuidList As List(Of String) = sMaterials.Split(";"c).ToList() Dim MaterialGuidList As List(Of String) = sMaterials.Split(";"c).ToList()
m_MachiningParamList = New List(Of MachiningParam) m_MachiningParamList = New List(Of MachiningParam)
For Each Material In Map.refTopPanelVM.MaterialList For Each Material In Map.refTopPanelVM.MaterialList
m_MachiningParamList.Add(New MaterialMachiningParam(Material.sName, Material.sGUID, MaterialGuidList.Contains(Material.sGUID), Me)) m_MachiningParamList.Add(New MaterialMachiningParam(Material.sName, Material.sGUID, MaterialGuidList.Contains(Material.sGUID)))
Next
End Select
' verifico dipendenze tra parametri
Select Case m_Type
Case Cathegories.LINK
For Each Param In {MachiningParam.Params.LINKTYPE, MachiningParam.Params.LEADIN, MachiningParam.Params.LEADOUT}
Dim MachiningParam As ComboMachiningParam = MachiningParamList.FirstOrDefault(Function(z) z.Type = Param)
MachiningParam.ManageDependencyParam()
Next
Case Cathegories.RIBS
For Each Param In {MachiningParam.Params.RIBSTYPE}
Dim MachiningParam As ComboMachiningParam = MachiningParamList.FirstOrDefault(Function(z) z.Type = Param)
MachiningParam.ManageDependencyParam()
Next
Case Cathegories.AUX_SOLID
For Each Param In {MachiningParam.Params.AUXSOLIDSINFILL}
Dim MachiningParam As ComboMachiningParam = MachiningParamList.FirstOrDefault(Function(z) z.Type = Param)
MachiningParam.ManageDependencyParam()
Next Next
End Select End Select
End Sub End Sub
@@ -444,70 +416,66 @@ Public MustInherit Class MachiningParam
Inherits VMBase Inherits VMBase
Public Enum Params As Integer Public Enum Params As Integer
SLICINGTYPE = 1 NAME = 2
SPIRALVASE = 2 SLICINGTYPE = 3
STRANDH = 3 STRANDH = 4
STRANDW = 4 STRANDW = 5
STRANDCOUNT = 5 STRANDCOUNT = 6
OFFSET = 6 OFFSET = 7
STRANDOVERLAP = 7
STARTPOINTOFFSETONSLICE = 8 STARTPOINTOFFSETONSLICE = 8
STRANDORDER = 9 STRANDORDER = 9
DIRECTION = 10 DIRECTION = 10
FLOORCOUNT = 11 LINKTYPE = 11
G0FEED = 12 LINKPARAM = 12
LINKZUP = 13 LINKZUP = 13
G0FEEDZ = 14 OFFSETLEADPOINT = 14
TOOLDIAM = 15 LEADIN = 15
FLOWRATE_PC = 16 LEADINTANGDIST = 16
DYNAMIC_MODE = 17 LEADINORTHODIST = 17
PRINT_ORDER = 18 LEADOUT = 18
PREFLOWDELAY = 19 LEADOUTTANGDIST = 19
POSTFLOWDELAY = 20 LEADOUTORTHODIST = 20
SCREWBACK = 21 COASTINGLEN = 21
LINKTYPE = 51 COASTINGFEED_PC = 22
LINKPARAM = 52 WIPELEN = 23
LEADIN = 53 WIPEFEED_PC = 24
LEADINTANGDIST = 54 FLOORCOUNT = 25
LEADINORTHODIST = 55 G0FEED = 26
OFFSETLEADPOINT = 56 G0FEEDZ = 27
LEADOUT = 57 TOOLDIAM = 28
LEADOUTTANGDIST = 58 RIBSTYPE = 29
LEADOUTORTHODIST = 59 RIBSOVERLAP = 30
COASTINGLEN = 60 RIBSSTRANDCOUNT = 31
COASTINGFEED_PC = 61 RIBSLINK = 32
WIPELEN = 62 RIBSINVERTORDER = 33
WIPEFEED_PC = 63 RIBSINVERTDIRECTION = 34
'WIPEDIR = 64 RIBSLEADININVERT = 35
RIBSTYPE = 101 RIBSLEADINLEN = 36
RIBSOVERLAP = 102 RIBSLEADOUTINVERT = 37
RIBSSTRANDCOUNT = 103 RIBSLEADOUTLEN = 38
RIBSLINK = 104 RIBSLEADOUTCOASTING = 39
RIBSINVERTORDER = 105 RIBSLEADOUTWIPE = 40
RIBSINVERTDIRECTION = 106 RIBSLEADOUTWIPEDIR = 41
RIBSINVERTSTRANDORDER = 107 SHELLNBRDIFFERENCE = 42
RIBSLEADININVERT = 108 SHELLNBRCOASTING = 43
RIBSLEADINLEN = 109 SHELLNBRWIPE = 44
RIBSLEADOUTINVERT = 110 SHELLNBRWIPEDIR = 45
RIBSLEADOUTLEN = 111 AUXSOLIDSOVERLAP = 46
RIBSLEADOUTCOASTING = 112 AUXSOLIDSINFILL = 47
RIBSLEADOUTWIPE = 113 AUXSOLIDSSTRANDORDER = 48
RIBSLEADOUTWIPEDIR = 114 AUXSOLIDSLINKTYPE = 49
RIBSLIMITUNBOUNDEDWITHSOLID = 115 AUXSOLIDSLINKPARAM = 50
SHELLNBRDIFFERENCE = 151 AUXSOLIDSSTARTPOINTOFFSETONSLICE = 51
SHELLNBRCOASTING = 152 AUXSOLIDSCOASTINGLEN = 52
SHELLNBRWIPE = 153 AUXSOLIDSWIPELEN = 53
SHELLNBRWIPEDIR = 154 AUXSOLIDSWIPEDIR = 54
AUXSOLIDSOVERLAP = 201 SPIRALVASE = 55
AUXSOLIDSINFILL = 202 'WIPEDIR = 56
AUXSOLIDSSTRANDORDER = 203 STRANDOVERLAP = 57
AUXSOLIDSLINKTYPE = 204 FLOWRATE_PC = 58
AUXSOLIDSLINKPARAM = 205 DYNAMIC_MODE = 59
AUXSOLIDSSTARTPOINTOFFSETONSLICE = 206 PRINT_ORDER = 60
AUXSOLIDSCOASTINGLEN = 207 MATERIALS = 100
AUXSOLIDSWIPELEN = 208
AUXSOLIDSWIPEDIR = 209
MATERIALS = 250
End Enum End Enum
Protected m_Type As Params Protected m_Type As Params
@@ -526,16 +494,8 @@ Public MustInherit Class MachiningParam
Public MustOverride ReadOnly Property bIsModified As Boolean Public MustOverride ReadOnly Property bIsModified As Boolean
Protected m_Cathegory As MachiningCathegory Sub New(Type As Params)
Public ReadOnly Property Cathegory As MachiningCathegory
Get
Return m_Cathegory
End Get
End Property
Sub New(Type As Params, Cathegory As MachiningCathegory)
m_Type = Type m_Type = Type
m_Cathegory = Cathegory
Select Case m_Type Select Case m_Type
Case Params.SLICINGTYPE Case Params.SLICINGTYPE
m_sName = "Slicing direction" m_sName = "Slicing direction"
@@ -589,12 +549,6 @@ Public MustInherit Class MachiningParam
m_sName = "G0 Feed Z" m_sName = "G0 Feed Z"
Case Params.TOOLDIAM Case Params.TOOLDIAM
m_sName = "Nozzle Diameter" m_sName = "Nozzle Diameter"
Case Params.PREFLOWDELAY
m_sName = "Pre Flow Delay"
Case Params.POSTFLOWDELAY
m_sName = "Post Flow Delay"
Case Params.SCREWBACK
m_sName = "Screw Back"
Case Params.RIBSTYPE Case Params.RIBSTYPE
m_sName = "Type" m_sName = "Type"
Case Params.RIBSOVERLAP Case Params.RIBSOVERLAP
@@ -607,8 +561,6 @@ Public MustInherit Class MachiningParam
m_sName = "Invert Order" m_sName = "Invert Order"
Case Params.RIBSINVERTDIRECTION Case Params.RIBSINVERTDIRECTION
m_sName = "Invert Direction" m_sName = "Invert Direction"
Case Params.RIBSINVERTSTRANDORDER
m_sName = "Invert Strand Order"
Case Params.RIBSLEADININVERT Case Params.RIBSLEADININVERT
m_sName = "Lead In Invert" m_sName = "Lead In Invert"
Case Params.RIBSLEADINLEN Case Params.RIBSLEADINLEN
@@ -623,8 +575,6 @@ Public MustInherit Class MachiningParam
m_sName = "Lead Out Wipe" m_sName = "Lead Out Wipe"
Case Params.RIBSLEADOUTWIPEDIR Case Params.RIBSLEADOUTWIPEDIR
m_sName = "Lead Out Wipe Dir [deg]" m_sName = "Lead Out Wipe Dir [deg]"
Case Params.RIBSLIMITUNBOUNDEDWITHSOLID
m_sName = "Limit Unbounded With Solid"
Case Params.SHELLNBRDIFFERENCE Case Params.SHELLNBRDIFFERENCE
m_sName = "Difference" m_sName = "Difference"
Case Params.SHELLNBRCOASTING Case Params.SHELLNBRCOASTING
@@ -666,9 +616,8 @@ Public MustInherit Class MachiningParam
End Select End Select
End Sub End Sub
Sub New(sName As String, Cathegory As MachiningCathegory) Sub New(sName As String)
m_Type = Params.MATERIALS m_Type = Params.MATERIALS
m_Cathegory = Cathegory
m_sName = sName m_sName = sName
End Sub End Sub
@@ -685,10 +634,6 @@ Public Class NumericMachiningParam
Protected m_bIsLen As Boolean = False Protected m_bIsLen As Boolean = False
Protected m_bIsActiveMinMax As Boolean = False
Protected m_dMinValue As Double
Protected m_dMaxValue As Double
Protected m_dValue As Double Protected m_dValue As Double
Public ReadOnly Property dValue As Double Public ReadOnly Property dValue As Double
Get Get
@@ -700,18 +645,10 @@ Public Class NumericMachiningParam
Return If(m_bIsLen, LenToString(m_dValue, 1), DoubleToString(m_dValue, 2)) Return If(m_bIsLen, LenToString(m_dValue, 1), DoubleToString(m_dValue, 2))
End Get End Get
Set(value As String) Set(value As String)
Dim dTempValue As Double = 0
If m_bIsLen Then If m_bIsLen Then
StringToLen(value, dTempValue) StringToLen(value, m_dValue)
Else Else
StringToDouble(value, dTempValue) StringToDouble(value, m_dValue)
End If
If m_bIsActiveMinMax Then
If dTempValue >= m_dMinValue AndAlso dTempValue <= m_dMaxValue Then
m_dValue = dTempValue
End If
Else
m_dValue = dTempValue
End If End If
NotifyPropertyChanged(NameOf(sValue)) NotifyPropertyChanged(NameOf(sValue))
End Set End Set
@@ -730,36 +667,12 @@ Public Class NumericMachiningParam
End Get End Get
End Property End Property
Protected m_bIsActive As Boolean = True Sub New(Type As Params)
Public ReadOnly Property bIsActive As Boolean MyBase.New(Type)
Get
Return m_bIsActive
End Get
End Property
Friend Sub SetIsActive(bValue As Boolean)
m_bIsActive = bValue
NotifyPropertyChanged(NameOf(bIsActive))
End Sub End Sub
Sub New(Type As Params, Cathegory As MachiningCathegory) Sub New(Type As Params, nIndex As Integer)
MyBase.New(Type, Cathegory) MyBase.New(Type)
End Sub
Sub New(Type As Params, nIndex As Integer, Cathegory As MachiningCathegory)
MyBase.New(Type, Cathegory)
' leggo ed imposto eventuali min e max
Dim sMinMax As String = ""
If GetPrivateProfileString(S_MINMAX, Type, "", sMinMax, CurrentMachine.sMachIniFile) > 0 Then
Dim sMinMaxValues() As String = sMinMax.Split(","c)
Dim dMin As Double = 0
Dim dMax As Double = 0
If StringToDouble(sMinMaxValues(0), dMin) AndAlso StringToDouble(sMinMaxValues(1), dMax) Then
m_dMinValue = dMin
m_dMaxValue = dMax
m_bIsActiveMinMax = True
End If
End If
' leggo parametri da Db
If nIndex = 0 Then If nIndex = 0 Then
m_dValue = 0 m_dValue = 0
m_bIsLen = True m_bIsLen = True
@@ -831,15 +744,6 @@ Public Class NumericMachiningParam
Case Params.TOOLDIAM Case Params.TOOLDIAM
m_dValue = ReadMachiningParamDouble(nIndex, MAC_TOOLDIAM, 0) m_dValue = ReadMachiningParamDouble(nIndex, MAC_TOOLDIAM, 0)
m_bIsLen = True m_bIsLen = True
Case Params.PREFLOWDELAY
m_dValue = ReadMachiningParamDouble(nIndex, MAC_PREFLOWDELAY, 0)
m_bIsLen = False
Case Params.POSTFLOWDELAY
m_dValue = ReadMachiningParamDouble(nIndex, MAC_POSTFLOWDELAY, 0)
m_bIsLen = False
Case Params.SCREWBACK
m_dValue = ReadMachiningParamDouble(nIndex, MAC_SCREWBACK, 45)
m_bIsLen = False
Case Params.RIBSOVERLAP Case Params.RIBSOVERLAP
m_dValue = ReadMachiningParamDouble(nIndex, MAC_RIBSOVERLAP, 0) m_dValue = ReadMachiningParamDouble(nIndex, MAC_RIBSOVERLAP, 0)
m_bIsLen = False m_bIsLen = False
@@ -951,12 +855,6 @@ Public Class NumericMachiningParam
WriteMachiningParam(nIndex, MAC_G0FEEDZ, sWriteValue, sFilePath) WriteMachiningParam(nIndex, MAC_G0FEEDZ, sWriteValue, sFilePath)
Case Params.TOOLDIAM Case Params.TOOLDIAM
WriteMachiningParam(nIndex, MAC_TOOLDIAM, sWriteValue, sFilePath) WriteMachiningParam(nIndex, MAC_TOOLDIAM, sWriteValue, sFilePath)
Case Params.PREFLOWDELAY
WriteMachiningParam(nIndex, MAC_PREFLOWDELAY, sWriteValue, sFilePath)
Case Params.POSTFLOWDELAY
WriteMachiningParam(nIndex, MAC_POSTFLOWDELAY, sWriteValue, sFilePath)
Case Params.SCREWBACK
WriteMachiningParam(nIndex, MAC_SCREWBACK, sWriteValue, sFilePath)
Case Params.RIBSOVERLAP Case Params.RIBSOVERLAP
WriteMachiningParam(nIndex, MAC_RIBSOVERLAP, sWriteValue, sFilePath) WriteMachiningParam(nIndex, MAC_RIBSOVERLAP, sWriteValue, sFilePath)
Case Params.RIBSSTRANDCOUNT Case Params.RIBSSTRANDCOUNT
@@ -1034,8 +932,8 @@ Public Class StringMachiningParam
End Get End Get
End Property End Property
Sub New(Type As Params, nIndex As Integer, Cathegory As MachiningCathegory) Sub New(Type As Params, nIndex As Integer)
MyBase.New(Type, Cathegory) MyBase.New(Type)
m_sValue = sValue m_sValue = sValue
m_sOrigValue = m_sValue m_sOrigValue = m_sValue
End Sub End Sub
@@ -1076,7 +974,6 @@ Public Class ComboMachiningParam
Set(value As IdNameStruct) Set(value As IdNameStruct)
m_SelValue = value m_SelValue = value
NotifyPropertyChanged(NameOf(SelValue)) NotifyPropertyChanged(NameOf(SelValue))
ManageDependencyParam()
End Set End Set
End Property End Property
@@ -1093,23 +990,12 @@ Public Class ComboMachiningParam
End Get End Get
End Property End Property
Protected m_bIsActive As Boolean = True Sub New(Type As Params)
Public ReadOnly Property bIsActive As Boolean MyBase.New(Type)
Get
Return m_bIsActive
End Get
End Property
Friend Sub SetIsActive(bValue As Boolean)
m_bIsActive = bValue
NotifyPropertyChanged(NameOf(bIsActive))
End Sub End Sub
Sub New(Type As Params, Cathegory As MachiningCathegory) Sub New(Type As Params, nIndex As Integer)
MyBase.New(Type, Cathegory) MyBase.New(Type)
End Sub
Sub New(Type As Params, nIndex As Integer, Cathegory As MachiningCathegory)
MyBase.New(Type, Cathegory)
If nIndex = 0 Then If nIndex = 0 Then
m_ValueList = New List(Of IdNameStruct) m_ValueList = New List(Of IdNameStruct)
m_SelValue = Nothing m_SelValue = Nothing
@@ -1186,35 +1072,6 @@ Public Class ComboMachiningParam
m_OrigSelValue = m_SelValue m_OrigSelValue = m_SelValue
End Sub End Sub
Friend Sub ManageDependencyParam()
' gestisco dis/attivazione parametri dipendenti
Select Case m_Type
Case Params.LINKTYPE
Dim NumMachiningParam As NumericMachiningParam = m_Cathegory.MachiningParamList.FirstOrDefault(Function(z) z.Type = Params.LINKPARAM)
NumMachiningParam.SetIsActive(m_SelValue.Id <> Machining.MPAR_LINKTYPES.NONE)
Case Params.LEADIN
Dim NumMachiningParam As NumericMachiningParam = m_Cathegory.MachiningParamList.FirstOrDefault(Function(z) z.Type = Params.LEADINTANGDIST)
NumMachiningParam.SetIsActive(m_SelValue.Id <> Machining.MPAR_LEADINOUT.NONE)
NumMachiningParam = m_Cathegory.MachiningParamList.FirstOrDefault(Function(z) z.Type = Params.LEADINORTHODIST)
NumMachiningParam.SetIsActive(m_SelValue.Id <> Machining.MPAR_LEADINOUT.NONE)
Case Params.LEADOUT
Dim NumMachiningParam As NumericMachiningParam = m_Cathegory.MachiningParamList.FirstOrDefault(Function(z) z.Type = Params.LEADOUTTANGDIST)
NumMachiningParam.SetIsActive(m_SelValue.Id <> Machining.MPAR_LEADINOUT.NONE)
NumMachiningParam = m_Cathegory.MachiningParamList.FirstOrDefault(Function(z) z.Type = Params.LEADOUTORTHODIST)
NumMachiningParam.SetIsActive(m_SelValue.Id <> Machining.MPAR_LEADINOUT.NONE)
Case Params.RIBSTYPE
Dim CheckMachiningParam As CheckMachiningParam = m_Cathegory.MachiningParamList.FirstOrDefault(Function(z) z.Type = Params.RIBSLIMITUNBOUNDEDWITHSOLID)
CheckMachiningParam.SetIsActive(m_SelValue.Id = MPAR_RIBSTYPE.UNBOUNDED)
Case Params.AUXSOLIDSINFILL
Dim ComboMachiningParam As ComboMachiningParam = m_Cathegory.MachiningParamList.FirstOrDefault(Function(z) z.Type = Params.AUXSOLIDSSTRANDORDER)
ComboMachiningParam.SetIsActive(m_SelValue.Id = Machining.MPAR_INFILL.OFFSET)
ComboMachiningParam = m_Cathegory.MachiningParamList.FirstOrDefault(Function(z) z.Type = Params.AUXSOLIDSLINKTYPE)
ComboMachiningParam.SetIsActive(m_SelValue.Id = Machining.MPAR_INFILL.OFFSET)
Dim NumMachiningParam As NumericMachiningParam = m_Cathegory.MachiningParamList.FirstOrDefault(Function(z) z.Type = Params.AUXSOLIDSLINKPARAM)
NumMachiningParam.SetIsActive(m_SelValue.Id = Machining.MPAR_INFILL.OFFSET)
End Select
End Sub
Friend Overrides Sub WriteParamOnDb(nIndex As Integer, Optional sFilePath As String = "") Friend Overrides Sub WriteParamOnDb(nIndex As Integer, Optional sFilePath As String = "")
Select Case Type Select Case Type
Case Params.SLICINGTYPE Case Params.SLICINGTYPE
@@ -1280,23 +1137,12 @@ Public Class CheckMachiningParam
End Get End Get
End Property End Property
Protected m_bIsActive As Boolean = True Sub New(Type As Params)
Public ReadOnly Property bIsActive As Boolean MyBase.New(Type)
Get
Return m_bIsActive
End Get
End Property
Friend Sub SetIsActive(bValue As Boolean)
m_bIsActive = bValue
NotifyPropertyChanged(NameOf(bIsActive))
End Sub End Sub
Sub New(Type As Params, Cathegory As MachiningCathegory) Sub New(Type As Params, nIndex As Integer)
MyBase.New(Type, Cathegory) MyBase.New(Type)
End Sub
Sub New(Type As Params, nIndex As Integer, Cathegory As MachiningCathegory)
MyBase.New(Type, Cathegory)
If nIndex = 0 Then If nIndex = 0 Then
m_bValue = 0 m_bValue = 0
Else Else
@@ -1309,14 +1155,10 @@ Public Class CheckMachiningParam
m_bValue = ReadMachiningParamDouble(nIndex, MAC_RIBSINVERTORDER, 0) m_bValue = ReadMachiningParamDouble(nIndex, MAC_RIBSINVERTORDER, 0)
Case Params.RIBSINVERTDIRECTION Case Params.RIBSINVERTDIRECTION
m_bValue = ReadMachiningParamDouble(nIndex, MAC_RIBSINVERTDIRECTION, 0) m_bValue = ReadMachiningParamDouble(nIndex, MAC_RIBSINVERTDIRECTION, 0)
Case Params.RIBSINVERTSTRANDORDER
m_bValue = ReadMachiningParamDouble(nIndex, MAC_RIBSINVERTSTRANDORDER, 0)
Case Params.RIBSLEADININVERT Case Params.RIBSLEADININVERT
m_bValue = ReadMachiningParamDouble(nIndex, MAC_RIBSLEADININVERT, 0) m_bValue = ReadMachiningParamDouble(nIndex, MAC_RIBSLEADININVERT, 0)
Case Params.RIBSLEADOUTINVERT Case Params.RIBSLEADOUTINVERT
m_bValue = ReadMachiningParamDouble(nIndex, MAC_RIBSLEADOUTINVERT, 0) m_bValue = ReadMachiningParamDouble(nIndex, MAC_RIBSLEADOUTINVERT, 0)
Case Params.RIBSLIMITUNBOUNDEDWITHSOLID
m_bValue = ReadMachiningParamDouble(nIndex, MAC_RIBSLIMITUNBOUNDEDWITHSOLID, 0)
End Select End Select
End If End If
m_bOrigValue = m_bValue m_bOrigValue = m_bValue
@@ -1332,14 +1174,10 @@ Public Class CheckMachiningParam
WriteMachiningParam(nIndex, MAC_RIBSINVERTORDER, If(m_bValue, 1, 0), sFilePath) WriteMachiningParam(nIndex, MAC_RIBSINVERTORDER, If(m_bValue, 1, 0), sFilePath)
Case Params.RIBSINVERTDIRECTION Case Params.RIBSINVERTDIRECTION
WriteMachiningParam(nIndex, MAC_RIBSINVERTDIRECTION, If(m_bValue, 1, 0), sFilePath) WriteMachiningParam(nIndex, MAC_RIBSINVERTDIRECTION, If(m_bValue, 1, 0), sFilePath)
Case Params.RIBSINVERTSTRANDORDER
WriteMachiningParam(nIndex, MAC_RIBSINVERTSTRANDORDER, If(m_bValue, 1, 0), sFilePath)
Case Params.RIBSLEADININVERT Case Params.RIBSLEADININVERT
WriteMachiningParam(nIndex, MAC_RIBSLEADININVERT, If(m_bValue, 1, 0), sFilePath) WriteMachiningParam(nIndex, MAC_RIBSLEADININVERT, If(m_bValue, 1, 0), sFilePath)
Case Params.RIBSLEADOUTINVERT Case Params.RIBSLEADOUTINVERT
WriteMachiningParam(nIndex, MAC_RIBSLEADOUTINVERT, If(m_bValue, 1, 0), sFilePath) WriteMachiningParam(nIndex, MAC_RIBSLEADOUTINVERT, If(m_bValue, 1, 0), sFilePath)
Case Params.RIBSLIMITUNBOUNDEDWITHSOLID
WriteMachiningParam(nIndex, MAC_RIBSLIMITUNBOUNDEDWITHSOLID, If(m_bValue, 1, 0), sFilePath)
End Select End Select
End Sub End Sub
@@ -1391,8 +1229,8 @@ Public Class MaterialMachiningParam
End Get End Get
End Property End Property
Sub New(sName As String, sGUID As String, bValue As Boolean, Cathegory As MachiningCathegory) Sub New(sName As String, sGUID As String, bValue As Boolean)
MyBase.New(sName, Cathegory) MyBase.New(sName)
m_sGUID = sGUID m_sGUID = sGUID
m_bValue = bValue m_bValue = bValue
m_bOrigValue = m_bValue m_bOrigValue = m_bValue
@@ -1431,8 +1269,6 @@ End Class
Public Class OrderedMachiningParam Public Class OrderedMachiningParam
Inherits MachiningParam Inherits MachiningParam
Protected m_StandardValueOrderList As List(Of Integer)
Protected m_ValueList As ObservableCollection(Of IdNameStruct) Protected m_ValueList As ObservableCollection(Of IdNameStruct)
Public ReadOnly Property ValueList As ObservableCollection(Of IdNameStruct) Public ReadOnly Property ValueList As ObservableCollection(Of IdNameStruct)
Get Get
@@ -1468,44 +1304,48 @@ Public Class OrderedMachiningParam
Set(value As String) Set(value As String)
Select Case Type Select Case Type
Case Params.PRINT_ORDER Case Params.PRINT_ORDER
Dim StringValueList() As String Dim StandardValueList() As String = {Machining.MPAR_PRINT_ORDER.SHELL,
Dim IntegerValueList As New List(Of Integer) Machining.MPAR_PRINT_ORDER.EXTRA_SHELL,
If value.Length = 15 Then Machining.MPAR_PRINT_ORDER.INFILL,
Machining.MPAR_PRINT_ORDER.AUX_SOLID,
Machining.MPAR_PRINT_ORDER.RIB}
Dim StringValueList() As String = StandardValueList
If value.Length = 9 Then
StringValueList = value.Split(","c) StringValueList = value.Split(","c)
For Each StringValue In StringValueList
Dim IntegerValue As Integer = 0
If Integer.TryParse(StringValue, IntegerValue) Then
IntegerValueList.Add(IntegerValue)
End If
Next
End If End If
If IntegerValueList.Count <> 8 Then If StringValueList.Count <> 5 Then
IntegerValueList = m_StandardValueOrderList StringValueList = StandardValueList
End If End If
If Not IntegerValueList.Contains(Machining.MPAR_PRINT_ORDER.SHELL) OrElse If Not StringValueList.Contains(Machining.MPAR_PRINT_ORDER.SHELL) OrElse
Not IntegerValueList.Contains(Machining.MPAR_PRINT_ORDER.EXTRA_SHELL) OrElse Not StringValueList.Contains(Machining.MPAR_PRINT_ORDER.EXTRA_SHELL) OrElse
Not IntegerValueList.Contains(Machining.MPAR_PRINT_ORDER.INFILL) OrElse Not StringValueList.Contains(Machining.MPAR_PRINT_ORDER.INFILL) OrElse
Not IntegerValueList.Contains(Machining.MPAR_PRINT_ORDER.AUX_SOLID) OrElse Not StringValueList.Contains(Machining.MPAR_PRINT_ORDER.AUX_SOLID) OrElse
Not IntegerValueList.Contains(Machining.MPAR_PRINT_ORDER.RIB_UNBOUNDED) OrElse Not StringValueList.Contains(Machining.MPAR_PRINT_ORDER.RIB) Then
Not IntegerValueList.Contains(Machining.MPAR_PRINT_ORDER.RIB_EXTERNAL) OrElse StringValueList = StandardValueList
Not IntegerValueList.Contains(Machining.MPAR_PRINT_ORDER.RIB_INTERNAL) OrElse
Not IntegerValueList.Contains(Machining.MPAR_PRINT_ORDER.RIB_SUPPORT) Then
IntegerValueList = m_StandardValueOrderList
End If End If
OrderByReference(m_ValueList, IntegerValueList) m_ValueList.Clear()
For Each StringValue In StringValueList
Dim nValue As Integer = -1
Integer.TryParse(StringValue, nValue)
Dim ItemList As IdNameStruct
Select Case nValue
Case Machining.MPAR_PRINT_ORDER.SHELL
ItemList = New IdNameStruct(Machining.MPAR_PRINT_ORDER.SHELL, "Shell")
Case Machining.MPAR_PRINT_ORDER.EXTRA_SHELL
ItemList = New IdNameStruct(Machining.MPAR_PRINT_ORDER.EXTRA_SHELL, "Extra Shell")
Case Machining.MPAR_PRINT_ORDER.INFILL
ItemList = New IdNameStruct(Machining.MPAR_PRINT_ORDER.INFILL, "Infill")
Case Machining.MPAR_PRINT_ORDER.AUX_SOLID
ItemList = New IdNameStruct(Machining.MPAR_PRINT_ORDER.AUX_SOLID, "Filled Solids")
Case Machining.MPAR_PRINT_ORDER.RIB
ItemList = New IdNameStruct(Machining.MPAR_PRINT_ORDER.RIB, "Ribs")
End Select
m_ValueList.Add(ItemList)
Next
End Select End Select
End Set End Set
End Property End Property
Public Shared Sub OrderByReference(collection As ObservableCollection(Of IdNameStruct), comparison As List(Of Integer))
For i As Integer = 0 To comparison.Count - 1
Dim Index As Integer = i
If Not comparison.ElementAt(i).Equals(collection.ElementAt(i)) Then
collection.Move(collection.IndexOf(collection.FirstOrDefault(Function(x) x.Id = comparison(Index))), i)
End If
Next
End Sub
Public Overrides ReadOnly Property bIsModified As Boolean Public Overrides ReadOnly Property bIsModified As Boolean
Get Get
Return Value <> m_OrigValue Return Value <> m_OrigValue
@@ -1517,52 +1357,19 @@ Public Class OrderedMachiningParam
Private m_cmdMoveDownOrder As ICommand Private m_cmdMoveDownOrder As ICommand
Private m_cmdResetOrder As ICommand Private m_cmdResetOrder As ICommand
Sub New(Type As Params, Cathegory As MachiningCathegory) Sub New(Type As Params)
MyBase.New(Type, Cathegory) MyBase.New(Type)
End Sub End Sub
Sub New(Type As Params, nIndex As Integer, Cathegory As MachiningCathegory) Sub New(Type As Params, nIndex As Integer)
MyBase.New(Type, Cathegory) MyBase.New(Type)
If nIndex = 0 Then If nIndex = 0 Then
Select Case Type m_ValueList = New ObservableCollection(Of IdNameStruct)
Case Params.PRINT_ORDER m_SelValue = Nothing
m_StandardValueOrderList = New List(Of Integer)({Machining.MPAR_PRINT_ORDER.SHELL,
Machining.MPAR_PRINT_ORDER.EXTRA_SHELL,
Machining.MPAR_PRINT_ORDER.INFILL,
Machining.MPAR_PRINT_ORDER.AUX_SOLID,
Machining.MPAR_PRINT_ORDER.RIB_UNBOUNDED,
Machining.MPAR_PRINT_ORDER.RIB_EXTERNAL,
Machining.MPAR_PRINT_ORDER.RIB_INTERNAL,
Machining.MPAR_PRINT_ORDER.RIB_SUPPORT})
m_ValueList = New ObservableCollection(Of IdNameStruct)({New IdNameStruct(Machining.MPAR_PRINT_ORDER.SHELL, "Shell"),
New IdNameStruct(Machining.MPAR_PRINT_ORDER.EXTRA_SHELL, "Extra Shell"),
New IdNameStruct(Machining.MPAR_PRINT_ORDER.INFILL, "Infill"),
New IdNameStruct(Machining.MPAR_PRINT_ORDER.AUX_SOLID, "Filled Solid"),
New IdNameStruct(Machining.MPAR_PRINT_ORDER.RIB_UNBOUNDED, "Unbounded Rib"),
New IdNameStruct(Machining.MPAR_PRINT_ORDER.RIB_EXTERNAL, "External Rib"),
New IdNameStruct(Machining.MPAR_PRINT_ORDER.RIB_INTERNAL, "Internal Rib"),
New IdNameStruct(Machining.MPAR_PRINT_ORDER.RIB_SUPPORT, "Support Rib")})
m_SelValue = Nothing
End Select
Else Else
Select Case Type Select Case Type
Case Params.PRINT_ORDER Case Params.PRINT_ORDER
m_StandardValueOrderList = New List(Of Integer)({Machining.MPAR_PRINT_ORDER.SHELL, m_ValueList = New ObservableCollection(Of IdNameStruct)
Machining.MPAR_PRINT_ORDER.EXTRA_SHELL,
Machining.MPAR_PRINT_ORDER.INFILL,
Machining.MPAR_PRINT_ORDER.AUX_SOLID,
Machining.MPAR_PRINT_ORDER.RIB_UNBOUNDED,
Machining.MPAR_PRINT_ORDER.RIB_EXTERNAL,
Machining.MPAR_PRINT_ORDER.RIB_INTERNAL,
Machining.MPAR_PRINT_ORDER.RIB_SUPPORT})
m_ValueList = New ObservableCollection(Of IdNameStruct)({New IdNameStruct(Machining.MPAR_PRINT_ORDER.SHELL, "Shell"),
New IdNameStruct(Machining.MPAR_PRINT_ORDER.EXTRA_SHELL, "Extra Shell"),
New IdNameStruct(Machining.MPAR_PRINT_ORDER.INFILL, "Infill"),
New IdNameStruct(Machining.MPAR_PRINT_ORDER.AUX_SOLID, "Filled Solid"),
New IdNameStruct(Machining.MPAR_PRINT_ORDER.RIB_UNBOUNDED, "Unbounded Rib"),
New IdNameStruct(Machining.MPAR_PRINT_ORDER.RIB_EXTERNAL, "External Rib"),
New IdNameStruct(Machining.MPAR_PRINT_ORDER.RIB_INTERNAL, "Internal Rib"),
New IdNameStruct(Machining.MPAR_PRINT_ORDER.RIB_SUPPORT, "Support Rib")})
ReadMachiningParamString(nIndex, MAC_PRINTORDER, "", Value) ReadMachiningParamString(nIndex, MAC_PRINTORDER, "", Value)
End Select End Select
End If End If
@@ -1650,9 +1457,9 @@ Public Class OrderedMachiningParam
Public Sub ResetOrder() Public Sub ResetOrder()
Dim CurrValue As String = Value Dim CurrValue As String = Value
OrderByReference(m_ValueList, m_StandardValueOrderList)
m_ValueList = New ObservableCollection(Of IdNameStruct)(m_ValueList.OrderBy(Function(x) x.Id)) m_ValueList = New ObservableCollection(Of IdNameStruct)(m_ValueList.OrderBy(Function(x) x.Id))
If Value <> CurrValue Then If Value <> CurrValue Then
SelValue = Nothing
NotifyPropertyChanged(NameOf(ValueList)) NotifyPropertyChanged(NameOf(ValueList))
NotifyPropertyChanged(NameOf(Value)) NotifyPropertyChanged(NameOf(Value))
NotifyPropertyChanged(NameOf(SelValue)) NotifyPropertyChanged(NameOf(SelValue))
+118 -144
View File
@@ -1,32 +1,20 @@
<Grid x:Class="MachiningDbV" <UserControl x:Class="MachiningDbV"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:EgtWPFLib5="clr-namespace:EgtWPFLib5;assembly=EgtWPFLib5" xmlns:EgtWPFLib5="clr-namespace:EgtWPFLib5;assembly=EgtWPFLib5"
xmlns:PrintApp="clr-namespace:Icarus" xmlns:PrintApp="clr-namespace:Icarus"
Width="310" Width="300">
VerticalAlignment="Center"> <Border VerticalAlignment="Center"
<Grid.RowDefinitions> Style="{StaticResource RightPanel_Border}">
<RowDefinition Height="Auto"/> <Grid>
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
<Border Margin="0,0,0,2.5"
Style="{StaticResource Title_Border}">
<TextBlock Text="MACHINING DATABASE"
Style="{StaticResource Title_TextBlock}"/>
</Border>
<Border Grid.Row="1"
VerticalAlignment="Center"
Margin="0,2.5,0,0"
Style="{StaticResource BottomGrayRow_Border}">
<Grid Margin="2.5,2.5,2.5,0">
<Grid.RowDefinitions> <Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/> <RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/> <RowDefinition Height="Auto"/>
<RowDefinition Height="1*"/> <RowDefinition Height="1*"/>
<RowDefinition Height="Auto"/> <RowDefinition Height="Auto"/>
</Grid.RowDefinitions> </Grid.RowDefinitions>
<Grid HorizontalAlignment="Center" <Grid>
Margin="0,2.5,0,2.5">
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/> <ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/> <ColumnDefinition Width="Auto"/>
@@ -37,41 +25,33 @@
<Button Content="New" <Button Content="New"
Command="{Binding New_Command}" Command="{Binding New_Command}"
IsEnabled="{Binding IsEnabled}" IsEnabled="{Binding IsEnabled}"
Margin="2.5,0,2.5,0" Style="{StaticResource ToolBar_TextButton}"/>
Style="{StaticResource RightPanel_Button}"/>
<Button Content="Save" <Button Content="Save"
Grid.Column="1" Grid.Column="1"
Command="{Binding Save_Command}" Command="{Binding Save_Command}"
IsEnabled="{Binding IsEnabled}" IsEnabled="{Binding IsEnabled}"
Margin="2.5,0,2.5,0" Style="{StaticResource ToolBar_TextButton}"/>
Style="{StaticResource RightPanel_Button}"/>
<Button Content="Delete" <Button Content="Delete"
Grid.Column="2" Grid.Column="2"
Command="{Binding Delete_Command}" Command="{Binding Delete_Command}"
IsEnabled="{Binding IsEnabled}" IsEnabled="{Binding IsEnabled}"
Margin="2.5,0,2.5,0" Style="{StaticResource ToolBar_TextButton}"/>
Style="{StaticResource RightPanel_Button}"/>
<Button Grid.Column="3" <Button Grid.Column="3"
Command="{Binding Import_Command}" Command="{Binding Import_Command}"
ToolTip="{Binding Import_ToolTip}" ToolTip="{Binding ImportToolTip}"
IsEnabled="{Binding ImpExp_IsEnabled}" IsEnabled="{Binding ImpExp_IsEnabled}"
Margin="2.5,0,2.5,0"
Style="{StaticResource ToolBar_Button}"> Style="{StaticResource ToolBar_Button}">
<Image Source="/Resources/MachiningDB/MachiningImport.png" <Image Source="/Resources/MachiningDB/Import.png" Stretch="Uniform"/>
Style="{StaticResource Button_Image}"/>
</Button> </Button>
<Button Grid.Column="4" <Button Grid.Column="4"
Command="{Binding Export_Command}" Command="{Binding Export_Command}"
ToolTip="{Binding Export_ToolTip}" ToolTip="{Binding ImportToolTip}"
IsEnabled="{Binding ImpExp_IsEnabled}" IsEnabled="{Binding ImpExp_IsEnabled}"
Margin="2.5,0,2.5,0"
Style="{StaticResource ToolBar_Button}"> Style="{StaticResource ToolBar_Button}">
<Image Source="/Resources/MachiningDB/MachiningExport.png" <Image Source="/Resources/MachiningDB/Export.png" Stretch="Uniform"/>
Style="{StaticResource Button_Image}"/>
</Button> </Button>
</Grid> </Grid>
<Grid Grid.Row="1" <Grid Grid.Row="1">
Margin="0,2.5,0,2.5">
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/> <ColumnDefinition Width="1*"/>
<ColumnDefinition Width="Auto"/> <ColumnDefinition Width="Auto"/>
@@ -81,40 +61,26 @@
SelectedItem="{Binding SelMachining}" SelectedItem="{Binding SelMachining}"
DisplayMemberPath="ghName" DisplayMemberPath="ghName"
Visibility="{Binding Combo_Visibility}" Visibility="{Binding Combo_Visibility}"
HorizontalAlignment="Stretch" Style="{StaticResource FeatureComboBox}"/>
Margin="2.5,0,2.5,0" <EgtWPFLib5:EgtTextBox Text="{Binding SelectedItem.sName, ElementName=MachiningCombo, UpdateSourceTrigger=Explicit}"
Style="{StaticResource RightPanel_ComboBox}"/> IsExplicitFocused="{Binding UserShouldEditValueNow}"
<EgtWPFLib5:EgtTextBox2 Text="{Binding SelectedItem.sName, ElementName=MachiningCombo, UpdateSourceTrigger=Explicit}" Visibility="{Binding Name_Visibility}"
ExplicitUpdateSource="EnterKeyPressOrLostFocus" Style="{StaticResource OptionTextBox}"/>
IsExplicitFocused="{Binding UserShouldEditValueNow}"
Visibility="{Binding Name_Visibility}"
Margin="2.5,0,2.5,0"
Style="{StaticResource OptionTextBox2}"/>
<Button Grid.Column="1" <Button Grid.Column="1"
Command="{Binding EditName_Command}" Command="{Binding EditName_Command}"
ToolTip="{Binding EditName_ToolTip}"
Margin="2.5,0,2.5,0"
Style="{StaticResource ToolBar_Button}"> Style="{StaticResource ToolBar_Button}">
<Image Source="/Resources/MachiningDB/Edit.png" <Image Source="/Resources/TopPanel/Edit.png"/>
Style="{StaticResource Button_Image}"/>
</Button> </Button>
</Grid> </Grid>
<ScrollViewer Grid.Row="2" <ScrollViewer Grid.Row="3"
IsEnabled="{Binding IsEnabled}"
VerticalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto"
HorizontalScrollBarVisibility="Disabled" HorizontalScrollBarVisibility="Disabled">
Margin="1,0,0,2.5" <ItemsControl Grid.Row="1"
Padding="0" ItemsSource="{Binding SelectedItem.CathegoryList, ElementName=MachiningCombo}"
BorderThickness="0" IsEnabled="{Binding IsEnabled}">
Style="{StaticResource RightPanel_ScrollViewer}">
<ItemsControl ItemsSource="{Binding SelectedItem.CathegoryList, ElementName=MachiningCombo}"
BorderThickness="0"
Margin="0"
Padding="0">
<ItemsControl.ItemsPanel> <ItemsControl.ItemsPanel>
<ItemsPanelTemplate> <ItemsPanelTemplate>
<StackPanel Orientation="Vertical" <StackPanel Orientation="Vertical"/>
Margin="0"/>
</ItemsPanelTemplate> </ItemsPanelTemplate>
</ItemsControl.ItemsPanel> </ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate> <ItemsControl.ItemTemplate>
@@ -122,121 +88,131 @@
<Expander Header="{Binding sName}" <Expander Header="{Binding sName}"
IsExpanded="{Binding Cathegory_IsExpanded}" IsExpanded="{Binding Cathegory_IsExpanded}"
VerticalContentAlignment="Top"> VerticalContentAlignment="Top">
<ItemsControl ItemsSource="{Binding MachiningParamList}" <ItemsControl ItemsSource="{Binding MachiningParamList}">
BorderThickness="0"
Margin="0"
Padding="0">
<ItemsControl.ItemsPanel> <ItemsControl.ItemsPanel>
<ItemsPanelTemplate> <ItemsPanelTemplate>
<StackPanel Orientation="Vertical" <StackPanel Orientation="Vertical"/>
Margin="0"/>
</ItemsPanelTemplate> </ItemsPanelTemplate>
</ItemsControl.ItemsPanel> </ItemsControl.ItemsPanel>
<ItemsControl.Resources> <ItemsControl.Resources>
<DataTemplate DataType="{x:Type PrintApp:NumericMachiningParam}"> <DataTemplate DataType="{x:Type PrintApp:NumericMachiningParam}">
<Grid Margin="0,1,2.5,1" <Grid>
IsEnabled="{Binding bIsActive}">
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
<ColumnDefinition Width="2*"/> <ColumnDefinition Width="2*"/>
<ColumnDefinition Width="1*"/> <ColumnDefinition Width="1*"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<TextBlock Text="{Binding sName}" <TextBlock Text="{Binding sName}"/>
Margin="0,0,2.5,0" <TextBox Grid.Column="1"
Style="{StaticResource ParameterList_TextBlock}"/> Text="{Binding sValue}"/>
<EgtWPFLib5:EgtTextBox2 Grid.Column="1" <!--<Button Grid.Column="2"
Text="{Binding sValue, UpdateSourceTrigger=Explicit}" Content="R"
Margin="2.5,0,0,0" Command="{Binding ResetParam_Command}"
Style="{StaticResource ParameterList_TextBox2}"/> CommandParameter="dCurrStrandH"
IsEnabled="{Binding bCurrStrandH_IsModified}"
VerticalContentAlignment="Center"
HorizontalContentAlignment="Center"
Margin="5,0,0,0"
Style="{StaticResource ToolBar_SmallButton}"/>-->
</Grid> </Grid>
</DataTemplate> </DataTemplate>
<DataTemplate DataType="{x:Type PrintApp:ComboMachiningParam}"> <DataTemplate DataType="{x:Type PrintApp:ComboMachiningParam}">
<Grid Margin="0,1,2.5,1" <Grid>
IsEnabled="{Binding bIsActive}">
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
<ColumnDefinition Width="2*"/>
<ColumnDefinition Width="1*"/> <ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/> <!--<ColumnDefinition Width="Auto"/>-->
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<TextBlock Text="{Binding sName}" <TextBlock Text="{Binding sName}"/>
Margin="0,0,2.5,0"
Style="{StaticResource ParameterList_TextBlock}"/>
<ComboBox Grid.Column="1" <ComboBox Grid.Column="1"
ItemsSource="{Binding ValueList}" ItemsSource="{Binding ValueList}"
SelectedItem="{Binding SelValue}" SelectedItem="{Binding SelValue}"
HorizontalAlignment="Stretch" HorizontalAlignment="Stretch"/>
Margin="2.5,0,0,0" <!--<Button Grid.Column="1"
Style="{StaticResource RightPanel_ComboBox}"/> Content="R"
Command="{Binding ResetParam_Command}"
CommandParameter="dCurrStrandH"
IsEnabled="{Binding bCurrStrandH_IsModified}"
VerticalContentAlignment="Center"
HorizontalContentAlignment="Center"
Margin="5,0,0,0"
Style="{StaticResource ToolBar_SmallButton}"/>-->
</Grid> </Grid>
</DataTemplate> </DataTemplate>
<DataTemplate DataType="{x:Type PrintApp:CheckMachiningParam}"> <DataTemplate DataType="{x:Type PrintApp:CheckMachiningParam}">
<Grid Height="22" <Grid>
Margin="0,1,2.5,1"
IsEnabled="{Binding bIsActive}">
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
<ColumnDefinition Width="2*"/> <ColumnDefinition Width="2*"/>
<ColumnDefinition Width="1*"/> <ColumnDefinition Width="1*"/>
<!--<ColumnDefinition Width="Auto"/>-->
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<TextBlock Text="{Binding sName}" <TextBlock Text="{Binding sName}"/>
Margin="0,0,2.5,0"
Style="{StaticResource ParameterList_TextBlock}"/>
<CheckBox Grid.Column="1" <CheckBox Grid.Column="1"
IsChecked="{Binding bValue}" IsChecked="{Binding bValue}"
HorizontalAlignment="Center" HorizontalAlignment="Center"
VerticalAlignment="Center" VerticalAlignment="Center"/>
Margin="2.5,0,0,0"/> <!--<Button Grid.Column="1"
Content="R"
Command="{Binding ResetParam_Command}"
CommandParameter="dCurrStrandH"
IsEnabled="{Binding bCurrStrandH_IsModified}"
VerticalContentAlignment="Center"
HorizontalContentAlignment="Center"
Margin="5,0,0,0"
Style="{StaticResource ToolBar_SmallButton}"/>-->
</Grid> </Grid>
</DataTemplate> </DataTemplate>
<DataTemplate DataType="{x:Type PrintApp:MaterialMachiningParam}"> <DataTemplate DataType="{x:Type PrintApp:MaterialMachiningParam}">
<Grid Height="22" <Grid>
Margin="0,1,2.5,1">
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
<ColumnDefinition Width="2*"/> <ColumnDefinition Width="2*"/>
<ColumnDefinition Width="1*"/> <ColumnDefinition Width="1*"/>
<!--<ColumnDefinition Width="Auto"/>-->
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<TextBlock Text="{Binding sName}" <TextBlock Text="{Binding sName}"/>
Margin="0,0,2.5,0"
Style="{StaticResource ParameterList_TextBlock}"/>
<CheckBox Grid.Column="1" <CheckBox Grid.Column="1"
IsChecked="{Binding bValue}" IsChecked="{Binding bValue}"
HorizontalAlignment="Center" HorizontalAlignment="Center"
VerticalAlignment="Center" VerticalAlignment="Center"/>
Margin="2.5,0,0,0"/> <!--<Button Grid.Column="1"
Content="R"
Command="{Binding ResetParam_Command}"
CommandParameter="dCurrStrandH"
IsEnabled="{Binding bCurrStrandH_IsModified}"
VerticalContentAlignment="Center"
HorizontalContentAlignment="Center"
Margin="5,0,0,0"
Style="{StaticResource ToolBar_SmallButton}"/>-->
</Grid> </Grid>
</DataTemplate> </DataTemplate>
<DataTemplate DataType="{x:Type PrintApp:OrderedMachiningParam}"> <DataTemplate DataType="{x:Type PrintApp:OrderedMachiningParam}">
<Grid Margin="0,1,2.5,1"> <Grid>
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/> <ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/> <ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<TextBlock Text="{Binding sName}" <Grid.RowDefinitions>
Margin="0,0,2.5,0" <RowDefinition Height="Auto"/>
Style="{StaticResource ParameterList_TextBlock}"/> <RowDefinition Height="Auto"/>
<Grid Grid.Column="1"> </Grid.RowDefinitions>
<Grid.ColumnDefinitions> <TextBlock Text="{Binding sName}"/>
<ColumnDefinition Width="1*"/> <StackPanel Grid.Column="1"
<ColumnDefinition Width="Auto"/> Orientation="Horizontal"
</Grid.ColumnDefinitions> HorizontalAlignment="Right">
<ListBox ItemsSource="{Binding ValueList}" <Button Content="&lt;>"
SelectedItem="{Binding SelValue}" Command="{Binding ResetOrder_Command}"
Margin="2.5,0,2.5,0"/> Style="{StaticResource ToolBar_SmallButton}"/>
<StackPanel Grid.Column="1" <Button Content="˄"
Orientation="Vertical" Command="{Binding MoveUpOrder_Command}"
VerticalAlignment="Center" Style="{StaticResource ToolBar_SmallButton}"/>
Margin="2.5,0,0,0"> <Button Content="˅"
<Button Content="˄" Command="{Binding MoveDownOrder_Command}"
Command="{Binding MoveUpOrder_Command}" Style="{StaticResource ToolBar_SmallButton}"/>
Margin="0,0,0,2.5" </StackPanel>
Style="{StaticResource ToolBar_SmallButton}"/> <ListBox Grid.ColumnSpan="2"
<Button Content="˅" Grid.Row="1"
Command="{Binding MoveDownOrder_Command}" ItemsSource="{Binding ValueList}"
Margin="0,2.5,0,2.5" SelectedItem="{Binding SelValue}"/>
Style="{StaticResource ToolBar_SmallButton}"/>
<Button Content="&lt;>"
Command="{Binding ResetOrder_Command}"
Margin="0,2.5,0,0"
Style="{StaticResource ToolBar_SmallButton}"/>
</StackPanel>
</Grid>
</Grid> </Grid>
</DataTemplate> </DataTemplate>
</ItemsControl.Resources> </ItemsControl.Resources>
@@ -246,14 +222,12 @@
</ItemsControl.ItemTemplate> </ItemsControl.ItemTemplate>
</ItemsControl> </ItemsControl>
</ScrollViewer> </ScrollViewer>
<Button Grid.Row="3" <UniformGrid Grid.Row="4" Rows="1">
Command="{Binding Ok_Command}" <Button Content="Ok"
IsEnabled="{Binding IsEnabled}" Command="{Binding Ok_Command}"
Margin="0,2.5,0,0" IsEnabled="{Binding IsEnabled}"
Style="{StaticResource RightPanel_HalfRound_Button}"> Style="{StaticResource ToolBar_TextButton}"/>
<Image Source="\Resources\Common\Ok.png" </UniformGrid>
Style="{StaticResource Button_Image}"/>
</Button>
</Grid> </Grid>
</Border> </Border>
</Grid> </UserControl>
+10 -36
View File
@@ -26,8 +26,7 @@ Public Class MachiningDbVM
' verifico se modificato ' verifico se modificato
If m_SelMachining.bIsModified Then If m_SelMachining.bIsModified Then
' chiedo se salvare ' chiedo se salvare
Select Case EgtMessageBoxV.Show(Application.Current.MainWindow, "Do you want to save the modification done on the selected machining?", "Info", MessageBoxButton.YesNoCancel, MessageBoxImage.Question) Select Case MessageBox.Show("Do you want to save the modification done on the selected machining?", "Info", MessageBoxButton.YesNoCancel, MessageBoxImage.Question)
'MessageBox.Show("Do you want to save the modification done on the selected machining?", "Info", MessageBoxButton.YesNoCancel, MessageBoxImage.Question)
Case MessageBoxResult.Yes Case MessageBoxResult.Yes
m_SelMachining.Save() m_SelMachining.Save()
Case MessageBoxResult.No Case MessageBoxResult.No
@@ -113,28 +112,6 @@ Public Class MachiningDbVM
End Get End Get
End Property End Property
#Region "Tooltip"
Public ReadOnly Property Import_ToolTip As String
Get
Return "Import"
End Get
End Property
Public ReadOnly Property Export_ToolTip As String
Get
Return "Export"
End Get
End Property
Public ReadOnly Property EditName_ToolTip As String
Get
Return "Edit Name"
End Get
End Property
#End Region ' Tooltip
' Definizione comandi ' Definizione comandi
Private m_cmdOk As ICommand Private m_cmdOk As ICommand
Private m_cmdNew As ICommand Private m_cmdNew As ICommand
@@ -199,8 +176,7 @@ Public Class MachiningDbVM
Public Sub Ok() Public Sub Ok()
If Not IsNothing(m_SelMachining) AndAlso m_SelMachining.bIsModified Then If Not IsNothing(m_SelMachining) AndAlso m_SelMachining.bIsModified Then
' chiedo se salvare ' chiedo se salvare
Select Case EgtMessageBoxV.Show(Application.Current.MainWindow, "Do you want to save modified parameters?", "Warning", MessageBoxButton.YesNoCancel, MessageBoxImage.Warning) Select Case MessageBox.Show("Do you want to save modified parameters?", "Warning", MessageBoxButton.YesNoCancel, MessageBoxImage.Warning)
'MessageBox.Show("Do you want to save modified parameters?", "Warning", MessageBoxButton.YesNoCancel, MessageBoxImage.Warning)
Case MessageBoxResult.Yes Case MessageBoxResult.Yes
m_SelMachining.Save() m_SelMachining.Save()
Case MessageBoxResult.No Case MessageBoxResult.No
@@ -311,14 +287,10 @@ Public Class MachiningDbVM
Public Sub Delete() Public Sub Delete()
If IsNothing(m_SelMachining) Then Return If IsNothing(m_SelMachining) Then Return
' chiedo conferma ' chiedo conferma
Select Case EgtMessageBoxV.Show(Application.Current.MainWindow, "Are you sure you want to delete the selected machining?", "Warning", MessageBoxButton.YesNo, MessageBoxImage.Warning) Select Case MessageBox.Show("Are you sure you want to delete the selected machining?", "Warning", MessageBoxButton.YesNo, MessageBoxImage.Warning)
'MessageBox.Show("Are you sure you want to delete the selected machining?", "Warning", MessageBoxButton.YesNo, MessageBoxImage.Warning)
Case MessageBoxResult.Yes Case MessageBoxResult.Yes
m_MachiningList.Remove(m_SelMachining) m_MachiningList.Remove(m_SelMachining)
SetIsModified(True) SetIsModified(True)
If m_MachiningList.Count > 0 Then
SelMachining = m_MachiningList(0)
End If
Case MessageBoxResult.No Case MessageBoxResult.No
Return Return
End Select End Select
@@ -358,11 +330,13 @@ Public Class MachiningDbVM
Public Sub Import() Public Sub Import()
' chiedo il nome del file .data da aprire ' chiedo il nome del file .data da aprire
Dim OpenFileDlg As New System.Windows.Forms.OpenFileDialog() With {.Title = EgtMsg(31451) & " " & EgtMsg(31452), Dim OpenFileDlg As New System.Windows.Forms.OpenFileDialog() With {
.Filter = "File data (*" & ImportExportMachiningPanelVM.MachiningDataExtension & ")|*" & ImportExportMachiningPanelVM.MachiningDataExtension, .Title = EgtMsg(31451) & " " & EgtMsg(31452),
.FileName = String.Empty} .Filter = "File data (*.data)|*.data|Tutti i file (*.*)|*.*",
.FileName = String.Empty
}
If OpenFileDlg.ShowDialog() <> System.Windows.Forms.DialogResult.OK Then Return If OpenFileDlg.ShowDialog() <> System.Windows.Forms.DialogResult.OK Then Return
Dim ImportWindow As New ImportExportMachiningPanelV(Application.Current.MainWindow, New ImportExportMachiningPanelVM(ImportExportMachiningPanelVM.WindowTypeEnum.MACHINING, ImportExportMachiningPanelVM.WindowModeEnum.IMPORT, OpenFileDlg.FileName)) Dim ImportWindow As New ImportExportMachiningPanelV(Application.Current.MainWindow, New ImportExportMachiningPanelVM(OpenFileDlg.FileName))
ImportWindow.ShowDialog() ImportWindow.ShowDialog()
End Sub End Sub
@@ -380,7 +354,7 @@ Public Class MachiningDbVM
End Property End Property
Public Sub Export() Public Sub Export()
Dim ExportWindow As New ImportExportMachiningPanelV(Application.Current.MainWindow, New ImportExportMachiningPanelVM(ImportExportMachiningPanelVM.WindowTypeEnum.MACHINING, ImportExportMachiningPanelVM.WindowModeEnum.EXPORT)) Dim ExportWindow As New ImportExportMachiningPanelV(Application.Current.MainWindow, New ImportExportMachiningPanelVM)
ExportWindow.ShowDialog() ExportWindow.ShowDialog()
End Sub End Sub
+2 -2
View File
@@ -195,8 +195,8 @@ Public Class MainWindowM
' Verifico abilitazione nesting automatico ' Verifico abilitazione nesting automatico
m_bAutoNestOption = Not String.IsNullOrWhiteSpace(sNestKey) m_bAutoNestOption = Not String.IsNullOrWhiteSpace(sNestKey)
' Recupero livello e opzioni della chiave ' Recupero livello e opzioni della chiave
Dim bKey As Boolean = EgtGetKeyLevel(5583, 2505, 1, m_nKeyLevel) And Dim bKey As Boolean = EgtGetKeyLevel(5583, 2501, 1, m_nKeyLevel) And
EgtGetKeyOptions(5583, 2505, 1, m_nKeyOptions) EgtGetKeyOptions(5583, 2501, 1, m_nKeyOptions)
' Inizializzazione generale di EgtInterface ' Inizializzazione generale di EgtInterface
m_nDebug = GetMainPrivateProfileInt(S_GENERAL, K_DEBUG, 0) m_nDebug = GetMainPrivateProfileInt(S_GENERAL, K_DEBUG, 0)
m_sLogFile = m_sTempDir & "\" & GENLOG_FILE_NAME.Replace("#", m_nInstance.ToString()) m_sLogFile = m_sTempDir & "\" & GENLOG_FILE_NAME.Replace("#", m_nInstance.ToString())
+28 -17
View File
@@ -1,21 +1,32 @@
<EgtWPFLib5:EgtMainWindow x:Class="MainWindowV" <EgtWPFLib5:EgtCustomWindow x:Class="MainWindowV"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:EgtWPFLib5="clr-namespace:EgtWPFLib5;assembly=EgtWPFLib5" xmlns:EgtWPFLib5="clr-namespace:EgtWPFLib5;assembly=EgtWPFLib5"
xmlns:PrintApp="clr-namespace:Icarus" xmlns:PrintApp="clr-namespace:Icarus"
MinHeight="600" MinWidth="800" Style="{DynamicResource {x:Type EgtWPFLib5:EgtCustomWindow}}"
AllowDrop="True" Title="{Binding sTitle}" Icon="/Resources/Icarus.ico"
Drop="MainWindowV_Drop" MinHeight="600" MinWidth="800" WindowStyle="None" ResizeMode="NoResize"
ShowInTaskbar="True" AllowDrop="True" Drop="MainWindowV_Drop"
Topmost="False" ShowInTaskbar="True"
Style="{StaticResource NoStyle_Window}"> Topmost="False"
CloseCommand="{Binding CloseApplicationCommand,Mode=OneWay,UpdateSourceTrigger=PropertyChanged}">
<!--<EgtWPFLib5:EgtCustomWindow.TitlePanel>
<PrintApp:ProjManagerV DataContext="{StaticResource ProjManagerVM}"/>
</EgtWPFLib5:EgtCustomWindow.TitlePanel>-->
<Grid> <Grid>
<Grid.RowDefinitions> <PrintApp:SceneHostV/>
<RowDefinition Height="60"/>
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
<PrintApp:SceneHostV Grid.Row="1"/>
</Grid> </Grid>
<!--Pannello principale --><!--
<DockPanel>
</EgtWPFLib5:EgtMainWindow> --><!--StatusBar --><!--
<PrintApp:StatusBarV DataContext="{StaticResource StatusBarVM}"
DockPanel.Dock="Bottom"/>
<PrintApp:ProjectV DataContext="{StaticResource ProjectVM}"/>
</DockPanel>-->
</EgtWPFLib5:EgtCustomWindow>
+3 -16
View File
@@ -5,6 +5,7 @@ Imports System.Windows.Interop
Class MainWindowV Class MainWindowV
Private m_MainWindowVM As MainWindowVM Private m_MainWindowVM As MainWindowVM
Private m_SceneHostWnd As SecondaryWindowV
#Region "CONSTRUCTOR" #Region "CONSTRUCTOR"
@@ -19,8 +20,6 @@ Class MainWindowV
AddHandler Me.Closing, AddressOf MainWindowV_Closing AddHandler Me.Closing, AddressOf MainWindowV_Closing
AddHandler Me.KeyDown, AddressOf MainWindowV_KeyDown AddHandler Me.KeyDown, AddressOf MainWindowV_KeyDown
AddHandler Me.StateChanged, AddressOf MainWindowV_StateChanged AddHandler Me.StateChanged, AddressOf MainWindowV_StateChanged
'AddHandler Me.LocationChanged, AddressOf MainWindowV_LocationChanged
'AddHandler Me.SizeChanged, AddressOf MainWindowV_SizeChanged
End Sub End Sub
#End Region ' CONSTRUCTOR #End Region ' CONSTRUCTOR
@@ -61,27 +60,15 @@ Class MainWindowV
Me.Activate() Me.Activate()
' Recupero l'array di stringhe con i nomi del file ' Recupero l'array di stringhe con i nomi del file
Dim sFiles() As String = DirectCast(e.Data.GetData(DataFormats.FileDrop), String()) Dim sFiles() As String = DirectCast(e.Data.GetData(DataFormats.FileDrop), String())
End If
End Sub
Private Sub MainWindowV_LocationChanged(sender As Object, e As EventArgs)
If Not IsNothing(Map.refSecondaryWindowV) Then
Map.refSecondaryWindowV.Top = Me.Top
Map.refSecondaryWindowV.Left = Me.Left
End If
End Sub
Private Sub MainWindowV_SizeChanged(sender As Object, e As SizeChangedEventArgs)
If Not IsNothing(Map.refSecondaryWindowV) Then
If e.WidthChanged Then Map.refSecondaryWindowV.Width = e.NewSize.Width
If e.HeightChanged Then Map.refSecondaryWindowV.Height = e.NewSize.Height
Map.refSecondaryWindowV.InvalidateVisual()
End If End If
End Sub End Sub
Private Sub MainWindowV_StateChanged(sender As Object, e As EventArgs) Private Sub MainWindowV_StateChanged(sender As Object, e As EventArgs)
If Not IsNothing(Map.refSecondaryWindowV) AndAlso Not Map.refSecondaryWindowV.WindowChangingState Then If Not IsNothing(Map.refSecondaryWindowV) AndAlso Not Map.refSecondaryWindowV.WindowChangingState Then
Map.refSecondaryWindowV.WindowState = Me.WindowState Map.refSecondaryWindowV.WindowState = Me.WindowState
'Application.Current.MainWindow.Topmost = True
'Application.Current.MainWindow.Topmost = False
End If End If
End Sub End Sub
+151 -88
View File
@@ -7,6 +7,9 @@ Imports System.Windows.Threading
Public Class MainWindowVM Public Class MainWindowVM
Inherits VMBase Inherits VMBase
Private m_SupervisorCommThread As Thread
Private m_Supervisor_Timer As New DispatcherTimer
' Riferimento al Model della MainWindow ' Riferimento al Model della MainWindow
Private m_MainWindowM As MainWindowM Private m_MainWindowM As MainWindowM
Friend ReadOnly Property MainWindowM As MainWindowM Friend ReadOnly Property MainWindowM As MainWindowM
@@ -15,9 +18,6 @@ Public Class MainWindowVM
End Get End Get
End Property End Property
' Funzioni di callback per output in interfaccia da LUA
Private m_ProcEventsCallback As New ProcessEventsCallback(AddressOf ProcessEvents)
' Variabile che indica che il programma è stato avviato correttamente (sia la mappa che l'ambiente Egt) ' Variabile che indica che il programma è stato avviato correttamente (sia la mappa che l'ambiente Egt)
Private m_bInitStatus As Boolean Private m_bInitStatus As Boolean
Friend ReadOnly Property bInitStatus As Boolean Friend ReadOnly Property bInitStatus As Boolean
@@ -27,34 +27,25 @@ Public Class MainWindowVM
End Property End Property
' Titolo ' Titolo
Public ReadOnly Property sTitle As String Private m_sTitle As String
Public Property sTitle As String
Get Get
Return "Icarus" Return m_sTitle
End Get End Get
Set(value As String)
m_sTitle = value
NotifyPropertyChanged(NameOf(sTitle))
End Set
End Property End Property
Public ReadOnly Property sProjectName As String ' proprietà che seleziona la giusta pagina del TabControl
Public Property nSelTabPage As Integer
Get Get
Dim sFilePath As String = "" ' Return If(IsNothing(Map.refMainMenuVM.SelPage) OrElse Map.refMainMenuVM.SelPage = -1 OrElse Map.refMainMenuVM.SelPage = Pages.VIEW OrElse Map.refMainMenuVM.SelPage = Pages.MACHINING, 0, 1)
EgtGetCurrFilePath(sFilePath) Return -1
If String.IsNullOrEmpty(sFilePath) Then
sFilePath = EgtMsg(MSG_TOPCOMMANDBAR + 1) & Map.refMainWindowVM.MainWindowM.nInstance.ToString()
Return sFilePath
Else
Return Path.GetFileNameWithoutExtension(sFilePath) & If(EgtGetModified(), "*", "")
End If
End Get
End Property
Public ReadOnly Property sProjectPath As String
Get
Dim sFilePath As String = ""
EgtGetCurrFilePath(sFilePath)
If String.IsNullOrEmpty(sFilePath) Then
sFilePath = EgtMsg(MSG_TOPCOMMANDBAR + 1) & Map.refMainWindowVM.MainWindowM.nInstance.ToString()
End If
Return sFilePath
End Get End Get
Set(value As Integer)
End Set
End Property End Property
Private m_MachinePanelVM As MachinePanelVM Private m_MachinePanelVM As MachinePanelVM
@@ -64,6 +55,9 @@ Public Class MainWindowVM
End Get End Get
End Property End Property
'Friend m_SupervisorStop As Boolean = False
'Private BlockedWnd As BlockedWndV
' definizione comandi ' definizione comandi
Private m_cmdAboutBox As ICommand Private m_cmdAboutBox As ICommand
Private m_cmdCloseApplication As ICommand Private m_cmdCloseApplication As ICommand
@@ -77,18 +71,117 @@ Public Class MainWindowVM
m_MainWindowM = New MainWindowM m_MainWindowM = New MainWindowM
' inizializzo machine panel ' inizializzo machine panel
m_MachinePanelVM = New MachinePanelVM m_MachinePanelVM = New MachinePanelVM
' Installo funzione gestione eventi per lua ' inizializzo contatore per blocco da supervisore
EgtSetProcessEvents(m_ProcEventsCallback) m_Supervisor_Timer.Interval = TimeSpan.FromMilliseconds(500)
' AddHandler m_Supervisor_Timer.Tick, AddressOf SupervisorTimer_Tick
m_Supervisor_Timer.Start()
End Sub End Sub
#End Region ' CONSTRUCTOR #End Region ' CONSTRUCTOR
'#Region "METHODS" '#Region "METHODS"
Friend Sub SetTitle(sTitle As String)
m_sTitle = sTitle
NotifyPropertyChanged(NameOf(sTitle))
' aggiorno titolo nella secondaryPage che e' quello che si vede nella barra in alto
Map.refSecondaryWindowVM.SetTitle(sTitle)
End Sub
'Public Sub UpdateTitle()
' m_Title = ""
' Select Case Map.refMainMenuVM.SelPage
' Case Pages.VIEW
' If Not IsNothing(Map.refProjManagerVM.CurrProj) Then
' If Map.refProjManagerVM.CurrProj.bIsNew Then m_Title = "New - "
' m_Title &= Map.refProjManagerVM.CurrProj.nProjId.ToString("0000") & " - " & Map.refProjManagerVM.CurrProj.sBTLFileName
' End If
' Case Pages.MACHINING
' If Not IsNothing(Map.refProdManagerVM.CurrProd) Then
' If Map.refProdManagerVM.CurrProd.bIsNew Then m_Title = "New - "
' m_Title &= Map.refProdManagerVM.CurrProd.nProdId.ToString("0000") & " - " & Map.refProdManagerVM.CurrProd.sBTLFileName
' End If
' Case Pages.CONFIG
' m_Title = "Configuration Page"
' End Select
' m_Title &= " - EgtBEAMWALL"
' NotifyPropertyChanged(NameOf(Title))
'End Sub
Friend Sub ContentRendered() Friend Sub ContentRendered()
'DbControllers.Init()
'' chiamata a caso su Db per inizializzarlo
'DbControllers.m_ProjController.FindByProjDbId(0)
'' Verifico che l'inizializzazione di tutte le parti del programma sia andata a buon fine
'If Map.EndInit() Then
' m_bInitStatus = True
' ' altrimenti chiudo il programma
'Else
' m_bInitStatus = False
'End If
'' Aggiorno visualizzazione unità di misura
''Map.refStatusBarVM.SetMeasureUnit(If(EgtUiUnitsAreMM(), MeasureUnitOpt.MM, MeasureUnitOpt.INCH))
'' imposto MainWindow per finestra di Loading
'LoadingWndHelper.SetMainWindow(Application.Current.MainWindow)
'' leggo riga di comando
'Dim nCommandType As Integer = 0
'Dim nPage As Pages = Pages.VIEW
'Dim nProdId As Integer = 0
'If ProcessCommandLine(nCommandType, nPage, nProdId) Then
' Select Case nCommandType
' Case 1
' Map.refProdManagerVM.SetCurrProd(nProdId)
' Case 2
' ' pagina gia' impostata nella variabile
' End Select
'Else
' ' setto il primo file dalla lista degli MRU come progetto corrente da aprire
' Dim sLastProjectPath As String = String.Empty
' GetMainPrivateProfileString(S_MRUPROJFILES, K_FILE & "1", String.Empty, sLastProjectPath)
' If Not String.IsNullOrWhiteSpace(sLastProjectPath) AndAlso File.Exists(sLastProjectPath) Then
' ' ricavo l'Id e il progetto associato per l'apertura di quest'ultimo
' Dim PjId As Integer = 0
' Dim sPjId As String = Path.GetFileNameWithoutExtension(sLastProjectPath)
' Integer.TryParse(sPjId, PjId)
' Map.refProjManagerVM.SetCurrProj(PjId)
' End If
'End If
'' seleziono pagina da aprire
'Map.refMainMenuVM.SelPage = nPage
'' inizializzo thread di aggiornamento e comunicazione con DB
'' creo thread gestione macchina
'm_SupervisorCommThread = New Thread(Sub()
' SupervisorCommThread.SupervisorCommThreadFunction()
' End Sub)
'm_SupervisorCommThread.SetApartmentState(ApartmentState.STA)
'' avvio thread di gestione della macchina che avvia la connessione
'm_SupervisorCommThread.Start()
End Sub End Sub
' Friend Function ProcessCommandLine(ByRef nCommandType As Integer, ByRef nPage As Pages, ByRef nProdId As Integer) As Boolean
' ' Se non ci sono veri parametri su linea di comando, esco (il primo è sempre il nome del programma)
' If Environment.GetCommandLineArgs.Count() <= 1 Then Return False
' ' Recupero primo parametro che dovrebbe essere il tipo di modalita' riga di comando
' Dim sFile As String = Environment.GetCommandLineArgs(1)
' If String.IsNullOrWhiteSpace(sFile) OrElse Not Integer.TryParse(sFile, nCommandType) OrElse nCommandType <= 0 Then Return False
' Select Case nCommandType
' Case 1 ' apri progetto in ottimizzatore
' ' recupero secondo parametro
' Dim sProdId As String = Environment.GetCommandLineArgs(2)
' If Not Integer.TryParse(sProdId, nProdId) OrElse nProdId <= 0 Then Return False
' nPage = Pages.MACHINING
' Return True
' Case 2 ' apri pagina specifica senza progetto specifico
' ' recupero secondo parametro
' Dim sPage As String = Environment.GetCommandLineArgs(2)
' If Not Integer.TryParse(sPage, nPage) OrElse (nPage <> Pages.VIEW AndAlso nPage <> Pages.MACHINING) Then Return False
' Return True
' End Select
' Return False
' End Function
Friend Sub KeyDown(PressedKey As Key) Friend Sub KeyDown(PressedKey As Key)
' Con ESC esco dall'azione corrente ' Con ESC esco dall'azione corrente
If PressedKey = Key.Escape Then If PressedKey = Key.Escape Then
@@ -147,25 +240,40 @@ Public Class MainWindowVM
End If End If
End Sub End Sub
Private Function ProcessEvents(ByVal nProg As Integer, ByVal nPause As Integer) As Integer ' Friend m_ManagingSupervisorStop As Boolean = False
If Map.refSliceManagerVM.bCalculating OrElse Map.refSliceManagerVM.bCalcSolid Then
Map.refSliceManagerVM.ProcessEvents(nProg, nPause)
End If
If Not IsNothing(Map.refImportLoadingWndVM) Then
Map.refImportLoadingWndVM.ProcessEvents(nProg, nPause)
End If
Map.refMyStatusBarVM.ProcessEvents(nProg, nPause)
Return 0
End Function
' Private Sub SupervisorTimer_Tick()
' If SupervisorCommThread.bViewerOptimizerBlocked And Not m_ManagingSupervisorStop Then
' m_ManagingSupervisorStop = True
' BlockedWnd = New BlockedWndV(Application.Current.MainWindow, New BlockedWndVM)
' BlockedWnd.ShowDialog()
' ElseIf Not SupervisorCommThread.bViewerOptimizerBlocked And m_ManagingSupervisorStop Then
' m_ManagingSupervisorStop = False
' BlockedWnd.Close()
' End If
' End Sub
'#End Region ' METHODS
'#Region "COMMANDS"
'#Region "CloseApplicationCommand"
' ' Returns a command that manage the MainWindow_Unloaded command
' Public ReadOnly Property CloseApplicationCommand() As ICommand
' Get
' If m_cmdCloseApplication Is Nothing Then
' m_cmdCloseApplication = New Command(AddressOf CloseApplication)
' End If
' Return m_cmdCloseApplication
' End Get
' End Property
' Manage the MainWindow_Unloaded event. This method is invoked by the cmdMainWindow_Unloaded.
Friend Sub CloseApplication() Friend Sub CloseApplication()
If (Keyboard.Modifiers And ModifierKeys.Alt) = ModifierKeys.Alt OrElse Keyboard.IsKeyDown(Key.F4) Then If (Keyboard.Modifiers And ModifierKeys.Alt) = ModifierKeys.Alt OrElse Keyboard.IsKeyDown(Key.F4) Then
Return Return
End If End If
' gestisco la chiusura della simulazione
If Map.refRightPanelVM.SelPanel = RightPanelVM.Panels.SIMULATION AndAlso Not IsNothing(Map.refSimulationPanelVM) Then
Map.refSimulationPanelVM.MySimul.ResetSimulation()
End If
' Gestisco eventuale file corrente modificato ' Gestisco eventuale file corrente modificato
Dim bOk As Boolean = True Dim bOk As Boolean = True
'bOk = ProjFileVM.VerifyProjectModification(Map.refProjManagerVM.CurrProj, ProjectType.PROJ) 'bOk = ProjFileVM.VerifyProjectModification(Map.refProjManagerVM.CurrProj, ProjectType.PROJ)
@@ -188,53 +296,8 @@ Public Class MainWindowVM
Application.Current.Shutdown() Application.Current.Shutdown()
End Sub End Sub
#Region "COMMANDS" '#End Region ' CloseApplicationCommand
#Region "AboutBoxCommand" '#End Region ' COMMANDS
' Returns a command that manage the MainWindow_Unloaded command
Public ReadOnly Property AboutBoxCommand() As ICommand
Get
If m_cmdAboutBox Is Nothing Then
m_cmdAboutBox = New Command(AddressOf AboutBox)
End If
Return m_cmdAboutBox
End Get
End Property
' Manage the MainWindow_Unloaded event. This method is invoked by the cmdMainWindow_Unloaded.
Public Sub AboutBox(ByVal param As Object)
Dim AboutBoxWindow As New AboutBoxV
AboutBoxWindow.Owner = Application.Current.MainWindow
AboutBoxWindow.ShowDialog()
End Sub
#End Region ' AboutBoxCommand
#Region "CloseApplicationCommand"
' Returns a command that manage the MainWindow_Unloaded command
Public ReadOnly Property CloseApplicationCommand() As ICommand
Get
If m_cmdCloseApplication Is Nothing Then
m_cmdCloseApplication = New Command(AddressOf CloseApplication)
End If
Return m_cmdCloseApplication
End Get
End Property
' Manage the MainWindow_Unloaded event. This method is invoked by the cmdMainWindow_Unloaded.
Public Sub CloseApplication(ByVal param As Object)
If Map.refSliceManagerVM.bCalculating Then
'MessageBox.Show("Impossible closing software! Wait end of calculation!", "Error", MessageBoxButton.OK, MessageBoxImage.Error)
EgtMessageBoxV.Show(Application.Current.MainWindow, "Impossible closing software! Wait end of calculation!", "Error", MessageBoxButton.OK, MessageBoxImage.Error)
Return
End If
CloseApplication()
End Sub
#End Region ' CloseApplicationCommand
#End Region ' COMMANDS
End Class End Class
+133 -151
View File
@@ -1,165 +1,147 @@
<Grid x:Class="ManagePartPanelV" <UserControl x:Class="ManagePartPanelV"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:Icarus" xmlns:local="clr-namespace:Icarus"
xmlns:EgtWPFLib5="clr-namespace:EgtWPFLib5;assembly=EgtWPFLib5" xmlns:EgtWPFLib5="clr-namespace:EgtWPFLib5;assembly=EgtWPFLib5"
Width="150" Width="150"
Margin="5,0,0,0"
VerticalAlignment="Stretch"> VerticalAlignment="Stretch">
<Grid.RowDefinitions> <Grid DockPanel.Dock="Left">
<RowDefinition Height="Auto"/> <Grid.RowDefinitions>
<RowDefinition Height="1*"/> <RowDefinition Height="Auto"/>
</Grid.RowDefinitions> <RowDefinition Height="Auto"/>
<Border Margin="0,0,0,2.5" <RowDefinition Height="2*"/>
Style="{StaticResource Title_Border}"> <RowDefinition Height="Auto"/>
<TextBlock Text="PART MANAGER" <RowDefinition Height="1*"/>
Style="{StaticResource Title_TextBlock}"/> <RowDefinition Height="Auto"/>
</Border> </Grid.RowDefinitions>
<Border Grid.Row="1" <Border Style="{StaticResource LeftPanelTitle_Border}">
Padding="0,2.5,0,0"
Margin="0,2.5,0,0"
Style="{StaticResource BottomGrayRow_Border}">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="2*"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<TextBlock Text="Part Entity List" <TextBlock Text="Part Entity List"
Margin="0,2.5,0,2.5" FontWeight="DemiBold"
Style="{StaticResource Title_TextBlock}"/> FontSize="14"/>
<TreeView x:Name="ManagerPartTreeView" </Border>
Grid.Row="1" <!--<UniformGrid Grid.Row="1" Rows="1"
ItemsSource="{Binding ManagerPartList}" IsEnabled="{Binding IsEnabled}">
MinHeight="200" <Button DockPanel.Dock="Left"
IsEnabled="{Binding IsEnabled}" Content="+"
Margin="0,2.5,0,2.5" FontSize="20"
FontSize="12" Command="{Binding AddPart_Command}"
Foreground="{StaticResource Icarus_Gray}"> Style="{StaticResource LeftPanel_Button}"/>
<TreeView.Resources> <Button DockPanel.Dock="Left"
<HierarchicalDataTemplate DataType="{x:Type local:ManagePart_Part}" Content="-"
ItemsSource="{Binding LayerList}"> FontSize="20"
<StackPanel Orientation="Horizontal"> Command="{Binding RemovePart_Command}"
<!--<Image Source="/Resources/TreeView/Folder.png" Style="{StaticResource LeftPanel_Button}"/>
Height="15"/>--> </UniformGrid>-->
<Grid> <TreeView Grid.Row="2"
<TextBlock Text="{Binding sName}" ItemsSource="{Binding ManagerPartList}"
Visibility="{Binding TextBlock_Visibility}" MinHeight="200"
Style="{StaticResource BaseTextBlock}"/> IsEnabled="{Binding IsEnabled}">
<EgtWPFLib5:EgtTextBox Text="{Binding sName, UpdateSourceTrigger=Explicit}" <TreeView.Resources>
IsExplicitFocused="{Binding UserShouldEditValueNow}" <HierarchicalDataTemplate DataType="{x:Type local:ManagePart_Part}"
Visibility="{Binding TextBox_Visibility}" ItemsSource="{Binding LayerList}">
Style="{StaticResource OptionTextBox}"/> <StackPanel Orientation="Horizontal">
</Grid> <Image Source="/Resources/TreeView/Folder.png"
</StackPanel> Height="15"/>
</HierarchicalDataTemplate>
<HierarchicalDataTemplate DataType="{x:Type local:ManagePart_Layer}"
ItemsSource="{Binding EntityList, UpdateSourceTrigger=PropertyChanged}">
<StackPanel Orientation="Horizontal">
<!--<Image Source="/Resources/TreeView/Folder.png"
Height="15"/>-->
<TextBlock Text="{Binding sName}"
Style="{StaticResource BaseTextBlock}"/>
</StackPanel>
</HierarchicalDataTemplate>
<HierarchicalDataTemplate DataType="{x:Type local:PartManager_GeomEntity}">
<Grid> <Grid>
<TextBlock Text="{Binding sName}" <TextBlock Text="{Binding sName}"
Style="{StaticResource BaseTextBlock}"/> Visibility="{Binding TextBlock_Visibility}"/>
<EgtWPFLib5:EgtTextBox Text="{Binding sName, UpdateSourceTrigger=Explicit}" <EgtWPFLib5:EgtTextBox Text="{Binding sName, UpdateSourceTrigger=Explicit}"
IsExplicitFocused="{Binding UserShouldEditValueNow}" IsExplicitFocused="{Binding UserShouldEditValueNow}"
Visibility="{Binding TextBox_Visibility}" Visibility="{Binding TextBox_Visibility}"
Style="{StaticResource OptionTextBox}"/> Style="{StaticResource OptionTextBox}"/>
</Grid> </Grid>
</HierarchicalDataTemplate> </StackPanel>
<!-- Menu' tasto destro --> </HierarchicalDataTemplate>
<ContextMenu x:Key="RowMenu" <HierarchicalDataTemplate DataType="{x:Type local:ManagePart_Layer}"
ItemsSource="{Binding MenuList}" ItemsSource="{Binding EntityList, UpdateSourceTrigger=PropertyChanged}">
Style="{StaticResource Icarus_ContextMenu}"> <StackPanel Orientation="Horizontal">
<ContextMenu.ItemContainerStyle> <Image Source="/Resources/TreeView/Folder.png"
<Style TargetType="MenuItem" BasedOn="{StaticResource Icarus_MenuItem}"> Height="15"/>
<Setter Property="Command" Value="{Binding MenuItem_Command}"/> <TextBlock Text="{Binding sName}" />
<Setter Property="Header" Value="{Binding sMsg}"/> </StackPanel>
</Style> </HierarchicalDataTemplate>
</ContextMenu.ItemContainerStyle> <HierarchicalDataTemplate DataType="{x:Type local:PartManager_GeomEntity}">
</ContextMenu> <Grid>
</TreeView.Resources> <TextBlock Text="{Binding sName}" />
<TreeView.ItemContainerStyle> <EgtWPFLib5:EgtTextBox Text="{Binding sName, UpdateSourceTrigger=Explicit}"
<Style TargetType="{x:Type TreeViewItem}" BasedOn="{StaticResource {x:Type TreeViewItem}}"> IsExplicitFocused="{Binding UserShouldEditValueNow}"
<Setter Property="IsSelected" Value="{Binding bIsSelected, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"/> Visibility="{Binding TextBox_Visibility}"
<Setter Property="IsExpanded" Value="True"/> Style="{StaticResource OptionTextBox}"/>
<Setter Property="ContextMenu" Value="{StaticResource RowMenu}"/> </Grid>
<Setter Property="ContextMenuService.Placement" Value="Right"/> </HierarchicalDataTemplate>
<EventSetter Event="ContextMenuOpening" Handler="Item_ContextMenuOpening"/> <!-- Menu' tasto destro -->
</Style> <ContextMenu x:Key="RowMenu" ItemsSource="{Binding MenuList}" >
</TreeView.ItemContainerStyle> <ContextMenu.ItemContainerStyle>
</TreeView> <Style TargetType="MenuItem">
<TextBlock Grid.Row="2" <Setter Property="Command" Value="{Binding MenuItem_Command}"/>
Text="Imported Entity List" <Setter Property="Header" Value="{Binding sMsg}"/>
Visibility="{Binding IsImport_Visibility}" </Style>
Margin="0,2.5,0,2.5" </ContextMenu.ItemContainerStyle>
Style="{StaticResource Title_TextBlock}"/> </ContextMenu>
<ListBox Grid.Row="3" </TreeView.Resources>
ItemsSource="{Binding ImportedEntityList, UpdateSourceTrigger=PropertyChanged}" <TreeView.ItemContainerStyle>
SelectedItem="{Binding SelImportedEntity}" <Style TargetType="{x:Type TreeViewItem}">
MinHeight="100" <Setter Property="IsSelected" Value="{Binding bIsSelected, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"/>
IsEnabled="{Binding IsEnabled}" <Setter Property="IsExpanded" Value="True"/>
Visibility="{Binding IsImport_Visibility}" <Setter Property="ContextMenu" Value="{StaticResource RowMenu}"/>
Margin="0,2.5,0,2.5"> <EventSetter Event="ContextMenuOpening" Handler="Item_ContextMenuOpening"/>
<ListBox.Resources> </Style>
<!-- Menu' tasto destro --> </TreeView.ItemContainerStyle>
<ContextMenu x:Key="RowMenu" </TreeView>
ItemsSource="{Binding MenuList}" <Border Grid.Row="3"
Style="{StaticResource Icarus_ContextMenu}"> Visibility="{Binding IsImport_Visibility}"
<ContextMenu.ItemContainerStyle> Style="{StaticResource LeftPanelTitle_Border}">
<Style TargetType="{x:Type MenuItem}" BasedOn="{StaticResource Icarus_MenuItem}"> <TextBlock Text="Imported Entity List"
<Setter Property="Command" Value="{Binding MenuItem_Command}"/> FontWeight="DemiBold"
<Setter Property="Header" Value="{Binding sMsg}"/> FontSize="14"/>
</Style> </Border>
</ContextMenu.ItemContainerStyle> <ListBox Grid.Row="4"
</ContextMenu> ItemsSource="{Binding ImportedEntityList, UpdateSourceTrigger=PropertyChanged}"
</ListBox.Resources> SelectedItem="{Binding SelImportedEntity}"
<ListBox.ItemContainerStyle> MinHeight="100"
<Style TargetType="ListBoxItem"> IsEnabled="{Binding IsEnabled}"
<Setter Property="HorizontalContentAlignment" Value="Stretch"/> Visibility="{Binding IsImport_Visibility}">
<Setter Property="ContextMenu" Value="{StaticResource RowMenu}" /> <ListBox.Resources>
<Setter Property="ContextMenuService.Placement" Value="Right" /> <!-- Menu' tasto destro -->
<Setter Property="ContextMenuService.VerticalOffset" Value="-3" /> <ContextMenu x:Key="RowMenu" ItemsSource="{Binding MenuList}" >
</Style> <ContextMenu.ItemContainerStyle>
</ListBox.ItemContainerStyle> <Style TargetType="MenuItem">
<ListBox.ItemTemplate> <Setter Property="Command" Value="{Binding MenuItem_Command}"/>
<DataTemplate> <Setter Property="Header" Value="{Binding sMsg}"/>
<Grid HorizontalAlignment="Stretch"> </Style>
<Grid.InputBindings> </ContextMenu.ItemContainerStyle>
<MouseBinding Gesture="LeftDoubleClick" </ContextMenu>
Command="{Binding GeomEntityDoubleClick_Command}"/> </ListBox.Resources>
</Grid.InputBindings> <ListBox.ItemContainerStyle>
<TextBlock Text="{Binding ghName}"> <Style TargetType="ListBoxItem">
</TextBlock> <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
</Grid> <Setter Property="ContextMenu" Value="{StaticResource RowMenu}" />
</DataTemplate> </Style>
</ListBox.ItemTemplate> </ListBox.ItemContainerStyle>
</ListBox> <ListBox.ItemTemplate>
<UniformGrid Grid.Row="4" <DataTemplate>
Rows="1" <Grid HorizontalAlignment="Stretch">
IsEnabled="{Binding IsEnabled}" <Grid.InputBindings>
Margin="0,2.5,0,0"> <MouseBinding Gesture="LeftDoubleClick"
<Button Command="{Binding Ok_Command}" Command="{Binding GeomEntityDoubleClick_Command}"/>
IsDefault="True" </Grid.InputBindings>
Margin="0,0,2.5,0" <TextBlock Text="{Binding ghName}">
Style="{StaticResource RightPanel_HalfRound_Button}"> </TextBlock>
<Image Source="\Resources\Common\Ok.png" </Grid>
Style="{StaticResource Button_Image}"/> </DataTemplate>
</Button> </ListBox.ItemTemplate>
<Button Command="{Binding Cancel_Command}" </ListBox>
Visibility="{Binding IsImport_Visibility}" <UniformGrid Grid.Row="5"
Margin="0,0,2.5,0" Rows="1"
Style="{StaticResource RightPanel_HalfRound_Button}"> IsEnabled="{Binding IsEnabled}">
<Image Source="\Resources\Common\Cancel.png" <Button Content="Ok"
Style="{StaticResource Button_Image}"/> Command="{Binding Ok_Command}"
</Button> Style="{StaticResource ToolBar_TextButton}"/>
</UniformGrid> <Button Content="Cancel"
</Grid> Command="{Binding Cancel_Command}"
</Border> Visibility="{Binding IsImport_Visibility}"
</Grid> Style="{StaticResource ToolBar_TextButton}"/>
</UniformGrid>
</Grid>
</UserControl>
+21 -36
View File
@@ -286,8 +286,7 @@ Public Class ManagePartPanelVM
Next Next
Next Next
If sErr.Count > 0 Then If sErr.Count > 0 Then
'MessageBox.Show(String.Concat(sErr), "Error") MessageBox.Show(String.Concat(sErr), "Error")
EgtMessageBoxV.Show(Application.Current.MainWindow, String.Concat(sErr), "Error")
Return Return
Else Else
' Creo pezzi e layer necessari ' Creo pezzi e layer necessari
@@ -317,9 +316,8 @@ Public Class ManagePartPanelVM
EgtRelocateGlob(PrintSolidEntity.nId, nPrintPartLayerId, GDB_POS.LAST_SON) EgtRelocateGlob(PrintSolidEntity.nId, nPrintPartLayerId, GDB_POS.LAST_SON)
' calcolo box superficie per creazione riferimento ' calcolo box superficie per creazione riferimento
EgtGetBBoxGlob(PrintSolidEntity.nId, GDB_BB.STANDARD, b3PrintSolid) EgtGetBBoxGlob(PrintSolidEntity.nId, GDB_BB.STANDARD, b3PrintSolid)
' elimino colore entita' e rendo visibile ' elimino colore entita'
EgtResetColor(PrintSolidEntity.nId) EgtResetColor(PrintSolidEntity.nId)
EgtSetStatus(PrintSolidEntity.nId, GDB_ST.ON_)
If PrintSolidEntity.sName <> PrintSolidEntity.nId.ToString() Then If PrintSolidEntity.sName <> PrintSolidEntity.nId.ToString() Then
EgtSetInfo(PrintSolidEntity.nId, ENTITY_NAME, PrintSolidEntity.sName) EgtSetInfo(PrintSolidEntity.nId, ENTITY_NAME, PrintSolidEntity.sName)
End If End If
@@ -343,9 +341,8 @@ Public Class ManagePartPanelVM
nMachStartId = EgtCreateCurveCompo(nMachStartLayerId, PartManager_GeomEntity.nId, True) nMachStartId = EgtCreateCurveCompo(nMachStartLayerId, PartManager_GeomEntity.nId, True)
End Select End Select
EgtSetName(nMachStartId, START_GEOM) EgtSetName(nMachStartId, START_GEOM)
' elimino colore entita' e rendo visibile ' elimino colore entita'
EgtResetColor(nMachStartId) EgtResetColor(nMachStartId)
EgtSetStatus(nMachStartId, GDB_ST.ON_)
If PartManager_GeomEntity.sName <> PartManager_GeomEntity.nId.ToString() Then If PartManager_GeomEntity.sName <> PartManager_GeomEntity.nId.ToString() Then
EgtSetInfo(PartManager_GeomEntity.nId, ENTITY_NAME, PartManager_GeomEntity.sName) EgtSetInfo(PartManager_GeomEntity.nId, ENTITY_NAME, PartManager_GeomEntity.sName)
End If End If
@@ -355,60 +352,48 @@ Public Class ManagePartPanelVM
Dim ptStart As Point3d = b3PrintSolid.Center() - 0.6 * b3PrintSolid.DimY() * Vector3d.Y_AX() - 0.5 * b3PrintSolid.DimZ() * Vector3d.Z_AX() Dim ptStart As Point3d = b3PrintSolid.Center() - 0.6 * b3PrintSolid.DimY() * Vector3d.Y_AX() - 0.5 * b3PrintSolid.DimZ() * Vector3d.Z_AX()
nMachStartId = EgtCreateGeoPoint(nMachStartLayerId, ptStart, GDB_RT.GLOB) nMachStartId = EgtCreateGeoPoint(nMachStartLayerId, ptStart, GDB_RT.GLOB)
EgtSetName(nMachStartId, START_GEOM) EgtSetName(nMachStartId, START_GEOM)
' elimino colore entita' e rendo visibile ' elimino colore entita'
EgtResetColor(nMachStartId) EgtResetColor(nMachStartId)
EgtSetStatus(nMachStartId, GDB_ST.ON_)
End If End If
Case ManagePart_Layer.LayerType.RIBS Case ManagePart_Layer.LayerType.RIBS
nRibsLayerId = EgtCreateGroup(nPartId) nRibsLayerId = EgtCreateGroup(nPartId)
EgtSetName(nRibsLayerId, LAY_RIBS) EgtSetName(nRibsLayerId, LAY_RIBS)
EgtSetColor(nRibsLayerId, GeomEntityColors.c3Rib) EgtSetColor(nRibsLayerId, GeomEntityColors.c3Rib)
Dim nRibsIndex As Integer = 1
For Each PartManager_GeomEntity In ManagePart_Layer.EntityList For Each PartManager_GeomEntity In ManagePart_Layer.EntityList
EgtSetInfo(PartManager_GeomEntity.nId, KEY_RIB_TYPE, RibEntity.RibTypes.FROMIMPORT) EgtSetInfo(PartManager_GeomEntity.nId, KEY_RIB_TYPE, RibEntity.RibTypes.FROMIMPORT)
EgtSetInfo(PartManager_GeomEntity.nId, RIB_ID, nRibsIndex) EgtSetInfo(PartManager_GeomEntity.nId, RIB_ID, RibPanelVM.GetNextRibIndex())
EgtRelocateGlob(PartManager_GeomEntity.nId, nRibsLayerId, GDB_POS.LAST_SON) EgtRelocateGlob(PartManager_GeomEntity.nId, nRibsLayerId, GDB_POS.LAST_SON)
' elimino colore entita' e rendo visibile ' elimino colore entita'
EgtResetColor(PartManager_GeomEntity.nId) EgtResetColor(PartManager_GeomEntity.nId)
EgtSetStatus(PartManager_GeomEntity.nId, GDB_ST.ON_)
If PartManager_GeomEntity.sName <> PartManager_GeomEntity.nId.ToString() Then If PartManager_GeomEntity.sName <> PartManager_GeomEntity.nId.ToString() Then
EgtSetInfo(PartManager_GeomEntity.nId, ENTITY_NAME, PartManager_GeomEntity.sName) EgtSetInfo(PartManager_GeomEntity.nId, ENTITY_NAME, PartManager_GeomEntity.sName)
End If End If
nRibsIndex += 1
Next Next
Case ManagePart_Layer.LayerType.SHELL_NUMBER Case ManagePart_Layer.LayerType.SHELL_NUMBER
nShellNumberLayerId = EgtCreateGroup(nPartId) nShellNumberLayerId = EgtCreateGroup(nPartId)
EgtSetName(nShellNumberLayerId, LAY_SHELL_NBR) EgtSetName(nShellNumberLayerId, LAY_SHELL_NBR)
EgtSetColor(nShellNumberLayerId, GeomEntityColors.c3ShellNumber) EgtSetColor(nShellNumberLayerId, GeomEntityColors.c3ShellNumber)
Dim nShellNumberIndex As Integer = 1
For Each PartManager_GeomEntity In ManagePart_Layer.EntityList For Each PartManager_GeomEntity In ManagePart_Layer.EntityList
EgtSetInfo(PartManager_GeomEntity.nId, KEY_SHELLNBR_TYPE, ShellNumberEntity.ShellNumberTypes.FROMIMPORT) EgtSetInfo(PartManager_GeomEntity.nId, KEY_SHELLNBR_TYPE, ShellNumberEntity.ShellNumberTypes.FROMIMPORT)
EgtSetInfo(PartManager_GeomEntity.nId, SHELLNUMBER_ID, nShellNumberIndex)
EgtRelocateGlob(PartManager_GeomEntity.nId, nShellNumberLayerId, GDB_POS.LAST_SON) EgtRelocateGlob(PartManager_GeomEntity.nId, nShellNumberLayerId, GDB_POS.LAST_SON)
' elimino colore entita' e rendo visibile ' elimino colore entita'
EgtResetColor(PartManager_GeomEntity.nId) EgtResetColor(PartManager_GeomEntity.nId)
EgtSetStatus(PartManager_GeomEntity.nId, GDB_ST.ON_)
If PartManager_GeomEntity.sName <> PartManager_GeomEntity.nId.ToString() Then If PartManager_GeomEntity.sName <> PartManager_GeomEntity.nId.ToString() Then
EgtSetInfo(PartManager_GeomEntity.nId, ENTITY_NAME, PartManager_GeomEntity.sName) EgtSetInfo(PartManager_GeomEntity.nId, ENTITY_NAME, PartManager_GeomEntity.sName)
End If End If
nShellNumberIndex += 1
Next Next
Case ManagePart_Layer.LayerType.AUX_SOLIDS Case ManagePart_Layer.LayerType.AUX_SOLIDS
nAuxSolidsLayerId = EgtCreateGroup(nPartId) nAuxSolidsLayerId = EgtCreateGroup(nPartId)
EgtSetName(nAuxSolidsLayerId, LAY_AUX_SOLIDS) EgtSetName(nAuxSolidsLayerId, LAY_AUX_SOLIDS)
EgtSetColor(nAuxSolidsLayerId, GeomEntityColors.c3AuxSolids) EgtSetColor(nAuxSolidsLayerId, GeomEntityColors.c3AuxSolids)
Dim nFilledSolidIndex As Integer = 1
For Each PartManager_GeomEntity In ManagePart_Layer.EntityList For Each PartManager_GeomEntity In ManagePart_Layer.EntityList
EgtSetInfo(PartManager_GeomEntity.nId, KEY_AUXSOLID_TYPE, RibEntity.RibTypes.FROMIMPORT) EgtSetInfo(PartManager_GeomEntity.nId, KEY_AUXSOLID_TYPE, RibEntity.RibTypes.FROMIMPORT)
EgtSetInfo(PartManager_GeomEntity.nId, FILLEDSOLID_ID, nFilledSolidIndex)
EgtRelocateGlob(PartManager_GeomEntity.nId, nAuxSolidsLayerId, GDB_POS.LAST_SON) EgtRelocateGlob(PartManager_GeomEntity.nId, nAuxSolidsLayerId, GDB_POS.LAST_SON)
' elimino colore entita' e rendo visibile ' elimino colore entita'
EgtResetColor(PartManager_GeomEntity.nId) EgtResetColor(PartManager_GeomEntity.nId)
EgtSetStatus(PartManager_GeomEntity.nId, GDB_ST.ON_)
If PartManager_GeomEntity.sName <> PartManager_GeomEntity.nId.ToString() Then If PartManager_GeomEntity.sName <> PartManager_GeomEntity.nId.ToString() Then
EgtSetInfo(PartManager_GeomEntity.nId, ENTITY_NAME, PartManager_GeomEntity.sName) EgtSetInfo(PartManager_GeomEntity.nId, ENTITY_NAME, PartManager_GeomEntity.sName)
End If End If
nFilledSolidIndex += 1
Next Next
Case ManagePart_Layer.LayerType.OTHERS Case ManagePart_Layer.LayerType.OTHERS
nOthersLayerId = EgtCreateGroup(nPartId) nOthersLayerId = EgtCreateGroup(nPartId)
@@ -416,9 +401,8 @@ Public Class ManagePartPanelVM
EgtSetColor(nOthersLayerId, GeomEntityColors.c3Others) EgtSetColor(nOthersLayerId, GeomEntityColors.c3Others)
For Each PartManager_GeomEntity In ManagePart_Layer.EntityList For Each PartManager_GeomEntity In ManagePart_Layer.EntityList
EgtRelocateGlob(PartManager_GeomEntity.nId, nOthersLayerId, GDB_POS.LAST_SON) EgtRelocateGlob(PartManager_GeomEntity.nId, nOthersLayerId, GDB_POS.LAST_SON)
' elimino colore entita' e rendo visibile ' elimino colore entita'
EgtResetColor(PartManager_GeomEntity.nId) EgtResetColor(PartManager_GeomEntity.nId)
EgtSetStatus(PartManager_GeomEntity.nId, GDB_ST.ON_)
If PartManager_GeomEntity.sName <> PartManager_GeomEntity.nId.ToString() Then If PartManager_GeomEntity.sName <> PartManager_GeomEntity.nId.ToString() Then
EgtSetInfo(PartManager_GeomEntity.nId, ENTITY_NAME, PartManager_GeomEntity.sName) EgtSetInfo(PartManager_GeomEntity.nId, ENTITY_NAME, PartManager_GeomEntity.sName)
End If End If
@@ -431,18 +415,16 @@ Public Class ManagePartPanelVM
Case GDB_TY.CRV_ARC, GDB_TY.CRV_BEZ, GDB_TY.CRV_LINE Case GDB_TY.CRV_ARC, GDB_TY.CRV_BEZ, GDB_TY.CRV_LINE
' la trasformo in curva compo ' la trasformo in curva compo
Dim nOtherId As Integer = EgtCreateCurveCompo(nOthersLayerId, PartManager_GeomEntity.nId, True) Dim nOtherId As Integer = EgtCreateCurveCompo(nOthersLayerId, PartManager_GeomEntity.nId, True)
' elimino colore entita' e rendo visibile ' elimino colore entita'
EgtResetColor(PartManager_GeomEntity.nId) EgtResetColor(PartManager_GeomEntity.nId)
EgtSetStatus(PartManager_GeomEntity.nId, GDB_ST.ON_)
If PartManager_GeomEntity.sName <> PartManager_GeomEntity.nId.ToString() Then If PartManager_GeomEntity.sName <> PartManager_GeomEntity.nId.ToString() Then
EgtSetInfo(nOtherId, ENTITY_NAME, PartManager_GeomEntity.sName) EgtSetInfo(nOtherId, ENTITY_NAME, PartManager_GeomEntity.sName)
End If End If
Case Else Case Else
' altrimenti la sposto solamente ' altrimenti la sposto solamente
EgtRelocateGlob(PartManager_GeomEntity.nId, nOthersLayerId, GDB_POS.LAST_SON) EgtRelocateGlob(PartManager_GeomEntity.nId, nOthersLayerId, GDB_POS.LAST_SON)
' elimino colore entita' e rendo visibile ' elimino colore entita'
EgtResetColor(PartManager_GeomEntity.nId) EgtResetColor(PartManager_GeomEntity.nId)
EgtSetStatus(PartManager_GeomEntity.nId, GDB_ST.ON_)
If PartManager_GeomEntity.sName <> PartManager_GeomEntity.nId.ToString() Then If PartManager_GeomEntity.sName <> PartManager_GeomEntity.nId.ToString() Then
EgtSetInfo(PartManager_GeomEntity.nId, ENTITY_NAME, PartManager_GeomEntity.sName) EgtSetInfo(PartManager_GeomEntity.nId, ENTITY_NAME, PartManager_GeomEntity.sName)
End If End If
@@ -451,11 +433,17 @@ Public Class ManagePartPanelVM
End If End If
End Select End Select
Next Next
' aggiungo layer riferimento ' aggiungo riferimento
Dim nPartReferenceLayerId As Integer = EgtCreateGroup(nPartId)
EgtSetName(nPartReferenceLayerId, LAY_PARTREFERENCE)
Dim nReferenceLayerId As Integer = EgtCreateGroup(nPartId) Dim nReferenceLayerId As Integer = EgtCreateGroup(nPartId)
EgtSetName(nReferenceLayerId, LAY_REFERENCE) EgtSetName(nReferenceLayerId, LAY_REFERENCE)
' Creo riferimento
Dim ptOrig As New Point3d(b3PrintSolid.Min())
Dim frPrintSolid As New Frame3d(ptOrig)
nFrameId = EgtCreateGeoFrame(nReferenceLayerId, frPrintSolid, GDB_RT.GLOB)
If nFrameId Then
EgtSetName(nFrameId, FRAME_PART)
EgtSetMode(nFrameId, GDB_MD.LOCKED)
End If
EgtSetInfo(nReferenceLayerId, KEY_REFERENCE, ReferenceBtn.References.BL) EgtSetInfo(nReferenceLayerId, KEY_REFERENCE, ReferenceBtn.References.BL)
' appoggio il pezzo sulla tavola ' appoggio il pezzo sulla tavola
EgtMove(nPartId, New Vector3d(0, 0, -b3PrintSolid.Min.z)) EgtMove(nPartId, New Vector3d(0, 0, -b3PrintSolid.Min.z))
@@ -465,11 +453,8 @@ Public Class ManagePartPanelVM
EgtSetInfo(nPartId, FILE_PATH, sFilePath) EgtSetInfo(nPartId, FILE_PATH, sFilePath)
EgtSetInfo(nPartId, PART_NAME, ManagePart_Part.sName) EgtSetInfo(nPartId, PART_NAME, ManagePart_Part.sName)
EgtSetInfo(nPartId, "PartOnTable", 1) EgtSetInfo(nPartId, "PartOnTable", 1)
Dim NewPart As New Print3dPartVM(nPartId, nPrintPartLayerId, nPartReferenceLayerId, nReferenceLayerId, nFrameId, nMachStartLayerId, nRibsLayerId, nShellNumberLayerId, nAuxSolidsLayerId, nOthersLayerId, sFilePath) Dim NewPart As New Print3dPartVM(nPartId, nPrintPartLayerId, nReferenceLayerId, nFrameId, nMachStartLayerId, nRibsLayerId, nShellNumberLayerId, nAuxSolidsLayerId, nOthersLayerId, sFilePath)
Map.refTopPanelVM.PartList.Add(NewPart) Map.refTopPanelVM.PartList.Add(NewPart)
' aggiorno riferimento
Map.refReferencePanelVM.UpdateFramePosition(NewPart)
Map.refSliceManagerVM.UpdateDimensions()
Next Next
End If End If
'EgtAddMachGroup("3dPrint") 'EgtAddMachGroup("3dPrint")
+42 -65
View File
@@ -1,5 +1,4 @@
Imports System.Collections.ObjectModel Imports System.Collections.ObjectModel
Imports System.Windows.Forms.VisualStyles.VisualStyleElement
Imports EgtUILib Imports EgtUILib
Imports EgtWPFLib5 Imports EgtWPFLib5
@@ -376,11 +375,10 @@ Public Class ManagePart_Layer
Public Enum LayerType As Integer Public Enum LayerType As Integer
PRINT_SOLID = 1 PRINT_SOLID = 1
'REFERENCE = 2 MACH_START = 2
MACH_START = 3 RIBS = 3
RIBS = 4 SHELL_NUMBER = 4
SHELL_NUMBER = 5 AUX_SOLIDS = 5
AUX_SOLIDS = 6
OTHERS = 7 OTHERS = 7
CHANGENAME = 15 CHANGENAME = 15
DELETE = 16 DELETE = 16
@@ -512,11 +510,11 @@ Public Class ManagePart_Layer
m_nLayerId = PrintPart.nAuxSolidsLayerId m_nLayerId = PrintPart.nAuxSolidsLayerId
Dim nEntityId As Integer = EgtGetFirstInGroup(m_nLayerId) Dim nEntityId As Integer = EgtGetFirstInGroup(m_nLayerId)
While nEntityId <> GDB_ID.NULL While nEntityId <> GDB_ID.NULL
Dim FIlledSolidType As Integer = FilledSolidEntity.FilledSolidTypes.FROMDRAW 'Dim ShellType As Integer = ShellNumberEntity.ShellNumberTypes.FROMDRAW
EgtGetInfo(nEntityId, KEY_AUXSOLID_TYPE, FIlledSolidType) 'EgtGetInfo(nEntityId, KEY_SHELLNBR_TYPE, ShellType)
If FIlledSolidType = FilledSolidEntity.FilledSolidTypes.FROMIMPORT Then 'If ShellType = ShellNumberEntity.ShellNumberTypes.FROMIMPORT Then
m_EntityList.Add(New PartManager_GeomEntity(Me, nEntityId)) m_EntityList.Add(New PartManager_GeomEntity(Me, nEntityId))
End If 'End If
nEntityId = EgtGetNext(nEntityId) nEntityId = EgtGetNext(nEntityId)
End While End While
Case LayerType.OTHERS Case LayerType.OTHERS
@@ -629,8 +627,7 @@ Public Class GeomEntity_MenuItem
Map.refManagePartPanelVM.SetIsEnabled(True) Map.refManagePartPanelVM.SetIsEnabled(True)
Return Return
ElseIf m_Type = ManagePart_Layer.LayerType.DELETE Then ElseIf m_Type = ManagePart_Layer.LayerType.DELETE Then
'If MessageBox.Show("Are you sure you want to delete this entity?", "Delete confirmation", MessageBoxButton.YesNo, MessageBoxImage.Question) = MessageBoxResult.Yes Then If MessageBox.Show("Are you sure you want to delete this entity?", "Delete confirmation", MessageBoxButton.YesNo, MessageBoxImage.Question) = MessageBoxResult.Yes Then
If EgtMessageBoxV.Show(Application.Current.MainWindow, "Are you sure you want to delete this entity?", "Delete confirmation", MessageBoxButton.YesNo, MessageBoxImage.Question) = MessageBoxResult.Yes Then
EgtErase(m_OrigEntity.nId) EgtErase(m_OrigEntity.nId)
' se l'entita' e' gia' in lista pezzi ' se l'entita' e' gia' in lista pezzi
If Not IsNothing(m_OrigEntity.OrigLayer) Then If Not IsNothing(m_OrigEntity.OrigLayer) Then
@@ -642,14 +639,12 @@ Public Class GeomEntity_MenuItem
End If End If
' se e' presente elimino flag di spostamento a 45 gradi ' se e' presente elimino flag di spostamento a 45 gradi
Dim nPartId As Integer = EgtGetParent(EgtGetParent(m_OrigEntity.nId)) Dim nPartId As Integer = EgtGetParent(EgtGetParent(m_OrigEntity.nId))
EgtRemoveInfo(nPartId, KEY_MOVEDPART) EgtRemoveInfo(nPartId, "MovedPart")
EgtDraw() EgtDraw()
' aggiorno riferimenti nel context menu item ' aggiorno riferimenti nel context menu item
Map.refManagePartPanelVM.UpdateAllEntityContextMenu() Map.refManagePartPanelVM.UpdateAllEntityContextMenu()
' Imposto flag di ricalcolo slice ' Imposto flag di ricalcolo slice
If Map.refManagePartPanelVM.Type = ManagePartPanelVM.ManagePartType.MODIFY Then EgtSetInfo(Map.refTopPanelVM.SelPart.nPartId, MAC_TORECALC_SLICE, True)
EgtSetInfo(Map.refTopPanelVM.SelPart.nPartId, MAC_TORECALC_SLICE, True)
End If
End If End If
Return Return
ElseIf m_Type = ManagePart_Layer.LayerType.NEWPART Then ElseIf m_Type = ManagePart_Layer.LayerType.NEWPART Then
@@ -671,8 +666,6 @@ Public Class GeomEntity_MenuItem
NewLayer.EntityList.Add(m_OrigEntity) NewLayer.EntityList.Add(m_OrigEntity)
' aggiorno riferimenti nell'entita' ' aggiorno riferimenti nell'entita'
m_OrigEntity.UpdateOrigLayer(NewLayer) m_OrigEntity.UpdateOrigLayer(NewLayer)
' aggiorno colore
EgtSetColor(m_OrigEntity.nId, GetColor(LayerType.PRINTPART))
End If End If
End If End If
' aggiorno i contextmenu di tutti gli entity ' aggiorno i contextmenu di tutti gli entity
@@ -691,50 +684,52 @@ Public Class GeomEntity_MenuItem
' creo layer solido di stampa ' creo layer solido di stampa
Dim nPrintPartLayerId As Integer = EgtCreateGroup(nPartId) Dim nPrintPartLayerId As Integer = EgtCreateGroup(nPartId)
EgtSetName(nPrintPartLayerId, PRINT_SOLID) EgtSetName(nPrintPartLayerId, PRINT_SOLID)
EgtSetColor(nPrintPartLayerId, GeomEntityColors.c3Print)
EgtRelocateGlob(m_OrigEntity.nId, nPrintPartLayerId, GDB_POS.LAST_SON) EgtRelocateGlob(m_OrigEntity.nId, nPrintPartLayerId, GDB_POS.LAST_SON)
' calcolo box superficie per creazione riferimento ' calcolo box superficie per creazione riferimento
EgtGetBBoxGlob(m_OrigEntity.nId, GDB_BB.STANDARD, b3PrintSolid) EgtGetBBoxGlob(m_OrigEntity.nId, GDB_BB.STANDARD, b3PrintSolid)
' coloro l'entita'
EgtSetColor(m_OrigEntity.nId, GeomEntityColors.c3Print)
' creo layer mach start ' creo layer mach start
Dim nMachStartLayerId As Integer = EgtCreateGroup(nPartId) Dim nMachStartLayerId As Integer = EgtCreateGroup(nPartId)
EgtSetName(nMachStartLayerId, LAY_MACH_START) EgtSetName(nMachStartLayerId, LAY_MACH_START)
EgtSetColor(nMachStartLayerId, GeomEntityColors.c3MachStart)
Dim nMachStartId As Integer = GDB_ID.NULL Dim nMachStartId As Integer = GDB_ID.NULL
' creo punto di partenza ' creo punto di partenza
Dim ptStart As Point3d = b3PrintSolid.Center() - 0.6 * b3PrintSolid.DimY() * Vector3d.Y_AX() - 0.5 * b3PrintSolid.DimZ() * Vector3d.Z_AX() Dim ptStart As Point3d = b3PrintSolid.Center() - 0.6 * b3PrintSolid.DimY() * Vector3d.Y_AX() - 0.5 * b3PrintSolid.DimZ() * Vector3d.Z_AX()
nMachStartId = EgtCreateGeoPoint(nMachStartLayerId, ptStart, GDB_RT.GLOB) nMachStartId = EgtCreateGeoPoint(nMachStartLayerId, ptStart, GDB_RT.GLOB)
EgtSetName(nMachStartId, START_GEOM) EgtSetName(nMachStartId, START_GEOM)
' coloro l'entita' di rosso
EgtSetColor(nMachStartId, GeomEntityColors.c3MachStart)
' creo layer ribs ' creo layer ribs
Dim nRibsLayerId As Integer = EgtCreateGroup(nPartId) Dim nRibsLayerId As Integer = EgtCreateGroup(nPartId)
EgtSetName(nRibsLayerId, LAY_RIBS) EgtSetName(nRibsLayerId, LAY_RIBS)
EgtSetColor(nRibsLayerId, GeomEntityColors.c3Rib)
' creo layer shell number ' creo layer shell number
Dim nShellNumberLayerId As Integer = EgtCreateGroup(nPartId) Dim nShellNumberLayerId As Integer = EgtCreateGroup(nPartId)
EgtSetName(nShellNumberLayerId, LAY_SHELL_NBR) EgtSetName(nShellNumberLayerId, LAY_SHELL_NBR)
EgtSetColor(nShellNumberLayerId, GeomEntityColors.c3ShellNumber)
' creo layer aux ' creo layer aux
Dim nAuxSolidsLayerId As Integer = EgtCreateGroup(nPartId) Dim nAuxSolidsLayerId As Integer = EgtCreateGroup(nPartId)
EgtSetName(nAuxSolidsLayerId, LAY_AUX_SOLIDS) EgtSetName(nAuxSolidsLayerId, LAY_AUX_SOLIDS)
EgtSetColor(nAuxSolidsLayerId, GeomEntityColors.c3AuxSolids)
' creo layer others ' creo layer others
Dim nOthersLayerId As Integer = EgtCreateGroup(nPartId) Dim nOthersLayerId As Integer = EgtCreateGroup(nPartId)
EgtSetName(nOthersLayerId, LAY_OTHERS) EgtSetName(nOthersLayerId, LAY_OTHERS)
EgtSetColor(nOthersLayerId, GeomEntityColors.c3Others)
' aggiungo riferimento ' aggiungo riferimento
Dim nPartReferenceLayerId As Integer = EgtCreateGroup(nPartId)
EgtSetName(nPartReferenceLayerId, LAY_PARTREFERENCE)
Dim nReferenceLayerId As Integer = EgtCreateGroup(nPartId) Dim nReferenceLayerId As Integer = EgtCreateGroup(nPartId)
EgtSetName(nReferenceLayerId, LAY_REFERENCE) EgtSetName(nReferenceLayerId, LAY_REFERENCE)
' Creo riferimento
Dim ptOrig As New Point3d(b3PrintSolid.Min())
Dim frPrintSolid As New Frame3d(ptOrig)
nFrameId = EgtCreateGeoFrame(nReferenceLayerId, frPrintSolid, GDB_RT.GLOB)
If nFrameId Then
EgtSetName(nFrameId, FRAME_PART)
EgtSetMode(nFrameId, GDB_MD.LOCKED)
End If
EgtSetInfo(nReferenceLayerId, KEY_REFERENCE, ReferenceBtn.References.BL) EgtSetInfo(nReferenceLayerId, KEY_REFERENCE, ReferenceBtn.References.BL)
' appoggio il pezzo sulla tavola ' appoggio il pezzo sulla tavola
EgtMove(nPartId, New Vector3d(0, 0, -b3PrintSolid.Min.z)) EgtMove(nPartId, New Vector3d(0, 0, -b3PrintSolid.Min.z))
' lo aggiungo a lista pezzi ' lo aggiungo a lista pezzi
EgtSetInfo(nPartId, FILE_PATH, sFilePath) EgtSetInfo(nPartId, FILE_PATH, sFilePath)
EgtSetInfo(nPartId, "PartOnTable", 1) EgtSetInfo(nPartId, "PartOnTable", 1)
Dim NewPart As New Print3dPartVM(nPartId, nPrintPartLayerId, nPartReferenceLayerId, nReferenceLayerId, nFrameId, nMachStartLayerId, nRibsLayerId, nShellNumberLayerId, nAuxSolidsLayerId, nOthersLayerId, sFilePath) Dim NewPart As New Print3dPartVM(nPartId, nPrintPartLayerId, nReferenceLayerId, nFrameId, nMachStartLayerId, nRibsLayerId, nShellNumberLayerId, nAuxSolidsLayerId, nOthersLayerId, sFilePath)
Map.refTopPanelVM.PartList.Add(NewPart) Map.refTopPanelVM.PartList.Add(NewPart)
' aggiorno riferimento
Map.refReferencePanelVM.UpdateFramePosition(NewPart)
Dim ManagePart_Part As ManagePart_Part = New ManagePart_Part(NewPart) Dim ManagePart_Part As ManagePart_Part = New ManagePart_Part(NewPart)
' elimino da posizione originale ' elimino da posizione originale
m_OrigEntity.OrigLayer.EntityList.Remove(m_OrigEntity) m_OrigEntity.OrigLayer.EntityList.Remove(m_OrigEntity)
@@ -746,10 +741,9 @@ Public Class GeomEntity_MenuItem
' Imposto flag di ricalcolo slice ' Imposto flag di ricalcolo slice
EgtSetInfo(Map.refTopPanelVM.SelPart.nPartId, MAC_TORECALC_SLICE, True) EgtSetInfo(Map.refTopPanelVM.SelPart.nPartId, MAC_TORECALC_SLICE, True)
End Select End Select
' aggiorno visibilita' da check di categoria '' aggiorno visibilita' da check di categoria
Dim PrintViewlayer As ViewLayer = Map.refViewLayerManagerVM.LayerList.FirstOrDefault(Function(x) x.Type = ViewLayer.ViewLayerType.PRINT_SOLID) 'Dim PrintLayer As ViewLayer = Map.refViewLayerManagerVM.LayerList.FirstOrDefault(Function(x) x.Type = ViewLayer.ViewLayerType.PRINT_SOLID)
EgtSetStatus(m_OrigEntity.nId, If(IsNothing(PrintViewlayer.bIsVisible) OrElse PrintViewlayer.bIsVisible, GDB_ST.ON_, GDB_ST.OFF)) 'EgtSetStatus(m_OrigEntity.nId, If(IsNothing(PrintLayer.bIsVisible) OrElse PrintLayer.bIsVisible, GDB_ST.ON_, GDB_ST.OFF))
EgtDraw()
Return Return
End If End If
Select Case Map.refManagePartPanelVM.Type Select Case Map.refManagePartPanelVM.Type
@@ -769,18 +763,11 @@ Public Class GeomEntity_MenuItem
NewLayer.EntityList.Add(m_OrigEntity) NewLayer.EntityList.Add(m_OrigEntity)
' aggiorno riferimenti nell'entita' ' aggiorno riferimenti nell'entita'
m_OrigEntity.UpdateOrigLayer(NewLayer) m_OrigEntity.UpdateOrigLayer(NewLayer)
' aggiorno colore
EgtSetColor(m_OrigEntity.nId, GetColor(m_Type))
' aggiorno visibilita' da check di categoria
Dim PrintViewlayer As ViewLayer = Map.refViewLayerManagerVM.LayerList.FirstOrDefault(Function(x) x.Type = m_Type)
EgtSetStatus(m_OrigEntity.nId, If(IsNothing(PrintViewlayer.bIsVisible) OrElse PrintViewlayer.bIsVisible, GDB_ST.ON_, GDB_ST.OFF))
EgtDraw()
End If End If
End If End If
' aggiorno riferimenti nel context menu item ' aggiorno riferimenti nel context menu item
Map.refManagePartPanelVM.UpdateAllEntityContextMenu() m_OrigEntity.UpdateContextMenu()
Case ManagePartPanelVM.ManagePartType.MODIFY Case ManagePartPanelVM.ManagePartType.MODIFY
Dim bIsMovedPartOrRib As Boolean = False
' recupero layer da pezzo ' recupero layer da pezzo
Dim nLayerId As Integer = GDB_ID.NULL Dim nLayerId As Integer = GDB_ID.NULL
Select Case m_Type Select Case m_Type
@@ -802,21 +789,19 @@ Public Class GeomEntity_MenuItem
' elimino info vecchio layer ' elimino info vecchio layer
Select Case m_OrigEntity.OrigLayer.Type Select Case m_OrigEntity.OrigLayer.Type
Case ManagePart_Layer.LayerType.PRINT_SOLID Case ManagePart_Layer.LayerType.PRINT_SOLID
'EgtResetMark(m_OrigEntity.nId) EgtResetMark(m_OrigEntity.nId)
' se e' presente flag di spostamento a 45 gradi ' se e' presente flag di spostamento a 45 gradi
Dim nPartId As Integer = EgtGetParent(EgtGetParent(m_OrigEntity.nId)) Dim nPartId As Integer = EgtGetParent(EgtGetParent(m_OrigEntity.nId))
Dim vtMoved As Vector3d Dim vtMoved As Vector3d
If EgtGetInfo(nPartId, KEY_MOVEDPART, vtMoved) Then If EgtGetInfo(nPartId, "MovedPart", vtMoved) Then
' lo sposto e rimuovo info ' lo sposto e rimuovo info
EgtMove(m_OrigEntity.nId, -vtMoved, GDB_RT.GLOB) EgtMove(m_OrigEntity.nId, -vtMoved, GDB_RT.GLOB)
EgtRemoveInfo(nPartId, KEY_MOVEDPART) EgtRemoveInfo(nPartId, "MovedPart")
End If End If
bIsMovedPartOrRib = True
Case ManagePart_Layer.LayerType.MACH_START Case ManagePart_Layer.LayerType.MACH_START
Case ManagePart_Layer.LayerType.RIBS Case ManagePart_Layer.LayerType.RIBS
EgtRemoveInfo(m_OrigEntity.nId, KEY_RIB_TYPE) EgtRemoveInfo(m_OrigEntity.nId, KEY_RIB_TYPE)
EgtRemoveInfo(m_OrigEntity.nId, RIB_ID) EgtRemoveInfo(m_OrigEntity.nId, RIB_ID)
bIsMovedPartOrRib = True
Case ManagePart_Layer.LayerType.SHELL_NUMBER Case ManagePart_Layer.LayerType.SHELL_NUMBER
EgtRemoveInfo(m_OrigEntity.nId, KEY_SHELLNBR_TYPE) EgtRemoveInfo(m_OrigEntity.nId, KEY_SHELLNBR_TYPE)
Case ManagePart_Layer.LayerType.AUX_SOLIDS Case ManagePart_Layer.LayerType.AUX_SOLIDS
@@ -840,33 +825,29 @@ Public Class GeomEntity_MenuItem
Select Case m_Type Select Case m_Type
Case ManagePart_Layer.LayerType.PRINT_SOLID Case ManagePart_Layer.LayerType.PRINT_SOLID
EgtSetName(m_OrigEntity.nId, PRINT_SOLID) EgtSetName(m_OrigEntity.nId, PRINT_SOLID)
EgtSetColor(m_OrigEntity.nId, c3Print)
' rimuovo eventuale nota spostamento per 45 gradi ' rimuovo eventuale nota spostamento per 45 gradi
EgtRemoveInfo(m_OrigEntity.OrigLayer.OrigPart.nId, KEY_MOVEDPART) EgtRemoveInfo(m_OrigEntity.OrigLayer.OrigPart.nId, "MovedPart")
bIsMovedPartOrRib = True
Case ManagePart_Layer.LayerType.MACH_START Case ManagePart_Layer.LayerType.MACH_START
EgtSetName(m_OrigEntity.nId, LAY_MACH_START) EgtSetName(m_OrigEntity.nId, LAY_MACH_START)
EgtSetColor(m_OrigEntity.nId, c3MachStart)
Case ManagePart_Layer.LayerType.RIBS Case ManagePart_Layer.LayerType.RIBS
EgtSetName(m_OrigEntity.nId, LAY_RIBS) EgtSetName(m_OrigEntity.nId, LAY_RIBS)
EgtSetInfo(m_OrigEntity.nId, KEY_RIB_TYPE, RibEntity.RibTypes.FROMIMPORT) EgtSetInfo(m_OrigEntity.nId, KEY_RIB_TYPE, RibEntity.RibTypes.FROMIMPORT)
EgtSetInfo(m_OrigEntity.nId, RIB_ID, RibPanelVM.GetNextRibIndex()) EgtSetInfo(m_OrigEntity.nId, RIB_ID, RibPanelVM.GetNextRibIndex())
bIsMovedPartOrRib = True EgtSetColor(m_OrigEntity.nId, c3Rib)
Case ManagePart_Layer.LayerType.SHELL_NUMBER Case ManagePart_Layer.LayerType.SHELL_NUMBER
EgtSetName(m_OrigEntity.nId, LAY_SHELL_NBR) EgtSetName(m_OrigEntity.nId, LAY_SHELL_NBR)
EgtSetInfo(m_OrigEntity.nId, KEY_SHELLNBR_TYPE, ShellNumberEntity.ShellNumberTypes.FROMIMPORT) EgtSetInfo(m_OrigEntity.nId, KEY_SHELLNBR_TYPE, ShellNumberEntity.ShellNumberTypes.FROMIMPORT)
EgtSetColor(m_OrigEntity.nId, c3ShellNumber)
Case ManagePart_Layer.LayerType.AUX_SOLIDS Case ManagePart_Layer.LayerType.AUX_SOLIDS
EgtSetName(m_OrigEntity.nId, LAY_AUX_SOLIDS) EgtSetName(m_OrigEntity.nId, LAY_AUX_SOLIDS)
EgtSetInfo(m_OrigEntity.nId, KEY_AUXSOLID_TYPE, RibEntity.RibTypes.FROMIMPORT) EgtSetInfo(m_OrigEntity.nId, KEY_AUXSOLID_TYPE, RibEntity.RibTypes.FROMIMPORT)
EgtSetColor(m_OrigEntity.nId, c3AuxSolids)
Case ManagePart_Layer.LayerType.OTHERS Case ManagePart_Layer.LayerType.OTHERS
EgtSetName(m_OrigEntity.nId, LAY_OTHERS) EgtSetName(m_OrigEntity.nId, LAY_OTHERS)
EgtSetColor(m_OrigEntity.nId, c3Others)
End Select End Select
' resetto colore entita'
EgtResetColor(m_OrigEntity.nId)
' se spostato un Rib, aggiorno posizione riferimento e pezzo
If bIsMovedPartOrRib Then
Map.refReferencePanelVM.UpdateFramePosition(NewPart.PrintPart)
Map.refDispositionPanelVM.UpdateZPos()
Map.refSliceManagerVM.UpdateDimensions()
End If
EgtDraw() EgtDraw()
' aggiorno riferimenti nel context menu item ' aggiorno riferimenti nel context menu item
If bUpdateAllContextMenu Then If bUpdateAllContextMenu Then
@@ -945,8 +926,7 @@ Public Class ManagerPart_MenuItem
Select Case Map.refManagePartPanelVM.Type Select Case Map.refManagePartPanelVM.Type
Case ManagePartPanelVM.ManagePartType.IMPORT Case ManagePartPanelVM.ManagePartType.IMPORT
For Each Layer In m_OrigPart.LayerList For Each Layer In m_OrigPart.LayerList
For EntityIndex = Layer.EntityList.Count - 1 To 0 Step -1 For Each Entity In Layer.EntityList
Dim Entity As PartManager_GeomEntity = Layer.EntityList(EntityIndex)
' le rimuovo da lista entita' pezzo ' le rimuovo da lista entita' pezzo
Layer.EntityList.Remove(Entity) Layer.EntityList.Remove(Entity)
' la rimetto in lista importati ' la rimetto in lista importati
@@ -969,9 +949,7 @@ Public Class ManagerPart_MenuItem
' aggiorno riferimenti nel context menu item ' aggiorno riferimenti nel context menu item
Map.refManagePartPanelVM.UpdateAllEntityContextMenu() Map.refManagePartPanelVM.UpdateAllEntityContextMenu()
' Imposto flag di ricalcolo slice ' Imposto flag di ricalcolo slice
If Not IsNothing(Map.refTopPanelVM.SelPart) Then ' in prima importazione non c'e' alcun pezzo selezionato EgtSetInfo(Map.refTopPanelVM.SelPart.nPartId, MAC_TORECALC_SLICE, True)
EgtSetInfo(Map.refTopPanelVM.SelPart.nPartId, MAC_TORECALC_SLICE, True)
End If
End Select End Select
End Sub End Sub
@@ -1038,8 +1016,7 @@ Public Class ManagerLayer_MenuItem
Case Else ' PartMenuCmd.IMPORTPRINT Case Else ' PartMenuCmd.IMPORTPRINT
Dim bDeleteOldPrint As Boolean = False Dim bDeleteOldPrint As Boolean = False
If m_OrigLayer.EntityList.Count > 0 Then If m_OrigLayer.EntityList.Count > 0 Then
'If MessageBox.Show("Importing a new print solid the current one will be deleted. Are you sure you want to proced?", "Warning", MessageBoxButton.YesNo, MessageBoxImage.Warning) <> MessageBoxResult.Yes Then If MessageBox.Show("Importing a new print solid the current one will be deleted. Are you sure you want to proced?", "Warning", MessageBoxButton.YesNo, MessageBoxImage.Warning) <> MessageBoxResult.Yes Then
If EgtMessageBoxV.Show(Application.Current.MainWindow, "Importing a new print solid the current one will be deleted. Are you sure you want to proced?", "Warning", MessageBoxButton.YesNo, MessageBoxImage.Warning) <> MessageBoxResult.Yes Then
Return Return
Else Else
bDeleteOldPrint = True bDeleteOldPrint = True
+45 -72
View File
@@ -21,7 +21,7 @@ Public Class Material
End Get End Get
End Property End Property
Friend Sub UpdateIsModified() Friend Sub UpdateIsModified()
m_bIsModified = m_CathegoryList.Any(Function(x) x.MaterialParamList.Any(Function(y) y.bIsModified)) OrElse bIsModifiedName m_bIsModified = m_CathegoryList.Any(Function(x) x.MaterialParamList.Any(Function(y) y.bIsModified))
NotifyPropertyChanged(NameOf(ghName)) NotifyPropertyChanged(NameOf(ghName))
End Sub End Sub
@@ -31,32 +31,23 @@ Public Class Material
Return m_nIndex Return m_nIndex
End Get End Get
End Property End Property
Friend Sub SetIndex(nValue As Integer)
m_nIndex = nValue
End Sub
Private m_sGUID As String Private m_sGUID As String
Public Property sGUID As String Public ReadOnly Property sGUID As String
Get Get
Return m_sGUID Return m_sGUID
End Get End Get
Set(value As String)
m_sGUID = value
End Set
End Property End Property
Private m_sOrigName As String = ""
Private m_sName As String Private m_sName As String
Public Property sName As String Public Property sName As String
Get Get
Return m_sName Return m_sName
End Get End Get
Set(value As String) Set(value As String)
Dim bIsModified As Boolean = m_sName <> value
m_sName = value m_sName = value
Map.refMaterialDbVM.SetNameVisibility(False) Map.refMaterialDbVM.SetNameVisibility(False)
If bIsModified Then UpdateIsModified() NotifyPropertyChanged(NameOf(ghName))
Map.refMaterialDbVM.SetIsEnabled(True)
End Set End Set
End Property End Property
Public ReadOnly Property ghName As String Public ReadOnly Property ghName As String
@@ -64,18 +55,12 @@ Public Class Material
Return m_sName & If(m_bIsModified, "*", "") Return m_sName & If(m_bIsModified, "*", "")
End Get End Get
End Property End Property
Public ReadOnly Property bIsModifiedName As Boolean
Get
Return m_sName <> m_sOrigName
End Get
End Property
' per lettura da file ' per lettura da file
Sub New(nIndex As Integer) Sub New(nIndex As Integer)
m_nIndex = nIndex m_nIndex = nIndex
ReadMaterialParamString(nIndex, MAT_GUID, "", m_sGUID) ReadMaterialParamString(nIndex, MAT_GUID, "", m_sGUID)
ReadMaterialParamString(nIndex, MAT_NAME, "", m_sName) ReadMaterialParamString(nIndex, MAT_NAME, "", m_sName)
m_sOrigName = m_sName
'EgtGetStringUtf8FromIni(nIndex, MAT_NAME, "", m_sName, sMatIniFilePath) 'EgtGetStringUtf8FromIni(nIndex, MAT_NAME, "", m_sName, sMatIniFilePath)
m_CathegoryList.Add(New MaterialCathegory(MaterialCathegory.Cathegories.GENERAL, nIndex)) m_CathegoryList.Add(New MaterialCathegory(MaterialCathegory.Cathegories.GENERAL, nIndex))
m_CathegoryList.Add(New MaterialCathegory(MaterialCathegory.Cathegories.TEMPERATURES, nIndex)) m_CathegoryList.Add(New MaterialCathegory(MaterialCathegory.Cathegories.TEMPERATURES, nIndex))
@@ -91,8 +76,7 @@ Public Class Material
Sub New() Sub New()
m_nIndex = Map.refMaterialDbVM.MaterialList.Max(Function(x) x.nIndex) + 1 m_nIndex = Map.refMaterialDbVM.MaterialList.Max(Function(x) x.nIndex) + 1
m_sGUID = Guid.NewGuid.ToString() m_sGUID = Guid.NewGuid.ToString()
m_sName = "New Material" m_sName = "New Material Param"
m_sOrigName = m_sName
Dim nCopyIndex As Integer = Map.refMaterialDbVM.SelMaterial.m_nIndex Dim nCopyIndex As Integer = Map.refMaterialDbVM.SelMaterial.m_nIndex
m_CathegoryList.Add(New MaterialCathegory(MaterialCathegory.Cathegories.GENERAL, nCopyIndex)) m_CathegoryList.Add(New MaterialCathegory(MaterialCathegory.Cathegories.GENERAL, nCopyIndex))
Dim Orig As StringMaterialParam = m_CathegoryList(0).MaterialParamList.FirstOrDefault(Function(x) x.Type = MaterialParam.Params.ORIG) Dim Orig As StringMaterialParam = m_CathegoryList(0).MaterialParamList.FirstOrDefault(Function(x) x.Type = MaterialParam.Params.ORIG)
@@ -149,16 +133,6 @@ Public Class Material
'm_dRibsLeadOutWipeDir = ReadMaterialParamDouble(m_nIndex, MAC_RIBSLEADOUTWIPEDIR, 0, CurrentMachine.sMachiningFilePath) 'm_dRibsLeadOutWipeDir = ReadMaterialParamDouble(m_nIndex, MAC_RIBSLEADOUTWIPEDIR, 0, CurrentMachine.sMachiningFilePath)
End Sub End Sub
Private Sub SaveName()
m_sOrigName = m_sName
End Sub
Private Sub ResetName()
m_sName = m_sOrigName
NotifyPropertyChanged(NameOf(ghName))
NotifyPropertyChanged(NameOf(sName))
End Sub
Friend Sub Save() Friend Sub Save()
If bIsModified Then If bIsModified Then
' salvo tutti i parametri su orig ' salvo tutti i parametri su orig
@@ -171,17 +145,15 @@ Public Class Material
End Sub End Sub
Private Sub SaveParams() Private Sub SaveParams()
SaveName()
For Each Cathegory In m_CathegoryList For Each Cathegory In m_CathegoryList
Cathegory.SaveParams() Cathegory.SaveParams()
Next Next
End Sub End Sub
Friend Sub ResetModification() Friend Sub ResetModification()
ResetName()
If bIsModified Then If bIsModified Then
' annullo le modifiche di tutti i parametri ' annullo le modifiche di tutti i parametri
ResetParams() SaveParams()
' resetto stato di modificata ' resetto stato di modificata
UpdateIsModified() UpdateIsModified()
End If End If
@@ -193,12 +165,12 @@ Public Class Material
Next Next
End Sub End Sub
Friend Sub WriteParamsOnDb(nIndex As Integer, Optional sFilePath As String = "") Friend Sub WriteParamsOnDb(nIndex As Integer)
WriteMaterialParam(nIndex, MAT_GUID, m_sGUID, sFilePath) WriteMaterialParam(nIndex, MAT_GUID, m_sGUID)
WriteMaterialParam(nIndex, MAT_NAME, m_sName, sFilePath) WriteMaterialParam(nIndex, MAT_NAME, m_sName)
' EgtWriteStringUtf8toIni(nIndex, MAT_NAME, m_sName) ' EgtWriteStringUtf8toIni(nIndex, MAT_NAME, m_sName)
For Each Cathegory In m_CathegoryList For Each Cathegory In m_CathegoryList
Cathegory.WriteParamOnDb(nIndex, sFilePath) Cathegory.WriteParamOnDb(nIndex)
Next Next
End Sub End Sub
@@ -386,9 +358,9 @@ Public Class MaterialCathegory
Next Next
End Sub End Sub
Friend Sub WriteParamOnDb(nIndex As Integer, Optional sFilePath As String = "") Friend Sub WriteParamOnDb(nIndex As Integer)
For Each Param In m_MaterialParamList For Each Param In m_MaterialParamList
Param.WriteParamOnDb(nIndex, sFilePath) Param.WriteParamOnDb(nIndex)
Next Next
End Sub End Sub
@@ -484,7 +456,7 @@ Public MustInherit Class MaterialParam
End Sub End Sub
Friend MustOverride Sub WriteParamOnDb(nIndex As Integer, Optional sFilePath As String = "") Friend MustOverride Sub WriteParamOnDb(nIndex As Integer)
Friend MustOverride Sub SaveParam() Friend MustOverride Sub SaveParam()
Friend MustOverride Sub ResetParam() Friend MustOverride Sub ResetParam()
@@ -587,7 +559,7 @@ Public Class NumericMaterialParam
m_dOrigValue = m_dValue m_dOrigValue = m_dValue
End Sub End Sub
Friend Overrides Sub WriteParamOnDb(nIndex As Integer, Optional sFilePath As String = "") Friend Overrides Sub WriteParamOnDb(nIndex As Integer)
Dim sWriteValue As String = "" Dim sWriteValue As String = ""
If m_bIsLen Then If m_bIsLen Then
sWriteValue = LenToString(m_dValue, 5) sWriteValue = LenToString(m_dValue, 5)
@@ -596,43 +568,43 @@ Public Class NumericMaterialParam
End If End If
Select Case Type Select Case Type
Case Params.T1 Case Params.T1
WriteMaterialParam(nIndex, MAT_T1, sWriteValue, sFilePath) WriteMaterialParam(nIndex, MAT_T1, sWriteValue)
Case Params.T2 Case Params.T2
WriteMaterialParam(nIndex, MAT_T2, sWriteValue, sFilePath) WriteMaterialParam(nIndex, MAT_T2, sWriteValue)
Case Params.T3 Case Params.T3
WriteMaterialParam(nIndex, MAT_T3, sWriteValue, sFilePath) WriteMaterialParam(nIndex, MAT_T3, sWriteValue)
Case Params.T4 Case Params.T4
WriteMaterialParam(nIndex, MAT_T4, sWriteValue, sFilePath) WriteMaterialParam(nIndex, MAT_T4, sWriteValue)
Case Params.T5 Case Params.T5
WriteMaterialParam(nIndex, MAT_T5, sWriteValue, sFilePath) WriteMaterialParam(nIndex, MAT_T5, sWriteValue)
Case Params.K_EXTRUSION Case Params.K_EXTRUSION
WriteMaterialParam(nIndex, MAT_KEXTRUSION, sWriteValue, sFilePath) WriteMaterialParam(nIndex, MAT_KEXTRUSION, sWriteValue)
Case Params.K_LAY_TIME Case Params.K_LAY_TIME
WriteMaterialParam(nIndex, MAT_KLAYERTIME, sWriteValue, sFilePath) WriteMaterialParam(nIndex, MAT_KLAYERTIME, sWriteValue)
Case Params.C1 Case Params.C1
WriteMaterialParam(nIndex, MAT_C1, sWriteValue, sFilePath) WriteMaterialParam(nIndex, MAT_C1, sWriteValue)
Case Params.C2 Case Params.C2
WriteMaterialParam(nIndex, MAT_C2, sWriteValue, sFilePath) WriteMaterialParam(nIndex, MAT_C2, sWriteValue)
Case Params.DENSITY Case Params.DENSITY
WriteMaterialParam(nIndex, MAT_DENSITY, sWriteValue, sFilePath) WriteMaterialParam(nIndex, MAT_DENSITY, sWriteValue)
Case Params.AMAX Case Params.AMAX
WriteMaterialParam(nIndex, MAT_AMAX, sWriteValue, sFilePath) WriteMaterialParam(nIndex, MAT_AMAX, sWriteValue)
Case Params.ATRG Case Params.ATRG
WriteMaterialParam(nIndex, MAT_ATRG, sWriteValue, sFilePath) WriteMaterialParam(nIndex, MAT_ATRG, sWriteValue)
Case Params.AMIN Case Params.AMIN
WriteMaterialParam(nIndex, MAT_AMIN, sWriteValue, sFilePath) WriteMaterialParam(nIndex, MAT_AMIN, sWriteValue)
Case Params.BMAX Case Params.BMAX
WriteMaterialParam(nIndex, MAT_BMAX, sWriteValue, sFilePath) WriteMaterialParam(nIndex, MAT_BMAX, sWriteValue)
Case Params.BTRG Case Params.BTRG
WriteMaterialParam(nIndex, MAT_BTRG, sWriteValue, sFilePath) WriteMaterialParam(nIndex, MAT_BTRG, sWriteValue)
Case Params.BMIN Case Params.BMIN
WriteMaterialParam(nIndex, MAT_BMIN, sWriteValue, sFilePath) WriteMaterialParam(nIndex, MAT_BMIN, sWriteValue)
Case Params.KW Case Params.KW
WriteMaterialParam(nIndex, MAT_KW, sWriteValue, sFilePath) WriteMaterialParam(nIndex, MAT_KW, sWriteValue)
Case Params.KZ Case Params.KZ
WriteMaterialParam(nIndex, MAT_KZ, sWriteValue, sFilePath) WriteMaterialParam(nIndex, MAT_KZ, sWriteValue)
Case Params.KN Case Params.KN
WriteMaterialParam(nIndex, MAT_KN, sWriteValue, sFilePath) WriteMaterialParam(nIndex, MAT_KN, sWriteValue)
End Select End Select
End Sub End Sub
@@ -649,6 +621,8 @@ End Class
Public Class StringMaterialParam Public Class StringMaterialParam
Inherits MaterialParam Inherits MaterialParam
Public Const DEFAULT_MATERIAL As String = "***"
Private m_sGUID As String Private m_sGUID As String
Public Property sGUID As String Public Property sGUID As String
Get Get
@@ -713,9 +687,9 @@ Public Class StringMaterialParam
Case Params.ORIG Case Params.ORIG
Dim sOrigGUID As String = "" Dim sOrigGUID As String = ""
ReadMaterialParamString(nIndex, MAT_ORIG, "", sOrigGUID) ReadMaterialParamString(nIndex, MAT_ORIG, "", sOrigGUID)
If sOrigGUID = ORIG_MATERIAL Then If sOrigGUID = DEFAULT_MATERIAL Then
m_sGUID = ORIG_MATERIAL m_sGUID = DEFAULT_MATERIAL
m_sValue = ORIG_MATERIAL m_sValue = DEFAULT_MATERIAL
' se livello alto, lo visualizzo comunque ' se livello alto, lo visualizzo comunque
If Map.refMainWindowVM.MainWindowM.nUserLevel >= 5 Then If Map.refMainWindowVM.MainWindowM.nUserLevel >= 5 Then
m_String_Visibility = Visibility.Visible m_String_Visibility = Visibility.Visible
@@ -740,10 +714,10 @@ Public Class StringMaterialParam
m_sOrigValue = m_sValue m_sOrigValue = m_sValue
End Sub End Sub
Friend Overrides Sub WriteParamOnDb(nIndex As Integer, Optional sFilePath As String = "") Friend Overrides Sub WriteParamOnDb(nIndex As Integer)
Select Case Type Select Case Type
Case Params.ORIG Case Params.ORIG
WriteMaterialParam(nIndex, MAT_ORIG, m_sGUID, sFilePath) WriteMaterialParam(nIndex, MAT_ORIG, m_sGUID)
End Select End Select
End Sub End Sub
@@ -769,10 +743,9 @@ Public Class StringMaterialParam
End Property End Property
Public Sub Original() Public Sub Original()
'If MessageBox.Show("Are you sure you want to set this material as original?", "Original material confirmation", MessageBoxButton.YesNo, MessageBoxImage.Question) = MessageBoxResult.Yes Then If MessageBox.Show("Are you sure you want to set this material as original?", "Original material confirmation", MessageBoxButton.YesNo, MessageBoxImage.Question) = MessageBoxResult.Yes Then
If EgtMessageBoxV.Show(Application.Current.MainWindow, "Are you sure you want to set this material as original?", "Original material confirmation", MessageBoxButton.YesNo, MessageBoxImage.Question) = MessageBoxResult.Yes Then m_sGUID = DEFAULT_MATERIAL
m_sGUID = ORIG_MATERIAL m_sValue = DEFAULT_MATERIAL
m_sValue = ORIG_MATERIAL
NotifyPropertyChanged(NameOf(sValue)) NotifyPropertyChanged(NameOf(sValue))
End If End If
End Sub End Sub
@@ -828,10 +801,10 @@ Public Class ComboMaterialParam
m_OrigSelValue = m_SelValue m_OrigSelValue = m_SelValue
End Sub End Sub
Friend Overrides Sub WriteParamOnDb(nIndex As Integer, Optional sFilePath As String = "") Friend Overrides Sub WriteParamOnDb(nIndex As Integer)
Select Case Type Select Case Type
'Case Params.STRANDORDER 'Case Params.STRANDORDER
' WriteMaterialParam(nIndex, MAC_STRANDORDER, m_SelValue.Id, sFilePath) ' WriteMaterialParam(nIndex, MAC_STRANDORDER, m_SelValue.Id)
End Select End Select
End Sub End Sub
@@ -879,7 +852,7 @@ Public Class CheckMaterialParam
m_bOrigValue = m_bValue m_bOrigValue = m_bValue
End Sub End Sub
Friend Overrides Sub WriteParamOnDb(nIndex As Integer, Optional sFilePath As String = "") Friend Overrides Sub WriteParamOnDb(nIndex As Integer)
Select Case Type Select Case Type
End Select End Select
End Sub End Sub
+82 -138
View File
@@ -1,118 +1,54 @@
<Grid x:Class="MaterialDbV" <UserControl x:Class="MaterialDbV"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:EgtWPFLib5="clr-namespace:EgtWPFLib5;assembly=EgtWPFLib5" xmlns:EgtWPFLib5="clr-namespace:EgtWPFLib5;assembly=EgtWPFLib5"
xmlns:PrintApp="clr-namespace:Icarus" xmlns:PrintApp="clr-namespace:Icarus">
Width="310" <Border VerticalAlignment="Center"
VerticalAlignment="Center"> Style="{StaticResource RightPanel_Border}">
<Grid.RowDefinitions> <Grid>
<RowDefinition Height="Auto"/>
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
<Border Margin="0,0,0,2.5"
Style="{StaticResource Title_Border}">
<TextBlock Text="MATERIAL DATABASE"
Style="{StaticResource Title_TextBlock}"/>
</Border>
<Border Grid.Row="1"
VerticalAlignment="Center"
Margin="0,2.5,0,0"
Style="{StaticResource BottomGrayRow_Border}">
<Grid Margin="2.5,2.5,2.5,0">
<Grid.RowDefinitions> <Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/> <RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/> <RowDefinition Height="Auto"/>
<RowDefinition Height="1*"/> <RowDefinition Height="1*"/>
<RowDefinition Height="Auto"/> <RowDefinition Height="Auto"/>
</Grid.RowDefinitions> </Grid.RowDefinitions>
<Grid HorizontalAlignment="Center" <UniformGrid Rows="1">
Margin="0,2.5,0,2.5">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<Button Content="Copy" <Button Content="Copy"
Command="{Binding Copy_Command}" Command="{Binding Copy_Command}"
IsEnabled="{Binding IsEnabled}" Style="{StaticResource ToolBar_TextButton}"/>
Margin="2.5,0,2.5,0" <Button Content="Save"
Style="{StaticResource RightPanel_Button}"/>
<Button Grid.Column="1"
Content="Save"
Command="{Binding Save_Command}" Command="{Binding Save_Command}"
IsEnabled="{Binding IsEnabled}" Style="{StaticResource ToolBar_TextButton}"/>
Margin="2.5,0,2.5,0" <Button Content="Delete"
Style="{StaticResource RightPanel_Button}"/>
<Button Grid.Column="2" Content="Delete"
Command="{Binding Delete_Command}" Command="{Binding Delete_Command}"
IsEnabled="{Binding Delete_IsEnabled}" IsEnabled="{Binding Delete_IsEnabled}"
Margin="2.5,0,2.5,0" Style="{StaticResource ToolBar_TextButton}"/>
Style="{StaticResource RightPanel_Button}"/> </UniformGrid>
<Button Grid.Column="3" <ComboBox Grid.Row="1"
Command="{Binding Import_Command}" Name="MaterialCombo"
ToolTip="{Binding Import_ToolTip}" ItemsSource="{Binding MaterialList}"
IsEnabled="{Binding ImpExp_IsEnabled}" SelectedItem="{Binding SelMaterial}"
Margin="2.5,0,2.5,0" DisplayMemberPath="ghName"/>
Style="{StaticResource ToolBar_Button}"> <Grid Grid.Row="2"
<Image Source="/Resources/MaterialDB/MaterialImport.png" Visibility="{Binding Name_Visibility}">
Style="{StaticResource Button_Image}"/>
</Button>
<Button Grid.Column="4"
Command="{Binding Export_Command}"
ToolTip="{Binding Export_ToolTip}"
IsEnabled="{Binding ImpExp_IsEnabled}"
Margin="2.5,0,2.5,0"
Style="{StaticResource ToolBar_Button}">
<Image Source="/Resources/MaterialDB/MaterialExport.png"
Style="{StaticResource Button_Image}"/>
</Button>
</Grid>
<Grid Grid.Row="1"
Margin="0,2.5,0,2.5">
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
<ColumnDefinition Width="2*"/>
<ColumnDefinition Width="1*"/> <ColumnDefinition Width="1*"/>
<ColumnDefinition Width="Auto"/> <ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<ComboBox Name="MaterialCombo" <TextBlock Text="{Binding Name_Msg}"/>
ItemsSource="{Binding MaterialList}" <EgtWPFLib5:EgtTextBox Grid.Column="1"
SelectedItem="{Binding SelMaterial}" Text="{Binding SelectedItem.sName, ElementName=MaterialCombo, UpdateSourceTrigger=Explicit}"/>
DisplayMemberPath="ghName"
Visibility="{Binding Combo_Visibility}"
HorizontalAlignment="Stretch"
Margin="2.5,0,2.5,0"
Style="{StaticResource RightPanel_ComboBox}"/>
<EgtWPFLib5:EgtTextBox2 Text="{Binding SelectedItem.sName, ElementName=MaterialCombo, UpdateSourceTrigger=Explicit}"
ExplicitUpdateSource="EnterKeyPressOrLostFocus"
IsExplicitFocused="{Binding UserShouldEditValueNow}"
Visibility="{Binding Name_Visibility}"
Margin="2.5,0,2.5,0"
Style="{StaticResource OptionTextBox2}"/>
<Button Grid.Column="1"
Command="{Binding EditName_Command}"
ToolTip="{Binding EditName_ToolTip}"
Margin="2.5,0,2.5,0"
Style="{StaticResource ToolBar_Button}">
<Image Source="/Resources/MaterialDB/Edit.png"/>
</Button>
</Grid> </Grid>
<ScrollViewer Grid.Row="2" <ScrollViewer Grid.Row="3"
IsEnabled="{Binding IsEnabled}"
VerticalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto"
HorizontalScrollBarVisibility="Disabled" HorizontalScrollBarVisibility="Disabled">
Margin="1,0,0,2.5" <ItemsControl Grid.Row="1"
Padding="0" ItemsSource="{Binding SelectedItem.CathegoryList, ElementName=MaterialCombo}">
BorderThickness="0"
Style="{StaticResource RightPanel_ScrollViewer}">
<ItemsControl ItemsSource="{Binding SelectedItem.CathegoryList, ElementName=MaterialCombo}"
BorderThickness="0"
Margin="0"
Padding="0">
<ItemsControl.ItemsPanel> <ItemsControl.ItemsPanel>
<ItemsPanelTemplate> <ItemsPanelTemplate>
<StackPanel Orientation="Vertical" <StackPanel Orientation="Vertical"/>
Margin="0"/>
</ItemsPanelTemplate> </ItemsPanelTemplate>
</ItemsControl.ItemsPanel> </ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate> <ItemsControl.ItemTemplate>
@@ -121,14 +57,11 @@
IsExpanded="{Binding Cathegory_IsExpanded}" IsExpanded="{Binding Cathegory_IsExpanded}"
VerticalContentAlignment="Top" VerticalContentAlignment="Top"
Visibility="{Binding Cathegory_Visibility}"> Visibility="{Binding Cathegory_Visibility}">
<ItemsControl ItemsSource="{Binding MaterialParamList}" <ItemsControl ItemsSource="{Binding MaterialParamList}">
BorderThickness="0"
Margin="0"
Padding="0">
<ItemsControl.ItemsPanel> <ItemsControl.ItemsPanel>
<ItemsPanelTemplate> <ItemsPanelTemplate>
<StackPanel Orientation="Vertical" <UniformGrid Columns="1"
Margin="0"/> HorizontalAlignment="Stretch"/>
</ItemsPanelTemplate> </ItemsPanelTemplate>
</ItemsControl.ItemsPanel> </ItemsControl.ItemsPanel>
<ItemsControl.ItemContainerStyle> <ItemsControl.ItemContainerStyle>
@@ -138,32 +71,34 @@
</ItemsControl.ItemContainerStyle> </ItemsControl.ItemContainerStyle>
<ItemsControl.Resources> <ItemsControl.Resources>
<DataTemplate DataType="{x:Type PrintApp:NumericMaterialParam}"> <DataTemplate DataType="{x:Type PrintApp:NumericMaterialParam}">
<Grid Margin="0,1,2.5,1"> <Grid>
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
<ColumnDefinition Width="2*"/> <ColumnDefinition Width="2*"/>
<ColumnDefinition Width="1*"/> <ColumnDefinition Width="1*"/>
<ColumnDefinition Width="Auto"/> <ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<TextBlock Text="{Binding sName}" <TextBlock Text="{Binding sName}"/>
Margin="0,0,2.5,0"
Style="{StaticResource ParameterList_TextBlock}"/>
<TextBox Grid.Column="1" <TextBox Grid.Column="1"
Text="{Binding dValue}" Text="{Binding dValue}"/>
Margin="2.5,0,0,0" <!--<Button Grid.Column="2"
Style="{StaticResource ParameterList_TextBox}"/> Content="R"
Command="{Binding ResetParam_Command}"
CommandParameter="dCurrStrandH"
IsEnabled="{Binding bCurrStrandH_IsModified}"
VerticalContentAlignment="Center"
HorizontalContentAlignment="Center"
Margin="5,0,0,0"
Style="{StaticResource ToolBar_SmallButton}"/>-->
</Grid> </Grid>
</DataTemplate> </DataTemplate>
<DataTemplate DataType="{x:Type PrintApp:StringMaterialParam}"> <DataTemplate DataType="{x:Type PrintApp:StringMaterialParam}">
<Grid Visibility="{Binding String_Visibility}" <Grid Visibility="{Binding String_Visibility}">
Margin="0,1,2.5,1">
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/> <ColumnDefinition Width="2*"/>
<ColumnDefinition Width="1*"/> <ColumnDefinition Width="1*"/>
<ColumnDefinition Width="Auto"/> <ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<TextBlock Text="{Binding sName}" <TextBlock Text="{Binding sName}"/>
Margin="0,0,2.5,0"
Style="{StaticResource ParameterList_TextBlock}"/>
<TextBox Grid.Column="1" <TextBox Grid.Column="1"
Text="{Binding sValue}" Text="{Binding sValue}"
IsReadOnly="True"/> IsReadOnly="True"/>
@@ -178,37 +113,49 @@
</Grid> </Grid>
</DataTemplate> </DataTemplate>
<DataTemplate DataType="{x:Type PrintApp:ComboMaterialParam}"> <DataTemplate DataType="{x:Type PrintApp:ComboMaterialParam}">
<Grid Margin="0,1,2.5,1"> <Grid>
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
<ColumnDefinition Width="2*"/> <ColumnDefinition Width="2*"/>
<ColumnDefinition Width="1*"/> <ColumnDefinition Width="1*"/>
<!--<ColumnDefinition Width="Auto"/>-->
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<TextBlock Text="{Binding sName}" <TextBlock Text="{Binding sName}"/>
Margin="0,0,2.5,0"
Style="{StaticResource ParameterList_TextBlock}"/>
<ComboBox Grid.Column="1" <ComboBox Grid.Column="1"
ItemsSource="{Binding ValueList}" ItemsSource="{Binding ValueList}"
SelectedItem="{Binding SelValue}" SelectedItem="{Binding SelValue}"
HorizontalAlignment="Stretch" HorizontalAlignment="Stretch"/>
Margin="2.5,0,0,0" <!--<Button Grid.Column="1"
Style="{StaticResource RightPanel_ComboBox}"/> Content="R"
Command="{Binding ResetParam_Command}"
CommandParameter="dCurrStrandH"
IsEnabled="{Binding bCurrStrandH_IsModified}"
VerticalContentAlignment="Center"
HorizontalContentAlignment="Center"
Margin="5,0,0,0"
Style="{StaticResource ToolBar_SmallButton}"/>-->
</Grid> </Grid>
</DataTemplate> </DataTemplate>
<DataTemplate DataType="{x:Type PrintApp:CheckMaterialParam}"> <DataTemplate DataType="{x:Type PrintApp:CheckMaterialParam}">
<Grid Height="22" <Grid>
Margin="0,1,2.5,1">
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
<ColumnDefinition Width="2*"/> <ColumnDefinition Width="2*"/>
<ColumnDefinition Width="1*"/> <ColumnDefinition Width="1*"/>
<!--<ColumnDefinition Width="Auto"/>-->
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<TextBlock Text="{Binding sName}" <TextBlock Text="{Binding sName}"/>
Margin="0,0,2.5,0"
Style="{StaticResource ParameterList_TextBlock}"/>
<CheckBox Grid.Column="1" <CheckBox Grid.Column="1"
IsChecked="{Binding bValue}" IsChecked="{Binding bValue}"
HorizontalAlignment="Center" HorizontalAlignment="Center"
VerticalAlignment="Center" VerticalAlignment="Center"/>
Margin="2.5,0,0,0"/> <!--<Button Grid.Column="1"
Content="R"
Command="{Binding ResetParam_Command}"
CommandParameter="dCurrStrandH"
IsEnabled="{Binding bCurrStrandH_IsModified}"
VerticalContentAlignment="Center"
HorizontalContentAlignment="Center"
Margin="5,0,0,0"
Style="{StaticResource ToolBar_SmallButton}"/>-->
</Grid> </Grid>
</DataTemplate> </DataTemplate>
</ItemsControl.Resources> </ItemsControl.Resources>
@@ -218,14 +165,11 @@
</ItemsControl.ItemTemplate> </ItemsControl.ItemTemplate>
</ItemsControl> </ItemsControl>
</ScrollViewer> </ScrollViewer>
<Button Grid.Row="3" <UniformGrid Grid.Row="4" Rows="1">
Command="{Binding Ok_Command}" <Button Content="Ok"
IsEnabled="{Binding IsEnabled}" Command="{Binding Ok_Command}"
Margin="0,2.5,0,0" Style="{StaticResource ToolBar_TextButton}"/>
Style="{StaticResource RightPanel_HalfRound_Button}"> </UniformGrid>
<Image Source="\Resources\Common\Ok.png"
Style="{StaticResource Button_Image}"/>
</Button>
</Grid> </Grid>
</Border> </Border>
</Grid> </UserControl>
+17 -180
View File
@@ -24,8 +24,7 @@ Public Class MaterialDbVM
' verifico se modificato ' verifico se modificato
If Not IsNothing(m_SelMaterial) AndAlso m_SelMaterial.bIsModified Then If Not IsNothing(m_SelMaterial) AndAlso m_SelMaterial.bIsModified Then
' chiedo se salvare ' chiedo se salvare
'Select Case MessageBox.Show("Do you want to save material modification?", "Info", MessageBoxButton.YesNoCancel, MessageBoxImage.Question) Select Case MessageBox.Show("Do you want to save material modification?", "Info", MessageBoxButton.YesNoCancel, MessageBoxImage.Question)
Select Case EgtMessageBoxV.Show(Application.Current.MainWindow, "Do you want to save material modification?", "Info", MessageBoxButton.YesNoCancel, MessageBoxImage.Question)
Case MessageBoxResult.Yes Case MessageBoxResult.Yes
m_SelMaterial.Save() m_SelMaterial.Save()
Case MessageBoxResult.No Case MessageBoxResult.No
@@ -61,13 +60,10 @@ Public Class MaterialDbVM
Return m_Name_Visibility Return m_Name_Visibility
End Get End Get
End Property End Property
Friend Sub SetNameVisibility(bValue As Boolean)
Private m_Combo_Visibility As Visibility = Visibility.Visible m_Name_Visibility = If(bValue, Visibility.Visible, Visibility.Collapsed)
Public ReadOnly Property Combo_Visibility As Visibility NotifyPropertyChanged(NameOf(Name_Visibility))
Get End Sub
Return m_Combo_Visibility
End Get
End Property
' variabile che indica se una qualunque lavorazione e' stata modificata ' variabile che indica se una qualunque lavorazione e' stata modificata
Private m_bIsModified As Boolean Private m_bIsModified As Boolean
@@ -80,22 +76,10 @@ Public Class MaterialDbVM
m_bIsModified = value m_bIsModified = value
End Sub End Sub
Private m_IsEnabled As Boolean = True
Public ReadOnly Property IsEnabled As Boolean
Get
Return m_IsEnabled
End Get
End Property
Friend Sub SetIsEnabled(value As Boolean)
m_IsEnabled = value
NotifyPropertyChanged(NameOf(IsEnabled))
NotifyPropertyChanged(NameOf(Delete_IsEnabled))
End Sub
Private m_Delete_IsEnabled As Boolean = True Private m_Delete_IsEnabled As Boolean = True
Public ReadOnly Property Delete_IsEnabled As Boolean Public ReadOnly Property Delete_IsEnabled As Boolean
Get Get
Return m_IsEnabled AndAlso m_Delete_IsEnabled Return m_Delete_IsEnabled
End Get End Get
End Property End Property
Friend Sub SetDeleteIsEnabled(value As Boolean) Friend Sub SetDeleteIsEnabled(value As Boolean)
@@ -107,58 +91,11 @@ Public Class MaterialDbVM
NotifyPropertyChanged(NameOf(Delete_IsEnabled)) NotifyPropertyChanged(NameOf(Delete_IsEnabled))
End Sub End Sub
Private m_UserShouldEditValueNow As Boolean = False
Public Property UserShouldEditValueNow As Boolean
Get
Return m_UserShouldEditValueNow
End Get
Set(value As Boolean)
m_UserShouldEditValueNow = value
End Set
End Property
Friend Sub SetUserShouldEditValueNow()
m_UserShouldEditValueNow = True
NotifyPropertyChanged(NameOf(UserShouldEditValueNow))
m_UserShouldEditValueNow = False
NotifyPropertyChanged(NameOf(UserShouldEditValueNow))
End Sub
Public ReadOnly Property ImpExp_IsEnabled As Boolean
Get
Return m_IsEnabled AndAlso (IsNothing(m_SelMaterial) OrElse Not m_SelMaterial.bIsModified)
End Get
End Property
#Region "Tooltip"
Public ReadOnly Property Import_ToolTip As String
Get
Return "Import"
End Get
End Property
Public ReadOnly Property Export_ToolTip As String
Get
Return "Export"
End Get
End Property
Public ReadOnly Property EditName_ToolTip As String
Get
Return "Edit Name"
End Get
End Property
#End Region ' Tooltip
' Definizione comandi ' Definizione comandi
Private m_cmdOk As ICommand Private m_cmdOk As ICommand
Private m_cmdCopy As ICommand Private m_cmdCopy As ICommand
Private m_cmdSave As ICommand Private m_cmdSave As ICommand
Private m_cmdDelete As ICommand Private m_cmdDelete As ICommand
Private m_cmdEditName As ICommand
Private m_cmdImport As ICommand
Private m_cmdExport As ICommand
#End Region ' FIELDS & PROPERTIES #End Region ' FIELDS & PROPERTIES
@@ -196,14 +133,6 @@ Public Class MaterialDbVM
End If End If
End Sub End Sub
Friend Sub SetNameVisibility(bValue As Boolean)
m_Name_Visibility = If(bValue, Visibility.Visible, Visibility.Collapsed)
m_Combo_Visibility = If(Not bValue, Visibility.Visible, Visibility.Collapsed)
NotifyPropertyChanged(NameOf(Name_Visibility))
NotifyPropertyChanged(NameOf(Combo_Visibility))
If bValue Then SetUserShouldEditValueNow()
End Sub
Private Function SelMaterialIsOriginal() As Boolean Private Function SelMaterialIsOriginal() As Boolean
If IsNothing(m_SelMaterial) Then Return False If IsNothing(m_SelMaterial) Then Return False
' verifico abilitazione delete ' verifico abilitazione delete
@@ -211,7 +140,7 @@ Public Class MaterialDbVM
If Not IsNothing(General) Then If Not IsNothing(General) Then
Dim Original As MaterialParam = General.MaterialParamList.FirstOrDefault(Function(x) x.Type = MaterialParam.Params.ORIG) Dim Original As MaterialParam = General.MaterialParamList.FirstOrDefault(Function(x) x.Type = MaterialParam.Params.ORIG)
If Not IsNothing(Original) Then If Not IsNothing(Original) Then
If DirectCast(Original, StringMaterialParam).sValue = ORIG_MATERIAL Then If DirectCast(Original, StringMaterialParam).sValue = StringMaterialParam.DEFAULT_MATERIAL Then
Return True Return True
End If End If
End If End If
@@ -237,8 +166,7 @@ Public Class MaterialDbVM
Public Sub Ok() Public Sub Ok()
If Not IsNothing(m_SelMaterial) AndAlso m_SelMaterial.bIsModified Then If Not IsNothing(m_SelMaterial) AndAlso m_SelMaterial.bIsModified Then
' chiedo se salvare ' chiedo se salvare
'Select Case MessageBox.Show("Do you want to save material modification?", "Warning", MessageBoxButton.YesNoCancel, MessageBoxImage.Warning) Select Case MessageBox.Show("Do you want to save material modification?", "Warning", MessageBoxButton.YesNoCancel, MessageBoxImage.Warning)
Select Case EgtMessageBoxV.Show(Application.Current.MainWindow, "Do you want to save material modification?", "Warning", MessageBoxButton.YesNoCancel, MessageBoxImage.Warning)
Case MessageBoxResult.Yes Case MessageBoxResult.Yes
m_SelMaterial.Save() m_SelMaterial.Save()
Case MessageBoxResult.No Case MessageBoxResult.No
@@ -248,7 +176,7 @@ Public Class MaterialDbVM
End Select End Select
End If End If
If m_bIsModified Then If m_bIsModified Then
Dim sBakMatIniFilePath As String = Path.ChangeExtension(CurrentMachine.sMaterialFilePath, ".bak") Dim sBakMatIniFilePath As String = Path.ChangeExtension(CurrentMachine.sMaterialsFilePath, ".bak")
If File.Exists(sBakMatIniFilePath) Then If File.Exists(sBakMatIniFilePath) Then
Try Try
' cambio estensione in bak a file Db vecchio ' cambio estensione in bak a file Db vecchio
@@ -256,24 +184,24 @@ Public Class MaterialDbVM
Catch ex As Exception Catch ex As Exception
End Try End Try
End If End If
If File.Exists(CurrentMachine.sMaterialFilePath) Then If File.Exists(CurrentMachine.sMaterialsFilePath) Then
Try Try
' cambio estensione in bak a file Db vecchio ' cambio estensione in bak a file Db vecchio
File.Move(CurrentMachine.sMaterialFilePath, sBakMatIniFilePath) File.Move(CurrentMachine.sMaterialsFilePath, sBakMatIniFilePath)
Catch ex As Exception Catch ex As Exception
End Try End Try
End If End If
' se ancora esiste lo elimino ' se ancora esiste lo elimino
If File.Exists(CurrentMachine.sMaterialFilePath) Then If File.Exists(CurrentMachine.sMaterialsFilePath) Then
Try Try
File.Delete(CurrentMachine.sMaterialFilePath) File.Delete(CurrentMachine.sMaterialsFilePath)
Catch ex As Exception Catch ex As Exception
End Try End Try
End If End If
' creo nuovo file ' creo nuovo file
If Not File.Exists(CurrentMachine.sMaterialFilePath) Then If Not File.Exists(CurrentMachine.sMaterialsFilePath) Then
Try Try
File.WriteAllLines(CurrentMachine.sMaterialFilePath, {"; Commento per evitare BOM con UTF-8"}) File.WriteAllLines(CurrentMachine.sMaterialsFilePath, {"; Commento per evitare BOM con UTF-8"})
Catch ex As Exception Catch ex As Exception
End Try End Try
End If End If
@@ -363,31 +291,12 @@ Public Class MaterialDbVM
End Property End Property
Public Sub Delete() Public Sub Delete()
Dim sCheckMessage As String = "Are you sure you want to delete selected material?"
' se materiale originale, esco ' se materiale originale, esco
If SelMaterialIsOriginal() Then If SelMaterialIsOriginal() Then Return
If Map.refMainWindowVM.MainWindowM.nUserLevel >= 5 Then
'If MessageBox.Show("Trying to delete an Original Material! Are you sure you want to delete it?", "", MessageBoxButton.YesNo, MessageBoxImage.Warning) <> MessageBoxResult.Yes Then
If EgtMessageBoxV.Show(Application.Current.MainWindow, "Trying to delete an Original Material! Are you sure you want to delete it?", "", MessageBoxButton.YesNo, MessageBoxImage.Warning) <> MessageBoxResult.Yes Then
Return
End If
sCheckMessage = "Trying to delete an Original Material! Are you ABSOLUTELY sure you want to delete it?"
Else
'MessageBox.Show("Original material impossible to delete!")
EgtMessageBoxV.Show(Application.Current.MainWindow, "Original material impossible to delete!")
Return
End If
End If
' chiedo conferma ' chiedo conferma
Select Case EgtMessageBoxV.Show(Application.Current.MainWindow, sCheckMessage, "Warning", MessageBoxButton.YesNo, MessageBoxImage.Warning) Select Case MessageBox.Show("Are you sure you want to delete selected material?", "Warning", MessageBoxButton.YesNo, MessageBoxImage.Warning)
'MessageBox.Show(sCheckMessage, "Warning", MessageBoxButton.YesNo, MessageBoxImage.Warning)
Case MessageBoxResult.Yes Case MessageBoxResult.Yes
m_MaterialList.Remove(m_SelMaterial) m_MaterialList.Remove(m_SelMaterial)
SetIsModified(True)
If m_MaterialList.Count > 0 Then
SelMaterial = m_MaterialList(0)
NotifyPropertyChanged(NameOf(SelMaterial))
End If
' segno Db come modificato ' segno Db come modificato
Map.refMaterialDbVM.SetIsModified(True) Map.refMaterialDbVM.SetIsModified(True)
Case MessageBoxResult.No Case MessageBoxResult.No
@@ -397,78 +306,6 @@ Public Class MaterialDbVM
#End Region ' Delete #End Region ' Delete
#Region "EditName"
Public ReadOnly Property EditName_Command As ICommand
Get
If m_cmdEditName Is Nothing Then
m_cmdEditName = New Command(AddressOf EditName)
End If
Return m_cmdEditName
End Get
End Property
Public Sub EditName()
If IsNothing(m_SelMaterial) Then Return
SetNameVisibility(True)
SetIsEnabled(False)
End Sub
#End Region ' EditName
#Region "Import"
Public ReadOnly Property Import_Command As ICommand
Get
If m_cmdImport Is Nothing Then
m_cmdImport = New Command(AddressOf Import)
End If
Return m_cmdImport
End Get
End Property
Public Sub Import()
' chiedo il nome del file .data da aprire
Dim OpenFileDlg As New System.Windows.Forms.OpenFileDialog() With {.Title = EgtMsg(31451) & " " & EgtMsg(31452),
.Filter = "Material file data (*" & ImportExportMachiningPanelVM.MaterialDataExtension & ")|*" & ImportExportMachiningPanelVM.MaterialDataExtension &
"|Original Material file data (*" & ImportExportMachiningPanelVM.OriginalMaterialDataExtension & ")|*" & ImportExportMachiningPanelVM.OriginalMaterialDataExtension &
"|All Material file data (*" & ImportExportMachiningPanelVM.MaterialDataExtension & "," & ImportExportMachiningPanelVM.OriginalMaterialDataExtension & ")|*" &
ImportExportMachiningPanelVM.MaterialDataExtension & ";*" & ImportExportMachiningPanelVM.OriginalMaterialDataExtension,
.FilterIndex = 3,
.FileName = String.Empty}
If OpenFileDlg.ShowDialog() <> System.Windows.Forms.DialogResult.OK Then Return
Dim ImportWindowVM As New ImportExportMachiningPanelVM(ImportExportMachiningPanelVM.WindowTypeEnum.MATERIAL, ImportExportMachiningPanelVM.WindowModeEnum.IMPORT, OpenFileDlg.FileName)
If ImportWindowVM.WindowMode <> ImportExportMachiningPanelVM.WindowModeEnum.IMPORT_ORIG Then
Dim ImportWindowV As New ImportExportMachiningPanelV(Application.Current.MainWindow, ImportWindowVM)
ImportWindowV.ShowDialog()
End If
End Sub
#End Region ' Import
#Region "Export"
Public ReadOnly Property Export_Command As ICommand
Get
If m_cmdExport Is Nothing Then
m_cmdExport = New Command(AddressOf Export)
End If
Return m_cmdExport
End Get
End Property
Public Sub Export()
Dim ExportMode As ImportExportMachiningPanelVM.WindowModeEnum = ImportExportMachiningPanelVM.WindowModeEnum.EXPORT
If Map.refMainWindowVM.MainWindowM.nUserLevel >= 5 AndAlso (Keyboard.Modifiers And ModifierKeys.Shift) = ModifierKeys.Shift Then
ExportMode = ImportExportMachiningPanelVM.WindowModeEnum.EXPORT_ORIG
End If
Dim ExportWindowVM As New ImportExportMachiningPanelVM(ImportExportMachiningPanelVM.WindowTypeEnum.MATERIAL, ExportMode)
Dim ExportWindowV As New ImportExportMachiningPanelV(Application.Current.MainWindow, ExportWindowVM)
ExportWindowV.ShowDialog()
End Sub
#End Region ' Export
#End Region ' COMMANDS #End Region ' COMMANDS
End Class End Class
+2 -2
View File
@@ -70,5 +70,5 @@ Imports System.Windows
' by using the '*' as shown below: ' by using the '*' as shown below:
' <Assembly: AssemblyVersion("1.0.*")> ' <Assembly: AssemblyVersion("1.0.*")>
<Assembly: AssemblyVersion("2.5.5.1")> <Assembly: AssemblyVersion("2.5.1.1")>
<Assembly: AssemblyFileVersion("2.5.5.1")> <Assembly: AssemblyFileVersion("2.5.1.1")>
+36
View File
@@ -0,0 +1,36 @@
<EgtWPFLib5:EgtCustomWindow x:Class="MachineBox"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:EgtWPFLib5="clr-namespace:EgtWPFLib5;assembly=EgtWPFLib5"
Height="160" Width="380" WindowStyle="None" ResizeMode="NoResize"
TitleBarHeight="30" IsResizable="False" IsMinimizable="False"
ShowInTaskbar="False" WindowStartupLocation="CenterOwner">
<Border BorderThickness="2" BorderBrush="LightBlue">
<Grid >
<Grid.ColumnDefinitions>
<ColumnDefinition Width="0.25*"/>
<ColumnDefinition Width="5*"/>
<ColumnDefinition Width="0.25*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="0.25*"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="0.25*"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="0.25*"/>
</Grid.RowDefinitions>
<TextBlock Name="MessageLbl" Grid.Column="1" Grid.Row="1" HorizontalAlignment="Center"
VerticalAlignment="Center" />
<UniformGrid Grid.Column="1" Grid.Row="3" Columns="3">
<Button Name="ReplaceBtn" Height="26" Margin="0,0,5,0"/>
<Button Name="UpdateBtn" Height="26" Margin="5,0,5,0"/>
<Button Name="CancelBtn" IsDefault="True" Height="26" Margin="5,0,0,0"/>
</UniformGrid>
</Grid>
</Border>
</EgtWPFLib5:EgtCustomWindow>
+45
View File
@@ -0,0 +1,45 @@
Imports EgtUILib
Public Class MachineBox
Public Shadows DialogResult As MessageBoxResult = MessageBoxResult.Cancel
Public Sub New( Owner As Window, sMachName As String)
InitializeComponent()
Me.Owner = Owner
Title = EgtMsg( 6534) ' Avviso
MessageLbl.Text = String.Format( EgtMsg( 6528), sMachName) ' La macchina "{0}" esiste già,<br/> cosa vuoi fare ?
ReplaceBtn.Content = EgtMsg( 6531) ' Sostituisci
UpdateBtn.Content = EgtMsg( 6532) ' Aggiorna
CancelBtn.Content = EgtMsg( 6533) ' Annulla
End Sub
Private Sub ReplaceBtn_Click( sender As Object, e As RoutedEventArgs) Handles ReplaceBtn.Click
DialogResult = MessageBoxResult.Yes
Close()
End Sub
Private Sub UpdateBtn_Click( sender As Object, e As RoutedEventArgs) Handles UpdateBtn.Click
DialogResult = MessageBoxResult.No
Close()
End Sub
Private Sub CancelBtn_Click( sender As Object, e As RoutedEventArgs) Handles CancelBtn.Click
DialogResult = MessageBoxResult.Cancel
Close()
End Sub
Public Overloads Function ShowDialog() As MessageBoxResult
MyBase.ShowDialog()
Return DialogResult
End Function
End Class
@@ -1,223 +0,0 @@
<EgtWPFLib5:EgtCustomWindow x:Class="OptionWindowV"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:Icarus="clr-namespace:Icarus"
xmlns:EgtWPFLib5="clr-namespace:EgtWPFLib5;assembly=EgtWPFLib5"
Style="{DynamicResource {x:Type EgtWPFLib5:EgtCustomWindow}}"
Title="{Binding Title}" Icon="/Resources/Icarus.ico"
Background="Transparent"
AllowsTransparency="True"
BorderThickness="0"
WindowStyle="None" ResizeMode="NoResize" TitleBarHeight="0" IsResizable="False"
IsMinimizable="False" WindowStartupLocation="CenterScreen" ShowInTaskbar="False"
MinWidth="400" MinHeight="382"
Width="400" Height="412">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
<Border Margin="0,0,0,2.5"
Style="{StaticResource Title_Border}">
<TextBlock Text="SETTINGS"
Style="{StaticResource Title_TextBlock}"/>
</Border>
<Border Grid.Row="1"
Margin="0,2.5,0,0"
CornerRadius="4"
Style="{StaticResource WhiteBottomBlueRow_Border}">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="1*"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<TabControl Margin="5,5,5,5">
<TabItem Header="{Binding GenericMsg}">
<StackPanel Margin="5,5,5,0">
<!--<GroupBox Header="{Binding CurrentLanguageMsg}"
Margin="0,0,0,5">
<UniformGrid Rows="2" Margin="3,3,3,3">
<ComboBox ItemsSource="{Binding LanguageList, Mode=OneWay}" Height="25"
DisplayMemberPath="Name" SelectedItem="{Binding SelectedLanguage}"
Margin="0,0,0,5"/>
<TextBlock Text="{Binding LanguageAdvertMsg}" TextWrapping="Wrap"
TextAlignment="Center"/>
</UniformGrid>
</GroupBox>-->
<UniformGrid Columns="2"
Margin="0,0,0,5">
<TextBlock Text="{Binding TopSceneBackgroundMsg}" VerticalAlignment="Center"/>
<Button Background="{Binding TopSceneBackground}"
Command="{Binding TopSceneBackground_Command}"
Style="{StaticResource EgtWPFLib5_InputButton}"/>
</UniformGrid>
<UniformGrid Columns="2"
Margin="0,0,0,5">
<TextBlock Text="{Binding BotSceneBackgroundMsg}" VerticalAlignment="Center"/>
<Button Background="{Binding BotSceneBackground}"
Command="{Binding BotSceneBackground_Command}"
Style="{StaticResource EgtWPFLib5_InputButton}"/>
</UniformGrid>
<UniformGrid Columns="2"
Margin="0,0,0,5">
<TextBlock Text="{Binding GridColorMsg}" VerticalAlignment="Center"/>
<Button Background="{Binding GridColor}"
Command="{Binding GridColor_Command}"
Style="{StaticResource EgtWPFLib5_InputButton}"/>
</UniformGrid>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="2*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="1*"/>
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
<TextBlock Text="{Binding ThickLineMsg}" VerticalAlignment="Center"
Grid.Row="0" Margin="0,5,0,5"/>
<CheckBox IsChecked="{Binding ThickLine}"
Grid.Column="1" Grid.Row="0" Margin="22,5,0,5" VerticalAlignment="Center"/>
<TextBlock Text="{Binding SmoothTriMeshMsg}" VerticalAlignment="Center"
Grid.Row="1" Margin="0,5,0,5"/>
<CheckBox IsChecked="{Binding SmoothTriMesh}"
Grid.Column="1" Grid.Row="1" Margin="22,5,0,5" VerticalAlignment="Center"/>
</Grid>
<Grid Margin="5,5,5,5">
<Button Content="{Binding UpdateLicenceMsg}" Command="{Binding UpdateLicence_Command}" Height="26" Margin="100,1"/>
</Grid>
</StackPanel>
</TabItem>
<TabItem Header="{Binding CADMsg}">
<StackPanel Margin="5,5,5,0">
<UniformGrid Grid.ColumnSpan="2" Columns="2"
Margin="0,0,0,5">
<TextBlock Text="{Binding GeometryToleranceMsg}" VerticalAlignment="Center"/>
<TextBox Text="{Binding GeometryTolerance}" Height="25"
VerticalContentAlignment="Center"
Margin="10,0,0,0"/>
</UniformGrid>
<ItemsControl ItemsSource="{Binding LayerColorList}">
<ItemsControl.ItemTemplate>
<DataTemplate>
<UniformGrid Columns="2"
Margin="0,0,0,5">
<TextBlock Text="{Binding Color_Msg}" VerticalAlignment="Center"/>
<Grid Margin="10,0,0,0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="35"/>
</Grid.ColumnDefinitions>
<Button Background="{Binding Background}"
Command="{Binding Color_Command}"
Margin="0,0,5,0"
Style="{StaticResource EgtWPFLib5_InputButton}"/>
<Slider Grid.Column="1"
Value="{Binding dAlpha}"
Minimum="10"
Maximum="100"
TickPlacement="BottomRight"
TickFrequency="10"
IsSnapToTickEnabled="True"
Margin="0,0,5,0"/>
<TextBlock Grid.Column="2"
Text="{Binding sAlpha}"
TextAlignment="Right"/>
</Grid>
</UniformGrid>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</StackPanel>
</TabItem>
<TabItem Header="{Binding ImportMsg}">
<StackPanel Margin="5,5,5,0">
<Grid Margin="0,5,0,0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="0.8*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="1*"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
<TextBlock Grid.Row="0" Grid.Column="1"
VerticalAlignment="Center" HorizontalAlignment="Center"
Text="{Binding UnitScaleMsg}" />
<TextBlock Grid.Row="0" Grid.Column="2"
VerticalAlignment="Center" HorizontalAlignment="Center"
Text="{Binding FactorScaleMsg}"/>
<TextBlock Grid.Row="1" Grid.Column="0"
Text="{Binding DxfScaleFactorMsg}" VerticalAlignment="Center"/>
<ComboBox Grid.Row="1" Grid.Column="1"
ItemsSource="{Binding ScaleDXFList, Mode=OneWay}"
SelectedItem="{Binding SelectedDXFScale, UpdateSourceTrigger=PropertyChanged}" Height="25"
Margin="10,0,0,5"/>
<TextBox Grid.Row="1" Grid.Column="2"
Text="{Binding DxfScaleFactor}" Height="25"
IsEnabled="{Binding DXFScaleEnable, UpdateSourceTrigger=LostFocus}"
VerticalContentAlignment="Center"
Margin="10,0,0,5"/>
<TextBlock Grid.Row="2" Grid.Column="0"
Text="{Binding StlScaleFactorMsg}" VerticalAlignment="Center"/>
<ComboBox Grid.Row="2" Grid.Column="1"
ItemsSource="{Binding ScaleSTLList, Mode=OneWay}"
SelectedItem="{Binding SelectedSTLScale, UpdateSourceTrigger=PropertyChanged}" Height="25"
Margin="10,0,0,5"/>
<TextBox Grid.Row="2" Grid.Column="2"
Text="{Binding StlScaleFactor}" Height="25"
IsEnabled="{Binding STLScaleEnable, UpdateSourceTrigger=LostFocus}"
VerticalContentAlignment="Center"
Margin="10,0,0,5"/>
</Grid>
</StackPanel>
</TabItem>
<!--<TabItem Header="{Binding ExportMsg}">
<StackPanel>
<GroupBox Grid.Column="1" Grid.RowSpan="2"
Header="{Binding ImageMsg}"
Margin="5,5,5,0">
<UniformGrid Grid.ColumnSpan="2" Columns="2">
<TextBlock Text="{Binding ImageWidthMsg}" VerticalAlignment="Center"/>
<TextBox Text="{Binding ImageWidth}" Height="25"
VerticalContentAlignment="Center"
Margin="10,0,0,5"/>
<TextBlock Text="{Binding ImageHeightMsg}" VerticalAlignment="Center"/>
<TextBox Text="{Binding ImageHeight}" Height="25"
VerticalContentAlignment="Center"
Margin="10,0,0,5"/>
</UniformGrid>
</GroupBox>
</StackPanel>
</TabItem>-->
<TabItem Header="{Binding CAMMsg}">
<StackPanel>
<Grid Margin="5,5,5,0">
<Button Content="{Binding AddMachineMsg}" Command="{Binding AddMachine_Command}" Height="26" Margin="100,1"/>
</Grid>
<Grid Margin="5,5,5,0">
<Button Content="{Binding ExportMachineMsg}" Command="{Binding ExportMachine_Command}" Height="26" Margin="100,1"/>
</Grid>
</StackPanel>
</TabItem>
</TabControl>
<Button Grid.Row="1"
IsCancel="True"
HorizontalAlignment="Center"
Style="{StaticResource RightPanel_HalfRound_Button}">
<Image Source="\Resources\Common\Ok.png"
Style="{StaticResource Button_Image}"/>
</Button>
</Grid>
</Border>
</Grid>
</EgtWPFLib5:EgtCustomWindow>
+315 -329
View File
@@ -1,342 +1,328 @@
<EgtWPFLib5:EgtMainWindow x:Class="OptionWindowV" <EgtWPFLib5:EgtCustomWindow x:Class="OptionWindowV"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:Icarus="clr-namespace:Icarus" xmlns:Icarus="clr-namespace:Icarus"
xmlns:EgtWPFLib5="clr-namespace:EgtWPFLib5;assembly=EgtWPFLib5" xmlns:EgtWPFLib5="clr-namespace:EgtWPFLib5;assembly=EgtWPFLib5"
Style="{StaticResource Dialog_Window}" Style="{DynamicResource {x:Type EgtWPFLib5:EgtCustomWindow}}"
Title="{Binding Title}" Icon="/Resources/Icarus.ico" Title="{Binding Title}" Icon="/Resources/Icarus.ico"
WindowStyle="None" ResizeMode="NoResize" WindowStyle="None" ResizeMode="NoResize" TitleBarHeight="30" IsResizable="False"
WindowStartupLocation="CenterOwner" ShowInTaskbar="False" IsMinimizable="False" WindowStartupLocation="CenterScreen" ShowInTaskbar="False"
MinWidth="400" MinHeight="382" MinWidth="400" MinHeight="382"
Width="400" Height="412"> Width="400" Height="412">
<!--<EgtWPFLib5:EgtCustomWindow.Resources> <!--<EgtWPFLib5:EgtCustomWindow.Resources>
<local:GeomTypeConverter x:Key="GeomTypeConverter"/> <local:GeomTypeConverter x:Key="GeomTypeConverter"/>
</EgtWPFLib5:EgtCustomWindow.Resources>--> </EgtWPFLib5:EgtCustomWindow.Resources>-->
<Grid> <TabControl Margin="5,5,5,5">
<Grid.RowDefinitions> <TabItem Header="{Binding GenericMsg}">
<RowDefinition Height="1*"/> <StackPanel Margin="5,5,5,0">
<RowDefinition Height="Auto"/> <!--<GroupBox Header="{Binding CurrentLanguageMsg}"
</Grid.RowDefinitions> Margin="0,0,0,5">
<TabControl Margin="5,5,5,5"> <UniformGrid Rows="2" Margin="3,3,3,3">
<TabItem Header="{Binding GenericMsg}"> <ComboBox ItemsSource="{Binding LanguageList, Mode=OneWay}" Height="25"
<StackPanel Margin="5,5,5,0"> DisplayMemberPath="Name" SelectedItem="{Binding SelectedLanguage}"
<!--<GroupBox Header="{Binding CurrentLanguageMsg}" Margin="0,0,0,5"/>
<TextBlock Text="{Binding LanguageAdvertMsg}" TextWrapping="Wrap"
TextAlignment="Center"/>
</UniformGrid>
</GroupBox>-->
<UniformGrid Columns="2"
Margin="0,0,0,5"> Margin="0,0,0,5">
<UniformGrid Rows="2" Margin="3,3,3,3"> <TextBlock Text="{Binding TopSceneBackgroundMsg}" VerticalAlignment="Center"/>
<ComboBox ItemsSource="{Binding LanguageList, Mode=OneWay}" Height="25" <Button Background="{Binding TopSceneBackground}"
DisplayMemberPath="Name" SelectedItem="{Binding SelectedLanguage}" Command="{Binding TopSceneBackground_Command}"
Margin="0,0,0,5"/> Style="{StaticResource EgtWPFLib5_InputButton}"/>
<TextBlock Text="{Binding LanguageAdvertMsg}" TextWrapping="Wrap" </UniformGrid>
TextAlignment="Center"/> <UniformGrid Columns="2"
</UniformGrid>
</GroupBox>-->
<UniformGrid Columns="2"
Margin="0,0,0,5">
<TextBlock Text="{Binding TopSceneBackgroundMsg}" VerticalAlignment="Center"/>
<Button Background="{Binding TopSceneBackground}"
Command="{Binding TopSceneBackground_Command}"
Style="{StaticResource EgtWPFLib5_InputButton}"/>
</UniformGrid>
<UniformGrid Columns="2"
Margin="0,0,0,5">
<TextBlock Text="{Binding BotSceneBackgroundMsg}" VerticalAlignment="Center"/>
<Button Background="{Binding BotSceneBackground}"
Command="{Binding BotSceneBackground_Command}"
Style="{StaticResource EgtWPFLib5_InputButton}"/>
</UniformGrid>
<UniformGrid Columns="2"
Margin="0,0,0,5">
<TextBlock Text="{Binding GridColorMsg}" VerticalAlignment="Center"/>
<Button Background="{Binding GridColor}"
Command="{Binding GridColor_Command}"
Style="{StaticResource EgtWPFLib5_InputButton}"/>
</UniformGrid>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="2*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="1*"/>
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
<TextBlock Text="{Binding ThickLineMsg}" VerticalAlignment="Center"
Grid.Row="0" Margin="0,5,0,5"/>
<CheckBox IsChecked="{Binding ThickLine}"
Grid.Column="1" Grid.Row="0" Margin="22,5,0,5" VerticalAlignment="Center"/>
<TextBlock Text="{Binding SmoothTriMeshMsg}" VerticalAlignment="Center"
Grid.Row="1" Margin="0,5,0,5"/>
<CheckBox IsChecked="{Binding SmoothTriMesh}"
Grid.Column="1" Grid.Row="1" Margin="22,5,0,5" VerticalAlignment="Center"/>
</Grid>
<!--<UniformGrid Columns="2"
Margin="0,0,0,5">
<TextBlock Text="{Binding FontMsg}" VerticalAlignment="Center"/>
<ComboBox ItemsSource="{Binding FontList, Mode=OneWay}"
SelectedItem="{Binding SelectedTextFont}" Height="25"
Margin="10,5,0,0"/>
</UniformGrid>-->
<Grid Margin="5,5,5,5">
<Button Content="{Binding UpdateLicenceMsg}" Command="{Binding UpdateLicence_Command}" Height="26" Margin="100,1"/>
</Grid>
</StackPanel>
</TabItem>
<TabItem Header="{Binding CADMsg}">
<StackPanel Margin="5,5,5,0">
<UniformGrid Grid.ColumnSpan="2" Columns="2"
Margin="0,0,0,5">
<TextBlock Text="{Binding GeometryToleranceMsg}" VerticalAlignment="Center"/>
<TextBox Text="{Binding GeometryTolerance}" Height="25"
VerticalContentAlignment="Center"
Margin="10,0,0,0"/>
</UniformGrid>
<ItemsControl ItemsSource="{Binding LayerColorList}">
<ItemsControl.ItemTemplate>
<DataTemplate>
<UniformGrid Columns="2"
Margin="0,0,0,5">
<TextBlock Text="{Binding Color_Msg}" VerticalAlignment="Center"/>
<Grid Margin="10,0,0,0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="35"/>
</Grid.ColumnDefinitions>
<Button Background="{Binding Background}"
Command="{Binding Color_Command}"
Margin="0,0,5,0"
Style="{StaticResource EgtWPFLib5_InputButton}"/>
<Slider Grid.Column="1"
Value="{Binding dAlpha}"
Minimum="10"
Maximum="100"
TickPlacement="BottomRight"
TickFrequency="10"
IsSnapToTickEnabled="True"
Margin="0,0,5,0"/>
<TextBlock Grid.Column="2"
Text="{Binding sAlpha}"
TextAlignment="Right"/>
</Grid>
</UniformGrid>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
<!--<GroupBox Grid.Column="1" Grid.RowSpan="2"
Header="{Binding DimensionMsg}"
Margin="0,0,0,5"> Margin="0,0,0,5">
<UniformGrid Grid.ColumnSpan="2" Columns="2"> <TextBlock Text="{Binding BotSceneBackgroundMsg}" VerticalAlignment="Center"/>
<TextBlock Text="{Binding ExtLineLenMsg}" VerticalAlignment="Center"/> <Button Background="{Binding BotSceneBackground}"
<TextBox Text="{Binding ExtLineLen}" Height="25" Command="{Binding BotSceneBackground_Command}"
VerticalContentAlignment="Center" Style="{StaticResource EgtWPFLib5_InputButton}"/>
Margin="10,5,0,0"/> </UniformGrid>
<TextBlock Text="{Binding ArrowLenMsg}" VerticalAlignment="Center"/> <UniformGrid Columns="2"
<TextBox Text="{Binding ArrowLen}" Height="25" Margin="0,0,0,5">
VerticalContentAlignment="Center" <TextBlock Text="{Binding GridColorMsg}" VerticalAlignment="Center"/>
Margin="10,5,0,0"/> <Button Background="{Binding GridColor}"
<TextBlock Text="{Binding TextDistMsg}" VerticalAlignment="Center"/> Command="{Binding GridColor_Command}"
<TextBox Text="{Binding TextDist}" Height="25" Style="{StaticResource EgtWPFLib5_InputButton}"/>
VerticalContentAlignment="Center" </UniformGrid>
Margin="10,5,0,0"/> <Grid>
<TextBlock Text="{Binding LenIsMMMsg}" VerticalAlignment="Center"/> <Grid.ColumnDefinitions>
<ComboBox ItemsSource="{Binding UnitMeasureList, Mode=OneWay}" <ColumnDefinition Width="2*"/>
SelectedItem="{Binding SelectedUnitMeasure}" Height="25" <ColumnDefinition Width="1*"/>
Margin="10,5,0,0"/> </Grid.ColumnDefinitions>
<TextBlock Text="{Binding DecDigitMsg}" VerticalAlignment="Center"/> <Grid.RowDefinitions>
<TextBox Text="{Binding DecDigit}" Height="25" <RowDefinition Height="1*"/>
VerticalContentAlignment="Center" <RowDefinition Height="1*"/>
Margin="10,5,0,0"/> </Grid.RowDefinitions>
<TextBlock Text="{Binding FontMsg}" VerticalAlignment="Center"/> <TextBlock Text="{Binding ThickLineMsg}" VerticalAlignment="Center"
<ComboBox ItemsSource="{Binding FontList, Mode=OneWay}" Grid.Row="0" Margin="0,5,0,5"/>
SelectedItem="{Binding SelectedFont}" Height="25" <CheckBox IsChecked="{Binding ThickLine}"
Margin="10,5,0,0"/> Grid.Column="1" Grid.Row="0" Margin="22,5,0,5" VerticalAlignment="Center"/>
<TextBlock Text="{Binding TextHeightMsg}" VerticalAlignment="Center"/> <TextBlock Text="{Binding SmoothTriMeshMsg}" VerticalAlignment="Center"
<TextBox Text="{Binding TextHeight}" Height="25" Grid.Row="1" Margin="0,5,0,5"/>
VerticalContentAlignment="Center" <CheckBox IsChecked="{Binding SmoothTriMesh}"
Margin="10,5,0,0"/> Grid.Column="1" Grid.Row="1" Margin="22,5,0,5" VerticalAlignment="Center"/>
</UniformGrid> </Grid>
</GroupBox>--> <!--<UniformGrid Columns="2"
</StackPanel> Margin="0,0,0,5">
<TextBlock Text="{Binding FontMsg}" VerticalAlignment="Center"/>
<ComboBox ItemsSource="{Binding FontList, Mode=OneWay}"
SelectedItem="{Binding SelectedTextFont}" Height="25"
Margin="10,5,0,0"/>
</UniformGrid>-->
<Grid Margin="5,5,5,5">
<Button Content="{Binding UpdateLicenceMsg}" Command="{Binding UpdateLicence_Command}" Height="26" Margin="100,1"/>
</Grid>
</StackPanel>
</TabItem>
<TabItem Header="{Binding CADMsg}">
<StackPanel Margin="5,5,5,0">
<UniformGrid Grid.ColumnSpan="2" Columns="2"
Margin="0,0,0,5">
<TextBlock Text="{Binding GeometryToleranceMsg}" VerticalAlignment="Center"/>
<TextBox Text="{Binding GeometryTolerance}" Height="25"
VerticalContentAlignment="Center"
Margin="10,0,0,0"/>
</UniformGrid>
<ItemsControl ItemsSource="{Binding LayerColorList}">
<ItemsControl.ItemTemplate>
<DataTemplate>
<UniformGrid Columns="2"
Margin="0,0,0,5">
<TextBlock Text="{Binding Color_Msg}" VerticalAlignment="Center"/>
<Grid Margin="10,0,0,0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="35"/>
</Grid.ColumnDefinitions>
<Button Background="{Binding Background}"
Command="{Binding Color_Command}"
Margin="0,0,5,0"
Style="{StaticResource EgtWPFLib5_InputButton}"/>
<Slider Grid.Column="1"
Value="{Binding dAlpha}"
Minimum="10"
Maximum="100"
TickPlacement="BottomRight"
TickFrequency="10"
IsSnapToTickEnabled="True"
Margin="0,0,5,0"/>
<TextBlock Grid.Column="2"
Text="{Binding sAlpha}"
TextAlignment="Right"/>
</Grid>
</UniformGrid>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
<!--<GroupBox Grid.Column="1" Grid.RowSpan="2"
Header="{Binding DimensionMsg}"
Margin="0,0,0,5">
<UniformGrid Grid.ColumnSpan="2" Columns="2">
<TextBlock Text="{Binding ExtLineLenMsg}" VerticalAlignment="Center"/>
<TextBox Text="{Binding ExtLineLen}" Height="25"
VerticalContentAlignment="Center"
Margin="10,5,0,0"/>
<TextBlock Text="{Binding ArrowLenMsg}" VerticalAlignment="Center"/>
<TextBox Text="{Binding ArrowLen}" Height="25"
VerticalContentAlignment="Center"
Margin="10,5,0,0"/>
<TextBlock Text="{Binding TextDistMsg}" VerticalAlignment="Center"/>
<TextBox Text="{Binding TextDist}" Height="25"
VerticalContentAlignment="Center"
Margin="10,5,0,0"/>
<TextBlock Text="{Binding LenIsMMMsg}" VerticalAlignment="Center"/>
<ComboBox ItemsSource="{Binding UnitMeasureList, Mode=OneWay}"
SelectedItem="{Binding SelectedUnitMeasure}" Height="25"
Margin="10,5,0,0"/>
<TextBlock Text="{Binding DecDigitMsg}" VerticalAlignment="Center"/>
<TextBox Text="{Binding DecDigit}" Height="25"
VerticalContentAlignment="Center"
Margin="10,5,0,0"/>
<TextBlock Text="{Binding FontMsg}" VerticalAlignment="Center"/>
<ComboBox ItemsSource="{Binding FontList, Mode=OneWay}"
SelectedItem="{Binding SelectedFont}" Height="25"
Margin="10,5,0,0"/>
<TextBlock Text="{Binding TextHeightMsg}" VerticalAlignment="Center"/>
<TextBox Text="{Binding TextHeight}" Height="25"
VerticalContentAlignment="Center"
Margin="10,5,0,0"/>
</UniformGrid>
</GroupBox>-->
</StackPanel>
</TabItem> </TabItem>
<TabItem Header="{Binding ImportMsg}"> <TabItem Header="{Binding ImportMsg}">
<StackPanel Margin="5,5,5,0"> <StackPanel Margin="5,5,5,0">
<Grid Margin="0,5,0,0"> <Grid Margin="0,5,0,0">
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/> <ColumnDefinition Width="1*"/>
<ColumnDefinition Width="0.8*"/> <ColumnDefinition Width="0.8*"/>
<ColumnDefinition Width="1*"/> <ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<Grid.RowDefinitions> <Grid.RowDefinitions>
<RowDefinition Height="1*"/> <RowDefinition Height="1*"/>
<RowDefinition Height="1*"/> <RowDefinition Height="1*"/>
<RowDefinition Height="1*"/> <RowDefinition Height="1*"/>
<RowDefinition Height="1*"/> <RowDefinition Height="1*"/>
</Grid.RowDefinitions> </Grid.RowDefinitions>
<TextBlock Grid.Row="0" Grid.Column="1" <TextBlock Grid.Row="0" Grid.Column="1"
VerticalAlignment="Center" HorizontalAlignment="Center" VerticalAlignment="Center" HorizontalAlignment="Center"
Text="{Binding UnitScaleMsg}" /> Text="{Binding UnitScaleMsg}" />
<TextBlock Grid.Row="0" Grid.Column="2" <TextBlock Grid.Row="0" Grid.Column="2"
VerticalAlignment="Center" HorizontalAlignment="Center" VerticalAlignment="Center" HorizontalAlignment="Center"
Text="{Binding FactorScaleMsg}"/> Text="{Binding FactorScaleMsg}"/>
<TextBlock Grid.Row="1" Grid.Column="0" <TextBlock Grid.Row="1" Grid.Column="0"
Text="{Binding DxfScaleFactorMsg}" VerticalAlignment="Center"/> Text="{Binding DxfScaleFactorMsg}" VerticalAlignment="Center"/>
<ComboBox Grid.Row="1" Grid.Column="1" <ComboBox Grid.Row="1" Grid.Column="1"
ItemsSource="{Binding ScaleDXFList, Mode=OneWay}" ItemsSource="{Binding ScaleDXFList, Mode=OneWay}"
SelectedItem="{Binding SelectedDXFScale, UpdateSourceTrigger=PropertyChanged}" Height="25" SelectedItem="{Binding SelectedDXFScale, UpdateSourceTrigger=PropertyChanged}" Height="25"
Margin="10,0,0,5"/> Margin="10,0,0,5"/>
<TextBox Grid.Row="1" Grid.Column="2" <TextBox Grid.Row="1" Grid.Column="2"
Text="{Binding DxfScaleFactor}" Height="25" Text="{Binding DxfScaleFactor}" Height="25"
IsEnabled="{Binding DXFScaleEnable, UpdateSourceTrigger=LostFocus}" IsEnabled="{Binding DXFScaleEnable, UpdateSourceTrigger=LostFocus}"
VerticalContentAlignment="Center" VerticalContentAlignment="Center"
Margin="10,0,0,5"/> Margin="10,0,0,5"/>
<TextBlock Grid.Row="2" Grid.Column="0" <TextBlock Grid.Row="2" Grid.Column="0"
Text="{Binding StlScaleFactorMsg}" VerticalAlignment="Center"/> Text="{Binding StlScaleFactorMsg}" VerticalAlignment="Center"/>
<ComboBox Grid.Row="2" Grid.Column="1" <ComboBox Grid.Row="2" Grid.Column="1"
ItemsSource="{Binding ScaleSTLList, Mode=OneWay}" ItemsSource="{Binding ScaleSTLList, Mode=OneWay}"
SelectedItem="{Binding SelectedSTLScale, UpdateSourceTrigger=PropertyChanged}" Height="25" SelectedItem="{Binding SelectedSTLScale, UpdateSourceTrigger=PropertyChanged}" Height="25"
Margin="10,0,0,5"/> Margin="10,0,0,5"/>
<TextBox Grid.Row="2" Grid.Column="2" <TextBox Grid.Row="2" Grid.Column="2"
Text="{Binding StlScaleFactor}" Height="25" Text="{Binding StlScaleFactor}" Height="25"
IsEnabled="{Binding STLScaleEnable, UpdateSourceTrigger=LostFocus}" IsEnabled="{Binding STLScaleEnable, UpdateSourceTrigger=LostFocus}"
VerticalContentAlignment="Center" VerticalContentAlignment="Center"
Margin="10,0,0,5"/> Margin="10,0,0,5"/>
<!--<TextBlock Grid.Row="3" Grid.Column="0" <!--<TextBlock Grid.Row="3" Grid.Column="0"
Text="{Binding ImageScaleFactorMsg}" VerticalAlignment="Center"/> Text="{Binding ImageScaleFactorMsg}" VerticalAlignment="Center"/>
<ComboBox Grid.Row="3" Grid.Column="1" <ComboBox Grid.Row="3" Grid.Column="1"
ItemsSource="{Binding ScaleImageList, Mode=OneWay}" ItemsSource="{Binding ScaleImageList, Mode=OneWay}"
SelectedItem="{Binding SelectedImageScale, UpdateSourceTrigger=PropertyChanged}" Height="25" SelectedItem="{Binding SelectedImageScale, UpdateSourceTrigger=PropertyChanged}" Height="25"
Margin="10,0,0,5"/> Margin="10,0,0,5"/>
<TextBox Grid.Row="3" Grid.Column="2" <TextBox Grid.Row="3" Grid.Column="2"
Text="{Binding ImageScaleFactor}" Height="25" Text="{Binding ImageScaleFactor}" Height="25"
IsEnabled="{Binding ImageScaleEnable, UpdateSourceTrigger=LostFocus}" IsEnabled="{Binding ImageScaleEnable, UpdateSourceTrigger=LostFocus}"
VerticalContentAlignment="Center" VerticalContentAlignment="Center"
Margin="10,0,0,5"/>--> Margin="10,0,0,5"/>-->
</Grid> </Grid>
</StackPanel> </StackPanel>
</TabItem> </TabItem>
<!--<TabItem Header="{Binding ExportMsg}"> <!--<TabItem Header="{Binding ExportMsg}">
<StackPanel> <StackPanel>
<GroupBox Grid.Column="1" Grid.RowSpan="2" <GroupBox Grid.Column="1" Grid.RowSpan="2"
Header="{Binding ImageMsg}" Header="{Binding ImageMsg}"
Margin="5,5,5,0"> Margin="5,5,5,0">
<UniformGrid Grid.ColumnSpan="2" Columns="2"> <UniformGrid Grid.ColumnSpan="2" Columns="2">
<TextBlock Text="{Binding ImageWidthMsg}" VerticalAlignment="Center"/> <TextBlock Text="{Binding ImageWidthMsg}" VerticalAlignment="Center"/>
<TextBox Text="{Binding ImageWidth}" Height="25" <TextBox Text="{Binding ImageWidth}" Height="25"
VerticalContentAlignment="Center" VerticalContentAlignment="Center"
Margin="10,0,0,5"/> Margin="10,0,0,5"/>
<TextBlock Text="{Binding ImageHeightMsg}" VerticalAlignment="Center"/> <TextBlock Text="{Binding ImageHeightMsg}" VerticalAlignment="Center"/>
<TextBox Text="{Binding ImageHeight}" Height="25" <TextBox Text="{Binding ImageHeight}" Height="25"
VerticalContentAlignment="Center" VerticalContentAlignment="Center"
Margin="10,0,0,5"/> Margin="10,0,0,5"/>
</UniformGrid> </UniformGrid>
</GroupBox> </GroupBox>
</StackPanel> </StackPanel>
</TabItem>--> </TabItem>-->
<TabItem Header="{Binding CAMMsg}"> <TabItem Header="{Binding CAMMsg}">
<StackPanel> <StackPanel>
<!--<GroupBox Grid.Column="1" Grid.RowSpan="2" <!--<GroupBox Grid.Column="1" Grid.RowSpan="2"
Header="{Binding MachiningSelGeomMsg}" Header="{Binding MachiningSelGeomMsg}"
Margin="5,5,5,0"> Margin="5,5,5,0">
<UniformGrid Columns="2"> <UniformGrid Columns="2">
<TextBlock Text="{Binding GeomTypeDrillingMsg}" VerticalAlignment="Center"/> <TextBlock Text="{Binding GeomTypeDrillingMsg}" VerticalAlignment="Center"/>
<ComboBox ItemsSource="{Binding GeomTypeList, Mode=OneWay}" <ComboBox ItemsSource="{Binding GeomTypeList, Mode=OneWay}"
SelectedItem="{Binding SelectedDrillingGeomType}" Height="25"> SelectedItem="{Binding SelectedDrillingGeomType}" Height="25">
<ComboBox.ItemTemplate> <ComboBox.ItemTemplate>
<DataTemplate> <DataTemplate>
<TextBlock Text="{Binding Converter={StaticResource GeomTypeConverter}}"/> <TextBlock Text="{Binding Converter={StaticResource GeomTypeConverter}}"/>
</DataTemplate> </DataTemplate>
</ComboBox.ItemTemplate> </ComboBox.ItemTemplate>
</ComboBox> </ComboBox>
<TextBlock Text="{Binding GeomTypeSawingMsg}" VerticalAlignment="Center"/> <TextBlock Text="{Binding GeomTypeSawingMsg}" VerticalAlignment="Center"/>
<ComboBox ItemsSource="{Binding GeomTypeList, Mode=OneWay}" <ComboBox ItemsSource="{Binding GeomTypeList, Mode=OneWay}"
SelectedItem="{Binding SelectedSawingGeomType}" Height="25"> SelectedItem="{Binding SelectedSawingGeomType}" Height="25">
<ComboBox.ItemTemplate> <ComboBox.ItemTemplate>
<DataTemplate> <DataTemplate>
<TextBlock Text="{Binding Converter={StaticResource GeomTypeConverter}}"/> <TextBlock Text="{Binding Converter={StaticResource GeomTypeConverter}}"/>
</DataTemplate> </DataTemplate>
</ComboBox.ItemTemplate> </ComboBox.ItemTemplate>
</ComboBox> </ComboBox>
<TextBlock Text="{Binding GeomTypeMillingMsg}" VerticalAlignment="Center"/> <TextBlock Text="{Binding GeomTypeMillingMsg}" VerticalAlignment="Center"/>
<ComboBox ItemsSource="{Binding GeomTypeList, Mode=OneWay}" <ComboBox ItemsSource="{Binding GeomTypeList, Mode=OneWay}"
SelectedItem="{Binding SelectedMillingGeomType}" Height="25" SelectedItem="{Binding SelectedMillingGeomType}" Height="25"
Margin="0,0,0,5"> Margin="0,0,0,5">
<ComboBox.ItemTemplate> <ComboBox.ItemTemplate>
<DataTemplate> <DataTemplate>
<TextBlock Text="{Binding Converter={StaticResource GeomTypeConverter}}"/> <TextBlock Text="{Binding Converter={StaticResource GeomTypeConverter}}"/>
</DataTemplate> </DataTemplate>
</ComboBox.ItemTemplate> </ComboBox.ItemTemplate>
</ComboBox> </ComboBox>
<TextBlock Text="{Binding GeomTypePocketingMsg}" VerticalAlignment="Center"/> <TextBlock Text="{Binding GeomTypePocketingMsg}" VerticalAlignment="Center"/>
<ComboBox ItemsSource="{Binding GeomTypeList, Mode=OneWay}" <ComboBox ItemsSource="{Binding GeomTypeList, Mode=OneWay}"
SelectedItem="{Binding SelectedPocketingGeomType}" Height="25"> SelectedItem="{Binding SelectedPocketingGeomType}" Height="25">
<ComboBox.ItemTemplate> <ComboBox.ItemTemplate>
<DataTemplate> <DataTemplate>
<TextBlock Text="{Binding Converter={StaticResource GeomTypeConverter}}"/> <TextBlock Text="{Binding Converter={StaticResource GeomTypeConverter}}"/>
</DataTemplate> </DataTemplate>
</ComboBox.ItemTemplate> </ComboBox.ItemTemplate>
</ComboBox> </ComboBox>
<TextBlock Text="{Binding GeomTypeMortisingMsg}" VerticalAlignment="Center"/> <TextBlock Text="{Binding GeomTypeMortisingMsg}" VerticalAlignment="Center"/>
<ComboBox ItemsSource="{Binding GeomTypeList, Mode=OneWay}" <ComboBox ItemsSource="{Binding GeomTypeList, Mode=OneWay}"
SelectedItem="{Binding SelectedMortisingGeomType}" Height="25"> SelectedItem="{Binding SelectedMortisingGeomType}" Height="25">
<ComboBox.ItemTemplate> <ComboBox.ItemTemplate>
<DataTemplate> <DataTemplate>
<TextBlock Text="{Binding Converter={StaticResource GeomTypeConverter}}"/> <TextBlock Text="{Binding Converter={StaticResource GeomTypeConverter}}"/>
</DataTemplate> </DataTemplate>
</ComboBox.ItemTemplate> </ComboBox.ItemTemplate>
</ComboBox> </ComboBox>
<TextBlock Text="{Binding GeomTypeChiselingMsg}" VerticalAlignment="Center"/> <TextBlock Text="{Binding GeomTypeChiselingMsg}" VerticalAlignment="Center"/>
<ComboBox ItemsSource="{Binding GeomTypeList, Mode=OneWay}" <ComboBox ItemsSource="{Binding GeomTypeList, Mode=OneWay}"
SelectedItem="{Binding SelectedChiselingGeomType}" Height="25"> SelectedItem="{Binding SelectedChiselingGeomType}" Height="25">
<ComboBox.ItemTemplate> <ComboBox.ItemTemplate>
<DataTemplate> <DataTemplate>
<TextBlock Text="{Binding Converter={StaticResource GeomTypeConverter}}"/> <TextBlock Text="{Binding Converter={StaticResource GeomTypeConverter}}"/>
</DataTemplate> </DataTemplate>
</ComboBox.ItemTemplate> </ComboBox.ItemTemplate>
</ComboBox> </ComboBox>
</UniformGrid> </UniformGrid>
</GroupBox>--> </GroupBox>-->
<!--<Grid Margin="5,5,5,0"> <!--<Grid Margin="5,5,5,0">
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
<ColumnDefinition Width="2*"/> <ColumnDefinition Width="2*"/>
<ColumnDefinition Width="1*"/> <ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<Grid.RowDefinitions> <Grid.RowDefinitions>
<RowDefinition Height="1*"/> <RowDefinition Height="1*"/>
<RowDefinition Height="1*"/> <RowDefinition Height="1*"/>
</Grid.RowDefinitions> </Grid.RowDefinitions>
<TextBlock Text="{Binding NewMachiningPosMsg}" VerticalAlignment="Center" <TextBlock Text="{Binding NewMachiningPosMsg}" VerticalAlignment="Center"
Grid.Row="0" Margin="0,0,0,5"/> Grid.Row="0" Margin="0,0,0,5"/>
<CheckBox IsChecked="{Binding NewMachiningIsLastOne}" <CheckBox IsChecked="{Binding NewMachiningIsLastOne}"
Grid.Column="1" Grid.Row="0" Margin="4,0,0,0" VerticalAlignment="Center"/> Grid.Column="1" Grid.Row="0" Margin="4,0,0,0" VerticalAlignment="Center"/>
<TextBlock Text="{Binding UseDispositionScriptMsg}" VerticalAlignment="Center" <TextBlock Text="{Binding UseDispositionScriptMsg}" VerticalAlignment="Center"
Grid.Row="1" Margin="0,0,0,5"/> Grid.Row="1" Margin="0,0,0,5"/>
<CheckBox IsChecked="{Binding UseDispositionScript}" <CheckBox IsChecked="{Binding UseDispositionScript}"
Grid.Column="1" Grid.Row="1" Margin="4,0,0,0" VerticalAlignment="Center"/> Grid.Column="1" Grid.Row="1" Margin="4,0,0,0" VerticalAlignment="Center"/>
</Grid>--> </Grid>-->
<Grid Margin="5,5,5,0"> <Grid Margin="5,5,5,0">
<Button Content="{Binding AddMachineMsg}" Command="{Binding AddMachine_Command}" Height="26" Margin="100,1"/> <Button Content="{Binding AddMachineMsg}" Command="{Binding AddMachine_Command}" Height="26" Margin="100,1"/>
</Grid> </Grid>
<Grid Margin="5,5,5,0"> <Grid Margin="5,5,5,0">
<Button Content="{Binding ExportMachineMsg}" Command="{Binding ExportMachine_Command}" Height="26" Margin="100,1"/> <Button Content="{Binding ExportMachineMsg}" Command="{Binding ExportMachine_Command}" Height="26" Margin="100,1"/>
</Grid> </Grid>
</StackPanel> </StackPanel>
</TabItem> </TabItem>
</TabControl> </TabControl>
<Button Grid.Row="1"
Command="{Binding Ok_Command}"
IsCancel="True"
Margin="0,0,2.5,0"
Style="{StaticResource RightPanel_HalfRound_Button}">
<Image Source="\Resources\Common\Ok.png"
Style="{StaticResource Button_Image}"/>
</Button>
</Grid>
</EgtWPFLib5:EgtMainWindow> </EgtWPFLib5:EgtCustomWindow>
+89 -58
View File
@@ -563,17 +563,17 @@ Public Class OptionWindowVM
End Property End Property
Public ReadOnly Property ThickLineMsg As String Public ReadOnly Property ThickLineMsg As String
Get Get
Return EgtMsg(6536) ' Linee spesse Return EgtMsg( 6536) ' Linee spesse
End Get End Get
End Property End Property
Public ReadOnly Property SmoothTriMeshMsg As String Public ReadOnly Property SmoothTriMeshMsg As String
Get Get
Return EgtMsg(6518) ' Superfici smussate Return EgtMsg( 6518) ' Superfici smussate
End Get End Get
End Property End Property
Public ReadOnly Property UpdateLicenceMsg As String Public ReadOnly Property UpdateLicenceMsg As String
Get Get
Return EgtMsg(6553) ' Aggiorna licenza Return EgtMsg( 6553) ' Aggiorna licenza
End Get End Get
End Property End Property
@@ -953,74 +953,71 @@ Public Class OptionWindowVM
Dim sMachDir As String = Path.Combine(Map.refMainWindowVM.MainWindowM.sMachinesRoot, sMachName) Dim sMachDir As String = Path.Combine(Map.refMainWindowVM.MainWindowM.sMachinesRoot, sMachName)
' Preparo direttorio temporaneo ' Preparo direttorio temporaneo
Dim sTempDir As String = Path.Combine(Map.refMainWindowVM.MainWindowM.sMachinesRoot, "Temp") Dim sTempDir As String = Path.Combine(Map.refMainWindowVM.MainWindowM.sMachinesRoot, "Temp")
If My.Computer.FileSystem.DirectoryExists(sTempDir) Then If My.Computer.FileSystem.DirectoryExists( sTempDir) Then
My.Computer.FileSystem.DeleteDirectory(sTempDir, FileIO.DeleteDirectoryOption.DeleteAllContents) My.Computer.FileSystem.DeleteDirectory( sTempDir, FileIO.DeleteDirectoryOption.DeleteAllContents)
End If End If
My.Computer.FileSystem.CreateDirectory(sTempDir) My.Computer.FileSystem.CreateDirectory( sTempDir)
' Unzip nel direttorio temporaneo ' Unzip nel direttorio temporaneo
Using zip As New Ionic.Zip.ZipFile(sMachZip) Using zip As New Ionic.Zip.ZipFile(sMachZip)
zip.ExtractAll(sTempDir, Ionic.Zip.ExtractExistingFileAction.DoNotOverwrite) zip.ExtractAll( sTempDir, Ionic.Zip.ExtractExistingFileAction.DoNotOverwrite)
End Using End Using
' Se non è una macchina segnalo il problema ed esco ' Se non è una macchina segnalo il problema ed esco
If Not My.Computer.FileSystem.FileExists(Path.Combine(sTempDir, sMachName, sMachName & ".ini")) Or If Not My.Computer.FileSystem.FileExists( Path.Combine( sTempDir, sMachName, sMachName & ".ini")) Or
Not My.Computer.FileSystem.FileExists(Path.Combine(sTempDir, sMachName, sMachName & ".mlde")) Then Not My.Computer.FileSystem.FileExists( Path.Combine( sTempDir, sMachName, sMachName & ".mlde")) Then
' Il file {0} non contiene una macchina - Avviso ' Il file {0} non contiene una macchina - Avviso
Dim sOut As String = String.Format(EgtMsg(6529), sMachZip) Dim sOut As String = String.Format(EgtMsg(6529), sMachZip)
'MessageBox.Show(sOut, EgtMsg(MSG_MESSAGEBOX + 2), MessageBoxButton.OK, MessageBoxImage.Warning) MessageBox.Show(sOut, EgtMsg(MSG_MESSAGEBOX + 2), MessageBoxButton.OK, MessageBoxImage.Warning)
EgtMessageBoxV.Show(Application.Current.MainWindow, sOut, EgtMsg(MSG_MESSAGEBOX + 2), MessageBoxButton.OK, MessageBoxImage.Warning)
' Rimuovo il direttorio temporaneo ed esco ' Rimuovo il direttorio temporaneo ed esco
My.Computer.FileSystem.DeleteDirectory(sTempDir, FileIO.DeleteDirectoryOption.DeleteAllContents) My.Computer.FileSystem.DeleteDirectory( sTempDir, FileIO.DeleteDirectoryOption.DeleteAllContents)
Return Return
End If End If
' Imposto data e ora correnti al file mlde della macchina ' Imposto data e ora correnti al file mlde della macchina
Try Try
File.SetLastWriteTime(Path.Combine(sTempDir, sMachName, sMachName & ".mlde"), System.DateTime.Now) File.SetLastWriteTime( Path.Combine( sTempDir, sMachName, sMachName & ".mlde"), System.DateTime.Now)
Catch ex As Exception Catch ex As Exception
End Try End Try
' Verifico esistenza di una macchina con lo stesso nome ' Verifico esistenza di una macchina con lo stesso nome
Dim bOldExists As Boolean = My.Computer.FileSystem.DirectoryExists(sMachDir) Dim bOldExists As Boolean = My.Computer.FileSystem.DirectoryExists( sMachDir)
Dim bUpdate As Boolean = True Dim bUpdate As Boolean = True
If bOldExists Then If bOldExists Then
Dim MachBox As New UpdateMachineV(Application.Current.MainWindow, New UpdateMachineVM(sMachName)) Dim MachBox As New MachineBox( Application.Current.MainWindow, sMachName)
MachBox.ShowDialog() Select MachBox.ShowDialog()
Select Case MachBox.DialogResult Case MessageBoxResult.Yes
Case MessageBoxResult.Yes bUpdate = False
bUpdate = False Case MessageBoxResult.No
Case MessageBoxResult.No bUpdate = True
bUpdate = True Case MessageBoxResult.Cancel
Case MessageBoxResult.Cancel ' Rimuovo il direttorio temporaneo ed esco
' Rimuovo il direttorio temporaneo ed esco My.Computer.FileSystem.DeleteDirectory( sTempDir, FileIO.DeleteDirectoryOption.DeleteAllContents)
My.Computer.FileSystem.DeleteDirectory(sTempDir, FileIO.DeleteDirectoryOption.DeleteAllContents) Return
Return
End Select End Select
' Faccio una copia di backup della macchina corrente ' Faccio una copia di backup della macchina corrente
Dim sBackupDir As String = sMachDir & ".old" Dim sBackupDir As String = sMachDir & ".old"
If My.Computer.FileSystem.DirectoryExists(sBackupDir) Then If My.Computer.FileSystem.DirectoryExists( sBackupDir) Then
My.Computer.FileSystem.DeleteDirectory(sBackupDir, FileIO.DeleteDirectoryOption.DeleteAllContents) My.Computer.FileSystem.DeleteDirectory( sBackupDir, FileIO.DeleteDirectoryOption.DeleteAllContents)
End If End If
Try Try
My.Computer.FileSystem.MoveDirectory(sMachDir, sBackupDir, True) My.Computer.FileSystem.MoveDirectory( sMachDir, sBackupDir, True)
Catch ex As Exception Catch ex As Exception
' Ripristino lo stato originale ed esco ' Ripristino lo stato originale ed esco
My.Computer.FileSystem.MoveDirectory(sBackupDir, sMachDir, True) My.Computer.FileSystem.MoveDirectory( sBackupDir, sMachDir, True)
' L'aggiornamento della macchina "{0}" non è riuscito. ' L'aggiornamento della macchina "{0}" non è riuscito.
Dim sKo As String = String.Format(EgtMsg(6535), sMachName) Dim sKo As String = String.Format(EgtMsg(6535), sMachName)
EgtOutLog(sKo) EgtOutLog( sKo)
'MessageBox.Show(sKo, EgtMsg(MSG_MESSAGEBOX + 1), MessageBoxButton.OK) MessageBox.Show(sKo, EgtMsg(MSG_MESSAGEBOX + 1), MessageBoxButton.OK)
EgtMessageBoxV.Show(Application.Current.MainWindow, sKo, EgtMsg(MSG_MESSAGEBOX + 1), MessageBoxButton.OK)
Return Return
End Try End Try
End If End If
' Installo la macchina ' Installo la macchina
My.Computer.FileSystem.MoveDirectory(Path.Combine(sTempDir, sMachName), sMachDir, True) My.Computer.FileSystem.MoveDirectory( Path.Combine( sTempDir, sMachName), sMachDir, True)
' Se è un aggiornamento, recupero utensili, lavorazioni, attrezzaggi e dati per travi ' Se è un aggiornamento, recupero utensili, lavorazioni, attrezzaggi e dati per travi
If bOldExists And bUpdate Then If bOldExists And bUpdate Then
Dim sBackupDir As String = sMachDir & ".old" Dim sBackupDir As String = sMachDir & ".old"
If My.Computer.FileSystem.DirectoryExists(sBackupDir & "\Tools") Then If My.Computer.FileSystem.DirectoryExists( sBackupDir & "\Tools") Then
If My.Computer.FileSystem.DirectoryExists(sMachDir & "\Tools") Then If My.Computer.FileSystem.DirectoryExists( sMachDir & "\Tools") Then
My.Computer.FileSystem.DeleteDirectory(sMachDir & "\Tools", FileIO.DeleteDirectoryOption.DeleteAllContents) My.Computer.FileSystem.DeleteDirectory( sMachDir & "\Tools", FileIO.DeleteDirectoryOption.DeleteAllContents)
End If End If
My.Computer.FileSystem.CopyDirectory(sBackupDir & "\Tools", sMachDir & "\Tools", True) My.Computer.FileSystem.CopyDirectory( sBackupDir & "\Tools", sMachDir & "\Tools", True)
End If End If
If My.Computer.FileSystem.DirectoryExists(sBackupDir & "\Machinings") Then If My.Computer.FileSystem.DirectoryExists(sBackupDir & "\Machinings") Then
If My.Computer.FileSystem.DirectoryExists(sMachDir & "\Machinings") Then If My.Computer.FileSystem.DirectoryExists(sMachDir & "\Machinings") Then
@@ -1040,20 +1037,57 @@ Public Class OptionWindowVM
End If End If
My.Computer.FileSystem.CopyDirectory(sBackupDir & "\SetUp", sMachDir & "\SetUp", True) My.Computer.FileSystem.CopyDirectory(sBackupDir & "\SetUp", sMachDir & "\SetUp", True)
End If End If
If My.Computer.FileSystem.DirectoryExists(sBackupDir & "\CustomData") Then 'If My.Computer.FileSystem.DirectoryExists( sBackupDir & "\Beam") Then
If My.Computer.FileSystem.DirectoryExists(sMachDir & "\CustomData") Then ' ' Flag per sovrascrivere vecchio file BeamData.lua con nuovo
My.Computer.FileSystem.DeleteDirectory(sMachDir & "\CustomData", FileIO.DeleteDirectoryOption.DeleteAllContents) ' Dim bBeamDataExists As Boolean = False
End If ' Const sBeamData As String = "\BeamData.lua"
My.Computer.FileSystem.CopyDirectory(sBackupDir & "\CustomData", sMachDir & "\CustomData", True) ' ' Flag per sovrascrivere vecchio file MachiningTypes.ini
End If ' Dim bMchgTypesExists As Boolean = False
' Const sMchgTypes As String = "\MachiningTypes.ini"
' If My.Computer.FileSystem.DirectoryExists( sMachDir & "\Beam") Then
' If My.Computer.FileSystem.FileExists( sMachDir & "\Beam" & sBeamData) Then
' bBeamDataExists = True
' My.Computer.FileSystem.MoveFile( sMachDir & "\Beam" & sBeamData, sMachDir & sBeamData, True)
' End If
' If My.Computer.FileSystem.FileExists( sMachDir & "\Beam" & sMchgTypes) Then
' bMchgTypesExists = True
' My.Computer.FileSystem.MoveFile( sMachDir & "\Beam" & sMchgTypes, sMachDir & sMchgTypes, True)
' End If
' My.Computer.FileSystem.DeleteDirectory( sMachDir & "\Beam", FileIO.DeleteDirectoryOption.DeleteAllContents)
' End If
' My.Computer.FileSystem.CopyDirectory( sBackupDir & "\Beam", sMachDir & "\Beam", True)
' If bBeamDataExists Then My.Computer.FileSystem.MoveFile( sMachDir & sBeamData, sMachDir & "\Beam" & sBeamData, True)
' If bMchgTypesExists Then My.Computer.FileSystem.MoveFile( sMachDir & sMchgTypes, sMachDir & "\Beam" & sMchgTypes, True)
'End If
'If My.Computer.FileSystem.DirectoryExists( sBackupDir & "\Wall") Then
' ' Flag per sovrascrittura vecchio file WallData.lua con nuovo
' Dim bWallDataExists As Boolean = False
' Const sWallData As String = "\WallData.lua"
' ' Flag per sovrascrivere vecchio file MachiningTypes.ini
' Dim bMchgTypesExists As Boolean = False
' Const sMchgTypes As String = "\MachiningTypes.ini"
' If My.Computer.FileSystem.DirectoryExists( sMachDir & "\Wall") Then
' If My.Computer.FileSystem.FileExists( sMachDir & "\Wall" & sWallData) Then
' bWallDataExists = True
' My.Computer.FileSystem.MoveFile( sMachDir & "\Wall" & sWallData, sMachDir & sWallData, True)
' End If
' If My.Computer.FileSystem.FileExists( sMachDir & "\Wall" & sMchgTypes) Then
' bMchgTypesExists = True
' My.Computer.FileSystem.MoveFile( sMachDir & "\Wall" & sMchgTypes, sMachDir & sMchgTypes, True)
' End If
' My.Computer.FileSystem.DeleteDirectory( sMachDir & "\Wall", FileIO.DeleteDirectoryOption.DeleteAllContents)
' End If
' My.Computer.FileSystem.CopyDirectory( sBackupDir & "\Wall", sMachDir & "\Wall", True)
' If bWallDataExists Then My.Computer.FileSystem.MoveFile( sMachDir & sWallData, sMachDir & "\Wall" & sWallData, True)
' If bMchgTypesExists Then My.Computer.FileSystem.MoveFile( sMachDir & sMchgTypes, sMachDir & "\Wall" & sMchgTypes, True)
'End If
End If End If
'La macchina "{0}" è stata aggiornata con successo. 'La macchina "{0}" è stata aggiornata con successo.
Dim sOk As String = String.Format(EgtMsg(6530), sMachName) Dim sOk As String = String.Format(EgtMsg(6530), sMachName)
EgtOutLog(sOk) EgtOutLog( sOk)
'MessageBox.Show(sOk, EgtMsg(MSG_MESSAGEBOX + 3), MessageBoxButton.OK) MessageBox.Show(sOk, EgtMsg(MSG_MESSAGEBOX + 3), MessageBoxButton.OK)
EgtMessageBoxV.Show(Application.Current.MainWindow, sOk, EgtMsg(MSG_MESSAGEBOX + 3), MessageBoxButton.OK)
' Rimuovo il direttorio temporaneo ' Rimuovo il direttorio temporaneo
My.Computer.FileSystem.DeleteDirectory(sTempDir, FileIO.DeleteDirectoryOption.DeleteAllContents) My.Computer.FileSystem.DeleteDirectory( sTempDir, FileIO.DeleteDirectoryOption.DeleteAllContents)
' Aggiorno la lista delle macchina ' Aggiorno la lista delle macchina
MyMachine.InsertMachine(sMachDir, Map.refMachinePanelVM.MachineList) MyMachine.InsertMachine(sMachDir, Map.refMachinePanelVM.MachineList)
End Sub End Sub
@@ -1099,7 +1133,7 @@ Public Class OptionWindowVM
' aggiungo i file della Macchina ' aggiungo i file della Macchina
Dim sMachineDir As String = Map.refMainWindowVM.MainWindowM.sMachinesRoot & "\" & sCurrMachineName Dim sMachineDir As String = Map.refMainWindowVM.MainWindowM.sMachinesRoot & "\" & sCurrMachineName
If Directory.Exists(sMachineDir) Then If Directory.Exists(sMachineDir) Then
zip.AddSelectedFiles("name != *\.git\*.* and name != *.git*", sMachineDir, sCurrMachineName, True) zip.AddItem(sMachineDir, sCurrMachineName)
End If End If
' salvo lo zip ' salvo lo zip
zip.Save() zip.Save()
@@ -1109,14 +1143,12 @@ Public Class OptionWindowVM
' L'esportazione della macchina "{0}" non è riuscita. ' L'esportazione della macchina "{0}" non è riuscita.
Dim sKo As String = String.Format(EgtMsg(6551), sCurrMachineName) Dim sKo As String = String.Format(EgtMsg(6551), sCurrMachineName)
EgtOutLog(sKo) EgtOutLog(sKo)
'MessageBox.Show(sKo, EgtMsg(MSG_MESSAGEBOX + 1), MessageBoxButton.OK) MessageBox.Show(sKo, EgtMsg(MSG_MESSAGEBOX + 1), MessageBoxButton.OK)
EgtMessageBoxV.Show(Application.Current.MainWindow, sKo, EgtMsg(MSG_MESSAGEBOX + 1), MessageBoxButton.OK)
End Try End Try
'La macchina "{0}" è stata esportata con successo. 'La macchina "{0}" è stata esportata con successo.
Dim sOk As String = String.Format(EgtMsg(6552), sCurrMachineName) Dim sOk As String = String.Format(EgtMsg(6552), sCurrMachineName)
EgtOutLog(sOk) EgtOutLog(sOk)
'MessageBox.Show(sOk, EgtMsg(MSG_MESSAGEBOX + 3), MessageBoxButton.OK) MessageBox.Show(sOk, EgtMsg(MSG_MESSAGEBOX + 3), MessageBoxButton.OK)
EgtMessageBoxV.Show(Application.Current.MainWindow, sOk, EgtMsg(MSG_MESSAGEBOX + 3), MessageBoxButton.OK)
End Sub End Sub
#End Region ' ExportMachine #End Region ' ExportMachine
@@ -1130,12 +1162,11 @@ Public Class LayerColor
Public Enum LayerType As Integer Public Enum LayerType As Integer
PRINTPART = 1 PRINTPART = 1
'REFERENCE = 2 RIBS = 2
MACHSTART = 3 SHELLNUMBERS = 3
RIBS = 4 AUXSOLIDS = 4
SHELLNUMBERS = 5 MACHSTART = 5
AUXSOLIDS = 6 OTHERS = 6
OTHERS = 7
End Enum End Enum
Private m_Type As LayerType Private m_Type As LayerType
+26 -35
View File
@@ -9,23 +9,19 @@
<Button Command="{Binding New_Command}" <Button Command="{Binding New_Command}"
ToolTip="{Binding NewToolTip}" ToolTip="{Binding NewToolTip}"
IsEnabled="{Binding ProjCmd_IsEnabled}" IsEnabled="{Binding ProjCmd_IsEnabled}"
Margin="0,0,2.5,0" Style="{StaticResource ToolBar_Button}">
Style="{StaticResource ProjManager_Button}"> <Image Source="/Resources/ProjectManager/New.png" Stretch="Uniform"/>
<Image Source="/Resources/ProjectManager/New.png"
Style="{StaticResource Button_Image}"/>
</Button> </Button>
<Button Command="{Binding OpenCommand}" <Button Command="{Binding OpenCommand}"
ToolTip="{Binding OpenToolTip}" ToolTip="{Binding OpenToolTip}"
ContextMenuService.Placement="Bottom" ContextMenuService.Placement="Bottom"
Tag="{Binding}" Tag="{Binding}"
IsEnabled="{Binding ProjCmd_IsEnabled}" IsEnabled="{Binding ProjCmd_IsEnabled}"
Margin="2.5,0,2.5,0" Style="{StaticResource ToolBar_Button}">
Style="{StaticResource ProjManager_Button}">
<Button.ContextMenu> <Button.ContextMenu>
<ContextMenu ItemsSource="{Binding MruFileNames}" <ContextMenu ItemsSource="{Binding MruFileNames}">
Style="{StaticResource Icarus_ContextMenu}">
<ContextMenu.Resources> <ContextMenu.Resources>
<Style TargetType="{x:Type MenuItem}" BasedOn="{StaticResource Icarus_MenuItem}"> <Style TargetType="{x:Type MenuItem}">
<Setter Property="Command" <Setter Property="Command"
Value="{Binding PlacementTarget.Tag.OpenMruFileCommand, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ContextMenu}}" /> Value="{Binding PlacementTarget.Tag.OpenMruFileCommand, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ContextMenu}}" />
<Setter Property="CommandParameter" Value="{Binding}" /> <Setter Property="CommandParameter" Value="{Binding}" />
@@ -33,58 +29,53 @@
</ContextMenu.Resources> </ContextMenu.Resources>
</ContextMenu> </ContextMenu>
</Button.ContextMenu> </Button.ContextMenu>
<Image Source="/Resources/ProjectManager/Open.png" <Image Source="/Resources/ProjectManager/Open.png" Stretch="Uniform"/>
Style="{StaticResource Button_Image}"/>
</Button> </Button>
<Button Command="{Binding SaveCommand}" <Button Command="{Binding SaveCommand}"
ToolTip="{Binding SaveToolTip}" ToolTip="{Binding SaveToolTip}"
IsEnabled="{Binding ProjCmd_IsEnabled}" IsEnabled="{Binding ProjCmd_IsEnabled}"
Margin="2.5,0,2.5,0" Style="{StaticResource ToolBar_Button}">
Style="{StaticResource ProjManager_Button}"> <Image Source="/Resources/ProjectManager/Save.png" Stretch="Uniform"/>
<Image Source="/Resources/ProjectManager/Save.png"
Style="{StaticResource Button_Image}"/>
</Button> </Button>
<Button Command="{Binding SaveAsCommand}" <Button Command="{Binding SaveAsCommand}"
ToolTip="{Binding SaveAsToolTip}" ToolTip="{Binding SaveAsToolTip}"
IsEnabled="{Binding ProjCmd_IsEnabled}" IsEnabled="{Binding ProjCmd_IsEnabled}"
Margin="2.5,0,2.5,0" Style="{StaticResource ToolBar_Button}">
Style="{StaticResource ProjManager_Button}"> <Image Source="/Resources/ProjectManager/SaveAs.png" Stretch="Uniform"/>
<Image Source="/Resources/ProjectManager/SaveAs.png"
Style="{StaticResource Button_Image}"/>
</Button> </Button>
<Button Command="{Binding ImportCommand}" <Button Command="{Binding ImportCommand}"
ToolTip="{Binding ImportToolTip}" ToolTip="{Binding ImportToolTip}"
IsEnabled="{Binding ProjCmd_IsEnabled}" IsEnabled="{Binding ProjCmd_IsEnabled}"
Margin="2.5,0,2.5,0" Style="{StaticResource ToolBar_Button}">
Style="{StaticResource ProjManager_Button}"> <Image Source="/Resources/ProjectManager/Import.png" Stretch="Uniform"/>
<Image Source="/Resources/ProjectManager/Import.png"
Style="{StaticResource Button_Image}"/>
</Button> </Button>
<Button Command="{Binding ExportCommand}" <Button Command="{Binding ExportCommand}"
ToolTip="{Binding ExportToolTip}" ToolTip="{Binding ExportToolTip}"
IsEnabled="{Binding ProjCmd_IsEnabled}" IsEnabled="{Binding ProjCmd_IsEnabled}"
Margin="2.5,0,2.5,0" Style="{StaticResource ToolBar_Button}">
Style="{StaticResource ProjManager_Button}"> <Image Source="/Resources/ProjectManager/Export.png" Stretch="Uniform"/>
<Image Source="/Resources/ProjectManager/Export.png"
Style="{StaticResource Button_Image}"/>
</Button> </Button>
<!--<Button Command="{Binding ExportCommand}" ToolTip="{Binding ExportToolTip}" <!--<Button Command="{Binding ExportCommand}" ToolTip="{Binding ExportToolTip}"
IsEnabled="{Binding DrawIsChecked}"> IsEnabled="{Binding DrawIsChecked}">
<Image Source="/Resources/ProjectManager/Export.png" Stretch="Uniform"/> <Image Source="/Resources/ProjectManager/Export.png" Stretch="Uniform"/>
</Button>--> </Button>-->
<Button Command="{Binding OptionsCommand}" <Button Command="{Binding OptionsCommand}"
Width="30"
ToolTip="{Binding OptionsToolTip}" ToolTip="{Binding OptionsToolTip}"
Margin="2.5,0,2.5,0" Style="{StaticResource ToolBar_Button}">
Style="{StaticResource ProjManager_Button}"> <Image Source="/Resources/ProjectManager/Options.png" Height="22" />
<Image Source="/Resources/ProjectManager/Options.png" </Button>
Style="{StaticResource Button_Image}"/> <Button Command="{Binding Help_Command}"
Width="30"
ToolTip="{Binding Help_ToolTip}"
Style="{StaticResource ToolBar_Button}">
<Image Source="/Resources/ProjectManager/Send.png" Height="22" />
</Button> </Button>
<Button Command="{Binding SendFeedbackCommand}" <Button Command="{Binding SendFeedbackCommand}"
Width="30"
ToolTip="{Binding SendFeedbackToolTip}" ToolTip="{Binding SendFeedbackToolTip}"
Margin="2.5,0,0,0" Style="{StaticResource ToolBar_Button}">
Style="{StaticResource ProjManager_Button}"> <Image Source="/Resources/ProjectManager/Send.png" Height="22" />
<Image Source="/Resources/ProjectManager/Send.png"
Style="{StaticResource Button_Image}"/>
</Button> </Button>
</StackPanel> </StackPanel>
+64 -22
View File
@@ -62,6 +62,7 @@ Public Class ProjManagerVM
Private m_cmdImport As ICommand Private m_cmdImport As ICommand
Private m_cmdExport As ICommand Private m_cmdExport As ICommand
Private m_cmdOptions As ICommand Private m_cmdOptions As ICommand
Private m_cmdHelp As ICommand
Private m_cmdSendFeedback As ICommand Private m_cmdSendFeedback As ICommand
@@ -88,24 +89,34 @@ Public Class ProjManagerVM
Return EgtMsg(MSG_TOPCOMMANDBAR + 4) Return EgtMsg(MSG_TOPCOMMANDBAR + 4)
End Get End Get
End Property End Property
Public ReadOnly Property ImportToolTip As String Public ReadOnly Property InsertToolTip As String
Get Get
Return "Import" Return EgtMsg(MSG_TOPCOMMANDBAR + 5)
End Get End Get
End Property End Property
Public ReadOnly Property ExportToolTip As String Public ReadOnly Property ImportBTL_ToolTip As String
Get Get
Return "Export" Return EgtMsg(61840)
End Get End Get
End Property End Property
Public ReadOnly Property OptionsToolTip As String Public ReadOnly Property UpdateBTL_ToolTip As String
Get Get
Return "Options" Return EgtMsg(61834)
End Get End Get
End Property End Property
Public ReadOnly Property SendFeedbackToolTip As String Public ReadOnly Property ExportProject_ToolTip As String
Get Get
Return "Send Feedback" Return EgtMsg(61838)
End Get
End Property
Public ReadOnly Property ImportProject_ToolTip As String
Get
Return EgtMsg(61839)
End Get
End Property
Public ReadOnly Property GoToProd_ToolTip As String
Get
Return EgtMsg(61835)
End Get End Get
End Property End Property
@@ -149,9 +160,6 @@ Public Class ProjManagerVM
''' Execute the Save. This method is invoked by the SaveCommand. ''' Execute the Save. This method is invoked by the SaveCommand.
''' </summary> ''' </summary>
Public Sub NewProjectCmd() Public Sub NewProjectCmd()
' 'MessageBox.Show("Testo di prova EgtMessageBox", "Titolo di prova")
' Dim x = EgtMessageBoxV.Show(Application.Current.MainWindow, "Testo di prova EgtMessageBox", "Titolo di prova", MessageBoxButton.YesNoCancel, MessageBoxImage.Warning, MessageBoxResult.Yes)
NewProject(True) NewProject(True)
End Sub End Sub
@@ -196,11 +204,23 @@ Public Class ProjManagerVM
''' Execute the Open. This method is invoked by the OpenCommand. ''' Execute the Open. This method is invoked by the OpenCommand.
''' </summary> ''' </summary>
Friend Sub Open() Friend Sub Open()
OpenProject("") OpenProject(Nothing)
End Sub End Sub
Friend Function OpenProject(sFilePath As String) As Boolean Friend Function OpenProject(sFilePath As String) As Boolean
Return Map.refSceneHostVM.OpenProject(sFilePath) If String.IsNullOrEmpty(sFilePath) Then
' Recupero cartella dell'ultimo progetto aperto
Dim sDir As String = Map.refSceneHostVM.MainController.GetCurrFile()
If String.IsNullOrWhiteSpace(sDir) Then
GetMainPrivateProfileString(S_MRUFILES, K_FILE & 1, "", sDir)
End If
If Not String.IsNullOrWhiteSpace(sDir) Then
sDir = Path.GetDirectoryName(sDir)
End If
Return Map.refSceneHostVM.MainController.OpenProject(sDir)
Else
Return Map.refSceneHostVM.MainController.OpenProject(sFilePath, False)
End If
End Function End Function
#End Region ' OpenCommand #End Region ' OpenCommand
@@ -350,6 +370,32 @@ Public Class ProjManagerVM
#End Region ' Options #End Region ' Options
#Region "Help"
''' <summary>
''' Returns a command that do Export.
''' </summary>
Public ReadOnly Property Help_Command As ICommand
Get
If m_cmdHelp Is Nothing Then
m_cmdHelp = New Command(AddressOf Help)
End If
Return m_cmdHelp
End Get
End Property
''' <summary>
''' Execute the Export. This method is invoked by the ExportCommand.
''' </summary>
Public Sub Help(ByVal param As Object)
Dim HelpWndVM As New HelpWndVM
Dim HelpWnd As New HelpWndV(Application.Current.MainWindow, HelpWndVM)
HelpWndVM.LoadHtml()
HelpWnd.Show()
End Sub
#End Region ' Options
#Region "SendFeedback" #Region "SendFeedback"
''' <summary> ''' <summary>
@@ -373,8 +419,7 @@ Public Class ProjManagerVM
GetMainPrivateProfileString(S_GENERAL, K_SUPPORT, "support@egaltech.com", sSupportAddress) GetMainPrivateProfileString(S_GENERAL, K_SUPPORT, "support@egaltech.com", sSupportAddress)
' se vuoto do messaggio di errore ed esco ' se vuoto do messaggio di errore ed esco
If String.IsNullOrWhiteSpace(sSupportAddress) Then If String.IsNullOrWhiteSpace(sSupportAddress) Then
'MessageBox.Show(EgtMsg(MSG_TOPCOMMANDBAR + 10), EgtMsg(MSG_MESSAGEBOX + 1), MessageBoxButton.OK, MessageBoxImage.Error) MessageBox.Show(EgtMsg(MSG_TOPCOMMANDBAR + 10), EgtMsg(MSG_MESSAGEBOX + 1), MessageBoxButton.OK, MessageBoxImage.Error)
EgtMessageBoxV.Show(Application.Current.MainWindow, EgtMsg(MSG_TOPCOMMANDBAR + 10), EgtMsg(MSG_MESSAGEBOX + 1), MessageBoxButton.OK, MessageBoxImage.Error)
Return Return
End If End If
' Recupero numero chiave ' Recupero numero chiave
@@ -385,16 +430,14 @@ Public Class ProjManagerVM
EgtGetCurrFilePath(sCurrProject) EgtGetCurrFilePath(sCurrProject)
' se nome file vuoto o con estensione non valida, chiedo se si vuole salvare ' se nome file vuoto o con estensione non valida, chiedo se si vuole salvare
If String.IsNullOrWhiteSpace(sCurrProject) Or EgtGetFileType(sCurrProject) <> FT.NGE Then If String.IsNullOrWhiteSpace(sCurrProject) Or EgtGetFileType(sCurrProject) <> FT.NGE Then
'If MessageBox.Show(EgtMsg(MSG_TOPCOMMANDBAR + 11), "", MessageBoxButton.YesNo, MessageBoxImage.Question) = MessageBoxResult.Yes Then If MessageBox.Show(EgtMsg(MSG_TOPCOMMANDBAR + 11), "", MessageBoxButton.YesNo, MessageBoxImage.Question) = MessageBoxResult.Yes Then
If EgtMessageBoxV.Show(Application.Current.MainWindow, EgtMsg(MSG_TOPCOMMANDBAR + 11), "", MessageBoxButton.YesNo, MessageBoxImage.Question) = MessageBoxResult.Yes Then
Map.refSceneHostVM.SaveProject() Map.refSceneHostVM.SaveProject()
End If End If
EgtGetCurrFilePath(sCurrProject) EgtGetCurrFilePath(sCurrProject)
' se modificato, chiedo se si vuole salvare ' se modificato, chiedo se si vuole salvare
Else Else
If EgtGetModified() Then If EgtGetModified() Then
'If MessageBox.Show(EgtMsg(MSG_TOPCOMMANDBAR + 11), "", MessageBoxButton.YesNo, MessageBoxImage.Question) = MessageBoxResult.Yes Then If MessageBox.Show(EgtMsg(MSG_TOPCOMMANDBAR + 11), "", MessageBoxButton.YesNo, MessageBoxImage.Question) = MessageBoxResult.Yes Then
If EgtMessageBoxV.Show(Application.Current.MainWindow, EgtMsg(MSG_TOPCOMMANDBAR + 11), "", MessageBoxButton.YesNo, MessageBoxImage.Question) = MessageBoxResult.Yes Then
Map.refSceneHostVM.SaveProject() Map.refSceneHostVM.SaveProject()
End If End If
End If End If
@@ -481,8 +524,7 @@ Public Class ProjManagerVM
bEx = True bEx = True
End Try End Try
If bEx OrElse EgtWPFLib5.MapiMailMessage.m_ErrorCode <> 0 Then If bEx OrElse EgtWPFLib5.MapiMailMessage.m_ErrorCode <> 0 Then
'MessageBox.Show(String.Format(EgtMsg(MSG_TOPCOMMANDBAR + 12), sSupportAddress, sZipToCreate), EgtMsg(MSG_MESSAGEBOX + 3), MessageBoxButton.OK, MessageBoxImage.Information) MessageBox.Show(String.Format(EgtMsg(MSG_TOPCOMMANDBAR + 12), sSupportAddress, sZipToCreate), EgtMsg(MSG_MESSAGEBOX + 3), MessageBoxButton.OK, MessageBoxImage.Information)
EgtMessageBoxV.Show(Application.Current.MainWindow, String.Format(EgtMsg(MSG_TOPCOMMANDBAR + 12), sSupportAddress, sZipToCreate), EgtMsg(MSG_MESSAGEBOX + 3), MessageBoxButton.OK, MessageBoxImage.Information)
Else Else
Map.refMyStatusBarVM.SetOutputMessage(EgtMsg(MSG_TOPCOMMANDBAR + 14), 5) Map.refMyStatusBarVM.SetOutputMessage(EgtMsg(MSG_TOPCOMMANDBAR + 14), 5)
End If End If
+34 -104
View File
@@ -1,136 +1,66 @@
<DockPanel x:Class="ProjectV" <EgtFloating:EgtFloatingManager x:Class="ProjectV"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:PrintApp="clr-namespace:Icarus"> xmlns:EgtFloating="clr-namespace:EgtWPFLib5.EgtFloating;assembly=EgtWPFLib5"
<DockPanel.Resources> xmlns:EgtWPFLib5="clr-namespace:EgtWPFLib5;assembly=EgtWPFLib5"
<PrintApp:VisibilityToRowConverter x:Key="VisibilityToRowConverter"/> xmlns:PrintApp="clr-namespace:Icarus">
</DockPanel.Resources>
<Grid DockPanel.Dock="Top"> <Grid DockPanel.Dock="Top" Margin="0,20,0,0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="0.5*"/>
<ColumnDefinition Width="5*"/>
<ColumnDefinition Width="0.5*"/>
</Grid.ColumnDefinitions>
<PrintApp:TopPanelV Grid.Column="1" <PrintApp:TopPanelV Grid.Column="1"
DataContext="{StaticResource TopPanelVM }"/> DataContext="{StaticResource TopPanelVM }"/>
</Grid> </Grid>
<Grid DockPanel.Dock="Bottom"> <Grid DockPanel.Dock="Bottom">
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
<ColumnDefinition Width="315"/>
<ColumnDefinition Width="1*"/> <ColumnDefinition Width="1*"/>
<ColumnDefinition Width="Auto"/> <ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="315"/>
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="67"/>
</Grid.RowDefinitions>
<PrintApp:LayerAdvancementSliderV Grid.Column="2"
Grid.ColumnSpan="3"
DockPanel.Dock="Bottom"
DataContext="{StaticResource SliderManagerVM}"
HorizontalAlignment="Stretch"/>
<!--StatusBar --> <!--StatusBar -->
<Grid Grid.RowSpan="2" <PrintApp:StatusBarV DataContext="{StaticResource StatusBarVM}"/>
Grid.ColumnSpan="2"> <PrintApp:MachinePanelV Grid.Column="1"
<Grid.RowDefinitions> DataContext="{StaticResource MachinePanelVM}"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="67"/>
</Grid.RowDefinitions>
<PrintApp:MessagePanelV Grid.Row="{Binding DataContext.Message_Visibility, ElementName=ControllerInputPanelV, Converter={StaticResource VisibilityToRowConverter}}"
Grid.ColumnSpan="2"
DataContext="{StaticResource StatusBarVM}"/>
<PrintApp:ControllerInputPanelV x:Name="ControllerInputPanelV" Grid.Row="2"
Grid.ColumnSpan="2"
DataContext="{StaticResource ControllerInputPanelVM}"/>
</Grid>
<!--<PrintApp:ControllerInputPanelV Grid.Row="1"
Grid.ColumnSpan="2"
DataContext="{StaticResource ControllerInputPanelVM}"/>
<PrintApp:MessagePanelV Grid.Row="1"
Grid.ColumnSpan="2"
DataContext="{StaticResource StatusBarVM}"/>-->
<PrintApp:ShowPanelV Grid.Column="2"
Grid.Row="1"
DataContext="{StaticResource ShowPanelVM}"/>
<PrintApp:ViewPanelV Grid.Column="3"
Grid.Row="1"
DataContext="{StaticResource ViewPanelVM}"/>
<PrintApp:InstrumentPanelV Grid.Column="4"
Grid.Row="1"
DataContext="{StaticResource InstrumentPanelVM}"/>
<PrintApp:StatusBarV Grid.Column="6"
Grid.Row="1"
DataContext="{StaticResource StatusBarVM}"/>
</Grid> </Grid>
<!--<DockPanel DockPanel.Dock="Bottom" <DockPanel DockPanel.Dock="Bottom"
LastChildFill="False"> LastChildFill="False">
<PrintApp:SliceManagerV DockPanel.Dock="Right"
DataContext="{StaticResource SliceManagerVM}"
Margin="5"/>
<PrintApp:LayerAdvancementSliderV DockPanel.Dock="Bottom" <PrintApp:LayerAdvancementSliderV DockPanel.Dock="Bottom"
DataContext="{StaticResource SliderManagerVM}" DataContext="{StaticResource SliderManagerVM}"
HorizontalAlignment="Center"/> HorizontalAlignment="Center"/>
--><!--<Grid DockPanel.Dock="Bottom" <Grid DockPanel.Dock="Bottom"
HorizontalAlignment="Stretch"> HorizontalAlignment="Stretch">
<PrintApp:ControllerInputPanelV Grid.Column="3" <PrintApp:ControllerInputPanelV Grid.Column="3"
DataContext="{StaticResource ControllerInputPanelVM}" DataContext="{StaticResource ControllerInputPanelVM}"
HorizontalAlignment="Center"/> HorizontalAlignment="Center"/>
</Grid>--><!-- </Grid>
</DockPanel>--> </DockPanel>
<PrintApp:ViewLayerManagerV DockPanel.Dock="Bottom"
HorizontalAlignment="Left"
DataContext="{StaticResource ViewLayerManagerVM}"/>
<Grid DockPanel.Dock="Left"> <Grid DockPanel.Dock="Left">
<Grid.ColumnDefinitions> <PrintApp:LeftPanelV Grid.Row="1"
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="1*"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<PrintApp:LeftPanelV Grid.ColumnSpan="2"
DataContext="{StaticResource LeftPanelVM}" DataContext="{StaticResource LeftPanelVM}"
VerticalAlignment="Center" VerticalAlignment="Center"
Visibility="{Binding DataContext.LeftPanel_Visibility, Visibility="{Binding DataContext.LeftPanel_Visibility,
RelativeSource={RelativeSource AncestorType={x:Type PrintApp:ProjectV}}}"/> RelativeSource={RelativeSource AncestorType={x:Type PrintApp:ProjectV}}}"/>
<PrintApp:ViewLayerManagerV Grid.Row="1"
VerticalAlignment="Bottom"
HorizontalAlignment="Left"
DataContext="{StaticResource ViewLayerManagerVM}"/>
</Grid>
<Grid DockPanel.Dock="Right">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="40"/>
<RowDefinition Height="20*"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Grid Grid.ColumnSpan="2"
Grid.Row="1"
HorizontalAlignment="Right">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<!--<PrintApp:MachineViewPanelV DataContext="{StaticResource MachineViewPanelVM}"/>-->
<PrintApp:LayerIndexSliderV DataContext="{StaticResource SliderManagerVM}"
VerticalAlignment="Stretch"
HorizontalAlignment="Right"/>
<PrintApp:RightPanelV Grid.Column="1"
DataContext="{StaticResource RightPanelVM}"/>
</Grid>
<PrintApp:SliceManagerV Grid.Column="1"
Grid.Row="3"
DataContext="{StaticResource SliceManagerVM}"
HorizontalAlignment="Right"/>
</Grid> </Grid>
<PrintApp:RightPanelV DockPanel.Dock="Right"
DataContext="{StaticResource RightPanelVM}"/>
<PrintApp:LayerIndexSliderV DockPanel.Dock="Right"
DataContext="{StaticResource SliderManagerVM}"
VerticalAlignment="Stretch"/>
<!-- Grid che occupa lo spazio della scena --> <!-- Grid che occupa lo spazio della scena -->
<Grid Background="Transparent"/> <Grid Background="Transparent"/>
</DockPanel> </EgtFloating:EgtFloatingManager>
-13
View File
@@ -3,7 +3,6 @@ Imports EgtWPFLib5
Imports EgtUILib Imports EgtUILib
Imports System.Collections.ObjectModel Imports System.Collections.ObjectModel
Imports System.IO Imports System.IO
Imports System.Globalization
Public Class ProjectVM Public Class ProjectVM
Inherits VMBase Inherits VMBase
@@ -29,15 +28,3 @@ Public Class ProjectVM
End Class End Class
Public Class VisibilityToRowConverter
Implements IValueConverter
Public Function Convert(ByVal value As Object, ByVal targetType As Type, ByVal parameter As Object, ByVal culture As CultureInfo) As Object Implements IValueConverter.Convert
If IsNothing(value) Then Return 2
Return If(value = Visibility.Visible, 1, 2)
End Function
Public Function ConvertBack(ByVal value As Object, ByVal targetType As Type, ByVal parameter As Object, ByVal culture As CultureInfo) As Object Implements IValueConverter.ConvertBack
Throw New System.NotImplementedException()
End Function
End Class
+9 -36
View File
@@ -1,9 +1,7 @@
<UserControl x:Class="ReferencePanelV" <UserControl x:Class="ReferencePanelV"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
xmlns:PrintApp="clr-namespace:Icarus"> <Border Style="{StaticResource LeftPanelPopup_Border}">
<Border Padding="2.5"
Style="{StaticResource LeftPanel_PopupButton_Border}">
<Grid> <Grid>
<Grid.RowDefinitions> <Grid.RowDefinitions>
<RowDefinition Height="Auto"/> <RowDefinition Height="Auto"/>
@@ -16,13 +14,11 @@
Padding="0"> Padding="0">
<ListBox.ItemsPanel> <ListBox.ItemsPanel>
<ItemsPanelTemplate> <ItemsPanelTemplate>
<UniformGrid Rows="3" <UniformGrid Rows="3"/>
Margin="0"/>
</ItemsPanelTemplate> </ItemsPanelTemplate>
</ListBox.ItemsPanel> </ListBox.ItemsPanel>
<ListBox.ItemContainerStyle> <ListBox.ItemContainerStyle>
<Style TargetType="ListBoxItem"> <Style TargetType="ListBoxItem">
<Setter Property="Margin" Value="0"/>
<Setter Property="Template"> <Setter Property="Template">
<Setter.Value> <Setter.Value>
<ControlTemplate TargetType="{x:Type ListBoxItem}"> <ControlTemplate TargetType="{x:Type ListBoxItem}">
@@ -34,33 +30,11 @@
</ListBox.ItemContainerStyle> </ListBox.ItemContainerStyle>
<ListBox.ItemTemplate> <ListBox.ItemTemplate>
<DataTemplate> <DataTemplate>
<PrintApp:CheckedImageRadioButton IsChecked="{Binding IsSelected,RelativeSource={RelativeSource AncestorType={x:Type ListBoxItem}}}" <RadioButton Content="{Binding sText}"
ImageSource="{Binding sText}" IsChecked="{Binding IsSelected,RelativeSource={RelativeSource AncestorType={x:Type ListBoxItem}}}"
CheckedImageSource="{Binding sSelText}" FontSize="40"
FontSize="40" GroupName="ReferenceRadio"
GroupName="ReferenceRadio" Style="{StaticResource OptionPanel_NestingToggleButton}"/>
Margin="2.5,2.5,2.5,2.5">
<!--<RadioButton.Resources>
<DataTemplate x:Key="Normal">
<Image Source="{Binding sText}"
Style="{StaticResource Button_Image}"/>
</DataTemplate>
<DataTemplate x:Key="Selected">
<Image Source="{Binding sSelText}"
Style="{StaticResource Button_Image}"/>
</DataTemplate>
</RadioButton.Resources>
<RadioButton.Style>
<Style TargetType="{x:Type RadioButton}" BasedOn="{StaticResource OptionPanel_NestingToggleButton}">
<Setter Property="ContentTemplate" Value="{StaticResource Normal}"/>
<Style.Triggers>
<Trigger Property="IsChecked" Value="True">
<Setter Property="ContentTemplate" Value="{StaticResource Selected}"/>
</Trigger>
</Style.Triggers>
</Style>
</RadioButton.Style>-->
</PrintApp:CheckedImageRadioButton>
</DataTemplate> </DataTemplate>
</ListBox.ItemTemplate> </ListBox.ItemTemplate>
</ListBox> </ListBox>
@@ -68,8 +42,7 @@
Content="From Import" Content="From Import"
IsChecked="{Binding FromImport_IsChecked}" IsChecked="{Binding FromImport_IsChecked}"
GroupName="ReferenceRadio" GroupName="ReferenceRadio"
Margin="2.5"
Style="{StaticResource OptionPanel_ToggleButton}"/> Style="{StaticResource OptionPanel_ToggleButton}"/>
</Grid> </Grid>
</Border> </Border>
</UserControl> </UserControl>
+29 -67
View File
@@ -30,7 +30,6 @@ Public Class ReferencePanelVM
End Get End Get
Set(value As ReferenceBtn) Set(value As ReferenceBtn)
m_SelReference = value.Type m_SelReference = value.Type
EgtSetInfo(Map.refTopPanelVM.SelPart.nReferenceLayerId, KEY_REFERENCE, value.Type)
UpdateFramePosition() UpdateFramePosition()
End Set End Set
End Property End Property
@@ -43,7 +42,6 @@ Public Class ReferencePanelVM
If value Then If value Then
m_SelReference = ReferenceBtn.References.FROM_IMPORT m_SelReference = ReferenceBtn.References.FROM_IMPORT
NotifyPropertyChanged(NameOf(ghSelReference)) NotifyPropertyChanged(NameOf(ghSelReference))
EgtSetInfo(Map.refTopPanelVM.SelPart.nReferenceLayerId, KEY_REFERENCE, ReferenceBtn.References.FROM_IMPORT)
UpdateFramePosition() UpdateFramePosition()
End If End If
End Set End Set
@@ -70,55 +68,45 @@ Public Class ReferencePanelVM
End Sub End Sub
Friend Sub UpdateFramePosition(Optional SelPart As Print3dPartVM = Nothing) Friend Sub UpdateFramePosition(Optional SelPart As Print3dPartVM = Nothing)
Dim SelReference As Integer = ReferenceBtn.References.BL If IsNothing(SelPart) Then SelPart = Map.refTopPanelVM.SelPart
If IsNothing(SelPart) Then
SelPart = Map.refTopPanelVM.SelPart
End If
EgtGetInfo(SelPart.nReferenceLayerId, KEY_REFERENCE, SelReference)
' elimino precedente ' elimino precedente
EgtEmptyGroup(SelPart.nReferenceLayerId) EgtEmptyGroup(SelPart.nReferenceLayerId)
' Creo riferimento ' Creo riferimento
Dim frPrintSolid As New Frame3d() Dim frPrintSolid As New Frame3d()
If SelReference = ReferenceBtn.References.FROM_IMPORT Then If m_SelReference = ReferenceBtn.References.FROM_IMPORT Then
EgtGetGlobFrame(SelPart.nPrintSolidId, frPrintSolid) EgtGetGlobFrame(SelPart.nPrintSolidId, frPrintSolid)
frPrintSolid.Setup(New Point3d(frPrintSolid.Orig.x, frPrintSolid.Orig.y, 0)) frPrintSolid.Setup(New Point3d(frPrintSolid.Orig.x, frPrintSolid.Orig.y, 0))
Else Else
Dim b3ToBePrintSolid As BBox3d = Map.refDispositionPanelVM.GetSolidForReferenceBBox(SelPart) Dim b3PrintSolid As New BBox3d
EgtGetBBoxGlob(SelPart.nPrintSolidId, GDB_BB.STANDARD, b3PrintSolid)
' Creo riferimento ' Creo riferimento
Dim ptOrig As New Point3d(b3ToBePrintSolid.Min()) Dim ptOrig As New Point3d(b3PrintSolid.Min())
Select Case SelReference Select Case m_SelReference
Case ReferenceBtn.References.TL Case ReferenceBtn.References.TL
ptOrig += b3ToBePrintSolid.DimY() * Vector3d.Y_AX ptOrig += b3PrintSolid.DimY() * Vector3d.Y_AX
Case ReferenceBtn.References.TR Case ReferenceBtn.References.TR
ptOrig += b3ToBePrintSolid.DimY() * Vector3d.Y_AX + b3ToBePrintSolid.DimX() * Vector3d.X_AX ptOrig += b3PrintSolid.DimY() * Vector3d.Y_AX + b3PrintSolid.DimX() * Vector3d.X_AX
Case ReferenceBtn.References.BL Case ReferenceBtn.References.BL
Case ReferenceBtn.References.BR Case ReferenceBtn.References.BR
ptOrig += b3ToBePrintSolid.DimX() * Vector3d.X_AX ptOrig += b3PrintSolid.DimX() * Vector3d.X_AX
Case ReferenceBtn.References.TC Case ReferenceBtn.References.TC
ptOrig += b3ToBePrintSolid.DimY() * Vector3d.Y_AX + b3ToBePrintSolid.DimX() / 2 * Vector3d.X_AX ptOrig += b3PrintSolid.DimY() * Vector3d.Y_AX + b3PrintSolid.DimX() / 2 * Vector3d.X_AX
Case ReferenceBtn.References.ML Case ReferenceBtn.References.ML
ptOrig += b3ToBePrintSolid.DimY() / 2 * Vector3d.Y_AX ptOrig += b3PrintSolid.DimY() / 2 * Vector3d.Y_AX
Case ReferenceBtn.References.MR Case ReferenceBtn.References.MR
ptOrig += b3ToBePrintSolid.DimY() / 2 * Vector3d.Y_AX + b3ToBePrintSolid.DimX() * Vector3d.X_AX ptOrig += b3PrintSolid.DimY() / 2 * Vector3d.Y_AX + b3PrintSolid.DimX() * Vector3d.X_AX
Case ReferenceBtn.References.TC Case ReferenceBtn.References.TC
ptOrig += b3ToBePrintSolid.DimY() * Vector3d.Y_AX + b3ToBePrintSolid.DimX() / 2 * Vector3d.X_AX ptOrig += b3PrintSolid.DimY() * Vector3d.Y_AX + b3PrintSolid.DimX() / 2 * Vector3d.X_AX
Case ReferenceBtn.References.MR Case ReferenceBtn.References.MR
ptOrig += b3ToBePrintSolid.DimY() / 2 * Vector3d.Y_AX + b3ToBePrintSolid.DimX() * Vector3d.X_AX ptOrig += b3PrintSolid.DimY() / 2 * Vector3d.Y_AX + b3PrintSolid.DimX() * Vector3d.X_AX
Case ReferenceBtn.References.BC Case ReferenceBtn.References.BC
ptOrig += b3ToBePrintSolid.DimX() / 2 * Vector3d.X_AX ptOrig += b3PrintSolid.DimX() / 2 * Vector3d.X_AX
Case ReferenceBtn.References.MC Case ReferenceBtn.References.MC
ptOrig += b3ToBePrintSolid.DimY() / 2 * Vector3d.Y_AX + b3ToBePrintSolid.DimX() / 2 * Vector3d.X_AX ptOrig += b3PrintSolid.DimY() / 2 * Vector3d.Y_AX + b3PrintSolid.DimX() / 2 * Vector3d.X_AX
End Select End Select
Dim vtMovedPart As Vector3d Dim vtMovedPart As Vector3d
If EgtGetInfo(SelPart.nPartId, KEY_MOVEDPART, vtMovedPart) Then EgtGetInfo(SelPart.nPartId, "MovedPart", vtMovedPart)
ptOrig = ptOrig - vtMovedPart ptOrig = ptOrig - vtMovedPart
ElseIf EgtGetInfo(SelPart.nPartId, KEY_MOVEDPART2, vtMovedPart) Then
ptOrig = ptOrig - vtMovedPart
End If
Dim nPartFrameId As Integer = EgtCreateGeoFrame(SelPart.nPartReferenceLayerId, New Frame3d(ptOrig), GDB_RT.GLOB)
EgtSetStatus(nPartFrameId, GDB_ST.OFF)
' elimino componente Z
ptOrig = ptOrig + New Vector3d(0, 0, -ptOrig.z)
frPrintSolid = New Frame3d(ptOrig) frPrintSolid = New Frame3d(ptOrig)
End If End If
Dim nFrameId As Integer = EgtCreateGeoFrame(SelPart.nReferenceLayerId, frPrintSolid, GDB_RT.GLOB) Dim nFrameId As Integer = EgtCreateGeoFrame(SelPart.nReferenceLayerId, frPrintSolid, GDB_RT.GLOB)
@@ -127,6 +115,7 @@ Public Class ReferencePanelVM
EgtSetMode(nFrameId, GDB_MD.LOCKED) EgtSetMode(nFrameId, GDB_MD.LOCKED)
SelPart.UpdateReferenceId(nFrameId) SelPart.UpdateReferenceId(nFrameId)
End If End If
EgtSetInfo(SelPart.nReferenceLayerId, KEY_REFERENCE, m_SelReference)
Map.refDispositionPanelVM.RefreshPos() Map.refDispositionPanelVM.RefreshPos()
EgtDraw() EgtDraw()
End Sub End Sub
@@ -190,52 +179,25 @@ Public Class ReferenceBtn
Get Get
Select Case Type Select Case Type
Case References.TL Case References.TL
Return "/Resources/ReferencePanel/TL.png" '"┌" Return ""
Case References.TR Case References.TR
Return "/Resources/ReferencePanel/TR.png" '"┐" Return ""
Case References.BL Case References.BL
Return "/Resources/ReferencePanel/BL.png" '"└" Return ""
Case References.BR Case References.BR
Return "/Resources/ReferencePanel/BR.png" '"┘" Return ""
Case References.TC Case References.TC
Return "/Resources/ReferencePanel/TC.png" '"┬" Return ""
Case References.ML Case References.ML
Return "/Resources/ReferencePanel/ML.png" '"├" Return ""
Case References.MR Case References.MR
Return "/Resources/ReferencePanel/MR.png" '"┤" Return ""
Case References.BC Case References.BC
Return "/Resources/ReferencePanel/BC.png" '"┴" Return ""
Case References.MC Case References.MC
Return "/Resources/ReferencePanel/MC.png" '"┼" Return ""
Case Else Case Else
Return "" '"X" Return "X"
End Select
End Get
End Property
Public ReadOnly Property sSelText As String
Get
Select Case Type
Case References.TL
Return "/Resources/ReferencePanel/White_TL.png" '"┌"
Case References.TR
Return "/Resources/ReferencePanel/White_TR.png" '"┐"
Case References.BL
Return "/Resources/ReferencePanel/White_BL.png" '"└"
Case References.BR
Return "/Resources/ReferencePanel/White_BR.png" '"┘"
Case References.TC
Return "/Resources/ReferencePanel/White_TC.png" '"┬"
Case References.ML
Return "/Resources/ReferencePanel/White_ML.png" '"├"
Case References.MR
Return "/Resources/ReferencePanel/White_MR.png" '"┤"
Case References.BC
Return "/Resources/ReferencePanel/White_BC.png" '"┴"
Case References.MC
Return "/Resources/ReferencePanel/White_MC.png" '"┼"
Case Else
Return "" '"X"
End Select End Select
End Get End Get
End Property End Property
Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 266 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 301 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 159 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 136 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 311 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 254 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 580 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 758 B

After

Width:  |  Height:  |  Size: 901 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 790 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 708 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 780 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 707 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 422 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 994 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 764 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 713 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 662 B

Some files were not shown because too many files have changed in this diff Show More