Compare commits
103 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 1f0fd32470 | |||
| a257412294 | |||
| daabc36730 | |||
| 503616820b | |||
| 84863dc5d5 | |||
| 0e09b44db3 | |||
| ef883cb163 | |||
| 7934ad8fd5 | |||
| 2631c94c03 | |||
| 5db3c25d77 | |||
| ba92a9098d | |||
| ee58cd36f0 | |||
| 1fae546b34 | |||
| 00dbe5f522 | |||
| e4b20c596a | |||
| b76ddfd303 | |||
| fa120a280c | |||
| 99bcefcfe8 | |||
| 704a4becb4 | |||
| b3d50be2f9 | |||
| 629d16b4f1 | |||
| ea551e25e5 | |||
| ff180ec2a4 | |||
| 3b6accaa20 | |||
| a6756b6f77 | |||
| 80bcd2f225 | |||
| 40970b417a | |||
| 647e3fe318 | |||
| 6f2fcbaf3e | |||
| 295f882d45 | |||
| 60ecebf9ff | |||
| 02ecb31ae7 | |||
| 51c736f7f9 | |||
| 1b9f5457f2 | |||
| cb2a22863c | |||
| 82bc1f4ff2 | |||
| b695326901 | |||
| 63092f1ed6 | |||
| 8d548dee9c | |||
| 60758454ed | |||
| a328be0e1c | |||
| 05864bcac5 | |||
| 238bdbb1ce | |||
| 144b8dc66e | |||
| 5f9a01ae2e | |||
| a6386e64d9 | |||
| 551eec6496 | |||
| a24c4ada62 | |||
| 2a86d67ca9 | |||
| 5c4a8adf9b | |||
| 0cc2534628 | |||
| 2a861dca1b | |||
| 16715a8c08 | |||
| 4c5500c490 | |||
| 75b4b4e4d0 | |||
| b643cb5030 | |||
| a666749d85 | |||
| f710918411 | |||
| 1585fc2659 | |||
| a00170b37a | |||
| 00836e0695 | |||
| c06d75e292 | |||
| a6acc66099 | |||
| c822538fb7 | |||
| 9072dc3780 | |||
| a9ed233d77 | |||
| 0635302dac | |||
| 12de367ba1 | |||
| a68dba11a2 | |||
| 60784d2588 | |||
| 5d26914967 | |||
| 4c4356dac7 | |||
| 50d301e8cc | |||
| bfbb85feee | |||
| 9783731396 | |||
| 9ff14634dd | |||
| 42970892ba | |||
| 2bb8cfc4a1 | |||
| 902f610703 | |||
| cb6b2721fc | |||
| d7aa5f1739 | |||
| e67f863235 | |||
| 5f6660d642 | |||
| 437e698d10 | |||
| 9a187ac36b | |||
| 2c04b2e5cc | |||
| a6c10569e0 | |||
| f60be49005 | |||
| b8b42114b6 | |||
| 69b2734987 | |||
| a52a8dfe36 | |||
| b73a4ba6c0 | |||
| 98628b887e | |||
| 5152600fd9 | |||
| c9b9646bbb | |||
| c6732698e8 | |||
| 89ab41da44 | |||
| 2b5bb35e21 | |||
| 68ee954dd3 | |||
| a47a5ed09a | |||
| 5aba0cf14f | |||
| 1e61027dbd | |||
| 4d26959075 |
@@ -3,18 +3,24 @@ Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Version 16
|
||||
VisualStudioVersion = 16.0.32002.261
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "Icarus", "Icarus/Icarus.vbproj", "{BCDE0368-2C69-4948-8723-D0FE71417986}"
|
||||
Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "Icarus", "Icarus\Icarus.vbproj", "{BCDE0368-2C69-4948-8723-D0FE71417986}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|x64 = Debug|x64
|
||||
Debug|x86 = Debug|x86
|
||||
Release|x64 = Release|x64
|
||||
Release|x86 = Release|x86
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{BCDE0368-2C69-4948-8723-D0FE71417986}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{BCDE0368-2C69-4948-8723-D0FE71417986}.Debug|x64.Build.0 = Debug|x64
|
||||
{BCDE0368-2C69-4948-8723-D0FE71417986}.Debug|x86.ActiveCfg = Debug|x86
|
||||
{BCDE0368-2C69-4948-8723-D0FE71417986}.Debug|x86.Build.0 = Debug|x86
|
||||
{BCDE0368-2C69-4948-8723-D0FE71417986}.Release|x64.ActiveCfg = Release|x64
|
||||
{BCDE0368-2C69-4948-8723-D0FE71417986}.Release|x64.Build.0 = Release|x64
|
||||
{BCDE0368-2C69-4948-8723-D0FE71417986}.Release|x86.ActiveCfg = Release|x86
|
||||
{BCDE0368-2C69-4948-8723-D0FE71417986}.Release|x86.Build.0 = Release|x86
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
|
||||
@@ -1,275 +0,0 @@
|
||||
' Follow steps 1a or 1b and then 2 to use this custom control in a XAML file.
|
||||
'
|
||||
' Step 1a) Using this custom control in a XAML file that exists in the current project.
|
||||
' Add this XmlNamespace attribute to the root element of the markup file where it is
|
||||
' to be used:
|
||||
'
|
||||
' xmlns:MyNamespace="clr-namespace:Icarus"
|
||||
'
|
||||
'
|
||||
' Step 1b) Using this custom control in a XAML file that exists in a different project.
|
||||
' Add this XmlNamespace attribute to the root element of the markup file where it is
|
||||
' to be used:
|
||||
'
|
||||
' xmlns:MyNamespace="clr-namespace:Icarus;assembly=Icarus"
|
||||
'
|
||||
' You will also need to add a project reference from the project where the XAML file lives
|
||||
' to this project and Rebuild to avoid compilation errors:
|
||||
'
|
||||
' Right click on the target project in the Solution Explorer and
|
||||
' "Add Reference"->"Projects"->[Browse to and select this project]
|
||||
'
|
||||
'
|
||||
' Step 2)
|
||||
' Go ahead and use your control in the XAML file. Note that Intellisense in the
|
||||
' XML editor does not currently work on custom controls and its child elements.
|
||||
'
|
||||
' <MyNamespace:AirspacePopup/>
|
||||
'
|
||||
|
||||
Imports System.Windows.Controls.Primitives
|
||||
Imports System
|
||||
Imports System.ComponentModel
|
||||
Imports System.Diagnostics
|
||||
Imports System.Runtime.InteropServices
|
||||
Imports System.Windows
|
||||
Imports System.Windows.Input
|
||||
Imports System.Windows.Interop
|
||||
|
||||
Public Class AirspacePopup
|
||||
Inherits Popup
|
||||
|
||||
Public Shared ReadOnly IsTopmostProperty As DependencyProperty = DependencyProperty.Register("IsTopmost", GetType(Boolean), GetType(AirspacePopup), New FrameworkPropertyMetadata(False, AddressOf OnIsTopmostChanged))
|
||||
Public Shared ReadOnly FollowPlacementTargetProperty As DependencyProperty = DependencyProperty.RegisterAttached("FollowPlacementTarget", GetType(Boolean), GetType(AirspacePopup), New UIPropertyMetadata(False))
|
||||
Public Shared ReadOnly AllowOutsideScreenPlacementProperty As DependencyProperty = DependencyProperty.RegisterAttached("AllowOutsideScreenPlacement", GetType(Boolean), GetType(AirspacePopup), New UIPropertyMetadata(False))
|
||||
Public Shared ReadOnly ParentWindowProperty As DependencyProperty = DependencyProperty.RegisterAttached("ParentWindow", GetType(Window), GetType(AirspacePopup), New UIPropertyMetadata(Nothing, AddressOf ParentWindowPropertyChanged))
|
||||
|
||||
Private Shared Sub OnIsTopmostChanged(ByVal source As DependencyObject, ByVal e As DependencyPropertyChangedEventArgs)
|
||||
Dim airspacePopup As AirspacePopup = TryCast(source, AirspacePopup)
|
||||
airspacePopup.SetTopmostState(airspacePopup.IsTopmost)
|
||||
End Sub
|
||||
|
||||
Private Shared Sub ParentWindowPropertyChanged(ByVal source As DependencyObject, ByVal e As DependencyPropertyChangedEventArgs)
|
||||
Dim airspacePopup As AirspacePopup = TryCast(source, AirspacePopup)
|
||||
airspacePopup.ParentWindowChanged()
|
||||
End Sub
|
||||
|
||||
Private m_appliedTopMost As Boolean?
|
||||
Private m_alreadyLoaded As Boolean
|
||||
Private m_parentWindow As Window
|
||||
|
||||
Shared Sub New()
|
||||
'This OverrideMetadata call tells the system that this element wants to provide a style that is different than its base class.
|
||||
'This style is defined in themes\generic.xaml
|
||||
DefaultStyleKeyProperty.OverrideMetadata(GetType(AirspacePopup), New FrameworkPropertyMetadata(GetType(AirspacePopup)))
|
||||
End Sub
|
||||
|
||||
Public Sub New()
|
||||
AddHandler Loaded, AddressOf OnPopupLoaded
|
||||
AddHandler Unloaded, AddressOf OnPopupUnloaded
|
||||
Dim descriptor As DependencyPropertyDescriptor = DependencyPropertyDescriptor.FromProperty(PlacementTargetProperty, GetType(AirspacePopup))
|
||||
descriptor.AddValueChanged(Me, AddressOf PlacementTargetChanged)
|
||||
End Sub
|
||||
|
||||
Public Property IsTopmost As Boolean
|
||||
Get
|
||||
Return CBool(GetValue(IsTopmostProperty))
|
||||
End Get
|
||||
Set(ByVal value As Boolean)
|
||||
SetValue(IsTopmostProperty, value)
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property FollowPlacementTarget As Boolean
|
||||
Get
|
||||
Return CBool(GetValue(FollowPlacementTargetProperty))
|
||||
End Get
|
||||
Set(ByVal value As Boolean)
|
||||
SetValue(FollowPlacementTargetProperty, value)
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property AllowOutsideScreenPlacement As Boolean
|
||||
Get
|
||||
Return CBool(GetValue(AllowOutsideScreenPlacementProperty))
|
||||
End Get
|
||||
Set(ByVal value As Boolean)
|
||||
SetValue(AllowOutsideScreenPlacementProperty, value)
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property ParentWindow As Window
|
||||
Get
|
||||
Return CType(GetValue(ParentWindowProperty), Window)
|
||||
End Get
|
||||
Set(ByVal value As Window)
|
||||
SetValue(ParentWindowProperty, value)
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private Sub ParentWindowChanged()
|
||||
If ParentWindow IsNot Nothing Then
|
||||
AddHandler ParentWindow.LocationChanged, Function(sender, e2)
|
||||
UpdatePopupPosition()
|
||||
End Function
|
||||
|
||||
AddHandler ParentWindow.SizeChanged, Function(sender, e2)
|
||||
UpdatePopupPosition()
|
||||
End Function
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub PlacementTargetChanged(ByVal sender As Object, ByVal e As EventArgs)
|
||||
Dim placementTarget As FrameworkElement = TryCast(Me.PlacementTarget, FrameworkElement)
|
||||
|
||||
If placementTarget IsNot Nothing Then
|
||||
AddHandler placementTarget.SizeChanged, Function(sender2, e2)
|
||||
UpdatePopupPosition()
|
||||
End Function
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub UpdatePopupPosition()
|
||||
Dim placementTarget As FrameworkElement = TryCast(Me.PlacementTarget, FrameworkElement)
|
||||
Dim child As FrameworkElement = TryCast(Me.Child, FrameworkElement)
|
||||
|
||||
If PresentationSource.FromVisual(placementTarget) IsNot Nothing AndAlso AllowOutsideScreenPlacement = True Then
|
||||
Dim leftOffset As Double = CutLeft(placementTarget)
|
||||
Dim topOffset As Double = CutTop(placementTarget)
|
||||
Dim rightOffset As Double = CutRight(placementTarget)
|
||||
Dim bottomOffset As Double = CutBottom(placementTarget)
|
||||
Debug.WriteLine(bottomOffset)
|
||||
Me.Width = Math.Max(0, Math.Min(leftOffset, rightOffset) + placementTarget.ActualWidth)
|
||||
Me.Height = Math.Max(0, Math.Min(topOffset, bottomOffset) + placementTarget.ActualHeight)
|
||||
|
||||
If child IsNot Nothing Then
|
||||
child.Margin = New Thickness(leftOffset, topOffset, rightOffset, bottomOffset)
|
||||
End If
|
||||
End If
|
||||
|
||||
If FollowPlacementTarget = True Then
|
||||
Me.HorizontalOffset += 0.01
|
||||
Me.HorizontalOffset -= 0.01
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Function CutLeft(ByVal placementTarget As FrameworkElement) As Double
|
||||
Dim point As Point = placementTarget.PointToScreen(New Point(0, placementTarget.ActualWidth))
|
||||
Return Math.Min(0, point.X)
|
||||
End Function
|
||||
|
||||
Private Function CutTop(ByVal placementTarget As FrameworkElement) As Double
|
||||
Dim point As Point = placementTarget.PointToScreen(New Point(placementTarget.ActualHeight, 0))
|
||||
Return Math.Min(0, point.Y)
|
||||
End Function
|
||||
|
||||
Private Function CutRight(ByVal placementTarget As FrameworkElement) As Double
|
||||
Dim point As Point = placementTarget.PointToScreen(New Point(0, placementTarget.ActualWidth))
|
||||
point.X += placementTarget.ActualWidth
|
||||
Return Math.Min(0, SystemParameters.VirtualScreenWidth - (Math.Max(SystemParameters.VirtualScreenWidth, point.X)))
|
||||
End Function
|
||||
|
||||
Private Function CutBottom(ByVal placementTarget As FrameworkElement) As Double
|
||||
Dim point As Point = placementTarget.PointToScreen(New Point(placementTarget.ActualHeight, 0))
|
||||
point.Y += placementTarget.ActualHeight
|
||||
Return Math.Min(0, SystemParameters.VirtualScreenHeight - (Math.Max(SystemParameters.VirtualScreenHeight, point.Y)))
|
||||
End Function
|
||||
|
||||
Private Sub OnPopupLoaded(ByVal sender As Object, ByVal e As RoutedEventArgs)
|
||||
If m_alreadyLoaded Then Return
|
||||
m_alreadyLoaded = True
|
||||
|
||||
If Child IsNot Nothing Then
|
||||
Child.[AddHandler](PreviewMouseLeftButtonDownEvent, New MouseButtonEventHandler(AddressOf OnChildPreviewMouseLeftButtonDown), True)
|
||||
End If
|
||||
|
||||
m_parentWindow = Window.GetWindow(Me)
|
||||
If m_parentWindow Is Nothing Then Return
|
||||
AddHandler m_parentWindow.Activated, AddressOf OnParentWindowActivated
|
||||
AddHandler m_parentWindow.Deactivated, AddressOf OnParentWindowDeactivated
|
||||
End Sub
|
||||
|
||||
Private Sub OnPopupUnloaded(ByVal sender As Object, ByVal e As RoutedEventArgs)
|
||||
If m_parentWindow Is Nothing Then Return
|
||||
RemoveHandler m_parentWindow.Activated, AddressOf OnParentWindowActivated
|
||||
RemoveHandler m_parentWindow.Deactivated, AddressOf OnParentWindowDeactivated
|
||||
End Sub
|
||||
|
||||
Private Sub OnParentWindowActivated(ByVal sender As Object, ByVal e As EventArgs)
|
||||
SetTopmostState(True)
|
||||
End Sub
|
||||
|
||||
Private Sub OnParentWindowDeactivated(ByVal sender As Object, ByVal e As EventArgs)
|
||||
If IsTopmost = False Then
|
||||
SetTopmostState(IsTopmost)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub OnChildPreviewMouseLeftButtonDown(ByVal sender As Object, ByVal e As MouseButtonEventArgs)
|
||||
SetTopmostState(True)
|
||||
|
||||
If Not m_parentWindow.IsActive AndAlso IsTopmost = False Then
|
||||
m_parentWindow.Activate()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Protected Overrides Sub OnOpened(ByVal e As EventArgs)
|
||||
SetTopmostState(IsTopmost)
|
||||
MyBase.OnOpened(e)
|
||||
End Sub
|
||||
|
||||
Private Sub SetTopmostState(ByVal isTop As Boolean)
|
||||
If m_appliedTopMost.HasValue AndAlso m_appliedTopMost = isTop Then
|
||||
Return
|
||||
End If
|
||||
|
||||
If Child Is Nothing Then Return
|
||||
Dim hwndSource = TryCast((PresentationSource.FromVisual(Child)), HwndSource)
|
||||
If hwndSource Is Nothing Then Return
|
||||
Dim hwnd = hwndSource.Handle
|
||||
Dim rect As RECT
|
||||
If Not GetWindowRect(hwnd, rect) Then Return
|
||||
Debug.WriteLine("setting z-order " & isTop)
|
||||
|
||||
If isTop Then
|
||||
SetWindowPos(hwnd, HWND_TOPMOST, rect.Left, rect.Top, CInt(Width), CInt(Height), TOPMOST_FLAGS)
|
||||
Else
|
||||
SetWindowPos(hwnd, HWND_BOTTOM, rect.Left, rect.Top, CInt(Width), CInt(Height), TOPMOST_FLAGS)
|
||||
SetWindowPos(hwnd, HWND_TOP, rect.Left, rect.Top, CInt(Width), CInt(Height), TOPMOST_FLAGS)
|
||||
SetWindowPos(hwnd, HWND_NOTOPMOST, rect.Left, rect.Top, CInt(Width), CInt(Height), TOPMOST_FLAGS)
|
||||
End If
|
||||
|
||||
m_appliedTopMost = isTop
|
||||
End Sub
|
||||
|
||||
<StructLayout(LayoutKind.Sequential)>
|
||||
Public Structure RECT
|
||||
Public Left As Integer
|
||||
Public Top As Integer
|
||||
Public Right As Integer
|
||||
Public Bottom As Integer
|
||||
End Structure
|
||||
|
||||
<DllImport("user32.dll")>
|
||||
Private Shared Function GetWindowRect(ByVal hWnd As IntPtr, <Out> ByRef lpRect As RECT) As Boolean
|
||||
End Function
|
||||
<DllImport("user32.dll")>
|
||||
Private Shared Function SetWindowPos(ByVal hWnd As IntPtr, ByVal hWndInsertAfter As IntPtr, ByVal X As Integer, ByVal Y As Integer, ByVal cx As Integer, ByVal cy As Integer, ByVal uFlags As UInteger) As Boolean
|
||||
End Function
|
||||
Shared ReadOnly HWND_TOPMOST As IntPtr = New IntPtr(-1)
|
||||
Shared ReadOnly HWND_NOTOPMOST As IntPtr = New IntPtr(-2)
|
||||
Shared ReadOnly HWND_TOP As IntPtr = New IntPtr(0)
|
||||
Shared ReadOnly HWND_BOTTOM As IntPtr = New IntPtr(1)
|
||||
Private Const SWP_NOSIZE As UInt32 = &H1
|
||||
Const SWP_NOMOVE As UInt32 = &H2
|
||||
Const SWP_NOZORDER As UInt32 = &H4
|
||||
Const SWP_NOREDRAW As UInt32 = &H8
|
||||
Const SWP_NOACTIVATE As UInt32 = &H10
|
||||
Const SWP_FRAMECHANGED As UInt32 = &H20
|
||||
Const SWP_SHOWWINDOW As UInt32 = &H40
|
||||
Const SWP_HIDEWINDOW As UInt32 = &H80
|
||||
Const SWP_NOCOPYBITS As UInt32 = &H100
|
||||
Const SWP_NOOWNERZORDER As UInt32 = &H200
|
||||
Const SWP_NOSENDCHANGING As UInt32 = &H400
|
||||
Const TOPMOST_FLAGS As UInt32 = SWP_NOACTIVATE Or SWP_NOOWNERZORDER Or SWP_NOSIZE Or SWP_NOMOVE Or SWP_NOREDRAW Or SWP_NOSENDCHANGING
|
||||
End Class
|
||||
@@ -3,7 +3,6 @@
|
||||
Public Const TABLE = "Table"
|
||||
Public Const TABLE_OUTLINE = "TableOutline"
|
||||
Public Const PART = "Part"
|
||||
Public Const ORIGINAL_SOLID = "OriginalSolid"
|
||||
Public Const PRINT_SOLID = "PrintSolid"
|
||||
Public Const LAY_MACH_START = "MachStart"
|
||||
Public Const LAY_REFERENCE = "Frame"
|
||||
@@ -15,11 +14,13 @@
|
||||
Public Const START_GEOM = "Start"
|
||||
Public Const RIB_EXTRUSION = "RibExtrusion"
|
||||
Public Const RIB_CURVE = "RibCurve"
|
||||
Public Const RIB_ID = "RibId"
|
||||
Public Const VIEWPARAMS = "ViewParams"
|
||||
Public Const IMPORTED_SOLID = "ImportedSolid"
|
||||
Public Const RESULT_READ_PROG = "ResultReadProg"
|
||||
Public Const KEY_CALC_SOLIDS = "CalcSolids"
|
||||
Public Const KEY_HAS_SOLIDS = "Solids"
|
||||
Public Const LAY_CHUNKS = "Chunks"
|
||||
|
||||
|
||||
' parametri calcolo tempi, F ed S
|
||||
@@ -37,6 +38,7 @@
|
||||
Public Const KEY_SPEED = "Speed"
|
||||
Public Const KEY_SLICEID = "SliceId"
|
||||
Public Const KEY_MASS = "PrintMass"
|
||||
Public Const KEY_EMITWAITINGTIME = "EmitWaitingTime"
|
||||
|
||||
|
||||
' parametri Materiali
|
||||
@@ -47,7 +49,8 @@
|
||||
Public Const MAT_T3 = "T3"
|
||||
Public Const MAT_T4 = "T4"
|
||||
Public Const MAT_T5 = "T5"
|
||||
Public Const MAT_K = "K"
|
||||
Public Const MAT_KEXTRUSION = "KExtrusion"
|
||||
Public Const MAT_KLAYERTIME = "KLayerTime"
|
||||
Public Const MAT_C1 = "C1"
|
||||
Public Const MAT_C2 = "C2"
|
||||
Public Const MAT_DENSITY = "Density"
|
||||
@@ -90,18 +93,21 @@
|
||||
Public Const MAC_LEADOUTTANGDIST = "LeadOutTangDist"
|
||||
Public Const MAC_LEADOUTORTHODIST = "LeadOutOrthoDist"
|
||||
Public Const MAC_COASTINGLEN = "CoastingLen"
|
||||
Public Const MAC_COASTINGFEED = "CoastingFeed"
|
||||
Public Const MAC_COASTINGFEEDPU = "CoastingFeedPu"
|
||||
Public Const MAC_WIPELEN = "WipeLen"
|
||||
Public Const MAC_WIPEFEEDPU = "WipeFeedPu"
|
||||
Public Const MAC_WIPEDIR = "WipeDir"
|
||||
Public Const MAC_FLOORCOUNT = "FloorCount"
|
||||
Public Const MAC_G0FEED = "G0Feed"
|
||||
Public Const MAC_G0FEEDZ = "G0FeedZ"
|
||||
Public Const MAC_TOOLDIAM = "ToolDiam"
|
||||
Public Const MAC_RIBSTYPE = "RibsType"
|
||||
Public Const MAC_RIBSOVERLAP = "RibsOverlap"
|
||||
Public Const MAC_RIBSSTRANDCOUNT = "RibsStrandCount"
|
||||
Public Const MAC_RIBSLINK = "RibsLink"
|
||||
Public Const MAC_RIBSINVERTORDER = "RibsInvertOrder"
|
||||
Public Const MAC_RIBSINVERTDIRECTION = "RibsInvertDirection"
|
||||
Public Const MAC_RIBSINVERTSTRANDORDER = "RibsInvertStrandOrder"
|
||||
Public Const MAC_RIBSLEADININVERT = "RibsLeadInInvert"
|
||||
Public Const MAC_RIBSLEADINLEN = "RibsLeadInLen"
|
||||
Public Const MAC_RIBSLEADOUTINVERT = "RibsLeadOutInvert"
|
||||
@@ -122,6 +128,8 @@
|
||||
Public Const MAC_AUXSOLIDSCOASTINGLEN = "AuxSolidsCoastingLen"
|
||||
Public Const MAC_AUXSOLIDSWIPELEN = "AuxSolidsWipeLen"
|
||||
Public Const MAC_AUXSOLIDSWIPEDIR = "AuxSolidsWipeDir"
|
||||
Public Const MAC_DYNAMICMODE = "DynamicMode"
|
||||
Public Const MAC_PRINTORDER = "PrintOrder"
|
||||
Public Const MAC_CONSTANT = "Constant"
|
||||
Public Const MAC_MATERIALS = "Materials"
|
||||
|
||||
@@ -146,9 +154,19 @@
|
||||
' materiale in progetto
|
||||
Public Const KEY_MATERIAL_GUID = "MaterialGuid"
|
||||
Public Const KEY_MATERIAL_NAME = "MaterialName"
|
||||
|
||||
' nome file cn in progetto
|
||||
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 PART_NAME = "PartName"
|
||||
Public Const ENTITY_NAME = "EntityName"
|
||||
|
||||
' stringa che identifica il materiale come originale del costruttore
|
||||
Public Const ORIG_MATERIAL As String = "***"
|
||||
|
||||
End Module
|
||||
|
||||
@@ -51,17 +51,7 @@ Public Module ConstGen
|
||||
|
||||
' Abilitazioni licenza
|
||||
Friend Enum KEY_OPT As UInteger
|
||||
BASE = 1 ' Prodotto EgtCAM5
|
||||
DOORS = 2
|
||||
GUNSTOCK = 4
|
||||
DOORCREATOR = 8 ' Prodotto DOORCreator
|
||||
VIRTUALMILLING = 16
|
||||
JAMBS = 32
|
||||
BEAM = 64
|
||||
CAD2D = 128
|
||||
STEELDORS = 256
|
||||
WALL = 512
|
||||
_3DPRINT = 1024
|
||||
BASE = 1 ' Prodotto Icarus
|
||||
End Enum
|
||||
|
||||
' File di log generale
|
||||
|
||||
@@ -42,6 +42,7 @@ Public Module ConstIni
|
||||
Public Const K_MOD_AUXSOLIDS As String = "ModAuxSolids"
|
||||
Public Const K_MOD_SOLIDSLICE As String = "ModSolidSlice"
|
||||
Public Const K_MOD_SLICETOOLPATH As String = "ModSliceToolPath"
|
||||
Public Const K_MOD_OTHERS As String = "ModOthers"
|
||||
Public Const K_SLC_PRINTSOLID As String = "SlcPrintSolid"
|
||||
Public Const K_SLC_REFERENCE As String = "SlcReference"
|
||||
Public Const K_SLC_STARTMACHINING As String = "SlcStartMAchining"
|
||||
@@ -50,6 +51,7 @@ Public Module ConstIni
|
||||
Public Const K_SLC_AUXSOLIDS As String = "SlcAuxSolids"
|
||||
Public Const K_SLC_SOLIDSLICE As String = "SlcSolidSlice"
|
||||
Public Const K_SLC_SLICETOOLPATH As String = "SlcSliceToolPath"
|
||||
Public Const K_SLC_OTHERS As String = "SlcOthers"
|
||||
|
||||
'Public Const S_LUA As String = "Lua"
|
||||
'Public Const K_LIBSDIR As String = "LibsDir"
|
||||
@@ -109,6 +111,15 @@ Public Module ConstIni
|
||||
Public Const K_CURRMATERIAL As String = "CurrMaterial"
|
||||
Public Const K_CURRMACHINING As String = "CurrMachining"
|
||||
Public Const K_VIEWSLIDER As String = "ViewSlider"
|
||||
Public Const K_IMPORTCURREXTENSION As String = "ImportCurrExtension"
|
||||
|
||||
Public Const S_COLORS As String = "Colors"
|
||||
Public Const K_CLR_PRINTPART As String = "PrintPart"
|
||||
Public Const K_CLR_RIBS As String = "Ribs"
|
||||
Public Const K_CLR_SHELLNUMBERS As String = "ShellNumbers"
|
||||
Public Const K_CLR_AUXSOLIDS As String = "AuxSolids"
|
||||
Public Const K_CLR_MACHSTART As String = "MachStart"
|
||||
Public Const K_CLR_OTHERS As String = "Others"
|
||||
|
||||
Public Const S_MRUFILES As String = "MruFiles"
|
||||
Public Const S_MRUIMPORTFILES As String = "MruImportFiles"
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
Public Const K_MACH_EXITSCRIPT As String = "ExitScript"
|
||||
|
||||
Public Const S_MACH_PRINTING3D As String = "3dPrinting"
|
||||
Public Const K_HORIZONTAL_PRINT As String = "HorizontalPrint"
|
||||
Public Const K_SLICINGTYPE As String = "SlicingType"
|
||||
Public Const K_SPEED_MIN As String = "SpeedMin"
|
||||
Public Const K_SPEED_MAX As String = "SpeedMax"
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
Imports System.Collections.ObjectModel
|
||||
Imports System.Collections.Specialized
|
||||
Imports System.ComponentModel
|
||||
Imports EgtUILib
|
||||
Imports EgtWPFLib5
|
||||
@@ -150,7 +151,7 @@ Public Class CurrMachining
|
||||
|
||||
Friend Overrides Sub OnMachiningParamPropertyChanged(sender As Object, e As PropertyChangedEventArgs)
|
||||
Select Case e.PropertyName
|
||||
Case NameOf(sender.dValue), NameOf(sender.sValue), NameOf(sender.bValue), NameOf(sender.SelValue)
|
||||
Case NameOf(sender.dValue), NameOf(sender.sValue), NameOf(sender.bValue), NameOf(sender.SelValue), NameOf(sender.Value)
|
||||
m_bIsModified = m_CathegoryList.Any(Function(x) x.MachiningParamList.Any(Function(y) y.bIsModified))
|
||||
NotifyPropertyChanged(NameOf(ghName))
|
||||
NotifyPropertyChanged(NameOf(sCurrSlicingType))
|
||||
@@ -158,9 +159,25 @@ Public Class CurrMachining
|
||||
NotifyPropertyChanged(NameOf(sCurrStrandW))
|
||||
NotifyPropertyChanged(NameOf(sCurrStrandCount))
|
||||
NotifyPropertyChanged(NameOf(sCurrOffset))
|
||||
sender.NotifyPropertyChanged(NameOf(sender.bIsModifiedFromDb))
|
||||
End Select
|
||||
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)
|
||||
EgtSetInfo(nPartId, MAC_GUID, m_sCurrGUID.ToString())
|
||||
For Each Cathegory As CurrMachiningCathegory In m_CathegoryList
|
||||
@@ -194,8 +211,11 @@ Public Class CurrMachiningCathegory
|
||||
New CurrComboMachiningParam(MachiningParam.Params.DIRECTION, nPartId, nIndex, bForceFromDb),
|
||||
New CurrNumericMachiningParam(MachiningParam.Params.FLOORCOUNT, nPartId, nIndex, bForceFromDb),
|
||||
New CurrNumericMachiningParam(MachiningParam.Params.G0FEED, nPartId, nIndex, bForceFromDb),
|
||||
New CurrNumericMachiningParam(MachiningParam.Params.G0FEEDZ, nPartId, nIndex, bForceFromDb),
|
||||
New CurrNumericMachiningParam(MachiningParam.Params.TOOLDIAM, nPartId, nIndex, bForceFromDb),
|
||||
New CurrNumericMachiningParam(MachiningParam.Params.CONSTANT, nPartId, nIndex, bForceFromDb)})
|
||||
New CurrNumericMachiningParam(MachiningParam.Params.FLOWRATE_PC, nPartId, nIndex, bForceFromDb),
|
||||
New CurrComboMachiningParam(MachiningParam.Params.DYNAMIC_MODE, nPartId, nIndex, bForceFromDb),
|
||||
New CurrOrderedMachiningParam(MachiningParam.Params.PRINT_ORDER, nPartId, nIndex, bForceFromDb)})
|
||||
Case Cathegories.LINK
|
||||
m_sName = "Shell"
|
||||
m_MachiningParamList = New List(Of MachiningParam)({New CurrComboMachiningParam(MachiningParam.Params.LINKTYPE, nPartId, nIndex, bForceFromDb),
|
||||
@@ -209,17 +229,19 @@ Public Class CurrMachiningCathegory
|
||||
New CurrNumericMachiningParam(MachiningParam.Params.LEADOUTTANGDIST, nPartId, nIndex, bForceFromDb),
|
||||
New CurrNumericMachiningParam(MachiningParam.Params.LEADOUTORTHODIST, nPartId, nIndex, bForceFromDb),
|
||||
New CurrNumericMachiningParam(MachiningParam.Params.COASTINGLEN, nPartId, nIndex, bForceFromDb),
|
||||
New CurrNumericMachiningParam(MachiningParam.Params.COASTINGFEED, nPartId, nIndex, bForceFromDb),
|
||||
New CurrNumericMachiningParam(MachiningParam.Params.COASTINGFEED_PC, nPartId, nIndex, bForceFromDb),
|
||||
New CurrNumericMachiningParam(MachiningParam.Params.WIPELEN, nPartId, nIndex, bForceFromDb),
|
||||
New CurrNumericMachiningParam(MachiningParam.Params.WIPEFEEDPU, nPartId, nIndex, bForceFromDb),
|
||||
New CurrNumericMachiningParam(MachiningParam.Params.WIPEDIR, nPartId, nIndex, bForceFromDb)})
|
||||
New CurrNumericMachiningParam(MachiningParam.Params.WIPEFEED_PC, nPartId, nIndex, bForceFromDb)})
|
||||
'New CurrNumericMachiningParam(MachiningParam.Params.WIPEDIR, nPartId, nIndex, bForceFromDb)})
|
||||
Case Cathegories.RIBS
|
||||
m_sName = "Ribs"
|
||||
m_MachiningParamList = New List(Of MachiningParam)({New CurrNumericMachiningParam(MachiningParam.Params.RIBSOVERLAP, nPartId, nIndex, bForceFromDb),
|
||||
m_MachiningParamList = New List(Of MachiningParam)({New CurrComboMachiningParam(MachiningParam.Params.RIBSTYPE, nPartId, nIndex, bForceFromDb),
|
||||
New CurrNumericMachiningParam(MachiningParam.Params.RIBSOVERLAP, nPartId, nIndex, bForceFromDb),
|
||||
New CurrNumericMachiningParam(MachiningParam.Params.RIBSSTRANDCOUNT, nPartId, nIndex, bForceFromDb),
|
||||
New CurrCheckMachiningParam(MachiningParam.Params.RIBSLINK, nPartId, nIndex, bForceFromDb),
|
||||
New CurrCheckMachiningParam(MachiningParam.Params.RIBSINVERTORDER, nPartId, nIndex, bForceFromDb),
|
||||
New CurrCheckMachiningParam(MachiningParam.Params.RIBSINVERTDIRECTION, nPartId, nIndex, bForceFromDb),
|
||||
New CurrCheckMachiningParam(MachiningParam.Params.RIBSINVERTSTRANDORDER, nPartId, nIndex, bForceFromDb),
|
||||
New CurrCheckMachiningParam(MachiningParam.Params.RIBSLEADININVERT, nPartId, nIndex, bForceFromDb),
|
||||
New CurrNumericMachiningParam(MachiningParam.Params.RIBSLEADINLEN, nPartId, nIndex, bForceFromDb),
|
||||
New CurrCheckMachiningParam(MachiningParam.Params.RIBSLEADOUTINVERT, nPartId, nIndex, bForceFromDb),
|
||||
@@ -247,12 +269,6 @@ Public Class CurrMachiningCathegory
|
||||
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()
|
||||
@@ -272,13 +288,13 @@ Public Class CurrNumericMachiningParam
|
||||
|
||||
Public Overrides Property sValue As String
|
||||
Get
|
||||
Return If(m_bIsLen, LenToString(m_dValue, 1), m_dValue)
|
||||
Return If(m_bIsLen, LenToString(m_dValue, 1), DoubleToString(m_dValue, 2))
|
||||
End Get
|
||||
Set(value As String)
|
||||
If m_bIsLen Then
|
||||
StringToLen(value, m_dValue)
|
||||
Else
|
||||
m_dValue = value
|
||||
StringToDouble(value, m_dValue)
|
||||
End If
|
||||
NotifyPropertyChanged(NameOf(sValue))
|
||||
NotifyPropertyChanged(NameOf(bIsModifiedFromDb))
|
||||
@@ -313,13 +329,13 @@ Public Class CurrNumericMachiningParam
|
||||
m_bIsLen = True
|
||||
Case Params.STRANDCOUNT
|
||||
bReadFromPart = EgtGetInfo(nPartId, MAC_STRANDCOUNT, m_dValue)
|
||||
m_bIsLen = True
|
||||
m_bIsLen = False
|
||||
Case Params.OFFSET
|
||||
bReadFromPart = EgtGetInfo(nPartId, MAC_OFFSET, m_dValue)
|
||||
m_bIsLen = True
|
||||
Case Params.STRANDOVERLAP
|
||||
bReadFromPart = EgtGetInfo(nPartId, MAC_STRANDOVERLAP, m_dValue)
|
||||
m_bIsLen = True
|
||||
m_bIsLen = False
|
||||
Case Params.STARTPOINTOFFSETONSLICE
|
||||
bReadFromPart = EgtGetInfo(nPartId, MAC_STARTPOINTOFFSETONSLICE, m_dValue)
|
||||
m_bIsLen = True
|
||||
@@ -347,33 +363,36 @@ Public Class CurrNumericMachiningParam
|
||||
Case Params.COASTINGLEN
|
||||
bReadFromPart = EgtGetInfo(nPartId, MAC_COASTINGLEN, m_dValue)
|
||||
m_bIsLen = True
|
||||
Case Params.COASTINGFEED
|
||||
bReadFromPart = EgtGetInfo(nPartId, MAC_COASTINGFEED, m_dValue)
|
||||
m_bIsLen = True
|
||||
Case Params.COASTINGFEED_PC
|
||||
bReadFromPart = EgtGetInfo(nPartId, MAC_COASTINGFEEDPU, m_dValue)
|
||||
m_bIsLen = False
|
||||
Case Params.WIPELEN
|
||||
bReadFromPart = EgtGetInfo(nPartId, MAC_WIPELEN, m_dValue)
|
||||
m_bIsLen = True
|
||||
Case Params.WIPEFEEDPU
|
||||
Case Params.WIPEFEED_PC
|
||||
bReadFromPart = EgtGetInfo(nPartId, MAC_WIPEFEEDPU, m_dValue)
|
||||
m_bIsLen = True
|
||||
Case Params.WIPEDIR
|
||||
bReadFromPart = EgtGetInfo(nPartId, MAC_WIPEDIR, m_dValue)
|
||||
m_bIsLen = True
|
||||
m_bIsLen = False
|
||||
'Case Params.WIPEDIR
|
||||
' bReadFromPart = EgtGetInfo(nPartId, MAC_WIPEDIR, m_dValue)
|
||||
' m_bIsLen = True
|
||||
Case Params.FLOORCOUNT
|
||||
bReadFromPart = EgtGetInfo(nPartId, MAC_FLOORCOUNT, m_dValue)
|
||||
m_bIsLen = True
|
||||
m_bIsLen = False
|
||||
Case Params.G0FEED
|
||||
bReadFromPart = EgtGetInfo(nPartId, MAC_G0FEED, m_dValue)
|
||||
m_bIsLen = True
|
||||
Case Params.G0FEEDZ
|
||||
bReadFromPart = EgtGetInfo(nPartId, MAC_G0FEEDZ, m_dValue)
|
||||
m_bIsLen = True
|
||||
Case Params.TOOLDIAM
|
||||
bReadFromPart = EgtGetInfo(nPartId, MAC_TOOLDIAM, m_dValue)
|
||||
m_bIsLen = True
|
||||
Case Params.RIBSOVERLAP
|
||||
bReadFromPart = EgtGetInfo(nPartId, MAC_RIBSOVERLAP, m_dValue)
|
||||
m_bIsLen = True
|
||||
m_bIsLen = False
|
||||
Case Params.RIBSSTRANDCOUNT
|
||||
bReadFromPart = EgtGetInfo(nPartId, MAC_RIBSSTRANDCOUNT, m_dValue)
|
||||
m_bIsLen = True
|
||||
m_bIsLen = False
|
||||
Case Params.RIBSLEADINLEN
|
||||
bReadFromPart = EgtGetInfo(nPartId, MAC_RIBSLEADINLEN, m_dValue)
|
||||
m_bIsLen = True
|
||||
@@ -388,10 +407,10 @@ Public Class CurrNumericMachiningParam
|
||||
m_bIsLen = True
|
||||
Case Params.RIBSLEADOUTWIPEDIR
|
||||
bReadFromPart = EgtGetInfo(nPartId, MAC_RIBSLEADOUTWIPEDIR, m_dValue)
|
||||
m_bIsLen = True
|
||||
m_bIsLen = False
|
||||
Case Params.SHELLNBRDIFFERENCE
|
||||
bReadFromPart = EgtGetInfo(nPartId, MAC_SHELLNBRDIFFERENCE, m_dValue)
|
||||
m_bIsLen = True
|
||||
m_bIsLen = False
|
||||
Case Params.SHELLNBRCOASTING
|
||||
bReadFromPart = EgtGetInfo(nPartId, MAC_SHELLNBRCOASTING, m_dValue)
|
||||
m_bIsLen = True
|
||||
@@ -400,10 +419,10 @@ Public Class CurrNumericMachiningParam
|
||||
m_bIsLen = True
|
||||
Case Params.SHELLNBRWIPEDIR
|
||||
bReadFromPart = EgtGetInfo(nPartId, MAC_SHELLNBRWIPEDIR, m_dValue)
|
||||
m_bIsLen = True
|
||||
m_bIsLen = False
|
||||
Case Params.AUXSOLIDSOVERLAP
|
||||
bReadFromPart = EgtGetInfo(nPartId, MAC_AUXSOLIDSOVERLAP, m_dValue)
|
||||
m_bIsLen = True
|
||||
m_bIsLen = False
|
||||
Case Params.AUXSOLIDSLINKPARAM
|
||||
bReadFromPart = EgtGetInfo(nPartId, MAC_AUXSOLIDSLINKPARAM, m_dValue)
|
||||
m_bIsLen = True
|
||||
@@ -418,8 +437,8 @@ Public Class CurrNumericMachiningParam
|
||||
m_bIsLen = True
|
||||
Case Params.AUXSOLIDSWIPEDIR
|
||||
bReadFromPart = EgtGetInfo(nPartId, MAC_AUXSOLIDSWIPEDIR, m_dValue)
|
||||
m_bIsLen = True
|
||||
Case Params.CONSTANT
|
||||
m_bIsLen = False
|
||||
Case Params.FLOWRATE_PC
|
||||
bReadFromPart = EgtGetInfo(nPartId, MAC_CONSTANT, m_dValue)
|
||||
m_bIsLen = False
|
||||
End Select
|
||||
@@ -427,24 +446,31 @@ Public Class CurrNumericMachiningParam
|
||||
If nIndex > 0 Then
|
||||
Dim DbMachining As Machining = Map.refMachiningDbVM.MachiningList.FirstOrDefault(Function(x) x.nIndex = nIndex)
|
||||
Select Case Type
|
||||
Case Params.STRANDH, Params.STRANDW, Params.STRANDCOUNT, Params.OFFSET, Params.STRANDOVERLAP, Params.STARTPOINTOFFSETONSLICE, Params.FLOORCOUNT, Params.G0FEED, Params.TOOLDIAM, Params.CONSTANT
|
||||
Case Params.STRANDH, Params.STRANDW, Params.STRANDCOUNT, Params.OFFSET, Params.STRANDOVERLAP, Params.STARTPOINTOFFSETONSLICE,
|
||||
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)
|
||||
Case Params.LINKPARAM, Params.LINKZUP, Params.OFFSETLEADPOINT, Params.LEADINTANGDIST, Params.LEADINORTHODIST,
|
||||
Params.LEADOUTTANGDIST, Params.LEADOUTORTHODIST, Params.COASTINGLEN, Params.COASTINGFEED, Params.WIPELEN, Params.WIPEFEEDPU, Params.WIPEDIR
|
||||
Params.LEADOUTTANGDIST, Params.LEADOUTORTHODIST, Params.COASTINGLEN, Params.COASTINGFEED_PC,
|
||||
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)
|
||||
Case Params.RIBSOVERLAP, Params.RIBSSTRANDCOUNT, Params.RIBSLINK, Params.RIBSINVERTORDER, Params.RIBSINVERTDIRECTION, Params.RIBSLEADININVERT,
|
||||
Params.RIBSLEADINLEN, Params.RIBSLEADOUTINVERT, Params.RIBSLEADOUTLEN, Params.RIBSLEADOUTCOASTING, Params.RIBSLEADOUTWIPE, Params.RIBSLEADOUTWIPEDIR
|
||||
Case Params.RIBSOVERLAP, Params.RIBSSTRANDCOUNT, Params.RIBSLINK, Params.RIBSINVERTORDER, Params.RIBSINVERTDIRECTION,
|
||||
Params.RIBSLEADININVERT, Params.RIBSLEADINLEN, Params.RIBSLEADOUTINVERT, Params.RIBSLEADOUTLEN, Params.RIBSLEADOUTCOASTING,
|
||||
Params.RIBSLEADOUTWIPE, Params.RIBSLEADOUTWIPEDIR
|
||||
m_DbParam = DbMachining.CathegoryList.FirstOrDefault(Function(y) y.Type = MachiningCathegory.Cathegories.RIBS).MachiningParamList.FirstOrDefault(Function(z) z.Type = m_Type)
|
||||
Case Params.SHELLNBRDIFFERENCE, Params.SHELLNBRCOASTING, Params.SHELLNBRWIPE, Params.SHELLNBRWIPEDIR
|
||||
m_DbParam = DbMachining.CathegoryList.FirstOrDefault(Function(y) y.Type = MachiningCathegory.Cathegories.SHELL_NUMBER).MachiningParamList.FirstOrDefault(Function(z) z.Type = m_Type)
|
||||
Case Params.AUXSOLIDSOVERLAP, Params.AUXSOLIDSLINKPARAM, Params.AUXSOLIDSSTARTPOINTOFFSETONSLICE, Params.AUXSOLIDSCOASTINGLEN, Params.AUXSOLIDSWIPELEN, Params.AUXSOLIDSWIPEDIR
|
||||
Case Params.AUXSOLIDSOVERLAP, Params.AUXSOLIDSLINKPARAM, Params.AUXSOLIDSSTARTPOINTOFFSETONSLICE,
|
||||
Params.AUXSOLIDSCOASTINGLEN, Params.AUXSOLIDSWIPELEN, Params.AUXSOLIDSWIPEDIR
|
||||
m_DbParam = DbMachining.CathegoryList.FirstOrDefault(Function(y) y.Type = MachiningCathegory.Cathegories.AUX_SOLID).MachiningParamList.FirstOrDefault(Function(z) z.Type = m_Type)
|
||||
End Select
|
||||
If bForceFromDb OrElse Not bReadFromPart Then
|
||||
m_dValue = m_DbParam.dOrigValue
|
||||
m_dOrigValue = m_DbParam.dOrigValue
|
||||
End If
|
||||
ElseIf Type = Params.CONSTANT AndAlso Not bReadFromPart Then
|
||||
ElseIf Type = Params.G0FEEDZ AndAlso Not bReadFromPart Then
|
||||
m_dValue = 1000
|
||||
m_dOrigValue = 1000
|
||||
ElseIf Type = Params.FLOWRATE_PC AndAlso Not bReadFromPart Then
|
||||
m_dValue = 100
|
||||
m_dOrigValue = 100
|
||||
End If
|
||||
@@ -486,18 +512,20 @@ Public Class CurrNumericMachiningParam
|
||||
EgtSetInfo(nPartId, MAC_LEADOUTORTHODIST, sWriteValue)
|
||||
Case Params.COASTINGLEN
|
||||
EgtSetInfo(nPartId, MAC_COASTINGLEN, sWriteValue)
|
||||
Case Params.COASTINGFEED
|
||||
EgtSetInfo(nPartId, MAC_COASTINGFEED, sWriteValue)
|
||||
Case Params.COASTINGFEED_PC
|
||||
EgtSetInfo(nPartId, MAC_COASTINGFEEDPU, sWriteValue)
|
||||
Case Params.WIPELEN
|
||||
EgtSetInfo(nPartId, MAC_WIPELEN, sWriteValue)
|
||||
Case Params.WIPEFEEDPU
|
||||
Case Params.WIPEFEED_PC
|
||||
EgtSetInfo(nPartId, MAC_WIPEFEEDPU, sWriteValue)
|
||||
Case Params.WIPEDIR
|
||||
EgtSetInfo(nPartId, MAC_WIPEDIR, sWriteValue)
|
||||
'Case Params.WIPEDIR
|
||||
' EgtSetInfo(nPartId, MAC_WIPEDIR, sWriteValue)
|
||||
Case Params.FLOORCOUNT
|
||||
EgtSetInfo(nPartId, MAC_FLOORCOUNT, sWriteValue)
|
||||
Case Params.G0FEED
|
||||
EgtSetInfo(nPartId, MAC_G0FEED, sWriteValue)
|
||||
Case Params.G0FEEDZ
|
||||
EgtSetInfo(nPartId, MAC_G0FEEDZ, sWriteValue)
|
||||
Case Params.TOOLDIAM
|
||||
EgtSetInfo(nPartId, MAC_TOOLDIAM, sWriteValue)
|
||||
Case Params.RIBSOVERLAP
|
||||
@@ -534,7 +562,7 @@ Public Class CurrNumericMachiningParam
|
||||
EgtSetInfo(nPartId, MAC_AUXSOLIDSWIPELEN, sWriteValue)
|
||||
Case Params.AUXSOLIDSWIPEDIR
|
||||
EgtSetInfo(nPartId, MAC_AUXSOLIDSWIPEDIR, sWriteValue)
|
||||
Case Params.CONSTANT
|
||||
Case Params.FLOWRATE_PC
|
||||
EgtSetInfo(nPartId, MAC_CONSTANT, sWriteValue)
|
||||
End Select
|
||||
End Sub
|
||||
@@ -672,11 +700,16 @@ Public Class CurrComboMachiningParam
|
||||
Dim bReadFromPart As Boolean = False
|
||||
Select Case Type
|
||||
Case Params.SLICINGTYPE
|
||||
Dim nHorizontalPrint As Integer = GetPrivateProfileInt(S_MACH_PRINTING3D, K_HORIZONTAL_PRINT, 0, CurrentMachine.sMachIniFile)
|
||||
m_ValueList = New List(Of IdNameStruct)({New IdNameStruct(Machining.MPAR_SLICINGTYPE.VERTICAL, "Vertical"),
|
||||
New IdNameStruct(Machining.MPAR_SLICINGTYPE.HORIZONTAL, "Horizontal")})
|
||||
If nHorizontalPrint > 0 Then
|
||||
m_ValueList.Add(New IdNameStruct(Machining.MPAR_SLICINGTYPE.DEG45, "45°"))
|
||||
Dim nSlicingType As Integer = GetPrivateProfileInt(S_MACH_PRINTING3D, K_SLICINGTYPE, 0, CurrentMachine.sMachIniFile)
|
||||
m_ValueList = New List(Of IdNameStruct)({New IdNameStruct(Machining.MPAR_SLICINGTYPE.VERTICAL, "Vertical")})
|
||||
If nSlicingType >= 1 Then
|
||||
m_ValueList.Add(New IdNameStruct(Machining.MPAR_SLICINGTYPE.DEG45, "45deg X"))
|
||||
If nSlicingType >= 2 Then
|
||||
m_ValueList.Add(New IdNameStruct(Machining.MPAR_SLICINGTYPE.DEG45_Y, "45deg Y"))
|
||||
If nSlicingType >= 3 Then
|
||||
m_ValueList.Add(New IdNameStruct(Machining.MPAR_SLICINGTYPE.HORIZONTAL, "Horizontal"))
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
Dim nSelValue As Integer = 0
|
||||
bReadFromPart = EgtGetInfo(nPartId, MAC_SLICINGTYPE, nSelValue)
|
||||
@@ -719,6 +752,14 @@ Public Class CurrComboMachiningParam
|
||||
Dim nSelValue As Integer = 0
|
||||
bReadFromPart = EgtGetInfo(nPartId, MAC_LEADOUT, nSelValue)
|
||||
m_SelValue = m_ValueList.FirstOrDefault(Function(x) x.Id = nSelValue)
|
||||
Case Params.RIBSTYPE
|
||||
m_ValueList = New List(Of IdNameStruct)({New IdNameStruct(Machining.MPAR_RIBSTYPE.INTERNAL, "Internal"),
|
||||
New IdNameStruct(Machining.MPAR_RIBSTYPE.EXTERNAL, "External"),
|
||||
New IdNameStruct(Machining.MPAR_RIBSTYPE.UNBOUNDED, "Unbounded"),
|
||||
New IdNameStruct(Machining.MPAR_RIBSTYPE.SUPPORT, "Support")})
|
||||
Dim nSelValue As Integer = 0
|
||||
bReadFromPart = EgtGetInfo(nPartId, MAC_RIBSTYPE, nSelValue)
|
||||
m_SelValue = m_ValueList.FirstOrDefault(Function(x) x.Id = nSelValue)
|
||||
Case Params.AUXSOLIDSINFILL
|
||||
m_ValueList = New List(Of IdNameStruct)({New IdNameStruct(Machining.MPAR_INFILL.NONE, "None"),
|
||||
New IdNameStruct(Machining.MPAR_INFILL.OFFSET, "Offset"),
|
||||
@@ -739,15 +780,23 @@ Public Class CurrComboMachiningParam
|
||||
Dim nSelValue As Integer = 0
|
||||
bReadFromPart = EgtGetInfo(nPartId, MAC_AUXSOLIDSLINKTYPE, nSelValue)
|
||||
m_SelValue = m_ValueList.FirstOrDefault(Function(x) x.Id = nSelValue)
|
||||
Case Params.DYNAMIC_MODE
|
||||
m_ValueList = New List(Of IdNameStruct)({New IdNameStruct(Machining.MPAR_DYNAMIC_MODE.STANDARD, "Standard"),
|
||||
New IdNameStruct(Machining.MPAR_DYNAMIC_MODE.FAST, "Fast")})
|
||||
Dim nSelValue As Integer = 0
|
||||
bReadFromPart = EgtGetInfo(nPartId, MAC_DYNAMICMODE, nSelValue)
|
||||
m_SelValue = m_ValueList.FirstOrDefault(Function(x) x.Id = nSelValue)
|
||||
End Select
|
||||
m_OrigSelValue = m_SelValue
|
||||
If nIndex > 0 Then
|
||||
Dim DbMachining As Machining = Map.refMachiningDbVM.MachiningList.FirstOrDefault(Function(x) x.nIndex = nIndex)
|
||||
Select Case Type
|
||||
Case Params.SLICINGTYPE, Params.STRANDORDER, Params.DIRECTION
|
||||
Case Params.SLICINGTYPE, Params.STRANDORDER, Params.DIRECTION, Params.DYNAMIC_MODE
|
||||
m_DbParam = DbMachining.CathegoryList.FirstOrDefault(Function(y) y.Type = MachiningCathegory.Cathegories.GENERAL).MachiningParamList.FirstOrDefault(Function(z) z.Type = m_Type)
|
||||
Case Params.LINKTYPE, Params.LEADIN, Params.LEADOUT
|
||||
m_DbParam = DbMachining.CathegoryList.FirstOrDefault(Function(y) y.Type = MachiningCathegory.Cathegories.LINK).MachiningParamList.FirstOrDefault(Function(z) z.Type = m_Type)
|
||||
Case Params.RIBSTYPE
|
||||
m_DbParam = DbMachining.CathegoryList.FirstOrDefault(Function(y) y.Type = MachiningCathegory.Cathegories.RIBS).MachiningParamList.FirstOrDefault(Function(z) z.Type = m_Type)
|
||||
Case Params.AUXSOLIDSINFILL, Params.AUXSOLIDSSTRANDORDER, Params.AUXSOLIDSLINKTYPE
|
||||
m_DbParam = DbMachining.CathegoryList.FirstOrDefault(Function(y) y.Type = MachiningCathegory.Cathegories.AUX_SOLID).MachiningParamList.FirstOrDefault(Function(z) z.Type = m_Type)
|
||||
End Select
|
||||
@@ -755,6 +804,12 @@ Public Class CurrComboMachiningParam
|
||||
m_SelValue = m_DbParam.OrigSelValue
|
||||
m_OrigSelValue = m_DbParam.OrigSelValue
|
||||
End If
|
||||
ElseIf Type = Params.RIBSTYPE AndAlso Not bReadFromPart Then
|
||||
m_OrigSelValue = m_ValueList.FirstOrDefault(Function(x) x.Id = Machining.MPAR_RIBSTYPE.INTERNAL)
|
||||
m_SelValue = m_OrigSelValue
|
||||
ElseIf Type = Params.DYNAMIC_MODE AndAlso Not bReadFromPart Then
|
||||
m_OrigSelValue = m_ValueList.FirstOrDefault(Function(x) x.Id = Machining.MPAR_DYNAMIC_MODE.STANDARD)
|
||||
m_SelValue = m_OrigSelValue
|
||||
End If
|
||||
End Sub
|
||||
|
||||
@@ -772,12 +827,16 @@ Public Class CurrComboMachiningParam
|
||||
EgtSetInfo(nPartId, MAC_LEADIN, m_SelValue.Id)
|
||||
Case Params.LEADOUT
|
||||
EgtSetInfo(nPartId, MAC_LEADOUT, m_SelValue.Id)
|
||||
Case Params.RIBSTYPE
|
||||
EgtSetInfo(nPartId, MAC_RIBSTYPE, m_SelValue.Id)
|
||||
Case Params.AUXSOLIDSINFILL
|
||||
EgtSetInfo(nPartId, MAC_AUXSOLIDSINFILL, m_SelValue.Id)
|
||||
Case Params.AUXSOLIDSSTRANDORDER
|
||||
EgtSetInfo(nPartId, MAC_AUXSOLIDSSTRANDORDER, m_SelValue.Id)
|
||||
Case Params.AUXSOLIDSLINKTYPE
|
||||
EgtSetInfo(nPartId, MAC_AUXSOLIDSLINKTYPE, m_SelValue.Id)
|
||||
Case Params.DYNAMIC_MODE
|
||||
EgtSetInfo(nPartId, MAC_DYNAMICMODE, m_SelValue.Id)
|
||||
End Select
|
||||
End Sub
|
||||
|
||||
@@ -857,6 +916,8 @@ Public Class CurrCheckMachiningParam
|
||||
bReadFromPart = EgtGetInfo(nPartId, MAC_RIBSINVERTORDER, m_bValue)
|
||||
Case Params.RIBSINVERTDIRECTION
|
||||
bReadFromPart = EgtGetInfo(nPartId, MAC_RIBSINVERTDIRECTION, m_bValue)
|
||||
Case Params.RIBSINVERTSTRANDORDER
|
||||
bReadFromPart = EgtGetInfo(nPartId, MAC_RIBSINVERTSTRANDORDER, m_bValue)
|
||||
Case Params.RIBSLEADININVERT
|
||||
bReadFromPart = EgtGetInfo(nPartId, MAC_RIBSLEADININVERT, m_bValue)
|
||||
Case Params.RIBSLEADOUTINVERT
|
||||
@@ -868,7 +929,7 @@ Public Class CurrCheckMachiningParam
|
||||
Select Case Type
|
||||
Case Params.SPIRALVASE
|
||||
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.RIBSLEADININVERT, Params.RIBSLEADOUTINVERT
|
||||
Case Params.RIBSLINK, Params.RIBSINVERTORDER, Params.RIBSINVERTDIRECTION, Params.RIBSINVERTSTRANDORDER, Params.RIBSLEADININVERT, Params.RIBSLEADOUTINVERT
|
||||
m_DbParam = DbMachining.CathegoryList.FirstOrDefault(Function(y) y.Type = MachiningCathegory.Cathegories.RIBS).MachiningParamList.FirstOrDefault(Function(z) z.Type = m_Type)
|
||||
End Select
|
||||
If bForceFromDb OrElse Not bReadFromPart Then
|
||||
@@ -888,6 +949,8 @@ Public Class CurrCheckMachiningParam
|
||||
EgtSetInfo(nPartId, MAC_RIBSINVERTORDER, If(m_bValue, 1, 0))
|
||||
Case Params.RIBSINVERTDIRECTION
|
||||
EgtSetInfo(nPartId, MAC_RIBSINVERTDIRECTION, If(m_bValue, 1, 0))
|
||||
Case Params.RIBSINVERTSTRANDORDER
|
||||
EgtSetInfo(nPartId, MAC_RIBSINVERTSTRANDORDER, If(m_bValue, 1, 0))
|
||||
Case Params.RIBSLEADININVERT
|
||||
EgtSetInfo(nPartId, MAC_RIBSLEADININVERT, If(m_bValue, 1, 0))
|
||||
Case Params.RIBSLEADOUTINVERT
|
||||
@@ -929,3 +992,107 @@ Public Class CurrCheckMachiningParam
|
||||
|
||||
End Class
|
||||
|
||||
Public Class CurrOrderedMachiningParam
|
||||
Inherits OrderedMachiningParam
|
||||
|
||||
Private m_DbParam As OrderedMachiningParam
|
||||
Public ReadOnly Property DbParam As OrderedMachiningParam
|
||||
Get
|
||||
Return m_DbParam
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property bIsModifiedFromDb As Boolean
|
||||
Get
|
||||
Return If(Map.refTopPanelVM.SelMachining.sGUID <> Guid.Empty, Value <> m_DbParam.Value, False)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
' Definizione comandi
|
||||
Private m_cmdResetParam As ICommand
|
||||
|
||||
Sub New(Type As Params, nPartId As Integer, nIndex As Integer, bForceFromDb As Boolean)
|
||||
MyBase.New(Type, nIndex)
|
||||
Dim bReadFromPart As Boolean = False
|
||||
Select Case Type
|
||||
Case Params.PRINT_ORDER
|
||||
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 Shells"),
|
||||
New IdNameStruct(Machining.MPAR_PRINT_ORDER.INFILL, "Infills"),
|
||||
New IdNameStruct(Machining.MPAR_PRINT_ORDER.AUX_SOLID, "Filled Solids"),
|
||||
New IdNameStruct(Machining.MPAR_PRINT_ORDER.RIB_UNBOUNDED, "Unbounded Ribs"),
|
||||
New IdNameStruct(Machining.MPAR_PRINT_ORDER.RIB_EXTERNAL, "External Ribs"),
|
||||
New IdNameStruct(Machining.MPAR_PRINT_ORDER.RIB_INTERNAL, "Internal Ribs"),
|
||||
New IdNameStruct(Machining.MPAR_PRINT_ORDER.RIB_SUPPORT, "Support Ribs")})
|
||||
Dim sValue As String = ""
|
||||
bReadFromPart = EgtGetInfo(nPartId, MAC_PRINTORDER, sValue)
|
||||
Value = sValue
|
||||
End Select
|
||||
m_OrigValue = Value
|
||||
If nIndex > 0 Then
|
||||
Dim DbMachining As Machining = Map.refMachiningDbVM.MachiningList.FirstOrDefault(Function(x) x.nIndex = nIndex)
|
||||
Select Case Type
|
||||
Case Params.PRINT_ORDER
|
||||
m_DbParam = DbMachining.CathegoryList.FirstOrDefault(Function(y) y.Type = MachiningCathegory.Cathegories.GENERAL).MachiningParamList.FirstOrDefault(Function(z) z.Type = m_Type)
|
||||
End Select
|
||||
If bForceFromDb OrElse Not bReadFromPart Then
|
||||
Value = m_DbParam.OrigValue
|
||||
m_OrigValue = m_DbParam.OrigValue
|
||||
End If
|
||||
ElseIf Type = Params.PRINT_ORDER AndAlso Not bReadFromPart Then
|
||||
Value = ""
|
||||
m_OrigValue = Value
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Friend Overrides Sub WriteParamInPart(nPartId As Integer)
|
||||
Select Case Type
|
||||
Case Params.PRINT_ORDER
|
||||
EgtSetInfo(nPartId, MAC_PRINTORDER, Value)
|
||||
End Select
|
||||
End Sub
|
||||
|
||||
Friend Overrides Sub SaveParam()
|
||||
m_OrigValue = Value
|
||||
End Sub
|
||||
|
||||
Friend Overrides Sub ResetParam()
|
||||
Value = m_OrigValue
|
||||
m_SelValue = Nothing
|
||||
NotifyPropertyChanged(NameOf(ValueList))
|
||||
NotifyPropertyChanged(NameOf(SelValue))
|
||||
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()
|
||||
Value = DbParam.OrigValue
|
||||
NotifyPropertyChanged(NameOf(Value))
|
||||
NotifyPropertyChanged(NameOf(SelValue))
|
||||
NotifyPropertyChanged(NameOf(bIsModifiedFromDb))
|
||||
End Sub
|
||||
|
||||
#End Region ' ResetParam
|
||||
|
||||
#End Region ' COMMANDS
|
||||
|
||||
End Class
|
||||
|
||||
@@ -27,8 +27,7 @@
|
||||
<ItemsControl ItemsSource="{Binding MachiningParamList}">
|
||||
<ItemsControl.ItemsPanel>
|
||||
<ItemsPanelTemplate>
|
||||
<UniformGrid Columns="1"
|
||||
HorizontalAlignment="Stretch"/>
|
||||
<StackPanel Orientation="Vertical"/>
|
||||
</ItemsPanelTemplate>
|
||||
</ItemsControl.ItemsPanel>
|
||||
<ItemsControl.Resources>
|
||||
@@ -118,6 +117,44 @@
|
||||
Style="{StaticResource ToolBar_SmallButton}"/>
|
||||
</Grid>
|
||||
</DataTemplate>
|
||||
<DataTemplate DataType="{x:Type PrintApp:OrderedMachiningParam}">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="2*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock Text="{Binding sName}"
|
||||
VerticalAlignment="Center"/>
|
||||
<ListBox Grid.Column="1"
|
||||
ItemsSource="{Binding ValueList}"
|
||||
SelectedItem="{Binding SelValue}"/>
|
||||
<StackPanel Grid.Column="2"
|
||||
Orientation="Vertical"
|
||||
VerticalAlignment="Center"
|
||||
Margin="5,0,0,0">
|
||||
<Button Content="˄"
|
||||
Command="{Binding MoveUpOrder_Command}"
|
||||
Margin="0"
|
||||
Style="{StaticResource ToolBar_SmallButton}"/>
|
||||
<Button Content="˅"
|
||||
Command="{Binding MoveDownOrder_Command}"
|
||||
Margin="0"
|
||||
Style="{StaticResource ToolBar_SmallButton}"/>
|
||||
<Button Content="<>"
|
||||
Command="{Binding ResetOrder_Command}"
|
||||
Margin="0"
|
||||
Style="{StaticResource ToolBar_SmallButton}"/>
|
||||
<Button Content="R"
|
||||
Command="{Binding ResetParam_Command}"
|
||||
IsEnabled="{Binding bIsModifiedFromDb}"
|
||||
VerticalContentAlignment="Center"
|
||||
HorizontalContentAlignment="Center"
|
||||
Margin="0"
|
||||
Style="{StaticResource ToolBar_SmallButton}"/>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</DataTemplate>
|
||||
</ItemsControl.Resources>
|
||||
</ItemsControl>
|
||||
</Expander>
|
||||
|
||||
@@ -59,8 +59,23 @@ Public Class CurrMachiningPanelVM
|
||||
End Property
|
||||
|
||||
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
|
||||
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()
|
||||
End If
|
||||
' ripristino modalita' standard
|
||||
Map.refTopPanelVM.SelPage = Pages.MODIFY
|
||||
End Sub
|
||||
|
||||
@@ -28,12 +28,6 @@
|
||||
Content="Move"
|
||||
IsChecked="{Binding bMove_IsChecked}"
|
||||
Style="{StaticResource ToolBar_TextToggleButton}"/>
|
||||
<!--<Border Background="Red"
|
||||
Grid.Column="1"
|
||||
Grid.Row="1"
|
||||
Grid.RowSpan="5"
|
||||
Width="50"
|
||||
VerticalAlignment="Stretch"/>-->
|
||||
|
||||
<Border x:Name="PopupBrd"
|
||||
Grid.Column="1"
|
||||
@@ -97,77 +91,12 @@
|
||||
</Grid>
|
||||
</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"
|
||||
Grid.Row="4"
|
||||
Content="Rotate"
|
||||
IsChecked="{Binding bRotate_IsChecked}"
|
||||
Style="{StaticResource ToolBar_TextToggleButton}"/>
|
||||
<!--<Border Background="Blue"
|
||||
Grid.Column="2"
|
||||
Grid.Row="2"
|
||||
Grid.RowSpan="5"
|
||||
Width="50"
|
||||
VerticalAlignment="Stretch"
|
||||
HorizontalAlignment="Stretch"/>-->
|
||||
|
||||
<Border Grid.Column="1"
|
||||
Grid.Row="2"
|
||||
@@ -186,15 +115,15 @@
|
||||
<UniformGrid Columns="3">
|
||||
<RadioButton Content="X"
|
||||
GroupName="Axes"
|
||||
IsChecked="{Binding RotAxes[0]}"
|
||||
IsChecked="{Binding RotX}"
|
||||
Style="{StaticResource ToolBar_ToggleButton}"/>
|
||||
<RadioButton Content="Y"
|
||||
GroupName="Axes"
|
||||
IsChecked="{Binding RotAxes[1]}"
|
||||
IsChecked="{Binding RotY}"
|
||||
Style="{StaticResource ToolBar_ToggleButton}"/>
|
||||
<RadioButton Content="Z"
|
||||
GroupName="Axes"
|
||||
IsChecked="{Binding RotAxes[2]}"
|
||||
IsChecked="{Binding RotZ}"
|
||||
Style="{StaticResource ToolBar_ToggleButton}"/>
|
||||
</UniformGrid>
|
||||
<EgtWPFLib5:EgtTextBox Grid.Row="1"
|
||||
@@ -209,42 +138,4 @@
|
||||
</Grid>
|
||||
</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>
|
||||
|
||||
@@ -20,13 +20,27 @@ Public Class DispositionPanelVM
|
||||
EgtStartPoint(Map.refTopPanelVM.SelPart.nReferenceId, GDB_ID.ROOT, ptReference)
|
||||
Dim dNewXPos As Double = ptReference.x
|
||||
StringToLen(value, dNewXPos)
|
||||
If dNewXPos >= 0 AndAlso dNewXPos <= CurrentMachine.b3Tab.DimX Then
|
||||
EgtMove(Map.refTopPanelVM.SelPart.nPartId, New Point3d(dNewXPos, ptReference.y, ptReference.z) - ptReference)
|
||||
EgtDraw()
|
||||
Else
|
||||
NotifyPropertyChanged(NameOf(sXPos))
|
||||
Dim b3Print As BBox3d = GetSolidForReferenceBBox(Map.refTopPanelVM.SelPart)
|
||||
Dim dMin As Double = 0
|
||||
Dim dMax As Double = CurrentMachine.b3Tab.DimX
|
||||
If b3Print.Max.x > ptReference.x Then
|
||||
dMax -= b3Print.Max.x - ptReference.x
|
||||
End If
|
||||
If b3Print.Min.x < ptReference.x Then
|
||||
dMin += ptReference.x - b3Print.Min.x
|
||||
End If
|
||||
' riduco a spostamento massimo
|
||||
If dNewXPos < dMin Then
|
||||
dNewXPos = dMin
|
||||
ElseIf dNewXPos > dMax Then
|
||||
dNewXPos = dMax
|
||||
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 Property
|
||||
|
||||
@@ -45,13 +59,27 @@ Public Class DispositionPanelVM
|
||||
EgtStartPoint(Map.refTopPanelVM.SelPart.nReferenceId, GDB_ID.ROOT, ptReference)
|
||||
Dim dNewYPos As Double = ptReference.y
|
||||
StringToLen(value, dNewYPos)
|
||||
If dNewYPos >= 0 AndAlso dNewYPos <= CurrentMachine.b3Tab.DimY Then
|
||||
EgtMove(Map.refTopPanelVM.SelPart.nPartId, New Point3d(ptReference.x, dNewYPos, ptReference.z) - ptReference)
|
||||
EgtDraw()
|
||||
Else
|
||||
NotifyPropertyChanged(NameOf(sYPos))
|
||||
Dim b3Print As BBox3d = GetSolidForReferenceBBox(Map.refTopPanelVM.SelPart)
|
||||
Dim dMin As Double = 0
|
||||
Dim dMax As Double = CurrentMachine.b3Tab.DimY
|
||||
If b3Print.Max.y > ptReference.y Then
|
||||
dMax -= b3Print.Max.y - ptReference.y
|
||||
End If
|
||||
If b3Print.Min.y < ptReference.y Then
|
||||
dMin += ptReference.y - b3Print.Min.y
|
||||
End If
|
||||
' riduco a spostamento massimo
|
||||
If dNewYPos < dMin Then
|
||||
dNewYPos = dMin
|
||||
ElseIf dNewyPos > dMax Then
|
||||
dNewYPos = dMax
|
||||
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 Property
|
||||
|
||||
@@ -70,23 +98,90 @@ Public Class DispositionPanelVM
|
||||
EgtStartPoint(Map.refTopPanelVM.SelPart.nReferenceId, GDB_ID.ROOT, ptReference)
|
||||
Dim dNewZPos As Double = ptReference.z
|
||||
StringToLen(value, dNewZPos)
|
||||
If dNewZPos >= 0 Then
|
||||
EgtMove(Map.refTopPanelVM.SelPart.nPartId, New Point3d(ptReference.x, ptReference.y, dNewZPos) - ptReference)
|
||||
EgtDraw()
|
||||
Else
|
||||
NotifyPropertyChanged(NameOf(sZPos))
|
||||
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
|
||||
' 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 Property
|
||||
|
||||
Private m_RotAxes() As Boolean = {False, False, True}
|
||||
Public Property RotAxes As Boolean()
|
||||
Friend Sub UpdateZPos()
|
||||
Dim ptReference As New Point3d
|
||||
EgtStartPoint(Map.refTopPanelVM.SelPart.nReferenceId, 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}
|
||||
Public Property RotX As Boolean
|
||||
Get
|
||||
Return m_RotAxes
|
||||
Return m_RotAxes(0)
|
||||
End Get
|
||||
Set(value As Boolean())
|
||||
m_RotAxes = value
|
||||
Set(value As Boolean)
|
||||
m_RotAxes(0) = value
|
||||
End Set
|
||||
End Property
|
||||
Public Property RotY As Boolean
|
||||
Get
|
||||
Return m_RotAxes(1)
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
m_RotAxes(1) = value
|
||||
End Set
|
||||
End Property
|
||||
Public Property RotZ As Boolean
|
||||
Get
|
||||
Return m_RotAxes(2)
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
m_RotAxes(2) = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
@@ -96,7 +191,7 @@ Public Class DispositionPanelVM
|
||||
Return Vector3d.X_AX
|
||||
ElseIf m_RotAxes(1) Then
|
||||
Return Vector3d.Y_AX
|
||||
ElseIf m_RotAxes(2) Then
|
||||
Else
|
||||
Return Vector3d.Z_AX
|
||||
End If
|
||||
End Get
|
||||
@@ -109,22 +204,39 @@ Public Class DispositionPanelVM
|
||||
End Get
|
||||
Set(value As String)
|
||||
Dim dNewAngle As Double = 0
|
||||
If Not StringToLen(value, dNewAngle) Then
|
||||
If IsNothing( value) OrElse Not StringToLen(value, dNewAngle) Then
|
||||
m_sRotAngle = 0
|
||||
NotifyPropertyChanged(NameOf(sRotAngle))
|
||||
Return
|
||||
End If
|
||||
Dim vtMovedPart As Vector3d
|
||||
If EgtGetInfo(Map.refTopPanelVM.SelPart.nPartId, KEY_MOVEDPART, vtMovedPart) Then
|
||||
Dim nEntId = EgtGetFirstInGroup(Map.refTopPanelVM.SelPart.nPrintSolidLayerId)
|
||||
While nEntId <> GDB_ID.NULL
|
||||
EgtMove(nEntId, -vtMovedPart, GDB_RT.GLOB)
|
||||
nEntId = EgtGetNext(nEntId)
|
||||
End While
|
||||
EgtRemoveInfo(Map.refTopPanelVM.SelPart.nPartId, KEY_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
|
||||
Dim b3PrintSolid As New BBox3d
|
||||
EgtGetBBoxGlob(Map.refTopPanelVM.SelPart.nPartId, GDB_BB.STANDARD, b3PrintSolid)
|
||||
If EgtRotate(Map.refTopPanelVM.SelPart.nPartId, b3PrintSolid.Center, vtSelRotAxes, dNewAngle) Then
|
||||
EgtDraw()
|
||||
RefreshPos()
|
||||
If EgtRotate(Map.refTopPanelVM.SelPart.nPartId, b3PrintSolid.Center, vtSelRotAxes, dNewAngle, GDB_RT.GLOB) Then
|
||||
m_sRotAngle = 0
|
||||
Map.refReferencePanelVM.UpdateFramePosition()
|
||||
Map.refDispositionPanelVM.UpdateZPos()
|
||||
RefreshPos()
|
||||
EgtDraw()
|
||||
NotifyPropertyChanged(NameOf(sRotAngle))
|
||||
' Imposto flag di ricalcolo slice
|
||||
EgtSetInfo(Map.refTopPanelVM.SelPart.nPartId, MAC_TORECALC_SLICE, True)
|
||||
Else
|
||||
m_sRotAngle = value
|
||||
End If
|
||||
Map.refReferencePanelVM.UpdateFramePosition()
|
||||
End Set
|
||||
End Property
|
||||
|
||||
@@ -178,7 +290,8 @@ Public Class DispositionPanelVM
|
||||
End Sub
|
||||
|
||||
Friend Sub Init()
|
||||
|
||||
RotZ = True
|
||||
NotifyPropertyChanged(NameOf(RotZ))
|
||||
End Sub
|
||||
|
||||
Friend Sub RefreshPos()
|
||||
@@ -193,6 +306,7 @@ Public Class DispositionPanelVM
|
||||
' seleziono percorso corrente
|
||||
EgtDeselectAll()
|
||||
EgtSelectObj(Map.refTopPanelVM.SelPart.nPartId)
|
||||
EgtDraw()
|
||||
End Sub
|
||||
|
||||
Friend Sub UpdateUI()
|
||||
@@ -201,8 +315,9 @@ Public Class DispositionPanelVM
|
||||
m_bRotating = False
|
||||
' ripristino griglia
|
||||
EgtSetGridFrame(m_PrevGridOrigin)
|
||||
EgtDraw()
|
||||
End If
|
||||
EgtDeselectAll()
|
||||
EgtDraw()
|
||||
End Sub
|
||||
|
||||
Friend Sub OnKeyDown(Key As Forms.Keys)
|
||||
@@ -211,8 +326,9 @@ Public Class DispositionPanelVM
|
||||
m_bRotating = False
|
||||
' ripristino griglia
|
||||
EgtSetGridFrame(m_PrevGridOrigin)
|
||||
EgtDraw()
|
||||
End If
|
||||
EgtDeselectAll()
|
||||
EgtDraw()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
|
||||
@@ -53,6 +53,28 @@
|
||||
<PropertyGroup>
|
||||
<ApplicationManifest>app.manifest</ApplicationManifest>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DefineDebug>true</DefineDebug>
|
||||
<DefineTrace>true</DefineTrace>
|
||||
<OutputPath>bin\x86\Debug\</OutputPath>
|
||||
<DocumentationFile>Icarus.xml</DocumentationFile>
|
||||
<NoWarn>41999,42016,42017,42018,42019,42020,42021,42022,42032,42036,42314</NoWarn>
|
||||
<DebugType>full</DebugType>
|
||||
<PlatformTarget>x86</PlatformTarget>
|
||||
<Prefer32Bit>true</Prefer32Bit>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DefineTrace>true</DefineTrace>
|
||||
<OutputPath>bin\x86\Release\</OutputPath>
|
||||
<DocumentationFile>Icarus.xml</DocumentationFile>
|
||||
<Optimize>true</Optimize>
|
||||
<NoWarn>41999,42016,42017,42018,42019,42020,42021,42022,42032,42036,42314</NoWarn>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<PlatformTarget>x86</PlatformTarget>
|
||||
<Prefer32Bit>true</Prefer32Bit>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="EgtUILib, Version=2.4.7.1, Culture=neutral, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
@@ -123,11 +145,10 @@
|
||||
<DependentUpon>DispositionPanelV.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="DispositionPanel\DispositionPanelVM.vb" />
|
||||
<Compile Include="ImportPanel\ImportPanelV.xaml.vb">
|
||||
<DependentUpon>ImportPanelV.xaml</DependentUpon>
|
||||
<Compile Include="ImportExportMachiningPanel\ImportExportMachiningPanelV.xaml.vb">
|
||||
<DependentUpon>ImportExportMachiningPanelV.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="ImportPanel\ImportPanelVM.vb" />
|
||||
<Compile Include="ImportPanel\ImportUtility.vb" />
|
||||
<Compile Include="ImportExportMachiningPanel\ImportExportMachiningPanelVM.vb" />
|
||||
<Compile Include="InstrumentPanel\InstrumentPanelV.xaml.vb">
|
||||
<DependentUpon>InstrumentPanelV.xaml</DependentUpon>
|
||||
</Compile>
|
||||
@@ -154,16 +175,16 @@
|
||||
<DependentUpon>MachSaveInDbWindowV.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="MachSaveInDbWnd\MachSaveInDbWndVM.vb" />
|
||||
<Compile Include="ManagePartPanel\ManagePartPanelV.xaml.vb">
|
||||
<DependentUpon>ManagePartPanelV.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="ManagePartPanel\ManagePartPanelVM.vb" />
|
||||
<Compile Include="ManagePartPanel\ManagePartUtility.vb" />
|
||||
<Compile Include="MaterialDb\Material.vb" />
|
||||
<Compile Include="MaterialDb\MaterialDbV.xaml.vb">
|
||||
<DependentUpon>MaterialDbV.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="MaterialDb\MaterialDbVM.vb" />
|
||||
<Compile Include="ModifyPartPanel\ModifyPartPanelV.xaml.vb">
|
||||
<DependentUpon>ModifyPartPanelV.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="ModifyPartPanel\ModifyPartPanelVM.vb" />
|
||||
<Compile Include="ModifyPartPanel\ModifyPartUtility.vb" />
|
||||
<Compile Include="OptionsWindow\MachineBox.xaml.vb">
|
||||
<DependentUpon>MachineBox.xaml</DependentUpon>
|
||||
</Compile>
|
||||
@@ -188,6 +209,10 @@
|
||||
<DependentUpon>RibPanelV.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="RibPanel\RibPanelVM.vb" />
|
||||
<Compile Include="RibParamPanel\CopyFromWndV.xaml.vb">
|
||||
<DependentUpon>CopyFromWndV.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="RibParamPanel\CopyFromWndVM.vb" />
|
||||
<Compile Include="RibParamPanel\RibParamPanelV.xaml.vb">
|
||||
<DependentUpon>RibParamPanelV.xaml</DependentUpon>
|
||||
</Compile>
|
||||
@@ -304,9 +329,9 @@
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Include="ImportPanel\ImportPanelV.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Page Include="ImportExportMachiningPanel\ImportExportMachiningPanelV.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Include="InstrumentPanel\InstrumentPanelV.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
@@ -348,14 +373,14 @@
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Include="ManagePartPanel\ManagePartPanelV.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Include="MaterialDb\MaterialDbV.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="ModifyPartPanel\ModifyPartPanelV.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Include="OptionsWindow\MachineBox.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
@@ -380,6 +405,10 @@
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Include="RibParamPanel\CopyFromWndV.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="RibParamPanel\RibParamPanelV.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
@@ -640,15 +669,24 @@
|
||||
<ItemGroup>
|
||||
<Resource Include="Resources\TopPanel\Edit.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Resource Include="Resources\MachiningDb\Export.png" />
|
||||
<Resource Include="Resources\MachiningDb\Import.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Resource Include="Resources\SplashScreen\GoldSplashscreen.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Resource Include="Resources\SplashScreen\LogoEgalware.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Resource Include="Resources\ProjectManager\Export.png" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />
|
||||
<PropertyGroup>
|
||||
<PostBuildEvent>IF "$(PlatformName)"=="x64" IF "$(ConfigurationName)" == "Release" copy $(TargetPath) c:\EgtProg\Icarus\IcarusR64.exe
|
||||
<PostBuildEvent>IF "$(PlatformName)"=="x86" IF "$(ConfigurationName)" == "Release" copy $(TargetPath) c:\EgtProg\Icarus\IcarusR32.exe
|
||||
IF "$(PlatformName)"=="x86" IF "$(ConfigurationName)" == "Debug" copy $(TargetPath) c:\EgtProg\Icarus\IcarusD32.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>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
@@ -0,0 +1,62 @@
|
||||
<EgtWPFLib5:EgtCustomWindow x:Class="ImportExportMachiningPanelV"
|
||||
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 OkMsg}"
|
||||
Style="{DynamicResource {x:Type EgtWPFLib5:EgtCustomWindow}}"
|
||||
WindowStyle="None" ResizeMode="NoResize" TitleBarHeight="30" IsResizable="False"
|
||||
IsMinimizable="False" WindowStartupLocation="CenterOwner" ShowInTaskbar="False"
|
||||
Width="400" Height="500">
|
||||
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="7*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<ListBox ItemsSource="{Binding MachiningList}">
|
||||
<ListBox.ItemTemplate>
|
||||
<DataTemplate DataType="{x:Type EgtWPFLib5:ImpExpMachiningItem}">
|
||||
<Grid Height="20">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<CheckBox Name="ActiveTxBx"
|
||||
Grid.Column="0"
|
||||
IsChecked="{Binding Active}"
|
||||
Height="15"
|
||||
Width="15"
|
||||
Margin="0,0,5,0"
|
||||
VerticalContentAlignment="Center"
|
||||
Visibility="{Binding Path=DataContext.Active_Visibility,
|
||||
RelativeSource={RelativeSource AncestorType={x:Type EgtWPFLib5:EgtCustomWindow}}}"/>
|
||||
<TextBlock Grid.Column="1"
|
||||
Text="{Binding sName}"
|
||||
FontSize="15"
|
||||
Margin="0,0,5,0"
|
||||
VerticalAlignment="Center" />
|
||||
<Ellipse Grid.Column="2"
|
||||
Width="15"
|
||||
Height="15"
|
||||
Fill="DarkOrange"
|
||||
Visibility="{Binding Overwrite_Visibility}"/>
|
||||
|
||||
</Grid>
|
||||
</DataTemplate>
|
||||
|
||||
</ListBox.ItemTemplate>
|
||||
</ListBox>
|
||||
|
||||
<Button Command="{Binding OkCommand}"
|
||||
Content="{Binding OkMsg}"
|
||||
IsEnabled="{Binding IsEnabledOkBtn, Mode=OneWay}"
|
||||
Grid.Row="1"
|
||||
Height="30" Width="100"
|
||||
Margin="10" />
|
||||
|
||||
</Grid>
|
||||
|
||||
</EgtWPFLib5:EgtCustomWindow>
|
||||
@@ -0,0 +1,18 @@
|
||||
Public Class ImportExportMachiningPanelV
|
||||
|
||||
Private WithEvents m_ImportExportMachiningPanelVM As ImportExportMachiningPanelVM
|
||||
|
||||
Sub New(Owner As Window, ImportExportMachiningPanelVM As ImportExportMachiningPanelVM)
|
||||
MyBase.New(Owner)
|
||||
' This call is required by the designer.
|
||||
InitializeComponent()
|
||||
Me.DataContext = ImportExportMachiningPanelVM
|
||||
' Assegno al riferimento locale al VM il VM preso dal DataContext
|
||||
m_ImportExportMachiningPanelVM = ImportExportMachiningPanelVM
|
||||
End Sub
|
||||
|
||||
Private Sub CloseWindow(bDialogResult As Boolean) Handles m_ImportExportMachiningPanelVM.m_CloseWindow
|
||||
Me.DialogResult = bDialogResult
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
@@ -0,0 +1,681 @@
|
||||
Imports System.Collections.ObjectModel
|
||||
Imports System.Drawing
|
||||
Imports System.IO
|
||||
Imports System.Reflection
|
||||
Imports EgtUILib
|
||||
Imports EgtWPFLib5
|
||||
Imports Icarus.ImportExportMachiningPanelVM
|
||||
|
||||
Public Class ImportExportMachiningPanelVM
|
||||
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
|
||||
Public Enum WindowModeEnum As Integer
|
||||
IMPORT = 1
|
||||
EXPORT = 2
|
||||
IMPORT_ORIG = 3
|
||||
EXPORT_ORIG = 4
|
||||
End Enum
|
||||
|
||||
' Tipo da importare/esportare
|
||||
Public Enum WindowTypeEnum As Integer
|
||||
MATERIAL = 1
|
||||
MACHINING = 2
|
||||
End Enum
|
||||
|
||||
Private m_WindowMode As WindowModeEnum
|
||||
Public ReadOnly Property WindowMode As WindowModeEnum
|
||||
Get
|
||||
Return m_WindowMode
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_WindowType As WindowTypeEnum
|
||||
Public ReadOnly Property WindowType As WindowTypeEnum
|
||||
Get
|
||||
Return m_WindowType
|
||||
End Get
|
||||
End Property
|
||||
|
||||
' Lista delle lavorazioni
|
||||
Private m_MachiningList As New ObservableCollection(Of ImpExpMachiningItem)
|
||||
Public Property MachiningList As ObservableCollection(Of ImpExpMachiningItem)
|
||||
Get
|
||||
Return m_MachiningList
|
||||
End Get
|
||||
Set(value As ObservableCollection(Of ImpExpMachiningItem))
|
||||
m_MachiningList = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
' Percorso del file da cui importare le lavorazioni
|
||||
Private m_ImportFilePath As String
|
||||
Public ReadOnly Property ImportFilePath As String
|
||||
Get
|
||||
Return m_ImportFilePath
|
||||
End Get
|
||||
End Property
|
||||
|
||||
' Lista delle lavorazioni presenti nel file da cui importare
|
||||
Private m_ImportFileMachiningNameList As String()
|
||||
Public ReadOnly Property ImportFileMachiningNameList As String()
|
||||
Get
|
||||
Return m_ImportFileMachiningNameList
|
||||
End Get
|
||||
End Property
|
||||
|
||||
' Lista delle lavorazioni importate con successo
|
||||
Private m_vsImported As String()
|
||||
Public ReadOnly Property vsImported As String()
|
||||
Get
|
||||
Return m_vsImported
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property IsEnabledOkBtn As Boolean
|
||||
Get
|
||||
For Each Machining In MachiningList
|
||||
If Machining.Active Then Return True
|
||||
Next
|
||||
Return False
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Friend Event m_CloseWindow(bDialogResult As Boolean)
|
||||
|
||||
' Definizione comandi
|
||||
Private m_cmdOk As ICommand
|
||||
|
||||
#Region "MESSAGES"
|
||||
|
||||
Public ReadOnly Property OkMsg As String
|
||||
Get
|
||||
If WindowMode = WindowModeEnum.IMPORT Then
|
||||
Return EgtMsg(31450)
|
||||
Else
|
||||
Return EgtMsg(31451)
|
||||
End If
|
||||
End Get
|
||||
End Property
|
||||
|
||||
#End Region ' Messages
|
||||
|
||||
#Region "CONSTRUCTOR"
|
||||
|
||||
' export
|
||||
Sub New(Type As WindowTypeEnum, Mode As WindowModeEnum, Optional sImportFilePath As String = "")
|
||||
m_WindowType = Type
|
||||
ImpExpMachiningItem.SetWindowType(m_WindowType)
|
||||
m_WindowMode = Mode
|
||||
' carico lista lavorazioni
|
||||
MachiningList.Clear()
|
||||
Select Case Mode
|
||||
Case WindowModeEnum.IMPORT
|
||||
Select Case Type
|
||||
Case WindowTypeEnum.MATERIAL
|
||||
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 = ""
|
||||
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!")
|
||||
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
|
||||
End Sub
|
||||
|
||||
' import
|
||||
Sub New(sImportFilePath As String)
|
||||
m_WindowMode = WindowModeEnum.IMPORT
|
||||
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
|
||||
ImpExpMachiningItem.m_delEnableOkBtn = AddressOf EnableOkBtn
|
||||
End Sub
|
||||
|
||||
#End Region ' Constructor
|
||||
|
||||
#Region "METHODS"
|
||||
|
||||
Private Sub EnableOkBtn()
|
||||
NotifyPropertyChanged(NameOf(IsEnabledOkBtn))
|
||||
End Sub
|
||||
|
||||
Private Function AlreadyExist(MachiningName As String) As Boolean
|
||||
Select Case m_WindowType
|
||||
Case WindowTypeEnum.MATERIAL
|
||||
Return Map.refMaterialDbVM.MaterialList.Any(Function(x) x.sName = MachiningName)
|
||||
Case WindowTypeEnum.MACHINING
|
||||
Return Map.refMachiningDbVM.MachiningList.Any(Function(x) x.sName = MachiningName)
|
||||
End Select
|
||||
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.")
|
||||
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.")
|
||||
Return
|
||||
End Sub
|
||||
|
||||
#End Region ' METHODS
|
||||
|
||||
#Region "COMMANDS"
|
||||
|
||||
#Region "OkCommand"
|
||||
|
||||
''' <summary>
|
||||
''' Returns a command that remove the current selected machining.
|
||||
''' </summary>
|
||||
Public ReadOnly Property OkCommand() As ICommand
|
||||
Get
|
||||
If m_cmdOk Is Nothing Then
|
||||
m_cmdOk = New Command(AddressOf ConfirmImpExpMachinings)
|
||||
End If
|
||||
Return m_cmdOk
|
||||
End Get
|
||||
End Property
|
||||
|
||||
''' <summary>
|
||||
''' Manage the MachiningDb closing. This method is invoked by the CloseMachiningDbCommand.
|
||||
''' </summary>
|
||||
Public Sub ConfirmImpExpMachinings(param As Object)
|
||||
Select Case m_WindowMode
|
||||
Case WindowModeEnum.IMPORT
|
||||
Select Case m_WindowType
|
||||
Case WindowTypeEnum.MATERIAL
|
||||
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)
|
||||
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
|
||||
CurrentMachine.SetMachiningFilePath(OrigFilePath)
|
||||
' seleziono ultima importata
|
||||
If Not IsNothing(NewMachining) Then
|
||||
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
|
||||
Else
|
||||
sExtension = MachiningDataExtension
|
||||
End If
|
||||
Dim SaveFileDlg As New System.Windows.Forms.SaveFileDialog() With {
|
||||
.Title = EgtMsg(31451) & " " & EgtMsg(31452),
|
||||
.Filter = "File data (*" & sExtension & ")|*" & sExtension,
|
||||
.FileName = String.Empty
|
||||
}
|
||||
If SaveFileDlg.ShowDialog() <> System.Windows.Forms.DialogResult.OK Then Return
|
||||
Dim sFilePath As String = String.Empty
|
||||
sFilePath = SaveFileDlg.FileName
|
||||
' se esiste già lo elimino
|
||||
If File.Exists(sFilePath) Then
|
||||
Try
|
||||
File.Delete(sFilePath)
|
||||
Catch ex As Exception
|
||||
End Try
|
||||
End If
|
||||
' creo nuovo file
|
||||
If Not File.Exists(sFilePath) Then
|
||||
Try
|
||||
File.WriteAllLines(sFilePath, {"; Commento per evitare BOM con UTF-8"})
|
||||
Catch ex As Exception
|
||||
End Try
|
||||
End If
|
||||
Select Case m_WindowType
|
||||
Case WindowTypeEnum.MATERIAL
|
||||
Dim ActiveMachiningList As List(Of Material) = (From Material In Map.refMaterialDbVM.MaterialList
|
||||
Select Material
|
||||
Where m_MachiningList.Any(Function(x) x.sGUID.ToString() = Material.sGUID AndAlso x.Active)).ToList()
|
||||
' salvo tutti i materiali sul Db
|
||||
For Index = 0 To ActiveMachiningList.Count - 1
|
||||
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
|
||||
' Chiusura finestra
|
||||
RaiseEvent m_CloseWindow(True)
|
||||
End Sub
|
||||
|
||||
#End Region ' OkCommand
|
||||
|
||||
#End Region ' Commands
|
||||
|
||||
End Class
|
||||
|
||||
Public Class ImpExpMachiningItem
|
||||
Inherits VMBase
|
||||
|
||||
Public Const IMPEXPNAME As String = "_imp"
|
||||
|
||||
' Actions
|
||||
Friend Shared m_delEnableOkBtn As Action
|
||||
|
||||
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
|
||||
Public ReadOnly Property nIndex As Integer
|
||||
Get
|
||||
Return m_nIndex
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_sGUID As Guid
|
||||
Public ReadOnly Property sGUID As Guid
|
||||
Get
|
||||
Return m_sGUID
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_sOrigName As String
|
||||
Private m_sName As String
|
||||
Public ReadOnly Property sName As String
|
||||
Get
|
||||
Return m_sName
|
||||
End Get
|
||||
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 m_WindowType
|
||||
Case WindowTypeEnum.MATERIAL
|
||||
Select Case System.Windows.MessageBox.Show("Material 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.refMaterialDbVM.MaterialList.Any(Function(x) x.sName = m_sOrigName & IMPEXPNAME) Then
|
||||
nImpNameIndex += 1
|
||||
While Map.refMaterialDbVM.MaterialList.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("Material 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
|
||||
Case WindowTypeEnum.MACHINING
|
||||
Select Case 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)
|
||||
NotifyPropertyChanged(NameOf(sName))
|
||||
m_ChangeName = True
|
||||
m_Active = True
|
||||
Case Else
|
||||
m_Active = False
|
||||
End Select
|
||||
End Select
|
||||
NotifyPropertyChanged(NameOf(Active))
|
||||
Else
|
||||
m_Active = True
|
||||
End If
|
||||
Else
|
||||
m_ChangeName = False
|
||||
m_Active = False
|
||||
m_sName = m_sOrigName
|
||||
NotifyPropertyChanged(NameOf(sName))
|
||||
End If
|
||||
NotifyPropertyChanged(NameOf(Overwrite_Visibility))
|
||||
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
|
||||
|
||||
Private m_Overwrite_Visibility As Visibility = Visibility.Collapsed
|
||||
Public ReadOnly Property Overwrite_Visibility As Visibility
|
||||
Get
|
||||
Return If(m_Active AndAlso m_AlreadyExist AndAlso Not m_ChangeName, Visibility.Visible, Visibility.Collapsed)
|
||||
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
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Sub New(nIndex As Integer, GUID As Guid, sName As String, AlreadyExist As Boolean)
|
||||
m_nIndex = nIndex
|
||||
m_sGUID = GUID
|
||||
m_sOrigName = sName
|
||||
m_sName = sName
|
||||
m_AlreadyExist = AlreadyExist
|
||||
m_Active = False
|
||||
End Sub
|
||||
|
||||
Friend Shared Function Empty() As MachiningIndex
|
||||
Return m_Empty
|
||||
End Function
|
||||
|
||||
End Class
|
||||
@@ -1,109 +0,0 @@
|
||||
<UserControl x:Class="ImportPanelV"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:local="clr-namespace:Icarus"
|
||||
Width="150"
|
||||
Margin="5,0,0,0">
|
||||
<Grid DockPanel.Dock="Left">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
<Border Style="{StaticResource LeftPanelTitle_Border}">
|
||||
<TextBlock Text="New part list"
|
||||
FontWeight="DemiBold"
|
||||
FontSize="14"/>
|
||||
</Border>
|
||||
<DockPanel Grid.Row="1">
|
||||
<Button DockPanel.Dock="Left"
|
||||
Content="+"
|
||||
FontSize="20"
|
||||
Command="{Binding AddPart_Command}"
|
||||
Style="{StaticResource LeftPanel_Button}"/>
|
||||
<Button DockPanel.Dock="Left"
|
||||
Content="-"
|
||||
FontSize="20"
|
||||
Command="{Binding RemovePart_Command}"
|
||||
Style="{StaticResource LeftPanel_Button}"/>
|
||||
<Button Content="Reference"
|
||||
Command="{Binding SetReference_Command}"
|
||||
Style="{StaticResource LeftPanel_TextButton}"/>
|
||||
</DockPanel>
|
||||
<TreeView Grid.Row="2"
|
||||
ItemsSource="{Binding ImportPartList}"
|
||||
MinHeight="300">
|
||||
<TreeView.Resources>
|
||||
<HierarchicalDataTemplate DataType="{x:Type local:ImportPart}"
|
||||
ItemsSource="{Binding LayerList}">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<Image Source="/Resources/TreeView/Folder.png"
|
||||
Height="15"/>
|
||||
<TextBlock Text="{Binding ghName}" />
|
||||
</StackPanel>
|
||||
</HierarchicalDataTemplate>
|
||||
<HierarchicalDataTemplate DataType="{x:Type local:ImportLayer}"
|
||||
ItemsSource="{Binding EntityList, UpdateSourceTrigger=PropertyChanged}">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<Image Source="/Resources/TreeView/Folder.png"
|
||||
Height="15"/>
|
||||
<TextBlock Text="{Binding sName}" />
|
||||
</StackPanel>
|
||||
</HierarchicalDataTemplate>
|
||||
<HierarchicalDataTemplate DataType="{x:Type local:GeomEntity}">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<!--<Image Source="/WpfTutorialSamples;component/Images/user.png" Margin="0,0,5,0" />-->
|
||||
<TextBlock Text="{Binding ghName}" />
|
||||
<TextBlock Text="{Binding ghReference, UpdateSourceTrigger=PropertyChanged}"/>
|
||||
</StackPanel>
|
||||
</HierarchicalDataTemplate>
|
||||
</TreeView.Resources>
|
||||
<TreeView.ItemContainerStyle>
|
||||
<Style TargetType="{x:Type TreeViewItem}">
|
||||
<Setter Property="IsSelected" Value="{Binding bIsSelected, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
|
||||
<Setter Property="IsExpanded" Value="True" />
|
||||
</Style>
|
||||
</TreeView.ItemContainerStyle>
|
||||
</TreeView>
|
||||
<Border Grid.Row="3"
|
||||
Style="{StaticResource LeftPanelTitle_Border}">
|
||||
<TextBlock Text="Imported entity list"
|
||||
FontWeight="DemiBold"
|
||||
FontSize="14"/>
|
||||
</Border>
|
||||
<ListBox Grid.Row="4"
|
||||
ItemsSource="{Binding ImportedEntityList, UpdateSourceTrigger=PropertyChanged}"
|
||||
SelectedItem="{Binding SelImportedEntity}"
|
||||
MinHeight="200">
|
||||
<ListBox.ItemContainerStyle>
|
||||
<Style TargetType="ListBoxItem">
|
||||
<Setter Property="HorizontalContentAlignment" Value="Stretch"/>
|
||||
</Style>
|
||||
</ListBox.ItemContainerStyle>
|
||||
<ListBox.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<Grid HorizontalAlignment="Stretch">
|
||||
<Grid.InputBindings>
|
||||
<MouseBinding Gesture="LeftDoubleClick"
|
||||
Command="{Binding ImportedEntity_DoubleClick}"/>
|
||||
</Grid.InputBindings>
|
||||
<TextBlock Text="{Binding ghName}">
|
||||
</TextBlock>
|
||||
</Grid>
|
||||
</DataTemplate>
|
||||
</ListBox.ItemTemplate>
|
||||
</ListBox>
|
||||
<UniformGrid Grid.Row="5"
|
||||
Rows="1">
|
||||
<Button Content="Ok"
|
||||
Command="{Binding Ok_Command}"
|
||||
Style="{StaticResource LeftPanel_TextButton}"/>
|
||||
<Button Content="Cancel"
|
||||
Command="{Binding Cancel_Command}"
|
||||
Style="{StaticResource LeftPanel_TextButton}"/>
|
||||
</UniformGrid>
|
||||
</Grid>
|
||||
</UserControl>
|
||||
@@ -1,3 +0,0 @@
|
||||
Public Class ImportPanelV
|
||||
|
||||
End Class
|
||||
@@ -1,443 +0,0 @@
|
||||
Imports System.Collections.ObjectModel
|
||||
Imports EgtUILib
|
||||
Imports EgtWPFLib5
|
||||
|
||||
Public Class ImportPanelVM
|
||||
Inherits VMBase
|
||||
|
||||
Private m_nImportedPartId As Integer = GDB_ID.NULL
|
||||
Friend ReadOnly Property nImportedPartId As Integer
|
||||
Get
|
||||
Return m_nImportedPartId
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_ImportedEntityList As New ObservableCollection(Of GeomEntity)
|
||||
Public Property ImportedEntityList As ObservableCollection(Of GeomEntity)
|
||||
Get
|
||||
Return m_ImportedEntityList
|
||||
End Get
|
||||
Set(value As ObservableCollection(Of GeomEntity))
|
||||
m_ImportedEntityList = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_SelImportedEntity As GeomEntity
|
||||
Public Property SelImportedEntity As GeomEntity
|
||||
Get
|
||||
Return m_SelImportedEntity
|
||||
End Get
|
||||
Set(value As GeomEntity)
|
||||
m_SelImportedEntity = value
|
||||
EgtDeselectAll()
|
||||
If Not IsNothing(m_SelImportedEntity) Then
|
||||
EgtSelectObj(m_SelImportedEntity.nId)
|
||||
End If
|
||||
EgtDraw()
|
||||
End Set
|
||||
End Property
|
||||
Friend Sub SetSelImportedEntity(nId As Integer)
|
||||
m_SelImportedEntity = Map.refImportPanelVM.ImportedEntityList.FirstOrDefault(Function(x) x.nId = nId)
|
||||
EgtDeselectAll()
|
||||
If Not IsNothing(m_SelImportedEntity) Then
|
||||
EgtSelectObj(m_SelImportedEntity.nId)
|
||||
End If
|
||||
EgtDraw()
|
||||
NotifyPropertyChanged(NameOf(SelImportedEntity))
|
||||
End Sub
|
||||
|
||||
Private m_ImportPartList As New ObservableCollection(Of ImportPart)
|
||||
Public ReadOnly Property ImportPartList As ObservableCollection(Of ImportPart)
|
||||
Get
|
||||
Return m_ImportPartList
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_SelImportPart As ImportPart
|
||||
Friend Sub SetSelImportPart(SelImportPart As ImportPart)
|
||||
m_SelImportPart = SelImportPart
|
||||
m_SelImportLayer = Nothing
|
||||
End Sub
|
||||
Public ReadOnly Property SelImportPart As ImportPart
|
||||
Get
|
||||
Return m_SelImportPart
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_SelImportLayer As ImportLayer
|
||||
Public ReadOnly Property SelImportLayer As ImportLayer
|
||||
Get
|
||||
Return m_SelImportLayer
|
||||
End Get
|
||||
End Property
|
||||
Friend Sub SetSelImportLayer(SelImportLayer As ImportLayer)
|
||||
m_SelImportPart = m_ImportPartList.FirstOrDefault(Function(x) x.LayerList.Contains(SelImportLayer))
|
||||
m_SelImportLayer = SelImportLayer
|
||||
End Sub
|
||||
|
||||
Private m_SelGeomEntity As GeomEntity
|
||||
Public ReadOnly Property SelGeomEntity As GeomEntity
|
||||
Get
|
||||
Return m_SelGeomEntity
|
||||
End Get
|
||||
End Property
|
||||
Friend Sub SetSelGeomEntity(SelGeomEntity As GeomEntity)
|
||||
For Each CurrPart In m_ImportPartList
|
||||
Dim CurrLayer As ImportLayer = CurrPart.LayerList.FirstOrDefault(Function(x) x.EntityList.Contains(SelGeomEntity))
|
||||
If Not IsNothing(CurrLayer) Then
|
||||
m_SelImportPart = CurrPart
|
||||
m_SelImportLayer = CurrLayer
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
m_SelGeomEntity = SelGeomEntity
|
||||
End Sub
|
||||
|
||||
' Definizione comandi
|
||||
Private m_cmdSetReference As ICommand
|
||||
Private m_cmdAddPart As ICommand
|
||||
Private m_cmdRemovePart As ICommand
|
||||
Private m_cmdOk As ICommand
|
||||
Private m_cmdCancel As ICommand
|
||||
|
||||
Sub New()
|
||||
' Creo riferimento a questa classe in EgtCAM5Map
|
||||
Map.SetRefImportPanelVM(Me)
|
||||
End Sub
|
||||
|
||||
#Region "METHODS"
|
||||
|
||||
Friend Sub Init()
|
||||
m_ImportedEntityList.Clear()
|
||||
m_ImportPartList.Clear()
|
||||
' aggiungo geometrie importate a lista
|
||||
m_nImportedPartId = EgtGetLastPart()
|
||||
Dim nLayerId As Integer = EgtGetFirstLayer(m_nImportedPartId)
|
||||
Dim nGeometryId As Integer = EgtGetFirstInGroup(nLayerId)
|
||||
While nGeometryId <> GDB_ID.NULL
|
||||
Dim sGeometryName As String = ""
|
||||
EgtGetName(nGeometryId, sGeometryName)
|
||||
m_ImportedEntityList.Add(New GeomEntity(nGeometryId, sGeometryName))
|
||||
nGeometryId = EgtGetNext(nGeometryId)
|
||||
End While
|
||||
' aggiungo primo pezzo
|
||||
m_ImportPartList.Add(New ImportPart())
|
||||
m_ImportPartList(0).LayerList.FirstOrDefault(Function(x) x.Type = ImportLayer.LayerType.PRINT_SOLID).bIsSelected = True
|
||||
End Sub
|
||||
|
||||
#End Region ' METHODS
|
||||
|
||||
#Region "COMMANDS"
|
||||
|
||||
#Region "SetReference"
|
||||
|
||||
Public ReadOnly Property SetReference_Command As ICommand
|
||||
Get
|
||||
If m_cmdSetReference Is Nothing Then
|
||||
m_cmdSetReference = New Command(AddressOf SetReference)
|
||||
End If
|
||||
Return m_cmdSetReference
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Sub SetReference()
|
||||
If Not IsNothing(SelGeomEntity) Then
|
||||
Dim ChooseReferenceWndVM As New ChooseReferenceWndVM
|
||||
Dim ChooseReferenceWndV As New ChooseReferenceWndV(Application.Current.MainWindow, ChooseReferenceWndVM)
|
||||
If Not ChooseReferenceWndV.ShowDialog() Then Return
|
||||
SelGeomEntity.Reference = ChooseReferenceWndVM.SelReference
|
||||
End If
|
||||
End Sub
|
||||
|
||||
#End Region ' SetReference
|
||||
|
||||
#Region "AddPart"
|
||||
|
||||
Public ReadOnly Property AddPart_Command As ICommand
|
||||
Get
|
||||
If m_cmdAddPart Is Nothing Then
|
||||
m_cmdAddPart = New Command(AddressOf AddPart)
|
||||
End If
|
||||
Return m_cmdAddPart
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Sub AddPart()
|
||||
m_ImportPartList.Add(New ImportPart)
|
||||
End Sub
|
||||
|
||||
#End Region ' AddPart
|
||||
|
||||
#Region "RemovePart"
|
||||
|
||||
Public ReadOnly Property RemovePart_Command As ICommand
|
||||
Get
|
||||
If m_cmdRemovePart Is Nothing Then
|
||||
m_cmdRemovePart = New Command(AddressOf RemovePart)
|
||||
End If
|
||||
Return m_cmdRemovePart
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Sub RemovePart()
|
||||
If IsNothing(SelImportLayer) Then
|
||||
' rimuovo pezzo
|
||||
m_ImportPartList.Remove(SelImportPart)
|
||||
Else
|
||||
' rimuovo geometria
|
||||
Dim CurrEntity As GeomEntity = m_SelGeomEntity
|
||||
SelImportLayer.EntityList.Remove(m_SelGeomEntity)
|
||||
' la rimetto in lista importati
|
||||
ImportedEntityList.Add(CurrEntity)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
#End Region ' RemovePart
|
||||
|
||||
#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()
|
||||
Dim sErr As New List(Of String)
|
||||
' verifico che tutti i pezzi abbiano una superficie da stampare nel layer apposito
|
||||
For Each CurrPart In m_ImportPartList
|
||||
For Each CurrLayer In CurrPart.LayerList
|
||||
Select Case CurrLayer.Type
|
||||
Case ImportLayer.LayerType.PRINT_SOLID
|
||||
If CurrLayer.EntityList.Count = 0 Then
|
||||
If sErr.Count > 0 Then sErr(sErr.Count - 1) &= Environment.NewLine
|
||||
sErr.Add(CurrPart.ghName & " - No print surface defined!")
|
||||
End If
|
||||
End Select
|
||||
Next
|
||||
Next
|
||||
If sErr.Count > 0 Then
|
||||
MessageBox.Show(String.Concat(sErr), "Error")
|
||||
Return
|
||||
Else
|
||||
' Creo pezzi e layer necessari
|
||||
For ImportPartIndex = 0 To m_ImportPartList.Count - 1
|
||||
Dim ImportPart As ImportPart = m_ImportPartList(ImportPartIndex)
|
||||
Dim frImportedPart As New Frame3d
|
||||
EgtGetGroupGlobFrame(m_nImportedPartId, frImportedPart)
|
||||
Dim nPartId As Integer = EgtCreateGroup(GDB_ID.ROOT, frImportedPart)
|
||||
EgtSetName(nPartId, PART)
|
||||
Dim nFrameId As Integer = GDB_ID.NULL
|
||||
Dim b3PrintSolid As New BBox3d
|
||||
Dim nPrintPartLayerId As Integer = GDB_ID.NULL
|
||||
Dim PrintSolidEntity As GeomEntity = Nothing
|
||||
Dim nOriginalPartLayerId As Integer = GDB_ID.NULL
|
||||
Dim nRibsLayerId As Integer = GDB_ID.NULL
|
||||
Dim nShellNumberLayerId As Integer = GDB_ID.NULL
|
||||
Dim nAuxSolidsLayerId As Integer = GDB_ID.NULL
|
||||
Dim nMachStartLayerId As Integer = GDB_ID.NULL
|
||||
Dim nOthersLayerId As Integer = GDB_ID.NULL
|
||||
For Each ImportLayer In ImportPart.LayerList
|
||||
Select Case ImportLayer.Type
|
||||
Case ImportLayer.LayerType.PRINT_SOLID
|
||||
nPrintPartLayerId = EgtCreateGroup(nPartId)
|
||||
EgtSetName(nPrintPartLayerId, PRINT_SOLID)
|
||||
If ImportLayer.EntityList.Count > 0 Then
|
||||
PrintSolidEntity = ImportLayer.EntityList(0)
|
||||
EgtRelocateGlob(PrintSolidEntity.nId, nPrintPartLayerId, GDB_POS.LAST_SON)
|
||||
' calcolo box superficie per creazione riferimento
|
||||
EgtGetBBoxGlob(PrintSolidEntity.nId, GDB_BB.STANDARD, b3PrintSolid)
|
||||
End If
|
||||
'Case ImportLayer.LayerType.ORIGINAL_SOLID
|
||||
' nOriginalPartLayerId = EgtCreateGroup(nPartId)
|
||||
' EgtSetName(nOriginalPartLayerId, ORIGINAL_SOLID)
|
||||
' For Each GeomEntity In ImportLayer.EntityList
|
||||
' EgtRelocateGlob(GeomEntity.nId, nOriginalPartLayerId, GDB_POS.LAST_SON)
|
||||
' Next
|
||||
Case ImportLayer.LayerType.MACH_START
|
||||
nMachStartLayerId = EgtCreateGroup(nPartId)
|
||||
EgtSetName(nMachStartLayerId, LAY_MACH_START)
|
||||
Dim nMachStartId As Integer = GDB_ID.NULL
|
||||
If ImportLayer.EntityList.Count > 0 Then
|
||||
For Each GeomEntity In ImportLayer.EntityList
|
||||
' se punto o curva compo
|
||||
Dim EntityType As GDB_TY = EgtGetType(GeomEntity.nId)
|
||||
Select Case EntityType
|
||||
Case GDB_TY.GEO_POINT, GDB_TY.CRV_COMPO
|
||||
' gli cambio layer
|
||||
EgtRelocateGlob(GeomEntity.nId, nMachStartLayerId, GDB_POS.LAST_SON)
|
||||
nMachStartId = GeomEntity.nId
|
||||
Case GDB_TY.CRV_ARC, GDB_TY.CRV_BEZ, GDB_TY.CRV_LINE
|
||||
' altrimenti la trasformo in curva compo
|
||||
nMachStartId = EgtCreateCurveCompo(nMachStartLayerId, GeomEntity.nId, True)
|
||||
End Select
|
||||
EgtSetName(nMachStartId, START_GEOM)
|
||||
' coloro l'entita' di rosso
|
||||
Dim c3Red As Color3d
|
||||
c3Red.FromColor(System.Drawing.Color.Red)
|
||||
EgtSetColor(nMachStartId, c3Red)
|
||||
Next
|
||||
Else
|
||||
' creo punto di partenza
|
||||
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)
|
||||
EgtSetName(nMachStartId, START_GEOM)
|
||||
' coloro l'entita' di rosso
|
||||
Dim c3Red As Color3d
|
||||
c3Red.FromColor(System.Drawing.Color.Red)
|
||||
EgtSetColor(nMachStartId, c3Red)
|
||||
End If
|
||||
Case ImportLayer.LayerType.RIBS
|
||||
nRibsLayerId = EgtCreateGroup(nPartId)
|
||||
EgtSetName(nRibsLayerId, LAY_RIBS)
|
||||
For Each GeomEntity In ImportLayer.EntityList
|
||||
EgtSetInfo(GeomEntity.nId, KEY_RIB_TYPE, RibEntity.RibTypes.FROMIMPORT)
|
||||
EgtRelocateGlob(GeomEntity.nId, nRibsLayerId, GDB_POS.LAST_SON)
|
||||
' coloro l'entita' di viola
|
||||
Dim c3LightBlue As Color3d
|
||||
c3LightBlue.FromColor(System.Drawing.Color.MediumOrchid)
|
||||
EgtSetColor(GeomEntity.nId, c3LightBlue)
|
||||
Next
|
||||
Case ImportLayer.LayerType.SHELL_NUMBER
|
||||
nShellNumberLayerId = EgtCreateGroup(nPartId)
|
||||
EgtSetName(nShellNumberLayerId, LAY_SHELL_NBR)
|
||||
For Each GeomEntity In ImportLayer.EntityList
|
||||
EgtSetInfo(GeomEntity.nId, KEY_SHELLNBR_TYPE, ShellNumberEntity.ShellNumberTypes.FROMIMPORT)
|
||||
EgtRelocateGlob(GeomEntity.nId, nShellNumberLayerId, GDB_POS.LAST_SON)
|
||||
' coloro l'entita' di verde
|
||||
Dim c3LightBlue As Color3d
|
||||
c3LightBlue.FromColor(System.Drawing.Color.Lime)
|
||||
EgtSetColor(GeomEntity.nId, c3LightBlue)
|
||||
Next
|
||||
Case ImportLayer.LayerType.AUX_SOLIDS
|
||||
nAuxSolidsLayerId = EgtCreateGroup(nPartId)
|
||||
EgtSetName(nAuxSolidsLayerId, LAY_AUX_SOLIDS)
|
||||
For Each GeomEntity In ImportLayer.EntityList
|
||||
EgtSetInfo(GeomEntity.nId, KEY_AUXSOLID_TYPE, RibEntity.RibTypes.FROMIMPORT)
|
||||
EgtRelocateGlob(GeomEntity.nId, nAuxSolidsLayerId, GDB_POS.LAST_SON)
|
||||
' coloro l'entita' di oro
|
||||
Dim c3LightBlue As Color3d
|
||||
c3LightBlue.FromColor(System.Drawing.Color.DarkGoldenrod)
|
||||
EgtSetColor(GeomEntity.nId, c3LightBlue)
|
||||
Next
|
||||
Case ImportLayer.LayerType.OTHERS
|
||||
nOthersLayerId = EgtCreateGroup(nPartId)
|
||||
EgtSetName(nOthersLayerId, LAY_OTHERS)
|
||||
For Each GeomEntity In ImportLayer.EntityList
|
||||
EgtRelocateGlob(GeomEntity.nId, nOthersLayerId, GDB_POS.LAST_SON)
|
||||
Next
|
||||
If ImportPartIndex = 0 Then
|
||||
For Each GeomEntity In ImportedEntityList
|
||||
' se curva
|
||||
Dim EntityType As GDB_TY = EgtGetType(GeomEntity.nId)
|
||||
Select Case EntityType
|
||||
Case GDB_TY.CRV_ARC, GDB_TY.CRV_BEZ, GDB_TY.CRV_LINE
|
||||
' la trasformo in curva compo
|
||||
EgtCreateCurveCompo(nOthersLayerId, GeomEntity.nId, True)
|
||||
Case Else
|
||||
' altrimenti la sposto solamente
|
||||
EgtRelocateGlob(GeomEntity.nId, nOthersLayerId, GDB_POS.LAST_SON)
|
||||
End Select
|
||||
Next
|
||||
End If
|
||||
End Select
|
||||
Next
|
||||
' aggiungo riferimento
|
||||
Dim nReferenceLayerId As Integer = EgtCreateGroup(nPartId)
|
||||
EgtSetName(nReferenceLayerId, LAY_REFERENCE)
|
||||
' Creo riferimento
|
||||
Dim ptOrig As New Point3d(b3PrintSolid.Min())
|
||||
Select Case PrintSolidEntity.Reference
|
||||
Case ChooseReferenceWndVM.References.TL
|
||||
ptOrig += b3PrintSolid.DimY() * Vector3d.Y_AX
|
||||
Case ChooseReferenceWndVM.References.TR
|
||||
ptOrig += b3PrintSolid.DimY() * Vector3d.Y_AX + b3PrintSolid.DimX() * Vector3d.X_AX
|
||||
Case ChooseReferenceWndVM.References.BL
|
||||
Case ChooseReferenceWndVM.References.BR
|
||||
ptOrig += b3PrintSolid.DimX() * Vector3d.X_AX
|
||||
Case ChooseReferenceWndVM.References.TC
|
||||
ptOrig += b3PrintSolid.DimY() * Vector3d.Y_AX + b3PrintSolid.DimX() / 2 * Vector3d.X_AX
|
||||
Case ChooseReferenceWndVM.References.ML
|
||||
ptOrig += b3PrintSolid.DimY() / 2 * Vector3d.Y_AX
|
||||
Case ChooseReferenceWndVM.References.MR
|
||||
ptOrig += b3PrintSolid.DimY() / 2 * Vector3d.Y_AX + b3PrintSolid.DimX() * Vector3d.X_AX
|
||||
Case ChooseReferenceWndVM.References.TC
|
||||
ptOrig += b3PrintSolid.DimY() * Vector3d.Y_AX + b3PrintSolid.DimX() / 2 * Vector3d.X_AX
|
||||
Case ChooseReferenceWndVM.References.MR
|
||||
ptOrig += b3PrintSolid.DimY() / 2 * Vector3d.Y_AX + b3PrintSolid.DimX() * Vector3d.X_AX
|
||||
Case ChooseReferenceWndVM.References.BC
|
||||
ptOrig += b3PrintSolid.DimX() / 2 * Vector3d.X_AX
|
||||
Case ChooseReferenceWndVM.References.MC
|
||||
ptOrig += b3PrintSolid.DimY() / 2 * Vector3d.Y_AX + b3PrintSolid.DimX() / 2 * Vector3d.X_AX
|
||||
End Select
|
||||
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, PrintSolidEntity.Reference)
|
||||
' appoggio il pezzo sulla tavola
|
||||
EgtMove(nPartId, New Vector3d(0, 0, -b3PrintSolid.Min.z))
|
||||
' lo aggiungo a lista pezzi
|
||||
Dim sFilePath As String = ""
|
||||
EgtGetInfo(m_nImportedPartId, FILE_PATH, sFilePath)
|
||||
EgtSetInfo(nPartId, FILE_PATH, sFilePath)
|
||||
EgtSetInfo(nPartId, "PartOnTable", 1)
|
||||
Dim NewPart As New Print3dPartVM(nPartId, nPrintPartLayerId, PrintSolidEntity.nId, nOriginalPartLayerId, nReferenceLayerId, nFrameId, nMachStartLayerId, nRibsLayerId, nShellNumberLayerId, nAuxSolidsLayerId, nOthersLayerId, sFilePath)
|
||||
Map.refTopPanelVM.PartList.Add(NewPart)
|
||||
Next
|
||||
End If
|
||||
'EgtAddMachGroup("3dPrint")
|
||||
'EgtSetTable("Tab")
|
||||
|
||||
'Dim nRawId As Integer = EgtAddRawPart(b3PrintSolid.Min, b3PrintSolid.DimX, b3PrintSolid.DimY, b3PrintSolid.DimZ, New Color3d(128, 128, 128, 30))
|
||||
'EgtAddPartToRawPart(nPartId, b3PrintSolid.Min, nRawId)
|
||||
'EgtMoveToCornerRawPart(nRawId, New Point3d(dPosX, dPosY, 0), MCH_CR.BL)
|
||||
|
||||
'EgtResetCurrMachGroup()
|
||||
|
||||
' seleziono ultimo pezzo aggiunto
|
||||
Map.refTopPanelVM.SelLastPart()
|
||||
' elimino vecchio pezzo d'importazione
|
||||
EgtErase(m_nImportedPartId)
|
||||
|
||||
EgtDraw()
|
||||
' ripristino modalita' standard
|
||||
Map.refTopPanelVM.SelPage = Pages.MODIFY
|
||||
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()
|
||||
' elimino pezzo importato
|
||||
EgtErase(m_nImportedPartId)
|
||||
EgtDraw()
|
||||
' se ci sono pezzi
|
||||
If Map.refTopPanelVM.PartList.Count > 0 Then
|
||||
' ripristino modalita' standard
|
||||
Map.refTopPanelVM.SelPage = Pages.MODIFY
|
||||
Else
|
||||
Map.refTopPanelVM.SelPage = Pages.NULL
|
||||
End If
|
||||
End Sub
|
||||
|
||||
#End Region ' Cancel
|
||||
|
||||
#End Region ' COMMANDS
|
||||
|
||||
End Class
|
||||
@@ -1,231 +0,0 @@
|
||||
Imports System.Collections.ObjectModel
|
||||
Imports EgtUILib
|
||||
Imports EgtWPFLib5
|
||||
|
||||
Public Class GeomEntity
|
||||
Inherits VMBase
|
||||
|
||||
Private m_bIsSelected As Boolean
|
||||
Public Property bIsSelected As Boolean
|
||||
Get
|
||||
Return m_bIsSelected
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
m_bIsSelected = value
|
||||
' seleziono in scena
|
||||
EgtDeselectAll()
|
||||
If Not IsNothing(value) Then
|
||||
EgtSelectObj(m_nId)
|
||||
End If
|
||||
EgtDraw()
|
||||
' segno come elemento selezionato in treeview
|
||||
Map.refImportPanelVM.SetSelGeomEntity(Me)
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_nId As Integer = GDB_ID.NULL
|
||||
Public ReadOnly Property nId As Integer
|
||||
Get
|
||||
Return m_nId
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_sName As String
|
||||
Public ReadOnly Property sName As String
|
||||
Get
|
||||
Return m_sName
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property ghName As String
|
||||
Get
|
||||
Return m_nId & If(Not String.IsNullOrWhiteSpace(m_sName), " - " & m_sName, "")
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_Reference As ChooseReferenceWndVM.References = ChooseReferenceWndVM.References.BL
|
||||
Public Property Reference As ChooseReferenceWndVM.References
|
||||
Get
|
||||
Return m_Reference
|
||||
End Get
|
||||
Set(value As ChooseReferenceWndVM.References)
|
||||
m_Reference = value
|
||||
NotifyPropertyChanged(NameOf(ghReference))
|
||||
End Set
|
||||
End Property
|
||||
Public ReadOnly Property ghReference As String
|
||||
Get
|
||||
Select Case m_Reference
|
||||
Case ChooseReferenceWndVM.References.TL
|
||||
Return "┌"
|
||||
Case ChooseReferenceWndVM.References.TR
|
||||
Return "┐"
|
||||
Case ChooseReferenceWndVM.References.BL
|
||||
Return "└"
|
||||
Case ChooseReferenceWndVM.References.BR
|
||||
Return "┘"
|
||||
Case ChooseReferenceWndVM.References.TC
|
||||
Return "┬"
|
||||
Case ChooseReferenceWndVM.References.ML
|
||||
Return "├"
|
||||
Case ChooseReferenceWndVM.References.MR
|
||||
Return "┤"
|
||||
Case ChooseReferenceWndVM.References.BC
|
||||
Return "┴"
|
||||
Case ChooseReferenceWndVM.References.MC
|
||||
Return "┼"
|
||||
Case Else
|
||||
Return "X"
|
||||
End Select
|
||||
End Get
|
||||
End Property
|
||||
|
||||
' Definizione comandi
|
||||
Private m_cmdImportedEntity As ICommand
|
||||
|
||||
Sub New(nId As Integer, sName As String)
|
||||
m_nId = nId
|
||||
m_sName = sName
|
||||
End Sub
|
||||
|
||||
#Region "COMMANDS"
|
||||
|
||||
#Region "ImportedEntity"
|
||||
|
||||
Public ReadOnly Property ImportedEntity_DoubleClick As ICommand
|
||||
Get
|
||||
If m_cmdImportedEntity Is Nothing Then
|
||||
m_cmdImportedEntity = New Command(AddressOf ImportedEntity)
|
||||
End If
|
||||
Return m_cmdImportedEntity
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Sub ImportedEntity()
|
||||
If Not IsNothing(Map.refImportPanelVM.SelImportLayer) Then
|
||||
Map.refImportPanelVM.ImportedEntityList.Remove(Me)
|
||||
Map.refImportPanelVM.SelImportLayer.EntityList.Add(Me)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
#End Region ' ImportedEntity
|
||||
|
||||
#End Region ' COMMANDS
|
||||
End Class
|
||||
|
||||
Public Class ImportPart
|
||||
Inherits VMBase
|
||||
|
||||
Private m_bIsSelected As Boolean
|
||||
Public Property bIsSelected As Boolean
|
||||
Get
|
||||
Return m_bIsSelected
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
m_bIsSelected = value
|
||||
Map.refImportPanelVM.SetSelImportPart(Me)
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_nId As Integer
|
||||
Public ReadOnly Property nId As Integer
|
||||
Get
|
||||
Return m_nId
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_sName As String
|
||||
Public Property sName As String
|
||||
Get
|
||||
Return m_sName
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_sName = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property ghName As String
|
||||
Get
|
||||
Return If(Not String.IsNullOrWhiteSpace(m_sName), m_nId & " - " & m_sName, "Part" & m_nId)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_LayerList As New ObservableCollection(Of ImportLayer)
|
||||
Public ReadOnly Property LayerList As ObservableCollection(Of ImportLayer)
|
||||
Get
|
||||
Return m_LayerList
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Sub New()
|
||||
m_nId = If(Map.refImportPanelVM.ImportPartList.Count = 0, 1, Map.refImportPanelVM.ImportPartList.Max(Function(x) x.m_nId) + 1)
|
||||
m_LayerList.Add(New ImportLayer(ImportLayer.LayerType.PRINT_SOLID, "Print"))
|
||||
m_LayerList.Add(New ImportLayer(ImportLayer.LayerType.MACH_START, "Layer Start"))
|
||||
'm_LayerList.Add(New ImportLayer(ImportLayer.LayerType.ORIGINAL_SOLID, "Original Solid"))
|
||||
m_LayerList.Add(New ImportLayer(ImportLayer.LayerType.RIBS, "Ribs"))
|
||||
m_LayerList.Add(New ImportLayer(ImportLayer.LayerType.SHELL_NUMBER, "Reduce Shell Number"))
|
||||
m_LayerList.Add(New ImportLayer(ImportLayer.LayerType.AUX_SOLIDS, "Filled Solids"))
|
||||
m_LayerList.Add(New ImportLayer(ImportLayer.LayerType.OTHERS, "Others"))
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
|
||||
Public Class ImportLayer
|
||||
Inherits VMBase
|
||||
|
||||
Public Enum LayerType As Integer
|
||||
PRINT_SOLID = 1
|
||||
MACH_START = 2
|
||||
RIBS = 3
|
||||
SHELL_NUMBER = 4
|
||||
AUX_SOLIDS = 5
|
||||
OTHERS = 7
|
||||
End Enum
|
||||
|
||||
Private m_bIsSelected As Boolean
|
||||
Public Property bIsSelected As Boolean
|
||||
Get
|
||||
Return m_bIsSelected
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
m_bIsSelected = value
|
||||
Map.refImportPanelVM.SetSelImportLayer(Me)
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_Type As LayerType
|
||||
Public Property Type As LayerType
|
||||
Get
|
||||
Return m_Type
|
||||
End Get
|
||||
Set(value As LayerType)
|
||||
m_Type = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_sName As String
|
||||
Public Property sName As String
|
||||
Get
|
||||
Return m_sName
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_sName = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_EntityList As New ObservableCollection(Of GeomEntity)
|
||||
Public Property EntityList As ObservableCollection(Of GeomEntity)
|
||||
Get
|
||||
Return m_EntityList
|
||||
End Get
|
||||
Set(value As ObservableCollection(Of GeomEntity))
|
||||
m_EntityList = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Sub New(Type As LayerType, sName As String)
|
||||
m_Type = Type
|
||||
m_sName = sName
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
@@ -1,10 +0,0 @@
|
||||
<UserControl x:Class="ImportSceneHostV"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:EgtUILib="clr-namespace:EgtUILib;assembly=EgtUILib">
|
||||
|
||||
<WindowsFormsHost>
|
||||
<EgtUILib:Scene x:Name="MainScene"/>
|
||||
</WindowsFormsHost>
|
||||
|
||||
</UserControl>
|
||||
@@ -1,33 +0,0 @@
|
||||
Imports System.Windows.Interop
|
||||
Imports System.IO
|
||||
Imports EgtUILib
|
||||
Imports EgtWPFLib5
|
||||
|
||||
Public Class ImportSceneHostV
|
||||
|
||||
Private m_ImportSceneHostVM As ImportSceneHostVM
|
||||
|
||||
Sub New()
|
||||
' This call is required by the designer.
|
||||
InitializeComponent()
|
||||
' Assegno al riferimento locale al VM il VM preso dal DataContext
|
||||
Me.DataContext = New ImportSceneHostVM
|
||||
m_ImportSceneHostVM = DirectCast(Me.DataContext, ImportSceneHostVM)
|
||||
m_ImportSceneHostVM.SetMainScene(MainScene)
|
||||
End Sub
|
||||
|
||||
Private Sub MainScene_GotFocus() Handles MainScene.GotFocus
|
||||
m_ImportSceneHostVM.SetIsFocused(True)
|
||||
EgtOutLog("MainScene_GotFocus")
|
||||
' Map.refSecondaryWindowV.Topmost = True
|
||||
'Map.refSecondaryWindowVM.SetVisibility(True)
|
||||
End Sub
|
||||
|
||||
Private Sub MainScene_LostFocus() Handles MainScene.LostFocus
|
||||
m_ImportSceneHostVM.SetIsFocused(False)
|
||||
EgtOutLog("MainScene_LostFocus")
|
||||
' Map.refSecondaryWindowV.Topmost = False
|
||||
'Map.refSecondaryWindowVM.SetVisibility(False)
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
@@ -1,722 +0,0 @@
|
||||
Imports System.IO
|
||||
Imports EgtUILib
|
||||
Imports EgtWPFLib5
|
||||
Imports Microsoft.Win32
|
||||
|
||||
Public Class ImportSceneHostVM
|
||||
Inherits EgtWPFLib5.SceneHostVM
|
||||
|
||||
Friend m_bIsFocused As Boolean
|
||||
Friend Sub SetIsFocused(bValue As Boolean)
|
||||
m_bIsFocused = bValue
|
||||
End Sub
|
||||
|
||||
' Identificativi per pezzo da selezionare/deselezionare
|
||||
Private m_nIdToSel As Integer = GDB_ID.NULL
|
||||
Private m_nIdToDesel As Integer = GDB_ID.NULL
|
||||
' Dati movimento
|
||||
Private m_dMaxStep As Double = 0
|
||||
' Dati per Drag
|
||||
Private m_nRestRadius As Integer = 5
|
||||
Private m_bDrag As Boolean = False
|
||||
Private m_bDragToStart As Boolean = False
|
||||
Private m_bVerify As Boolean = False
|
||||
Private m_bFromParking As Boolean = False
|
||||
Private m_bDragging As Boolean = False
|
||||
Private m_locPrev As System.Drawing.Point
|
||||
Private m_ptPrev As Point3d
|
||||
Private m_vtTotMove As Vector3d
|
||||
Private m_dSnapDist As Double = 0
|
||||
|
||||
Private bReducedCut As Boolean = False
|
||||
Private m_bMagnetic As Boolean
|
||||
|
||||
' punto di snap per inizializzazione
|
||||
Private m_SnapType As SP
|
||||
Friend ReadOnly Property SnapType As SP
|
||||
Get
|
||||
Return m_SnapType
|
||||
End Get
|
||||
End Property
|
||||
|
||||
#Region "CONSTRUCTOR"
|
||||
|
||||
Sub New()
|
||||
MyBase.New()
|
||||
AddHandler MainController.OnNewProject, AddressOf OnNewProject
|
||||
AddHandler MainController.OnOpenProject, AddressOf OnOpenProject
|
||||
AddHandler MainController.OnSavingProject, AddressOf OnSavingProject
|
||||
AddHandler MainController.OnSavedProject, AddressOf OnSavedProject
|
||||
AddHandler MainController.OnInsertedProject, AddressOf OnInsertedProject
|
||||
AddHandler MainController.OnImportingProject, AddressOf OnImportingProject
|
||||
AddHandler MainController.OnImportedProject, AddressOf OnImportedProject
|
||||
AddHandler MainController.PrepareInputBox, AddressOf PrepareInputBox
|
||||
AddHandler MainController.SetInputBoxText, AddressOf SetInputBoxText
|
||||
AddHandler MainController.SetInputBoxCheck, AddressOf SetInputBoxCheck
|
||||
AddHandler MainController.AddInputBoxCombo, AddressOf AddInputBoxCombo
|
||||
AddHandler MainController.UpdateUI, AddressOf UpdateUI
|
||||
End Sub
|
||||
|
||||
#End Region ' CONSTRUCTOR
|
||||
|
||||
#Region "METHODS"
|
||||
|
||||
Overrides Sub InitScene()
|
||||
InitSceneEvents()
|
||||
' Inizializzazione Scena
|
||||
PreInitializeScene()
|
||||
' Se tutto bene
|
||||
If MainScene.Init() And Map.refMainWindowVM.MainWindowM.GetKeyOption(KEY_OPT._3DPRINT) Then
|
||||
PostInitializeScene()
|
||||
' Imposto stato gestione mouse diretto della scena a nessuno
|
||||
MainScene.SetStatusNull()
|
||||
EgtSetCurrentContext(MainScene.GetCtx())
|
||||
' inizializzo gestore lavorazioni
|
||||
EgtInitMachMgr(Map.refMainWindowVM.MainWindowM.sMachinesRoot, Map.refMainWindowVM.MainWindowM.sToolMakersDir)
|
||||
Return
|
||||
End If
|
||||
' Problemi
|
||||
' Se manca la chiave
|
||||
If Map.refMainWindowVM.MainWindowM.nKeyLevel = -1 Or Map.refMainWindowVM.MainWindowM.nKeyLevel = -2 Then
|
||||
EgtOutLog("Missing Dongle")
|
||||
' Box di avviso chiave mancante : "Chiave non presente. \n Inserirla e riavviare il programma." "Errore"
|
||||
Dim sText As String = EgtMsg(MSG_MISSINGKEYWD + 2) & vbCrLf & EgtMsg(MSG_MISSINGKEYWD + 3)
|
||||
Dim sTitle As String = EgtMsg(MSG_MISSINGKEYWD + 1)
|
||||
MessageBox.Show(sText, sTitle, MessageBoxButton.OK, MessageBoxImage.Error)
|
||||
' Altrimenti manca la licenza
|
||||
Else
|
||||
EgtOutLog("Problems with Licence")
|
||||
' Box di avviso licenza con problemi : "Programma senza licenza. \n Caricala e riavvia il programma." "Errore"
|
||||
Dim sText As String = EgtMsg(MSG_MISSINGKEYWD + 5) & vbCrLf & EgtMsg(MSG_MISSINGKEYWD + 6)
|
||||
Dim sTitle As String = EgtMsg(MSG_MISSINGKEYWD + 1)
|
||||
If MessageBox.Show(sText, sTitle, MessageBoxButton.OKCancel, MessageBoxImage.Error) = MessageBoxResult.OK Then
|
||||
' Apro dialogo per richiesta file licenza
|
||||
Dim LicDlg As New Microsoft.Win32.OpenFileDialog() With {
|
||||
.DefaultExt = ".lic",
|
||||
.Filter = "Licences (.lic)|*.lic",
|
||||
.CheckFileExists = True,
|
||||
.ValidateNames = True
|
||||
}
|
||||
If LicDlg.ShowDialog() = True Then
|
||||
' Recupero il direttorio del file
|
||||
Dim sDir As String = Path.GetDirectoryName(LicDlg.FileName)
|
||||
' Se il file non è già nel direttorio di configurazione lo copio
|
||||
If Not String.Equals(Path.GetFullPath(sDir), Path.GetFullPath(Map.refMainWindowVM.MainWindowM.sConfigDir), StringComparison.OrdinalIgnoreCase) Then
|
||||
Try
|
||||
File.Copy(LicDlg.FileName, Path.Combine(Map.refMainWindowVM.MainWindowM.sConfigDir, LicDlg.SafeFileName), True)
|
||||
Catch ex As Exception
|
||||
End Try
|
||||
End If
|
||||
' Imposto il nuovo file di licenza nell'Ini
|
||||
WriteMainPrivateProfileString(S_GENERAL, K_LICENCE, LicDlg.SafeFileName)
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
' Chiudo il programma
|
||||
End
|
||||
End Sub
|
||||
|
||||
Public Overrides Sub InitSceneEvents()
|
||||
AddHandler MainScene.OnCursorPos, AddressOf OnCursorPos
|
||||
AddHandler MainScene.OnMouseSetObjFilterForSelect, AddressOf OnMouseSetObjFilterForSelect
|
||||
AddHandler MainScene.OnMouseSelectedAll, AddressOf OnMouseSelectedAll
|
||||
AddHandler MainScene.OnMouseDeselectedAll, AddressOf OnMouseDeselectedAll
|
||||
AddHandler MainScene.OnMouseDownScene, AddressOf OnMouseDownScene
|
||||
AddHandler MainScene.OnMouseMoveScene, AddressOf OnMouseMoveScene
|
||||
AddHandler MainScene.OnMouseUpScene, AddressOf OnMouseUpScene
|
||||
AddHandler MainScene.OnMouseSelectedObj, AddressOf OnMouseSelectedObj
|
||||
AddHandler MainScene.OnMouseSelectedPart, AddressOf OnMouseSelectedPart
|
||||
AddHandler MainScene.OnMouseSelectedLayer, AddressOf OnMouseSelectedLayer
|
||||
AddHandler MainScene.OnMouseSelectedPath, AddressOf OnMouseSelectedPath
|
||||
AddHandler MainScene.OnMousePointFromSelection, AddressOf OnMousePointFromSelection
|
||||
AddHandler MainScene.OnMouseDone, AddressOf OnMouseDone
|
||||
AddHandler MainScene.OnMouseSelectedPoint, AddressOf OnMouseSelectedPoint
|
||||
AddHandler MainScene.OnMouseSelectedDir, AddressOf OnMouseSelectedDir
|
||||
AddHandler MainScene.OnMouseMoveSelPoint, AddressOf OnMouseMoveSelPoint
|
||||
AddHandler MainScene.OnShowDistance, AddressOf OnShowDistance
|
||||
AddHandler MainScene.KeyDown, AddressOf OnKeyDown
|
||||
AddHandler MainScene.OnCloseGetDist, AddressOf OnCloseGetDist
|
||||
AddHandler MainScene.OnChangedSnapPointType, AddressOf OnChangedSnapPointType
|
||||
End Sub
|
||||
|
||||
Private Sub PreInitializeScene()
|
||||
' imposto colore di default
|
||||
Dim DefColor As New Color3d(0, 0, 0)
|
||||
GetMainPrivateProfileColor(S_GEOMDB, K_DEFAULTCOLOR, DefColor)
|
||||
MainScene.SetDefaultMaterial(DefColor)
|
||||
' imposto colori sfondo
|
||||
Dim BackTopColor As New Color3d(192, 192, 192)
|
||||
GetMainPrivateProfileColor(S_SCENE, K_BACKTOP, BackTopColor)
|
||||
Dim BackBotColor As New Color3d(BackTopColor)
|
||||
GetMainPrivateProfileColor(S_SCENE, K_BACKBOTTOM, BackBotColor)
|
||||
MainScene.SetViewBackground(BackTopColor, BackBotColor)
|
||||
' imposto spessore linee
|
||||
Dim nLineWidth As Integer = 1
|
||||
nLineWidth = GetMainPrivateProfileInt(S_SCENE, K_LINEWIDTH, nLineWidth)
|
||||
MainScene.SetLineWidth(nLineWidth)
|
||||
' imposto colore di evidenziazione
|
||||
Dim MarkColor As New Color3d(255, 255, 0)
|
||||
GetMainPrivateProfileColor(S_SCENE, K_MARK, MarkColor)
|
||||
MainScene.SetMarkMaterial(MarkColor)
|
||||
' imposto colore per superfici selezionate
|
||||
Dim SelSurfColor As New Color3d(255, 255, 192)
|
||||
GetMainPrivateProfileColor(S_SCENE, K_SELSURF, SelSurfColor)
|
||||
MainScene.SetSelSurfMaterial(SelSurfColor)
|
||||
' imposto tipo e colore del rettangolo di zoom
|
||||
Dim bOutline As Boolean = True
|
||||
Dim ZwColor As New Color3d(0, 0, 0)
|
||||
GetMainPrivateProfileZoomWin(S_SCENE, K_ZOOMWIN, bOutline, ZwColor)
|
||||
MainScene.SetZoomWinAttribs(bOutline, ZwColor)
|
||||
' imposto colore della linea di distanza
|
||||
Dim DstLnColor As New Color3d(255, 0, 0)
|
||||
GetMainPrivateProfileColor(S_SCENE, K_DISTLINE, DstLnColor)
|
||||
MainScene.SetDistLineMaterial(DstLnColor)
|
||||
' imposto parametri OpenGL
|
||||
Dim nDriver As Integer = GetMainPrivateProfileInt(S_OPENGL, K_DRIVER, 3)
|
||||
Dim b2Buff As Boolean = (GetMainPrivateProfileInt(S_OPENGL, K_DOUBLEBUFFER, 1) <> 0)
|
||||
Dim nColorBits As Integer = GetMainPrivateProfileInt(S_OPENGL, K_COLORBITS, 32)
|
||||
Dim nDepthBits As Integer = GetMainPrivateProfileInt(S_OPENGL, K_DEPTHBITS, 32)
|
||||
MainScene.SetViewAttributes(nDriver, b2Buff, nColorBits, nDepthBits)
|
||||
End Sub
|
||||
|
||||
Private Sub PostInitializeScene()
|
||||
' Impostazioni Controller
|
||||
MainController.SetScene(MainScene)
|
||||
MainController.SetSurfTmTolerance(0.05)
|
||||
MainController.SetUseCustomColors(True, S_SCENE, K_CUSTOMCOLORS)
|
||||
' imposto unità di misura per interfaccia utente
|
||||
Dim nMeasureUnit As Integer = GetMainPrivateProfileInt(S_SCENE, K_MMUNITS, 1)
|
||||
EgtSetUiUnits(nMeasureUnit <> 0)
|
||||
'Map.refMyStatusBarVM.SetMeasureUnit(nMeasureUnit <> 0)
|
||||
' imposto visualizzazione riferimento globale
|
||||
EgtSetGlobFrameShow(True)
|
||||
' imposto i dati della griglia
|
||||
'LoadGridData()
|
||||
EgtSetGridFrame(Frame3d.GLOB)
|
||||
EgtSetGridGeo(10, 10, 100, 484)
|
||||
EgtSetGridColor(New Color3d(160, 160, 160), New Color3d(160, 160, 160))
|
||||
EgtSetGridShow(True, False)
|
||||
' imposto tipo coordinate
|
||||
MainScene.SetGridCursorPos(True)
|
||||
' modo di visualizzazione
|
||||
Dim nShowMode As Integer = GetMainPrivateProfileInt(S_SCENE, K_SHOWMODE, SM.SHADING)
|
||||
'''Map.refShowPanelVM.SetShowMode(DirectCast(nShowMode, SM))
|
||||
' visualizzazione avanzata dei triangoli costituenti le superfici
|
||||
Dim bShowTriaAdv As Boolean = (GetMainPrivateProfileInt(S_SCENE, K_SHOWTRIAADV, 1) <> 0)
|
||||
EgtSetShowTriaAdv(bShowTriaAdv)
|
||||
' tipo visualizzazione per Zmap
|
||||
Dim nShowZmap As Integer = GetMainPrivateProfileInt(S_SCENE, K_SHOWZMAP, 1)
|
||||
EgtSetShowZmap(DirectCast(nShowZmap, ZSM), False)
|
||||
' dimensione lineare max in pixel delle textures
|
||||
Dim nTxrMaxLinPix As Integer = GetMainPrivateProfileInt(S_SCENE, K_TEXMAXLINPIX, 4096)
|
||||
EgtSetTextureMaxLinPixels(nTxrMaxLinPix)
|
||||
' tipo snap point
|
||||
MainScene.SetSnapPointType(SP.PT_SKETCH)
|
||||
' visualizzazione assemblato
|
||||
Dim nShowBuilding As Boolean = GetMainPrivateProfileInt(S_SCENE, K_SHOWBUILDING, 0) <> 0
|
||||
'''Map.refShowBeamPanelVM.SetShowBuilding(nShowBuilding)
|
||||
' nascondo input box
|
||||
'''Map.refFreeContourInputVM.ResetInputBox()
|
||||
End Sub
|
||||
|
||||
#End Region ' METHODS
|
||||
|
||||
#Region "ProjectManager"
|
||||
|
||||
Public Overrides Sub NewProject()
|
||||
EgtSetCurrentContext(MainScene.GetCtx())
|
||||
Dim bOk As Boolean = MainController.NewProject()
|
||||
MainScene.SetStatusNull()
|
||||
End Sub
|
||||
|
||||
Public Overrides Sub OpenProject(sFilePath As String)
|
||||
EgtSetCurrentContext(MainScene.GetCtx())
|
||||
Dim bOk As Boolean = False
|
||||
If String.IsNullOrEmpty(sFilePath) Then
|
||||
' Recupero cartella dell'ultimo progetto aperto
|
||||
Dim sDir As String = MainController.GetCurrFile()
|
||||
If String.IsNullOrWhiteSpace(sDir) Then
|
||||
GetMainPrivateProfileString(S_MRUFILES, K_FILE, "", sDir)
|
||||
End If
|
||||
If Not String.IsNullOrWhiteSpace(sDir) Then
|
||||
sDir = Path.GetDirectoryName(sDir)
|
||||
End If
|
||||
bOk = MainController.OpenProject(sDir)
|
||||
Else
|
||||
bOk = MainController.OpenProject(sFilePath, False)
|
||||
End If
|
||||
MainScene.SetStatusNull()
|
||||
End Sub
|
||||
|
||||
Public Overrides Sub SaveProject()
|
||||
MyBase.SaveProject()
|
||||
' Imposto stato gestione mouse diretto della scena a nessuno
|
||||
MainScene.SetStatusNull()
|
||||
End Sub
|
||||
|
||||
Public Overrides Sub SaveAsProject()
|
||||
MyBase.SaveAsProject()
|
||||
' Imposto stato gestione mouse diretto della scena a nessuno
|
||||
MainScene.SetStatusNull()
|
||||
End Sub
|
||||
|
||||
Public Overrides Sub InsertProject()
|
||||
' eseguo
|
||||
Dim sDir As String = String.Empty
|
||||
GetMainPrivateProfileString(S_MRUIMPORT, K_FILE & "1", "", sDir)
|
||||
Dim OpenFileDialog As New OpenFileDialog With {.Title = "Insert",
|
||||
.Filter = "Stereolithography (*.stl)|*.stl" &
|
||||
"|New geometry EgalTech(*.nge)|*.nge" &
|
||||
"|All Files (*.*)|*.*",
|
||||
.FilterIndex = 1,
|
||||
.InitialDirectory = sDir}
|
||||
If Not OpenFileDialog.ShowDialog Then
|
||||
Return
|
||||
End If
|
||||
Dim sFile As String = String.Empty
|
||||
sFile = OpenFileDialog.FileName
|
||||
Dim ChooseReferenceWndVM As New ChooseReferenceWndVM
|
||||
Dim ChooseReferenceWndV As New ChooseReferenceWndV(Application.Current.MainWindow, ChooseReferenceWndVM)
|
||||
If Not ChooseReferenceWndV.ShowDialog() Then Return
|
||||
|
||||
Dim nImportContext As Integer = EgtInitContext()
|
||||
MainController.InsertProject(sFile, False)
|
||||
End Sub
|
||||
|
||||
Public Overrides Sub ImportProject()
|
||||
Dim sDir As String = String.Empty
|
||||
GetMainPrivateProfileString(S_MRUIMPORT, K_FILE & "1", "", sDir)
|
||||
If Not String.IsNullOrWhiteSpace(sDir) Then
|
||||
sDir = Path.GetDirectoryName(sDir)
|
||||
End If
|
||||
sDir.TrimEnd("\"c)
|
||||
MainController.ImportProject(sDir)
|
||||
' Imposto stato gestione mouse diretto della scena a nessuno
|
||||
MainScene.SetStatusNull()
|
||||
End Sub
|
||||
|
||||
Friend Sub PreExecScript(bScriptInMru As Boolean)
|
||||
'm_bScriptInMru = bScriptInMru
|
||||
End Sub
|
||||
|
||||
Friend Sub ExecScript(sFilePath As String)
|
||||
If String.IsNullOrEmpty(sFilePath) Then
|
||||
Dim sDir As String = String.Empty
|
||||
'GetMainPrivateProfileString(S_GENERAL, K_LASTLUADIR, "", sDir)
|
||||
MainController.Exec(sDir)
|
||||
Else
|
||||
MainController.Exec(sFilePath, False)
|
||||
End If
|
||||
Dim bMachiningMode As Boolean = EgtGetCurrMachGroup() <> GDB_ID.NULL
|
||||
If Not bMachiningMode And EgtGetCurrLayer() = GDB_ID.NULL Then
|
||||
Dim nCurrPart As Integer = EgtGetCurrPart()
|
||||
If nCurrPart = GDB_ID.NULL Or Not EgtSetCurrPartLayer(nCurrPart, EgtGetFirstLayer(nCurrPart, True)) Then
|
||||
EgtResetCurrPartLayer()
|
||||
End If
|
||||
End If
|
||||
End Sub
|
||||
|
||||
#End Region ' ProjectManager
|
||||
|
||||
#Region "SCENE EVENTS"
|
||||
|
||||
Private Sub OnCursorPos(ByVal sender As Object, ByVal sCursorPos As String)
|
||||
Map.refMyStatusBarVM.SetCurrPos(sCursorPos)
|
||||
End Sub
|
||||
|
||||
Private Sub OnMouseSetObjFilterForSelect(sender As Object, bZeroDim As Boolean, bCurve As Boolean,
|
||||
bSurf As Boolean, bVolume As Boolean, bExtra As Boolean)
|
||||
End Sub
|
||||
|
||||
Private Sub OnMouseSelectedAll(ByVal sender As Object, bOnlyVisble As Boolean)
|
||||
End Sub
|
||||
|
||||
Private Sub OnMouseDeselectedAll(ByVal sender As Object)
|
||||
End Sub
|
||||
|
||||
Private Sub OnMouseDownScene(sender As Object, e As Forms.MouseEventArgs)
|
||||
If e.Button = Forms.MouseButtons.Middle Then Return
|
||||
If Map.refInstrumentPanelVM.GetDistIsChecked Then Return
|
||||
Basic_OnMouseDownScene(sender, e)
|
||||
'Select Case Map.refMainMenuVM.SelPage
|
||||
' Case Pages.VIEW
|
||||
' If Not IsNothing(Map.refProjectVM.BTLStructureVM) Then
|
||||
' If Map.refFreeContourManagerVM.bIsActive Then Return
|
||||
' If Map.refShowBeamPanelVM.bShowAll Then
|
||||
' View_Part_OnMouseDownScene(sender, e)
|
||||
' Else
|
||||
' View_Feature_OnMouseDownScene(sender, e)
|
||||
' End If
|
||||
' End If
|
||||
' Case Pages.MACHINING
|
||||
' If Not IsNothing(Map.refMachGroupPanelVM) AndAlso Not IsNothing(Map.refMachGroupPanelVM.SelectedMachGroup) Then
|
||||
' Dim SelectedMachGroup As MyMachGroupVM = Map.refMachGroupPanelVM.SelectedMachGroup
|
||||
' If EgtGetCurrMachGroup() = GDB_ID.NULL Then Return
|
||||
' If SelectedMachGroup.nType = BWType.BEAM Then
|
||||
' Beam_OnMouseDownScene(sender, e)
|
||||
' ElseIf SelectedMachGroup.nType = BWType.WALL Then
|
||||
' Wall_OnMouseDownScene(sender, e)
|
||||
' End If
|
||||
' End If
|
||||
'End Select
|
||||
End Sub
|
||||
|
||||
Private Sub OnMouseMoveScene(sender As Object, e As Forms.MouseEventArgs)
|
||||
If e.Button = Forms.MouseButtons.Middle Then Return
|
||||
If Map.refInstrumentPanelVM.GetDistIsChecked Then Return
|
||||
Basic_OnMouseMoveScene(sender, e)
|
||||
'Select Case Map.refMainMenuVM.SelPage
|
||||
' Case Pages.VIEW
|
||||
' If Not IsNothing(Map.refProjectVM.BTLStructureVM) Then
|
||||
' If Map.refFreeContourManagerVM.bIsActive Then Return
|
||||
' If Map.refShowBeamPanelVM.bShowAll Then
|
||||
' View_Part_OnMouseMoveScene(sender, e)
|
||||
' Else
|
||||
' View_Feature_OnMouseMoveScene(sender, e)
|
||||
' End If
|
||||
' End If
|
||||
' Case Pages.MACHINING
|
||||
' If Not IsNothing(Map.refMachGroupPanelVM) AndAlso Not IsNothing(Map.refMachGroupPanelVM.SelectedMachGroup) Then
|
||||
' Dim SelectedMachGroup As MyMachGroupVM = Map.refMachGroupPanelVM.SelectedMachGroup
|
||||
' If EgtGetCurrMachGroup() = GDB_ID.NULL Then Return
|
||||
' If SelectedMachGroup.nType = BWType.BEAM Then
|
||||
' Beam_OnMouseMoveScene(sender, e)
|
||||
' ElseIf SelectedMachGroup.nType = BWType.WALL Then
|
||||
' Wall_OnMouseMoveScene(sender, e)
|
||||
' End If
|
||||
' End If
|
||||
'End Select
|
||||
End Sub
|
||||
|
||||
Private Sub OnMouseUpScene(sender As Object, e As Forms.MouseEventArgs)
|
||||
If e.Button = Forms.MouseButtons.Middle Then Return
|
||||
If Map.refInstrumentPanelVM.GetDistIsChecked Then Return
|
||||
Basic_OnMouseUpScene(sender, e)
|
||||
'Select Case Map.refMainMenuVM.SelPage
|
||||
' Case Pages.VIEW
|
||||
' If Not IsNothing(Map.refProjectVM.BTLStructureVM) Then
|
||||
' If Map.refFreeContourManagerVM.bIsActive Then Return
|
||||
' If Map.refShowBeamPanelVM.bShowAll Then
|
||||
' View_Part_OnMouseUpScene(sender, e)
|
||||
' Else
|
||||
' View_Feature_OnMouseUpScene(sender, e)
|
||||
' End If
|
||||
' End If
|
||||
' Case Pages.MACHINING
|
||||
' If Not IsNothing(Map.refMachGroupPanelVM) AndAlso Not IsNothing(Map.refMachGroupPanelVM.SelectedMachGroup) Then
|
||||
' Dim SelectedMachGroup As MyMachGroupVM = Map.refMachGroupPanelVM.SelectedMachGroup
|
||||
' If EgtGetCurrMachGroup() = GDB_ID.NULL Then Return
|
||||
' If SelectedMachGroup.nType = BWType.BEAM Then
|
||||
' Beam_OnMouseUpScene(sender, e)
|
||||
' ElseIf SelectedMachGroup.nType = BWType.WALL Then
|
||||
' Wall_OnMouseUpScene(sender, e)
|
||||
' End If
|
||||
' End If
|
||||
'End Select
|
||||
End Sub
|
||||
|
||||
Private Sub OnMouseSelectedObj(ByVal sender As Object, ByVal nId As Integer, ByVal bLast As Boolean)
|
||||
'' Se in modalità edit L250
|
||||
'If Map.refMainMenuVM.SelPage = Pages.VIEW AndAlso Not IsNothing(Map.refProjectVM.BTLStructureVM) AndAlso Map.refFreeContourManagerVM.bIsActive Then
|
||||
' ' se sto editando testo angoli
|
||||
' If Map.refFreeContourManagerVM.bIsModifyingTextAngle Then
|
||||
' ' passo testo selezionato
|
||||
' Map.refFreeContourManagerVM.TextAngleSelected(nId)
|
||||
' End If
|
||||
' MainController.MouseSelectedObj(nId, bLast)
|
||||
'End If
|
||||
End Sub
|
||||
|
||||
Private Sub OnMouseSelectedPart(ByVal sender As Object, ByVal nId As Integer)
|
||||
'' Se in modalità edit L250
|
||||
'If Map.refMainMenuVM.SelPage = Pages.VIEW AndAlso Not IsNothing(Map.refProjectVM.BTLStructureVM) AndAlso Map.refFreeContourManagerVM.bIsActive Then
|
||||
' MainController.MouseSelectedPart(nId)
|
||||
'End If
|
||||
End Sub
|
||||
|
||||
Private Sub OnMouseSelectedLayer(ByVal sender As Object, ByVal nId As Integer)
|
||||
'' Se in modalità edit L250
|
||||
'If Map.refMainMenuVM.SelPage = Pages.VIEW AndAlso Not IsNothing(Map.refProjectVM.BTLStructureVM) AndAlso Map.refFreeContourManagerVM.bIsActive Then
|
||||
' MainController.MouseSelectedLayer(nId)
|
||||
'End If
|
||||
End Sub
|
||||
|
||||
Private Sub OnMouseSelectedPath(ByVal sender As Object, ByVal nId As Integer, ByVal bHaltOnFork As Boolean)
|
||||
'' Se in modalità edit L250
|
||||
'If Map.refMainMenuVM.SelPage = Pages.VIEW AndAlso Not IsNothing(Map.refProjectVM.BTLStructureVM) AndAlso Map.refFreeContourManagerVM.bIsActive Then
|
||||
' MainController.MouseSelectedPath(nId, bHaltOnFork)
|
||||
'End If
|
||||
End Sub
|
||||
|
||||
Private Sub OnMousePointFromSelection(ByVal sender As Object, ByVal nId As Integer, ByVal PtP As Point3d, ByVal nAux As Integer)
|
||||
'' Se in modalità edit L250
|
||||
'If Map.refMainMenuVM.SelPage = Pages.VIEW AndAlso Not IsNothing(Map.refProjectVM.BTLStructureVM) AndAlso Map.refFreeContourManagerVM.bIsActive Then
|
||||
' MainController.SetPointFromSelection(nId, PtP, nAux)
|
||||
'End If
|
||||
End Sub
|
||||
|
||||
Private Sub OnMouseDone(ByVal sender As Object)
|
||||
'' Se in modalità edit L250
|
||||
'If Map.refMainMenuVM.SelPage = Pages.VIEW AndAlso Not IsNothing(Map.refProjectVM.BTLStructureVM) AndAlso Map.refFreeContourManagerVM.bIsActive Then
|
||||
' MainController.Done(Map.refFreeContourInputVM.Text)
|
||||
'End If
|
||||
End Sub
|
||||
|
||||
Private Sub OnMouseSelectedPoint(ByVal sender As Object, ByVal PtP As Point3d, ByVal nSep As SEP, ByVal nId As Integer)
|
||||
'' Se in modalità edit L250
|
||||
'If Map.refMainMenuVM.SelPage = Pages.VIEW AndAlso Not IsNothing(Map.refProjectVM.BTLStructureVM) AndAlso Map.refFreeContourManagerVM.bIsActive Then
|
||||
' Dim bDone As Boolean = (Keyboard.Modifiers And ModifierKeys.Control) <> ModifierKeys.Control
|
||||
' MainController.MouseSelectedPoint(PtP, nSep, nId, bDone)
|
||||
'End If
|
||||
End Sub
|
||||
|
||||
Private Sub OnMouseSelectedDir(ByVal sender As Object, ByVal VtDir As Vector3d)
|
||||
'' Se in modalità edit L250
|
||||
'If Map.refMainMenuVM.SelPage = Pages.VIEW AndAlso Not IsNothing(Map.refProjectVM.BTLStructureVM) AndAlso Map.refFreeContourManagerVM.bIsActive Then
|
||||
' MainController.SetLastVector3d(VtDir)
|
||||
'End If
|
||||
End Sub
|
||||
|
||||
Private Sub OnMouseMoveSelPoint(ByVal sender As Object, ByVal PtP As Point3d)
|
||||
'' Se in modalità edit L250
|
||||
'If Map.refMainMenuVM.SelPage = Pages.VIEW AndAlso Not IsNothing(Map.refProjectVM.BTLStructureVM) AndAlso Map.refFreeContourManagerVM.bIsActive Then
|
||||
' MainController.MouseMoveInSelectionPoint(PtP)
|
||||
'End If
|
||||
End Sub
|
||||
|
||||
Private Sub OnShowDistance(ByVal sender As Object, ByVal sDistance As String)
|
||||
Map.refMyStatusBarVM.SetOutputMessage(sDistance)
|
||||
End Sub
|
||||
|
||||
Private Sub OnKeyDown(ByVal sender As System.Object, ByVal e As System.Windows.Forms.KeyEventArgs)
|
||||
'' Se in modalità edit L250
|
||||
'If Map.refMainMenuVM.SelPage = Pages.VIEW AndAlso Not IsNothing(Map.refProjectVM.BTLStructureVM) AndAlso Map.refFreeContourManagerVM.bIsActive Then
|
||||
' ' Con DEL eseguo cancellazione delle entità selezionate
|
||||
' If e.KeyData = System.Windows.Forms.Keys.Delete Then
|
||||
' MainController.SetLastInteger(GDB_ID.SEL)
|
||||
' MainController.ExecuteCommand(Controller.CMD.DELETE)
|
||||
' ' Con SPAZIO ripeto l'ultimo comando
|
||||
' ElseIf e.KeyData = System.Windows.Forms.Keys.Space Then
|
||||
' MainController.RepeatLastCommand()
|
||||
' ' Con 'A' e in modalità continuazione, forzo il passaggio ad arco
|
||||
' ElseIf e.KeyData = System.Windows.Forms.Keys.A And MainController.GetContinue() Then
|
||||
' MainController.ContinueArcPDP()
|
||||
' ' Con 'L' e in modalità continuazione, forzo il passaggio a retta
|
||||
' ElseIf e.KeyData = System.Windows.Forms.Keys.L And MainController.GetContinue() Then
|
||||
' MainController.ContinueLine2P()
|
||||
' ' Con 'V' cambio lo stato del check
|
||||
' ElseIf e.KeyData = System.Windows.Forms.Keys.V Then
|
||||
' Map.refFreeContourInputVM.ChangeInputBoxCheck()
|
||||
' End If
|
||||
'End If
|
||||
End Sub
|
||||
|
||||
Private Sub OnCloseGetDist(sender As System.Object)
|
||||
Map.refInstrumentPanelVM.SetGetDistance_IsChecked(False)
|
||||
End Sub
|
||||
|
||||
Friend Sub OnChangedSnapPointType(ByVal sender As Object, ByVal nSpType As SP, ByVal bUser As Boolean)
|
||||
m_SnapType = nSpType
|
||||
If Not IsNothing(Map.refMyStatusBarVM) Then Map.refMyStatusBarVM.SetSnapPointType(nSpType)
|
||||
End Sub
|
||||
|
||||
#End Region ' SCENE EVENTS
|
||||
|
||||
#Region "CONTROLLER EVENTS"
|
||||
|
||||
Private Sub OnNewProject(sender As Object, bOk As Boolean)
|
||||
CurrentMachine.CreateMachineTable()
|
||||
If Not bOk Then
|
||||
MessageBox.Show(Application.Current.MainWindow, EgtMsg(10002), EgtMsg(10001), MessageBoxButton.OK, MessageBoxImage.Error) ' Error on new file - Error
|
||||
End If
|
||||
EgtZoom(ZM.ALL)
|
||||
MainScene.SetStatusNull()
|
||||
End Sub
|
||||
|
||||
Private Sub OnOpenProject(sender As Object, sFile As String, bOk As Boolean)
|
||||
EgtZoom(ZM.ALL)
|
||||
WriteMainPrivateProfileString(S_GENERAL, K_LASTNGEDIR, Path.GetDirectoryName(sFile))
|
||||
If bOk Then
|
||||
Map.refProjManagerVM.MruFiles.Add(sFile)
|
||||
Else
|
||||
Map.refProjManagerVM.MruFiles.Remove(sFile)
|
||||
Dim sMsg As String
|
||||
If My.Computer.FileSystem.FileExists(sFile) Then
|
||||
sMsg = EgtMsg(10003) & " '" & sFile & "'" 'Error opening file
|
||||
Else
|
||||
sMsg = EgtMsg(10009) & " '" & sFile & "'" 'Missing file
|
||||
End If
|
||||
MessageBox.Show(Application.Current.MainWindow, sMsg, EgtMsg(10001), MessageBoxButton.OK, MessageBoxImage.Error) 'Error
|
||||
End If
|
||||
MainScene.SetStatusNull()
|
||||
End Sub
|
||||
|
||||
Private Sub OnSavingProject(ByVal sender As Object, sFile As String)
|
||||
End Sub
|
||||
|
||||
Private Sub OnSavedProject(ByVal sender As Object, ByVal sFile As String, ByVal bOk As Boolean)
|
||||
WriteMainPrivateProfileString(S_GENERAL, K_LASTNGEDIR, Path.GetDirectoryName(sFile))
|
||||
If bOk Then
|
||||
Map.refProjManagerVM.MruFiles.Add(sFile)
|
||||
Else
|
||||
Map.refProjManagerVM.MruFiles.Remove(sFile)
|
||||
Dim sMsg As String = EgtMsg(10004) & " '" & sFile & "'" 'Error saving file
|
||||
MessageBox.Show(Application.Current.MainWindow, sMsg, EgtMsg(10001), MessageBoxButton.OK, MessageBoxImage.Error) ' Error
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub OnInsertedProject(ByVal sender As Object, ByVal sFile As String, ByVal bOk As Boolean)
|
||||
' Segnalo eventuale errore
|
||||
If Not bOk Then
|
||||
Dim sMsg As String = EgtMsg(10006) & " '" & sFile & "'" 'Error importing file
|
||||
MessageBox.Show(Application.Current.MainWindow, sMsg, EgtMsg(10001), MessageBoxButton.OK, MessageBoxImage.Error) ' Error
|
||||
Else
|
||||
' lo aggiungo alla lista pezzi
|
||||
Map.refProjectVM.AddNewPart(sFile)
|
||||
End If
|
||||
EgtDraw()
|
||||
MainScene.SetStatusNull()
|
||||
End Sub
|
||||
|
||||
Private Sub OnImportingProject(sender As Object, nType As Integer, ByRef nFlag As Integer)
|
||||
If nType <> FT.NULL Then
|
||||
If nType = FT.CNC Then
|
||||
nFlag = GetMainPrivateProfileInt(S_IMPORT, K_CNCFLAG, EIC_FL.NONE)
|
||||
Else
|
||||
nFlag = 0
|
||||
End If
|
||||
' Abilito progress e bottone stop
|
||||
Map.refMyStatusBarVM.StartLoading("", True)
|
||||
Else
|
||||
MessageBox.Show(Application.Current.MainWindow, EgtMsg(10005), EgtMsg(10001), MessageBoxButton.OK, MessageBoxImage.Error) ' File type unknown - Error
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub OnImportedProject(ByVal sender As Object, ByVal sFile As String, ByVal bOk As Boolean)
|
||||
EgtZoom(ZM.ALL)
|
||||
' Disabilito progress e bottone stop
|
||||
Map.refMyStatusBarVM.EndLoading("")
|
||||
' Salvo path
|
||||
WriteMainPrivateProfileString(S_GENERAL, K_LASTIMPDIR, Path.GetDirectoryName(sFile))
|
||||
' Segnalo eventuale errore
|
||||
If Not bOk Then
|
||||
Dim sMsg As String = EgtMsg(10006) & " '" & sFile & "'" 'Error importing file
|
||||
MessageBox.Show(Application.Current.MainWindow, sMsg, EgtMsg(10001), MessageBoxButton.OK, MessageBoxImage.Error) ' Error
|
||||
ElseIf Path.GetExtension(sFile) <> ".cnc" Then
|
||||
' creo oggetto pezzo in lista
|
||||
'Map.refProjectVM.
|
||||
End If
|
||||
MainScene.SetStatusNull()
|
||||
End Sub
|
||||
|
||||
Private Sub PrepareInputBox(ByVal sTitle As String, ByVal sLabel As String, ByVal sCheckLabel As String,
|
||||
ByVal bShowCombo As Boolean, ByVal bShowBtn As Boolean)
|
||||
'Map.refFreeContourInputVM.PrepareInputBox(sTitle, sLabel, sCheckLabel, bShowCombo, bShowBtn)
|
||||
End Sub
|
||||
|
||||
Private Sub SetInputBoxText(ByVal sText As String)
|
||||
'Map.refFreeContourInputVM.SetInputBoxText(sText)
|
||||
End Sub
|
||||
|
||||
Private Sub SetInputBoxCheck(ByVal bCheck As Boolean)
|
||||
'Map.refFreeContourInputVM.SetInputBoxCheck(bCheck)
|
||||
End Sub
|
||||
|
||||
Private Sub AddInputBoxCombo(ByVal sText As String, ByVal bSelected As Boolean)
|
||||
'Map.refFreeContourInputVM.AddInputBoxCombo(sText, bSelected)
|
||||
End Sub
|
||||
|
||||
Private Sub UpdateUI(ByVal sender As Object, ByVal bReloadUI As Boolean)
|
||||
'' pulisco input e relativi messaggi
|
||||
'Map.refFreeContourInputVM.ResetInputBox()
|
||||
If MainController.GetContinue() Then
|
||||
Map.refMyStatusBarVM.SetOutputMessage(EgtMsg(399)) ' Continue : 'L' with line, 'A' with arc
|
||||
Else
|
||||
Map.refMyStatusBarVM.ClearOutputMessage()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
#End Region ' CONTROLLER EVENTS
|
||||
|
||||
#Region "Part"
|
||||
|
||||
Friend Sub Basic_OnMouseDownScene(sender As Object, e As Forms.MouseEventArgs)
|
||||
' Verifico se selezionato indicativo di pezzo
|
||||
EgtSetObjFilterForSelWin(True, True, True, True, True)
|
||||
Dim nSel As Integer
|
||||
EgtSelect(e.Location, Scene.DIM_SEL, Scene.DIM_SEL, nSel)
|
||||
Dim nId As Integer = EgtGetFirstObjInSelWin()
|
||||
While nId <> GDB_ID.NULL
|
||||
' Recupero l'identificativo del pezzo cui appartiene
|
||||
Dim nPartId As Integer = EgtGetParent(EgtGetParent(nId))
|
||||
Dim bFound As Boolean = False
|
||||
If EgtIsPart(nPartId) Then bFound = True
|
||||
If Not bFound Then
|
||||
nId = EgtGetNextObjInSelWin()
|
||||
Continue While
|
||||
End If
|
||||
Dim nStat As Integer = GDB_ST.ON_
|
||||
EgtGetStatus(nPartId, nStat)
|
||||
' Se già selezionato
|
||||
If nStat = GDB_ST.SEL Then
|
||||
' Memorizzo Id da deselezionare
|
||||
m_nIdToDesel = nPartId
|
||||
Else
|
||||
' Memorizzo Id da selezionare
|
||||
m_nIdToSel = nPartId
|
||||
End If
|
||||
Exit While
|
||||
nId = EgtGetNextObjInSelWin()
|
||||
End While
|
||||
' Dati per drag
|
||||
m_bDragToStart = True
|
||||
End Sub
|
||||
|
||||
Friend Sub Basic_OnMouseMoveScene(sender As Object, e As System.Windows.Forms.MouseEventArgs)
|
||||
' Se drag non abilitato o già in esecuzione, esco
|
||||
If Not m_bDragToStart Then Return
|
||||
' Se primo movimento di drag, verifico di aver superato la soglia di movimento in pixel
|
||||
If m_bDragToStart Then
|
||||
If Math.Abs(e.Location.X - m_locPrev.X) < m_nRestRadius And
|
||||
Math.Abs(e.Location.Y - m_locPrev.Y) < m_nRestRadius Then
|
||||
Return
|
||||
End If
|
||||
m_bDragToStart = False
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Friend Sub Basic_OnMouseUpScene(sender As Object, e As System.Windows.Forms.MouseEventArgs)
|
||||
' Se eseguito drag
|
||||
If Not m_bDragToStart Then
|
||||
' Se selezione da eseguire
|
||||
ElseIf m_nIdToSel <> GDB_ID.NULL Then
|
||||
' Se pezzo da selezionare non è già selezionato
|
||||
'If EgtIsSelectedObj(m_nIdToSel) Then
|
||||
' Eseguo la selezione
|
||||
Map.refProjectVM.SelPartFromId(m_nIdToSel)
|
||||
'EgtDeselectAll()
|
||||
'EgtSelectPartObjs(m_nIdToSel)
|
||||
'EgtSelectObj(m_nIdToSel)
|
||||
'EgtSetMark(m_nIdToSel)
|
||||
'End If
|
||||
'If IsNothing(Map.refProjectVM.BTLStructureVM.SelBTLPart) OrElse Map.refProjectVM.BTLStructureVM.SelBTLPart.nPartId <> m_nIdToSel Then
|
||||
' ' Eseguo la selezione
|
||||
' For Each BTLPart In Map.refProjectVM.BTLStructureVM.BTLPartVMList
|
||||
' If BTLPart.nPartId = m_nIdToSel Then
|
||||
' BTLPart.SetIsSelected(True)
|
||||
' ElseIf BTLPart.IsSelected Then
|
||||
' BTLPart.SetIsSelected(False)
|
||||
' End If
|
||||
' Next
|
||||
' End If
|
||||
End If
|
||||
' Reset
|
||||
m_bDrag = False
|
||||
m_nIdToSel = GDB_ID.NULL
|
||||
m_nIdToDesel = GDB_ID.NULL
|
||||
EgtDraw()
|
||||
End Sub
|
||||
|
||||
#End Region ' Part
|
||||
|
||||
End Class
|
||||
@@ -1,33 +0,0 @@
|
||||
<EgtWPFLib5:EgtCustomWindow x:Class="ImportWndV"
|
||||
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:local="clr-namespace:Icarus">
|
||||
<DockPanel>
|
||||
<Grid DockPanel.Dock="Left">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
</Grid.RowDefinitions>
|
||||
<ListBox ItemsSource="{Binding ImportedEntityList}"
|
||||
SelectedItem="{Binding SelImportedEntity}"/>
|
||||
<StackPanel Grid.Row="1"
|
||||
Orientation="Horizontal">
|
||||
<Button Content="+"
|
||||
Command="{Binding AddPart_Command}"
|
||||
Style="{StaticResource ToolBar_Button}"/>
|
||||
<Button Content="-"
|
||||
Command="{Binding RemovePart_Command}"
|
||||
Style="{StaticResource ToolBar_Button}"/>
|
||||
<Button Content="Ref"
|
||||
Command="{Binding ChangeReference_Command}"
|
||||
Style="{StaticResource ToolBar_Button}"/>
|
||||
</StackPanel>
|
||||
<ListBox Grid.Row="2"
|
||||
ItemsSource="{Binding ImportPartList}"
|
||||
SelectedItem="{Binding SelImportPartList}"/>
|
||||
</Grid>
|
||||
<!--<local:ImportSceneHostV/>-->
|
||||
</DockPanel>
|
||||
</EgtWPFLib5:EgtCustomWindow>
|
||||
@@ -1,18 +0,0 @@
|
||||
Public Class ImportWndV
|
||||
|
||||
Private WithEvents m_ImportWndVM As ImportWndVM
|
||||
|
||||
Sub New(Owner As Window, ImportWndVM As ImportWndVM)
|
||||
MyBase.New(Owner)
|
||||
' This call is required by the designer.
|
||||
InitializeComponent()
|
||||
Me.DataContext = ImportWndVM
|
||||
' Assegno al riferimento locale al VM il VM preso dal DataContext
|
||||
m_ImportWndVM = ImportWndVM
|
||||
End Sub
|
||||
|
||||
'Private Sub CloseWindow(bDialogResult As Boolean) Handles m_ImportWndVM.m_CloseWindow
|
||||
' Me.DialogResult = bDialogResult
|
||||
'End Sub
|
||||
|
||||
End Class
|
||||
@@ -1,106 +0,0 @@
|
||||
Imports System.Collections.ObjectModel
|
||||
Imports EgtWPFLib5
|
||||
Imports EgtUILib
|
||||
|
||||
Public Class ImportWndVM
|
||||
Inherits VMBase
|
||||
|
||||
Private m_ImportedEntityList As ObservableCollection(Of GeomEntity)
|
||||
Public ReadOnly Property ImportedEntityList As ObservableCollection(Of GeomEntity)
|
||||
Get
|
||||
Return m_ImportedEntityList
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_SelImportedEntity As GeomEntity
|
||||
Public Property SelImportedEntity As GeomEntity
|
||||
Get
|
||||
Return m_SelImportedEntity
|
||||
End Get
|
||||
Set(value As GeomEntity)
|
||||
m_SelImportedEntity = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_ImportPartList As ObservableCollection(Of ImportPart)
|
||||
Public ReadOnly Property ImportPartList As ObservableCollection(Of ImportPart)
|
||||
Get
|
||||
Return m_ImportPartList
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_SelImportPartList As ImportPart
|
||||
Public Property SelImportPartList As ImportPart
|
||||
Get
|
||||
Return m_SelImportPartList
|
||||
End Get
|
||||
Set(value As ImportPart)
|
||||
m_SelImportPartList = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Sub New(sFilePath As String)
|
||||
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
|
||||
Public Class GeomEntity
|
||||
|
||||
Private m_nId As Integer = GDB_ID.NULL
|
||||
Public ReadOnly Property nId As Integer
|
||||
Get
|
||||
Return m_nId
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_sName As String
|
||||
Public ReadOnly Property sName As String
|
||||
Get
|
||||
Return m_sName
|
||||
End Get
|
||||
End Property
|
||||
|
||||
End Class
|
||||
|
||||
Public Class ImportPart
|
||||
|
||||
Private m_sName As String
|
||||
Public Property sName As String
|
||||
Get
|
||||
Return m_sName
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_sName = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_LayerList As List(Of ImportLayer)
|
||||
Public ReadOnly Property LayerList As List(Of ImportLayer)
|
||||
Get
|
||||
Return m_LayerList
|
||||
End Get
|
||||
End Property
|
||||
|
||||
End Class
|
||||
|
||||
Public Class ImportLayer
|
||||
|
||||
Private m_sName As String
|
||||
Public Property sName As String
|
||||
Get
|
||||
Return m_sName
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_sName = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_EntityList As List(Of GeomEntity)
|
||||
Public ReadOnly Property EntityList As List(Of GeomEntity)
|
||||
Get
|
||||
Return m_EntityList
|
||||
End Get
|
||||
End Property
|
||||
|
||||
End Class
|
||||
@@ -6,6 +6,20 @@ Imports EgtWPFLib5
|
||||
Public Class MyInstrumentPanelVM
|
||||
Inherits InstrumentPanelVM
|
||||
|
||||
Private m_PrevSelObjs As New List(Of Integer)
|
||||
Friend ReadOnly Property PrevSelObjs As List(Of Integer)
|
||||
Get
|
||||
Return m_PrevSelObjs
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_PrevPage As Pages
|
||||
Friend ReadOnly Property PrevPage As Pages
|
||||
Get
|
||||
Return m_PrevPage
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_InstrumentPanel_IsEnabled As Boolean = True
|
||||
Public Property InstrumentPanel_IsEnabled As Boolean
|
||||
Get
|
||||
@@ -16,6 +30,114 @@ Public Class MyInstrumentPanelVM
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_bEdgeAnalysis_IsChecked As Boolean
|
||||
Public Property bEdgeAnalysis_IsChecked As Boolean
|
||||
Get
|
||||
Return m_bEdgeAnalysis_IsChecked
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
' verifico che non sia in corso un altro comando
|
||||
If Map.refSceneHostVM.MainController.GetStep <> 0 Then Return
|
||||
m_bEdgeAnalysis_IsChecked = value
|
||||
If value Then
|
||||
' salvo pagina precedente ed imposto pagina nulla
|
||||
m_PrevPage = Map.refTopPanelVM.SelPage
|
||||
Map.refTopPanelVM.SelPage = Pages.NULL
|
||||
' disabilito ProjManager, TopPanel, TFS, Slider, bottoni e uscita dal programma
|
||||
Map.refProjManagerVM.SetProjCmdIsEnabled(False)
|
||||
Map.refTopPanelVM.SetTopPanelIsEnabled(False)
|
||||
Map.refViewLayerManagerVM.SetViewLayerManagerIsEnabled(False)
|
||||
Map.refSliceManagerVM.SetButtonsIsEnabled(False)
|
||||
Map.refSliderManagerVM.SetLayerIndexIsEnabled(False)
|
||||
Map.refSliderManagerVM.SetLayerAdvancementIsEnabled(False)
|
||||
' Disabilito segnalazione modificato
|
||||
Dim DisableMgr As New DisableModifiedMgr
|
||||
' salvo selezione precedente e deseleziono altri oggetti
|
||||
Dim nSelObjId As Integer = EgtGetFirstSelectedObj()
|
||||
While nSelObjId <> GDB_ID.NULL
|
||||
m_PrevSelObjs.Add(nSelObjId)
|
||||
nSelObjId = EgtGetNextSelectedObj()
|
||||
End While
|
||||
' eseguo comando su tutti i pezzi
|
||||
Dim sResult As String = "Chunk Number for every part:"
|
||||
For Each CurrPart In Map.refTopPanelVM.PartList
|
||||
EgtDeselectAll()
|
||||
Dim nPrintSolidId As Integer = EgtGetFirstInGroup(CurrPart.nPrintSolidLayerId)
|
||||
Dim nChunkLayerId As Integer = EgtGetFirstNameInGroup(CurrPart.nPartId, LAY_CHUNKS)
|
||||
If nChunkLayerId = GDB_ID.NULL Then
|
||||
nChunkLayerId = EgtCreateGroup(CurrPart.nPartId)
|
||||
EgtSetName(nChunkLayerId, LAY_CHUNKS)
|
||||
End If
|
||||
EgtSelectObj(nPrintSolidId)
|
||||
EgtSetCurrPartLayer(CurrPart.nPartId, nChunkLayerId)
|
||||
' estraggo bordi superficie
|
||||
Dim nCount As Integer = 0
|
||||
If EgtGetType(nPrintSolidId) = GDB_TY.SRF_FRGN Then
|
||||
For nChunk As Integer = 0 To EgtSurfFrChunkCount(nPrintSolidId) - 1
|
||||
EgtExtractSurfFrChunkLoops(nPrintSolidId, nChunk, nChunkLayerId, nCount)
|
||||
Next
|
||||
ElseIf EgtGetType(nPrintSolidId) = GDB_TY.SRF_MESH Then
|
||||
EgtExtractSurfTmLoops(nPrintSolidId, nChunkLayerId, nCount)
|
||||
ElseIf EgtGetType(nPrintSolidId) = GDB_TY.SRF_BEZ Then
|
||||
EgtExtractSurfBezierLoops(nPrintSolidId, nChunkLayerId, nCount)
|
||||
End If
|
||||
sResult &= Environment.NewLine & CurrPart.sName & " = " & nCount
|
||||
Next
|
||||
EgtDeselectAll()
|
||||
' li seleziono per evidenziarli
|
||||
For Each CurrPart In Map.refTopPanelVM.PartList
|
||||
Dim nChunkLayerId As Integer = EgtGetFirstNameInGroup(CurrPart.nPartId, LAY_CHUNKS)
|
||||
Dim nChunkId As Integer = EgtGetFirstInGroup(nChunkLayerId)
|
||||
While nChunkId <> GDB_ID.NULL
|
||||
EgtSelectObj(nChunkId)
|
||||
nChunkId = EgtGetNext(nChunkId)
|
||||
End While
|
||||
Next
|
||||
EgtDraw()
|
||||
' Ripristino stato segnalazione modifica
|
||||
DisableMgr.ReEnable()
|
||||
MessageBox.Show(sResult)
|
||||
Else
|
||||
' Disabilito segnalazione modificato
|
||||
Dim DisableMgr As New DisableModifiedMgr
|
||||
' cancello tutti i gruppi con i chunk
|
||||
For Each CurrPart In Map.refTopPanelVM.PartList
|
||||
Dim nChunkLayerId As Integer = EgtGetFirstNameInGroup(CurrPart.nPartId, LAY_CHUNKS)
|
||||
If nChunkLayerId <> GDB_ID.NULL Then EgtErase(nChunkLayerId)
|
||||
Next
|
||||
' ripristino selezioni precedenti
|
||||
For Each Id In m_PrevSelObjs
|
||||
EgtSelectObj(Id)
|
||||
Next
|
||||
' Ripristino stato segnalazione modifica
|
||||
DisableMgr.ReEnable()
|
||||
EgtDraw()
|
||||
' ripristino pagina precedente
|
||||
Map.refTopPanelVM.SelPage = m_PrevPage
|
||||
' riabilito ProjManager, TopPanel, TFS, Slider, bottoni e uscita dal programma
|
||||
Map.refProjManagerVM.SetProjCmdIsEnabled(True)
|
||||
Map.refTopPanelVM.SetTopPanelIsEnabled(True)
|
||||
Map.refViewLayerManagerVM.SetViewLayerManagerIsEnabled(True)
|
||||
Map.refSliceManagerVM.SetButtonsIsEnabled(True)
|
||||
Map.refSliderManagerVM.SetLayerIndexIsEnabled(True)
|
||||
Map.refSliderManagerVM.SetLayerAdvancementIsEnabled(True)
|
||||
End If
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_bEdgeAnalysis_IsEnabled As Boolean = True
|
||||
Public Property bEdgeAnalysis_IsEnabled As Boolean
|
||||
Get
|
||||
Return m_bEdgeAnalysis_IsEnabled
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
m_bEdgeAnalysis_IsEnabled = value
|
||||
End Set
|
||||
End Property
|
||||
Friend Sub SetEdgeAnalysisIsEnabled(value As Boolean)
|
||||
m_bEdgeAnalysis_IsEnabled = value
|
||||
NotifyPropertyChanged(NameOf(bEdgeAnalysis_IsEnabled))
|
||||
End Sub
|
||||
|
||||
#Region "CONSTRUCTORS"
|
||||
|
||||
|
||||
@@ -15,7 +15,8 @@
|
||||
<TabItem Header="NULL">
|
||||
</TabItem>
|
||||
<TabItem Header="IMPORT">
|
||||
<PrintApp:ImportPanelV DataContext="{StaticResource ImportPanelVM}"/>
|
||||
<!--<PrintApp:ImportPanelV DataContext="{StaticResource ImportPanelVM}"/>-->
|
||||
<PrintApp:ManagePartPanelV DataContext="{StaticResource ManagePartPanelVM}"/>
|
||||
</TabItem>
|
||||
<TabItem Header="DISPOSITION">
|
||||
<PrintApp:DispositionPanelV DataContext="{StaticResource DispositionPanelVM}"/>
|
||||
@@ -36,7 +37,8 @@
|
||||
<Button Height="100"/>
|
||||
</TabItem>
|
||||
<TabItem Header="MODIFYPART">
|
||||
<PrintApp:ModifyPartPanelV DataContext="{StaticResource ModifyPartPanelVM}"/>
|
||||
<!--<PrintApp:ModifyPartPanelV DataContext="{StaticResource ModifyPartPanelVM}"/>-->
|
||||
<PrintApp:ManagePartPanelV DataContext="{StaticResource ManagePartPanelVM}"/>
|
||||
</TabItem>
|
||||
</TabControl>
|
||||
|
||||
|
||||
@@ -55,7 +55,8 @@ Public Class LeftPanelVM
|
||||
Case Panels.SHELLNUMBER
|
||||
Map.refShellNumberPanelVM.Init()
|
||||
Case Panels.MODIFYPART
|
||||
Map.refModifyPartPanelVM.Init()
|
||||
''Map.refModifyPartPanelVM.Init()
|
||||
Map.refManagePartPanelVM.Init(ManagePartPanelVM.ManagePartType.MODIFY)
|
||||
End Select
|
||||
Map.refViewLayerManagerVM.UpdateForced()
|
||||
NotifyPropertyChanged(NameOf(SelPanel))
|
||||
|
||||
@@ -8,26 +8,48 @@
|
||||
Style="{StaticResource RightPanel_Border}">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
<UniformGrid Rows="1">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Button Content="New"
|
||||
Command="{Binding New_Command}"
|
||||
IsEnabled="{Binding IsEnabled}"
|
||||
Style="{StaticResource ToolBar_TextButton}"/>
|
||||
<Button Content="Save"
|
||||
Grid.Column="1"
|
||||
Command="{Binding Save_Command}"
|
||||
IsEnabled="{Binding IsEnabled}"
|
||||
Style="{StaticResource ToolBar_TextButton}"/>
|
||||
<Button Content="Delete"
|
||||
Grid.Column="2"
|
||||
Command="{Binding Delete_Command}"
|
||||
IsEnabled="{Binding IsEnabled}"
|
||||
Style="{StaticResource ToolBar_TextButton}"/>
|
||||
</UniformGrid>
|
||||
<Button Grid.Column="3"
|
||||
Command="{Binding Import_Command}"
|
||||
ToolTip="{Binding ImportToolTip}"
|
||||
IsEnabled="{Binding ImpExp_IsEnabled}"
|
||||
Style="{StaticResource ToolBar_Button}">
|
||||
<Image Source="/Resources/MachiningDB/Import.png" Stretch="Uniform"/>
|
||||
</Button>
|
||||
<Button Grid.Column="4"
|
||||
Command="{Binding Export_Command}"
|
||||
ToolTip="{Binding ImportToolTip}"
|
||||
IsEnabled="{Binding ImpExp_IsEnabled}"
|
||||
Style="{StaticResource ToolBar_Button}">
|
||||
<Image Source="/Resources/MachiningDB/Export.png" Stretch="Uniform"/>
|
||||
</Button>
|
||||
</Grid>
|
||||
<Grid Grid.Row="1">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
@@ -40,6 +62,7 @@
|
||||
Visibility="{Binding Combo_Visibility}"
|
||||
Style="{StaticResource FeatureComboBox}"/>
|
||||
<EgtWPFLib5:EgtTextBox Text="{Binding SelectedItem.sName, ElementName=MachiningCombo, UpdateSourceTrigger=Explicit}"
|
||||
ExplicitUpdateSource="EnterKeyPressOrLostFocus"
|
||||
IsExplicitFocused="{Binding UserShouldEditValueNow}"
|
||||
Visibility="{Binding Name_Visibility}"
|
||||
Style="{StaticResource OptionTextBox}"/>
|
||||
@@ -49,7 +72,7 @@
|
||||
<Image Source="/Resources/TopPanel/Edit.png"/>
|
||||
</Button>
|
||||
</Grid>
|
||||
<ScrollViewer Grid.Row="3"
|
||||
<ScrollViewer Grid.Row="2"
|
||||
VerticalScrollBarVisibility="Auto"
|
||||
HorizontalScrollBarVisibility="Disabled">
|
||||
<ItemsControl Grid.Row="1"
|
||||
@@ -68,8 +91,7 @@
|
||||
<ItemsControl ItemsSource="{Binding MachiningParamList}">
|
||||
<ItemsControl.ItemsPanel>
|
||||
<ItemsPanelTemplate>
|
||||
<UniformGrid Columns="1"
|
||||
HorizontalAlignment="Stretch"/>
|
||||
<StackPanel Orientation="Vertical"/>
|
||||
</ItemsPanelTemplate>
|
||||
</ItemsControl.ItemsPanel>
|
||||
<ItemsControl.Resources>
|
||||
@@ -163,6 +185,38 @@
|
||||
Style="{StaticResource ToolBar_SmallButton}"/>-->
|
||||
</Grid>
|
||||
</DataTemplate>
|
||||
<DataTemplate DataType="{x:Type PrintApp:OrderedMachiningParam}">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="2*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock Text="{Binding sName}"
|
||||
VerticalAlignment="Center"/>
|
||||
<Grid Grid.Column="1">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<ListBox ItemsSource="{Binding ValueList}"
|
||||
SelectedItem="{Binding SelValue}"/>
|
||||
<StackPanel Grid.Column="1"
|
||||
Orientation="Vertical"
|
||||
VerticalAlignment="Center"
|
||||
Margin="5,0,0,0">
|
||||
<Button Content="˄"
|
||||
Command="{Binding MoveUpOrder_Command}"
|
||||
Style="{StaticResource ToolBar_SmallButton}"/>
|
||||
<Button Content="˅"
|
||||
Command="{Binding MoveDownOrder_Command}"
|
||||
Style="{StaticResource ToolBar_SmallButton}"/>
|
||||
<Button Content="<>"
|
||||
Command="{Binding ResetOrder_Command}"
|
||||
Style="{StaticResource ToolBar_SmallButton}"/>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</DataTemplate>
|
||||
</ItemsControl.Resources>
|
||||
</ItemsControl>
|
||||
</Expander>
|
||||
@@ -170,7 +224,7 @@
|
||||
</ItemsControl.ItemTemplate>
|
||||
</ItemsControl>
|
||||
</ScrollViewer>
|
||||
<UniformGrid Grid.Row="4" Rows="1">
|
||||
<UniformGrid Grid.Row="3" Rows="1">
|
||||
<Button Content="Ok"
|
||||
Command="{Binding Ok_Command}"
|
||||
IsEnabled="{Binding IsEnabled}"
|
||||
|
||||
@@ -26,7 +26,7 @@ Public Class MachiningDbVM
|
||||
' verifico se modificato
|
||||
If m_SelMachining.bIsModified Then
|
||||
' chiedo se salvare
|
||||
Select Case MessageBox.Show("Salvare le modifiche apportate alla lavorazione selezionata?", "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)
|
||||
Case MessageBoxResult.Yes
|
||||
m_SelMachining.Save()
|
||||
Case MessageBoxResult.No
|
||||
@@ -50,6 +50,7 @@ Public Class MachiningDbVM
|
||||
End If
|
||||
Next
|
||||
End If
|
||||
NotifyPropertyChanged(NameOf(ImpExp_IsEnabled))
|
||||
End Set
|
||||
End Property
|
||||
|
||||
@@ -105,12 +106,20 @@ Public Class MachiningDbVM
|
||||
NotifyPropertyChanged(NameOf(UserShouldEditValueNow))
|
||||
End Sub
|
||||
|
||||
Public ReadOnly Property ImpExp_IsEnabled As Boolean
|
||||
Get
|
||||
Return m_IsEnabled AndAlso (IsNothing(m_SelMachining) OrElse Not m_SelMachining.bIsModified)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
' Definizione comandi
|
||||
Private m_cmdOk As ICommand
|
||||
Private m_cmdNew As ICommand
|
||||
Private m_cmdSave 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
|
||||
|
||||
@@ -138,6 +147,7 @@ Public Class MachiningDbVM
|
||||
GetMainPrivateProfileString(S_PRINTING3D, K_CURRMACHINING, "", sCurrMachining)
|
||||
m_SelMachining = MachiningList.FirstOrDefault(Function(x) x.sGUID = sCurrMachining)
|
||||
NotifyPropertyChanged(NameOf(SelMachining))
|
||||
NotifyPropertyChanged(NameOf(ImpExp_IsEnabled))
|
||||
End Sub
|
||||
|
||||
Friend Sub SetNameVisibility(bValue As Boolean)
|
||||
@@ -213,7 +223,7 @@ Public Class MachiningDbVM
|
||||
' aggiorno combo top
|
||||
Dim CurrSelTopMachining As MachiningIndex = Map.refTopPanelVM.SelMachining
|
||||
Map.refTopPanelVM.InitMachiningsList()
|
||||
Map.refTopPanelVM.SetSelMachining( CurrSelTopMachining)
|
||||
Map.refTopPanelVM.SetSelMachining(CurrSelTopMachining)
|
||||
End If
|
||||
' ripristino modalita' standard
|
||||
Map.refTopPanelVM.SelPage = Pages.MODIFY
|
||||
@@ -239,6 +249,7 @@ Public Class MachiningDbVM
|
||||
m_SelMachining = NewMachining
|
||||
NotifyPropertyChanged(NameOf(SelMachining))
|
||||
SetNameVisibility(True)
|
||||
SetIsModified(True)
|
||||
End Sub
|
||||
|
||||
#End Region ' New
|
||||
@@ -255,8 +266,9 @@ Public Class MachiningDbVM
|
||||
End Property
|
||||
|
||||
Public Sub Save()
|
||||
If IsNothing( m_SelMachining) Then Return
|
||||
If IsNothing(m_SelMachining) Then Return
|
||||
m_SelMachining.Save()
|
||||
NotifyPropertyChanged(NameOf(ImpExp_IsEnabled))
|
||||
End Sub
|
||||
|
||||
#End Region ' Save
|
||||
@@ -275,10 +287,13 @@ Public Class MachiningDbVM
|
||||
Public Sub Delete()
|
||||
If IsNothing(m_SelMachining) Then Return
|
||||
' chiedo conferma
|
||||
Select Case MessageBox.Show("Sei sicuro di voler cancellare la lavorazione selezionata?", "Warning", MessageBoxButton.YesNo, MessageBoxImage.Warning)
|
||||
Select Case MessageBox.Show("Are you sure you want to delete the selected machining?", "Warning", MessageBoxButton.YesNo, MessageBoxImage.Warning)
|
||||
Case MessageBoxResult.Yes
|
||||
m_MachiningList.Remove(m_SelMachining)
|
||||
SetIsModified(True)
|
||||
If m_MachiningList.Count > 0 Then
|
||||
SelMachining = m_MachiningList(0)
|
||||
End If
|
||||
Case MessageBoxResult.No
|
||||
Return
|
||||
End Select
|
||||
@@ -305,6 +320,47 @@ Public Class MachiningDbVM
|
||||
|
||||
#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 = "File data (*" & ImportExportMachiningPanelVM.MachiningDataExtension & ")|*" & ImportExportMachiningPanelVM.MachiningDataExtension,
|
||||
.FileName = String.Empty}
|
||||
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))
|
||||
ImportWindow.ShowDialog()
|
||||
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 ExportWindow As New ImportExportMachiningPanelV(Application.Current.MainWindow, New ImportExportMachiningPanelVM(ImportExportMachiningPanelVM.WindowTypeEnum.MACHINING, ImportExportMachiningPanelVM.WindowModeEnum.EXPORT))
|
||||
ExportWindow.ShowDialog()
|
||||
End Sub
|
||||
|
||||
#End Region ' Export
|
||||
|
||||
#End Region ' COMMANDS
|
||||
|
||||
End Class
|
||||
|
||||
@@ -195,8 +195,8 @@ Public Class MainWindowM
|
||||
' Verifico abilitazione nesting automatico
|
||||
m_bAutoNestOption = Not String.IsNullOrWhiteSpace(sNestKey)
|
||||
' Recupero livello e opzioni della chiave
|
||||
Dim bKey As Boolean = EgtGetKeyLevel(3279, 2410, 1, m_nKeyLevel) And
|
||||
EgtGetKeyOptions(3279, 2410, 1, m_nKeyOptions)
|
||||
Dim bKey As Boolean = EgtGetKeyLevel(5583, 2502, 1, m_nKeyLevel) And
|
||||
EgtGetKeyOptions(5583, 2502, 1, m_nKeyOptions)
|
||||
' Inizializzazione generale di EgtInterface
|
||||
m_nDebug = GetMainPrivateProfileInt(S_GENERAL, K_DEBUG, 0)
|
||||
m_sLogFile = m_sTempDir & "\" & GENLOG_FILE_NAME.Replace("#", m_nInstance.ToString())
|
||||
|
||||
@@ -19,6 +19,7 @@ Class MainWindowV
|
||||
AddHandler Me.ContentRendered, AddressOf MainWindowV_ContentRendered
|
||||
AddHandler Me.Closing, AddressOf MainWindowV_Closing
|
||||
AddHandler Me.KeyDown, AddressOf MainWindowV_KeyDown
|
||||
AddHandler Me.StateChanged, AddressOf MainWindowV_StateChanged
|
||||
End Sub
|
||||
|
||||
#End Region ' CONSTRUCTOR
|
||||
@@ -63,6 +64,14 @@ Class MainWindowV
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub MainWindowV_StateChanged(sender As Object, e As EventArgs)
|
||||
If Not IsNothing(Map.refSecondaryWindowV) AndAlso Not Map.refSecondaryWindowV.WindowChangingState Then
|
||||
Map.refSecondaryWindowV.WindowState = Me.WindowState
|
||||
'Application.Current.MainWindow.Topmost = True
|
||||
'Application.Current.MainWindow.Topmost = False
|
||||
End If
|
||||
End Sub
|
||||
|
||||
#End Region ' EVENTS
|
||||
|
||||
End Class
|
||||
|
||||
@@ -285,7 +285,11 @@ Public Class MainWindowVM
|
||||
' Se non confermata chiusura, esco
|
||||
If Not bAllowClose Then Return
|
||||
' salvo modo di visualizzazione
|
||||
WriteMainPrivateProfileString(S_SCENE, K_SHOWMODE, EgtGetShowMode().ToString)
|
||||
WriteMainPrivateProfileString(S_SCENE, K_SHOWMODE, EgtGetShowMode().ToString())
|
||||
' Salvo stato visualizzazione direzione curve
|
||||
WriteMainPrivateProfileString(S_SCENE, K_CURVEDIR, If(EgtGetShowCurveDirection(), "1", "0"))
|
||||
' Salvo stato visualizzazione griglia
|
||||
WriteMainPrivateProfileString(S_GRID, K_SHOWGRID, If(Map.refMyStatusBarVM.bGridVisibility, "1", "0"))
|
||||
' Termino il Model
|
||||
m_MainWindowM.Close()
|
||||
' Termino il programma
|
||||
|
||||
@@ -1,24 +1,27 @@
|
||||
<UserControl x:Class="ModifyPartPanelV"
|
||||
<UserControl x:Class="ManagePartPanelV"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:local="clr-namespace:Icarus"
|
||||
xmlns:EgtWPFLib5="clr-namespace:EgtWPFLib5;assembly=EgtWPFLib5"
|
||||
Width="150"
|
||||
Margin="5,0,0,0">
|
||||
Margin="5,0,0,0"
|
||||
VerticalAlignment="Stretch">
|
||||
<Grid DockPanel.Dock="Left">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="2*"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
<Border Style="{StaticResource LeftPanelTitle_Border}">
|
||||
<TextBlock Text="Part entity list"
|
||||
<TextBlock Text="Part Entity List"
|
||||
FontWeight="DemiBold"
|
||||
FontSize="14"/>
|
||||
</Border>
|
||||
<!--<DockPanel Grid.Row="1">
|
||||
<!--<UniformGrid Grid.Row="1" Rows="1"
|
||||
IsEnabled="{Binding IsEnabled}">
|
||||
<Button DockPanel.Dock="Left"
|
||||
Content="+"
|
||||
FontSize="20"
|
||||
@@ -29,23 +32,28 @@
|
||||
FontSize="20"
|
||||
Command="{Binding RemovePart_Command}"
|
||||
Style="{StaticResource LeftPanel_Button}"/>
|
||||
<Button Content="Reference"
|
||||
Command="{Binding SetReference_Command}"
|
||||
Style="{StaticResource LeftPanel_TextButton}"/>
|
||||
</DockPanel>-->
|
||||
</UniformGrid>-->
|
||||
<TreeView Grid.Row="2"
|
||||
ItemsSource="{Binding ModifyPartList}"
|
||||
MinHeight="300">
|
||||
ItemsSource="{Binding ManagerPartList}"
|
||||
MinHeight="200"
|
||||
IsEnabled="{Binding IsEnabled}">
|
||||
<TreeView.Resources>
|
||||
<HierarchicalDataTemplate DataType="{x:Type local:ModifyPart}"
|
||||
<HierarchicalDataTemplate DataType="{x:Type local:ManagePart_Part}"
|
||||
ItemsSource="{Binding LayerList}">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<Image Source="/Resources/TreeView/Folder.png"
|
||||
Height="15"/>
|
||||
<TextBlock Text="{Binding ghName}" />
|
||||
<Grid>
|
||||
<TextBlock Text="{Binding sName}"
|
||||
Visibility="{Binding TextBlock_Visibility}"/>
|
||||
<EgtWPFLib5:EgtTextBox Text="{Binding sName, UpdateSourceTrigger=Explicit}"
|
||||
IsExplicitFocused="{Binding UserShouldEditValueNow}"
|
||||
Visibility="{Binding TextBox_Visibility}"
|
||||
Style="{StaticResource OptionTextBox}"/>
|
||||
</Grid>
|
||||
</StackPanel>
|
||||
</HierarchicalDataTemplate>
|
||||
<HierarchicalDataTemplate DataType="{x:Type local:ModifyLayer}"
|
||||
<HierarchicalDataTemplate DataType="{x:Type local:ManagePart_Layer}"
|
||||
ItemsSource="{Binding EntityList, UpdateSourceTrigger=PropertyChanged}">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<Image Source="/Resources/TreeView/Folder.png"
|
||||
@@ -53,19 +61,20 @@
|
||||
<TextBlock Text="{Binding sName}" />
|
||||
</StackPanel>
|
||||
</HierarchicalDataTemplate>
|
||||
<HierarchicalDataTemplate DataType="{x:Type local:ModifyEntity}">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<!--<Image Source="/WpfTutorialSamples;component/Images/user.png" Margin="0,0,5,0" />-->
|
||||
<TextBlock Text="{Binding ghName}" />
|
||||
<TextBlock Text="{Binding ghReference, UpdateSourceTrigger=PropertyChanged}"/>
|
||||
</StackPanel>
|
||||
<HierarchicalDataTemplate DataType="{x:Type local:PartManager_GeomEntity}">
|
||||
<Grid>
|
||||
<TextBlock Text="{Binding sName}" />
|
||||
<EgtWPFLib5:EgtTextBox Text="{Binding sName, UpdateSourceTrigger=Explicit}"
|
||||
IsExplicitFocused="{Binding UserShouldEditValueNow}"
|
||||
Visibility="{Binding TextBox_Visibility}"
|
||||
Style="{StaticResource OptionTextBox}"/>
|
||||
</Grid>
|
||||
</HierarchicalDataTemplate>
|
||||
<!-- Menu' tasto destro -->
|
||||
<ContextMenu x:Key="RowMenu" ItemsSource="{Binding MenuList}" >
|
||||
<ContextMenu.ItemContainerStyle>
|
||||
<Style TargetType="MenuItem">
|
||||
<Setter Property="Command" Value="{Binding MenuItem_Command}"/>
|
||||
<Setter Property="CommandParameter" Value="{Binding MenuItem_Command}"/>
|
||||
<Setter Property="Header" Value="{Binding sMsg}"/>
|
||||
</Style>
|
||||
</ContextMenu.ItemContainerStyle>
|
||||
@@ -73,25 +82,41 @@
|
||||
</TreeView.Resources>
|
||||
<TreeView.ItemContainerStyle>
|
||||
<Style TargetType="{x:Type TreeViewItem}">
|
||||
<Setter Property="IsSelected" Value="{Binding bIsSelected, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
|
||||
<Setter Property="IsExpanded" Value="True" />
|
||||
<Setter Property="ContextMenu" Value="{StaticResource RowMenu}" />
|
||||
<Setter Property="IsSelected" Value="{Binding bIsSelected, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"/>
|
||||
<Setter Property="IsExpanded" Value="True"/>
|
||||
<Setter Property="ContextMenu" Value="{StaticResource RowMenu}"/>
|
||||
<EventSetter Event="ContextMenuOpening" Handler="Item_ContextMenuOpening"/>
|
||||
</Style>
|
||||
</TreeView.ItemContainerStyle>
|
||||
</TreeView>
|
||||
<!--<Border Grid.Row="3"
|
||||
<Border Grid.Row="3"
|
||||
Visibility="{Binding IsImport_Visibility}"
|
||||
Style="{StaticResource LeftPanelTitle_Border}">
|
||||
<TextBlock Text="Lista entità importate"
|
||||
<TextBlock Text="Imported Entity List"
|
||||
FontWeight="DemiBold"
|
||||
FontSize="14"/>
|
||||
</Border>
|
||||
<ListBox Grid.Row="4"
|
||||
ItemsSource="{Binding ImportedEntityList, UpdateSourceTrigger=PropertyChanged}"
|
||||
SelectedItem="{Binding SelImportedEntity}"
|
||||
MinHeight="200">
|
||||
MinHeight="100"
|
||||
IsEnabled="{Binding IsEnabled}"
|
||||
Visibility="{Binding IsImport_Visibility}">
|
||||
<ListBox.Resources>
|
||||
<!-- Menu' tasto destro -->
|
||||
<ContextMenu x:Key="RowMenu" ItemsSource="{Binding MenuList}" >
|
||||
<ContextMenu.ItemContainerStyle>
|
||||
<Style TargetType="MenuItem">
|
||||
<Setter Property="Command" Value="{Binding MenuItem_Command}"/>
|
||||
<Setter Property="Header" Value="{Binding sMsg}"/>
|
||||
</Style>
|
||||
</ContextMenu.ItemContainerStyle>
|
||||
</ContextMenu>
|
||||
</ListBox.Resources>
|
||||
<ListBox.ItemContainerStyle>
|
||||
<Style TargetType="ListBoxItem">
|
||||
<Setter Property="HorizontalContentAlignment" Value="Stretch"/>
|
||||
<Setter Property="ContextMenu" Value="{StaticResource RowMenu}" />
|
||||
</Style>
|
||||
</ListBox.ItemContainerStyle>
|
||||
<ListBox.ItemTemplate>
|
||||
@@ -99,22 +124,24 @@
|
||||
<Grid HorizontalAlignment="Stretch">
|
||||
<Grid.InputBindings>
|
||||
<MouseBinding Gesture="LeftDoubleClick"
|
||||
Command="{Binding ImportedEntity_DoubleClick}"/>
|
||||
Command="{Binding GeomEntityDoubleClick_Command}"/>
|
||||
</Grid.InputBindings>
|
||||
<TextBlock Text="{Binding ghName}">
|
||||
</TextBlock>
|
||||
</Grid>
|
||||
</DataTemplate>
|
||||
</ListBox.ItemTemplate>
|
||||
</ListBox>-->
|
||||
</ListBox>
|
||||
<UniformGrid Grid.Row="5"
|
||||
Rows="1">
|
||||
Rows="1"
|
||||
IsEnabled="{Binding IsEnabled}">
|
||||
<Button Content="Ok"
|
||||
Command="{Binding Ok_Command}"
|
||||
Style="{StaticResource LeftPanel_TextButton}"/>
|
||||
<!--<Button Content="Cancel"
|
||||
Style="{StaticResource ToolBar_TextButton}"/>
|
||||
<Button Content="Cancel"
|
||||
Command="{Binding Cancel_Command}"
|
||||
Style="{StaticResource LeftPanel_TextButton}"/>-->
|
||||
Visibility="{Binding IsImport_Visibility}"
|
||||
Style="{StaticResource ToolBar_TextButton}"/>
|
||||
</UniformGrid>
|
||||
</Grid>
|
||||
</UserControl>
|
||||
@@ -0,0 +1,26 @@
|
||||
Public Class ManagePartPanelV
|
||||
|
||||
Protected Sub Item_ContextMenuOpening(sender As Object, e As ContextMenuEventArgs)
|
||||
Dim PartItem As ManagePart_Part
|
||||
Dim LayerItem As ManagePart_Layer
|
||||
Dim EntityItem As PartManager_GeomEntity
|
||||
Select Case e.OriginalSource.DataContext.GetType()
|
||||
Case GetType(ManagePart_Part)
|
||||
PartItem = DirectCast(e.OriginalSource.DataContext, ManagePart_Part)
|
||||
If PartItem.MenuList.Count = 0 Then
|
||||
e.Handled = True
|
||||
End If
|
||||
Case GetType(ManagePart_Layer)
|
||||
LayerItem = DirectCast(e.OriginalSource.DataContext, ManagePart_Layer)
|
||||
If LayerItem.Type <> ManagePart_Layer.LayerType.PRINT_SOLID OrElse LayerItem.MenuList.Count = 0 Then
|
||||
e.Handled = True
|
||||
End If
|
||||
Case GetType(PartManager_GeomEntity)
|
||||
EntityItem = DirectCast(e.OriginalSource.DataContext, PartManager_GeomEntity)
|
||||
If EntityItem.MenuList.Count = 0 Then
|
||||
e.Handled = True
|
||||
End If
|
||||
End Select
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
@@ -0,0 +1,510 @@
|
||||
Imports System.Collections.ObjectModel
|
||||
Imports EgtUILib
|
||||
Imports EgtWPFLib5
|
||||
|
||||
Public Class ManagePartPanelVM
|
||||
Inherits VMBase
|
||||
|
||||
Public Enum ManagePartType
|
||||
IMPORT = 1
|
||||
MODIFY = 2
|
||||
End Enum
|
||||
|
||||
Private m_Type As ManagePartType
|
||||
Friend ReadOnly Property Type As ManagePartType
|
||||
Get
|
||||
Return m_Type
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_nImportedPartId As Integer = GDB_ID.NULL
|
||||
Friend ReadOnly Property nImportedPartId As Integer
|
||||
Get
|
||||
Return m_nImportedPartId
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_ImportedEntityList As New ObservableCollection(Of PartManager_GeomEntity)
|
||||
Public Property ImportedEntityList As ObservableCollection(Of PartManager_GeomEntity)
|
||||
Get
|
||||
Return m_ImportedEntityList
|
||||
End Get
|
||||
Set(value As ObservableCollection(Of PartManager_GeomEntity))
|
||||
m_ImportedEntityList = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_SelImportedEntity As PartManager_GeomEntity
|
||||
Public Property SelImportedEntity As PartManager_GeomEntity
|
||||
Get
|
||||
Return m_SelImportedEntity
|
||||
End Get
|
||||
Set(value As PartManager_GeomEntity)
|
||||
m_SelImportedEntity = value
|
||||
EgtDeselectAll()
|
||||
If Not IsNothing(m_SelImportedEntity) Then
|
||||
EgtSelectObj(m_SelImportedEntity.nId)
|
||||
End If
|
||||
EgtDraw()
|
||||
End Set
|
||||
End Property
|
||||
Friend Sub SetSelImportedEntity(nId As Integer)
|
||||
Dim SelEntity As PartManager_GeomEntity = Nothing
|
||||
' cerco tra entita' importate
|
||||
SelEntity = m_ImportedEntityList.FirstOrDefault(Function(x) x.nId = nId)
|
||||
If IsNothing(SelEntity) Then
|
||||
' cerco tra pezzi creati
|
||||
For Each ManagePart In m_ManagerPartList
|
||||
For Each Layer In ManagePart.LayerList
|
||||
SelEntity = Layer.EntityList.FirstOrDefault(Function(x) x.nId = nId)
|
||||
If Not IsNothing(SelEntity) Then
|
||||
SelEntity.bIsSelected = True
|
||||
SelEntity.NotifyPropertyChanged(NameOf(SelEntity.bIsSelected))
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
If Not IsNothing(SelEntity) Then
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
End If
|
||||
m_SelImportedEntity = SelEntity
|
||||
EgtDeselectAll()
|
||||
If Not IsNothing(m_SelImportedEntity) Then
|
||||
EgtSelectObj(m_SelImportedEntity.nId)
|
||||
End If
|
||||
EgtDraw()
|
||||
NotifyPropertyChanged(NameOf(SelImportedEntity))
|
||||
End Sub
|
||||
|
||||
Private m_ManagerPartList As New ObservableCollection(Of ManagePart_Part)
|
||||
Public ReadOnly Property ManagerPartList As ObservableCollection(Of ManagePart_Part)
|
||||
Get
|
||||
Return m_ManagerPartList
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_SelManagerPart As ManagePart_Part
|
||||
Friend Sub SetSelManagerPart(SelManagePart_Part As ManagePart_Part)
|
||||
m_SelManagerPart = SelManagePart_Part
|
||||
m_SelManagerLayer = Nothing
|
||||
End Sub
|
||||
Public ReadOnly Property SelManagerPart As ManagePart_Part
|
||||
Get
|
||||
Return m_SelManagerPart
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_SelManagerLayer As ManagePart_Layer
|
||||
Public ReadOnly Property SelManagerLayer As ManagePart_Layer
|
||||
Get
|
||||
Return m_SelManagerLayer
|
||||
End Get
|
||||
End Property
|
||||
Friend Sub SetSelManagerLayer(SelManagePart_Layer As ManagePart_Layer)
|
||||
m_SelManagerPart = m_ManagerPartList.FirstOrDefault(Function(x) x.LayerList.Contains(SelManagePart_Layer))
|
||||
m_SelManagerLayer = SelManagePart_Layer
|
||||
End Sub
|
||||
|
||||
Private m_SelPartManager_GeomEntity As PartManager_GeomEntity
|
||||
Public ReadOnly Property SelPartManager_GeomEntity As PartManager_GeomEntity
|
||||
Get
|
||||
Return m_SelPartManager_GeomEntity
|
||||
End Get
|
||||
End Property
|
||||
Friend Sub SetSelPartManager_GeomEntity(SelPartManager_GeomEntity As PartManager_GeomEntity)
|
||||
For Each CurrPart In m_ManagerPartList
|
||||
Dim CurrLayer As ManagePart_Layer = CurrPart.LayerList.FirstOrDefault(Function(x) x.EntityList.Contains(SelPartManager_GeomEntity))
|
||||
If Not IsNothing(CurrLayer) Then
|
||||
m_SelManagerPart = CurrPart
|
||||
m_SelManagerLayer = CurrLayer
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
m_SelPartManager_GeomEntity = SelPartManager_GeomEntity
|
||||
End Sub
|
||||
|
||||
Public ReadOnly Property IsImport_Visibility As Visibility
|
||||
Get
|
||||
Select Case m_Type
|
||||
Case ManagePartType.IMPORT
|
||||
Return Visibility.Visible
|
||||
Case Else ' ManagePartType.MODIFY
|
||||
Return Visibility.Collapsed
|
||||
End Select
|
||||
End Get
|
||||
End Property
|
||||
|
||||
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))
|
||||
End Sub
|
||||
|
||||
' Definizione comandi
|
||||
Private m_cmdSetReference As ICommand
|
||||
Private m_cmdAddPart As ICommand
|
||||
Private m_cmdRemovePart As ICommand
|
||||
Private m_cmdOk As ICommand
|
||||
Private m_cmdCancel As ICommand
|
||||
|
||||
Sub New()
|
||||
' Creo riferimento a questa classe in EgtCAM5Map
|
||||
Map.SetRefManagePartPanelVM(Me)
|
||||
End Sub
|
||||
|
||||
#Region "METHODS"
|
||||
|
||||
Friend Sub Init(Type As ManagePartType)
|
||||
m_Type = Type
|
||||
Select Case Type
|
||||
Case ManagePartType.IMPORT
|
||||
' import
|
||||
m_ImportedEntityList.Clear()
|
||||
m_ManagerPartList.Clear()
|
||||
' aggiungo geometrie importate a lista
|
||||
m_nImportedPartId = EgtGetLastPart()
|
||||
Dim nLayerId As Integer = EgtGetFirstLayer(m_nImportedPartId)
|
||||
Dim nGeometryId As Integer = EgtGetFirstInGroup(nLayerId)
|
||||
While nGeometryId <> GDB_ID.NULL
|
||||
Dim sGeometryName As String = ""
|
||||
EgtGetName(nGeometryId, sGeometryName)
|
||||
m_ImportedEntityList.Add(New PartManager_GeomEntity(Nothing, nGeometryId))
|
||||
nGeometryId = EgtGetNext(nGeometryId)
|
||||
End While
|
||||
' aggiungo primo pezzo
|
||||
m_ManagerPartList.Add(New ManagePart_Part(Nothing))
|
||||
m_ManagerPartList(0).LayerList.FirstOrDefault(Function(x) x.Type = ManagePart_Layer.LayerType.PRINT_SOLID).bIsSelected = True
|
||||
' aggiorno i contextmenu di tutti gli entity
|
||||
UpdateAllEntityContextMenu()
|
||||
Case ManagePartType.MODIFY
|
||||
' modify
|
||||
m_ImportedEntityList.Clear()
|
||||
m_ManagerPartList.Clear()
|
||||
' carico pezzi in lista
|
||||
For Each PrintPart In Map.refTopPanelVM.PartList
|
||||
m_ManagerPartList.Add(New ManagePart_Part(PrintPart))
|
||||
Next
|
||||
End Select
|
||||
NotifyPropertyChanged(NameOf(IsImport_Visibility))
|
||||
EgtDeselectAll()
|
||||
End Sub
|
||||
|
||||
Friend Sub UpdateAllEntityContextMenu()
|
||||
' aggiorno i contextmenu di tutti gli entity
|
||||
For Each ManagePart In m_ManagerPartList
|
||||
For Each Layer In ManagePart.LayerList
|
||||
For Each Entity In Layer.EntityList
|
||||
Entity.UpdateContextMenu()
|
||||
Next
|
||||
Next
|
||||
Next
|
||||
For Each Entity In ImportedEntityList
|
||||
Entity.UpdateContextMenu()
|
||||
Next
|
||||
End Sub
|
||||
|
||||
#End Region ' METHODS
|
||||
|
||||
#Region "COMMANDS"
|
||||
|
||||
#Region "AddPart"
|
||||
|
||||
Public ReadOnly Property AddPart_Command As ICommand
|
||||
Get
|
||||
If m_cmdAddPart Is Nothing Then
|
||||
m_cmdAddPart = New Command(AddressOf AddPart)
|
||||
End If
|
||||
Return m_cmdAddPart
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Sub AddPart()
|
||||
m_ManagerPartList.Add(New ManagePart_Part(Nothing))
|
||||
' aggiorno i contextmenu di tutti gli entity
|
||||
UpdateAllEntityContextMenu()
|
||||
End Sub
|
||||
|
||||
#End Region ' AddPart
|
||||
|
||||
#Region "RemovePart"
|
||||
|
||||
Public ReadOnly Property RemovePart_Command As ICommand
|
||||
Get
|
||||
If m_cmdRemovePart Is Nothing Then
|
||||
m_cmdRemovePart = New Command(AddressOf RemovePart)
|
||||
End If
|
||||
Return m_cmdRemovePart
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Sub RemovePart()
|
||||
If IsNothing(SelManagerLayer) AndAlso m_ManagerPartList.Count > 1 Then
|
||||
' rimuovo pezzo
|
||||
m_ManagerPartList.Remove(SelManagerPart)
|
||||
'Else
|
||||
' ' rimuovo geometria
|
||||
' Dim CurrEntity As PartManager_GeomEntity = m_SelPartManager_GeomEntity
|
||||
' SelManagerLayer.EntityList.Remove(m_SelPartManager_GeomEntity)
|
||||
' ' la rimetto in lista importati
|
||||
' ImportedEntityList.Add(CurrEntity)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
#End Region ' RemovePart
|
||||
|
||||
#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()
|
||||
Select Case m_Type
|
||||
Case ManagePartType.IMPORT
|
||||
Dim sErr As New List(Of String)
|
||||
' verifico che tutti i pezzi abbiano una superficie da stampare nel layer apposito
|
||||
For Each CurrPart In m_ManagerPartList
|
||||
For Each CurrLayer In CurrPart.LayerList
|
||||
Select Case CurrLayer.Type
|
||||
Case ManagePart_Layer.LayerType.PRINT_SOLID
|
||||
If CurrLayer.EntityList.Count = 0 Then
|
||||
If sErr.Count > 0 Then sErr(sErr.Count - 1) &= Environment.NewLine
|
||||
sErr.Add(CurrPart.sName & " - No print surface defined!")
|
||||
End If
|
||||
End Select
|
||||
Next
|
||||
Next
|
||||
If sErr.Count > 0 Then
|
||||
MessageBox.Show(String.Concat(sErr), "Error")
|
||||
Return
|
||||
Else
|
||||
' Creo pezzi e layer necessari
|
||||
For ManagePart_PartIndex = 0 To m_ManagerPartList.Count - 1
|
||||
Dim ManagePart_Part As ManagePart_Part = m_ManagerPartList(ManagePart_PartIndex)
|
||||
Dim frImportedPart As New Frame3d
|
||||
EgtGetGroupGlobFrame(m_nImportedPartId, frImportedPart)
|
||||
Dim nPartId As Integer = EgtCreateGroup(GDB_ID.ROOT, frImportedPart)
|
||||
EgtSetName(nPartId, PART)
|
||||
Dim nFrameId As Integer = GDB_ID.NULL
|
||||
Dim b3PrintSolid As New BBox3d
|
||||
Dim nPrintPartLayerId As Integer = GDB_ID.NULL
|
||||
Dim PrintSolidEntity As PartManager_GeomEntity = Nothing
|
||||
Dim nRibsLayerId As Integer = GDB_ID.NULL
|
||||
Dim nShellNumberLayerId As Integer = GDB_ID.NULL
|
||||
Dim nAuxSolidsLayerId As Integer = GDB_ID.NULL
|
||||
Dim nMachStartLayerId As Integer = GDB_ID.NULL
|
||||
Dim nOthersLayerId As Integer = GDB_ID.NULL
|
||||
For Each ManagePart_Layer In ManagePart_Part.LayerList
|
||||
Select Case ManagePart_Layer.Type
|
||||
Case ManagePart_Layer.LayerType.PRINT_SOLID
|
||||
nPrintPartLayerId = EgtCreateGroup(nPartId)
|
||||
EgtSetName(nPrintPartLayerId, PRINT_SOLID)
|
||||
EgtSetColor(nPrintPartLayerId, GeomEntityColors.c3Print)
|
||||
If ManagePart_Layer.EntityList.Count > 0 Then
|
||||
PrintSolidEntity = ManagePart_Layer.EntityList(0)
|
||||
EgtRelocateGlob(PrintSolidEntity.nId, nPrintPartLayerId, GDB_POS.LAST_SON)
|
||||
' calcolo box superficie per creazione riferimento
|
||||
EgtGetBBoxGlob(PrintSolidEntity.nId, GDB_BB.STANDARD, b3PrintSolid)
|
||||
' elimino colore entita'
|
||||
EgtResetColor(PrintSolidEntity.nId)
|
||||
If PrintSolidEntity.sName <> PrintSolidEntity.nId.ToString() Then
|
||||
EgtSetInfo(PrintSolidEntity.nId, ENTITY_NAME, PrintSolidEntity.sName)
|
||||
End If
|
||||
End If
|
||||
Case ManagePart_Layer.LayerType.MACH_START
|
||||
nMachStartLayerId = EgtCreateGroup(nPartId)
|
||||
EgtSetName(nMachStartLayerId, LAY_MACH_START)
|
||||
EgtSetColor(nMachStartLayerId, GeomEntityColors.c3MachStart)
|
||||
Dim nMachStartId As Integer = GDB_ID.NULL
|
||||
If ManagePart_Layer.EntityList.Count > 0 Then
|
||||
For Each PartManager_GeomEntity In ManagePart_Layer.EntityList
|
||||
' se punto o curva compo
|
||||
Dim EntityType As GDB_TY = EgtGetType(PartManager_GeomEntity.nId)
|
||||
Select Case EntityType
|
||||
Case GDB_TY.GEO_POINT, GDB_TY.CRV_COMPO
|
||||
' gli cambio layer
|
||||
EgtRelocateGlob(PartManager_GeomEntity.nId, nMachStartLayerId, GDB_POS.LAST_SON)
|
||||
nMachStartId = PartManager_GeomEntity.nId
|
||||
Case GDB_TY.CRV_ARC, GDB_TY.CRV_BEZ, GDB_TY.CRV_LINE
|
||||
' altrimenti la trasformo in curva compo
|
||||
nMachStartId = EgtCreateCurveCompo(nMachStartLayerId, PartManager_GeomEntity.nId, True)
|
||||
End Select
|
||||
EgtSetName(nMachStartId, START_GEOM)
|
||||
' elimino colore entita'
|
||||
EgtResetColor(nMachStartId)
|
||||
If PartManager_GeomEntity.sName <> PartManager_GeomEntity.nId.ToString() Then
|
||||
EgtSetInfo(PartManager_GeomEntity.nId, ENTITY_NAME, PartManager_GeomEntity.sName)
|
||||
End If
|
||||
Next
|
||||
Else
|
||||
' creo punto di partenza
|
||||
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)
|
||||
EgtSetName(nMachStartId, START_GEOM)
|
||||
' elimino colore entita'
|
||||
EgtResetColor(nMachStartId)
|
||||
End If
|
||||
Case ManagePart_Layer.LayerType.RIBS
|
||||
nRibsLayerId = EgtCreateGroup(nPartId)
|
||||
EgtSetName(nRibsLayerId, LAY_RIBS)
|
||||
EgtSetColor(nRibsLayerId, GeomEntityColors.c3Rib)
|
||||
Dim nRibsIndex As Integer = 1
|
||||
For Each PartManager_GeomEntity In ManagePart_Layer.EntityList
|
||||
EgtSetInfo(PartManager_GeomEntity.nId, KEY_RIB_TYPE, RibEntity.RibTypes.FROMIMPORT)
|
||||
EgtSetInfo(PartManager_GeomEntity.nId, RIB_ID, nRibsIndex)
|
||||
EgtRelocateGlob(PartManager_GeomEntity.nId, nRibsLayerId, GDB_POS.LAST_SON)
|
||||
' elimino colore entita'
|
||||
EgtResetColor(PartManager_GeomEntity.nId)
|
||||
If PartManager_GeomEntity.sName <> PartManager_GeomEntity.nId.ToString() Then
|
||||
EgtSetInfo(PartManager_GeomEntity.nId, ENTITY_NAME, PartManager_GeomEntity.sName)
|
||||
End If
|
||||
nRibsIndex += 1
|
||||
Next
|
||||
Case ManagePart_Layer.LayerType.SHELL_NUMBER
|
||||
nShellNumberLayerId = EgtCreateGroup(nPartId)
|
||||
EgtSetName(nShellNumberLayerId, LAY_SHELL_NBR)
|
||||
EgtSetColor(nShellNumberLayerId, GeomEntityColors.c3ShellNumber)
|
||||
For Each PartManager_GeomEntity In ManagePart_Layer.EntityList
|
||||
EgtSetInfo(PartManager_GeomEntity.nId, KEY_SHELLNBR_TYPE, ShellNumberEntity.ShellNumberTypes.FROMIMPORT)
|
||||
EgtRelocateGlob(PartManager_GeomEntity.nId, nShellNumberLayerId, GDB_POS.LAST_SON)
|
||||
' elimino colore entita'
|
||||
EgtResetColor(PartManager_GeomEntity.nId)
|
||||
If PartManager_GeomEntity.sName <> PartManager_GeomEntity.nId.ToString() Then
|
||||
EgtSetInfo(PartManager_GeomEntity.nId, ENTITY_NAME, PartManager_GeomEntity.sName)
|
||||
End If
|
||||
Next
|
||||
Case ManagePart_Layer.LayerType.AUX_SOLIDS
|
||||
nAuxSolidsLayerId = EgtCreateGroup(nPartId)
|
||||
EgtSetName(nAuxSolidsLayerId, LAY_AUX_SOLIDS)
|
||||
EgtSetColor(nAuxSolidsLayerId, GeomEntityColors.c3AuxSolids)
|
||||
For Each PartManager_GeomEntity In ManagePart_Layer.EntityList
|
||||
EgtSetInfo(PartManager_GeomEntity.nId, KEY_AUXSOLID_TYPE, RibEntity.RibTypes.FROMIMPORT)
|
||||
EgtRelocateGlob(PartManager_GeomEntity.nId, nAuxSolidsLayerId, GDB_POS.LAST_SON)
|
||||
' elimino colore entita'
|
||||
EgtResetColor(PartManager_GeomEntity.nId)
|
||||
If PartManager_GeomEntity.sName <> PartManager_GeomEntity.nId.ToString() Then
|
||||
EgtSetInfo(PartManager_GeomEntity.nId, ENTITY_NAME, PartManager_GeomEntity.sName)
|
||||
End If
|
||||
Next
|
||||
Case ManagePart_Layer.LayerType.OTHERS
|
||||
nOthersLayerId = EgtCreateGroup(nPartId)
|
||||
EgtSetName(nOthersLayerId, LAY_OTHERS)
|
||||
EgtSetColor(nOthersLayerId, GeomEntityColors.c3Others)
|
||||
For Each PartManager_GeomEntity In ManagePart_Layer.EntityList
|
||||
EgtRelocateGlob(PartManager_GeomEntity.nId, nOthersLayerId, GDB_POS.LAST_SON)
|
||||
' elimino colore entita'
|
||||
EgtResetColor(PartManager_GeomEntity.nId)
|
||||
If PartManager_GeomEntity.sName <> PartManager_GeomEntity.nId.ToString() Then
|
||||
EgtSetInfo(PartManager_GeomEntity.nId, ENTITY_NAME, PartManager_GeomEntity.sName)
|
||||
End If
|
||||
Next
|
||||
If ManagePart_PartIndex = 0 Then
|
||||
For Each PartManager_GeomEntity In ImportedEntityList
|
||||
' se curva
|
||||
Dim EntityType As GDB_TY = EgtGetType(PartManager_GeomEntity.nId)
|
||||
Select Case EntityType
|
||||
Case GDB_TY.CRV_ARC, GDB_TY.CRV_BEZ, GDB_TY.CRV_LINE
|
||||
' la trasformo in curva compo
|
||||
Dim nOtherId As Integer = EgtCreateCurveCompo(nOthersLayerId, PartManager_GeomEntity.nId, True)
|
||||
' elimino colore entita'
|
||||
EgtResetColor(PartManager_GeomEntity.nId)
|
||||
If PartManager_GeomEntity.sName <> PartManager_GeomEntity.nId.ToString() Then
|
||||
EgtSetInfo(nOtherId, ENTITY_NAME, PartManager_GeomEntity.sName)
|
||||
End If
|
||||
Case Else
|
||||
' altrimenti la sposto solamente
|
||||
EgtRelocateGlob(PartManager_GeomEntity.nId, nOthersLayerId, GDB_POS.LAST_SON)
|
||||
' elimino colore entita'
|
||||
EgtResetColor(PartManager_GeomEntity.nId)
|
||||
If PartManager_GeomEntity.sName <> PartManager_GeomEntity.nId.ToString() Then
|
||||
EgtSetInfo(PartManager_GeomEntity.nId, ENTITY_NAME, PartManager_GeomEntity.sName)
|
||||
End If
|
||||
End Select
|
||||
Next
|
||||
End If
|
||||
End Select
|
||||
Next
|
||||
' aggiungo layer riferimento
|
||||
Dim nReferenceLayerId As Integer = EgtCreateGroup(nPartId)
|
||||
EgtSetName(nReferenceLayerId, LAY_REFERENCE)
|
||||
EgtSetInfo(nReferenceLayerId, KEY_REFERENCE, ReferenceBtn.References.BL)
|
||||
' appoggio il pezzo sulla tavola
|
||||
EgtMove(nPartId, New Vector3d(0, 0, -b3PrintSolid.Min.z))
|
||||
' lo aggiungo a lista pezzi
|
||||
Dim sFilePath As String = ""
|
||||
EgtGetInfo(m_nImportedPartId, FILE_PATH, sFilePath)
|
||||
EgtSetInfo(nPartId, FILE_PATH, sFilePath)
|
||||
EgtSetInfo(nPartId, PART_NAME, ManagePart_Part.sName)
|
||||
EgtSetInfo(nPartId, "PartOnTable", 1)
|
||||
Dim NewPart As New Print3dPartVM(nPartId, nPrintPartLayerId, nReferenceLayerId, nFrameId, nMachStartLayerId, nRibsLayerId, nShellNumberLayerId, nAuxSolidsLayerId, nOthersLayerId, sFilePath)
|
||||
Map.refTopPanelVM.PartList.Add(NewPart)
|
||||
' aggiorno riferimento
|
||||
Map.refReferencePanelVM.UpdateFramePosition(NewPart)
|
||||
Next
|
||||
End If
|
||||
'EgtAddMachGroup("3dPrint")
|
||||
'EgtSetTable("Tab")
|
||||
|
||||
'Dim nRawId As Integer = EgtAddRawPart(b3PrintSolid.Min, b3PrintSolid.DimX, b3PrintSolid.DimY, b3PrintSolid.DimZ, New Color3d(128, 128, 128, 30))
|
||||
'EgtAddPartToRawPart(nPartId, b3PrintSolid.Min, nRawId)
|
||||
'EgtMoveToCornerRawPart(nRawId, New Point3d(dPosX, dPosY, 0), MCH_CR.BL)
|
||||
|
||||
'EgtResetCurrMachGroup()
|
||||
|
||||
' seleziono ultimo pezzo aggiunto
|
||||
Map.refTopPanelVM.SelLastPart()
|
||||
' elimino vecchio pezzo d'importazione
|
||||
EgtErase(m_nImportedPartId)
|
||||
|
||||
Case ManagePartType.MODIFY
|
||||
' nulla da fare
|
||||
End Select
|
||||
EgtDeselectAll()
|
||||
EgtDraw()
|
||||
' ripristino modalita' standard
|
||||
Map.refTopPanelVM.SelPage = Pages.MODIFY
|
||||
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()
|
||||
' elimino pezzo importato
|
||||
EgtErase(m_nImportedPartId)
|
||||
EgtDeselectAll()
|
||||
EgtDraw()
|
||||
' se ci sono pezzi
|
||||
If Map.refTopPanelVM.PartList.Count > 0 Then
|
||||
' ripristino modalita' standard
|
||||
Map.refTopPanelVM.SelPage = Pages.MODIFY
|
||||
Else
|
||||
Map.refTopPanelVM.SelPage = Pages.NULL
|
||||
End If
|
||||
End Sub
|
||||
|
||||
#End Region ' Cancel
|
||||
|
||||
#End Region ' COMMANDS
|
||||
|
||||
End Class
|
||||
@@ -21,7 +21,7 @@ Public Class Material
|
||||
End Get
|
||||
End Property
|
||||
Friend Sub UpdateIsModified()
|
||||
m_bIsModified = m_CathegoryList.Any(Function(x) x.MaterialParamList.Any(Function(y) y.bIsModified))
|
||||
m_bIsModified = m_CathegoryList.Any(Function(x) x.MaterialParamList.Any(Function(y) y.bIsModified)) OrElse bIsModifiedName
|
||||
NotifyPropertyChanged(NameOf(ghName))
|
||||
End Sub
|
||||
|
||||
@@ -31,23 +31,32 @@ Public Class Material
|
||||
Return m_nIndex
|
||||
End Get
|
||||
End Property
|
||||
Friend Sub SetIndex(nValue As Integer)
|
||||
m_nIndex = nValue
|
||||
End Sub
|
||||
|
||||
Private m_sGUID As String
|
||||
Public ReadOnly Property sGUID As String
|
||||
Public Property sGUID As String
|
||||
Get
|
||||
Return m_sGUID
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_sGUID = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_sOrigName As String = ""
|
||||
Private m_sName As String
|
||||
Public Property sName As String
|
||||
Get
|
||||
Return m_sName
|
||||
End Get
|
||||
Set(value As String)
|
||||
Dim bIsModified As Boolean = m_sName <> value
|
||||
m_sName = value
|
||||
Map.refMaterialDbVM.SetNameVisibility(False)
|
||||
NotifyPropertyChanged(NameOf(ghName))
|
||||
If bIsModified Then UpdateIsModified()
|
||||
Map.refMaterialDbVM.SetIsEnabled(True)
|
||||
End Set
|
||||
End Property
|
||||
Public ReadOnly Property ghName As String
|
||||
@@ -55,95 +64,9 @@ Public Class Material
|
||||
Return m_sName & If(m_bIsModified, "*", "")
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_dK As Double
|
||||
Public ReadOnly Property dK As Double
|
||||
Public ReadOnly Property bIsModifiedName As Boolean
|
||||
Get
|
||||
Return m_dK
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_dC1 As Double
|
||||
Public ReadOnly Property dC1 As Double
|
||||
Get
|
||||
Return m_dC1
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_dC2 As Double
|
||||
Public ReadOnly Property dC2 As Double
|
||||
Get
|
||||
Return m_dC2
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_dDensity As Double
|
||||
Public ReadOnly Property dDensity As Double
|
||||
Get
|
||||
Return m_dDensity
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_dAMax As Double
|
||||
Public ReadOnly Property dAMax As Double
|
||||
Get
|
||||
Return m_dAMax
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_dATrg As Double
|
||||
Public ReadOnly Property dATrg As Double
|
||||
Get
|
||||
Return m_dATrg
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_dAMin As Double
|
||||
Public ReadOnly Property dAMin As Double
|
||||
Get
|
||||
Return m_dAMin
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_dBMax As Double
|
||||
Public ReadOnly Property dBMax As Double
|
||||
Get
|
||||
Return m_dBMax
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_dBTrg As Double
|
||||
Public ReadOnly Property dBTrg As Double
|
||||
Get
|
||||
Return m_dBTrg
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_dBMin As Double
|
||||
Public ReadOnly Property dBMin As Double
|
||||
Get
|
||||
Return m_dBMin
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_dKW As Double
|
||||
Friend ReadOnly Property dKW As Double
|
||||
Get
|
||||
Return m_dKW
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_dKZ As Double
|
||||
Friend ReadOnly Property dKZ As Double
|
||||
Get
|
||||
Return m_dKZ
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_dKN As Double
|
||||
Friend ReadOnly Property dKN As Double
|
||||
Get
|
||||
Return m_dKN
|
||||
Return m_sName <> m_sOrigName
|
||||
End Get
|
||||
End Property
|
||||
|
||||
@@ -152,6 +75,7 @@ Public Class Material
|
||||
m_nIndex = nIndex
|
||||
ReadMaterialParamString(nIndex, MAT_GUID, "", m_sGUID)
|
||||
ReadMaterialParamString(nIndex, MAT_NAME, "", m_sName)
|
||||
m_sOrigName = m_sName
|
||||
'EgtGetStringUtf8FromIni(nIndex, MAT_NAME, "", m_sName, sMatIniFilePath)
|
||||
m_CathegoryList.Add(New MaterialCathegory(MaterialCathegory.Cathegories.GENERAL, nIndex))
|
||||
m_CathegoryList.Add(New MaterialCathegory(MaterialCathegory.Cathegories.TEMPERATURES, nIndex))
|
||||
@@ -167,7 +91,8 @@ Public Class Material
|
||||
Sub New()
|
||||
m_nIndex = Map.refMaterialDbVM.MaterialList.Max(Function(x) x.nIndex) + 1
|
||||
m_sGUID = Guid.NewGuid.ToString()
|
||||
m_sName = "New Material Param"
|
||||
m_sName = "New Material"
|
||||
m_sOrigName = m_sName
|
||||
Dim nCopyIndex As Integer = Map.refMaterialDbVM.SelMaterial.m_nIndex
|
||||
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)
|
||||
@@ -184,27 +109,8 @@ Public Class Material
|
||||
m_bIsModified = True
|
||||
End Sub
|
||||
|
||||
Sub New(nIndex As Integer, sGUID As String, sName As String)
|
||||
m_nIndex = nIndex
|
||||
m_sName = sName
|
||||
m_sGUID = sGUID
|
||||
m_dK = ReadMaterialParamDouble(m_nIndex, MAT_K, 0)
|
||||
m_dC1 = ReadMaterialParamDouble(m_nIndex, MAT_C1, 0)
|
||||
m_dC2 = ReadMaterialParamDouble(m_nIndex, MAT_C2, 0)
|
||||
m_dDensity = ReadMaterialParamDouble(m_nIndex, MAT_DENSITY, 0)
|
||||
m_dAMax = ReadMaterialParamDouble(m_nIndex, MAT_AMAX, 0)
|
||||
m_dATrg = ReadMaterialParamDouble(m_nIndex, MAT_ATRG, 0)
|
||||
m_dAMin = ReadMaterialParamDouble(m_nIndex, MAT_AMIN, 0)
|
||||
m_dBMax = ReadMaterialParamDouble(m_nIndex, MAT_BMAX, 0)
|
||||
m_dBTrg = ReadMaterialParamDouble(m_nIndex, MAT_BTRG, 0)
|
||||
m_dBMin = ReadMaterialParamDouble(m_nIndex, MAT_BMIN, 0)
|
||||
m_dKW = ReadMaterialParamDouble(m_nIndex, MAT_KW, 0)
|
||||
m_dKZ = ReadMaterialParamDouble(m_nIndex, MAT_KZ, 0)
|
||||
m_dKN = ReadMaterialParamDouble(m_nIndex, MAT_KN, 0)
|
||||
End Sub
|
||||
|
||||
Private Sub ReadAllParams()
|
||||
'm_bSlicing45 = ReadMaterialParamDouble(m_nIndex, MAC_SLICING45, 0, CurrentMachine.sMachiningFilePath)
|
||||
'm_nSlicingType = ReadMaterialParamDouble(m_nIndex, MAC_SLICINGTYPE, 0, CurrentMachine.sMachiningFilePath)
|
||||
'm_dStrandH = ReadMaterialParamDouble(m_nIndex, MAC_STRANDH, 0, CurrentMachine.sMachiningFilePath)
|
||||
'm_dStrandW = ReadMaterialParamDouble(m_nIndex, MAC_STRANDW, 0, CurrentMachine.sMachiningFilePath)
|
||||
'm_nStrandCount = ReadMaterialParamDouble(m_nIndex, MAC_STRANDCOUNT, 0, CurrentMachine.sMachiningFilePath)
|
||||
@@ -243,6 +149,16 @@ Public Class Material
|
||||
'm_dRibsLeadOutWipeDir = ReadMaterialParamDouble(m_nIndex, MAC_RIBSLEADOUTWIPEDIR, 0, CurrentMachine.sMachiningFilePath)
|
||||
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()
|
||||
If bIsModified Then
|
||||
' salvo tutti i parametri su orig
|
||||
@@ -255,15 +171,17 @@ Public Class Material
|
||||
End Sub
|
||||
|
||||
Private Sub SaveParams()
|
||||
SaveName()
|
||||
For Each Cathegory In m_CathegoryList
|
||||
Cathegory.SaveParams()
|
||||
Next
|
||||
End Sub
|
||||
|
||||
Friend Sub ResetModification()
|
||||
ResetName()
|
||||
If bIsModified Then
|
||||
' annullo le modifiche di tutti i parametri
|
||||
SaveParams()
|
||||
ResetParams()
|
||||
' resetto stato di modificata
|
||||
UpdateIsModified()
|
||||
End If
|
||||
@@ -275,12 +193,12 @@ Public Class Material
|
||||
Next
|
||||
End Sub
|
||||
|
||||
Friend Sub WriteParamsOnDb(nIndex As Integer)
|
||||
WriteMaterialParam(nIndex, MAT_GUID, m_sGUID)
|
||||
WriteMaterialParam(nIndex, MAT_NAME, m_sName)
|
||||
Friend Sub WriteParamsOnDb(nIndex As Integer, Optional sFilePath As String = "")
|
||||
WriteMaterialParam(nIndex, MAT_GUID, m_sGUID, sFilePath)
|
||||
WriteMaterialParam(nIndex, MAT_NAME, m_sName, sFilePath)
|
||||
' EgtWriteStringUtf8toIni(nIndex, MAT_NAME, m_sName)
|
||||
For Each Cathegory In m_CathegoryList
|
||||
Cathegory.WriteParamOnDb(nIndex)
|
||||
Cathegory.WriteParamOnDb(nIndex, sFilePath)
|
||||
Next
|
||||
End Sub
|
||||
|
||||
@@ -323,6 +241,54 @@ Public Class MaterialIndex
|
||||
m_sName = sName
|
||||
End Sub
|
||||
|
||||
Friend Function GetSelMaterialData(Param As MaterialParam.Params) As Double
|
||||
Dim sParamKey As String = ""
|
||||
Dim dDefault As Double = 0
|
||||
Select Case Param
|
||||
Case MaterialParam.Params.T1
|
||||
sParamKey = MAT_T1
|
||||
Case MaterialParam.Params.T2
|
||||
sParamKey = MAT_T2
|
||||
Case MaterialParam.Params.T3
|
||||
sParamKey = MAT_T3
|
||||
Case MaterialParam.Params.T4
|
||||
sParamKey = MAT_T4
|
||||
Case MaterialParam.Params.T5
|
||||
sParamKey = MAT_T5
|
||||
Case MaterialParam.Params.K_EXTRUSION
|
||||
sParamKey = MAT_KEXTRUSION
|
||||
dDefault = 100
|
||||
Case MaterialParam.Params.K_LAY_TIME
|
||||
sParamKey = MAT_KLAYERTIME
|
||||
dDefault = 100
|
||||
Case MaterialParam.Params.C1
|
||||
sParamKey = MAT_C1
|
||||
Case MaterialParam.Params.C2
|
||||
sParamKey = MAT_C2
|
||||
Case MaterialParam.Params.DENSITY
|
||||
sParamKey = MAT_DENSITY
|
||||
Case MaterialParam.Params.AMAX
|
||||
sParamKey = MAT_AMAX
|
||||
Case MaterialParam.Params.ATRG
|
||||
sParamKey = MAT_ATRG
|
||||
Case MaterialParam.Params.AMIN
|
||||
sParamKey = MAT_AMIN
|
||||
Case MaterialParam.Params.BMAX
|
||||
sParamKey = MAT_BMAX
|
||||
Case MaterialParam.Params.BTRG
|
||||
sParamKey = MAT_BTRG
|
||||
Case MaterialParam.Params.BMIN
|
||||
sParamKey = MAT_BMIN
|
||||
Case MaterialParam.Params.KW
|
||||
sParamKey = MAT_KW
|
||||
Case MaterialParam.Params.KZ
|
||||
sParamKey = MAT_KZ
|
||||
Case MaterialParam.Params.KN
|
||||
sParamKey = MAT_KN
|
||||
End Select
|
||||
Return ReadMaterialParamDouble(m_nIndex, sParamKey, dDefault)
|
||||
End Function
|
||||
|
||||
End Class
|
||||
|
||||
Public Class MaterialCathegory
|
||||
@@ -377,7 +343,8 @@ Public Class MaterialCathegory
|
||||
Select Case m_Type
|
||||
Case Cathegories.GENERAL
|
||||
m_sName = "General"
|
||||
m_MaterialParamList = New List(Of MaterialParam)({New NumericMaterialParam(MaterialParam.Params.K, nIndex),
|
||||
m_MaterialParamList = New List(Of MaterialParam)({New NumericMaterialParam(MaterialParam.Params.K_EXTRUSION, nIndex),
|
||||
New NumericMaterialParam(MaterialParam.Params.K_LAY_TIME, nIndex),
|
||||
New NumericMaterialParam(MaterialParam.Params.DENSITY, nIndex),
|
||||
New StringMaterialParam(MaterialParam.Params.ORIG, nIndex)})
|
||||
m_Cathegory_Visibility = Visibility.Visible
|
||||
@@ -419,9 +386,9 @@ Public Class MaterialCathegory
|
||||
Next
|
||||
End Sub
|
||||
|
||||
Friend Sub WriteParamOnDb(nIndex As Integer)
|
||||
Friend Sub WriteParamOnDb(nIndex As Integer, Optional sFilePath As String = "")
|
||||
For Each Param In m_MaterialParamList
|
||||
Param.WriteParamOnDb(nIndex)
|
||||
Param.WriteParamOnDb(nIndex, sFilePath)
|
||||
Next
|
||||
End Sub
|
||||
|
||||
@@ -437,20 +404,21 @@ Public MustInherit Class MaterialParam
|
||||
T3 = 5
|
||||
T4 = 6
|
||||
T5 = 7
|
||||
K = 8
|
||||
C1 = 9
|
||||
C2 = 10
|
||||
DENSITY = 11
|
||||
AMAX = 12
|
||||
ATRG = 13
|
||||
AMIN = 14
|
||||
BMAX = 15
|
||||
BTRG = 16
|
||||
BMIN = 17
|
||||
KW = 18
|
||||
KZ = 19
|
||||
KN = 20
|
||||
ORIG = 21
|
||||
K_EXTRUSION = 8
|
||||
K_LAY_TIME = 9
|
||||
C1 = 10
|
||||
C2 = 11
|
||||
DENSITY = 12
|
||||
AMAX = 13
|
||||
ATRG = 14
|
||||
AMIN = 15
|
||||
BMAX = 16
|
||||
BTRG = 17
|
||||
BMIN = 18
|
||||
KW = 19
|
||||
KZ = 20
|
||||
KN = 21
|
||||
ORIG = 22
|
||||
End Enum
|
||||
|
||||
Private m_Type As Params
|
||||
@@ -482,8 +450,10 @@ Public MustInherit Class MaterialParam
|
||||
m_sName = "Temperature 4"
|
||||
Case Params.T5
|
||||
m_sName = "Temperature 5"
|
||||
Case Params.K
|
||||
m_sName = "Constant"
|
||||
Case Params.K_EXTRUSION
|
||||
m_sName = "Flow Multiplier [%]"
|
||||
Case Params.K_LAY_TIME
|
||||
m_sName = "Layer Time Multiplier [%]"
|
||||
Case Params.C1
|
||||
m_sName = "C1"
|
||||
Case Params.C2
|
||||
@@ -514,7 +484,7 @@ Public MustInherit Class MaterialParam
|
||||
End Sub
|
||||
|
||||
|
||||
Friend MustOverride Sub WriteParamOnDb(nIndex As Integer)
|
||||
Friend MustOverride Sub WriteParamOnDb(nIndex As Integer, Optional sFilePath As String = "")
|
||||
Friend MustOverride Sub SaveParam()
|
||||
Friend MustOverride Sub ResetParam()
|
||||
|
||||
@@ -571,8 +541,11 @@ Public Class NumericMaterialParam
|
||||
Case Params.T5
|
||||
m_dValue = ReadMaterialParamDouble(nIndex, MAT_T5, 0)
|
||||
m_bIsLen = False
|
||||
Case Params.K
|
||||
m_dValue = ReadMaterialParamDouble(nIndex, MAT_K, 0)
|
||||
Case Params.K_EXTRUSION
|
||||
m_dValue = ReadMaterialParamDouble(nIndex, MAT_KEXTRUSION, 100)
|
||||
m_bIsLen = False
|
||||
Case Params.K_LAY_TIME
|
||||
m_dValue = ReadMaterialParamDouble(nIndex, MAT_KLAYERTIME, 100)
|
||||
m_bIsLen = False
|
||||
Case Params.C1
|
||||
m_dValue = ReadMaterialParamDouble(nIndex, MAT_C1, 0)
|
||||
@@ -614,7 +587,7 @@ Public Class NumericMaterialParam
|
||||
m_dOrigValue = m_dValue
|
||||
End Sub
|
||||
|
||||
Friend Overrides Sub WriteParamOnDb(nIndex As Integer)
|
||||
Friend Overrides Sub WriteParamOnDb(nIndex As Integer, Optional sFilePath As String = "")
|
||||
Dim sWriteValue As String = ""
|
||||
If m_bIsLen Then
|
||||
sWriteValue = LenToString(m_dValue, 5)
|
||||
@@ -623,41 +596,43 @@ Public Class NumericMaterialParam
|
||||
End If
|
||||
Select Case Type
|
||||
Case Params.T1
|
||||
WriteMaterialParam(nIndex, MAT_T1, sWriteValue)
|
||||
WriteMaterialParam(nIndex, MAT_T1, sWriteValue, sFilePath)
|
||||
Case Params.T2
|
||||
WriteMaterialParam(nIndex, MAT_T2, sWriteValue)
|
||||
WriteMaterialParam(nIndex, MAT_T2, sWriteValue, sFilePath)
|
||||
Case Params.T3
|
||||
WriteMaterialParam(nIndex, MAT_T3, sWriteValue)
|
||||
WriteMaterialParam(nIndex, MAT_T3, sWriteValue, sFilePath)
|
||||
Case Params.T4
|
||||
WriteMaterialParam(nIndex, MAT_T4, sWriteValue)
|
||||
WriteMaterialParam(nIndex, MAT_T4, sWriteValue, sFilePath)
|
||||
Case Params.T5
|
||||
WriteMaterialParam(nIndex, MAT_T5, sWriteValue)
|
||||
Case Params.K
|
||||
WriteMaterialParam(nIndex, MAT_K, sWriteValue)
|
||||
WriteMaterialParam(nIndex, MAT_T5, sWriteValue, sFilePath)
|
||||
Case Params.K_EXTRUSION
|
||||
WriteMaterialParam(nIndex, MAT_KEXTRUSION, sWriteValue, sFilePath)
|
||||
Case Params.K_LAY_TIME
|
||||
WriteMaterialParam(nIndex, MAT_KLAYERTIME, sWriteValue, sFilePath)
|
||||
Case Params.C1
|
||||
WriteMaterialParam(nIndex, MAT_C1, sWriteValue)
|
||||
WriteMaterialParam(nIndex, MAT_C1, sWriteValue, sFilePath)
|
||||
Case Params.C2
|
||||
WriteMaterialParam(nIndex, MAT_C2, sWriteValue)
|
||||
WriteMaterialParam(nIndex, MAT_C2, sWriteValue, sFilePath)
|
||||
Case Params.DENSITY
|
||||
WriteMaterialParam(nIndex, MAT_DENSITY, sWriteValue)
|
||||
WriteMaterialParam(nIndex, MAT_DENSITY, sWriteValue, sFilePath)
|
||||
Case Params.AMAX
|
||||
WriteMaterialParam(nIndex, MAT_AMAX, sWriteValue)
|
||||
WriteMaterialParam(nIndex, MAT_AMAX, sWriteValue, sFilePath)
|
||||
Case Params.ATRG
|
||||
WriteMaterialParam(nIndex, MAT_ATRG, sWriteValue)
|
||||
WriteMaterialParam(nIndex, MAT_ATRG, sWriteValue, sFilePath)
|
||||
Case Params.AMIN
|
||||
WriteMaterialParam(nIndex, MAT_AMIN, sWriteValue)
|
||||
WriteMaterialParam(nIndex, MAT_AMIN, sWriteValue, sFilePath)
|
||||
Case Params.BMAX
|
||||
WriteMaterialParam(nIndex, MAT_BMAX, sWriteValue)
|
||||
WriteMaterialParam(nIndex, MAT_BMAX, sWriteValue, sFilePath)
|
||||
Case Params.BTRG
|
||||
WriteMaterialParam(nIndex, MAT_BTRG, sWriteValue)
|
||||
WriteMaterialParam(nIndex, MAT_BTRG, sWriteValue, sFilePath)
|
||||
Case Params.BMIN
|
||||
WriteMaterialParam(nIndex, MAT_BMIN, sWriteValue)
|
||||
WriteMaterialParam(nIndex, MAT_BMIN, sWriteValue, sFilePath)
|
||||
Case Params.KW
|
||||
WriteMaterialParam(nIndex, MAT_KW, sWriteValue)
|
||||
WriteMaterialParam(nIndex, MAT_KW, sWriteValue, sFilePath)
|
||||
Case Params.KZ
|
||||
WriteMaterialParam(nIndex, MAT_KZ, sWriteValue)
|
||||
WriteMaterialParam(nIndex, MAT_KZ, sWriteValue, sFilePath)
|
||||
Case Params.KN
|
||||
WriteMaterialParam(nIndex, MAT_KN, sWriteValue)
|
||||
WriteMaterialParam(nIndex, MAT_KN, sWriteValue, sFilePath)
|
||||
End Select
|
||||
End Sub
|
||||
|
||||
@@ -715,10 +690,10 @@ Public Class StringMaterialParam
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_bIsReadOnly As Boolean = True
|
||||
Public ReadOnly Property bIsReadOnly As Boolean
|
||||
Private m_OrigButton_Visibility As Visibility = Visibility.Collapsed
|
||||
Public ReadOnly Property OrigButton_Visibility As Visibility
|
||||
Get
|
||||
Return m_bIsReadOnly
|
||||
Return m_OrigButton_Visibility
|
||||
End Get
|
||||
End Property
|
||||
|
||||
@@ -729,15 +704,18 @@ Public Class StringMaterialParam
|
||||
End Get
|
||||
End Property
|
||||
|
||||
' Definizione comandi
|
||||
Private m_cmdOriginal As ICommand
|
||||
|
||||
Sub New(Type As Params, nIndex As Integer)
|
||||
MyBase.New(Type)
|
||||
Select Case Type
|
||||
Case Params.ORIG
|
||||
Dim sOrigGUID As String = ""
|
||||
ReadMaterialParamString(nIndex, MAT_ORIG, "", sOrigGUID)
|
||||
If sOrigGUID = "***" Then
|
||||
m_sGUID = sOrigGUID
|
||||
m_sValue = sOrigGUID
|
||||
If sOrigGUID = ORIG_MATERIAL Then
|
||||
m_sGUID = ORIG_MATERIAL
|
||||
m_sValue = ORIG_MATERIAL
|
||||
' se livello alto, lo visualizzo comunque
|
||||
If Map.refMainWindowVM.MainWindowM.nUserLevel >= 5 Then
|
||||
m_String_Visibility = Visibility.Visible
|
||||
@@ -757,15 +735,15 @@ Public Class StringMaterialParam
|
||||
End Select
|
||||
' verifico chiave per assegnare readonly
|
||||
If Map.refMainWindowVM.MainWindowM.nUserLevel >= 5 Then
|
||||
m_bIsReadOnly = False
|
||||
m_OrigButton_Visibility = Visibility.Visible
|
||||
End If
|
||||
m_sOrigValue = m_sValue
|
||||
End Sub
|
||||
|
||||
Friend Overrides Sub WriteParamOnDb(nIndex As Integer)
|
||||
Friend Overrides Sub WriteParamOnDb(nIndex As Integer, Optional sFilePath As String = "")
|
||||
Select Case Type
|
||||
Case Params.ORIG
|
||||
WriteMaterialParam(nIndex, MAT_ORIG, m_sGUID)
|
||||
WriteMaterialParam(nIndex, MAT_ORIG, m_sGUID, sFilePath)
|
||||
End Select
|
||||
End Sub
|
||||
|
||||
@@ -777,6 +755,31 @@ Public Class StringMaterialParam
|
||||
m_sValue = m_sOrigValue
|
||||
End Sub
|
||||
|
||||
#Region "COMMANDS"
|
||||
|
||||
#Region "Original"
|
||||
|
||||
Public ReadOnly Property Original_Command As ICommand
|
||||
Get
|
||||
If m_cmdOriginal Is Nothing Then
|
||||
m_cmdOriginal = New Command(AddressOf Original)
|
||||
End If
|
||||
Return m_cmdOriginal
|
||||
End Get
|
||||
End Property
|
||||
|
||||
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
|
||||
m_sGUID = ORIG_MATERIAL
|
||||
m_sValue = ORIG_MATERIAL
|
||||
NotifyPropertyChanged(NameOf(sValue))
|
||||
End If
|
||||
End Sub
|
||||
|
||||
#End Region ' Original
|
||||
|
||||
#End Region ' COMMANDS
|
||||
|
||||
End Class
|
||||
|
||||
Public Class ComboMaterialParam
|
||||
@@ -824,10 +827,10 @@ Public Class ComboMaterialParam
|
||||
m_OrigSelValue = m_SelValue
|
||||
End Sub
|
||||
|
||||
Friend Overrides Sub WriteParamOnDb(nIndex As Integer)
|
||||
Friend Overrides Sub WriteParamOnDb(nIndex As Integer, Optional sFilePath As String = "")
|
||||
Select Case Type
|
||||
'Case Params.STRANDORDER
|
||||
' WriteMaterialParam(nIndex, MAC_STRANDORDER, m_SelValue.Id)
|
||||
' WriteMaterialParam(nIndex, MAC_STRANDORDER, m_SelValue.Id, sFilePath)
|
||||
End Select
|
||||
End Sub
|
||||
|
||||
@@ -871,16 +874,12 @@ Public Class CheckMaterialParam
|
||||
Sub New(Type As Params, nIndex As Integer)
|
||||
MyBase.New(Type)
|
||||
Select Case Type
|
||||
'Case Params.SLICING45
|
||||
' m_bValue = ReadMaterialParamDouble(nIndex, MAC_SLICING45, 0)
|
||||
End Select
|
||||
m_bOrigValue = m_bValue
|
||||
End Sub
|
||||
|
||||
Friend Overrides Sub WriteParamOnDb(nIndex As Integer)
|
||||
Friend Overrides Sub WriteParamOnDb(nIndex As Integer, Optional sFilePath As String = "")
|
||||
Select Case Type
|
||||
'Case Params.SLICING45
|
||||
' WriteMaterialParam(nIndex, MAC_SLICING45, If(m_bValue, 1, 0))
|
||||
End Select
|
||||
End Sub
|
||||
|
||||
|
||||
@@ -13,39 +13,70 @@
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
<UniformGrid Rows="1">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Button Content="Copy"
|
||||
Command="{Binding Copy_Command}"
|
||||
IsEnabled="{Binding IsEnabled}"
|
||||
Style="{StaticResource ToolBar_TextButton}"/>
|
||||
<Button Content="Save"
|
||||
<Button Grid.Column="1"
|
||||
Content="Save"
|
||||
Command="{Binding Save_Command}"
|
||||
IsEnabled="{Binding IsEnabled}"
|
||||
Style="{StaticResource ToolBar_TextButton}"/>
|
||||
<Button Content="Delete"
|
||||
<Button Grid.Column="2" Content="Delete"
|
||||
Command="{Binding Delete_Command}"
|
||||
IsEnabled="{Binding Delete_IsEnabled}"
|
||||
Style="{StaticResource ToolBar_TextButton}"/>
|
||||
</UniformGrid>
|
||||
<ComboBox Grid.Row="1"
|
||||
Name="MaterialCombo"
|
||||
ItemsSource="{Binding MaterialList}"
|
||||
SelectedItem="{Binding SelMaterial}"
|
||||
DisplayMemberPath="ghName"/>
|
||||
<Grid Grid.Row="2"
|
||||
Visibility="{Binding Name_Visibility}">
|
||||
<Button Grid.Column="3"
|
||||
Command="{Binding Import_Command}"
|
||||
ToolTip="{Binding ImportToolTip}"
|
||||
IsEnabled="{Binding ImpExp_IsEnabled}"
|
||||
Style="{StaticResource ToolBar_Button}">
|
||||
<Image Source="/Resources/MachiningDB/Import.png" Stretch="Uniform"/>
|
||||
</Button>
|
||||
<Button Grid.Column="4"
|
||||
Command="{Binding Export_Command}"
|
||||
ToolTip="{Binding ImportToolTip}"
|
||||
IsEnabled="{Binding ImpExp_IsEnabled}"
|
||||
Style="{StaticResource ToolBar_Button}">
|
||||
<Image Source="/Resources/MachiningDB/Export.png" Stretch="Uniform"/>
|
||||
</Button>
|
||||
</Grid>
|
||||
<Grid Grid.Row="1">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="2*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock Text="{Binding Name_Msg}"/>
|
||||
<EgtWPFLib5:EgtTextBox Grid.Column="1"
|
||||
Text="{Binding SelectedItem.sName, ElementName=MaterialCombo, UpdateSourceTrigger=Explicit}"/>
|
||||
<ComboBox Grid.Row="1"
|
||||
Name="MaterialCombo"
|
||||
ItemsSource="{Binding MaterialList}"
|
||||
SelectedItem="{Binding SelMaterial}"
|
||||
DisplayMemberPath="ghName"
|
||||
Visibility="{Binding Combo_Visibility}"
|
||||
Style="{StaticResource FeatureComboBox}"/>
|
||||
<EgtWPFLib5:EgtTextBox Text="{Binding SelectedItem.sName, ElementName=MaterialCombo, UpdateSourceTrigger=Explicit}"
|
||||
ExplicitUpdateSource="EnterKeyPressOrLostFocus"
|
||||
IsExplicitFocused="{Binding UserShouldEditValueNow}"
|
||||
Visibility="{Binding Name_Visibility}"/>
|
||||
<Button Grid.Column="1"
|
||||
Command="{Binding EditName_Command}"
|
||||
Style="{StaticResource ToolBar_Button}">
|
||||
<Image Source="/Resources/TopPanel/Edit.png"/>
|
||||
</Button>
|
||||
</Grid>
|
||||
<ScrollViewer Grid.Row="3"
|
||||
<ScrollViewer Grid.Row="2"
|
||||
VerticalScrollBarVisibility="Auto"
|
||||
HorizontalScrollBarVisibility="Disabled">
|
||||
<ItemsControl Grid.Row="1"
|
||||
ItemsSource="{Binding SelectedItem.CathegoryList, ElementName=MaterialCombo}">
|
||||
ItemsSource="{Binding SelectedItem.CathegoryList, ElementName=MaterialCombo}"
|
||||
IsEnabled="{Binding IsEnabled}">
|
||||
<ItemsControl.ItemsPanel>
|
||||
<ItemsPanelTemplate>
|
||||
<StackPanel Orientation="Vertical"/>
|
||||
@@ -80,15 +111,6 @@
|
||||
<TextBlock Text="{Binding sName}"/>
|
||||
<TextBox Grid.Column="1"
|
||||
Text="{Binding dValue}"/>
|
||||
<!--<Button Grid.Column="2"
|
||||
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>
|
||||
</DataTemplate>
|
||||
<DataTemplate DataType="{x:Type PrintApp:StringMaterialParam}">
|
||||
@@ -101,16 +123,15 @@
|
||||
<TextBlock Text="{Binding sName}"/>
|
||||
<TextBox Grid.Column="1"
|
||||
Text="{Binding sValue}"
|
||||
IsReadOnly="{Binding bIsReadOnly}"/>
|
||||
<!--<Button Grid.Column="2"
|
||||
Content="R"
|
||||
Command="{Binding ResetParam_Command}"
|
||||
CommandParameter="dCurrStrandH"
|
||||
IsEnabled="{Binding bCurrStrandH_IsModified}"
|
||||
IsReadOnly="True"/>
|
||||
<Button Grid.Column="2"
|
||||
Content="O"
|
||||
Command="{Binding Original_Command}"
|
||||
VerticalContentAlignment="Center"
|
||||
HorizontalContentAlignment="Center"
|
||||
Margin="5,0,0,0"
|
||||
Style="{StaticResource ToolBar_SmallButton}"/>-->
|
||||
Visibility="{Binding OrigButton_Visibility}"
|
||||
Style="{StaticResource ToolBar_SmallButton}"/>
|
||||
</Grid>
|
||||
</DataTemplate>
|
||||
<DataTemplate DataType="{x:Type PrintApp:ComboMaterialParam}">
|
||||
@@ -118,22 +139,12 @@
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="2*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<!--<ColumnDefinition Width="Auto"/>-->
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock Text="{Binding sName}"/>
|
||||
<ComboBox Grid.Column="1"
|
||||
ItemsSource="{Binding ValueList}"
|
||||
SelectedItem="{Binding SelValue}"
|
||||
HorizontalAlignment="Stretch"/>
|
||||
<!--<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>
|
||||
</DataTemplate>
|
||||
<DataTemplate DataType="{x:Type PrintApp:CheckMaterialParam}">
|
||||
@@ -141,22 +152,12 @@
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="2*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<!--<ColumnDefinition Width="Auto"/>-->
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock Text="{Binding sName}"/>
|
||||
<CheckBox Grid.Column="1"
|
||||
IsChecked="{Binding bValue}"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"/>
|
||||
<!--<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>
|
||||
</DataTemplate>
|
||||
</ItemsControl.Resources>
|
||||
@@ -166,9 +167,10 @@
|
||||
</ItemsControl.ItemTemplate>
|
||||
</ItemsControl>
|
||||
</ScrollViewer>
|
||||
<UniformGrid Grid.Row="4" Rows="1">
|
||||
<UniformGrid Grid.Row="3" Rows="1">
|
||||
<Button Content="Ok"
|
||||
Command="{Binding Ok_Command}"
|
||||
IsEnabled="{Binding IsEnabled}"
|
||||
Style="{StaticResource ToolBar_TextButton}"/>
|
||||
</UniformGrid>
|
||||
</Grid>
|
||||
|
||||
@@ -48,6 +48,9 @@ Public Class MaterialDbVM
|
||||
m_SelMaterial.CathegoryList(Index).Cathegory_IsExpanded = IsExpandedList(Index)
|
||||
Next
|
||||
End If
|
||||
' verifico abilitazione delete
|
||||
SetDeleteIsEnabled(Not SelMaterialIsOriginal())
|
||||
NotifyPropertyChanged(NameOf(Delete_IsEnabled))
|
||||
End Set
|
||||
End Property
|
||||
|
||||
@@ -57,10 +60,13 @@ Public Class MaterialDbVM
|
||||
Return m_Name_Visibility
|
||||
End Get
|
||||
End Property
|
||||
Friend Sub SetNameVisibility(bValue As Boolean)
|
||||
m_Name_Visibility = If(bValue, Visibility.Visible, Visibility.Collapsed)
|
||||
NotifyPropertyChanged(NameOf(Name_Visibility))
|
||||
End Sub
|
||||
|
||||
Private m_Combo_Visibility As Visibility = Visibility.Visible
|
||||
Public ReadOnly Property Combo_Visibility As Visibility
|
||||
Get
|
||||
Return m_Combo_Visibility
|
||||
End Get
|
||||
End Property
|
||||
|
||||
' variabile che indica se una qualunque lavorazione e' stata modificata
|
||||
Private m_bIsModified As Boolean
|
||||
@@ -73,11 +79,63 @@ Public Class MaterialDbVM
|
||||
m_bIsModified = value
|
||||
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
|
||||
Public ReadOnly Property Delete_IsEnabled As Boolean
|
||||
Get
|
||||
Return m_IsEnabled AndAlso m_Delete_IsEnabled
|
||||
End Get
|
||||
End Property
|
||||
Friend Sub SetDeleteIsEnabled(value As Boolean)
|
||||
If Map.refMainWindowVM.MainWindowM.nUserLevel >= 5 Then
|
||||
m_Delete_IsEnabled = True
|
||||
Else
|
||||
m_Delete_IsEnabled = value
|
||||
End If
|
||||
NotifyPropertyChanged(NameOf(Delete_IsEnabled))
|
||||
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
|
||||
|
||||
' Definizione comandi
|
||||
Private m_cmdOk As ICommand
|
||||
Private m_cmdCopy As ICommand
|
||||
Private m_cmdSave 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
|
||||
|
||||
@@ -104,9 +162,40 @@ Public Class MaterialDbVM
|
||||
Dim sCurrMaterial As String = ""
|
||||
GetMainPrivateProfileString(S_PRINTING3D, K_CURRMATERIAL, "", sCurrMaterial)
|
||||
m_SelMaterial = MaterialList.FirstOrDefault(Function(x) x.sGUID = sCurrMaterial)
|
||||
If IsNothing(m_SelMaterial) AndAlso m_MaterialList.Count > 0 Then
|
||||
m_SelMaterial = m_MaterialList(0)
|
||||
End If
|
||||
NotifyPropertyChanged(NameOf(SelMaterial))
|
||||
' verifico abilitazione delete
|
||||
If Not IsNothing(m_SelMaterial) Then
|
||||
SetDeleteIsEnabled(Not SelMaterialIsOriginal())
|
||||
NotifyPropertyChanged(NameOf(Delete_IsEnabled))
|
||||
End If
|
||||
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
|
||||
If IsNothing(m_SelMaterial) Then Return False
|
||||
' verifico abilitazione delete
|
||||
Dim General As MaterialCathegory = m_SelMaterial.CathegoryList.FirstOrDefault(Function(x) x.Type = MaterialCathegory.Cathegories.GENERAL)
|
||||
If Not IsNothing(General) Then
|
||||
Dim Original As MaterialParam = General.MaterialParamList.FirstOrDefault(Function(x) x.Type = MaterialParam.Params.ORIG)
|
||||
If Not IsNothing(Original) Then
|
||||
If DirectCast(Original, StringMaterialParam).sValue = ORIG_MATERIAL Then
|
||||
Return True
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
Return False
|
||||
End Function
|
||||
|
||||
#End Region ' METHODS
|
||||
|
||||
#Region "COMMANDS"
|
||||
@@ -135,7 +224,7 @@ Public Class MaterialDbVM
|
||||
End Select
|
||||
End If
|
||||
If m_bIsModified Then
|
||||
Dim sBakMatIniFilePath As String = Path.ChangeExtension(CurrentMachine.sMaterialsFilePath, ".bak")
|
||||
Dim sBakMatIniFilePath As String = Path.ChangeExtension(CurrentMachine.sMaterialFilePath, ".bak")
|
||||
If File.Exists(sBakMatIniFilePath) Then
|
||||
Try
|
||||
' cambio estensione in bak a file Db vecchio
|
||||
@@ -143,24 +232,24 @@ Public Class MaterialDbVM
|
||||
Catch ex As Exception
|
||||
End Try
|
||||
End If
|
||||
If File.Exists(CurrentMachine.sMaterialsFilePath) Then
|
||||
If File.Exists(CurrentMachine.sMaterialFilePath) Then
|
||||
Try
|
||||
' cambio estensione in bak a file Db vecchio
|
||||
File.Move(CurrentMachine.sMaterialsFilePath, sBakMatIniFilePath)
|
||||
File.Move(CurrentMachine.sMaterialFilePath, sBakMatIniFilePath)
|
||||
Catch ex As Exception
|
||||
End Try
|
||||
End If
|
||||
' se ancora esiste lo elimino
|
||||
If File.Exists(CurrentMachine.sMaterialsFilePath) Then
|
||||
If File.Exists(CurrentMachine.sMaterialFilePath) Then
|
||||
Try
|
||||
File.Delete(CurrentMachine.sMaterialsFilePath)
|
||||
File.Delete(CurrentMachine.sMaterialFilePath)
|
||||
Catch ex As Exception
|
||||
End Try
|
||||
End If
|
||||
' creo nuovo file
|
||||
If Not File.Exists(CurrentMachine.sMaterialsFilePath) Then
|
||||
If Not File.Exists(CurrentMachine.sMaterialFilePath) Then
|
||||
Try
|
||||
File.WriteAllLines(CurrentMachine.sMaterialsFilePath, {"; Commento per evitare BOM con UTF-8"})
|
||||
File.WriteAllLines(CurrentMachine.sMaterialFilePath, {"; Commento per evitare BOM con UTF-8"})
|
||||
Catch ex As Exception
|
||||
End Try
|
||||
End If
|
||||
@@ -181,6 +270,8 @@ Public Class MaterialDbVM
|
||||
Map.refTopPanelVM.SelMaterial = Nothing
|
||||
Map.refTopPanelVM.NotifyPropertyChanged(NameOf(Map.refTopPanelVM.SelMaterial))
|
||||
End If
|
||||
' ricarico lavorazioni per aggiorno liste materiali all'interno
|
||||
Map.refMachiningDbVM.Init()
|
||||
End If
|
||||
' ripristino modalita' standard
|
||||
Map.refTopPanelVM.SelPage = Pages.MODIFY
|
||||
@@ -248,10 +339,28 @@ Public Class MaterialDbVM
|
||||
End Property
|
||||
|
||||
Public Sub Delete()
|
||||
Dim sCheckMessage As String = "Are you sure you want to delete selected material?"
|
||||
' se materiale originale, esco
|
||||
If SelMaterialIsOriginal() Then
|
||||
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
|
||||
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!")
|
||||
Return
|
||||
End If
|
||||
End If
|
||||
' chiedo conferma
|
||||
Select Case MessageBox.Show("Sei sicuro di voler cancellare la lavorazione selezionata?", "Warning", MessageBoxButton.YesNo, MessageBoxImage.Warning)
|
||||
Select Case MessageBox.Show(sCheckMessage, "Warning", MessageBoxButton.YesNo, MessageBoxImage.Warning)
|
||||
Case MessageBoxResult.Yes
|
||||
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
|
||||
Map.refMaterialDbVM.SetIsModified(True)
|
||||
Case MessageBoxResult.No
|
||||
@@ -261,6 +370,78 @@ Public Class MaterialDbVM
|
||||
|
||||
#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 Class
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
Public Class ModifyPartPanelV
|
||||
|
||||
End Class
|
||||
@@ -1,407 +0,0 @@
|
||||
Imports System.Collections.ObjectModel
|
||||
Imports EgtUILib
|
||||
Imports EgtWPFLib5
|
||||
|
||||
Public Class ModifyPartPanelVM
|
||||
Inherits VMBase
|
||||
|
||||
'Private m_nImportedPartId As Integer = GDB_ID.NULL
|
||||
'Friend ReadOnly Property nImportedPartId As Integer
|
||||
' Get
|
||||
' Return m_nImportedPartId
|
||||
' End Get
|
||||
'End Property
|
||||
|
||||
'Private m_ImportedEntityList As New ObservableCollection(Of GeomEntity)
|
||||
'Public Property ImportedEntityList As ObservableCollection(Of GeomEntity)
|
||||
' Get
|
||||
' Return m_ImportedEntityList
|
||||
' End Get
|
||||
' Set(value As ObservableCollection(Of GeomEntity))
|
||||
' m_ImportedEntityList = value
|
||||
' End Set
|
||||
'End Property
|
||||
|
||||
'Private m_SelImportedEntity As GeomEntity
|
||||
'Public Property SelImportedEntity As GeomEntity
|
||||
' Get
|
||||
' Return m_SelImportedEntity
|
||||
' End Get
|
||||
' Set(value As GeomEntity)
|
||||
' m_SelImportedEntity = value
|
||||
' EgtDeselectAll()
|
||||
' If Not IsNothing(m_SelImportedEntity) Then
|
||||
' EgtSelectObj(m_SelImportedEntity.nId)
|
||||
' End If
|
||||
' EgtDraw()
|
||||
' End Set
|
||||
'End Property
|
||||
'Friend Sub SetSelImportedEntity(nId As Integer)
|
||||
' m_SelImportedEntity = Map.refImportPanelVM.ImportedEntityList.FirstOrDefault(Function(x) x.nId = nId)
|
||||
' EgtDeselectAll()
|
||||
' If Not IsNothing(m_SelImportedEntity) Then
|
||||
' EgtSelectObj(m_SelImportedEntity.nId)
|
||||
' End If
|
||||
' EgtDraw()
|
||||
' NotifyPropertyChanged(NameOf(SelImportedEntity))
|
||||
'End Sub
|
||||
|
||||
Private m_ModifyPartList As New ObservableCollection(Of ModifyPart)
|
||||
Public ReadOnly Property ModifyPartList As ObservableCollection(Of ModifyPart)
|
||||
Get
|
||||
Return m_ModifyPartList
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_SelModifyPart As ModifyPart
|
||||
Friend Sub SetSelModifyPart(SelModifyPart As ModifyPart)
|
||||
m_SelModifyPart = SelModifyPart
|
||||
m_SelModifyLayer = Nothing
|
||||
End Sub
|
||||
Public ReadOnly Property SelModifyPart As ModifyPart
|
||||
Get
|
||||
Return m_SelModifyPart
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_SelModifyLayer As ModifyLayer
|
||||
Public ReadOnly Property SelModifyLayer As ModifyLayer
|
||||
Get
|
||||
Return m_SelModifyLayer
|
||||
End Get
|
||||
End Property
|
||||
Friend Sub SetSelModifyLayer(SelModifyLayer As ModifyLayer)
|
||||
m_SelModifyPart = m_ModifyPartList.FirstOrDefault(Function(x) x.LayerList.Contains(SelModifyLayer))
|
||||
m_SelModifyLayer = SelModifyLayer
|
||||
End Sub
|
||||
|
||||
Private m_SelModifyEntity As ModifyEntity
|
||||
Public ReadOnly Property SelModifyEntity As ModifyEntity
|
||||
Get
|
||||
Return m_SelModifyEntity
|
||||
End Get
|
||||
End Property
|
||||
Friend Sub SetSelModifyEntity(SelModifyEntity As ModifyEntity)
|
||||
For Each CurrPart In m_ModifyPartList
|
||||
Dim CurrLayer As ModifyLayer = CurrPart.LayerList.FirstOrDefault(Function(x) x.EntityList.Contains(SelModifyEntity))
|
||||
If Not IsNothing(CurrLayer) Then
|
||||
m_SelModifyPart = CurrPart
|
||||
m_SelModifyLayer = CurrLayer
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
m_SelModifyEntity = SelModifyEntity
|
||||
End Sub
|
||||
|
||||
' Definizione comandi
|
||||
Private m_cmdOk As ICommand
|
||||
Private m_cmdCancel As ICommand
|
||||
|
||||
Sub New()
|
||||
' Creo riferimento a questa classe in EgtCAM5Map
|
||||
Map.SetRefModifyPartPanelVM(Me)
|
||||
End Sub
|
||||
|
||||
#Region "METHODS"
|
||||
|
||||
Friend Sub Init()
|
||||
m_ModifyPartList.Clear()
|
||||
' carico pezzi in lista
|
||||
For Each PrintPart In Map.refTopPanelVM.PartList
|
||||
m_ModifyPartList.Add(New ModifyPart(PrintPart))
|
||||
Next
|
||||
End Sub
|
||||
|
||||
#End Region ' METHODS
|
||||
|
||||
#Region "COMMANDS"
|
||||
|
||||
'#Region "SetReference"
|
||||
|
||||
' Public ReadOnly Property SetReference_Command As ICommand
|
||||
' Get
|
||||
' If m_cmdSetReference Is Nothing Then
|
||||
' m_cmdSetReference = New Command(AddressOf SetReference)
|
||||
' End If
|
||||
' Return m_cmdSetReference
|
||||
' End Get
|
||||
' End Property
|
||||
|
||||
' Public Sub SetReference()
|
||||
' If Not IsNothing(SelGeomEntity) Then
|
||||
' Dim ChooseReferenceWndVM As New ChooseReferenceWndVM
|
||||
' Dim ChooseReferenceWndV As New ChooseReferenceWndV(Application.Current.MainWindow, ChooseReferenceWndVM)
|
||||
' If Not ChooseReferenceWndV.ShowDialog() Then Return
|
||||
' SelGeomEntity.Reference = ChooseReferenceWndVM.SelReference
|
||||
' End If
|
||||
' End Sub
|
||||
|
||||
'#End Region ' SetReference
|
||||
|
||||
'#Region "AddPart"
|
||||
|
||||
' Public ReadOnly Property AddPart_Command As ICommand
|
||||
' Get
|
||||
' If m_cmdAddPart Is Nothing Then
|
||||
' m_cmdAddPart = New Command(AddressOf AddPart)
|
||||
' End If
|
||||
' Return m_cmdAddPart
|
||||
' End Get
|
||||
' End Property
|
||||
|
||||
' Public Sub AddPart()
|
||||
' m_ImportPartList.Add(New ImportPart)
|
||||
' End Sub
|
||||
|
||||
'#End Region ' AddPart
|
||||
|
||||
'#Region "RemovePart"
|
||||
|
||||
' Public ReadOnly Property RemovePart_Command As ICommand
|
||||
' Get
|
||||
' If m_cmdRemovePart Is Nothing Then
|
||||
' m_cmdRemovePart = New Command(AddressOf RemovePart)
|
||||
' End If
|
||||
' Return m_cmdRemovePart
|
||||
' End Get
|
||||
' End Property
|
||||
|
||||
' Public Sub RemovePart()
|
||||
' If IsNothing(SelImportLayer) Then
|
||||
' ' rimuovo pezzo
|
||||
' m_ImportPartList.Remove(SelImportPart)
|
||||
' Else
|
||||
' ' rimuovo geometria
|
||||
' Dim CurrEntity As GeomEntity = m_SelGeomEntity
|
||||
' SelImportLayer.EntityList.Remove(m_SelGeomEntity)
|
||||
' ' la rimetto in lista importati
|
||||
' ImportedEntityList.Add(CurrEntity)
|
||||
' End If
|
||||
' End Sub
|
||||
|
||||
'#End Region ' RemovePart
|
||||
|
||||
#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()
|
||||
'Dim sErr As New List(Of String)
|
||||
'' verifico che tutti i pezzi abbiano una superficie da stampare nel layer apposito
|
||||
'For Each CurrPart In m_ImportPartList
|
||||
' For Each CurrLayer In CurrPart.LayerList
|
||||
' Select Case CurrLayer.Type
|
||||
' Case ImportLayer.LayerType.PRINT_SOLID
|
||||
' If CurrLayer.EntityList.Count = 0 Then
|
||||
' If sErr.Count > 0 Then sErr(sErr.Count - 1) &= Environment.NewLine
|
||||
' sErr.Add(CurrPart.ghName & " - No print surface defined!")
|
||||
' End If
|
||||
' End Select
|
||||
' Next
|
||||
'Next
|
||||
'If sErr.Count > 0 Then
|
||||
' MessageBox.Show(String.Concat(sErr), "Error")
|
||||
' Return
|
||||
'Else
|
||||
' ' Creo pezzi e layer necessari
|
||||
' For Each ImportPart In m_ImportPartList
|
||||
' Dim frImportedPart As New Frame3d
|
||||
' EgtGetGroupGlobFrame(m_nImportedPartId, frImportedPart)
|
||||
' Dim nPartId As Integer = EgtCreateGroup(GDB_ID.ROOT, frImportedPart)
|
||||
' EgtSetName(nPartId, PART)
|
||||
' Dim nFrameId As Integer = GDB_ID.NULL
|
||||
' Dim b3PrintSolid As New BBox3d
|
||||
' Dim nPrintPartLayerId As Integer = GDB_ID.NULL
|
||||
' Dim PrintSolidEntity As GeomEntity = Nothing
|
||||
' Dim nOriginalPartLayerId As Integer = GDB_ID.NULL
|
||||
' Dim nRibsLayerId As Integer = GDB_ID.NULL
|
||||
' Dim nShellNumberLayerId As Integer = GDB_ID.NULL
|
||||
' Dim nAuxSolidsLayerId As Integer = GDB_ID.NULL
|
||||
' Dim nMachStartLayerId As Integer = GDB_ID.NULL
|
||||
' Dim nOthersLayerId As Integer = GDB_ID.NULL
|
||||
' For Each ImportLayer In ImportPart.LayerList
|
||||
' Select Case ImportLayer.Type
|
||||
' Case ImportLayer.LayerType.PRINT_SOLID
|
||||
' nPrintPartLayerId = EgtCreateGroup(nPartId)
|
||||
' EgtSetName(nPrintPartLayerId, PRINT_SOLID)
|
||||
' If ImportLayer.EntityList.Count > 0 Then
|
||||
' PrintSolidEntity = ImportLayer.EntityList(0)
|
||||
' EgtRelocateGlob(PrintSolidEntity.nId, nPrintPartLayerId, GDB_POS.LAST_SON)
|
||||
' ' calcolo box superficie per creazione riferimento
|
||||
' EgtGetBBoxGlob(PrintSolidEntity.nId, GDB_BB.STANDARD, b3PrintSolid)
|
||||
' End If
|
||||
' 'Case ImportLayer.LayerType.ORIGINAL_SOLID
|
||||
' ' nOriginalPartLayerId = EgtCreateGroup(nPartId)
|
||||
' ' EgtSetName(nOriginalPartLayerId, ORIGINAL_SOLID)
|
||||
' ' For Each GeomEntity In ImportLayer.EntityList
|
||||
' ' EgtRelocateGlob(GeomEntity.nId, nOriginalPartLayerId, GDB_POS.LAST_SON)
|
||||
' ' Next
|
||||
' Case ImportLayer.LayerType.MACH_START
|
||||
' nMachStartLayerId = EgtCreateGroup(nPartId)
|
||||
' EgtSetName(nMachStartLayerId, LAY_MACH_START)
|
||||
' Dim nMachStartId As Integer = GDB_ID.NULL
|
||||
' If ImportLayer.EntityList.Count > 0 Then
|
||||
' For Each GeomEntity In ImportLayer.EntityList
|
||||
' ' se punto o curva compo
|
||||
' Dim EntityType As GDB_TY = EgtGetType(GeomEntity.nId)
|
||||
' Select Case EntityType
|
||||
' Case GDB_TY.GEO_POINT, GDB_TY.CRV_COMPO
|
||||
' ' gli cambio layer
|
||||
' EgtRelocateGlob(GeomEntity.nId, nMachStartLayerId, GDB_POS.LAST_SON)
|
||||
' nMachStartId = GeomEntity.nId
|
||||
' Case GDB_TY.CRV_ARC, GDB_TY.CRV_BEZ, GDB_TY.CRV_LINE
|
||||
' ' altrimenti la trasformo in curva compo
|
||||
' nMachStartId = EgtCreateCurveCompo(nMachStartLayerId, GeomEntity.nId, True)
|
||||
' End Select
|
||||
' EgtSetName(nMachStartId, START_GEOM)
|
||||
' ' coloro l'entita' di rosso
|
||||
' Dim c3Red As Color3d
|
||||
' c3Red.FromColor(System.Drawing.Color.Red)
|
||||
' EgtSetColor(nMachStartId, c3Red)
|
||||
' Next
|
||||
' Else
|
||||
' ' creo punto di partenza
|
||||
' 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)
|
||||
' EgtSetName(nMachStartId, START_GEOM)
|
||||
' ' coloro l'entita' di rosso
|
||||
' Dim c3Red As Color3d
|
||||
' c3Red.FromColor(System.Drawing.Color.Red)
|
||||
' EgtSetColor(nMachStartId, c3Red)
|
||||
' End If
|
||||
' Case ImportLayer.LayerType.RIBS
|
||||
' nRibsLayerId = EgtCreateGroup(nPartId)
|
||||
' EgtSetName(nRibsLayerId, LAY_RIBS)
|
||||
' For Each GeomEntity In ImportLayer.EntityList
|
||||
' EgtSetInfo(GeomEntity.nId, KEY_RIB_TYPE, RibEntity.RibTypes.FROMIMPORT)
|
||||
' EgtRelocateGlob(GeomEntity.nId, nRibsLayerId, GDB_POS.LAST_SON)
|
||||
' ' coloro l'entita' di viola
|
||||
' Dim c3LightBlue As Color3d
|
||||
' c3LightBlue.FromColor(System.Drawing.Color.MediumOrchid)
|
||||
' EgtSetColor(GeomEntity.nId, c3LightBlue)
|
||||
' Next
|
||||
' Case ImportLayer.LayerType.SHELL_NUMBER
|
||||
' nShellNumberLayerId = EgtCreateGroup(nPartId)
|
||||
' EgtSetName(nShellNumberLayerId, LAY_SHELL_NBR)
|
||||
' For Each GeomEntity In ImportLayer.EntityList
|
||||
' EgtSetInfo(GeomEntity.nId, KEY_SHELLNBR_TYPE, ShellNumberEntity.ShellNumberTypes.FROMIMPORT)
|
||||
' EgtRelocateGlob(GeomEntity.nId, nShellNumberLayerId, GDB_POS.LAST_SON)
|
||||
' ' coloro l'entita' di verde
|
||||
' Dim c3LightBlue As Color3d
|
||||
' c3LightBlue.FromColor(System.Drawing.Color.Lime)
|
||||
' EgtSetColor(GeomEntity.nId, c3LightBlue)
|
||||
' Next
|
||||
' Case ImportLayer.LayerType.AUX_SOLIDS
|
||||
' nAuxSolidsLayerId = EgtCreateGroup(nPartId)
|
||||
' EgtSetName(nAuxSolidsLayerId, LAY_AUX_SOLIDS)
|
||||
' For Each GeomEntity In ImportLayer.EntityList
|
||||
' EgtSetInfo(GeomEntity.nId, KEY_AUXSOLID_TYPE, RibEntity.RibTypes.FROMIMPORT)
|
||||
' EgtRelocateGlob(GeomEntity.nId, nAuxSolidsLayerId, GDB_POS.LAST_SON)
|
||||
' ' coloro l'entita' di oro
|
||||
' Dim c3LightBlue As Color3d
|
||||
' c3LightBlue.FromColor(System.Drawing.Color.DarkGoldenrod)
|
||||
' EgtSetColor(GeomEntity.nId, c3LightBlue)
|
||||
' Next
|
||||
' Case ImportLayer.LayerType.OTHERS
|
||||
' nOthersLayerId = EgtCreateGroup(nPartId)
|
||||
' EgtSetName(nOthersLayerId, LAY_OTHERS)
|
||||
' For Each GeomEntity In ImportLayer.EntityList
|
||||
' EgtRelocateGlob(GeomEntity.nId, nOthersLayerId, GDB_POS.LAST_SON)
|
||||
' Next
|
||||
' End Select
|
||||
' Next
|
||||
' ' aggiungo riferimento
|
||||
' Dim nReferenceLayerId As Integer = EgtCreateGroup(nPartId)
|
||||
' EgtSetName(nReferenceLayerId, LAY_REFERENCE)
|
||||
' ' Creo riferimento
|
||||
' Dim ptOrig As New Point3d(b3PrintSolid.Min())
|
||||
' Select Case PrintSolidEntity.Reference
|
||||
' Case ChooseReferenceWndVM.References.TL
|
||||
' ptOrig += b3PrintSolid.DimY() * Vector3d.Y_AX
|
||||
' Case ChooseReferenceWndVM.References.TR
|
||||
' ptOrig += b3PrintSolid.DimY() * Vector3d.Y_AX + b3PrintSolid.DimX() * Vector3d.X_AX
|
||||
' Case ChooseReferenceWndVM.References.BL
|
||||
' Case ChooseReferenceWndVM.References.BR
|
||||
' ptOrig += b3PrintSolid.DimX() * Vector3d.X_AX
|
||||
' Case ChooseReferenceWndVM.References.TC
|
||||
' ptOrig += b3PrintSolid.DimY() * Vector3d.Y_AX + b3PrintSolid.DimX() / 2 * Vector3d.X_AX
|
||||
' Case ChooseReferenceWndVM.References.ML
|
||||
' ptOrig += b3PrintSolid.DimY() / 2 * Vector3d.Y_AX
|
||||
' Case ChooseReferenceWndVM.References.MR
|
||||
' ptOrig += b3PrintSolid.DimY() / 2 * Vector3d.Y_AX + b3PrintSolid.DimX() * Vector3d.X_AX
|
||||
' Case ChooseReferenceWndVM.References.TC
|
||||
' ptOrig += b3PrintSolid.DimY() * Vector3d.Y_AX + b3PrintSolid.DimX() / 2 * Vector3d.X_AX
|
||||
' Case ChooseReferenceWndVM.References.MR
|
||||
' ptOrig += b3PrintSolid.DimY() / 2 * Vector3d.Y_AX + b3PrintSolid.DimX() * Vector3d.X_AX
|
||||
' Case ChooseReferenceWndVM.References.BC
|
||||
' ptOrig += b3PrintSolid.DimX() / 2 * Vector3d.X_AX
|
||||
' Case ChooseReferenceWndVM.References.MC
|
||||
' ptOrig += b3PrintSolid.DimY() / 2 * Vector3d.Y_AX + b3PrintSolid.DimX() / 2 * Vector3d.X_AX
|
||||
' End Select
|
||||
' 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, PrintSolidEntity.Reference)
|
||||
' ' appoggio il pezzo sulla tavola
|
||||
' EgtMove( nPartId, New Vector3d(0, 0, -b3PrintSolid.Min.z))
|
||||
' ' lo aggiungo a lista pezzi
|
||||
' Dim sFilePath As String = ""
|
||||
' EgtGetInfo(m_nImportedPartId, FILE_PATH, sFilePath)
|
||||
' EgtSetInfo(nPartId, FILE_PATH, sFilePath)
|
||||
' EgtSetInfo(nPartId, "PartOnTable", 1)
|
||||
' Dim NewPart As New Print3dPartVM(nPartId, nPrintPartLayerId, PrintSolidEntity.nId, nOriginalPartLayerId, nReferenceLayerId, nFrameId, nMachStartLayerId, nRibsLayerId, nShellNumberLayerId, nAuxSolidsLayerId, nOthersLayerId, sFilePath)
|
||||
' Map.refTopPanelVM.PartList.Add(NewPart)
|
||||
' Next
|
||||
'End If
|
||||
''EgtAddMachGroup("3dPrint")
|
||||
''EgtSetTable("Tab")
|
||||
|
||||
''Dim nRawId As Integer = EgtAddRawPart(b3PrintSolid.Min, b3PrintSolid.DimX, b3PrintSolid.DimY, b3PrintSolid.DimZ, New Color3d(128, 128, 128, 30))
|
||||
''EgtAddPartToRawPart(nPartId, b3PrintSolid.Min, nRawId)
|
||||
''EgtMoveToCornerRawPart(nRawId, New Point3d(dPosX, dPosY, 0), MCH_CR.BL)
|
||||
|
||||
''EgtResetCurrMachGroup()
|
||||
|
||||
'' seleziono ultimo pezzo aggiunto
|
||||
'Map.refTopPanelVM.SelLastPart()
|
||||
'' elimino vecchio pezzo d'importazione
|
||||
'EgtErase(m_nImportedPartId)
|
||||
|
||||
'EgtDraw()
|
||||
' ripristino modalita' standard
|
||||
Map.refTopPanelVM.SelPage = Pages.MODIFY
|
||||
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.refTopPanelVM.SelPage = Pages.MODIFY
|
||||
End Sub
|
||||
|
||||
#End Region ' Cancel
|
||||
|
||||
#End Region ' COMMANDS
|
||||
|
||||
End Class
|
||||
@@ -1,435 +0,0 @@
|
||||
Imports System.Collections.ObjectModel
|
||||
Imports EgtUILib
|
||||
Imports EgtWPFLib5
|
||||
|
||||
Public Class ModifyEntity
|
||||
Inherits VMBase
|
||||
|
||||
' layer sotto cui e' questa entita'
|
||||
Private m_OrigLayer As ModifyLayer
|
||||
Friend ReadOnly Property OrigLayer As ModifyLayer
|
||||
Get
|
||||
Return m_OrigLayer
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_bIsSelected As Boolean
|
||||
Public Property bIsSelected As Boolean
|
||||
Get
|
||||
Return m_bIsSelected
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
m_bIsSelected = value
|
||||
' seleziono in scena
|
||||
EgtDeselectAll()
|
||||
If Not IsNothing(value) Then
|
||||
EgtSelectObj(m_nId)
|
||||
End If
|
||||
EgtDraw()
|
||||
' segno come elemento selezionato in treeview
|
||||
Map.refModifyPartPanelVM.SetSelModifyEntity(Me)
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_nId As Integer = GDB_ID.NULL
|
||||
Public ReadOnly Property nId As Integer
|
||||
Get
|
||||
Return m_nId
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_sName As String
|
||||
Public ReadOnly Property sName As String
|
||||
Get
|
||||
Return m_sName
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property ghName As String
|
||||
Get
|
||||
Return m_nId
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_MenuList As New List(Of MenuItemVm)
|
||||
Public Property MenuList As List(Of MenuItemVm)
|
||||
Get
|
||||
Return m_MenuList
|
||||
End Get
|
||||
Set(value As List(Of MenuItemVm))
|
||||
m_MenuList = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Sub New(nId As Integer, sName As String, OrigLayer As ModifyLayer)
|
||||
m_nId = nId
|
||||
m_sName = sName
|
||||
m_OrigLayer = OrigLayer
|
||||
' aggiungo voci layer a contextmenu
|
||||
CreateContextMenu(OrigLayer)
|
||||
End Sub
|
||||
|
||||
Friend Sub UpdateContextMenu(OrigLayer As ModifyLayer)
|
||||
m_MenuList.Clear()
|
||||
' aggiungo voci layer a contextmenu
|
||||
CreateContextMenu(OrigLayer)
|
||||
End Sub
|
||||
|
||||
Friend Sub CreateContextMenu(OrigLayer As ModifyLayer)
|
||||
For Each ProjectPart In Map.refTopPanelVM.PartList
|
||||
' verifico in quali layer puo' andare questo elemento
|
||||
Dim EntityType As GDB_TY = EgtGetType(nId)
|
||||
Select Case EntityType
|
||||
Case GDB_TY.GEO_POINT, GDB_TY.CRV_COMPO, GDB_TY.CRV_ARC, GDB_TY.CRV_BEZ, GDB_TY.CRV_LINE
|
||||
' recupero i layer
|
||||
If OrigLayer.Type <> ModifyLayer.LayerType.MACH_START Then m_MenuList.Add(New MenuItemVm(Me, OrigLayer, ModifyLayer.LayerType.MACH_START, ProjectPart))
|
||||
If OrigLayer.Type <> ModifyLayer.LayerType.OTHERS Then m_MenuList.Add(New MenuItemVm(Me, OrigLayer, ModifyLayer.LayerType.OTHERS, ProjectPart))
|
||||
Case GDB_TY.SRF_MESH
|
||||
' verifico se volume chiuso
|
||||
If OrigLayer.Type <> ModifyLayer.LayerType.PRINT_SOLID Then m_MenuList.Add(New MenuItemVm(Me, OrigLayer, ModifyLayer.LayerType.PRINT_SOLID, ProjectPart))
|
||||
If OrigLayer.Type <> ModifyLayer.LayerType.SHELL_NUMBER Then m_MenuList.Add(New MenuItemVm(Me, OrigLayer, ModifyLayer.LayerType.SHELL_NUMBER, ProjectPart))
|
||||
If OrigLayer.Type <> ModifyLayer.LayerType.AUX_SOLIDS Then m_MenuList.Add(New MenuItemVm(Me, OrigLayer, ModifyLayer.LayerType.AUX_SOLIDS, ProjectPart))
|
||||
If OrigLayer.Type <> ModifyLayer.LayerType.RIBS Then m_MenuList.Add(New MenuItemVm(Me, OrigLayer, ModifyLayer.LayerType.RIBS, ProjectPart))
|
||||
If OrigLayer.Type <> ModifyLayer.LayerType.OTHERS Then m_MenuList.Add(New MenuItemVm(Me, OrigLayer, ModifyLayer.LayerType.OTHERS, ProjectPart))
|
||||
End Select
|
||||
Next
|
||||
End Sub
|
||||
|
||||
Friend Sub UpdateOrigLayer(NewLayer As ModifyLayer)
|
||||
m_OrigLayer = NewLayer
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
|
||||
Public Class ModifyPart
|
||||
Inherits VMBase
|
||||
|
||||
Private m_bIsSelected As Boolean
|
||||
Public Property bIsSelected As Boolean
|
||||
Get
|
||||
Return m_bIsSelected
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
m_bIsSelected = value
|
||||
Map.refModifyPartPanelVM.SetSelModifyPart(Me)
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_PrintPart As Print3dPartVM
|
||||
Public ReadOnly Property PrintPart As Print3dPartVM
|
||||
Get
|
||||
Return m_PrintPart
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_sName As String
|
||||
Public Property sName As String
|
||||
Get
|
||||
Return m_sName
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_sName = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property ghName As String
|
||||
Get
|
||||
Return m_PrintPart.sImportedFileName
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_LayerList As New ObservableCollection(Of ModifyLayer)
|
||||
Public ReadOnly Property LayerList As ObservableCollection(Of ModifyLayer)
|
||||
Get
|
||||
Return m_LayerList
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Sub New(PrintPart As Print3dPartVM)
|
||||
m_PrintPart = PrintPart
|
||||
m_LayerList.Add(New ModifyLayer(ModifyLayer.LayerType.PRINT_SOLID, "Print", PrintPart))
|
||||
m_LayerList.Add(New ModifyLayer(ModifyLayer.LayerType.MACH_START, "Layer Start", PrintPart))
|
||||
m_LayerList.Add(New ModifyLayer(ModifyLayer.LayerType.RIBS, "Ribs", PrintPart))
|
||||
m_LayerList.Add(New ModifyLayer(ModifyLayer.LayerType.SHELL_NUMBER, "Reduce Shell Number", PrintPart))
|
||||
m_LayerList.Add(New ModifyLayer(ModifyLayer.LayerType.AUX_SOLIDS, "Filled Solids", PrintPart))
|
||||
m_LayerList.Add(New ModifyLayer(ModifyLayer.LayerType.OTHERS, "Others", PrintPart))
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
|
||||
Public Class ModifyLayer
|
||||
Inherits VMBase
|
||||
|
||||
Public Enum LayerType As Integer
|
||||
PRINT_SOLID = 1
|
||||
MACH_START = 2
|
||||
RIBS = 3
|
||||
SHELL_NUMBER = 4
|
||||
AUX_SOLIDS = 5
|
||||
OTHERS = 6
|
||||
End Enum
|
||||
|
||||
Private m_nLayerId As Integer
|
||||
|
||||
Private m_bIsSelected As Boolean
|
||||
Public Property bIsSelected As Boolean
|
||||
Get
|
||||
Return m_bIsSelected
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
m_bIsSelected = value
|
||||
Map.refModifyPartPanelVM.SetSelModifyLayer(Me)
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_Type As LayerType
|
||||
Public Property Type As LayerType
|
||||
Get
|
||||
Return m_Type
|
||||
End Get
|
||||
Set(value As LayerType)
|
||||
m_Type = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_sName As String
|
||||
Public Property sName As String
|
||||
Get
|
||||
Return m_sName
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_sName = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_EntityList As New ObservableCollection(Of ModifyEntity)
|
||||
Public Property EntityList As ObservableCollection(Of ModifyEntity)
|
||||
Get
|
||||
Return m_EntityList
|
||||
End Get
|
||||
Set(value As ObservableCollection(Of ModifyEntity))
|
||||
m_EntityList = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Sub New(Type As LayerType, sName As String)
|
||||
m_Type = Type
|
||||
m_sName = sName
|
||||
End Sub
|
||||
|
||||
Sub New(Type As LayerType, sName As String, PrintPart As Print3dPartVM)
|
||||
m_Type = Type
|
||||
m_sName = sName
|
||||
Select Case Type
|
||||
Case LayerType.PRINT_SOLID
|
||||
m_nLayerId = PrintPart.nPrintSolidLayerId
|
||||
Dim nEntityId As Integer = EgtGetFirstInGroup(m_nLayerId)
|
||||
Dim sEntitytName As String = ""
|
||||
EgtGetName(nEntityId, sEntitytName)
|
||||
m_EntityList.Add(New ModifyEntity(nEntityId, sEntitytName, Me))
|
||||
Case LayerType.MACH_START
|
||||
m_nLayerId = PrintPart.nMachStartLayerId
|
||||
Dim nEntityId As Integer = EgtGetFirstInGroup(m_nLayerId)
|
||||
Dim sEntitytName As String = ""
|
||||
EgtGetName(nEntityId, sEntitytName)
|
||||
While nEntityId <> GDB_ID.NULL
|
||||
m_EntityList.Add(New ModifyEntity(nEntityId, sEntitytName, Me))
|
||||
nEntityId = EgtGetNext(nEntityId)
|
||||
EgtGetName(nEntityId, sEntitytName)
|
||||
End While
|
||||
Case LayerType.RIBS
|
||||
m_nLayerId = PrintPart.nRibsLayerId
|
||||
Dim nEntityId As Integer = EgtGetFirstInGroup(m_nLayerId)
|
||||
Dim sEntitytName As String = ""
|
||||
EgtGetName(nEntityId, sEntitytName)
|
||||
While nEntityId <> GDB_ID.NULL
|
||||
Dim RibType As Integer = RibEntity.RibTypes.FROMDRAW
|
||||
EgtGetInfo(nEntityId, KEY_RIB_TYPE, RibType)
|
||||
If RibType = RibEntity.RibTypes.FROMIMPORT Then
|
||||
m_EntityList.Add(New ModifyEntity(nEntityId, sEntitytName, Me))
|
||||
End If
|
||||
nEntityId = EgtGetNext(nEntityId)
|
||||
EgtGetName(nEntityId, sEntitytName)
|
||||
End While
|
||||
Case LayerType.SHELL_NUMBER
|
||||
m_nLayerId = PrintPart.nShellNumberLayerId
|
||||
Dim nEntityId As Integer = EgtGetFirstInGroup(m_nLayerId)
|
||||
Dim sEntitytName As String = ""
|
||||
EgtGetName(nEntityId, sEntitytName)
|
||||
While nEntityId <> GDB_ID.NULL
|
||||
Dim ShellType As Integer = ShellNumberEntity.ShellNumberTypes.FROMDRAW
|
||||
EgtGetInfo(nEntityId, KEY_SHELLNBR_TYPE, ShellType)
|
||||
If ShellType = ShellNumberEntity.ShellNumberTypes.FROMIMPORT Then
|
||||
m_EntityList.Add(New ModifyEntity(nEntityId, sEntitytName, Me))
|
||||
End If
|
||||
nEntityId = EgtGetNext(nEntityId)
|
||||
EgtGetName(nEntityId, sEntitytName)
|
||||
End While
|
||||
Case LayerType.AUX_SOLIDS
|
||||
m_nLayerId = PrintPart.nAuxSolidsLayerId
|
||||
Dim nEntityId As Integer = EgtGetFirstInGroup(m_nLayerId)
|
||||
Dim sEntitytName As String = ""
|
||||
EgtGetName(nEntityId, sEntitytName)
|
||||
While nEntityId <> GDB_ID.NULL
|
||||
'Dim ShellType As Integer = ShellNumberEntity.ShellNumberTypes.FROMDRAW
|
||||
'EgtGetInfo(nEntityId, KEY_SHELLNBR_TYPE, ShellType)
|
||||
'If ShellType = ShellNumberEntity.ShellNumberTypes.FROMIMPORT Then
|
||||
m_EntityList.Add(New ModifyEntity(nEntityId, sEntitytName, Me))
|
||||
'End If
|
||||
nEntityId = EgtGetNext(nEntityId)
|
||||
EgtGetName(nEntityId, sEntitytName)
|
||||
End While
|
||||
Case LayerType.OTHERS
|
||||
m_nLayerId = PrintPart.nOthersLayerId
|
||||
Dim nEntityId As Integer = EgtGetFirstInGroup(m_nLayerId)
|
||||
Dim sEntitytName As String = ""
|
||||
EgtGetName(nEntityId, sEntitytName)
|
||||
While nEntityId <> GDB_ID.NULL
|
||||
m_EntityList.Add(New ModifyEntity(nEntityId, sEntitytName, Me))
|
||||
nEntityId = EgtGetNext(nEntityId)
|
||||
EgtGetName(nEntityId, sEntitytName)
|
||||
End While
|
||||
End Select
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
|
||||
Public Class MenuItemVm
|
||||
Inherits VMBase
|
||||
|
||||
' enita' di origine
|
||||
Private m_OrigEntity As ModifyEntity
|
||||
Private m_OrigLayer As ModifyLayer
|
||||
|
||||
' pezzo in cui spostare
|
||||
Private m_Part As Print3dPartVM
|
||||
|
||||
' tipo del layer indicato
|
||||
Private m_Type As ModifyLayer.LayerType
|
||||
Public Property Type As ModifyLayer.LayerType
|
||||
Get
|
||||
Return m_Type
|
||||
End Get
|
||||
Set(value As ModifyLayer.LayerType)
|
||||
m_Type = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property sMsg As String
|
||||
Get
|
||||
Dim sType As String = ""
|
||||
Select Case m_Type
|
||||
Case ModifyLayer.LayerType.PRINT_SOLID
|
||||
sType = "Print"
|
||||
Case ModifyLayer.LayerType.MACH_START
|
||||
sType = "Layer Start"
|
||||
Case ModifyLayer.LayerType.RIBS
|
||||
sType = "Ribs"
|
||||
Case ModifyLayer.LayerType.SHELL_NUMBER
|
||||
sType = "Reduce shell number"
|
||||
Case ModifyLayer.LayerType.AUX_SOLIDS
|
||||
sType = "Filled Solids"
|
||||
Case ModifyLayer.LayerType.OTHERS
|
||||
sType = "Others"
|
||||
End Select
|
||||
Return "Move to " & sType
|
||||
End Get
|
||||
End Property
|
||||
|
||||
' Definizione comando
|
||||
Private m_cmdCommand As ICommand
|
||||
|
||||
Sub New(OrigEntity As ModifyEntity, OrigLayer As ModifyLayer, Type As ModifyLayer.LayerType, Part As Print3dPartVM)
|
||||
m_OrigEntity = OrigEntity
|
||||
m_OrigLayer = OrigLayer
|
||||
m_Type = Type
|
||||
m_Part = Part
|
||||
End Sub
|
||||
|
||||
#Region "Cancel"
|
||||
|
||||
Public ReadOnly Property MenuItem_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()
|
||||
' recupero layer da pezzo
|
||||
Dim nLayerId As Integer = GDB_ID.NULL
|
||||
Select Case m_Type
|
||||
Case ModifyLayer.LayerType.PRINT_SOLID
|
||||
nLayerId = m_Part.nPrintSolidLayerId
|
||||
Case ModifyLayer.LayerType.MACH_START
|
||||
nLayerId = m_Part.nMachStartLayerId
|
||||
Case ModifyLayer.LayerType.RIBS
|
||||
nLayerId = m_Part.nRibsLayerId
|
||||
Case ModifyLayer.LayerType.SHELL_NUMBER
|
||||
nLayerId = m_Part.nShellNumberLayerId
|
||||
Case ModifyLayer.LayerType.AUX_SOLIDS
|
||||
nLayerId = m_Part.nAuxSolidsLayerId
|
||||
Case ModifyLayer.LayerType.OTHERS
|
||||
nLayerId = m_Part.nOthersLayerId
|
||||
End Select
|
||||
' sposto entita'
|
||||
If EgtRelocateGlob(m_OrigEntity.nId, nLayerId) Then
|
||||
' elimino info vecchio layer
|
||||
Select Case m_OrigLayer.Type
|
||||
Case ModifyLayer.LayerType.PRINT_SOLID
|
||||
EgtResetMark(m_OrigEntity.nId)
|
||||
Case ModifyLayer.LayerType.MACH_START
|
||||
Case ModifyLayer.LayerType.RIBS
|
||||
EgtRemoveInfo(m_OrigEntity.nId, KEY_RIB_TYPE)
|
||||
Case ModifyLayer.LayerType.SHELL_NUMBER
|
||||
EgtRemoveInfo(m_OrigEntity.nId, KEY_SHELLNBR_TYPE)
|
||||
Case ModifyLayer.LayerType.AUX_SOLIDS
|
||||
EgtRemoveInfo(m_OrigEntity.nId, KEY_AUXSOLID_TYPE)
|
||||
Case ModifyLayer.LayerType.OTHERS
|
||||
End Select
|
||||
' sposto in lista
|
||||
m_OrigLayer.EntityList.Remove(m_OrigEntity)
|
||||
Dim NewPart As ModifyPart = Map.refModifyPartPanelVM.ModifyPartList.FirstOrDefault(Function(x) x.PrintPart.nPartId = m_Part.nPartId)
|
||||
If Not IsNothing(NewPart) Then
|
||||
Dim NewLayer As ModifyLayer = NewPart.LayerList.FirstOrDefault(Function(x) x.Type = m_Type)
|
||||
If Not IsNothing(NewLayer) Then
|
||||
NewLayer.EntityList.Add(m_OrigEntity)
|
||||
' aggiorno riferimenti nell'entita'
|
||||
m_OrigEntity.UpdateOrigLayer(NewLayer)
|
||||
End If
|
||||
End If
|
||||
' aggiungo info nuovo layer
|
||||
Select Case m_Type
|
||||
Case ModifyLayer.LayerType.PRINT_SOLID
|
||||
EgtSetName(m_OrigEntity.nId, PRINT_SOLID)
|
||||
EgtSetColor(m_OrigEntity.nId, c3Print)
|
||||
Case ModifyLayer.LayerType.MACH_START
|
||||
EgtSetName(m_OrigEntity.nId, LAY_MACH_START)
|
||||
EgtSetColor(m_OrigEntity.nId, c3MachStart)
|
||||
Case ModifyLayer.LayerType.RIBS
|
||||
EgtSetName(m_OrigEntity.nId, LAY_RIBS)
|
||||
EgtSetInfo(m_OrigEntity.nId, KEY_RIB_TYPE, RibEntity.RibTypes.FROMIMPORT)
|
||||
EgtSetColor(m_OrigEntity.nId, c3Rib)
|
||||
Case ModifyLayer.LayerType.SHELL_NUMBER
|
||||
EgtSetName(m_OrigEntity.nId, LAY_SHELL_NBR)
|
||||
EgtSetInfo(m_OrigEntity.nId, KEY_SHELLNBR_TYPE, ShellNumberEntity.ShellNumberTypes.FROMIMPORT)
|
||||
EgtSetColor(m_OrigEntity.nId, c3ShellNumber)
|
||||
Case ModifyLayer.LayerType.AUX_SOLIDS
|
||||
EgtSetName(m_OrigEntity.nId, LAY_AUX_SOLIDS)
|
||||
EgtSetInfo(m_OrigEntity.nId, KEY_AUXSOLID_TYPE, RibEntity.RibTypes.FROMIMPORT)
|
||||
EgtSetColor(m_OrigEntity.nId, c3AuxSolids)
|
||||
Case ModifyLayer.LayerType.OTHERS
|
||||
EgtSetName(m_OrigEntity.nId, LAY_OTHERS)
|
||||
EgtSetColor(m_OrigEntity.nId, c3Others)
|
||||
End Select
|
||||
EgtDraw()
|
||||
' aggiorno riferimenti nel context menu item
|
||||
m_OrigEntity.UpdateContextMenu(m_OrigEntity.OrigLayer)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
#End Region ' Cancel
|
||||
|
||||
End Class
|
||||
@@ -11,6 +11,7 @@ Imports System.Windows
|
||||
|
||||
' Review the values of the assembly attributes
|
||||
|
||||
#If PLATFORM = "x64" Then
|
||||
#If DEBUG Then
|
||||
<Assembly: AssemblyTitle("IcarusD64.exe")>
|
||||
<Assembly: AssemblyDescription("Icarus Debug 64 bit")>
|
||||
@@ -18,9 +19,18 @@ Imports System.Windows
|
||||
<Assembly: AssemblyTitle("IcarusR64.exe")>
|
||||
<Assembly: AssemblyDescription("Icarus 64 bit")>
|
||||
#End If
|
||||
#Else
|
||||
#If DEBUG Then
|
||||
<Assembly: AssemblyTitle("IcarusD32.exe")>
|
||||
<Assembly: AssemblyDescription("Icarus Debug 32 bit")>
|
||||
#Else
|
||||
<Assembly: AssemblyTitle("IcarusR32.exe")>
|
||||
<Assembly: AssemblyDescription("Icarus 32 bit")>
|
||||
#End If
|
||||
#End If
|
||||
<Assembly: AssemblyCompany("Egalware s.r.l.")>
|
||||
<Assembly: AssemblyProduct("Icarus")>
|
||||
<Assembly: AssemblyCopyright("Copyright © 2022 by Egalware s.r.l.")>
|
||||
<Assembly: AssemblyCopyright("Copyright © 2022-2023 by Egalware s.r.l.")>
|
||||
<Assembly: AssemblyTrademark("")>
|
||||
<Assembly: ComVisible(false)>
|
||||
|
||||
@@ -60,5 +70,5 @@ Imports System.Windows
|
||||
' by using the '*' as shown below:
|
||||
' <Assembly: AssemblyVersion("1.0.*")>
|
||||
|
||||
<Assembly: AssemblyVersion("2.4.10.3")>
|
||||
<Assembly: AssemblyFileVersion("2.4.10.3")>
|
||||
<Assembly: AssemblyVersion("2.5.2.2")>
|
||||
<Assembly: AssemblyFileVersion("2.5.2.2")>
|
||||
|
||||
@@ -80,13 +80,6 @@
|
||||
</TabItem>
|
||||
<TabItem Header="{Binding CADMsg}">
|
||||
<StackPanel Margin="5,5,5,0">
|
||||
<!--<UniformGrid Columns="2"
|
||||
Margin="0,0,0,5">
|
||||
<TextBlock Text="{Binding DefMaterialColorMsg}" VerticalAlignment="Center"/>
|
||||
<Button Background="{Binding DefMaterialColor}"
|
||||
Command="{Binding DefMaterialColor_Command}"
|
||||
Style="{StaticResource EgtWPFLib5_InputButton}"/>
|
||||
</UniformGrid>-->
|
||||
<UniformGrid Grid.ColumnSpan="2" Columns="2"
|
||||
Margin="0,0,0,5">
|
||||
<TextBlock Text="{Binding GeometryToleranceMsg}" VerticalAlignment="Center"/>
|
||||
@@ -94,6 +87,38 @@
|
||||
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">
|
||||
|
||||
@@ -179,12 +179,16 @@ Public Class OptionWindowVM
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property DefMaterialColor As Brush
|
||||
' lista oggetti che gestiscono colori e trasparenze delle catogorie
|
||||
Private m_LayerColorList As New ObservableCollection(Of LayerColor)({New LayerColor(LayerColor.LayerType.PRINTPART),
|
||||
New LayerColor(LayerColor.LayerType.RIBS),
|
||||
New LayerColor(LayerColor.LayerType.SHELLNUMBERS),
|
||||
New LayerColor(LayerColor.LayerType.AUXSOLIDS),
|
||||
New LayerColor(LayerColor.LayerType.MACHSTART),
|
||||
New LayerColor(LayerColor.LayerType.OTHERS)})
|
||||
Public ReadOnly Property LayerColorList As ObservableCollection(Of LayerColor)
|
||||
Get
|
||||
Return New SolidColorBrush(Color.FromArgb(CByte(255),
|
||||
CByte(OptionModule.m_DefMaterialColor.R),
|
||||
CByte(OptionModule.m_DefMaterialColor.G),
|
||||
CByte(OptionModule.m_DefMaterialColor.B)))
|
||||
Return m_LayerColorList
|
||||
End Get
|
||||
End Property
|
||||
|
||||
@@ -195,7 +199,7 @@ Public Class OptionWindowVM
|
||||
Set(value As Boolean)
|
||||
OptionModule.m_bThickLine = value
|
||||
WriteMainPrivateProfileString(S_SCENE, K_LINEWIDTH, If(value, "2", "1"))
|
||||
EgtSetLineAttribs( If( value, 2, 1))
|
||||
EgtSetLineAttribs(If(value, 2, 1))
|
||||
End Set
|
||||
End Property
|
||||
|
||||
@@ -510,11 +514,11 @@ Public Class OptionWindowVM
|
||||
'End Property
|
||||
|
||||
' Definizione comandi
|
||||
|
||||
Private m_cmdTopSceneBackground As ICommand
|
||||
Private m_cmdBotSceneBackground As ICommand
|
||||
Private m_cmdGridColor As ICommand
|
||||
Private m_cmdUpdateLicenceCmd As ICommand
|
||||
Private m_cmdDefMaterialColor As ICommand
|
||||
Private m_cmdAddMachineCmd As ICommand
|
||||
Private m_cmdExportMachineCmd As ICommand
|
||||
|
||||
@@ -583,11 +587,6 @@ Public Class OptionWindowVM
|
||||
Return EgtMsg(6513)
|
||||
End Get
|
||||
End Property
|
||||
Public ReadOnly Property DefMaterialColorMsg As String
|
||||
Get
|
||||
Return EgtMsg(6512)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property ImportMsg As String
|
||||
Get
|
||||
@@ -747,9 +746,35 @@ Public Class OptionWindowVM
|
||||
|
||||
#End Region
|
||||
|
||||
Public Function WritePrivateProfileColor(IpAppName As String, IpKeyName As String, ByRef Color As Color3d) As Boolean
|
||||
Dim sColor As String = Color.R & "," & Color.G & "," & Color.B
|
||||
Return EgtUILib.WritePrivateProfileString(IpAppName, IpKeyName, sColor, m_sIniFile)
|
||||
Private Function SelectColor(Col As Color3d, ByRef NewCol As Color3d) As Boolean
|
||||
' Recupero colori custom
|
||||
Dim sCustomColors As String = ""
|
||||
GetMainPrivateProfileString(S_COLORS, K_CUSTOMCOLORS, "", sCustomColors)
|
||||
Dim CustomColors() As String = sCustomColors.Split(","c)
|
||||
Dim nCustomColors As New List(Of Integer)
|
||||
For Each Color In CustomColors
|
||||
Dim nColor As Integer
|
||||
If Integer.TryParse(Color, nColor) Then
|
||||
nCustomColors.Add(nColor)
|
||||
End If
|
||||
Next
|
||||
' Creo dialogo colori
|
||||
Dim ColorDlg As New System.Windows.Forms.ColorDialog
|
||||
ColorDlg.FullOpen = True
|
||||
ColorDlg.CustomColors = nCustomColors.ToArray()
|
||||
ColorDlg.Color = Col.ToColor()
|
||||
' Visualizzo dialogo
|
||||
If ColorDlg.ShowDialog() <> Windows.Forms.DialogResult.OK Then Return False
|
||||
' Recupero colore scelto
|
||||
NewCol.FromColor(ColorDlg.Color)
|
||||
' Salvo eventuali modifiche ai colori custom
|
||||
sCustomColors = ""
|
||||
For Each Color In ColorDlg.CustomColors
|
||||
sCustomColors &= Color.ToString() & ","
|
||||
Next
|
||||
sCustomColors = sCustomColors.Trim({" "c, ","c})
|
||||
WriteMainPrivateProfileString(S_COLORS, K_CUSTOMCOLORS, sCustomColors)
|
||||
Return True
|
||||
End Function
|
||||
|
||||
#Region "COMMANDS"
|
||||
@@ -854,41 +879,6 @@ Public Class OptionWindowVM
|
||||
|
||||
#End Region ' GridColor
|
||||
|
||||
#Region "DefMaterialColor"
|
||||
|
||||
'''' <summary>
|
||||
'''' Returns a command that remove the current selected machining.
|
||||
'''' </summary>
|
||||
'Public ReadOnly Property DefMaterialColor_Command() As ICommand
|
||||
' Get
|
||||
' If m_cmdDefMaterialColor Is Nothing Then
|
||||
' m_cmdDefMaterialColor = New Command(AddressOf DefMaterialColorCmd)
|
||||
' End If
|
||||
' Return m_cmdDefMaterialColor
|
||||
' End Get
|
||||
'End Property
|
||||
|
||||
'''' <summary>
|
||||
'''' Manage the MachiningDb closing. This method is invoked by the CloseMachiningDbCommand.
|
||||
'''' </summary>
|
||||
'Public Sub DefMaterialColorCmd()
|
||||
' ' Recupero colore da Ini
|
||||
' Dim DefColor As New Color3d(192, 192, 192)
|
||||
' GetMainPrivateProfileColor(S_GEOMDB, K_DEFAULTCOLOR, DefColor)
|
||||
' ' Eseguo modifica con dialogo
|
||||
' If SelectColor(DefColor, DefColor) Then
|
||||
' OptionModule.m_DefMaterialColor = DefColor
|
||||
' Map.refSceneHostVM.MainScene.SetDefaultMaterial(OptionModule.m_DefMaterialColor)
|
||||
' WritePrivateProfileColor(S_GEOMDB, K_DEFAULTCOLOR, OptionModule.m_DefMaterialColor)
|
||||
' EgtDraw()
|
||||
' Map.refManageLayerExpanderVM.UpdateHeaderColor(OptionModule.m_DefMaterialColor)
|
||||
' Map.refManageLayerExpanderVM.LoadObjTree()
|
||||
' NotifyPropertyChanged("DefMaterialColor")
|
||||
' End If
|
||||
'End Sub
|
||||
|
||||
#End Region ' DefMaterialColor
|
||||
|
||||
#Region "UpdateLicence"
|
||||
|
||||
''' <summary>
|
||||
@@ -1165,10 +1155,97 @@ Public Class OptionWindowVM
|
||||
|
||||
#End Region ' COMMANDS
|
||||
|
||||
End Class
|
||||
|
||||
Public Class LayerColor
|
||||
Inherits VMBase
|
||||
|
||||
Public Enum LayerType As Integer
|
||||
PRINTPART = 1
|
||||
'REFERENCE = 2
|
||||
MACHSTART = 3
|
||||
RIBS = 4
|
||||
SHELLNUMBERS = 5
|
||||
AUXSOLIDS = 6
|
||||
OTHERS = 7
|
||||
End Enum
|
||||
|
||||
Private m_Type As LayerType
|
||||
Public ReadOnly Property c3Color As Color3d
|
||||
Get
|
||||
Select Case m_Type
|
||||
Case LayerType.PRINTPART
|
||||
Return GeomEntityColors.c3Print
|
||||
Case LayerType.RIBS
|
||||
Return GeomEntityColors.c3Rib
|
||||
Case LayerType.SHELLNUMBERS
|
||||
Return GeomEntityColors.c3ShellNumber
|
||||
Case LayerType.AUXSOLIDS
|
||||
Return GeomEntityColors.c3AuxSolids
|
||||
Case LayerType.MACHSTART
|
||||
Return GeomEntityColors.c3MachStart
|
||||
Case LayerType.OTHERS
|
||||
Return GeomEntityColors.c3Others
|
||||
End Select
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property Background As Brush
|
||||
Get
|
||||
Return New SolidColorBrush(Color.FromArgb(CByte(255),
|
||||
CByte(c3Color.R),
|
||||
CByte(c3Color.G),
|
||||
CByte(c3Color.B)))
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Property dAlpha As Double
|
||||
Get
|
||||
Return c3Color.A
|
||||
End Get
|
||||
Set(value As Double)
|
||||
GeomEntityColors.SetAlpha(m_Type, value)
|
||||
NotifyPropertyChanged(NameOf(sAlpha))
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property sAlpha As String
|
||||
Get
|
||||
Return c3Color.A & "%"
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property Color_Msg As String
|
||||
Get
|
||||
Select Case m_Type
|
||||
Case LayerType.PRINTPART
|
||||
Return "Print"
|
||||
Case LayerType.RIBS
|
||||
Return "Ribs"
|
||||
Case LayerType.SHELLNUMBERS
|
||||
Return "Reduce Shell Number"
|
||||
Case LayerType.AUXSOLIDS
|
||||
Return "Filled Solids"
|
||||
Case LayerType.MACHSTART
|
||||
Return "Layer Start"
|
||||
Case LayerType.OTHERS
|
||||
Return "Others"
|
||||
Case Else
|
||||
Return ""
|
||||
End Select
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_cmdColor As ICommand
|
||||
|
||||
Sub New(Type As LayerType)
|
||||
m_Type = Type
|
||||
End Sub
|
||||
|
||||
Private Function SelectColor(Col As Color3d, ByRef NewCol As Color3d) As Boolean
|
||||
' Recupero colori custom
|
||||
Dim sCustomColors As String = ""
|
||||
GetMainPrivateProfileString(S_SCENE, K_CUSTOMCOLORS, "", sCustomColors)
|
||||
GetMainPrivateProfileString(S_COLORS, K_CUSTOMCOLORS, "", sCustomColors)
|
||||
Dim CustomColors() As String = sCustomColors.Split(","c)
|
||||
Dim nCustomColors As New List(Of Integer)
|
||||
For Each Color In CustomColors
|
||||
@@ -1192,10 +1269,39 @@ Public Class OptionWindowVM
|
||||
sCustomColors &= Color.ToString() & ","
|
||||
Next
|
||||
sCustomColors = sCustomColors.Trim({" "c, ","c})
|
||||
WriteMainPrivateProfileString(S_SCENE, K_CUSTOMCOLORS, sCustomColors)
|
||||
WriteMainPrivateProfileString(S_COLORS, K_CUSTOMCOLORS, sCustomColors)
|
||||
Return True
|
||||
End Function
|
||||
|
||||
#Region "Color"
|
||||
|
||||
''' <summary>
|
||||
''' Returns a command that remove the current selected machining.
|
||||
''' </summary>
|
||||
Public ReadOnly Property Color_Command() As ICommand
|
||||
Get
|
||||
If m_cmdColor Is Nothing Then
|
||||
m_cmdColor = New Command(AddressOf ColorCmd)
|
||||
End If
|
||||
Return m_cmdColor
|
||||
End Get
|
||||
End Property
|
||||
|
||||
''' <summary>
|
||||
''' Manage the MachiningDb closing. This method is invoked by the CloseMachiningDbCommand.
|
||||
''' </summary>
|
||||
Public Sub ColorCmd()
|
||||
' Recupero colore da Ini
|
||||
Dim c3Print As Color3d = c3Color
|
||||
' Eseguo modifica con dialogo
|
||||
If SelectColor(c3Color, c3Print) Then
|
||||
GeomEntityColors.SetColor(m_Type, c3Print)
|
||||
NotifyPropertyChanged(NameOf(Background))
|
||||
End If
|
||||
End Sub
|
||||
|
||||
#End Region ' PrintPartColor
|
||||
|
||||
End Class
|
||||
|
||||
'Public Class GeomTypeConverter
|
||||
|
||||
@@ -49,6 +49,12 @@
|
||||
Style="{StaticResource ToolBar_Button}">
|
||||
<Image Source="/Resources/ProjectManager/Import.png" Stretch="Uniform"/>
|
||||
</Button>
|
||||
<Button Command="{Binding ExportCommand}"
|
||||
ToolTip="{Binding ExportToolTip}"
|
||||
IsEnabled="{Binding ProjCmd_IsEnabled}"
|
||||
Style="{StaticResource ToolBar_Button}">
|
||||
<Image Source="/Resources/ProjectManager/Export.png" Stretch="Uniform"/>
|
||||
</Button>
|
||||
<!--<Button Command="{Binding ExportCommand}" ToolTip="{Binding ExportToolTip}"
|
||||
IsEnabled="{Binding DrawIsChecked}">
|
||||
<Image Source="/Resources/ProjectManager/Export.png" Stretch="Uniform"/>
|
||||
|
||||
@@ -60,6 +60,7 @@ Public Class ProjManagerVM
|
||||
Private m_cmdSave As ICommand
|
||||
Private m_cmdSaveAs As ICommand
|
||||
Private m_cmdImport As ICommand
|
||||
Private m_cmdExport As ICommand
|
||||
Private m_cmdOptions As ICommand
|
||||
Private m_cmdSendFeedback As ICommand
|
||||
|
||||
@@ -162,6 +163,9 @@ Public Class ProjManagerVM
|
||||
End Sub
|
||||
|
||||
Friend Sub NewProject(bDialog As Boolean)
|
||||
' Gestisco eventuale file corrente modificato
|
||||
If Not Map.refSceneHostVM.MainController.ManageModified() Then Return
|
||||
EgtResetModified()
|
||||
Dim NewProjMachine As Machine
|
||||
If bDialog AndAlso Map.refMachinePanelVM.MachineList.Count > 0 Then
|
||||
Dim ChooseMachineWndVM As New ChooseMachineWndVM
|
||||
@@ -316,6 +320,29 @@ Public Class ProjManagerVM
|
||||
|
||||
#End Region ' Import
|
||||
|
||||
#Region "ExportCommand"
|
||||
|
||||
''' <summary>
|
||||
''' Returns a command that do Export.
|
||||
''' </summary>
|
||||
Public ReadOnly Property ExportCommand As ICommand
|
||||
Get
|
||||
If m_cmdExport Is Nothing Then
|
||||
m_cmdExport = New Command(AddressOf Export)
|
||||
End If
|
||||
Return m_cmdExport
|
||||
End Get
|
||||
End Property
|
||||
|
||||
''' <summary>
|
||||
''' Execute the Export. This method is invoked by the ExportCommand.
|
||||
''' </summary>
|
||||
Public Sub Export(ByVal param As Object)
|
||||
Map.refSceneHostVM.ExportProject()
|
||||
End Sub
|
||||
|
||||
#End Region ' ExportCommand
|
||||
|
||||
#Region "Options"
|
||||
|
||||
''' <summary>
|
||||
|
||||
@@ -30,6 +30,7 @@ Public Class ReferencePanelVM
|
||||
End Get
|
||||
Set(value As ReferenceBtn)
|
||||
m_SelReference = value.Type
|
||||
EgtSetInfo(Map.refTopPanelVM.SelPart.nReferenceLayerId, KEY_REFERENCE, value.Type)
|
||||
UpdateFramePosition()
|
||||
End Set
|
||||
End Property
|
||||
@@ -42,6 +43,7 @@ Public Class ReferencePanelVM
|
||||
If value Then
|
||||
m_SelReference = ReferenceBtn.References.FROM_IMPORT
|
||||
NotifyPropertyChanged(NameOf(ghSelReference))
|
||||
EgtSetInfo(Map.refTopPanelVM.SelPart.nReferenceLayerId, KEY_REFERENCE, ReferenceBtn.References.FROM_IMPORT)
|
||||
UpdateFramePosition()
|
||||
End If
|
||||
End Set
|
||||
@@ -67,51 +69,61 @@ Public Class ReferencePanelVM
|
||||
NotifyPropertyChanged(NameOf(ghSelReference))
|
||||
End Sub
|
||||
|
||||
Friend Sub UpdateFramePosition()
|
||||
Friend Sub UpdateFramePosition(Optional SelPart As Print3dPartVM = Nothing)
|
||||
Dim SelReference As Integer = ReferenceBtn.References.BL
|
||||
If IsNothing(SelPart) Then
|
||||
SelPart = Map.refTopPanelVM.SelPart
|
||||
End If
|
||||
EgtGetInfo(SelPart.nReferenceLayerId, KEY_REFERENCE, SelReference)
|
||||
' elimino precedente
|
||||
EgtEmptyGroup(Map.refTopPanelVM.SelPart.nReferenceLayerId)
|
||||
EgtEmptyGroup(SelPart.nReferenceLayerId)
|
||||
' Creo riferimento
|
||||
Dim frPrintSolid As New Frame3d()
|
||||
If m_SelReference = ReferenceBtn.References.FROM_IMPORT Then
|
||||
EgtGetGlobFrame(Map.refTopPanelVM.SelPart.nPrintSolidId, frPrintSolid)
|
||||
If SelReference = ReferenceBtn.References.FROM_IMPORT Then
|
||||
EgtGetGlobFrame(SelPart.nPrintSolidId, frPrintSolid)
|
||||
frPrintSolid.Setup(New Point3d(frPrintSolid.Orig.x, frPrintSolid.Orig.y, 0))
|
||||
Else
|
||||
Dim b3PrintSolid As New BBox3d
|
||||
EgtGetBBoxGlob(Map.refTopPanelVM.SelPart.nPrintSolidId, GDB_BB.STANDARD, b3PrintSolid)
|
||||
Dim b3ToBePrintSolid As BBox3d = Map.refDispositionPanelVM.GetSolidForReferenceBBox(SelPart)
|
||||
' Creo riferimento
|
||||
Dim ptOrig As New Point3d(b3PrintSolid.Min())
|
||||
Select Case m_SelReference
|
||||
Dim ptOrig As New Point3d(b3ToBePrintSolid.Min())
|
||||
Select Case SelReference
|
||||
Case ReferenceBtn.References.TL
|
||||
ptOrig += b3PrintSolid.DimY() * Vector3d.Y_AX
|
||||
ptOrig += b3ToBePrintSolid.DimY() * Vector3d.Y_AX
|
||||
Case ReferenceBtn.References.TR
|
||||
ptOrig += b3PrintSolid.DimY() * Vector3d.Y_AX + b3PrintSolid.DimX() * Vector3d.X_AX
|
||||
ptOrig += b3ToBePrintSolid.DimY() * Vector3d.Y_AX + b3ToBePrintSolid.DimX() * Vector3d.X_AX
|
||||
Case ReferenceBtn.References.BL
|
||||
Case ReferenceBtn.References.BR
|
||||
ptOrig += b3PrintSolid.DimX() * Vector3d.X_AX
|
||||
ptOrig += b3ToBePrintSolid.DimX() * Vector3d.X_AX
|
||||
Case ReferenceBtn.References.TC
|
||||
ptOrig += b3PrintSolid.DimY() * Vector3d.Y_AX + b3PrintSolid.DimX() / 2 * Vector3d.X_AX
|
||||
ptOrig += b3ToBePrintSolid.DimY() * Vector3d.Y_AX + b3ToBePrintSolid.DimX() / 2 * Vector3d.X_AX
|
||||
Case ReferenceBtn.References.ML
|
||||
ptOrig += b3PrintSolid.DimY() / 2 * Vector3d.Y_AX
|
||||
ptOrig += b3ToBePrintSolid.DimY() / 2 * Vector3d.Y_AX
|
||||
Case ReferenceBtn.References.MR
|
||||
ptOrig += b3PrintSolid.DimY() / 2 * Vector3d.Y_AX + b3PrintSolid.DimX() * Vector3d.X_AX
|
||||
ptOrig += b3ToBePrintSolid.DimY() / 2 * Vector3d.Y_AX + b3ToBePrintSolid.DimX() * Vector3d.X_AX
|
||||
Case ReferenceBtn.References.TC
|
||||
ptOrig += b3PrintSolid.DimY() * Vector3d.Y_AX + b3PrintSolid.DimX() / 2 * Vector3d.X_AX
|
||||
ptOrig += b3ToBePrintSolid.DimY() * Vector3d.Y_AX + b3ToBePrintSolid.DimX() / 2 * Vector3d.X_AX
|
||||
Case ReferenceBtn.References.MR
|
||||
ptOrig += b3PrintSolid.DimY() / 2 * Vector3d.Y_AX + b3PrintSolid.DimX() * Vector3d.X_AX
|
||||
ptOrig += b3ToBePrintSolid.DimY() / 2 * Vector3d.Y_AX + b3ToBePrintSolid.DimX() * Vector3d.X_AX
|
||||
Case ReferenceBtn.References.BC
|
||||
ptOrig += b3PrintSolid.DimX() / 2 * Vector3d.X_AX
|
||||
ptOrig += b3ToBePrintSolid.DimX() / 2 * Vector3d.X_AX
|
||||
Case ReferenceBtn.References.MC
|
||||
ptOrig += b3PrintSolid.DimY() / 2 * Vector3d.Y_AX + b3PrintSolid.DimX() / 2 * Vector3d.X_AX
|
||||
ptOrig += b3ToBePrintSolid.DimY() / 2 * Vector3d.Y_AX + b3ToBePrintSolid.DimX() / 2 * Vector3d.X_AX
|
||||
End Select
|
||||
Dim vtMovedPart As Vector3d
|
||||
If EgtGetInfo(SelPart.nPartId, KEY_MOVEDPART, vtMovedPart) Then
|
||||
ptOrig = ptOrig - vtMovedPart
|
||||
ElseIf EgtGetInfo(SelPart.nPartId, KEY_MOVEDPART2, vtMovedPart) Then
|
||||
ptOrig = ptOrig - vtMovedPart
|
||||
End If
|
||||
frPrintSolid = New Frame3d(ptOrig)
|
||||
End If
|
||||
Dim nFrameId As Integer = EgtCreateGeoFrame(Map.refTopPanelVM.SelPart.nReferenceLayerId, frPrintSolid, GDB_RT.GLOB)
|
||||
Dim nFrameId As Integer = EgtCreateGeoFrame(SelPart.nReferenceLayerId, frPrintSolid, GDB_RT.GLOB)
|
||||
If nFrameId Then
|
||||
EgtSetName(nFrameId, FRAME_PART)
|
||||
EgtSetMode(nFrameId, GDB_MD.LOCKED)
|
||||
Map.refTopPanelVM.SelPart.UpdateReferenceId(nFrameId)
|
||||
SelPart.UpdateReferenceId(nFrameId)
|
||||
End If
|
||||
EgtSetInfo(Map.refTopPanelVM.SelPart.nReferenceLayerId, KEY_REFERENCE, m_SelReference)
|
||||
Map.refDispositionPanelVM.RefreshPos()
|
||||
EgtDraw()
|
||||
End Sub
|
||||
|
||||
|
||||
|
Before Width: | Height: | Size: 947 B |
|
Before Width: | Height: | Size: 477 B |
|
Before Width: | Height: | Size: 691 B |
|
Before Width: | Height: | Size: 812 B |
|
Before Width: | Height: | Size: 757 B |
|
Before Width: | Height: | Size: 792 B |
|
Before Width: | Height: | Size: 434 B |
|
Before Width: | Height: | Size: 4.3 KiB |
|
Before Width: | Height: | Size: 468 B |
|
Before Width: | Height: | Size: 525 B |
|
Before Width: | Height: | Size: 315 B |
|
Before Width: | Height: | Size: 434 B |
|
Before Width: | Height: | Size: 474 B |
|
Before Width: | Height: | Size: 290 B |
|
Before Width: | Height: | Size: 397 B |
|
Before Width: | Height: | Size: 478 B |
|
Before Width: | Height: | Size: 503 B |
|
After Width: | Height: | Size: 603 B |
|
After Width: | Height: | Size: 671 B |
|
Before Width: | Height: | Size: 1.0 KiB |
|
Before Width: | Height: | Size: 449 B |
|
Before Width: | Height: | Size: 427 B |
|
Before Width: | Height: | Size: 681 B |
|
Before Width: | Height: | Size: 599 B |
|
Before Width: | Height: | Size: 561 B |
|
Before Width: | Height: | Size: 286 B |
|
Before Width: | Height: | Size: 449 B |
|
Before Width: | Height: | Size: 472 B |
|
Before Width: | Height: | Size: 8.4 KiB |
|
Before Width: | Height: | Size: 299 B |
|
Before Width: | Height: | Size: 427 B |
|
Before Width: | Height: | Size: 479 B |
|
Before Width: | Height: | Size: 9.1 KiB |
|
Before Width: | Height: | Size: 318 B |
|
After Width: | Height: | Size: 603 B |
|
Before Width: | Height: | Size: 604 B |
|
Before Width: | Height: | Size: 785 B |
|
Before Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 312 KiB |
|
Before Width: | Height: | Size: 7.7 KiB |
|
Before Width: | Height: | Size: 4.7 KiB After Width: | Height: | Size: 4.9 KiB |
|
Before Width: | Height: | Size: 367 B |
|
Before Width: | Height: | Size: 541 B |
@@ -206,6 +206,7 @@
|
||||
Grid.Row="6"
|
||||
Content="Grid"
|
||||
IsChecked="{Binding bGrid_IsChecked}"
|
||||
IsEnabled="{Binding bGrid_IsEnabled}"
|
||||
Style="{StaticResource ToolBar_TextToggleButton}"/>
|
||||
<Border Grid.Column="1"
|
||||
Grid.Row="5"
|
||||
@@ -270,29 +271,17 @@
|
||||
<Image Source="/Resources/GridViewPanel/CplaneELEVATION.png" Stretch="Uniform"/>
|
||||
</Button>
|
||||
<Button Grid.Column="7"
|
||||
Command="{Binding CPlaneRotate_Command}"
|
||||
ToolTip="{Binding CPlaneRotateToolTip}"
|
||||
Command="{Binding CPlaneOrigin_Command}"
|
||||
ToolTip="{Binding CPlaneOriginToolTip}"
|
||||
Style="{StaticResource ToolBar_Button}">
|
||||
<Image Source="/Resources/GridViewPanel/CplaneROTATE.png" Stretch="Uniform"/>
|
||||
<Image Source="/Resources/GridViewPanel/CplaneORIGIN.png" Stretch="Uniform"/>
|
||||
</Button>
|
||||
<Button Grid.Column="8"
|
||||
Command="{Binding CPlane3P_Command}"
|
||||
ToolTip="{Binding CPlane3PToolTip}"
|
||||
Style="{StaticResource ToolBar_Button}">
|
||||
<Image Source="/Resources/GridViewPanel/CPlane3POINTS.png" Stretch="Uniform"/>
|
||||
</Button>
|
||||
<Button Grid.Column="9"
|
||||
Command="{Binding CPlanePerpObj_Command}"
|
||||
ToolTip="{Binding CPlanePerpObjToolTip}"
|
||||
Style="{StaticResource ToolBar_Button}">
|
||||
<Image Source="/Resources/GridViewPanel/CPlanePERPCURVE.png" Stretch="Uniform"/>
|
||||
</Button>
|
||||
<!--<Button Grid.Column="10"
|
||||
Command="{Binding CPlaneObj_Command}"
|
||||
ToolTip="{Binding CPlaneObjToolTip}"
|
||||
Style="{StaticResource ToolBar_Button}">
|
||||
<Image Source="/Resources/GridViewPanel/CplaneOBJECT.png" Stretch="Uniform"/>
|
||||
</Button>-->
|
||||
</Button>
|
||||
</Grid>
|
||||
</Border>
|
||||
<!--<Popup IsOpen="{Binding IsChecked, ElementName=GridBtn}"
|
||||
@@ -527,15 +516,15 @@
|
||||
<UniformGrid Columns="3">
|
||||
<RadioButton Content="X"
|
||||
GroupName="Axes"
|
||||
IsChecked="{Binding RotAxes[0]}"
|
||||
IsChecked="{Binding RotX}"
|
||||
Style="{StaticResource ToolBar_ToggleButton}"/>
|
||||
<RadioButton Content="Y"
|
||||
GroupName="Axes"
|
||||
IsChecked="{Binding RotAxes[1]}"
|
||||
IsChecked="{Binding RotY}"
|
||||
Style="{StaticResource ToolBar_ToggleButton}"/>
|
||||
<RadioButton Content="Z"
|
||||
GroupName="Axes"
|
||||
IsChecked="{Binding RotAxes[2]}"
|
||||
IsChecked="{Binding RotZ}"
|
||||
Style="{StaticResource ToolBar_ToggleButton}"/>
|
||||
</UniformGrid>
|
||||
<EgtWPFLib5:EgtTextBox Grid.Row="1"
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
Imports System.Collections.ObjectModel
|
||||
Imports System.Collections.Specialized
|
||||
Imports System.Globalization
|
||||
Imports System.Windows.Markup
|
||||
Imports EgtUILib
|
||||
Imports EgtWPFLib5
|
||||
Imports Icarus.RibEntity
|
||||
|
||||
Public Class RibPanelVM
|
||||
Inherits VMBase
|
||||
@@ -41,7 +43,7 @@ Public Class RibPanelVM
|
||||
End Get
|
||||
Set(value As RibEntity)
|
||||
m_SelRib = value
|
||||
EgtDeselectLayerObjs(m_nRibLayerId)
|
||||
EgtDeselectAll()
|
||||
If Not IsNothing(value) Then
|
||||
EgtSelectObj(value.nCurveId)
|
||||
EgtSelectObj(value.nExtrusionId)
|
||||
@@ -73,9 +75,18 @@ Public Class RibPanelVM
|
||||
EgtGetBBoxGlob(nId, GDB_BB.STANDARD, b3Reference)
|
||||
Dim dNewXPos As Double = b3Reference.Min.x
|
||||
StringToLen(value, dNewXPos)
|
||||
If dNewXPos >= 0 AndAlso dNewXPos <= CurrentMachine.b3Tab.DimX Then
|
||||
EgtMove(m_SelRib.nCurveId, New Point3d(dNewXPos, b3Reference.Min.y, b3Reference.Min.z) - b3Reference.Min)
|
||||
EgtMove(m_SelRib.nExtrusionId, New Point3d(dNewXPos, b3Reference.Min.y, b3Reference.Min.z) - b3Reference.Min)
|
||||
Dim dMin As Double = 0
|
||||
Dim dMax As Double = CurrentMachine.b3Tab.DimX
|
||||
Dim nRibType As Integer = Machining.MPAR_RIBSTYPE.INTERNAL
|
||||
EgtGetInfo(m_SelRib.nExtrusionId, MAC_RIBSTYPE, nRibType)
|
||||
If nRibType = Machining.MPAR_RIBSTYPE.EXTERNAL OrElse nRibType = Machining.MPAR_RIBSTYPE.UNBOUNDED Then
|
||||
dMax -= b3Reference.DimX
|
||||
Else
|
||||
dMin -= b3Reference.DimX
|
||||
End If
|
||||
If dNewXPos >= dMin AndAlso dNewXPos <= dMax Then
|
||||
EgtMove(m_SelRib.nCurveId, New Point3d(dNewXPos, b3Reference.Min.y, b3Reference.Min.z) - b3Reference.Min, GDB_RT.GLOB)
|
||||
EgtMove(m_SelRib.nExtrusionId, New Point3d(dNewXPos, b3Reference.Min.y, b3Reference.Min.z) - b3Reference.Min, GDB_RT.GLOB)
|
||||
EgtDraw()
|
||||
Else
|
||||
NotifyPropertyChanged(NameOf(sXPos))
|
||||
@@ -102,9 +113,18 @@ Public Class RibPanelVM
|
||||
EgtGetBBoxGlob(nId, GDB_BB.STANDARD, b3Reference)
|
||||
Dim dNewYPos As Double = b3Reference.Min.y
|
||||
StringToLen(value, dNewYPos)
|
||||
If dNewYPos >= 0 AndAlso dNewYPos <= CurrentMachine.b3Tab.DimY Then
|
||||
EgtMove(m_SelRib.nCurveId, New Point3d(b3Reference.Min.x, dNewYPos, b3Reference.Min.z) - b3Reference.Min)
|
||||
EgtMove(m_SelRib.nExtrusionId, New Point3d(b3Reference.Min.x, dNewYPos, b3Reference.Min.z) - b3Reference.Min)
|
||||
Dim dMin As Double = 0
|
||||
Dim dMax As Double = CurrentMachine.b3Tab.DimY
|
||||
Dim nRibType As Integer = Machining.MPAR_RIBSTYPE.INTERNAL
|
||||
EgtGetInfo(m_SelRib.nExtrusionId, MAC_RIBSTYPE, nRibType)
|
||||
If nRibType = Machining.MPAR_RIBSTYPE.EXTERNAL OrElse nRibType = Machining.MPAR_RIBSTYPE.UNBOUNDED Then
|
||||
dMax -= b3Reference.DimY
|
||||
Else
|
||||
dMin -= b3Reference.DimY
|
||||
End If
|
||||
If dNewYPos >= dMin AndAlso dNewYPos <= dMax Then
|
||||
EgtMove(m_SelRib.nCurveId, New Point3d(b3Reference.Min.x, dNewYPos, b3Reference.Min.z) - b3Reference.Min, GDB_RT.GLOB)
|
||||
EgtMove(m_SelRib.nExtrusionId, New Point3d(b3Reference.Min.x, dNewYPos, b3Reference.Min.z) - b3Reference.Min, GDB_RT.GLOB)
|
||||
EgtDraw()
|
||||
Else
|
||||
NotifyPropertyChanged(NameOf(sYPos))
|
||||
@@ -131,9 +151,9 @@ Public Class RibPanelVM
|
||||
EgtGetBBoxGlob(nId, GDB_BB.STANDARD, b3Reference)
|
||||
Dim dNewZPos As Double = b3Reference.Min.y
|
||||
StringToLen(value, dNewZPos)
|
||||
If dNewZPos >= 0 Then
|
||||
EgtMove(m_SelRib.nCurveId, New Point3d(b3Reference.Min.x, b3Reference.Min.y, dNewZPos) - b3Reference.Min)
|
||||
EgtMove(m_SelRib.nExtrusionId, New Point3d(b3Reference.Min.x, b3Reference.Min.y, dNewZPos) - b3Reference.Min)
|
||||
If dNewZPos >= -1000 Then
|
||||
EgtMove(m_SelRib.nCurveId, New Point3d(b3Reference.Min.x, b3Reference.Min.y, dNewZPos) - b3Reference.Min, GDB_RT.GLOB)
|
||||
EgtMove(m_SelRib.nExtrusionId, New Point3d(b3Reference.Min.x, b3Reference.Min.y, dNewZPos) - b3Reference.Min, GDB_RT.GLOB)
|
||||
EgtDraw()
|
||||
Else
|
||||
NotifyPropertyChanged(NameOf(sZPos))
|
||||
@@ -144,12 +164,28 @@ Public Class RibPanelVM
|
||||
End Property
|
||||
|
||||
Private m_RotAxes() As Boolean = {False, False, True}
|
||||
Public Property RotAxes As Boolean()
|
||||
Public Property RotX As Boolean
|
||||
Get
|
||||
Return m_RotAxes
|
||||
Return m_RotAxes(0)
|
||||
End Get
|
||||
Set(value As Boolean())
|
||||
m_RotAxes = value
|
||||
Set(value As Boolean)
|
||||
m_RotAxes(0) = value
|
||||
End Set
|
||||
End Property
|
||||
Public Property RotY As Boolean
|
||||
Get
|
||||
Return m_RotAxes(1)
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
m_RotAxes(1) = value
|
||||
End Set
|
||||
End Property
|
||||
Public Property RotZ As Boolean
|
||||
Get
|
||||
Return m_RotAxes(2)
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
m_RotAxes(2) = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
@@ -159,7 +195,7 @@ Public Class RibPanelVM
|
||||
Return Vector3d.X_AX
|
||||
ElseIf m_RotAxes(1) Then
|
||||
Return Vector3d.Y_AX
|
||||
ElseIf m_RotAxes(2) Then
|
||||
Else
|
||||
Return Vector3d.Z_AX
|
||||
End If
|
||||
End Get
|
||||
@@ -179,20 +215,20 @@ Public Class RibPanelVM
|
||||
End If
|
||||
Dim nId As Integer = If(m_SelRib.Type = RibEntity.RibTypes.FROMDRAW, m_SelRib.nCurveId, m_SelRib.nExtrusionId)
|
||||
Dim b3Rib As New BBox3d
|
||||
EgtGetBBox(nId, GDB_BB.STANDARD, b3Rib)
|
||||
EgtGetBBoxGlob(nId, GDB_BB.STANDARD, b3Rib)
|
||||
Dim bOk As Boolean = False
|
||||
bOk = EgtRotate(nId, b3Rib.Center(), vtSelRotAxes, dNewAngle)
|
||||
If bOk AndAlso m_SelRib.Type = RibEntity.RibTypes.FROMDRAW Then EgtRotate(m_SelRib.nExtrusionId, b3Rib.Center, vtSelRotAxes, dNewAngle)
|
||||
bOk = EgtRotate(nId, b3Rib.Center(), vtSelRotAxes, dNewAngle, GDB_RT.GLOB)
|
||||
If bOk AndAlso m_SelRib.Type = RibEntity.RibTypes.FROMDRAW Then EgtRotate(m_SelRib.nExtrusionId, b3Rib.Center, vtSelRotAxes, dNewAngle, GDB_RT.GLOB)
|
||||
If bOk Then
|
||||
EgtDraw()
|
||||
RefreshPos()
|
||||
m_sRotAngle = 0
|
||||
NotifyPropertyChanged(NameOf(sRotAngle))
|
||||
' Imposto flag di ricalcolo slice
|
||||
EgtSetInfo(Map.refTopPanelVM.SelPart.nPartId, MAC_TORECALC_SLICE, True)
|
||||
Else
|
||||
m_sRotAngle = value
|
||||
End If
|
||||
' Imposto flag di ricalcolo slice
|
||||
EgtSetInfo(Map.refTopPanelVM.SelPart.nPartId, MAC_TORECALC_SLICE, True)
|
||||
End Set
|
||||
End Property
|
||||
|
||||
@@ -264,6 +300,12 @@ Public Class RibPanelVM
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property bGrid_IsEnabled As Boolean
|
||||
Get
|
||||
Return Map.refMyStatusBarVM.bGridVisibility
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_bMove_IsChecked As Boolean
|
||||
Public Property bMove_IsChecked As Boolean
|
||||
Get
|
||||
@@ -411,6 +453,9 @@ Public Class RibPanelVM
|
||||
#Region "METHODS"
|
||||
|
||||
Friend Sub Init()
|
||||
' asse rotazione di default
|
||||
RotZ = True
|
||||
NotifyPropertyChanged(NameOf(RotZ))
|
||||
' azzero indice
|
||||
StartEntity.ResetSharedIndex()
|
||||
' fisso frame originale
|
||||
@@ -418,6 +463,10 @@ Public Class RibPanelVM
|
||||
' recupero dati pezzo selezionato layer ed entita'
|
||||
m_nPartId = Map.refTopPanelVM.SelPart.nPartId
|
||||
m_nRibLayerId = Map.refTopPanelVM.SelPart.nRibsLayerId
|
||||
If m_nRibLayerId = GDB_ID.NULL Then
|
||||
m_nRibLayerId = EgtCreateGroup(m_nPartId)
|
||||
EgtSetName(m_nRibLayerId, LAY_RIBS)
|
||||
End If
|
||||
'recupero tutte le entita' rib
|
||||
m_RibList.Clear()
|
||||
Dim nRibId As Integer = EgtGetFirstInGroup(m_nRibLayerId)
|
||||
@@ -455,6 +504,7 @@ Public Class RibPanelVM
|
||||
Map.refRightPanelVM.SetSelPanel(RightPanelVM.Panels.NULL)
|
||||
Map.refRibPanelVM.ResetMachParamIsChecked()
|
||||
End If
|
||||
EgtDeselectAll()
|
||||
EgtDraw()
|
||||
Map.refSceneHostVM.MainScene.SetStatusNull()
|
||||
End Sub
|
||||
@@ -525,7 +575,8 @@ Public Class RibPanelVM
|
||||
EgtDraw()
|
||||
' rimetto la selezione scena a null
|
||||
Map.refSceneHostVM.MainScene.SetStatusNull()
|
||||
Case Controller.CMD.GRID_ELEVATION, Controller.CMD.GRID_3P, Controller.CMD.GRID_ORIGIN, Controller.CMD.GRID_PERPCURVE, Controller.CMD.GRID_ROTATE, Controller.CMD.GRID_ROTATE3D
|
||||
Case Controller.CMD.GRID_ELEVATION, Controller.CMD.GRID_3P, Controller.CMD.GRID_ORIGIN, Controller.CMD.GRID_PERPCURVE,
|
||||
Controller.CMD.GRID_ROTATE, Controller.CMD.GRID_ROTATE3D, Controller.CMD.GRID_OBJ
|
||||
' rimetto la selezione scena a null
|
||||
Map.refSceneHostVM.MainScene.SetStatusNull()
|
||||
End Select
|
||||
@@ -612,7 +663,18 @@ Public Class RibPanelVM
|
||||
|
||||
Friend Sub OnKeyDown(Key As Forms.Keys)
|
||||
If Key = Forms.Keys.Escape Then
|
||||
|
||||
' se attiva, disattivo griglia su oggetto
|
||||
If m_bCPlaneObj_IsActive Then
|
||||
m_bCPlaneObj_IsActive = False
|
||||
ResetCPlaneObjIsActive()
|
||||
' ripristino selezioni precedenti
|
||||
For Each Id In Map.refShellNumberPanelVM.PrevSelObjs
|
||||
EgtSelectObj(Id)
|
||||
Next
|
||||
EgtDraw()
|
||||
' rimetto la selezione scena a null
|
||||
Map.refSceneHostVM.MainScene.SetStatusNull()
|
||||
End If
|
||||
End If
|
||||
End Sub
|
||||
|
||||
@@ -634,6 +696,20 @@ Public Class RibPanelVM
|
||||
NotifyPropertyChanged(NameOf(SelRib))
|
||||
End Sub
|
||||
|
||||
Friend Shared Function GetNextRibIndex()
|
||||
Dim nRibIndex As Integer = 0
|
||||
Dim nRibId As Integer = EgtGetFirstInGroup(Map.refTopPanelVM.SelPart.nRibsLayerId)
|
||||
While nRibId <> GDB_ID.NULL
|
||||
Dim nCurrIndex As Integer = GDB_ID.NULL
|
||||
EgtGetInfo(nRibId, RIB_ID, nCurrIndex)
|
||||
If nCurrIndex > nRibIndex Then
|
||||
nRibIndex = nCurrIndex
|
||||
End If
|
||||
nRibId = EgtGetNext(nRibId)
|
||||
End While
|
||||
Return nRibIndex + 1
|
||||
End Function
|
||||
|
||||
#End Region ' METHODS
|
||||
|
||||
#Region "COMMANDS"
|
||||
@@ -1117,6 +1193,22 @@ Public Class RibPanelVM
|
||||
|
||||
#Region "CPlaneObj"
|
||||
|
||||
Private m_bCPlaneObj_IsActive As Boolean = False
|
||||
Friend ReadOnly Property bCPlaneObj_IsActive As Boolean
|
||||
Get
|
||||
Return m_bCPlaneObj_IsActive
|
||||
End Get
|
||||
End Property
|
||||
Friend Sub ResetCPlaneObjIsActive()
|
||||
m_bCPlaneObj_IsActive = False
|
||||
End Sub
|
||||
Private m_PrevSelObjs As New List(Of Integer)
|
||||
Friend ReadOnly Property PrevSelObjs As List(Of Integer)
|
||||
Get
|
||||
Return m_PrevSelObjs
|
||||
End Get
|
||||
End Property
|
||||
|
||||
''' <summary>
|
||||
''' Returns a command that do CPlanepObj.
|
||||
''' </summary>
|
||||
@@ -1134,7 +1226,16 @@ Public Class RibPanelVM
|
||||
''' </summary>
|
||||
Public Sub CPlaneObj(ByVal param As Object)
|
||||
If Map.refSceneHostVM.MainController.GetStep <> 0 Then Return
|
||||
Map.refSceneHostVM.MainController.ExecuteCommand(Controller.CMD.GRID_OBJ)
|
||||
' salvo selezione precedente e deseleziono altri oggetti
|
||||
m_PrevSelObjs.Clear()
|
||||
Dim nSelObjId As Integer = EgtGetFirstSelectedObj()
|
||||
While nSelObjId <> GDB_ID.NULL
|
||||
m_PrevSelObjs.Add(nSelObjId)
|
||||
nSelObjId = EgtGetNextSelectedObj()
|
||||
End While
|
||||
EgtDeselectAll()
|
||||
m_bCPlaneObj_IsActive = True
|
||||
' Map.refControllerInputPanelVM.PrepareInputBox("Grid from Selection", "Select the face of the object where to place the grid", "", False, False)
|
||||
End Sub
|
||||
|
||||
#End Region ' CPlaneObj
|
||||
@@ -1265,7 +1366,10 @@ Public Class RibEntity
|
||||
End Property
|
||||
|
||||
Sub New(Type As RibTypes, nId As Integer)
|
||||
m_nIndex = nSharedIndex
|
||||
If Not EgtGetInfo(nId, RIB_ID, m_nIndex) Then
|
||||
m_nIndex = RibPanelVM.GetNextRibIndex()
|
||||
EgtSetInfo(nId, RIB_ID, m_nIndex)
|
||||
End If
|
||||
m_Type = Type
|
||||
EgtSetInfo(nId, KEY_RIB_TYPE, Type)
|
||||
Select Case Type
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
<EgtWPFLib5:EgtCustomWindow x:Class="CopyFromWndV"
|
||||
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"
|
||||
Style="{DynamicResource {x:Type EgtWPFLib5:EgtCustomWindow}}"
|
||||
Title="{Binding sTitle}" Icon="/Resources/Icarus.ico"
|
||||
WindowStyle="None" ResizeMode="NoResize" IsClosable="False"
|
||||
WindowStartupLocation="CenterOwner"
|
||||
SizeToContent="WidthAndHeight">
|
||||
<Grid Margin="5">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
<TextBlock Text="Select Rib to Copy"
|
||||
HorizontalAlignment="Center"
|
||||
Margin="0,0,0,2.5"/>
|
||||
<ComboBox Grid.Row="1"
|
||||
ItemsSource="{Binding RibList}"
|
||||
SelectedItem="{Binding SelRib}"
|
||||
DisplayMemberPath="ghName"
|
||||
Margin="0,2.5,0,2.5"/>
|
||||
<UniformGrid Grid.Row="2"
|
||||
Rows="1"
|
||||
Margin="0,2.5,0,0">
|
||||
<Button Content="Ok"
|
||||
Command="{Binding Ok_Command}"
|
||||
Style="{StaticResource ToolBar_TextButton}"/>
|
||||
<Button Content="Cancel"
|
||||
Command="{Binding Cancel_Command}"
|
||||
Style="{StaticResource ToolBar_TextButton}"/>
|
||||
</UniformGrid>
|
||||
</Grid>
|
||||
</EgtWPFLib5:EgtCustomWindow>
|
||||
@@ -0,0 +1,18 @@
|
||||
Public Class CopyFromWndV
|
||||
|
||||
Private WithEvents m_CopyFromWndVM As CopyFromWndVM
|
||||
|
||||
Sub New(Owner As Window, CopyFromWndVM As CopyFromWndVM)
|
||||
MyBase.New(Owner)
|
||||
' This call is required by the designer.
|
||||
InitializeComponent()
|
||||
Me.DataContext = CopyFromWndVM
|
||||
' Assegno al riferimento locale al VM il VM preso dal DataContext
|
||||
m_CopyFromWndVM = CopyFromWndVM
|
||||
End Sub
|
||||
|
||||
Private Sub CloseWindow(bDialogResult As Boolean) Handles m_CopyFromWndVM.m_CloseWindow
|
||||
Me.DialogResult = bDialogResult
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
@@ -0,0 +1,182 @@
|
||||
Imports System.Collections.ObjectModel
|
||||
Imports EgtUILib
|
||||
Imports EgtWPFLib5
|
||||
|
||||
Public Class CopyFromWndVM
|
||||
Inherits VMBase
|
||||
|
||||
Friend Event m_CloseWindow(bDialogResult As Boolean)
|
||||
|
||||
Private m_RibList As ObservableCollection(Of RibEntity)
|
||||
Public ReadOnly Property RibList As ObservableCollection(Of RibEntity)
|
||||
Get
|
||||
Return m_RibList
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_SelRib As RibEntity
|
||||
Public Property SelRib As RibEntity
|
||||
Get
|
||||
Return m_SelRib
|
||||
End Get
|
||||
Set(value As RibEntity)
|
||||
m_SelRib = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
' Definizione comandi
|
||||
Private m_cmdOk As ICommand
|
||||
Private m_cmdCancel As ICommand
|
||||
|
||||
Sub New()
|
||||
m_RibList = New ObservableCollection(Of RibEntity)(Map.refRibPanelVM.RibList)
|
||||
m_RibList.Remove(m_RibList.FirstOrDefault(Function(x) x.nExtrusionId = Map.refRibPanelVM.SelRib.nExtrusionId))
|
||||
If m_RibList.Count > 0 Then
|
||||
m_SelRib = m_RibList(0)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
#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 IsNothing(m_SelRib) Then
|
||||
MessageBox.Show("Please select the rib from which to copy the parameters!", "Warning", MessageBoxButton.OK, MessageBoxImage.Warning)
|
||||
Return
|
||||
End If
|
||||
' copio i parametri nella rib corrente
|
||||
Dim ParamList As New List(Of MachiningParam.Params)({MachiningParam.Params.RIBSTYPE,
|
||||
MachiningParam.Params.RIBSOVERLAP,
|
||||
MachiningParam.Params.RIBSSTRANDCOUNT,
|
||||
MachiningParam.Params.RIBSLINK,
|
||||
MachiningParam.Params.RIBSINVERTDIRECTION,
|
||||
MachiningParam.Params.RIBSINVERTSTRANDORDER,
|
||||
MachiningParam.Params.RIBSLEADININVERT,
|
||||
MachiningParam.Params.RIBSLEADINLEN,
|
||||
MachiningParam.Params.RIBSLEADOUTINVERT,
|
||||
MachiningParam.Params.RIBSLEADOUTLEN,
|
||||
MachiningParam.Params.RIBSLEADOUTCOASTING,
|
||||
MachiningParam.Params.RIBSLEADOUTWIPE,
|
||||
MachiningParam.Params.RIBSLEADOUTWIPEDIR})
|
||||
For Each Param In ParamList
|
||||
Select Case Map.refRibPanelVM.SelRib.Type
|
||||
'Case RibEntity.RibTypes.FROMDRAW
|
||||
' CopyParam(Param, m_SelRib.nExtrusionId, Map.refRibPanelVM.SelRib.nCurveId)
|
||||
' CopyParam(Param, m_SelRib.nExtrusionId, Map.refRibPanelVM.SelRib.nExtrusionId)
|
||||
Case RibEntity.RibTypes.FROMIMPORT
|
||||
CopyParam(Param, m_SelRib.nExtrusionId, Map.refRibPanelVM.SelRib.nExtrusionId)
|
||||
End Select
|
||||
Next
|
||||
'' ricarico i parametri
|
||||
'Map.refRibParamPanelVM.Init()
|
||||
RaiseEvent m_CloseWindow(True)
|
||||
End Sub
|
||||
|
||||
Private Sub CopyParam(Type As MachiningParam.Params, nFromId As Integer, nToId As Integer)
|
||||
Dim bRead As Boolean = False
|
||||
Select Case Type
|
||||
Case MachiningParam.Params.RIBSTYPE
|
||||
Dim RibTypeParam As RibComboMachiningParam = Nothing
|
||||
Dim nRibParam As Integer = 0
|
||||
Select Case Type
|
||||
Case MachiningParam.Params.RIBSTYPE
|
||||
RibTypeParam = Map.refRibParamPanelVM.MachiningParamList.FirstOrDefault(Function(x) x.Type = MachiningParam.Params.RIBSTYPE)
|
||||
bRead = EgtGetInfo(nFromId, MAC_RIBSTYPE, nRibParam)
|
||||
End Select
|
||||
If Not IsNothing(RibTypeParam) AndAlso bRead Then
|
||||
RibTypeParam.SelValue = RibTypeParam.ValueList.FirstOrDefault(Function(x) x.Id = nRibParam)
|
||||
Else
|
||||
RibTypeParam.SelValue = RibTypeParam.PartSelValue
|
||||
End If
|
||||
Case MachiningParam.Params.RIBSOVERLAP, MachiningParam.Params.RIBSSTRANDCOUNT, MachiningParam.Params.RIBSLEADINLEN, MachiningParam.Params.RIBSLEADOUTLEN,
|
||||
MachiningParam.Params.RIBSLEADOUTCOASTING, MachiningParam.Params.RIBSLEADOUTWIPE, MachiningParam.Params.RIBSLEADOUTWIPEDIR
|
||||
Dim RibTypeParam As RibNumericMachiningParam = Nothing
|
||||
Dim dRibParam As Double = 0
|
||||
Select Case Type
|
||||
Case MachiningParam.Params.RIBSOVERLAP
|
||||
RibTypeParam = Map.refRibParamPanelVM.MachiningParamList.FirstOrDefault(Function(x) x.Type = MachiningParam.Params.RIBSOVERLAP)
|
||||
bRead = EgtGetInfo(nFromId, MAC_RIBSOVERLAP, dRibParam)
|
||||
Case MachiningParam.Params.RIBSSTRANDCOUNT
|
||||
RibTypeParam = Map.refRibParamPanelVM.MachiningParamList.FirstOrDefault(Function(x) x.Type = MachiningParam.Params.RIBSSTRANDCOUNT)
|
||||
bRead = EgtGetInfo(nFromId, MAC_RIBSSTRANDCOUNT, dRibParam)
|
||||
Case MachiningParam.Params.RIBSLEADINLEN
|
||||
RibTypeParam = Map.refRibParamPanelVM.MachiningParamList.FirstOrDefault(Function(x) x.Type = MachiningParam.Params.RIBSLEADINLEN)
|
||||
bRead = EgtGetInfo(nFromId, MAC_RIBSLEADINLEN, dRibParam)
|
||||
Case MachiningParam.Params.RIBSLEADOUTLEN
|
||||
RibTypeParam = Map.refRibParamPanelVM.MachiningParamList.FirstOrDefault(Function(x) x.Type = MachiningParam.Params.RIBSLEADOUTLEN)
|
||||
bRead = EgtGetInfo(nFromId, MAC_RIBSLEADOUTLEN, dRibParam)
|
||||
Case MachiningParam.Params.RIBSLEADOUTCOASTING
|
||||
RibTypeParam = Map.refRibParamPanelVM.MachiningParamList.FirstOrDefault(Function(x) x.Type = MachiningParam.Params.RIBSLEADOUTCOASTING)
|
||||
bRead = EgtGetInfo(nFromId, MAC_RIBSLEADOUTCOASTING, dRibParam)
|
||||
Case MachiningParam.Params.RIBSLEADOUTWIPE
|
||||
RibTypeParam = Map.refRibParamPanelVM.MachiningParamList.FirstOrDefault(Function(x) x.Type = MachiningParam.Params.RIBSLEADOUTWIPE)
|
||||
bRead = EgtGetInfo(nFromId, MAC_RIBSLEADOUTWIPE, dRibParam)
|
||||
Case MachiningParam.Params.RIBSLEADOUTWIPEDIR
|
||||
RibTypeParam = Map.refRibParamPanelVM.MachiningParamList.FirstOrDefault(Function(x) x.Type = MachiningParam.Params.RIBSLEADOUTWIPEDIR)
|
||||
bRead = EgtGetInfo(nFromId, MAC_RIBSLEADOUTWIPEDIR, dRibParam)
|
||||
End Select
|
||||
If Not IsNothing(RibTypeParam) AndAlso bRead Then
|
||||
RibTypeParam.SetValue(dRibParam)
|
||||
Else
|
||||
RibTypeParam.SetValue(RibTypeParam.dPartValue)
|
||||
End If
|
||||
Case MachiningParam.Params.RIBSLINK, MachiningParam.Params.RIBSINVERTDIRECTION, MachiningParam.Params.RIBSINVERTSTRANDORDER, MachiningParam.Params.RIBSLEADININVERT, MachiningParam.Params.RIBSLEADOUTINVERT
|
||||
Dim RibTypeParam As RibCheckMachiningParam = Nothing
|
||||
Dim bRibParam As Boolean = False
|
||||
Select Case Type
|
||||
Case MachiningParam.Params.RIBSLINK
|
||||
RibTypeParam = Map.refRibParamPanelVM.MachiningParamList.FirstOrDefault(Function(x) x.Type = MachiningParam.Params.RIBSLINK)
|
||||
bRead = EgtGetInfo(nFromId, MAC_RIBSLINK, bRibParam)
|
||||
Case MachiningParam.Params.RIBSINVERTDIRECTION
|
||||
RibTypeParam = Map.refRibParamPanelVM.MachiningParamList.FirstOrDefault(Function(x) x.Type = MachiningParam.Params.RIBSINVERTDIRECTION)
|
||||
bRead = EgtGetInfo(nFromId, MAC_RIBSINVERTDIRECTION, bRibParam)
|
||||
Case MachiningParam.Params.RIBSINVERTSTRANDORDER
|
||||
RibTypeParam = Map.refRibParamPanelVM.MachiningParamList.FirstOrDefault(Function(x) x.Type = MachiningParam.Params.RIBSINVERTSTRANDORDER)
|
||||
bRead = EgtGetInfo(nFromId, MAC_RIBSINVERTSTRANDORDER, bRibParam)
|
||||
Case MachiningParam.Params.RIBSLEADININVERT
|
||||
RibTypeParam = Map.refRibParamPanelVM.MachiningParamList.FirstOrDefault(Function(x) x.Type = MachiningParam.Params.RIBSLEADININVERT)
|
||||
bRead = EgtGetInfo(nFromId, MAC_RIBSLEADININVERT, bRibParam)
|
||||
Case MachiningParam.Params.RIBSLEADOUTINVERT
|
||||
RibTypeParam = Map.refRibParamPanelVM.MachiningParamList.FirstOrDefault(Function(x) x.Type = MachiningParam.Params.RIBSLEADOUTINVERT)
|
||||
bRead = EgtGetInfo(nFromId, MAC_RIBSLEADOUTINVERT, bRibParam)
|
||||
End Select
|
||||
If Not IsNothing(RibTypeParam) AndAlso bRead Then
|
||||
RibTypeParam.bValue = bRibParam
|
||||
Else
|
||||
RibTypeParam.bValue = RibTypeParam.bPartValue
|
||||
End If
|
||||
End Select
|
||||
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()
|
||||
RaiseEvent m_CloseWindow(False)
|
||||
End Sub
|
||||
|
||||
#End Region ' Cancel
|
||||
|
||||
#End Region ' COMMANDS
|
||||
|
||||
End Class
|
||||
@@ -58,7 +58,7 @@
|
||||
<Button Grid.Column="2"
|
||||
Content="R"
|
||||
Command="{Binding ResetParam_Command}"
|
||||
IsEnabled="{Binding bIsModifiedFromDb}"
|
||||
IsEnabled="{Binding bIsModifiedFromPart}"
|
||||
VerticalContentAlignment="Center"
|
||||
HorizontalContentAlignment="Center"
|
||||
Margin="5,0,0,0"
|
||||
@@ -80,7 +80,7 @@
|
||||
<Button Grid.Column="2"
|
||||
Content="R"
|
||||
Command="{Binding ResetParam_Command}"
|
||||
IsEnabled="{Binding bIsModifiedFromDb}"
|
||||
IsEnabled="{Binding bIsModifiedFromPart}"
|
||||
VerticalContentAlignment="Center"
|
||||
HorizontalContentAlignment="Center"
|
||||
Margin="5,0,0,0"
|
||||
@@ -120,6 +120,9 @@
|
||||
<Button Content="Cancel"
|
||||
Command="{Binding Cancel_Command}"
|
||||
Style="{StaticResource ToolBar_TextButton}"/>
|
||||
<Button Content="Copy From"
|
||||
Command="{Binding CopyFrom_Command}"
|
||||
Style="{StaticResource ToolBar_TextButton}"/>
|
||||
</UniformGrid>
|
||||
</Grid>
|
||||
</Border>
|
||||
|
||||
@@ -10,6 +10,7 @@ Public Class RibParamPanelVM
|
||||
' Definizione comandi
|
||||
Private m_cmdOk As ICommand
|
||||
Private m_cmdCancel As ICommand
|
||||
Private m_cmdCopyFrom As ICommand
|
||||
|
||||
#End Region ' FIELDS & PROPERTIES
|
||||
|
||||
@@ -41,12 +42,15 @@ Public Class RibParamPanelVM
|
||||
|
||||
m_Type = Cathegories.RIBS
|
||||
m_sName = "Ribs"
|
||||
m_MachiningParamList = New List(Of MachiningParam)({New RibNumericMachiningParam(MachiningParam.Params.RIBSOVERLAP, nRibId, nPartId),
|
||||
m_MachiningParamList = New List(Of MachiningParam)({New RibComboMachiningParam(MachiningParam.Params.RIBSTYPE, nRibId, nPartId),
|
||||
New RibNumericMachiningParam(MachiningParam.Params.RIBSOVERLAP, nRibId, nPartId),
|
||||
New RibNumericMachiningParam(MachiningParam.Params.RIBSSTRANDCOUNT, nRibId, nPartId),
|
||||
New RibNumericMachiningParam(MachiningParam.Params.RIBSINVERTDIRECTION, nRibId, nPartId),
|
||||
New RibNumericMachiningParam(MachiningParam.Params.RIBSLEADININVERT, nRibId, nPartId),
|
||||
New RibCheckMachiningParam(MachiningParam.Params.RIBSLINK, nRibId, nPartId),
|
||||
New RibCheckMachiningParam(MachiningParam.Params.RIBSINVERTDIRECTION, nRibId, nPartId),
|
||||
New RibCheckMachiningParam(MachiningParam.Params.RIBSINVERTSTRANDORDER, nRibId, nPartId),
|
||||
New RibCheckMachiningParam(MachiningParam.Params.RIBSLEADININVERT, nRibId, nPartId),
|
||||
New RibNumericMachiningParam(MachiningParam.Params.RIBSLEADINLEN, nRibId, nPartId),
|
||||
New RibNumericMachiningParam(MachiningParam.Params.RIBSLEADOUTINVERT, nRibId, nPartId),
|
||||
New RibCheckMachiningParam(MachiningParam.Params.RIBSLEADOUTINVERT, nRibId, nPartId),
|
||||
New RibNumericMachiningParam(MachiningParam.Params.RIBSLEADOUTLEN, nRibId, nPartId),
|
||||
New RibNumericMachiningParam(MachiningParam.Params.RIBSLEADOUTCOASTING, nRibId, nPartId),
|
||||
New RibNumericMachiningParam(MachiningParam.Params.RIBSLEADOUTWIPE, nRibId, nPartId),
|
||||
@@ -70,9 +74,21 @@ Public Class RibParamPanelVM
|
||||
Friend Sub WriteParamsInRib(nRibId As Integer)
|
||||
' se parametri modificati
|
||||
Dim bModified As Boolean = False
|
||||
For Each Param As RibNumericMachiningParam In m_MachiningParamList
|
||||
If Param.bIsModified AndAlso Not bModified Then bModified = True
|
||||
Param.WriteParamInRib(nRibId)
|
||||
For Each Param In m_MachiningParamList
|
||||
Select Case Param.GetType()
|
||||
Case GetType(RibNumericMachiningParam)
|
||||
Dim NumericParam As RibNumericMachiningParam = TryCast(Param, RibNumericMachiningParam)
|
||||
If NumericParam.bIsModified AndAlso Not bModified Then bModified = True
|
||||
NumericParam.WriteParamInRib(nRibId)
|
||||
Case GetType(RibComboMachiningParam)
|
||||
Dim ComboParam As RibComboMachiningParam = TryCast(Param, RibComboMachiningParam)
|
||||
If ComboParam.bIsModified AndAlso Not bModified Then bModified = True
|
||||
ComboParam.WriteParamInRib(nRibId)
|
||||
Case GetType(RibCheckMachiningParam)
|
||||
Dim CheckParam As RibCheckMachiningParam = TryCast(Param, RibCheckMachiningParam)
|
||||
If CheckParam.bIsModified AndAlso Not bModified Then bModified = True
|
||||
CheckParam.WriteParamInRib(nRibId)
|
||||
End Select
|
||||
Next
|
||||
If bModified Then
|
||||
' Imposto flag di ricalcolo slice
|
||||
@@ -97,6 +113,12 @@ Public Class RibParamPanelVM
|
||||
|
||||
Public Sub Ok()
|
||||
If Not IsNothing(Map.refRibPanelVM.SelRib) Then
|
||||
' verifico se modificata tipologia Ribs
|
||||
Dim bIsModifiedRibsType As Boolean = False
|
||||
Dim RibsTypeParam As MachiningParam = MachiningParamList.FirstOrDefault(Function(y) y.Type = MachiningParam.Params.RIBSTYPE)
|
||||
If Not IsNothing(RibsTypeParam) Then
|
||||
bIsModifiedRibsType = RibsTypeParam.bIsModified
|
||||
End If
|
||||
' scrivo i parametri modificati
|
||||
Select Case Map.refRibPanelVM.SelRib.Type
|
||||
Case RibEntity.RibTypes.FROMDRAW
|
||||
@@ -105,6 +127,12 @@ Public Class RibParamPanelVM
|
||||
Case RibEntity.RibTypes.FROMIMPORT
|
||||
WriteParamsInRib(Map.refRibPanelVM.SelRib.nExtrusionId)
|
||||
End Select
|
||||
SaveCurrParams()
|
||||
' se modificata tipologia Ribs, aggiorno posizione riferimento e pezzo
|
||||
If bIsModifiedRibsType Then
|
||||
Map.refReferencePanelVM.UpdateFramePosition()
|
||||
Map.refDispositionPanelVM.UpdateZPos()
|
||||
End If
|
||||
End If
|
||||
' ripristino modalita' standard
|
||||
Map.refRightPanelVM.SetSelPanel(RightPanelVM.Panels.NULL)
|
||||
@@ -132,6 +160,26 @@ Public Class RibParamPanelVM
|
||||
|
||||
#End Region ' Cancel
|
||||
|
||||
#Region "CopyFrom"
|
||||
|
||||
Public ReadOnly Property CopyFrom_Command As ICommand
|
||||
Get
|
||||
If m_cmdCopyFrom Is Nothing Then
|
||||
m_cmdCopyFrom = New Command(AddressOf CopyFrom)
|
||||
End If
|
||||
Return m_cmdCopyFrom
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Sub CopyFrom()
|
||||
Dim CopyFromWndVM As New CopyFromWndVM
|
||||
Dim CopyFromWndV As New CopyFromWndV(Application.Current.MainWindow, CopyFromWndVM)
|
||||
CopyFromWndV.ShowDialog()
|
||||
Dim x = CopyFromWndVM.SelRib
|
||||
End Sub
|
||||
|
||||
#End Region ' CopyFrom
|
||||
|
||||
#End Region ' COMMANDS
|
||||
|
||||
End Class
|
||||
@@ -153,6 +201,11 @@ Public Class RibNumericMachiningParam
|
||||
NotifyPropertyChanged(NameOf(bIsModifiedFromPart))
|
||||
End Set
|
||||
End Property
|
||||
Friend Sub SetValue(value As Double)
|
||||
m_dValue = value
|
||||
NotifyPropertyChanged(NameOf(sValue))
|
||||
NotifyPropertyChanged(NameOf(bIsModifiedFromPart))
|
||||
End Sub
|
||||
|
||||
Private m_dPartValue As Double
|
||||
Public ReadOnly Property dPartValue As Double
|
||||
@@ -186,6 +239,10 @@ Public Class RibNumericMachiningParam
|
||||
bReadFromPart = EgtGetInfo(nRibId, MAC_RIBSINVERTDIRECTION, m_dValue)
|
||||
EgtGetInfo(nPartId, MAC_RIBSINVERTDIRECTION, m_dPartValue)
|
||||
m_bIsLen = True
|
||||
Case Params.RIBSINVERTSTRANDORDER
|
||||
bReadFromPart = EgtGetInfo(nRibId, MAC_RIBSINVERTSTRANDORDER, m_dValue)
|
||||
EgtGetInfo(nPartId, MAC_RIBSINVERTSTRANDORDER, m_dPartValue)
|
||||
m_bIsLen = True
|
||||
Case Params.RIBSLEADININVERT
|
||||
bReadFromPart = EgtGetInfo(nRibId, MAC_RIBSLEADININVERT, m_dValue)
|
||||
EgtGetInfo(nPartId, MAC_RIBSLEADININVERT, m_dPartValue)
|
||||
@@ -248,6 +305,12 @@ Public Class RibNumericMachiningParam
|
||||
Else
|
||||
EgtRemoveInfo(nRibId, MAC_RIBSINVERTDIRECTION)
|
||||
End If
|
||||
Case Params.RIBSINVERTSTRANDORDER
|
||||
If bIsModifiedFromPart Then
|
||||
EgtSetInfo(nRibId, MAC_RIBSINVERTSTRANDORDER, sWriteValue)
|
||||
Else
|
||||
EgtRemoveInfo(nRibId, MAC_RIBSINVERTSTRANDORDER)
|
||||
End If
|
||||
Case Params.RIBSLEADININVERT
|
||||
If bIsModifiedFromPart Then
|
||||
EgtSetInfo(nRibId, MAC_RIBSLEADININVERT, sWriteValue)
|
||||
@@ -324,4 +387,236 @@ Public Class RibNumericMachiningParam
|
||||
|
||||
#End Region ' COMMANDS
|
||||
|
||||
End Class
|
||||
|
||||
Public Class RibComboMachiningParam
|
||||
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))
|
||||
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)
|
||||
MyBase.New(Type)
|
||||
Dim bReadFromRib As Boolean = False
|
||||
Dim bReadFromPart As Boolean = False
|
||||
Select Case Type
|
||||
Case Params.RIBSTYPE
|
||||
m_ValueList = New List(Of IdNameStruct)({New IdNameStruct(Machining.MPAR_RIBSTYPE.INTERNAL, "Internal"),
|
||||
New IdNameStruct(Machining.MPAR_RIBSTYPE.EXTERNAL, "External"),
|
||||
New IdNameStruct(Machining.MPAR_RIBSTYPE.UNBOUNDED, "Unbounded"),
|
||||
New IdNameStruct(Machining.MPAR_RIBSTYPE.SUPPORT, "Support")})
|
||||
Dim nSelValue As Integer = 1
|
||||
bReadFromRib = EgtGetInfo(nRibId, MAC_RIBSTYPE, nSelValue)
|
||||
If bReadFromRib Then
|
||||
m_SelValue = m_ValueList.FirstOrDefault(Function(x) x.Id = nSelValue)
|
||||
End If
|
||||
bReadFromPart = EgtGetInfo(nPartId, MAC_RIBSTYPE, 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
|
||||
ElseIf Type = Params.RIBSTYPE Then
|
||||
m_OrigSelValue = m_ValueList.FirstOrDefault(Function(x) x.Id = Machining.MPAR_RIBSTYPE.INTERNAL)
|
||||
m_SelValue = m_OrigSelValue
|
||||
End If
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Friend Sub WriteParamInRib(nRibId As Integer)
|
||||
Select Case Type
|
||||
Case Params.RIBSTYPE
|
||||
If bIsModifiedFromPart Then
|
||||
EgtSetInfo(nRibId, MAC_RIBSTYPE, m_SelValue.Id)
|
||||
Else
|
||||
EgtRemoveInfo(nRibId, MAC_RIBSTYPE)
|
||||
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
|
||||
|
||||
Public Class RibCheckMachiningParam
|
||||
Inherits CheckMachiningParam
|
||||
|
||||
Public Overrides Property bValue As Boolean
|
||||
Get
|
||||
Return m_bValue
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
m_bValue = value
|
||||
NotifyPropertyChanged(NameOf(bValue))
|
||||
NotifyPropertyChanged(NameOf(bIsModifiedFromPart))
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Protected m_bPartValue As Boolean
|
||||
Public ReadOnly Property bPartValue As Boolean
|
||||
Get
|
||||
Return m_bPartValue
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property bIsModifiedFromPart As Boolean
|
||||
Get
|
||||
Return m_bValue <> m_bPartValue
|
||||
End Get
|
||||
End Property
|
||||
|
||||
' Definizione comandi
|
||||
Private m_cmdResetParam As ICommand
|
||||
|
||||
Sub New(Type As Params, nRibId As Integer, nPartId As Integer)
|
||||
MyBase.New(Type)
|
||||
Dim bReadFromPart As Boolean = False
|
||||
Select Case Type
|
||||
Case Params.RIBSLINK
|
||||
bReadFromPart = EgtGetInfo(nRibId, MAC_RIBSLINK, m_bValue)
|
||||
EgtGetInfo(nPartId, MAC_RIBSLINK, m_bPartValue)
|
||||
Case Params.RIBSINVERTDIRECTION
|
||||
bReadFromPart = EgtGetInfo(nRibId, MAC_RIBSINVERTDIRECTION, m_bValue)
|
||||
EgtGetInfo(nPartId, MAC_RIBSINVERTDIRECTION, m_bPartValue)
|
||||
Case Params.RIBSINVERTSTRANDORDER
|
||||
bReadFromPart = EgtGetInfo(nRibId, MAC_RIBSINVERTSTRANDORDER, m_bValue)
|
||||
EgtGetInfo(nPartId, MAC_RIBSINVERTSTRANDORDER, m_bPartValue)
|
||||
Case Params.RIBSLEADININVERT
|
||||
bReadFromPart = EgtGetInfo(nRibId, MAC_RIBSLEADININVERT, m_bValue)
|
||||
EgtGetInfo(nPartId, MAC_RIBSLEADININVERT, m_bPartValue)
|
||||
Case Params.RIBSLEADOUTINVERT
|
||||
bReadFromPart = EgtGetInfo(nRibId, MAC_RIBSLEADOUTINVERT, m_bValue)
|
||||
EgtGetInfo(nPartId, MAC_RIBSLEADOUTINVERT, m_bPartValue)
|
||||
End Select
|
||||
m_bOrigValue = m_bValue
|
||||
If Not bReadFromPart Then
|
||||
m_bValue = m_bPartValue
|
||||
m_bOrigValue = m_bPartValue
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Friend Sub WriteParamInRib(nRibId As Integer)
|
||||
Select Case Type
|
||||
Case Params.RIBSLINK
|
||||
If bIsModifiedFromPart Then
|
||||
EgtSetInfo(nRibId, MAC_RIBSLINK, If(m_bValue, 1, 0))
|
||||
Else
|
||||
EgtRemoveInfo(nRibId, MAC_RIBSLINK)
|
||||
End If
|
||||
Case Params.RIBSINVERTDIRECTION
|
||||
If bIsModifiedFromPart Then
|
||||
EgtSetInfo(nRibId, MAC_RIBSINVERTDIRECTION, If(m_bValue, 1, 0))
|
||||
Else
|
||||
EgtRemoveInfo(nRibId, MAC_RIBSINVERTDIRECTION)
|
||||
End If
|
||||
Case Params.RIBSINVERTSTRANDORDER
|
||||
If bIsModifiedFromPart Then
|
||||
EgtSetInfo(nRibId, MAC_RIBSINVERTSTRANDORDER, If(m_bValue, 1, 0))
|
||||
Else
|
||||
EgtRemoveInfo(nRibId, MAC_RIBSINVERTSTRANDORDER)
|
||||
End If
|
||||
Case Params.RIBSLEADININVERT
|
||||
If bIsModifiedFromPart Then
|
||||
EgtSetInfo(nRibId, MAC_RIBSLEADININVERT, If(m_bValue, 1, 0))
|
||||
Else
|
||||
EgtRemoveInfo(nRibId, MAC_RIBSLEADININVERT)
|
||||
End If
|
||||
Case Params.RIBSLEADOUTINVERT
|
||||
If bIsModifiedFromPart Then
|
||||
EgtSetInfo(nRibId, MAC_RIBSLEADOUTINVERT, If(m_bValue, 1, 0))
|
||||
Else
|
||||
EgtRemoveInfo(nRibId, MAC_RIBSLEADOUTINVERT)
|
||||
End If
|
||||
End Select
|
||||
End Sub
|
||||
|
||||
Friend Overrides Sub SaveParam()
|
||||
m_bOrigValue = m_bValue
|
||||
End Sub
|
||||
|
||||
Friend Overrides Sub ResetParam()
|
||||
m_bValue = m_bOrigValue
|
||||
NotifyPropertyChanged(NameOf(bValue))
|
||||
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_bValue = m_bPartValue
|
||||
NotifyPropertyChanged(NameOf(bValue))
|
||||
NotifyPropertyChanged(NameOf(bIsModifiedFromPart))
|
||||
End Sub
|
||||
|
||||
#End Region ' ResetParam
|
||||
|
||||
#End Region ' COMMANDS
|
||||
|
||||
|
||||
End Class
|
||||
|
||||