diff --git a/3dPrintApp/3dPrintApp.vbproj b/3dPrintApp/3dPrintApp.vbproj
index d7c80ad..1954acd 100644
--- a/3dPrintApp/3dPrintApp.vbproj
+++ b/3dPrintApp/3dPrintApp.vbproj
@@ -78,6 +78,11 @@
MSBuild:CompileDesigner
+
+ ChooseReferenceWndV.xaml
+
+
+
@@ -87,10 +92,23 @@
+
+ ControllerInputPanelV.xaml
+
+ CurrLayerSliderV.xaml
+
+ DispositionPanelV.xaml
+
+
+
+ ImportPanelV.xaml
+
+
+ InstrumentPanelV.xaml
@@ -103,6 +121,13 @@
MachinePanelV.xaml
+
+
+ CurrMachiningPanelV.xaml
+
+
+
+ ProjectV.xaml
@@ -111,6 +136,10 @@
ProjManagerV.xaml
+
+ RightPanelV.xaml
+
+ SceneHostV.xaml
@@ -122,11 +151,19 @@
ShowPanelV.xaml
+
+ SliceManagerV.xaml
+
+ Printing3DPanelV.xaml
+
+ StartMachPanelV.xaml
+
+ StatusBarV.xaml
@@ -135,11 +172,16 @@
TopPanelV.xaml
+
+
+ TFSEditorV.xaml
+ Dictionary.xaml
+
@@ -149,10 +191,26 @@
ViewPanelV.xaml
+
+ Designer
+ MSBuild:Compile
+
+
+ MSBuild:Compile
+ Designer
+ DesignerMSBuild:Compile
+
+ MSBuild:Compile
+ Designer
+
+
+ Designer
+ MSBuild:Compile
+ MSBuild:CompileDesigner
@@ -165,6 +223,10 @@
MSBuild:CompileDesigner
+
+ Designer
+ MSBuild:Compile
+ MSBuild:CompileDesigner
@@ -189,6 +251,10 @@
MSBuild:CompileDesigner
+
+ MSBuild:Compile
+ Designer
+ MSBuild:CompileDesigner
@@ -201,10 +267,18 @@
MSBuild:CompileDesigner
+
+ Designer
+ MSBuild:Compile
+ MSBuild:CompileDesigner
+
+ MSBuild:Compile
+ Designer
+ MSBuild:CompileDesigner
@@ -213,6 +287,10 @@
DesignerMSBuild:Compile
+
+ Designer
+ MSBuild:Compile
+ MSBuild:CompileDesigner
@@ -274,6 +352,8 @@
Settings.Designer.vb
+
+
@@ -327,7 +407,48 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ IF "$(PlatformName)"=="x64" IF "$(ConfigurationName)" == "Release" copy $(TargetPath) c:\EgtProg\3dPrintApp\3dPrintAppR64.exe
diff --git a/3dPrintApp/ChooseReferenceWnd/ChooseReferenceWndV.xaml b/3dPrintApp/ChooseReferenceWnd/ChooseReferenceWndV.xaml
new file mode 100644
index 0000000..2308e70
--- /dev/null
+++ b/3dPrintApp/ChooseReferenceWnd/ChooseReferenceWndV.xaml
@@ -0,0 +1,80 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/3dPrintApp/ChooseReferenceWnd/ChooseReferenceWndV.xaml.vb b/3dPrintApp/ChooseReferenceWnd/ChooseReferenceWndV.xaml.vb
new file mode 100644
index 0000000..ec648e1
--- /dev/null
+++ b/3dPrintApp/ChooseReferenceWnd/ChooseReferenceWndV.xaml.vb
@@ -0,0 +1,18 @@
+Public Class ChooseReferenceWndV
+
+ Private WithEvents m_ChooseReferenceWndVM As ChooseReferenceWndVM
+
+ Sub New(Owner As Window, ChooseReferenceWndVM As ChooseReferenceWndVM)
+ MyBase.New(Owner)
+ ' This call is required by the designer.
+ InitializeComponent()
+ Me.DataContext = ChooseReferenceWndVM
+ ' Assegno al riferimento locale al VM il VM preso dal DataContext
+ m_ChooseReferenceWndVM = ChooseReferenceWndVM
+ End Sub
+
+ Private Sub CloseWindow(bDialogResult As Boolean) Handles m_ChooseReferenceWndVM.m_CloseWindow
+ Me.DialogResult = bDialogResult
+ End Sub
+
+End Class
diff --git a/3dPrintApp/ChooseReferenceWnd/ChooseReferenceWndVM.vb b/3dPrintApp/ChooseReferenceWnd/ChooseReferenceWndVM.vb
new file mode 100644
index 0000000..14843e0
--- /dev/null
+++ b/3dPrintApp/ChooseReferenceWnd/ChooseReferenceWndVM.vb
@@ -0,0 +1,63 @@
+Imports EgtUILib
+Imports EgtWPFLib5
+
+Public Class ChooseReferenceWndVM
+
+ Friend Event m_CloseWindow(bDialogResult As Boolean)
+
+ Public Enum References As Integer
+ TL = 1
+ TR = 2
+ BL = 3
+ BR = 4
+ TC = 5
+ ML = 6
+ MR = 7
+ BC = 8
+ MC = 9
+ End Enum
+
+ Private m_ReferenceList() As Boolean = {False, False, True, False, False, False, False, False, False}
+ Public Property ReferenceList As Boolean()
+ Get
+ Return m_ReferenceList
+ End Get
+ Set(value As Boolean())
+ m_ReferenceList = value
+ End Set
+ End Property
+
+ Public Property SelReference As References
+ Get
+ Return Array.IndexOf(m_ReferenceList, True) + 1
+ End Get
+ Set(value As References)
+ m_ReferenceList(value - 1) = True
+ End Set
+ End Property
+
+ ' Definizione comandi
+ Private m_cmdOk As ICommand
+
+#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()
+ RaiseEvent m_CloseWindow(True)
+ End Sub
+
+#End Region ' Ok
+
+#End Region ' COMMANDS
+
+End Class
diff --git a/3dPrintApp/Constants/Const3dPrint.vb b/3dPrintApp/Constants/Const3dPrint.vb
new file mode 100644
index 0000000..b381a67
--- /dev/null
+++ b/3dPrintApp/Constants/Const3dPrint.vb
@@ -0,0 +1,99 @@
+Public Module Const3dPrint
+
+ Public Const TABLE = "Table"
+ Public Const PART = "Part"
+ Public Const ORIGINAL_SOLID = "OriginalSolid"
+ Public Const PRINT_SOLID = "PrintSolid"
+ Public Const LAY_MACHSTART = "MachStart"
+ Public Const LAY_REFERENCE = "Reference"
+ Public Const LAY_OTHERS = "Aux"
+ Public Const LAY_RIBS = "Ribs"
+ Public Const LAY_AUXSOLIDS = "AuxSolids"
+ Public Const FRAME_PART = "FramePart"
+ Public Const START_GEOM = "Start"
+ Public Const VIEWPARAMS = "ViewParams"
+ Public Const IMPORTED_SOLID = "ImportedSolid"
+ Public Const RESULT_READ_PROG = "ResultReadProg"
+
+
+ ' parametri calcolo tempi, F ed S
+ Public Const LAY_TFSCALC = "TFSCalc"
+ Public Const KEY_TMIN = "TMin"
+ Public Const KEY_TTRG = "TTrg"
+ Public Const KEY_TMAX = "TMax"
+ Public Const KEY_FMIN = "FMin"
+ Public Const KEY_FTRG = "FTrg"
+ Public Const KEY_FMAX = "FMax"
+ Public Const KEY_TCUR = "TCur"
+ Public Const KEY_FCUR = "FCur"
+ Public Const KEY_LENGTH = "Length"
+ Public Const KEY_SPEED = "Speed"
+
+ ' parametri Materiali
+ Public Const MAT_GUID = "GUID"
+ Public Const MAT_NAME = "Name"
+ Public Const MAT_T1 = "T1"
+ Public Const MAT_T2 = "T2"
+ Public Const MAT_T3 = "T3"
+ Public Const MAT_T4 = "T4"
+ Public Const MAT_T5 = "T5"
+ Public Const MAT_K = "K"
+ Public Const MAT_C1 = "C1"
+ Public Const MAT_C2 = "C2"
+ Public Const MAT_DENSITY = "Density"
+ Public Const MAT_AMAX = "AMax"
+ Public Const MAT_ATrg = "ATrg"
+ Public Const MAT_AMin = "AMin"
+ Public Const MAT_BMAX = "BMax"
+ Public Const MAT_BTrg = "BTrg"
+ Public Const MAT_BMin = "BMin"
+ Public Const MAT_KW = "KW"
+ Public Const MAT_KZ = "KZ"
+ Public Const MAT_KN = "KN"
+
+ ' parametri Lavorazione
+ Public Const MAC_GUID = "MacGuid"
+ Public Const MAC_NAME = "Name"
+ Public Const MAC_SLICING45 = "Slicing45"
+ Public Const MAC_STRANDH = "StrandH"
+ Public Const MAC_STRANDW = "StrandW"
+ Public Const MAC_STRANDCOUNT = "StrandCount"
+ Public Const MAC_OFFSET = "Offset"
+ Public Const MAC_STARTPOINTOFFSETONSLICE = "StartPointOffsetOnSlice"
+ Public Const MAC_STRANDORDER = "StrandOrder"
+ Public Const MAC_DIRECTION = "Direction"
+ Public Const MAC_LINKTYPE = "LinkType"
+ Public Const MAC_LINKPARAM = "LinkParam"
+ Public Const MAC_LINKZUP = "LinkZup"
+ Public Const MAC_OFFSETLEADPOINT = "OffsetLeadPoint"
+ Public Const MAC_LEADIN = "LeadIn"
+ Public Const MAC_LEADINTANGDIST = "LeadInTangDist"
+ Public Const MAC_LEADINORTHODIST = "LeadInOrthoDist"
+ Public Const MAC_LEADOUT = "LeadOut"
+ Public Const MAC_LEADOUTTANGDIST = "LeadOutTangDist"
+ Public Const MAC_LEADOUTORTHODIST = "LeadOutOrthoDist"
+ Public Const MAC_COASTINGLEN = "CoastingLen"
+ Public Const MAC_COASTINGFEED = "CoastingFeed"
+ Public Const MAC_WIPELEN = "WipeLen"
+ Public Const MAC_WIPEFEEDPU = "WipeFeedPu"
+ Public Const MAC_FLOORCOUNT = "FloorCount"
+ Public Const MAC_G0FEED = "G0Feed"
+ Public Const MAC_TOOLDIAM = "ToolDiam"
+ 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_RIBSLEADININVERT = "RibsLeadInInvert"
+ Public Const MAC_RIBSLEADINLEN = "RibsLeadInLen"
+ Public Const MAC_RIBSLEADOUTINVERT = "RibsLeadOutInvert"
+ Public Const MAC_RIBSLEADOUTLEN = "RibsLeadOutLen"
+ Public Const MAC_RIBSLEADOUTCOASTING = "RibsLeadOutCoasting"
+ Public Const MAC_RIBSLEADOUTWIPE = "RibsLeadOutWipe"
+ Public Const MAC_RIBSLEADOUTWIPEDIR = "RibsLeadOutWipeDir"
+ Public Const MAC_MATERIALS = "Materials"
+
+
+ Public Const FILE_PATH = "FilePath"
+
+End Module
diff --git a/3dPrintApp/Constants/ConstGen.vb b/3dPrintApp/Constants/ConstGen.vb
index 1623224..ffbf0cd 100644
--- a/3dPrintApp/Constants/ConstGen.vb
+++ b/3dPrintApp/Constants/ConstGen.vb
@@ -26,12 +26,25 @@ Public Module ConstGen
' Pagine del programma
Public Enum Pages As Integer
- VIEW = 0
- MACHINING = 1
- SUPERVISOR = 2
- CONFIG = 3
- INPUTS = 4
- OUTPUTS = 5
+ NULL = 0
+ IMPORT = 1
+ MODIFY = 2
+ SLICE = 3
+ SIMULATION = 4
+ MATERIALDB = 5
+ MACHININGDB = 6
+ CURRMACHINING = 7
+ End Enum
+
+ ' MOdalita' di modifica
+ Public Enum ModifyModes As Integer
+ NULL = 0
+ DISPOSITION = 2
+ REFERENCE = 3
+ STARTMACH = 4
+ RIBS = 5
+ SHELLNUMBER = 6
+ AUXSOLIDS = 7
End Enum
' Abilitazioni licenza
diff --git a/3dPrintApp/Constants/ConstIni.vb b/3dPrintApp/Constants/ConstIni.vb
index 018413f..d9f5dca 100644
--- a/3dPrintApp/Constants/ConstIni.vb
+++ b/3dPrintApp/Constants/ConstIni.vb
@@ -99,7 +99,9 @@ Public Module ConstIni
Public Const S_PRINTING3D As String = "3dPrinting"
Public Const K_3PRNBASEDIR As String = "BaseDir"
Public Const K_CURRMATERIAL As String = "CurrMaterial"
+ Public Const K_CURRMACHINING As String = "CurrMachining"
Public Const S_MRUFILES As String = "MruFiles"
+ Public Const S_MRUIMPORTFILES As String = "MruImportFiles"
End Module
diff --git a/3dPrintApp/ControllerInputPanel/ControllerInputPanelV.xaml b/3dPrintApp/ControllerInputPanel/ControllerInputPanelV.xaml
new file mode 100644
index 0000000..899a61f
--- /dev/null
+++ b/3dPrintApp/ControllerInputPanel/ControllerInputPanelV.xaml
@@ -0,0 +1,46 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/3dPrintApp/ControllerInputPanel/ControllerInputPanelV.xaml.vb b/3dPrintApp/ControllerInputPanel/ControllerInputPanelV.xaml.vb
new file mode 100644
index 0000000..5c01e17
--- /dev/null
+++ b/3dPrintApp/ControllerInputPanel/ControllerInputPanelV.xaml.vb
@@ -0,0 +1,3 @@
+Public Class ControllerInputPanelV
+
+End Class
diff --git a/3dPrintApp/ControllerInputPanel/ControllerInputPanelVM.vb b/3dPrintApp/ControllerInputPanel/ControllerInputPanelVM.vb
new file mode 100644
index 0000000..4bc2a73
--- /dev/null
+++ b/3dPrintApp/ControllerInputPanel/ControllerInputPanelVM.vb
@@ -0,0 +1,335 @@
+Imports System.Collections.ObjectModel
+Imports EgtUILib
+Imports EgtWPFLib5
+
+Public Class ControllerInputPanelVM
+ Inherits VMBase
+
+#Region "FIELDS & PROPERTIES"
+
+ Private m_Title As String
+ Public Property Title As String
+ Get
+ Return m_Title
+ End Get
+ Set(value As String)
+ m_Title = value
+ NotifyPropertyChanged(NameOf(Title))
+ End Set
+ End Property
+
+ ' TextBlock fields
+ Private m_Message As String
+ Public Property Message As String
+ Get
+ Return m_Message
+ End Get
+ Set(value As String)
+ m_Message = value
+ NotifyPropertyChanged(NameOf(Message))
+ End Set
+ End Property
+
+ ' TextBox fields
+ Private m_Text As String
+ Public Property Text As String
+ Get
+ Return m_Text
+ End Get
+ Set(value As String)
+ m_Text = value
+ 'Map.refProjectVM.NotifyInputText(value)
+ NotifyPropertyChanged(NameOf(Text))
+ End Set
+ End Property
+
+ Private m_Text_Visibility As Visibility
+ Public Property Text_Visibility As Visibility
+ Get
+ Return m_Text_Visibility
+ End Get
+ Set(value As Visibility)
+ If value <> m_Text_Visibility Then
+ m_Text_Visibility = value
+ NotifyPropertyChanged(NameOf(Text_Visibility))
+ End If
+ End Set
+ End Property
+
+ Private m_Message_Visibility As Visibility
+ Public Property Message_Visibility As Visibility
+ Get
+ Return m_Message_Visibility
+ End Get
+ Set(value As Visibility)
+ If value <> m_Message_Visibility Then
+ m_Message_Visibility = value
+ NotifyPropertyChanged(NameOf(Message_Visibility))
+ End If
+ End Set
+ End Property
+
+ Private m_FocusTextBox As Boolean
+ Public Property FocusTextBox As Boolean
+ Get
+ Return m_FocusTextBox
+ End Get
+ Set(value As Boolean)
+ m_FocusTextBox = value
+ NotifyPropertyChanged(NameOf(FocusTextBox))
+ End Set
+ End Property
+
+ 'CheckBox fields
+ Private m_CheckBoxText As String
+ Public Property CheckBoxText As String
+ Get
+ Return m_CheckBoxText
+ End Get
+ Set(value As String)
+ m_CheckBoxText = value
+ NotifyPropertyChanged(NameOf(CheckBoxText))
+ End Set
+ End Property
+
+ Private m_IsChecked As Boolean = False
+ Public Property IsChecked As Boolean
+ Get
+ Return m_IsChecked
+ End Get
+ Set(value As Boolean)
+ If value <> m_IsChecked Then
+ Map.refSceneHostVM.MainController.SetLastBoolean(value)
+ m_IsChecked = value
+ NotifyPropertyChanged(NameOf(IsChecked))
+ End If
+ End Set
+ End Property
+
+ Private m_Check_Visibility As Visibility
+ Public Property Check_Visibility As Visibility
+ Get
+ Return m_Check_Visibility
+ End Get
+ Set(value As Visibility)
+ If value <> m_Check_Visibility Then
+ m_Check_Visibility = value
+ NotifyPropertyChanged(NameOf(Check_Visibility))
+ End If
+ End Set
+ End Property
+
+ ' ComboBox fields
+ Private m_ComboItemsList As New ObservableCollection(Of String)
+ Public Property ComboItemsList As ObservableCollection(Of String)
+ Get
+ Return m_ComboItemsList
+ End Get
+ Set(value As ObservableCollection(Of String))
+ m_ComboItemsList = value
+ NotifyPropertyChanged(NameOf(ComboItemsList))
+ End Set
+ End Property
+
+ Private m_ComboSelectedIndex As Integer
+ Public Property ComboSelectedIndex As Integer
+ Get
+ Return m_ComboSelectedIndex
+ End Get
+ Set(value As Integer)
+ Map.refSceneHostVM.MainController.SetLastInteger(value)
+ m_ComboSelectedIndex = value
+ NotifyPropertyChanged(NameOf(ComboSelectedIndex))
+ End Set
+ End Property
+
+ Private m_Combo_Visibility As Visibility
+ Public Property Combo_Visibility As Visibility
+ Get
+ Return m_Combo_Visibility
+ End Get
+ Set(value As Visibility)
+ If value <> m_Combo_Visibility Then
+ m_Combo_Visibility = value
+ NotifyPropertyChanged(NameOf(Combo_Visibility))
+ End If
+ End Set
+ End Property
+
+ ' Buttons fields
+ Private m_ShowBtn_Visibility As Visibility
+ Public Property ShowBtn_Visibility As Visibility
+ Get
+ Return m_ShowBtn_Visibility
+ End Get
+ Set(value As Visibility)
+ m_ShowBtn_Visibility = value
+ NotifyPropertyChanged(NameOf(ShowBtn_Visibility))
+ End Set
+ End Property
+
+ Private m_DoneBtn_Visibility As Visibility
+ Public Property DoneBtn_Visibility As Visibility
+ Get
+ Return m_DoneBtn_Visibility
+ End Get
+ Set(value As Visibility)
+ m_DoneBtn_Visibility = value
+ NotifyPropertyChanged(NameOf(DoneBtn_Visibility))
+ End Set
+ End Property
+
+ ' Commands definition
+ Private m_cmdShow As ICommand
+ Private m_cmdDone As ICommand
+
+#Region "Messages"
+
+ Public ReadOnly Property ShowMsg As String
+ Get
+ Return EgtMsg(5350 + 14)
+ End Get
+ End Property
+ Public ReadOnly Property OkMsg As String
+ Get
+ Return EgtMsg(5350 + 15)
+ End Get
+ End Property
+
+#End Region
+
+#End Region ' Fields & Properties
+
+#Region "CONSTRUCTOR"
+
+ Sub New()
+ ' Creo riferimento a questa classe in EgtCAM5Map
+ Map.SetRefControllerInputPanelVM(Me)
+ ' nascondo input box
+ ResetInputBox()
+ End Sub
+
+#End Region ' Constructor
+
+#Region "METHODS"
+
+ Friend Sub ShowMessage(sTitle As String, sLabel As String)
+ Title = sTitle
+ If sLabel <> "" Then
+ Message = sLabel
+ Message_Visibility = Visibility.Visible
+ End If
+ End Sub
+
+ Friend Sub PrepareInputBox(sTitle As String, sLabel As String, sCheckLabel As String,
+ bShowCombo As Boolean, bShowBtn As Boolean)
+ Title = sTitle
+ If sLabel <> "" Then
+ Message = sLabel
+ Text = ""
+ Text_Visibility = Visibility.Visible
+ Message_Visibility = Visibility.Visible
+ End If
+ 'If sCheckLabel <> "" Then
+ ' CheckBoxText = sCheckLabel
+ ' Check_Visibility = Visibility.Visible
+ 'End If
+ If bShowCombo Then
+ ComboItemsList.Clear()
+ Combo_Visibility = Visibility.Visible
+ End If
+ If bShowBtn Then
+ ShowBtn_Visibility = Visibility.Visible
+ End If
+ DoneBtn_Visibility = Visibility.Visible
+ FocusTextBox = True
+ End Sub
+
+ Friend Sub ResetInputBox()
+ Title = EgtMsg(5350 + 5)
+ Text_Visibility = Visibility.Collapsed
+ Message_Visibility = Visibility.Collapsed
+ Check_Visibility = Visibility.Collapsed
+ Combo_Visibility = Visibility.Collapsed
+ ShowBtn_Visibility = Visibility.Collapsed
+ DoneBtn_Visibility = Visibility.Collapsed
+ End Sub
+
+ Friend Function SetInputBoxText(sVal As String) As Boolean
+ Text = sVal
+ FocusTextBox = True
+ Return True
+ End Function
+
+ Friend Function ChangeInputBoxCheck() As Boolean
+ IsChecked = Not m_IsChecked
+ Return True
+ End Function
+
+ Friend Function SetInputBoxCheck(bCheck As Boolean) As Boolean
+ IsChecked = bCheck
+ Map.refSceneHostVM.MainController.SetLastBoolean(IsChecked)
+ Return True
+ End Function
+
+ Friend Function AddInputBoxCombo(sText As String, bSelected As Boolean) As Boolean
+ ComboItemsList.Add(sText)
+ If bSelected Then
+ ComboSelectedIndex = ComboItemsList.Count - 1
+ End If
+ Return True
+ End Function
+
+#End Region ' METHODS
+
+#Region "COMMANDS"
+
+#Region "Show"
+
+ '''
+ ''' Returns a command that do Point.
+ '''
+ Public ReadOnly Property Show_Command As ICommand
+ Get
+ If m_cmdShow Is Nothing Then
+ m_cmdShow = New Command(AddressOf Show)
+ End If
+ Return m_cmdShow
+ End Get
+ End Property
+
+ '''
+ ''' Execute the Point. This method is invoked by the PointCommand.
+ '''
+ Public Sub Show(ByVal param As Object)
+ Map.refSceneHostVM.MainController.Show(m_Text)
+ End Sub
+
+#End Region ' Show
+
+#Region "Done"
+
+ '''
+ ''' Returns a command that do Point.
+ '''
+ Public ReadOnly Property Done_Command As ICommand
+ Get
+ If m_cmdDone Is Nothing Then
+ m_cmdDone = New Command(AddressOf Done)
+ End If
+ Return m_cmdDone
+ End Get
+ End Property
+
+ '''
+ ''' Execute the Point. This method is invoked by the PointCommand.
+ '''
+ Public Sub Done(ByVal param As Object)
+ Map.refSceneHostVM.MainController.Done(m_Text)
+ End Sub
+
+#End Region ' Done
+
+#End Region ' COMMANDS
+
+End Class
diff --git a/3dPrintApp/DispositionPanel/DispositionPanelV.xaml b/3dPrintApp/DispositionPanel/DispositionPanelV.xaml
new file mode 100644
index 0000000..6726655
--- /dev/null
+++ b/3dPrintApp/DispositionPanel/DispositionPanelV.xaml
@@ -0,0 +1,100 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/3dPrintApp/DispositionPanel/DispositionPanelV.xaml.vb b/3dPrintApp/DispositionPanel/DispositionPanelV.xaml.vb
new file mode 100644
index 0000000..51b7341
--- /dev/null
+++ b/3dPrintApp/DispositionPanel/DispositionPanelV.xaml.vb
@@ -0,0 +1,3 @@
+Public Class DispositionPanelV
+
+End Class
diff --git a/3dPrintApp/DispositionPanel/DispositionPanelVM.vb b/3dPrintApp/DispositionPanel/DispositionPanelVM.vb
new file mode 100644
index 0000000..4044452
--- /dev/null
+++ b/3dPrintApp/DispositionPanel/DispositionPanelVM.vb
@@ -0,0 +1,190 @@
+Imports System.Globalization
+Imports EgtUILib
+Imports EgtWPFLib5
+
+Public Class DispositionPanelVM
+ Inherits VMBase
+
+ Public Property sXPos As String
+ Get
+ If Not IsNothing(Map.refTopPanelVM.SelPart) Then
+ Dim ptReference As New Point3d
+ EgtStartPoint(Map.refTopPanelVM.SelPart.nReferenceId, GDB_ID.ROOT, ptReference)
+ Return LenToString(ptReference.x, 1)
+ Else
+ Return ""
+ End If
+ End Get
+ Set(value As String)
+ Dim ptReference As New Point3d
+ 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))
+ End If
+ End Set
+ End Property
+
+ Public Property sYPos As String
+ Get
+ If Not IsNothing(Map.refTopPanelVM.SelPart) Then
+ Dim ptReference As New Point3d
+ EgtStartPoint(Map.refTopPanelVM.SelPart.nReferenceId, GDB_ID.ROOT, ptReference)
+ Return LenToString(ptReference.y, 1)
+ Else
+ Return ""
+ End If
+ End Get
+ Set(value As String)
+ Dim ptReference As New Point3d
+ 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))
+ End If
+ End Set
+ End Property
+
+ Public Property sZPos As String
+ Get
+ If Not IsNothing(Map.refTopPanelVM.SelPart) Then
+ Dim ptReference As New Point3d
+ EgtStartPoint(Map.refTopPanelVM.SelPart.nReferenceId, GDB_ID.ROOT, ptReference)
+ Return LenToString(ptReference.z, 1)
+ Else
+ Return ""
+ End If
+ End Get
+ Set(value As String)
+ Dim ptReference As New Point3d
+ 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))
+ End If
+ End Set
+ End Property
+
+ Private m_RotAxes() As Boolean = {False, False, True}
+ Public Property RotAxes As Boolean()
+ Get
+ Return m_RotAxes
+ End Get
+ Set(value As Boolean())
+ m_RotAxes = value
+ End Set
+ End Property
+
+ Public ReadOnly Property vtSelRotAxes As Vector3d
+ Get
+ If m_RotAxes(0) Then
+ Return Vector3d.X_AX
+ ElseIf m_RotAxes(1) Then
+ Return Vector3d.Y_AX
+ ElseIf m_RotAxes(2) Then
+ Return Vector3d.Z_AX
+ End If
+ End Get
+ End Property
+
+ Private m_sRotAngle As String
+ Public Property sRotAngle As String
+ Get
+ Return m_sRotAngle
+ End Get
+ Set(value As String)
+ Dim dNewAngle As Double = 0
+ If Not StringToLen(value, dNewAngle) Then
+ m_sRotAngle = 0
+ NotifyPropertyChanged(NameOf(sRotAngle))
+ Return
+ 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()
+ m_sRotAngle = 0
+ NotifyPropertyChanged(NameOf(sRotAngle))
+ Else
+ m_sRotAngle = value
+ End If
+ End Set
+ End Property
+
+ Private m_bMove_IsChecked As Boolean
+ Public Property bMove_IsChecked As Boolean
+ Get
+ Return m_bMove_IsChecked
+ End Get
+ Set(value As Boolean)
+ m_bMove_IsChecked = value
+ If value Then
+ m_bRotate_IsChecked = False
+ NotifyPropertyChanged(NameOf(bRotate_IsChecked))
+ End If
+ End Set
+ End Property
+
+ Private m_bRotate_IsChecked As Boolean
+ Public Property bRotate_IsChecked As Boolean
+ Get
+ Return m_bRotate_IsChecked
+ End Get
+ Set(value As Boolean)
+ m_bRotate_IsChecked = value
+ If value Then
+ m_bMove_IsChecked = False
+ NotifyPropertyChanged(NameOf(bMove_IsChecked))
+ End If
+ End Set
+ End Property
+
+ Sub New()
+ ' Creo riferimento a questa classe in EgtCAM5Map
+ Map.SetRefDispositionPanelVM(Me)
+ End Sub
+
+ Friend Sub Init()
+
+ End Sub
+
+ Friend Sub RefreshPos()
+ NotifyPropertyChanged(NameOf(sXPos))
+ NotifyPropertyChanged(NameOf(sYPos))
+ NotifyPropertyChanged(NameOf(sZPos))
+ End Sub
+
+End Class
+
+Public Class CenterToolTipConverter
+ Implements IMultiValueConverter
+
+ Public Function Convert(ByVal values As Object(), ByVal targetType As Type, ByVal parameter As Object, ByVal culture As CultureInfo) As Object Implements IMultiValueConverter.Convert
+ For Each value In values
+ If TypeOf (value) IsNot Double Then
+ Return Double.NaN
+ End If
+ Next
+ Dim placementTargetHeight As Double = CDbl(values(0))
+ Dim toolTipHeight As Double = CDbl(values(1))
+ Return (placementTargetHeight / 2.0) - (toolTipHeight / 2.0)
+ End Function
+
+ Public Function ConvertBack(ByVal value As Object, ByVal targetTypes As Type(), ByVal parameter As Object, ByVal culture As CultureInfo) As Object() Implements IMultiValueConverter.ConvertBack
+ Throw New NotSupportedException()
+ End Function
+
+End Class
diff --git a/3dPrintApp/ImportPanel/ImportPanelV.xaml b/3dPrintApp/ImportPanel/ImportPanelV.xaml
new file mode 100644
index 0000000..12de09c
--- /dev/null
+++ b/3dPrintApp/ImportPanel/ImportPanelV.xaml
@@ -0,0 +1,109 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/3dPrintApp/ImportPanel/ImportPanelV.xaml.vb b/3dPrintApp/ImportPanel/ImportPanelV.xaml.vb
new file mode 100644
index 0000000..9511550
--- /dev/null
+++ b/3dPrintApp/ImportPanel/ImportPanelV.xaml.vb
@@ -0,0 +1,3 @@
+Public Class ImportPanelV
+
+End Class
diff --git a/3dPrintApp/ImportPanel/ImportPanelVM.vb b/3dPrintApp/ImportPanel/ImportPanelVM.vb
new file mode 100644
index 0000000..a66bbc1
--- /dev/null
+++ b/3dPrintApp/ImportPanel/ImportPanelVM.vb
@@ -0,0 +1,362 @@
+Imports System.Collections.ObjectModel
+Imports EgtUILib
+Imports EgtWPFLib5
+
+Public Class ImportPanelVM
+ Inherits VMBase
+
+ Private m_nImportedPartId As Integer = GDB_ID.NULL
+
+ 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
+
+ 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 Each ImportPart In m_ImportPartList
+ Dim nPartId As Integer = EgtCreateGroup(GDB_ID.ROOT)
+ 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 nAuxSolidsLayerId As Integer = GDB_ID.NULL
+ Dim nMachStartLayerId As Integer = GDB_ID.NULL
+ Dim nMachStartId 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.RIBS
+ nRibsLayerId = EgtCreateGroup(nPartId)
+ EgtSetName(nRibsLayerId, LAY_RIBS)
+ For Each GeomEntity In ImportLayer.EntityList
+ EgtRelocateGlob(GeomEntity.nId, nRibsLayerId, GDB_POS.LAST_SON)
+ Next
+ Case ImportLayer.LayerType.AUX_SOLIDS
+ nAuxSolidsLayerId = EgtCreateGroup(nPartId)
+ EgtSetName(nAuxSolidsLayerId, LAY_AUXSOLIDS)
+ For Each GeomEntity In ImportLayer.EntityList
+ EgtRelocateGlob(GeomEntity.nId, nAuxSolidsLayerId, GDB_POS.LAST_SON)
+ Next
+ Case ImportLayer.LayerType.MACH_START
+ nMachStartLayerId = EgtCreateGroup(nPartId)
+ EgtSetName(nMachStartLayerId, LAY_MACHSTART)
+ If ImportLayer.EntityList.Count > 0 Then
+ nMachStartId = ImportLayer.EntityList(0).nId
+ EgtRelocateGlob(ImportLayer.EntityList(0).nId, nMachStartLayerId, GDB_POS.LAST_SON)
+ 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)
+ End If
+ EgtSetName(nMachStartId, START_GEOM)
+ ' coloro l'entita' di rosso
+ Dim c3Red As Color3d
+ c3Red.FromColor(System.Drawing.Color.Red)
+ EgtSetColor(nMachStartId, c3Red)
+ Case ImportLayer.LayerType.OTHERS
+ Dim nOthersLayerId As Integer = 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
+ ' 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, nFrameId, nMachStartLayerId, nMachStartId, nAuxSolidsLayerId, nRibsLayerId, 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
diff --git a/3dPrintApp/ImportPanel/ImportUtility.vb b/3dPrintApp/ImportPanel/ImportUtility.vb
new file mode 100644
index 0000000..719b5e2
--- /dev/null
+++ b/3dPrintApp/ImportPanel/ImportUtility.vb
@@ -0,0 +1,228 @@
+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 "┼"
+ 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 Solid"))
+ 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.AUX_SOLIDS, "Solids"))
+ m_LayerList.Add(New ImportLayer(ImportLayer.LayerType.MACH_START, "MachStart"))
+ m_LayerList.Add(New ImportLayer(ImportLayer.LayerType.OTHERS, "Others"))
+ End Sub
+
+End Class
+
+Public Class ImportLayer
+ Inherits VMBase
+
+ Public Enum LayerType As Integer
+ ORIGINAL_SOLID = 1
+ PRINT_SOLID = 2
+ RIBS = 3
+ AUX_SOLIDS = 4
+ MACH_START = 5
+ OTHERS = 6
+ 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
diff --git a/3dPrintApp/ImportWnd/ImportSceneHostV.xaml b/3dPrintApp/ImportWnd/ImportSceneHostV.xaml
new file mode 100644
index 0000000..32a122f
--- /dev/null
+++ b/3dPrintApp/ImportWnd/ImportSceneHostV.xaml
@@ -0,0 +1,10 @@
+
+
+
+
+
+
+
diff --git a/3dPrintApp/ImportWnd/ImportSceneHostV.xaml.vb b/3dPrintApp/ImportWnd/ImportSceneHostV.xaml.vb
new file mode 100644
index 0000000..8e0495c
--- /dev/null
+++ b/3dPrintApp/ImportWnd/ImportSceneHostV.xaml.vb
@@ -0,0 +1,33 @@
+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
diff --git a/3dPrintApp/ImportWnd/ImportSceneHostVM.vb b/3dPrintApp/ImportWnd/ImportSceneHostVM.vb
new file mode 100644
index 0000000..d4dc260
--- /dev/null
+++ b/3dPrintApp/ImportWnd/ImportSceneHostVM.vb
@@ -0,0 +1,722 @@
+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
diff --git a/3dPrintApp/ImportWnd/ImportWndV.xaml b/3dPrintApp/ImportWnd/ImportWndV.xaml
new file mode 100644
index 0000000..baa7325
--- /dev/null
+++ b/3dPrintApp/ImportWnd/ImportWndV.xaml
@@ -0,0 +1,33 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/3dPrintApp/ImportWnd/ImportWndV.xaml.vb b/3dPrintApp/ImportWnd/ImportWndV.xaml.vb
new file mode 100644
index 0000000..dc82292
--- /dev/null
+++ b/3dPrintApp/ImportWnd/ImportWndV.xaml.vb
@@ -0,0 +1,18 @@
+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
diff --git a/3dPrintApp/ImportWnd/ImportWndVM.vb b/3dPrintApp/ImportWnd/ImportWndVM.vb
new file mode 100644
index 0000000..3da6414
--- /dev/null
+++ b/3dPrintApp/ImportWnd/ImportWndVM.vb
@@ -0,0 +1,106 @@
+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
\ No newline at end of file
diff --git a/3dPrintApp/LeftPanel/LeftPanelV.xaml b/3dPrintApp/LeftPanel/LeftPanelV.xaml
index d1cb175..0ddf78d 100644
--- a/3dPrintApp/LeftPanel/LeftPanelV.xaml
+++ b/3dPrintApp/LeftPanel/LeftPanelV.xaml
@@ -1,42 +1,40 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/3dPrintApp/LeftPanel/LeftPanelVM.vb b/3dPrintApp/LeftPanel/LeftPanelVM.vb
index ccd634e..1be22e1 100644
--- a/3dPrintApp/LeftPanel/LeftPanelVM.vb
+++ b/3dPrintApp/LeftPanel/LeftPanelVM.vb
@@ -1,25 +1,47 @@
Imports System.Globalization
+Imports EgtUILib
+Imports EgtWPFLib5
Public Class LeftPanelVM
-
-End Class
-
-Public Class CenterToolTipConverter
- Implements IMultiValueConverter
-
- Public Function Convert(ByVal values As Object(), ByVal targetType As Type, ByVal parameter As Object, ByVal culture As CultureInfo) As Object Implements IMultiValueConverter.Convert
- For Each value In values
- If TypeOf (value) IsNot Double Then
- Return Double.NaN
- End If
- Next
- Dim placementTargetHeight As Double = CDbl(values(0))
- Dim toolTipHeight As Double = CDbl(values(1))
- Return (placementTargetHeight / 2.0) - (toolTipHeight / 2.0)
- End Function
-
- Public Function ConvertBack(ByVal value As Object, ByVal targetTypes As Type(), ByVal parameter As Object, ByVal culture As CultureInfo) As Object() Implements IMultiValueConverter.ConvertBack
- Throw New NotSupportedException()
- End Function
+ Inherits VMBase
+
+ Public Enum Panels As Integer
+ NULL = 0
+ IMPORT = 1
+ DISPOSITION = 2
+ REFERENCE = 3
+ STARTMACH = 4
+ RIBS = 5
+ SHELLNUMBER = 6
+ AUXSOLIDS = 7
+ End Enum
+
+ Private m_SelPanel As Panels
+ Public Property SelPanel As Integer
+ Get
+ Return m_SelPanel
+ End Get
+ Set(value As Integer)
+ m_SelPanel = value
+ End Set
+ End Property
+ Friend Sub SetSelPanel(Panel As Panels)
+ m_SelPanel = Panel
+ Select Case Panel
+ Case Panels.IMPORT
+
+ Case Panels.DISPOSITION
+ Map.refDispositionPanelVM.Init()
+ Case Panels.STARTMACH
+ Map.refStartMachPanelVM.Init()
+ End Select
+ NotifyPropertyChanged(NameOf(SelPanel))
+ End Sub
+
+ Sub New()
+ ' Creo riferimento a questa classe in EgtCAM5Map
+ Map.SetRefLeftPanelVM(Me)
+ SetSelPanel(Panels.NULL)
+ End Sub
End Class
diff --git a/3dPrintApp/MachiningManager/CurrMachining.vb b/3dPrintApp/MachiningManager/CurrMachining.vb
new file mode 100644
index 0000000..6d5b698
--- /dev/null
+++ b/3dPrintApp/MachiningManager/CurrMachining.vb
@@ -0,0 +1,773 @@
+Imports EgtUILib
+Imports EgtWPFLib5
+
+Public Class CurrMachining
+ Inherits Machining
+
+ Private m_OrigMachining As New Machining
+ Public ReadOnly Property OrigMachining As Machining
+ Get
+ Return m_OrigMachining
+ End Get
+ End Property
+ Friend Sub SetOrigMachining(OrigMachining As Machining)
+ m_OrigMachining = OrigMachining
+ End Sub
+
+ Private m_sCurrGUID As String = ""
+ Public Property sCurrGUID As String
+ Get
+ Return m_sCurrGUID
+ End Get
+ Set(value As String)
+ m_sCurrGUID = value
+ End Set
+ End Property
+
+ Private m_sCurrName As String = ""
+ Public Property sCurrName As String
+ Get
+ Return m_sCurrName
+ End Get
+ Set(value As String)
+ m_sCurrName = value
+ End Set
+ End Property
+
+ Private m_bCurrSlicing45 As Boolean
+ Public Property bCurrSlicing45 As Boolean
+ Get
+ Return m_bCurrSlicing45
+ End Get
+ Set(value As Boolean)
+ m_bCurrSlicing45 = value
+ NotifyPropertyChanged(NameOf(bCurrSlicing45))
+ End Set
+ End Property
+
+ Private m_dCurrStrandH As Double
+ Public Property dCurrStrandH As Double
+ Get
+ Return m_dCurrStrandH
+ End Get
+ Set(value As Double)
+ m_dCurrStrandH = value
+ NotifyPropertyChanged(NameOf(dCurrStrandH))
+ NotifyPropertyChanged(NameOf(bCurrStrandH_IsModified))
+ End Set
+ End Property
+ Public ReadOnly Property bCurrStrandH_IsModified As Boolean
+ Get
+ Return m_dCurrStrandH <> m_OrigMachining.dStrandH
+ End Get
+ End Property
+
+ Private m_dCurrStrandW As Double
+ Public Property dCurrStrandW As Double
+ Get
+ Return m_dCurrStrandW
+ End Get
+ Set(value As Double)
+ m_dCurrStrandW = value
+ NotifyPropertyChanged(NameOf(dCurrStrandW))
+ End Set
+ End Property
+
+ Private m_nCurrStrandCount As Integer
+ Public Property nCurrStrandCount As Integer
+ Get
+ Return m_nCurrStrandCount
+ End Get
+ Set(value As Integer)
+ m_nCurrStrandCount = value
+ NotifyPropertyChanged(NameOf(nCurrStrandCount))
+ End Set
+ End Property
+
+ Private m_dCurrOffset As Double
+ Public Property dCurrOffset As Double
+ Get
+ Return m_dCurrOffset
+ End Get
+ Set(value As Double)
+ m_dCurrOffset = value
+ NotifyPropertyChanged(NameOf(dCurrOffset))
+ End Set
+ End Property
+
+ Private m_dCurrStartPointOffsetOnSlice As Double
+ Public Property dCurrStartPointOffsetOnSlice As Double
+ Get
+ Return m_dCurrStartPointOffsetOnSlice
+ End Get
+ Set(value As Double)
+ m_dCurrStartPointOffsetOnSlice = value
+ End Set
+ End Property
+
+ Private m_StrandOrderList As New List(Of IdNameStruct)({New IdNameStruct(MPAR_STRANDORDERS.INTOOUT, "From Inside To Outside"),
+ New IdNameStruct(MPAR_STRANDORDERS.OUTTOIN, "From Outside To Inside")})
+ Public Property StrandOrderList As List(Of IdNameStruct)
+ Get
+ Return m_StrandOrderList
+ End Get
+ Set(value As List(Of IdNameStruct))
+ m_StrandOrderList = value
+ End Set
+ End Property
+
+ Public Property SelStrandOrder As IdNameStruct
+ Get
+ Return m_StrandOrderList.FirstOrDefault(Function(x) x.Id = m_nCurrStrandOrder)
+ End Get
+ Set(value As IdNameStruct)
+ m_nCurrStrandOrder = value.Id
+ End Set
+ End Property
+
+ Private m_nCurrStrandOrder As MPAR_STRANDORDERS
+ Public Property nCurrStrandOrder As MPAR_STRANDORDERS
+ Get
+ Return m_nCurrStrandOrder
+ End Get
+ Set(value As MPAR_STRANDORDERS)
+ m_nCurrStrandOrder = value
+ End Set
+ End Property
+ Friend Sub SetCurrStrandOrder(StrandOrder As Integer)
+ m_nCurrStrandOrder = StrandOrder
+ NotifyPropertyChanged(NameOf(SelStrandOrder))
+ End Sub
+
+ Private m_DirectionList As New List(Of IdNameStruct)({New IdNameStruct(MPAR_DIRECTIONS.CCW, "Counterclockwise"),
+ New IdNameStruct(MPAR_DIRECTIONS.CW, "Clockwise")})
+ Public Property DirectionList As List(Of IdNameStruct)
+ Get
+ Return m_DirectionList
+ End Get
+ Set(value As List(Of IdNameStruct))
+ m_DirectionList = value
+ End Set
+ End Property
+
+ Public Property SelDirection As IdNameStruct
+ Get
+ Return m_DirectionList.FirstOrDefault(Function(x) x.Id = m_nCurrDirection)
+ End Get
+ Set(value As IdNameStruct)
+ m_nCurrDirection = value.Id
+ End Set
+ End Property
+
+ Private m_nCurrDirection As MPAR_DIRECTIONS
+ Public Property nCurrDirection As MPAR_DIRECTIONS
+ Get
+ Return m_nCurrDirection
+ End Get
+ Set(value As MPAR_DIRECTIONS)
+ m_nCurrDirection = value
+ End Set
+ End Property
+ Friend Sub SetCurrDirection(Direction As Integer)
+ m_nCurrDirection = Direction
+ NotifyPropertyChanged(NameOf(SelDirection))
+ End Sub
+
+ Private m_LinkTypeList As New List(Of IdNameStruct)({New IdNameStruct(MPAR_LINKTYPES.NONE, "None"),
+ New IdNameStruct(MPAR_LINKTYPES.LINEAR, "Linear"),
+ New IdNameStruct(MPAR_LINKTYPES.BIARC, "Biarc")})
+ Public Property LinkTypeList As List(Of IdNameStruct)
+ Get
+ Return m_LinkTypeList
+ End Get
+ Set(value As List(Of IdNameStruct))
+ m_LinkTypeList = value
+ End Set
+ End Property
+
+ Public Property SelLinkType As IdNameStruct
+ Get
+ Return m_LinkTypeList.FirstOrDefault(Function(x) x.Id = m_nCurrLinkType)
+ End Get
+ Set(value As IdNameStruct)
+ m_nCurrLinkType = value.Id
+ End Set
+ End Property
+
+ Private m_nCurrLinkType As MPAR_LINKTYPES
+ Public Property nCurrLinkType As MPAR_LINKTYPES
+ Get
+ Return m_nCurrLinkType
+ End Get
+ Set(value As MPAR_LINKTYPES)
+ m_nCurrLinkType = value
+ End Set
+ End Property
+ Friend Sub SetCurrLinkType(LinkType As Integer)
+ m_nCurrLinkType = LinkType
+ NotifyPropertyChanged(NameOf(SelLinkType))
+ End Sub
+
+ Private m_dCurrLinkParam As Double
+ Public Property dCurrLinkParam As Double
+ Get
+ Return m_dCurrLinkParam
+ End Get
+ Set(value As Double)
+ m_dCurrLinkParam = value
+ End Set
+ End Property
+
+ Private m_dCurrLinkZup As Double
+ Public Property dCurrLinkZup As Double
+ Get
+ Return m_dCurrLinkZup
+ End Get
+ Set(value As Double)
+ m_dCurrLinkZup = value
+ End Set
+ End Property
+
+ Private m_dCurrOffsetLeadPoint As Double
+ Public Property dCurrOffsetLeadPoint As Double
+ Get
+ Return m_dCurrOffsetLeadPoint
+ End Get
+ Set(value As Double)
+ m_dCurrOffsetLeadPoint = value
+ End Set
+ End Property
+
+ Private m_LeadInList As New List(Of IdNameStruct)({New IdNameStruct(MPAR_LEADINOUT.NONE, "None"),
+ New IdNameStruct(MPAR_LEADINOUT.LINEAR, "Linear"),
+ New IdNameStruct(MPAR_LEADINOUT.ARC, "Arc")})
+ Public Property LeadInList As List(Of IdNameStruct)
+ Get
+ Return m_LeadInList
+ End Get
+ Set(value As List(Of IdNameStruct))
+ m_LeadInList = value
+ End Set
+ End Property
+
+ Public Property SelLeadIn As IdNameStruct
+ Get
+ Return m_LeadInList.FirstOrDefault(Function(x) x.Id = m_nCurrLeadIn)
+ End Get
+ Set(value As IdNameStruct)
+ m_nCurrLeadIn = value.Id
+ End Set
+ End Property
+
+ Private m_nCurrLeadIn As MPAR_LEADINOUT
+ Public Property nCurrLeadIn As MPAR_LEADINOUT
+ Get
+ Return m_nCurrLeadIn
+ End Get
+ Set(value As MPAR_LEADINOUT)
+ m_nCurrLeadIn = value
+ End Set
+ End Property
+ Friend Sub SetCurrLeadIn(LeadIn As Integer)
+ m_nCurrLeadIn = LeadIn
+ NotifyPropertyChanged(NameOf(SelLeadIn))
+ End Sub
+
+ Private m_dCurrLeadInTangDist As Double
+ Public Property dCurrLeadInTangDist As Double
+ Get
+ Return m_dCurrLeadInTangDist
+ End Get
+ Set(value As Double)
+ m_dCurrLeadInTangDist = value
+ End Set
+ End Property
+
+ Private m_dCurrLeadInOrthoDist As Double
+ Public Property dCurrLeadInOrthoDist As Double
+ Get
+ Return m_dCurrLeadInOrthoDist
+ End Get
+ Set(value As Double)
+ m_dCurrLeadInOrthoDist = value
+ End Set
+ End Property
+
+ Private m_LeadOutList As New List(Of IdNameStruct)({New IdNameStruct(MPAR_LEADINOUT.NONE, "None"),
+ New IdNameStruct(MPAR_LEADINOUT.LINEAR, "Linear"),
+ New IdNameStruct(MPAR_LEADINOUT.ARC, "Arc")})
+ Public Property LeadOutList As List(Of IdNameStruct)
+ Get
+ Return m_LeadOutList
+ End Get
+ Set(value As List(Of IdNameStruct))
+ m_LeadOutList = value
+ End Set
+ End Property
+
+ Public Property SelLeadOut As IdNameStruct
+ Get
+ Return m_LeadOutList.FirstOrDefault(Function(x) x.Id = m_nCurrLeadOut)
+ End Get
+ Set(value As IdNameStruct)
+ m_nCurrLeadOut = value.Id
+ End Set
+ End Property
+
+ Private m_nCurrLeadOut As MPAR_LEADINOUT
+ Public Property nCurrLeadOut As MPAR_LEADINOUT
+ Get
+ Return m_nCurrLeadOut
+ End Get
+ Set(value As MPAR_LEADINOUT)
+ m_nCurrLeadOut = value
+ End Set
+ End Property
+ Friend Sub SetCurrLeadOut(LeadOut As Integer)
+ m_nCurrLeadOut = LeadOut
+ NotifyPropertyChanged(NameOf(SelLeadOut))
+ End Sub
+
+ Private m_dCurrLeadOutTangDist As Double
+ Public Property dCurrLeadOutTangDist As Double
+ Get
+ Return m_dCurrLeadOutTangDist
+ End Get
+ Set(value As Double)
+ m_dCurrLeadOutTangDist = value
+ End Set
+ End Property
+
+ Private m_dCurrLeadOutOrthoDist As Double
+ Public Property dCurrLeadOutOrthoDist As Double
+ Get
+ Return m_dCurrLeadOutOrthoDist
+ End Get
+ Set(value As Double)
+ m_dCurrLeadOutOrthoDist = value
+ End Set
+ End Property
+
+ Private m_dCurrCoastingLen As Double
+ Public Property dCurrCoastingLen As Double
+ Get
+ Return m_dCurrCoastingLen
+ End Get
+ Set(value As Double)
+ m_dCurrCoastingLen = value
+ End Set
+ End Property
+
+ Private m_dCurrCoastingFeed As Double
+ Public Property dCurrCoastingFeed As Double
+ Get
+ Return m_dCurrCoastingFeed
+ End Get
+ Set(value As Double)
+ m_dCurrCoastingFeed = value
+ End Set
+ End Property
+
+ Private m_dCurrWipeLen As Double
+ Public Property dCurrWipeLen As Double
+ Get
+ Return m_dCurrWipeLen
+ End Get
+ Set(value As Double)
+ m_dCurrWipeLen = value
+ End Set
+ End Property
+
+ Private m_dCurrWipeFeedPu As Double
+ Public Property dCurrWipeFeedPu As Double
+ Get
+ Return m_dCurrWipeFeedPu
+ End Get
+ Set(value As Double)
+ m_dCurrWipeFeedPu = value
+ End Set
+ End Property
+
+ Private m_dCurrFloorCount As Integer
+ Public Property dCurrFloorCount As Double
+ Get
+ Return m_dCurrFloorCount
+ End Get
+ Set(value As Double)
+ m_dCurrFloorCount = value
+ End Set
+ End Property
+
+ Private m_dCurrG0Feed As Double
+ Public Property dCurrG0Feed As Double
+ Get
+ Return m_dCurrG0Feed
+ End Get
+ Set(value As Double)
+ m_dCurrG0Feed = value
+ End Set
+ End Property
+
+ Private m_dCurrToolDiam As Double
+ Public Property dCurrToolDiam As Double
+ Get
+ Return m_dCurrToolDiam
+ End Get
+ Set(value As Double)
+ m_dCurrToolDiam = value
+ End Set
+ End Property
+
+ Private m_dCurrRibsOverlap As Double
+ Public Property dCurrRibsOverlap As Double
+ Get
+ Return m_dCurrRibsOverlap
+ End Get
+ Set(value As Double)
+ m_dCurrRibsOverlap = value
+ End Set
+ End Property
+
+ Private m_dCurrRibsStrandCount As Integer
+ Public Property dCurrRibsStrandCount As Double
+ Get
+ Return m_dCurrRibsStrandCount
+ End Get
+ Set(value As Double)
+ m_dCurrRibsStrandCount = value
+ End Set
+ End Property
+
+ Private m_dCurrRibsLink As Boolean
+ Public Property dCurrRibsLink As Double
+ Get
+ Return m_dCurrRibsLink
+ End Get
+ Set(value As Double)
+ m_dCurrRibsLink = value
+ End Set
+ End Property
+
+ Private m_dCurrRibsInvertOrder As Boolean
+ Public Property dCurrRibsInvertOrder As Double
+ Get
+ Return m_dCurrRibsInvertOrder
+ End Get
+ Set(value As Double)
+ m_dCurrRibsInvertOrder = value
+ End Set
+ End Property
+
+ Private m_dCurrRibsInvertDirection As Boolean
+ Public Property dCurrRibsInvertDirection As Double
+ Get
+ Return m_dCurrRibsInvertDirection
+ End Get
+ Set(value As Double)
+ m_dCurrRibsInvertDirection = value
+ End Set
+ End Property
+
+ Private m_dCurrRibsLeadInInvert As Boolean
+ Public Property dCurrRibsLeadInInvert As Double
+ Get
+ Return m_dCurrRibsLeadInInvert
+ End Get
+ Set(value As Double)
+ m_dCurrRibsLeadInInvert = value
+ End Set
+ End Property
+
+ Private m_dCurrRibsLeadInLen As Double
+ Public Property dCurrRibsLeadInLen As Double
+ Get
+ Return m_dCurrRibsLeadInLen
+ End Get
+ Set(value As Double)
+ m_dCurrRibsLeadInLen = value
+ End Set
+ End Property
+
+ Private m_dCurrRibsLeadOutInvert As Boolean
+ Public Property dCurrRibsLeadOutInvert As Double
+ Get
+ Return m_dCurrRibsLeadOutInvert
+ End Get
+ Set(value As Double)
+ m_dCurrRibsLeadOutInvert = value
+ End Set
+ End Property
+
+ Private m_dCurrRibsLeadOutLen As Double
+ Public Property dCurrRibsLeadOutLen As Double
+ Get
+ Return m_dCurrRibsLeadOutLen
+ End Get
+ Set(value As Double)
+ m_dCurrRibsLeadOutLen = value
+ End Set
+ End Property
+
+ Private m_dCurrRibsLeadOutCoasting As Double
+ Public Property dCurrRibsLeadOutCoasting As Double
+ Get
+ Return m_dCurrRibsLeadOutCoasting
+ End Get
+ Set(value As Double)
+ m_dCurrRibsLeadOutCoasting = value
+ End Set
+ End Property
+
+ Private m_dCurrRibsLeadOutWipe As Double
+ Public Property dCurrRibsLeadOutWipe As Double
+ Get
+ Return m_dCurrRibsLeadOutWipe
+ End Get
+ Set(value As Double)
+ m_dCurrRibsLeadOutWipe = value
+ End Set
+ End Property
+
+ Private m_dCurrRibsLeadOutWipeDir As Double
+ Public Property dCurrRibsLeadOutWipeDir As Double
+ Get
+ Return m_dCurrRibsLeadOutWipeDir
+ End Get
+ Set(value As Double)
+ m_dCurrRibsLeadOutWipeDir = value
+ End Set
+ End Property
+
+ ' Definizione comandi
+ Private m_cmdResetParam As ICommand
+
+ Sub New(nPartId As Integer)
+ ReadCurrMachParam(nPartId)
+ End Sub
+
+ Sub New(MachiningIndex As MachiningIndex)
+ ' imposto Machining da Db
+ Dim Machining As New Machining(MachiningIndex.nIndex, MachiningIndex.sGUID, MachiningIndex.sName)
+ SetOrigMachining(Machining)
+ ' Imposto parametri Curr copiando da Db
+ bCurrSlicing45 = m_OrigMachining.bSlicing45
+ dCurrStrandH = m_OrigMachining.dStrandH
+ dCurrStrandW = m_OrigMachining.dStrandW
+ nCurrStrandCount = m_OrigMachining.nStrandCount
+ dCurrOffset = m_OrigMachining.dOffset
+ dCurrStartPointOffsetOnSlice = m_OrigMachining.dStartPointOffsetOnSlice
+ SetCurrStrandOrder(m_OrigMachining.dStrandOrder)
+ SetCurrDirection(m_OrigMachining.dDirection)
+ SetCurrLinkType(m_OrigMachining.dLinkType)
+ dCurrLinkParam = m_OrigMachining.dLinkParam
+ dCurrLinkZup = m_OrigMachining.dLinkZup
+ dCurrOffsetLeadPoint = m_OrigMachining.dOffsetLeadPoint
+ SetCurrLeadIn(m_OrigMachining.dLeadIn)
+ dCurrLeadInTangDist = m_OrigMachining.dLeadInTangDist
+ dCurrLeadInOrthoDist = m_OrigMachining.dLeadInOrthoDist
+ SetCurrLeadOut(m_OrigMachining.dLeadOut)
+ dCurrLeadOutTangDist = m_OrigMachining.dLeadOutTangDist
+ dCurrLeadOutOrthoDist = m_OrigMachining.dLeadOutOrthoDist
+ dCurrCoastingLen = m_OrigMachining.dCoastingLen
+ dCurrCoastingFeed = m_OrigMachining.dCoastingFeed
+ dCurrWipeLen = m_OrigMachining.dWipeLen
+ dCurrWipeFeedPu = m_OrigMachining.dWipeFeedPu
+ dCurrFloorCount = m_OrigMachining.dFloorCount
+ dCurrG0Feed = m_OrigMachining.dG0Feed
+ dCurrToolDiam = m_OrigMachining.dToolDiam
+ dCurrRibsOverlap = m_OrigMachining.dRibsOverlap
+ dCurrRibsStrandCount = m_OrigMachining.dRibsStrandCount
+ dCurrRibsLink = m_OrigMachining.dRibsLink
+ dCurrRibsInvertOrder = m_OrigMachining.dRibsInvertOrder
+ dCurrRibsInvertDirection = m_OrigMachining.dRibsInvertDirection
+ dCurrRibsLeadInInvert = m_OrigMachining.dRibsLeadInInvert
+ dCurrRibsLeadInLen = m_OrigMachining.dRibsLeadInLen
+ dCurrRibsLeadOutInvert = m_OrigMachining.dRibsLeadOutInvert
+ dCurrRibsLeadOutLen = m_OrigMachining.dRibsLeadOutLen
+ dCurrRibsLeadOutCoasting = m_OrigMachining.dRibsLeadOutCoasting
+ dCurrRibsLeadOutWipe = m_OrigMachining.dRibsLeadOutWipe
+ dCurrRibsLeadOutWipeDir = m_OrigMachining.dRibsLeadOutWipeDir
+ End Sub
+
+ Sub New(sName As String, bSlicing45 As Boolean, dStrandH As Double, dStrandW As Double, nStrandCount As Integer, dOffset As Double, dStartPointOffsetOnSlice As Double,
+ dStrandOrder As MPAR_STRANDORDERS, dDirection As MPAR_DIRECTIONS, dLinkType As MPAR_LINKTYPES, dLinkParam As Double, dLinkZup As Double, dOffsetLeadPoint As Double,
+ dLeadIn As MPAR_LEADINOUT, dLeadInTangDist As Double, dLeadInOrthoDist As Double, dLeadOut As MPAR_LEADINOUT, dLeadOutTangDist As Double, dLeadOutOrthoDist As Double,
+ dCoastingLen As Double, dCoastingFeed As Double, dWipeLen As Double, dWipeFeedPu As Double, dFloorCount As Integer, dG0Feed As Double, dMaterial As String,
+ dToolDiam As Double, dRibsOverlap As Double, dRibsStrandCount As Integer, dRibsLink As Boolean, dRibsInvertOrder As Boolean, dRibsInvertDirection As Boolean,
+ dRibsLeadInInvert As Boolean, dRibsLeadInLen As Double, dRibsLeadOutInvert As Boolean, dRibsLeadOutLen As Double, dRibsLeadOutCoasting As Double,
+ dRibsLeadOutWipe As Double, dRibsLeadOutWipeDir As Double)
+
+ End Sub
+
+#Region "METHODS"
+
+
+ Friend Function ReadCurrMachParam(nPartId As Integer) As MachiningIndex
+ ' leggo parametri da pezzo
+ Dim nData As Integer = 0
+ EgtGetInfo(nPartId, MAC_GUID, m_sCurrGUID)
+ EgtGetInfo(nPartId, MAC_SLICING45, m_bCurrSlicing45)
+ EgtGetInfo(nPartId, MAC_STRANDH, m_dCurrStrandH)
+ EgtGetInfo(nPartId, MAC_STRANDW, m_dCurrStrandW)
+ EgtGetInfo(nPartId, MAC_STRANDCOUNT, m_nCurrStrandCount)
+ EgtGetInfo(nPartId, MAC_OFFSET, m_dCurrOffset)
+ EgtGetInfo(nPartId, MAC_STARTPOINTOFFSETONSLICE, m_dCurrStartPointOffsetOnSlice)
+ EgtGetInfo(nPartId, MAC_STRANDORDER, nData)
+ SetCurrStrandOrder(nData)
+ EgtGetInfo(nPartId, MAC_DIRECTION, nData)
+ SetCurrDirection(nData)
+ EgtGetInfo(nPartId, MAC_LINKTYPE, nData)
+ SetCurrLinkType(nData)
+ EgtGetInfo(nPartId, MAC_LINKPARAM, m_dCurrLinkParam)
+ EgtGetInfo(nPartId, MAC_LINKZUP, m_dCurrLinkZup)
+ EgtGetInfo(nPartId, MAC_OFFSETLEADPOINT, m_dCurrOffsetLeadPoint)
+ EgtGetInfo(nPartId, MAC_LEADIN, nData)
+ SetCurrLeadIn(nData)
+ EgtGetInfo(nPartId, MAC_LEADINTANGDIST, m_dCurrLeadInTangDist)
+ EgtGetInfo(nPartId, MAC_LEADINORTHODIST, m_dCurrLeadInOrthoDist)
+ EgtGetInfo(nPartId, MAC_LEADOUT, nData)
+ SetCurrLeadOut(nData)
+ EgtGetInfo(nPartId, MAC_LEADOUTTANGDIST, m_dCurrLeadOutTangDist)
+ EgtGetInfo(nPartId, MAC_LEADOUTORTHODIST, m_dCurrLeadOutOrthoDist)
+ EgtGetInfo(nPartId, MAC_COASTINGLEN, m_dCurrCoastingLen)
+ EgtGetInfo(nPartId, MAC_COASTINGFEED, m_dCurrCoastingFeed)
+ EgtGetInfo(nPartId, MAC_WIPELEN, m_dCurrWipeLen)
+ EgtGetInfo(nPartId, MAC_WIPEFEEDPU, m_dCurrWipeFeedPu)
+ EgtGetInfo(nPartId, MAC_FLOORCOUNT, m_dCurrFloorCount)
+ EgtGetInfo(nPartId, MAC_G0FEED, m_dCurrG0Feed)
+ EgtGetInfo(nPartId, MAC_TOOLDIAM, m_dCurrToolDiam)
+ EgtGetInfo(nPartId, MAC_RIBSOVERLAP, m_dCurrRibsOverlap)
+ EgtGetInfo(nPartId, MAC_RIBSSTRANDCOUNT, m_dCurrRibsStrandCount)
+ EgtGetInfo(nPartId, MAC_RIBSLINK, m_dCurrRibsLink)
+ EgtGetInfo(nPartId, MAC_RIBSINVERTORDER, m_dCurrRibsInvertOrder)
+ EgtGetInfo(nPartId, MAC_RIBSINVERTDIRECTION, m_dCurrRibsInvertDirection)
+ EgtGetInfo(nPartId, MAC_RIBSLEADININVERT, m_dCurrRibsLeadInInvert)
+ EgtGetInfo(nPartId, MAC_RIBSLEADINLEN, m_dCurrRibsLeadInLen)
+ EgtGetInfo(nPartId, MAC_RIBSLEADOUTINVERT, m_dCurrRibsLeadOutInvert)
+ EgtGetInfo(nPartId, MAC_RIBSLEADOUTLEN, m_dCurrRibsLeadOutLen)
+ EgtGetInfo(nPartId, MAC_RIBSLEADOUTCOASTING, m_dCurrRibsLeadOutCoasting)
+ EgtGetInfo(nPartId, MAC_RIBSLEADOUTWIPE, m_dCurrRibsLeadOutWipe)
+ EgtGetInfo(nPartId, MAC_RIBSLEADOUTWIPEDIR, m_dCurrRibsLeadOutWipeDir)
+ ' ricavo lavorazione da lista
+ Dim CurrMachiningInDb As MachiningIndex = Map.refTopPanelVM.MachiningList.FirstOrDefault(Function(x) x.sGUID = m_sCurrGUID)
+ If Not IsNothing(CurrMachiningInDb) Then
+ ' leggo parametri lavorazione originale
+ m_OrigMachining = New Machining(CurrMachiningInDb.nIndex, CurrMachiningInDb.sGUID, CurrMachiningInDb.sName)
+ 'Dim sMacIniFilePath As String = Map.refMainWindowVM.MainWindowM.sMachiningsDir & "/Machinings.ini"
+ 'm_OrigMachining.bSlicing45 = GetPrivateProfileDouble(CurrMachiningInDb.nIndex, MAC_SLICING45, 0, sMacIniFilePath)
+ 'm_OrigMachining.dStrandH = GetPrivateProfileDouble(CurrMachiningInDb.nIndex, MAC_STRANDH, 0, sMacIniFilePath)
+ 'm_OrigMachining.dStrandW = GetPrivateProfileDouble(CurrMachiningInDb.nIndex, MAC_STRANDW, 0, sMacIniFilePath)
+ 'm_OrigMachining.nStrandCount = GetPrivateProfileDouble(CurrMachiningInDb.nIndex, MAC_STRANDCOUNT, 0, sMacIniFilePath)
+ 'm_OrigMachining.dOffset = GetPrivateProfileDouble(CurrMachiningInDb.nIndex, MAC_OFFSET, 0, sMacIniFilePath)
+ 'm_OrigMachining.dStartPointOffsetOnSlice = GetPrivateProfileDouble(CurrMachiningInDb.nIndex, MAC_STARTPOINTOFFSETONSLICE, 0, sMacIniFilePath)
+ 'm_OrigMachining.dStrandOrder = GetPrivateProfileDouble(CurrMachiningInDb.nIndex, MAC_STRANDORDER, 0, sMacIniFilePath)
+ 'm_OrigMachining.dDirection = GetPrivateProfileDouble(CurrMachiningInDb.nIndex, MAC_DIRECTION, 0, sMacIniFilePath)
+ 'm_OrigMachining.dLinkType = GetPrivateProfileDouble(CurrMachiningInDb.nIndex, MAC_LINKTYPE, 0, sMacIniFilePath)
+ 'm_OrigMachining.dLinkParam = GetPrivateProfileDouble(CurrMachiningInDb.nIndex, MAC_LINKPARAM, 0, sMacIniFilePath)
+ 'm_OrigMachining.dLinkZup = GetPrivateProfileDouble(CurrMachiningInDb.nIndex, MAC_LINKZUP, 0, sMacIniFilePath)
+ 'm_OrigMachining.dOffsetLeadPoint = GetPrivateProfileDouble(CurrMachiningInDb.nIndex, MAC_OFFSETLEADPOINT, 0, sMacIniFilePath)
+ 'm_OrigMachining.dLeadIn = GetPrivateProfileDouble(CurrMachiningInDb.nIndex, MAC_LEADIN, 0, sMacIniFilePath)
+ 'm_OrigMachining.dLeadInTangDist = GetPrivateProfileDouble(CurrMachiningInDb.nIndex, MAC_LEADINTANGDIST, 0, sMacIniFilePath)
+ 'm_OrigMachining.dLeadInOrthoDist = GetPrivateProfileDouble(CurrMachiningInDb.nIndex, MAC_LEADINORTHODIST, 0, sMacIniFilePath)
+ 'm_OrigMachining.dLeadOut = GetPrivateProfileDouble(CurrMachiningInDb.nIndex, MAC_LEADOUT, 0, sMacIniFilePath)
+ 'm_OrigMachining.dLeadOutTangDist = GetPrivateProfileDouble(CurrMachiningInDb.nIndex, MAC_LEADOUTTANGDIST, 0, sMacIniFilePath)
+ 'm_OrigMachining.dLeadOutOrthoDist = GetPrivateProfileDouble(CurrMachiningInDb.nIndex, MAC_LEADOUTORTHODIST, 0, sMacIniFilePath)
+ 'm_OrigMachining.dCoastingLen = GetPrivateProfileDouble(CurrMachiningInDb.nIndex, MAC_COASTINGLEN, 0, sMacIniFilePath)
+ 'm_OrigMachining.dCoastingFeed = GetPrivateProfileDouble(CurrMachiningInDb.nIndex, MAC_COASTINGFEED, 0, sMacIniFilePath)
+ 'm_OrigMachining.dWipeLen = GetPrivateProfileDouble(CurrMachiningInDb.nIndex, MAC_WIPELEN, 0, sMacIniFilePath)
+ 'm_OrigMachining.dWipeFeedPu = GetPrivateProfileDouble(CurrMachiningInDb.nIndex, MAC_WIPEFEEDPU, 0, sMacIniFilePath)
+ 'm_OrigMachining.dFloorCount = GetPrivateProfileDouble(CurrMachiningInDb.nIndex, MAC_FLOORCOUNT, 0, sMacIniFilePath)
+ 'm_OrigMachining.dG0Feed = GetPrivateProfileDouble(CurrMachiningInDb.nIndex, MAC_G0FEED, 0, sMacIniFilePath)
+ 'm_OrigMachining.dToolDiam = GetPrivateProfileDouble(CurrMachiningInDb.nIndex, MAC_TOOLDIAM, 0, sMacIniFilePath)
+ 'm_OrigMachining.dRibsOverlap = GetPrivateProfileDouble(CurrMachiningInDb.nIndex, MAC_RIBSOVERLAP, 0, sMacIniFilePath)
+ 'm_OrigMachining.dRibsStrandCount = GetPrivateProfileDouble(CurrMachiningInDb.nIndex, MAC_RIBSSTRANDCOUNT, 0, sMacIniFilePath)
+ 'm_OrigMachining.dRibsLink = GetPrivateProfileDouble(CurrMachiningInDb.nIndex, MAC_RIBSLINK, 0, sMacIniFilePath)
+ 'm_OrigMachining.dRibsInvertOrder = GetPrivateProfileDouble(CurrMachiningInDb.nIndex, MAC_RIBSINVERTORDER, 0, sMacIniFilePath)
+ 'm_OrigMachining.dRibsInvertDirection = GetPrivateProfileDouble(CurrMachiningInDb.nIndex, MAC_RIBSINVERTDIRECTION, 0, sMacIniFilePath)
+ 'm_OrigMachining.dRibsLeadInInvert = GetPrivateProfileDouble(CurrMachiningInDb.nIndex, MAC_RIBSLEADININVERT, 0, sMacIniFilePath)
+ 'm_OrigMachining.dRibsLeadInLen = GetPrivateProfileDouble(CurrMachiningInDb.nIndex, MAC_RIBSLEADINLEN, 0, sMacIniFilePath)
+ 'm_OrigMachining.dRibsLeadOutInvert = GetPrivateProfileDouble(CurrMachiningInDb.nIndex, MAC_RIBSLEADOUTINVERT, 0, sMacIniFilePath)
+ 'm_OrigMachining.dRibsLeadOutLen = GetPrivateProfileDouble(CurrMachiningInDb.nIndex, MAC_RIBSLEADOUTLEN, 0, sMacIniFilePath)
+ 'm_OrigMachining.dRibsLeadOutCoasting = GetPrivateProfileDouble(CurrMachiningInDb.nIndex, MAC_RIBSLEADOUTCOASTING, 0, sMacIniFilePath)
+ 'm_OrigMachining.dRibsLeadOutWipe = GetPrivateProfileDouble(CurrMachiningInDb.nIndex, MAC_RIBSLEADOUTWIPE, 0, sMacIniFilePath)
+ 'm_OrigMachining.dRibsLeadOutWipeDir = GetPrivateProfileDouble(CurrMachiningInDb.nIndex, MAC_RIBSLEADOUTWIPEDIR, 0, sMacIniFilePath)
+ End If
+ Return CurrMachiningInDb
+ End Function
+
+ Friend Sub WriteMachParamOnPart(nPartId As Integer)
+ EgtSetInfo(nPartId, MAC_GUID, m_sCurrGUID)
+ EgtSetInfo(nPartId, MAC_SLICING45, m_bCurrSlicing45)
+ EgtSetInfo(nPartId, MAC_STRANDH, m_dCurrStrandH)
+ EgtSetInfo(nPartId, MAC_STRANDW, m_dCurrStrandW)
+ EgtSetInfo(nPartId, MAC_STRANDCOUNT, m_nCurrStrandCount)
+ EgtSetInfo(nPartId, MAC_OFFSET, m_dCurrOffset)
+ EgtSetInfo(nPartId, MAC_STARTPOINTOFFSETONSLICE, m_dCurrStartPointOffsetOnSlice)
+ EgtSetInfo(nPartId, MAC_STRANDORDER, m_nCurrStrandCount)
+ EgtSetInfo(nPartId, MAC_DIRECTION, m_nCurrDirection)
+ EgtSetInfo(nPartId, MAC_LINKTYPE, m_nCurrLinkType)
+ EgtSetInfo(nPartId, MAC_LINKPARAM, m_dCurrLinkParam)
+ EgtSetInfo(nPartId, MAC_LINKZUP, m_dCurrLinkZup)
+ EgtSetInfo(nPartId, MAC_OFFSETLEADPOINT, m_dCurrOffsetLeadPoint)
+ EgtSetInfo(nPartId, MAC_LEADIN, m_nCurrLeadIn)
+ EgtSetInfo(nPartId, MAC_LEADINTANGDIST, m_dCurrLeadInTangDist)
+ EgtSetInfo(nPartId, MAC_LEADINORTHODIST, m_dCurrLeadInOrthoDist)
+ EgtSetInfo(nPartId, MAC_LEADOUT, m_nCurrLeadOut)
+ EgtSetInfo(nPartId, MAC_LEADOUTTANGDIST, m_dCurrLeadOutTangDist)
+ EgtSetInfo(nPartId, MAC_LEADOUTORTHODIST, m_dCurrLeadOutOrthoDist)
+ EgtSetInfo(nPartId, MAC_COASTINGLEN, m_dCurrCoastingLen)
+ EgtSetInfo(nPartId, MAC_COASTINGFEED, m_dCurrCoastingFeed)
+ EgtSetInfo(nPartId, MAC_WIPELEN, m_dCurrWipeLen)
+ EgtSetInfo(nPartId, MAC_WIPEFEEDPU, m_dCurrWipeFeedPu)
+ EgtSetInfo(nPartId, MAC_FLOORCOUNT, m_dCurrFloorCount)
+ EgtSetInfo(nPartId, MAC_G0FEED, m_dCurrG0Feed)
+ EgtSetInfo(nPartId, MAC_TOOLDIAM, m_dCurrToolDiam)
+ EgtSetInfo(nPartId, MAC_RIBSOVERLAP, m_dCurrRibsOverlap)
+ EgtSetInfo(nPartId, MAC_RIBSSTRANDCOUNT, m_dCurrRibsStrandCount)
+ EgtSetInfo(nPartId, MAC_RIBSLINK, m_dCurrRibsLink)
+ EgtSetInfo(nPartId, MAC_RIBSINVERTORDER, m_dCurrRibsInvertOrder)
+ EgtSetInfo(nPartId, MAC_RIBSINVERTDIRECTION, m_dCurrRibsInvertDirection)
+ EgtSetInfo(nPartId, MAC_RIBSLEADININVERT, m_dCurrRibsLeadInInvert)
+ EgtSetInfo(nPartId, MAC_RIBSLEADINLEN, m_dCurrRibsLeadInLen)
+ EgtSetInfo(nPartId, MAC_RIBSLEADOUTINVERT, m_dCurrRibsLeadOutInvert)
+ EgtSetInfo(nPartId, MAC_RIBSLEADOUTLEN, m_dCurrRibsLeadOutLen)
+ EgtSetInfo(nPartId, MAC_RIBSLEADOUTCOASTING, m_dCurrRibsLeadOutCoasting)
+ EgtSetInfo(nPartId, MAC_RIBSLEADOUTWIPE, m_dCurrRibsLeadOutWipe)
+ EgtSetInfo(nPartId, MAC_RIBSLEADOUTWIPEDIR, m_dCurrRibsLeadOutWipeDir)
+ End Sub
+
+ Friend Sub UpdateMachParam()
+ NotifyPropertyChanged(NameOf(bCurrSlicing45))
+ NotifyPropertyChanged(NameOf(dCurrStrandH))
+ NotifyPropertyChanged(NameOf(dCurrStrandW))
+ NotifyPropertyChanged(NameOf(nCurrStrandCount))
+ NotifyPropertyChanged(NameOf(dCurrOffset))
+ End Sub
+
+#End Region ' METHODS
+
+#Region "COMMANDS"
+
+#Region "ResetParam"
+
+ Public ReadOnly Property ResetParam_Command As ICommand
+ Get
+ If m_cmdResetParam Is Nothing Then
+ m_cmdResetParam = New Command(AddressOf ResetParam)
+ End If
+ Return m_cmdResetParam
+ End Get
+ End Property
+
+ Public Sub ResetParam(Param As Object)
+ Select Case Param
+ Case NameOf(dCurrStrandH)
+ dCurrStrandH = m_OrigMachining.dStrandH
+ End Select
+ End Sub
+
+#End Region ' ResetParam
+
+#End Region ' COMMANDS
+
+End Class
diff --git a/3dPrintApp/MachiningManager/CurrMachiningPanelV.xaml b/3dPrintApp/MachiningManager/CurrMachiningPanelV.xaml
new file mode 100644
index 0000000..894c15e
--- /dev/null
+++ b/3dPrintApp/MachiningManager/CurrMachiningPanelV.xaml
@@ -0,0 +1,201 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/3dPrintApp/MachiningManager/CurrMachiningPanelV.xaml.vb b/3dPrintApp/MachiningManager/CurrMachiningPanelV.xaml.vb
new file mode 100644
index 0000000..6883ab2
--- /dev/null
+++ b/3dPrintApp/MachiningManager/CurrMachiningPanelV.xaml.vb
@@ -0,0 +1,3 @@
+Public Class CurrMachiningPanelV
+
+End Class
diff --git a/3dPrintApp/MachiningManager/CurrMachiningPanelVM.vb b/3dPrintApp/MachiningManager/CurrMachiningPanelVM.vb
new file mode 100644
index 0000000..247d36f
--- /dev/null
+++ b/3dPrintApp/MachiningManager/CurrMachiningPanelVM.vb
@@ -0,0 +1,88 @@
+Imports EgtWPFLib5
+
+Public Class CurrMachiningPanelVM
+ Inherits VMBase
+
+#Region "FIELDS & PROPERTIES"
+
+ Private m_CurrMachining As CurrMachining
+ Public ReadOnly Property CurrMachining As CurrMachining
+ Get
+ Return m_CurrMachining
+ End Get
+ End Property
+ Friend Sub SetCurrMachining(CurrMachining As CurrMachining)
+ m_CurrMachining = CurrMachining
+ NotifyPropertyChanged(NameOf(CurrMachining))
+ Map.refTopPanelVM.UpdateCurrMachining()
+ End Sub
+
+ ' Definizione comandi
+ Private m_cmdOk As ICommand
+ Private m_cmdCancel As ICommand
+
+#End Region ' FIELDS & PROPERTIES
+
+#Region "CONSTRUCTORS"
+
+ Sub New()
+ ' Creo riferimento a questa classe in Map
+ Map.SetRefCurrMachiningPanelVM(Me)
+ End Sub
+
+#End Region ' CONSTRUCTORS
+
+ Friend Sub ReadMachParamFromSelPart()
+ If IsNothing(Map.refTopPanelVM.SelPart) Then Return
+ Dim nData As Integer = 0
+ m_CurrMachining = New CurrMachining(Map.refTopPanelVM.SelPart.nPartId)
+ SetCurrMachining(m_CurrMachining)
+ ' aggiorno parametri mostrati nella barra
+ NotifyPropertyChanged(NameOf(CurrMachining))
+ Map.refTopPanelVM.UpdateCurrMachining()
+ 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()
+ ' scrivo i parametri modificati
+ m_CurrMachining.WriteMachParamOnPart(Map.refTopPanelVM.SelPart.nPartId)
+ ' 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
diff --git a/3dPrintApp/MachiningManager/Machining.vb b/3dPrintApp/MachiningManager/Machining.vb
new file mode 100644
index 0000000..ab8c7c8
--- /dev/null
+++ b/3dPrintApp/MachiningManager/Machining.vb
@@ -0,0 +1,539 @@
+Imports EgtUILib
+Imports EgtWPFLib5
+
+Public Class Machining
+ Inherits VMBase
+
+ Public Enum MPAR_STRANDORDERS As Integer
+ INTOOUT = 1
+ OUTTOIN = 2
+ End Enum
+
+ Public Enum MPAR_DIRECTIONS As Integer
+ CCW = 1
+ CW = 2
+ End Enum
+
+ Public Enum MPAR_LINKTYPES As Integer
+ NONE = 1
+ LINEAR = 2
+ BIARC = 3
+ End Enum
+
+ Public Enum MPAR_LEADINOUT As Integer
+ NONE = 1
+ LINEAR = 2
+ ARC = 3
+ End Enum
+
+ Private m_nIndex As Integer
+ Public ReadOnly Property nIndex As Integer
+ Get
+ Return m_nIndex
+ End Get
+ End Property
+
+ Private m_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_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_bSlicing45 As Boolean
+ Public Property bSlicing45 As Boolean
+ Get
+ Return m_bSlicing45
+ End Get
+ Set(value As Boolean)
+ m_bSlicing45 = value
+ End Set
+ End Property
+
+ Private m_dStrandH As Double
+ Public Property dStrandH As Double
+ Get
+ Return m_dStrandH
+ End Get
+ Set(value As Double)
+ m_dStrandH = value
+ End Set
+ End Property
+
+ Private m_dStrandW As Double
+ Public Property dStrandW As Double
+ Get
+ Return m_dStrandW
+ End Get
+ Set(value As Double)
+ m_dStrandW = value
+ End Set
+ End Property
+
+ Private m_nStrandCount As Integer
+ Public Property nStrandCount As Integer
+ Get
+ Return m_nStrandCount
+ End Get
+ Set(value As Integer)
+ m_nStrandCount = value
+ End Set
+ End Property
+
+ Private m_dOffset As Double
+ Public Property dOffset As Double
+ Get
+ Return m_dOffset
+ End Get
+ Set(value As Double)
+ m_dOffset = value
+ End Set
+ End Property
+
+ Private m_dStartPointOffsetOnSlice As Double
+ Public Property dStartPointOffsetOnSlice As Double
+ Get
+ Return m_dStartPointOffsetOnSlice
+ End Get
+ Set(value As Double)
+ m_dStartPointOffsetOnSlice = value
+ End Set
+ End Property
+
+ Private m_dStrandOrder As MPAR_STRANDORDERS
+ Public Property dStrandOrder As MPAR_STRANDORDERS
+ Get
+ Return m_dStrandOrder
+ End Get
+ Set(value As MPAR_STRANDORDERS)
+ m_dStrandOrder = value
+ End Set
+ End Property
+ Friend Sub SetStrandOrder(StrandOrder As Integer)
+ m_dStrandOrder = StrandOrder
+ End Sub
+
+ Private m_dDirection As MPAR_DIRECTIONS
+ Public Property dDirection As MPAR_DIRECTIONS
+ Get
+ Return m_dDirection
+ End Get
+ Set(value As MPAR_DIRECTIONS)
+ m_dDirection = value
+ End Set
+ End Property
+ Friend Sub SetDirection(Direction As Integer)
+ m_dDirection = Direction
+ End Sub
+
+ Private m_dLinkType As MPAR_LINKTYPES
+ Public Property dLinkType As MPAR_LINKTYPES
+ Get
+ Return m_dLinkType
+ End Get
+ Set(value As MPAR_LINKTYPES)
+ m_dLinkType = value
+ End Set
+ End Property
+ Friend Sub SetLinkType(LinkType As Integer)
+ m_dLinkType = LinkType
+ End Sub
+
+ Private m_dLinkParam As Double
+ Public Property dLinkParam As Double
+ Get
+ Return m_dLinkParam
+ End Get
+ Set(value As Double)
+ m_dLinkParam = value
+ End Set
+ End Property
+
+ Private m_dLinkZup As Double
+ Public Property dLinkZup As Double
+ Get
+ Return m_dLinkZup
+ End Get
+ Set(value As Double)
+ m_dLinkZup = value
+ End Set
+ End Property
+
+ Private m_dOffsetLeadPoint As Double
+ Public Property dOffsetLeadPoint As Double
+ Get
+ Return m_dOffsetLeadPoint
+ End Get
+ Set(value As Double)
+ m_dOffsetLeadPoint = value
+ End Set
+ End Property
+
+ Private m_dLeadIn As MPAR_LEADINOUT
+ Public Property dLeadIn As MPAR_LEADINOUT
+ Get
+ Return m_dLeadIn
+ End Get
+ Set(value As MPAR_LEADINOUT)
+ m_dLeadIn = value
+ End Set
+ End Property
+ Friend Sub SetLeadIn(LeadIn As Integer)
+ m_dLeadIn = LeadIn
+ End Sub
+
+ Private m_dLeadInTangDist As Double
+ Public Property dLeadInTangDist As Double
+ Get
+ Return m_dLeadInTangDist
+ End Get
+ Set(value As Double)
+ m_dLeadInTangDist = value
+ End Set
+ End Property
+
+ Private m_dLeadInOrthoDist As Double
+ Public Property dLeadInOrthoDist As Double
+ Get
+ Return m_dLeadInOrthoDist
+ End Get
+ Set(value As Double)
+ m_dLeadInOrthoDist = value
+ End Set
+ End Property
+
+ Private m_dLeadOut As MPAR_LEADINOUT
+ Public Property dLeadOut As MPAR_LEADINOUT
+ Get
+ Return m_dLeadOut
+ End Get
+ Set(value As MPAR_LEADINOUT)
+ m_dLeadOut = value
+ End Set
+ End Property
+ Friend Sub SetLeadOut(LeadOut As Integer)
+ m_dLeadOut = LeadOut
+ End Sub
+
+ Private m_dLeadOutTangDist As Double
+ Public Property dLeadOutTangDist As Double
+ Get
+ Return m_dLeadOutTangDist
+ End Get
+ Set(value As Double)
+ m_dLeadOutTangDist = value
+ End Set
+ End Property
+
+ Private m_dLeadOutOrthoDist As Double
+ Public Property dLeadOutOrthoDist As Double
+ Get
+ Return m_dLeadOutOrthoDist
+ End Get
+ Set(value As Double)
+ m_dLeadOutOrthoDist = value
+ End Set
+ End Property
+
+ Private m_dCoastingLen As Double
+ Public Property dCoastingLen As Double
+ Get
+ Return m_dCoastingLen
+ End Get
+ Set(value As Double)
+ m_dCoastingLen = value
+ End Set
+ End Property
+
+ Private m_dCoastingFeed As Double
+ Public Property dCoastingFeed As Double
+ Get
+ Return m_dCoastingFeed
+ End Get
+ Set(value As Double)
+ m_dCoastingFeed = value
+ End Set
+ End Property
+
+ Private m_dWipeLen As Double
+ Public Property dWipeLen As Double
+ Get
+ Return m_dWipeLen
+ End Get
+ Set(value As Double)
+ m_dWipeLen = value
+ End Set
+ End Property
+
+ Private m_dWipeFeedPu As Double
+ Public Property dWipeFeedPu As Double
+ Get
+ Return m_dWipeFeedPu
+ End Get
+ Set(value As Double)
+ m_dWipeFeedPu = value
+ End Set
+ End Property
+
+ Private m_dFloorCount As Integer
+ Public Property dFloorCount As Double
+ Get
+ Return m_dFloorCount
+ End Get
+ Set(value As Double)
+ m_dFloorCount = value
+ End Set
+ End Property
+
+ Private m_dG0Feed As Double
+ Public Property dG0Feed As Double
+ Get
+ Return m_dG0Feed
+ End Get
+ Set(value As Double)
+ m_dG0Feed = value
+ End Set
+ End Property
+
+ Private m_dMaterial As String
+ Public Property dMaterial As Double
+ Get
+ Return m_dMaterial
+ End Get
+ Set(value As Double)
+ m_dMaterial = value
+ End Set
+ End Property
+
+ Private m_dToolDiam As Double
+ Public Property dToolDiam As Double
+ Get
+ Return m_dToolDiam
+ End Get
+ Set(value As Double)
+ m_dToolDiam = value
+ End Set
+ End Property
+
+ Private m_dRibsOverlap As Double
+ Public Property dRibsOverlap As Double
+ Get
+ Return m_dRibsOverlap
+ End Get
+ Set(value As Double)
+ m_dRibsOverlap = value
+ End Set
+ End Property
+
+ Private m_dRibsStrandCount As Integer
+ Public Property dRibsStrandCount As Double
+ Get
+ Return m_dRibsStrandCount
+ End Get
+ Set(value As Double)
+ m_dRibsStrandCount = value
+ End Set
+ End Property
+
+ Private m_dRibsLink As Boolean
+ Public Property dRibsLink As Double
+ Get
+ Return m_dRibsLink
+ End Get
+ Set(value As Double)
+ m_dRibsLink = value
+ End Set
+ End Property
+
+ Private m_dRibsInvertOrder As Boolean
+ Public Property dRibsInvertOrder As Double
+ Get
+ Return m_dRibsInvertOrder
+ End Get
+ Set(value As Double)
+ m_dRibsInvertOrder = value
+ End Set
+ End Property
+
+ Private m_dRibsInvertDirection As Boolean
+ Public Property dRibsInvertDirection As Double
+ Get
+ Return m_dRibsInvertDirection
+ End Get
+ Set(value As Double)
+ m_dRibsInvertDirection = value
+ End Set
+ End Property
+
+ Private m_dRibsLeadInInvert As Boolean
+ Public Property dRibsLeadInInvert As Double
+ Get
+ Return m_dRibsLeadInInvert
+ End Get
+ Set(value As Double)
+ m_dRibsLeadInInvert = value
+ End Set
+ End Property
+
+ Private m_dRibsLeadInLen As Double
+ Public Property dRibsLeadInLen As Double
+ Get
+ Return m_dRibsLeadInLen
+ End Get
+ Set(value As Double)
+ m_dRibsLeadInLen = value
+ End Set
+ End Property
+
+ Private m_dRibsLeadOutInvert As Boolean
+ Public Property dRibsLeadOutInvert As Double
+ Get
+ Return m_dRibsLeadOutInvert
+ End Get
+ Set(value As Double)
+ m_dRibsLeadOutInvert = value
+ End Set
+ End Property
+
+ Private m_dRibsLeadOutLen As Double
+ Public Property dRibsLeadOutLen As Double
+ Get
+ Return m_dRibsLeadOutLen
+ End Get
+ Set(value As Double)
+ m_dRibsLeadOutLen = value
+ End Set
+ End Property
+
+ Private m_dRibsLeadOutCoasting As Double
+ Public Property dRibsLeadOutCoasting As Double
+ Get
+ Return m_dRibsLeadOutCoasting
+ End Get
+ Set(value As Double)
+ m_dRibsLeadOutCoasting = value
+ End Set
+ End Property
+
+ Private m_dRibsLeadOutWipe As Double
+ Public Property dRibsLeadOutWipe As Double
+ Get
+ Return m_dRibsLeadOutWipe
+ End Get
+ Set(value As Double)
+ m_dRibsLeadOutWipe = value
+ End Set
+ End Property
+
+ Private m_dRibsLeadOutWipeDir As Double
+ Public Property dRibsLeadOutWipeDir As Double
+ Get
+ Return m_dRibsLeadOutWipeDir
+ End Get
+ Set(value As Double)
+ m_dRibsLeadOutWipeDir = value
+ End Set
+ End Property
+
+ Sub New()
+ End Sub
+
+ Sub New(nIndex As Integer, sGUID As String, sName As String)
+ m_nIndex = nIndex
+ m_sName = sName
+ m_sGUID = sGUID
+ Dim sMacIniFilePath As String = Map.refMainWindowVM.MainWindowM.sMachiningsDir & "/Machinings.ini"
+ m_bSlicing45 = GetPrivateProfileDouble(m_nIndex, MAC_SLICING45, 0, sMacIniFilePath)
+ m_dStrandH = GetPrivateProfileDouble(m_nIndex, MAC_STRANDH, 0, sMacIniFilePath)
+ m_dStrandW = GetPrivateProfileDouble(m_nIndex, MAC_STRANDW, 0, sMacIniFilePath)
+ m_nStrandCount = GetPrivateProfileDouble(m_nIndex, MAC_STRANDCOUNT, 0, sMacIniFilePath)
+ m_dOffset = GetPrivateProfileDouble(m_nIndex, MAC_OFFSET, 0, sMacIniFilePath)
+ m_dStartPointOffsetOnSlice = GetPrivateProfileDouble(m_nIndex, MAC_STARTPOINTOFFSETONSLICE, 0, sMacIniFilePath)
+ m_dStrandOrder = GetPrivateProfileDouble(m_nIndex, MAC_STRANDORDER, 0, sMacIniFilePath)
+ m_dDirection = GetPrivateProfileDouble(m_nIndex, MAC_DIRECTION, 0, sMacIniFilePath)
+ m_dLinkType = GetPrivateProfileDouble(m_nIndex, MAC_LINKTYPE, 0, sMacIniFilePath)
+ m_dLinkParam = GetPrivateProfileDouble(m_nIndex, MAC_LINKPARAM, 0, sMacIniFilePath)
+ m_dLinkZup = GetPrivateProfileDouble(m_nIndex, MAC_LINKZUP, 0, sMacIniFilePath)
+ m_dOffsetLeadPoint = GetPrivateProfileDouble(m_nIndex, MAC_OFFSETLEADPOINT, 0, sMacIniFilePath)
+ m_dLeadIn = GetPrivateProfileDouble(m_nIndex, MAC_LEADIN, 0, sMacIniFilePath)
+ m_dLeadInTangDist = GetPrivateProfileDouble(m_nIndex, MAC_LEADINTANGDIST, 0, sMacIniFilePath)
+ m_dLeadInOrthoDist = GetPrivateProfileDouble(m_nIndex, MAC_LEADINORTHODIST, 0, sMacIniFilePath)
+ m_dLeadOut = GetPrivateProfileDouble(m_nIndex, MAC_LEADOUT, 0, sMacIniFilePath)
+ m_dLeadOutTangDist = GetPrivateProfileDouble(m_nIndex, MAC_LEADOUTTANGDIST, 0, sMacIniFilePath)
+ m_dLeadOutOrthoDist = GetPrivateProfileDouble(m_nIndex, MAC_LEADOUTORTHODIST, 0, sMacIniFilePath)
+ m_dCoastingLen = GetPrivateProfileDouble(m_nIndex, MAC_COASTINGLEN, 0, sMacIniFilePath)
+ m_dCoastingFeed = GetPrivateProfileDouble(m_nIndex, MAC_COASTINGFEED, 0, sMacIniFilePath)
+ m_dWipeLen = GetPrivateProfileDouble(m_nIndex, MAC_WIPELEN, 0, sMacIniFilePath)
+ m_dWipeFeedPu = GetPrivateProfileDouble(m_nIndex, MAC_WIPEFEEDPU, 0, sMacIniFilePath)
+ m_dFloorCount = GetPrivateProfileDouble(m_nIndex, MAC_FLOORCOUNT, 0, sMacIniFilePath)
+ m_dG0Feed = GetPrivateProfileDouble(m_nIndex, MAC_G0FEED, 0, sMacIniFilePath)
+ m_dToolDiam = GetPrivateProfileDouble(m_nIndex, MAC_TOOLDIAM, 0, sMacIniFilePath)
+ m_dRibsOverlap = GetPrivateProfileDouble(m_nIndex, MAC_RIBSOVERLAP, 0, sMacIniFilePath)
+ m_dRibsStrandCount = GetPrivateProfileDouble(m_nIndex, MAC_RIBSSTRANDCOUNT, 0, sMacIniFilePath)
+ m_dRibsLink = GetPrivateProfileDouble(m_nIndex, MAC_RIBSLINK, 0, sMacIniFilePath)
+ m_dRibsInvertOrder = GetPrivateProfileDouble(m_nIndex, MAC_RIBSINVERTORDER, 0, sMacIniFilePath)
+ m_dRibsInvertDirection = GetPrivateProfileDouble(m_nIndex, MAC_RIBSINVERTDIRECTION, 0, sMacIniFilePath)
+ m_dRibsLeadInInvert = GetPrivateProfileDouble(m_nIndex, MAC_RIBSLEADININVERT, 0, sMacIniFilePath)
+ m_dRibsLeadInLen = GetPrivateProfileDouble(m_nIndex, MAC_RIBSLEADINLEN, 0, sMacIniFilePath)
+ m_dRibsLeadOutInvert = GetPrivateProfileDouble(m_nIndex, MAC_RIBSLEADOUTINVERT, 0, sMacIniFilePath)
+ m_dRibsLeadOutLen = GetPrivateProfileDouble(m_nIndex, MAC_RIBSLEADOUTLEN, 0, sMacIniFilePath)
+ m_dRibsLeadOutCoasting = GetPrivateProfileDouble(m_nIndex, MAC_RIBSLEADOUTCOASTING, 0, sMacIniFilePath)
+ m_dRibsLeadOutWipe = GetPrivateProfileDouble(m_nIndex, MAC_RIBSLEADOUTWIPE, 0, sMacIniFilePath)
+ m_dRibsLeadOutWipeDir = GetPrivateProfileDouble(m_nIndex, MAC_RIBSLEADOUTWIPEDIR, 0, sMacIniFilePath)
+ End Sub
+
+ Sub New(sName As String, bSlicing45 As Boolean, dStrandH As Double, dStrandW As Double, nStrandCount As Integer, dOffset As Double, dStartPointOffsetOnSlice As Double,
+ dStrandOrder As MPAR_STRANDORDERS, dDirection As MPAR_DIRECTIONS, dLinkType As MPAR_LINKTYPES, dLinkParam As Double, dLinkZup As Double, dOffsetLeadPoint As Double,
+ dLeadIn As MPAR_LEADINOUT, dLeadInTangDist As Double, dLeadInOrthoDist As Double, dLeadOut As MPAR_LEADINOUT, dLeadOutTangDist As Double, dLeadOutOrthoDist As Double,
+ dCoastingLen As Double, dCoastingFeed As Double, dWipeLen As Double, dWipeFeedPu As Double, dFloorCount As Integer, dG0Feed As Double, dMaterial As String,
+ dToolDiam As Double, dRibsOverlap As Double, dRibsStrandCount As Integer, dRibsLink As Boolean, dRibsInvertOrder As Boolean, dRibsInvertDirection As Boolean,
+ dRibsLeadInInvert As Boolean, dRibsLeadInLen As Double, dRibsLeadOutInvert As Boolean, dRibsLeadOutLen As Double, dRibsLeadOutCoasting As Double,
+ dRibsLeadOutWipe As Double, dRibsLeadOutWipeDir As Double)
+
+ End Sub
+
+End Class
+
+Public Class MachiningIndex
+
+ Private m_nIndex As Integer
+ Public ReadOnly Property nIndex As Integer
+ Get
+ Return m_nIndex
+ End Get
+ End Property
+
+ Private m_sGUID As String
+ Public ReadOnly Property sGUID As String
+ Get
+ Return m_sGUID
+ End Get
+ End Property
+
+ Private m_sName As String
+ Public ReadOnly Property sName As String
+ Get
+ Return m_sName
+ End Get
+ End Property
+
+ Sub New(nIndex As Integer, sGUID As String, sName As String)
+ m_nIndex = nIndex
+ m_sGUID = sGUID
+ m_sName = sName
+ End Sub
+
+End Class
\ No newline at end of file
diff --git a/3dPrintApp/MainWindow/MainWindowV.xaml b/3dPrintApp/MainWindow/MainWindowV.xaml
index a782b35..1ebb7f7 100644
--- a/3dPrintApp/MainWindow/MainWindowV.xaml
+++ b/3dPrintApp/MainWindow/MainWindowV.xaml
@@ -4,7 +4,8 @@
xmlns:EgtWPFLib5="clr-namespace:EgtWPFLib5;assembly=EgtWPFLib5"
xmlns:PrintApp="clr-namespace:_3dPrintApp"
Style="{DynamicResource {x:Type EgtWPFLib5:EgtCustomWindow}}"
- Title="{Binding Title}" Icon="/Resources/EgtBEAMWALL.ico"
+ Foreground="Black"
+ Title="Buongiorno" Icon="/Resources/EgtBEAMWALL.ico"
MinHeight="600" MinWidth="800"
AboutBoxCommand="{Binding AboutBoxCommand}" WindowStyle="None" ResizeMode="NoResize"
AllowDrop="True" Drop="MainWindowV_Drop"
diff --git a/3dPrintApp/MainWindow/MainWindowV.xaml.vb b/3dPrintApp/MainWindow/MainWindowV.xaml.vb
index 053ef6f..31c3d68 100644
--- a/3dPrintApp/MainWindow/MainWindowV.xaml.vb
+++ b/3dPrintApp/MainWindow/MainWindowV.xaml.vb
@@ -16,6 +16,7 @@ Class MainWindowV
Me.DataContext = m_MainWindowVM
' creo finestra della scena
AddHandler Me.Loaded, AddressOf MainWindowV_Loaded
+ AddHandler Me.ContentRendered, AddressOf MainWindowV_ContentRendered
AddHandler Me.Closing, AddressOf MainWindowV_Closing
AddHandler Me.KeyDown, AddressOf MainWindowV_KeyDown
End Sub
@@ -32,6 +33,10 @@ Class MainWindowV
EgtSetMainWindowHandle(hMainWnd)
End Sub
+ Private Sub MainWindowV_ContentRendered(sender As Object, e As EventArgs)
+ m_MainWindowVM.ContentRendered()
+ End Sub
+
Private Sub MainWindowV_Closing(sender As Object, e As System.ComponentModel.CancelEventArgs)
If (Keyboard.Modifiers And ModifierKeys.Alt) = ModifierKeys.Alt OrElse Keyboard.IsKeyDown(Key.F4) Then
e.Cancel = True
@@ -44,7 +49,7 @@ Class MainWindowV
End Sub
Private Sub MainWindowV_KeyDown(sender As Object, e As KeyEventArgs)
- 'm_MainWindowVM.KeyDown(e.Key)
+ m_MainWindowVM.KeyDown(e.Key)
End Sub
Private Sub MainWindowV_Drop(sender As Object, e As DragEventArgs)
diff --git a/3dPrintApp/MainWindow/MainWindowVM.vb b/3dPrintApp/MainWindow/MainWindowVM.vb
index c78cfd4..ac28897 100644
--- a/3dPrintApp/MainWindow/MainWindowVM.vb
+++ b/3dPrintApp/MainWindow/MainWindowVM.vb
@@ -27,7 +27,7 @@ Public Class MainWindowVM
End Property
' Titolo
- Private m_Title As String = ""
+ Private m_Title As String = "Ciao"
Public ReadOnly Property Title As String
Get
Return m_Title
@@ -76,81 +76,82 @@ Public Class MainWindowVM
'#Region "METHODS"
- ' Friend Sub SetTitle(sTitle As String)
- ' m_Title = sTitle
- ' NotifyPropertyChanged(NameOf(Title))
- ' End Sub
- ' Public Sub UpdateTitle()
- ' m_Title = ""
- ' Select Case Map.refMainMenuVM.SelPage
- ' Case Pages.VIEW
- ' If Not IsNothing(Map.refProjManagerVM.CurrProj) Then
- ' If Map.refProjManagerVM.CurrProj.bIsNew Then m_Title = "New - "
- ' m_Title &= Map.refProjManagerVM.CurrProj.nProjId.ToString("0000") & " - " & Map.refProjManagerVM.CurrProj.sBTLFileName
- ' End If
- ' Case Pages.MACHINING
- ' If Not IsNothing(Map.refProdManagerVM.CurrProd) Then
- ' If Map.refProdManagerVM.CurrProd.bIsNew Then m_Title = "New - "
- ' m_Title &= Map.refProdManagerVM.CurrProd.nProdId.ToString("0000") & " - " & Map.refProdManagerVM.CurrProd.sBTLFileName
- ' End If
- ' Case Pages.CONFIG
- ' m_Title = "Configuration Page"
- ' End Select
- ' m_Title &= " - EgtBEAMWALL"
- ' NotifyPropertyChanged(NameOf(Title))
- ' End Sub
-
- ' Friend Sub ContentRendered()
- ' DbControllers.Init()
- ' '' chiamata a caso su Db per inizializzarlo
- ' DbControllers.m_ProjController.FindByProjDbId(0)
- ' ' Verifico che l'inizializzazione di tutte le parti del programma sia andata a buon fine
- ' If Map.EndInit() Then
- ' m_bInitStatus = True
- ' ' altrimenti chiudo il programma
- ' Else
- ' m_bInitStatus = False
- ' End If
- ' ' Aggiorno visualizzazione unità di misura
- ' 'Map.refStatusBarVM.SetMeasureUnit(If(EgtUiUnitsAreMM(), MeasureUnitOpt.MM, MeasureUnitOpt.INCH))
- ' ' imposto MainWindow per finestra di Loading
- ' LoadingWndHelper.SetMainWindow(Application.Current.MainWindow)
- ' ' leggo riga di comando
- ' Dim nCommandType As Integer = 0
- ' Dim nPage As Pages = Pages.VIEW
- ' Dim nProdId As Integer = 0
- ' If ProcessCommandLine(nCommandType, nPage, nProdId) Then
- ' Select Case nCommandType
- ' Case 1
- ' Map.refProdManagerVM.SetCurrProd(nProdId)
- ' Case 2
- ' ' pagina gia' impostata nella variabile
- ' End Select
- ' Else
- ' ' setto il primo file dalla lista degli MRU come progetto corrente da aprire
- ' Dim sLastProjectPath As String = String.Empty
- ' GetMainPrivateProfileString(S_MRUPROJFILES, K_FILE & "1", String.Empty, sLastProjectPath)
- ' If Not String.IsNullOrWhiteSpace(sLastProjectPath) AndAlso File.Exists(sLastProjectPath) Then
- ' ' ricavo l'Id e il progetto associato per l'apertura di quest'ultimo
- ' Dim PjId As Integer = 0
- ' Dim sPjId As String = Path.GetFileNameWithoutExtension(sLastProjectPath)
- ' Integer.TryParse(sPjId, PjId)
- ' Map.refProjManagerVM.SetCurrProj(PjId)
+ Friend Sub SetTitle(sTitle As String)
+ m_Title = sTitle
+ NotifyPropertyChanged(NameOf(Title))
+ End Sub
+ 'Public Sub UpdateTitle()
+ ' m_Title = ""
+ ' Select Case Map.refMainMenuVM.SelPage
+ ' Case Pages.VIEW
+ ' If Not IsNothing(Map.refProjManagerVM.CurrProj) Then
+ ' If Map.refProjManagerVM.CurrProj.bIsNew Then m_Title = "New - "
+ ' m_Title &= Map.refProjManagerVM.CurrProj.nProjId.ToString("0000") & " - " & Map.refProjManagerVM.CurrProj.sBTLFileName
' End If
- ' End If
- ' ' seleziono pagina da aprire
- ' Map.refMainMenuVM.SelPage = nPage
+ ' Case Pages.MACHINING
+ ' If Not IsNothing(Map.refProdManagerVM.CurrProd) Then
+ ' If Map.refProdManagerVM.CurrProd.bIsNew Then m_Title = "New - "
+ ' m_Title &= Map.refProdManagerVM.CurrProd.nProdId.ToString("0000") & " - " & Map.refProdManagerVM.CurrProd.sBTLFileName
+ ' End If
+ ' Case Pages.CONFIG
+ ' m_Title = "Configuration Page"
+ ' End Select
+ ' m_Title &= " - EgtBEAMWALL"
+ ' NotifyPropertyChanged(NameOf(Title))
+ 'End Sub
- ' ' inizializzo thread di aggiornamento e comunicazione con DB
- ' ' creo thread gestione macchina
- ' m_SupervisorCommThread = New Thread(Sub()
- ' SupervisorCommThread.SupervisorCommThreadFunction()
- ' End Sub)
- ' m_SupervisorCommThread.SetApartmentState(ApartmentState.STA)
- ' ' avvio thread di gestione della macchina che avvia la connessione
- ' m_SupervisorCommThread.Start()
+ Friend Sub ContentRendered()
+ Map.refTopPanelVM.SelPage = Pages.NULL
+ 'DbControllers.Init()
+ ''' chiamata a caso su Db per inizializzarlo
+ 'DbControllers.m_ProjController.FindByProjDbId(0)
+ '' Verifico che l'inizializzazione di tutte le parti del programma sia andata a buon fine
+ 'If Map.EndInit() Then
+ ' m_bInitStatus = True
+ ' ' altrimenti chiudo il programma
+ 'Else
+ ' m_bInitStatus = False
+ 'End If
+ '' Aggiorno visualizzazione unità di misura
+ ''Map.refStatusBarVM.SetMeasureUnit(If(EgtUiUnitsAreMM(), MeasureUnitOpt.MM, MeasureUnitOpt.INCH))
+ '' imposto MainWindow per finestra di Loading
+ 'LoadingWndHelper.SetMainWindow(Application.Current.MainWindow)
+ '' leggo riga di comando
+ 'Dim nCommandType As Integer = 0
+ 'Dim nPage As Pages = Pages.VIEW
+ 'Dim nProdId As Integer = 0
+ 'If ProcessCommandLine(nCommandType, nPage, nProdId) Then
+ ' Select Case nCommandType
+ ' Case 1
+ ' Map.refProdManagerVM.SetCurrProd(nProdId)
+ ' Case 2
+ ' ' pagina gia' impostata nella variabile
+ ' End Select
+ 'Else
+ ' ' setto il primo file dalla lista degli MRU come progetto corrente da aprire
+ ' Dim sLastProjectPath As String = String.Empty
+ ' GetMainPrivateProfileString(S_MRUPROJFILES, K_FILE & "1", String.Empty, sLastProjectPath)
+ ' If Not String.IsNullOrWhiteSpace(sLastProjectPath) AndAlso File.Exists(sLastProjectPath) Then
+ ' ' ricavo l'Id e il progetto associato per l'apertura di quest'ultimo
+ ' Dim PjId As Integer = 0
+ ' Dim sPjId As String = Path.GetFileNameWithoutExtension(sLastProjectPath)
+ ' Integer.TryParse(sPjId, PjId)
+ ' Map.refProjManagerVM.SetCurrProj(PjId)
+ ' End If
+ 'End If
+ '' seleziono pagina da aprire
+ 'Map.refMainMenuVM.SelPage = nPage
- ' End Sub
+ '' inizializzo thread di aggiornamento e comunicazione con DB
+ '' creo thread gestione macchina
+ 'm_SupervisorCommThread = New Thread(Sub()
+ ' SupervisorCommThread.SupervisorCommThreadFunction()
+ ' End Sub)
+ 'm_SupervisorCommThread.SetApartmentState(ApartmentState.STA)
+ '' avvio thread di gestione della macchina che avvia la connessione
+ 'm_SupervisorCommThread.Start()
+
+ End Sub
' Friend Function ProcessCommandLine(ByRef nCommandType As Integer, ByRef nPage As Pages, ByRef nProdId As Integer) As Boolean
' ' Se non ci sono veri parametri su linea di comando, esco (il primo è sempre il nome del programma)
@@ -174,31 +175,20 @@ Public Class MainWindowVM
' Return False
' End Function
- ' Friend Sub KeyDown(PressedKey As Key)
- ' ' Con ESC esco dall'azione corrente
- ' If PressedKey = Key.Escape Then
- ' ' se in modifica L250
- ' If Map.refFreeContourManagerVM.bIsActive Then
- ' ' se in modifica testo angolo di inclinazione
- ' If Map.refFreeContourManagerVM.bIsModifyingTextAngle Then
- ' Map.refFreeContourManagerVM.CloseIsModifyingTextAngle(False)
- ' End If
- ' ' reset Azione corrente
- ' Map.refSceneHostVM.MainController.ResetStatus()
- ' Map.refFreeContourInputVM.ResetInputBox()
- ' End If
- ' ' se misura attiva, la disattivo
- ' If Map.refInstrumentPanelVM.GetDistIsChecked Then
- ' Map.refInstrumentPanelVM.SetGetDistance_IsChecked(False)
- ' End If
- ' ' se Reset Macchina è aperto
- ' If (nSelTabPage = Pages.VIEW Or nSelTabPage = Pages.MACHINING) AndAlso Map.refCALCPanelVM.ChooseMachine_Visibility = Visibility.Visible Then
- ' Map.refCALCPanelVM.CloseResetMachine()
- ' End If
- ' ' pulisco output
- ' Map.refMyStatusBarVM.ClearOutputMessage()
- ' End If
- ' End Sub
+ Friend Sub KeyDown(PressedKey As Key)
+ ' Con ESC esco dall'azione corrente
+ If PressedKey = Key.Escape Then
+ ' reset Azione corrente
+ Map.refSceneHostVM.MainController.ResetStatus()
+ Map.refControllerInputPanelVM.ResetInputBox()
+ ' se misura attiva, la disattivo
+ If Map.refInstrumentPanelVM.GetDistIsChecked Then
+ Map.refInstrumentPanelVM.SetGetDistance_IsChecked(False)
+ End If
+ ' pulisco output
+ Map.refMyStatusBarVM.ClearOutputMessage()
+ End If
+ End Sub
' Friend m_ManagingSupervisorStop As Boolean = False
diff --git a/3dPrintApp/MaterialManager/Material.vb b/3dPrintApp/MaterialManager/Material.vb
new file mode 100644
index 0000000..ad422cd
--- /dev/null
+++ b/3dPrintApp/MaterialManager/Material.vb
@@ -0,0 +1,168 @@
+Imports EgtUILib
+
+Public Class Material
+
+ Private m_nIndex As Integer
+ Public ReadOnly Property nIndex As Integer
+ Get
+ Return m_nIndex
+ End Get
+ End Property
+
+ Private m_sGUID As String
+ Public ReadOnly Property sGUID As String
+ Get
+ Return m_sGUID
+ End Get
+ End Property
+
+ Private m_sName As String
+ Public ReadOnly Property sName As String
+ Get
+ Return m_sName
+ End Get
+ End Property
+
+ Private m_dK As Double
+ Public ReadOnly Property dK As Double
+ 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
+ End Get
+ End Property
+
+ Sub New(nIndex As Integer, sGUID As String, sName As String)
+ m_nIndex = nIndex
+ m_sName = sName
+ m_sGUID = sGUID
+ Dim sMatIniFilePath As String = Map.refMainWindowVM.MainWindowM.sMaterialsDir & "/Materials.ini"
+ m_dK = GetPrivateProfileDouble(m_nIndex, MAT_K, 0, sMatIniFilePath)
+ m_dC1 = GetPrivateProfileDouble(m_nIndex, MAT_C1, 0, sMatIniFilePath)
+ m_dC2 = GetPrivateProfileDouble(m_nIndex, MAT_C2, 0, sMatIniFilePath)
+ m_dDensity = GetPrivateProfileDouble(m_nIndex, MAT_DENSITY, 0, sMatIniFilePath)
+ m_dAMax = GetPrivateProfileDouble(m_nIndex, MAT_AMAX, 0, sMatIniFilePath)
+ m_dATrg = GetPrivateProfileDouble(m_nIndex, MAT_ATrg, 0, sMatIniFilePath)
+ m_dAMin = GetPrivateProfileDouble(m_nIndex, MAT_AMin, 0, sMatIniFilePath)
+ m_dBMax = GetPrivateProfileDouble(m_nIndex, MAT_BMAX, 0, sMatIniFilePath)
+ m_dBTrg = GetPrivateProfileDouble(m_nIndex, MAT_BTrg, 0, sMatIniFilePath)
+ m_dBMin = GetPrivateProfileDouble(m_nIndex, MAT_BMin, 0, sMatIniFilePath)
+ m_dKW = GetPrivateProfileDouble(m_nIndex, MAT_KW, 0, sMatIniFilePath)
+ m_dKZ = GetPrivateProfileDouble(m_nIndex, MAT_KZ, 0, sMatIniFilePath)
+ m_dKN = GetPrivateProfileDouble(m_nIndex, MAT_KN, 0, sMatIniFilePath)
+ End Sub
+
+End Class
+
+Public Class MaterialIndex
+
+ Private m_nIndex As Integer
+ Public ReadOnly Property nIndex As Integer
+ Get
+ Return m_nIndex
+ End Get
+ End Property
+
+ Private m_sGUID As String
+ Public ReadOnly Property sGUID As String
+ Get
+ Return m_sGUID
+ End Get
+ End Property
+
+ Private m_sName As String
+ Public ReadOnly Property sName As String
+ Get
+ Return m_sName
+ End Get
+ End Property
+
+ Sub New(nIndex As Integer, sGUID As String, sName As String)
+ m_nIndex = nIndex
+ m_sGUID = sGUID
+ m_sName = sName
+ End Sub
+
+End Class
\ No newline at end of file
diff --git a/3dPrintApp/ProjManager/ProjManagerVM.vb b/3dPrintApp/ProjManager/ProjManagerVM.vb
index aceb184..c5e877e 100644
--- a/3dPrintApp/ProjManager/ProjManagerVM.vb
+++ b/3dPrintApp/ProjManager/ProjManagerVM.vb
@@ -32,6 +32,23 @@ Public Class ProjManagerVM
End Get
End Property
+ Private m_MruImportFiles As New MruList
+ Public ReadOnly Property MruImportFiles As MruList
+ Get
+ Return m_MruImportFiles
+ End Get
+ End Property
+ Public ReadOnly Property MruImportFileNames As ObservableCollection(Of String)
+ Get
+ For Each FileName In m_MruImportFiles.FileNames.ToList()
+ If Not File.Exists(FileName) Then
+ m_MruImportFiles.Remove(FileName)
+ End If
+ Next
+ Return m_MruImportFiles.FileNames
+ End Get
+ End Property
+
' Definizione comandi
Private m_cmdNew As ICommand
Private m_cmdOpen As ICommand
@@ -108,6 +125,7 @@ Public Class ProjManagerVM
Map.SetRefProjManagerVM(Me)
' Impostazioni MruLists
m_MruFiles.Init(S_MRUFILES, 8)
+ m_MruImportFiles.Init(S_MRUIMPORTFILES, 8)
End Sub
#End Region ' CONSTRUCTOR
@@ -165,8 +183,14 @@ Public Class ProjManagerVM
Friend Sub OpenProject(sFilePath As String)
If String.IsNullOrEmpty(sFilePath) Then
- Dim sDir As String = String.Empty
- GetMainPrivateProfileString(S_GENERAL, K_LASTNGEDIR, "", sDir)
+ ' Recupero cartella dell'ultimo progetto aperto
+ Dim sDir As String = Map.refSceneHostVM.MainController.GetCurrFile()
+ If String.IsNullOrWhiteSpace(sDir) Then
+ GetMainPrivateProfileString(S_MRUFILES, K_FILE & 1, "", sDir)
+ End If
+ If Not String.IsNullOrWhiteSpace(sDir) Then
+ sDir = Path.GetDirectoryName(sDir)
+ End If
Map.refSceneHostVM.MainController.OpenProject(sDir)
Else
Map.refSceneHostVM.MainController.OpenProject(sFilePath, False)
diff --git a/3dPrintApp/Project/ProjectV.xaml b/3dPrintApp/Project/ProjectV.xaml
index 723a05c..7efde0a 100644
--- a/3dPrintApp/Project/ProjectV.xaml
+++ b/3dPrintApp/Project/ProjectV.xaml
@@ -59,8 +59,7 @@
+ DataContext="{StaticResource TopPanelVM }"/>
@@ -75,25 +74,36 @@
-
+
+
+ HorizontalAlignment="Center">
+
+
-
-
-
-
-
-
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/3dPrintApp/StartMachPanel/StartMachPanelV.xaml.vb b/3dPrintApp/StartMachPanel/StartMachPanelV.xaml.vb
new file mode 100644
index 0000000..b2a208b
--- /dev/null
+++ b/3dPrintApp/StartMachPanel/StartMachPanelV.xaml.vb
@@ -0,0 +1,3 @@
+Public Class StartMachPanelV
+
+End Class
diff --git a/3dPrintApp/StartMachPanel/StartMachPanelVM.vb b/3dPrintApp/StartMachPanel/StartMachPanelVM.vb
new file mode 100644
index 0000000..5f80228
--- /dev/null
+++ b/3dPrintApp/StartMachPanel/StartMachPanelVM.vb
@@ -0,0 +1,473 @@
+Imports System.Globalization
+Imports EgtUILib
+Imports EgtWPFLib5
+
+Public Class StartMachPanelVM
+ Inherits VMBase
+
+#Region "FIELDS & PROPERTIES"
+
+ Public Enum StartMachTypes As Integer
+ NULL = 0
+ POINT = 1
+ COMPO = 2
+ End Enum
+
+ Private m_nPartId As Integer = GDB_ID.NULL
+ Private m_nStartMachLayerId As Integer = GDB_ID.NULL
+ Private m_nStartMachId As Integer = GDB_ID.NULL
+
+ Private m_TypeList() As Boolean = {True, False}
+ Public ReadOnly Property TypeList As Boolean()
+ Get
+ Return m_TypeList
+ End Get
+ End Property
+
+ Public Property SelType As StartMachTypes
+ Get
+ Dim Index As Integer = m_TypeList.FirstOrDefault(Function(x) x)
+ Select Case Index
+ Case -1
+ Return StartMachTypes.NULL
+ Case 0
+ Return StartMachTypes.POINT
+ Case 1
+ Return StartMachTypes.COMPO
+ End Select
+ End Get
+ Set(value As StartMachTypes)
+ m_TypeList(value - 1) = True
+ End Set
+ End Property
+
+ Public Property sXPos As String
+ Get
+ Dim ptReference As New Point3d
+ EgtStartPoint(m_nStartMachId, GDB_ID.ROOT, ptReference)
+ Return LenToString(ptReference.x, 1)
+ End Get
+ Set(value As String)
+ Dim ptReference As New Point3d
+ EgtStartPoint(m_nStartMachId, GDB_ID.ROOT, ptReference)
+ Dim dNewXPos As Double = ptReference.x
+ StringToLen(value, dNewXPos)
+ If dNewXPos >= 0 AndAlso dNewXPos <= CurrentMachine.b3Tab.DimX Then
+ EgtMove(m_nStartMachId, New Point3d(dNewXPos, ptReference.y, ptReference.z) - ptReference)
+ EgtDraw()
+ Else
+ NotifyPropertyChanged(NameOf(sXPos))
+ End If
+ End Set
+ End Property
+
+ Public Property sYPos As String
+ Get
+ Dim ptReference As New Point3d
+ EgtStartPoint(m_nStartMachId, GDB_ID.ROOT, ptReference)
+ Return LenToString(ptReference.y, 1)
+ End Get
+ Set(value As String)
+ Dim ptReference As New Point3d
+ EgtStartPoint(m_nStartMachId, GDB_ID.ROOT, ptReference)
+ Dim dNewYPos As Double = ptReference.y
+ StringToLen(value, dNewYPos)
+ If dNewYPos >= 0 AndAlso dNewYPos <= CurrentMachine.b3Tab.DimY Then
+ EgtMove(m_nStartMachId, New Point3d(ptReference.x, dNewYPos, ptReference.z) - ptReference)
+ EgtDraw()
+ Else
+ NotifyPropertyChanged(NameOf(sYPos))
+ End If
+ End Set
+ End Property
+
+ Public Property sZPos As String
+ Get
+ Dim ptReference As New Point3d
+ EgtStartPoint(m_nStartMachId, GDB_ID.ROOT, ptReference)
+ Return LenToString(ptReference.z, 1)
+ End Get
+ Set(value As String)
+ Dim ptReference As New Point3d
+ EgtStartPoint(m_nStartMachId, GDB_ID.ROOT, ptReference)
+ Dim dNewZPos As Double = ptReference.z
+ StringToLen(value, dNewZPos)
+ If dNewZPos >= 0 Then
+ EgtMove(m_nStartMachId, New Point3d(ptReference.x, ptReference.y, dNewZPos) - ptReference)
+ EgtDraw()
+ Else
+ NotifyPropertyChanged(NameOf(sZPos))
+ End If
+ End Set
+ End Property
+
+ Private m_RotAxes() As Boolean = {False, False, True}
+ Public Property RotAxes As Boolean()
+ Get
+ Return m_RotAxes
+ End Get
+ Set(value As Boolean())
+ m_RotAxes = value
+ End Set
+ End Property
+
+ Public ReadOnly Property vtSelRotAxes As Vector3d
+ Get
+ If m_RotAxes(0) Then
+ Return Vector3d.X_AX
+ ElseIf m_RotAxes(1) Then
+ Return Vector3d.Y_AX
+ ElseIf m_RotAxes(2) Then
+ Return Vector3d.Z_AX
+ End If
+ End Get
+ End Property
+
+ Private m_sRotAngle As String
+ Public Property sRotAngle As String
+ Get
+ Return m_sRotAngle
+ End Get
+ Set(value As String)
+ Dim dNewAngle As Double = 0
+ If Not StringToLen(value, dNewAngle) Then
+ m_sRotAngle = 0
+ NotifyPropertyChanged(NameOf(sRotAngle))
+ Return
+ 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()
+ m_sRotAngle = 0
+ NotifyPropertyChanged(NameOf(sRotAngle))
+ Else
+ m_sRotAngle = value
+ End If
+ End Set
+ End Property
+
+ Private m_bType_IsChecked As Boolean
+ Public Property bType_IsChecked As Boolean
+ Get
+ Return m_bType_IsChecked
+ End Get
+ Set(value As Boolean)
+ m_bType_IsChecked = value
+ If value Then
+ m_bEdit_IsChecked = False
+ m_bGrid_IsChecked = False
+ m_bMove_IsChecked = False
+ NotifyPropertyChanged(NameOf(bEdit_IsChecked))
+ NotifyPropertyChanged(NameOf(bGrid_IsChecked))
+ NotifyPropertyChanged(NameOf(bMove_IsChecked))
+ End If
+ End Set
+ End Property
+
+ Private m_bEdit_IsChecked As Boolean
+ Public Property bEdit_IsChecked As Boolean
+ Get
+ Return m_bEdit_IsChecked
+ End Get
+ Set(value As Boolean)
+ m_bEdit_IsChecked = value
+ If value Then
+ m_bType_IsChecked = False
+ m_bGrid_IsChecked = False
+ m_bMove_IsChecked = False
+ NotifyPropertyChanged(NameOf(bType_IsChecked))
+ NotifyPropertyChanged(NameOf(bGrid_IsChecked))
+ NotifyPropertyChanged(NameOf(bMove_IsChecked))
+ End If
+ End Set
+ End Property
+
+ Private m_bGrid_IsChecked As Boolean
+ Public Property bGrid_IsChecked As Boolean
+ Get
+ Return m_bGrid_IsChecked
+ End Get
+ Set(value As Boolean)
+ m_bGrid_IsChecked = value
+ If value Then
+ m_bType_IsChecked = False
+ m_bEdit_IsChecked = False
+ m_bMove_IsChecked = False
+ NotifyPropertyChanged(NameOf(bType_IsChecked))
+ NotifyPropertyChanged(NameOf(bEdit_IsChecked))
+ NotifyPropertyChanged(NameOf(bMove_IsChecked))
+ End If
+ End Set
+ End Property
+
+ Private m_bMove_IsChecked As Boolean
+ Public Property bMove_IsChecked As Boolean
+ Get
+ Return m_bMove_IsChecked
+ End Get
+ Set(value As Boolean)
+ m_bMove_IsChecked = value
+ If value Then
+ m_bType_IsChecked = False
+ m_bEdit_IsChecked = False
+ m_bGrid_IsChecked = False
+ NotifyPropertyChanged(NameOf(bType_IsChecked))
+ NotifyPropertyChanged(NameOf(bEdit_IsChecked))
+ NotifyPropertyChanged(NameOf(bGrid_IsChecked))
+ End If
+ End Set
+ End Property
+
+ ' Definizione comandi
+ Private m_cmdCPlaneTop As ICommand
+ Private m_cmdCPlaneFront As ICommand
+ Private m_cmdCPlaneRight As ICommand
+ Private m_cmdCPlaneBack As ICommand
+ Private m_cmdCPlaneLeft As ICommand
+ Private m_cmdCPlaneBottom As ICommand
+ Private m_cmdCPlaneView As ICommand
+ Private m_cmdCPlaneElevation As ICommand
+ Private m_cmdCPlaneOrigin As ICommand
+ Private m_cmdCPlaneRotate As ICommand
+ Private m_cmdCPlane3P As ICommand
+ Private m_cmdCPlanePerpObj As ICommand
+ Private m_cmdCPlaneObj As ICommand
+
+#End Region ' FIELDS & PROPERTIES
+
+#Region "CONSTRUCTORS"
+
+ Sub New()
+ ' Creo riferimento a questa classe in EgtCAM5Map
+ Map.SetRefStartMachPanelVM(Me)
+ End Sub
+
+#End Region ' CONSTRUCTORS
+
+#Region "METHODS"
+
+ Friend Sub Init()
+ ' recupero dati pezzo selezionato layer ed entita'
+ m_nPartId = Map.refTopPanelVM.SelPart.nPartId
+ m_nStartMachLayerId = Map.refTopPanelVM.SelPart.nMachStartLayerId
+ m_nStartMachId = Map.refTopPanelVM.SelPart.nMachStartId
+ ' verifico se punto o curva
+ Dim StartMachType As GDB_TY = EgtGetType(m_nStartMachId)
+ Select Case StartMachType
+ Case GDB_TY.GEO_POINT
+ SelType = StartMachTypes.POINT
+ Case GDB_TY.CRV_LINE, GDB_TY.CRV_ARC, GDB_TY.CRV_COMPO
+ SelType = StartMachTypes.COMPO
+ End Select
+ NotifyPropertyChanged(NameOf(TypeList))
+ ' aggiorno campi di testo posizione
+ NotifyPropertyChanged(NameOf(sXPos))
+ NotifyPropertyChanged(NameOf(sYPos))
+ NotifyPropertyChanged(NameOf(sZPos))
+ End Sub
+
+ Friend Sub RefreshPos()
+ NotifyPropertyChanged(NameOf(sXPos))
+ NotifyPropertyChanged(NameOf(sYPos))
+ NotifyPropertyChanged(NameOf(sZPos))
+ End Sub
+
+#End Region ' METHODS
+
+#Region "COMMANDS"
+
+#Region "CPlaneTop"
+
+ '''
+ ''' Returns a command that do CPlaneTop.
+ '''
+ Public ReadOnly Property CPlaneTop_Command As ICommand
+ Get
+ If m_cmdCPlaneTop Is Nothing Then
+ m_cmdCPlaneTop = New Command(AddressOf CPlaneTop)
+ End If
+ Return m_cmdCPlaneTop
+ End Get
+ End Property
+
+ '''
+ ''' Execute the CPlaneTop. This method is invoked by the CPlaneTopCommand.
+ '''
+ Public Sub CPlaneTop(ByVal param As Object)
+ Map.refSceneHostVM.MainController.SetLastInteger(Controller.GRID_TYPE.TOP)
+ Map.refSceneHostVM.MainController.ExecuteCommand(Controller.CMD.GRID)
+ End Sub
+
+#End Region ' CPlaneTop
+
+#Region "CPlaneFront"
+
+ '''
+ ''' Returns a command that do CPlaneFront.
+ '''
+ Public ReadOnly Property CPlaneFront_Command As ICommand
+ Get
+ If m_cmdCPlaneFront Is Nothing Then
+ m_cmdCPlaneFront = New Command(AddressOf CPlaneFront)
+ End If
+ Return m_cmdCPlaneFront
+ End Get
+ End Property
+
+ '''
+ ''' Execute the CPlaneFront. This method is invoked by the CPlaneFrontCommand.
+ '''
+ Public Sub CPlaneFront(ByVal param As Object)
+ Map.refSceneHostVM.MainController.SetLastInteger(Controller.GRID_TYPE.FRONT)
+ Map.refSceneHostVM.MainController.ExecuteCommand(Controller.CMD.GRID)
+ End Sub
+
+#End Region ' CPlaneFront
+
+#Region "CPlaneRight"
+
+ '''
+ ''' Returns a command that do CPlaneRight.
+ '''
+ Public ReadOnly Property CPlaneRight_Command As ICommand
+ Get
+ If m_cmdCPlaneRight Is Nothing Then
+ m_cmdCPlaneRight = New Command(AddressOf CPlaneRight)
+ End If
+ Return m_cmdCPlaneRight
+ End Get
+ End Property
+
+ '''
+ ''' Execute the CPlaneRight. This method is invoked by the CPlaneRightCommand.
+ '''
+ Public Sub CPlaneRight(ByVal param As Object)
+ Map.refSceneHostVM.MainController.SetLastInteger(Controller.GRID_TYPE.RIGHT)
+ Map.refSceneHostVM.MainController.ExecuteCommand(Controller.CMD.GRID)
+ End Sub
+
+#End Region ' CPlaneRight
+
+#Region "CPlaneBack"
+
+ '''
+ ''' Returns a command that do CPlaneBack.
+ '''
+ Public ReadOnly Property CPlaneBack_Command As ICommand
+ Get
+ If m_cmdCPlaneBack Is Nothing Then
+ m_cmdCPlaneBack = New Command(AddressOf CPlaneBack)
+ End If
+ Return m_cmdCPlaneBack
+ End Get
+ End Property
+
+ '''
+ ''' Execute the CPlaneBack. This method is invoked by the CPlaneBackCommand.
+ '''
+ Public Sub CPlaneBack(ByVal param As Object)
+ Map.refSceneHostVM.MainController.SetLastInteger(Controller.GRID_TYPE.BACK)
+ Map.refSceneHostVM.MainController.ExecuteCommand(Controller.CMD.GRID)
+ End Sub
+
+#End Region ' CPlaneBack
+
+#Region "CPlaneLeft"
+
+ '''
+ ''' Returns a command that do CPlaneLeft.
+ '''
+ Public ReadOnly Property CPlaneLeft_Command As ICommand
+ Get
+ If m_cmdCPlaneLeft Is Nothing Then
+ m_cmdCPlaneLeft = New Command(AddressOf CPlaneLeft)
+ End If
+ Return m_cmdCPlaneLeft
+ End Get
+ End Property
+
+ '''
+ ''' Execute the CPlaneLeft. This method is invoked by the CPlaneLeftCommand.
+ '''
+ Public Sub CPlaneLeft(ByVal param As Object)
+ Map.refSceneHostVM.MainController.SetLastInteger(Controller.GRID_TYPE.LEFT)
+ Map.refSceneHostVM.MainController.ExecuteCommand(Controller.CMD.GRID)
+ End Sub
+
+#End Region ' CPlaneLeft
+
+#Region "CPlaneBottom"
+
+ '''
+ ''' Returns a command that do CPlaneBottom.
+ '''
+ Public ReadOnly Property CPlaneBottom_Command As ICommand
+ Get
+ If m_cmdCPlaneBottom Is Nothing Then
+ m_cmdCPlaneBottom = New Command(AddressOf CPlaneBottom)
+ End If
+ Return m_cmdCPlaneBottom
+ End Get
+ End Property
+
+ '''
+ ''' Execute the CPlaneBottom. This method is invoked by the CPlaneBottomCommand.
+ '''
+ Public Sub CPlaneBottom(ByVal param As Object)
+ Map.refSceneHostVM.MainController.SetLastInteger(Controller.GRID_TYPE.BOTTOM)
+ Map.refSceneHostVM.MainController.ExecuteCommand(Controller.CMD.GRID)
+ End Sub
+
+#End Region ' CPlaneBottom
+
+#Region "CPlaneElevation"
+
+ '''
+ ''' Returns a command that do CPlaneElevation.
+ '''
+ Public ReadOnly Property CPlaneElevation_Command As ICommand
+ Get
+ If m_cmdCPlaneElevation Is Nothing Then
+ m_cmdCPlaneElevation = New Command(AddressOf CPlaneElevation)
+ End If
+ Return m_cmdCPlaneElevation
+ End Get
+ End Property
+
+ '''
+ ''' Execute the CPlaneElevation. This method is invoked by the CPlaneElevationCommand.
+ '''
+ Public Sub CPlaneElevation(ByVal param As Object)
+ Map.refSceneHostVM.MainController.ExecuteCommand(Controller.CMD.GRID_ELEVATION)
+ End Sub
+
+#End Region ' CPlaneElevation
+
+#Region "CPlaneOrigin"
+
+ '''
+ ''' Returns a command that do CPlaneOrigin.
+ '''
+ Public ReadOnly Property CPlaneOrigin_Command As ICommand
+ Get
+ If m_cmdCPlaneOrigin Is Nothing Then
+ m_cmdCPlaneOrigin = New Command(AddressOf CPlaneOrigin)
+ End If
+ Return m_cmdCPlaneOrigin
+ End Get
+ End Property
+
+ '''
+ ''' Execute the CPlaneOrigin. This method is invoked by the CPlaneOriginCommand.
+ '''
+ Public Sub CPlaneOrigin(ByVal param As Object)
+ Map.refSceneHostVM.MainController.ExecuteCommand(Controller.CMD.GRID_ORIGIN)
+ End Sub
+
+#End Region ' CPlaneOrigin
+
+#End Region ' COMMANDS
+
+End Class
\ No newline at end of file
diff --git a/3dPrintApp/TSFEditor/TFSEditorV.xaml b/3dPrintApp/TSFEditor/TFSEditorV.xaml
new file mode 100644
index 0000000..e78c9f5
--- /dev/null
+++ b/3dPrintApp/TSFEditor/TFSEditorV.xaml
@@ -0,0 +1,67 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/3dPrintApp/TSFEditor/TFSEditorV.xaml.vb b/3dPrintApp/TSFEditor/TFSEditorV.xaml.vb
new file mode 100644
index 0000000..b5c1f3c
--- /dev/null
+++ b/3dPrintApp/TSFEditor/TFSEditorV.xaml.vb
@@ -0,0 +1,3 @@
+Public Class TFSEditorV
+
+End Class
diff --git a/3dPrintApp/TSFEditor/TFSEditorVM.vb b/3dPrintApp/TSFEditor/TFSEditorVM.vb
new file mode 100644
index 0000000..c4dd797
--- /dev/null
+++ b/3dPrintApp/TSFEditor/TFSEditorVM.vb
@@ -0,0 +1,174 @@
+Imports System.Collections.ObjectModel
+Imports EgtUILib
+Imports EgtWPFLib5
+
+Public Class TFSEditorVM
+ Inherits VMBase
+
+#Region "FIELDS & PROPERTIES"
+
+ Private m_LayerList As New ObservableCollection(Of TFSLayer)
+ Public ReadOnly Property LayerList As ObservableCollection(Of TFSLayer)
+ Get
+ Return m_LayerList
+ End Get
+ End Property
+
+ Private m_SelLayer As TFSLayer
+ Public Property SelLayer As TFSLayer
+ Get
+ Return m_SelLayer
+ End Get
+ Set(value As TFSLayer)
+ m_SelLayer = value
+ End Set
+ End Property
+
+#End Region ' FIELDS & PROPERTIES
+
+#Region "CONSTRUCTORS"
+
+ Sub New()
+ ' Creo riferimento a questa classe in EgtCAM5Map
+ Map.SetRefTFSEditorVM(Me)
+ End Sub
+
+#End Region ' CONSTRUCTORS
+
+#Region "METHODS"
+
+ Friend Sub Refresh()
+ m_LayerList.Clear()
+ Dim nLayTFSCalcId As Integer = EgtGetFirstNameInGroup(GDB_ID.ROOT, LAY_TFSCALC)
+ Dim nTFSLayerId As Integer = EgtGetFirstInGroup(nLayTFSCalcId)
+ While nTFSLayerId <> GDB_ID.NULL
+ m_LayerList.Add(New TFSLayer(nTFSLayerId))
+ nTFSLayerId = EgtGetNext(nTFSLayerId)
+ End While
+ End Sub
+
+#End Region ' METHODS
+
+End Class
+
+Public Class TFSLayer
+
+ Private m_nId As Integer
+ Public ReadOnly Property nId As Integer
+ Get
+ Return m_nId
+ End Get
+ End Property
+
+ Private m_nIndex As Integer
+ Public ReadOnly Property nIndex As Integer
+ Get
+ Return m_nIndex
+ End Get
+ End Property
+
+ Private m_dLength As Double
+ Public ReadOnly Property dLength As Double
+ Get
+ Return LenToString(m_dLength, 2)
+ End Get
+ End Property
+
+ Private m_dTMin As Double
+ Public ReadOnly Property dTMin As Double
+ Get
+ Return m_dTMin
+ End Get
+ End Property
+
+ Private m_dTTrg As Double
+ Public ReadOnly Property dTTrg As Double
+ Get
+ Return m_dTTrg
+ End Get
+ End Property
+
+ Private m_dTMax As Double
+ Public ReadOnly Property dTMax As Double
+ Get
+ Return m_dTMax
+ End Get
+ End Property
+
+ Private m_dTCurr As Double
+ Public ReadOnly Property dTCurr As Double
+ Get
+ Return m_dTCurr
+ End Get
+ End Property
+
+ Private m_dFMin As Double
+ Public ReadOnly Property dFMin As Double
+ Get
+ Return m_dFMin
+ End Get
+ End Property
+
+ Private m_dFTrg As Double
+ Public ReadOnly Property dFTrg As Double
+ Get
+ Return m_dFTrg
+ End Get
+ End Property
+
+ Private m_dFMax As Double
+ Public ReadOnly Property dFMax As Double
+ Get
+ Return m_dFMax
+ End Get
+ End Property
+
+ Private m_dFCurr As Double
+ Public Property dFCurr As Double
+ Get
+ Return m_dFCurr
+ End Get
+ Set(value As Double)
+ m_dFCurr = value
+ End Set
+ End Property
+
+ Private m_dSpeed As Double
+ Public ReadOnly Property dSpeed As Double
+ Get
+ Return m_dSpeed
+ End Get
+ End Property
+
+ Sub New(nId As Integer)
+ Dim sIndex As String = ""
+ EgtGetName(nId, sIndex)
+ Integer.TryParse(sIndex, m_nIndex)
+ EgtGetInfo(nId, KEY_LENGTH, m_dLength)
+ EgtGetInfo(nId, KEY_TMIN, m_dTMin)
+ EgtGetInfo(nId, KEY_TTRG, m_dTTrg)
+ EgtGetInfo(nId, KEY_TMAX, m_dTMax)
+ EgtGetInfo(nId, KEY_TCUR, m_dTCurr)
+ EgtGetInfo(nId, KEY_FMIN, m_dFMin)
+ EgtGetInfo(nId, KEY_FTRG, m_dFTrg)
+ EgtGetInfo(nId, KEY_FMAX, m_dFMax)
+ EgtGetInfo(nId, KEY_FCUR, m_dFCurr)
+ EgtGetInfo(nId, KEY_SPEED, m_dSpeed)
+
+ End Sub
+
+ Sub New(nId As Integer, nIndex As Integer, dLength As Double, dTMin As Double, dTTrg As Double, dTMax As Double, dTCurr As Double, dFMin As Double, dFTrg As Double, dFMax As Double, dFCurr As Double, dSpeed As Double)
+ m_nId = nId
+ m_nIndex = nIndex
+ m_dLength = dLength
+ m_dTMin = dTMin
+ m_dTTrg = dTTrg
+ m_dTMax = dTMax
+ m_dTCurr = dTCurr
+ m_dFMin = dFMin
+ m_dFTrg = dFTrg
+ m_dFMax = dFMax
+ m_dFCurr = dFCurr
+ m_dSpeed = dSpeed
+ End Sub
+End Class
\ No newline at end of file
diff --git a/3dPrintApp/TopPanel/TopPanelV.xaml b/3dPrintApp/TopPanel/TopPanelV.xaml
index 0234b92..7f01c65 100644
--- a/3dPrintApp/TopPanel/TopPanelV.xaml
+++ b/3dPrintApp/TopPanel/TopPanelV.xaml
@@ -1,19 +1,23 @@
+ xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+ Height="50">
-
-
-
-
+
+
+
+
-
-
+
+
-
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/3dPrintApp/TopPanel/TopPanelVM.vb b/3dPrintApp/TopPanel/TopPanelVM.vb
index 43953a1..719e0f1 100644
--- a/3dPrintApp/TopPanel/TopPanelVM.vb
+++ b/3dPrintApp/TopPanel/TopPanelVM.vb
@@ -1,6 +1,580 @@
-Imports EgtWPFLib5
+Imports System.Collections.ObjectModel
+Imports System.IO
+Imports EgtUILib
+Imports EgtWPFLib5
Public Class TopPanelVM
Inherits VMBase
+#Region "FIELDS & PROPERTIES"
+
+#Region "Pages & Modes"
+
+ Private m_SelPage As Integer = -1
+ Public Property SelPage As Integer
+ Get
+ Return m_SelPage
+ End Get
+ Set(value As Integer)
+ ' lancio selezione pagina con verifica file modificato
+ SetSelPage(value)
+ End Set
+ End Property
+ ' funzione che permette di cambiare pagina
+ ' bVerifyModification: se vero verifica modifiche su file e chiede di salvare
+ Friend Sub SetSelPage(Page As Pages, Optional bVerifyModification As Boolean = True)
+ Dim bOk As Boolean = True
+ ' Esco dallo stato corrente
+ Select Case m_SelPage
+ Case Pages.IMPORT
+ bOk = ExitIMPORT()
+ Case Pages.MODIFY
+ bOk = ExitMODIFY()
+ Case Pages.SLICE
+ bOk = ExitSLICE()
+ Case Pages.SIMULATION
+ bOk = ExitSIMULATION()
+ Case Pages.MATERIALDB
+ bOk = ExitMATERIALDB()
+ Case Pages.MACHININGDB
+ bOk = ExitMACHININGDB()
+ Case Pages.CURRMACHINING
+ bOk = ExitCURRMACHINING()
+ End Select
+ If bOk Then
+ ' Entro nel nuovo stato
+ m_SelPage = Page
+ Select Case m_SelPage
+ Case Pages.IMPORT
+ InitIMPORT()
+ Case Pages.MODIFY
+ InitMODIFY()
+ Case Pages.SLICE
+ InitSLICE()
+ Case Pages.SIMULATION
+ InitSIMULATION()
+ Case Pages.MATERIALDB
+ InitMATERIALDB()
+ Case Pages.MACHININGDB
+ InitMACHININGDB()
+ Case Pages.CURRMACHINING
+ InitCURRMACHINING()
+ Case Else
+ InitNULL()
+ End Select
+ End If
+ End Sub
+
+ Private m_ModifyModeList As New List(Of ModifyModeButton)({New ModifyModeButton("Disposition", ModifyModes.DISPOSITION),
+ New ModifyModeButton("Reference", ModifyModes.REFERENCE),
+ New ModifyModeButton("StartMachining", ModifyModes.STARTMACH),
+ New ModifyModeButton("Ribs", ModifyModes.RIBS),
+ New ModifyModeButton("Shell Number", ModifyModes.SHELLNUMBER),
+ New ModifyModeButton("Aux Solids", ModifyModes.AUXSOLIDS)})
+ Public ReadOnly Property ModifyModeList As List(Of ModifyModeButton)
+ Get
+ Return m_ModifyModeList
+ End Get
+ End Property
+
+ Private m_SelModifyMode As ModifyModeButton
+ Public Property SelModifyMode As ModifyModeButton
+ Get
+ Return m_SelModifyMode
+ End Get
+ Set(value As ModifyModeButton)
+ m_SelModifyMode = value
+ Dim SelLeftPanel As LeftPanelVM.Panels = LeftPanelVM.Panels.NULL
+ Select Case value.ModifyMode
+ Case ModifyModes.DISPOSITION
+ SelLeftPanel = LeftPanelVM.Panels.DISPOSITION
+ Case ModifyModes.REFERENCE
+ SelLeftPanel = LeftPanelVM.Panels.REFERENCE
+ Case ModifyModes.STARTMACH
+ SelLeftPanel = LeftPanelVM.Panels.STARTMACH
+ Case ModifyModes.RIBS
+ SelLeftPanel = LeftPanelVM.Panels.RIBS
+ Case ModifyModes.SHELLNUMBER
+ SelLeftPanel = LeftPanelVM.Panels.SHELLNUMBER
+ Case ModifyModes.AUXSOLIDS
+ SelLeftPanel = LeftPanelVM.Panels.AUXSOLIDS
+ Case Else
+ SelLeftPanel = LeftPanelVM.Panels.NULL
+ End Select
+ Map.refLeftPanelVM.SetSelPanel(SelLeftPanel)
+ End Set
+ End Property
+ Friend Sub SetSelModifyMode(ModifyMode As ModifyModes)
+ SelModifyMode = m_ModifyModeList.FirstOrDefault(Function(x) x.ModifyMode = ModifyMode)
+ NotifyPropertyChanged(NameOf(SelModifyMode))
+ End Sub
+
+#End Region ' Pages
+
+#Region "Parts Manager"
+
+ Private m_PartList As New ObservableCollection(Of Print3dPartVM)
+ Public ReadOnly Property PartList As ObservableCollection(Of Print3dPartVM)
+ Get
+ Return m_PartList
+ End Get
+ End Property
+
+ Private m_SelPart As Print3dPartVM
+ Public Property SelPart As Print3dPartVM
+ Get
+ Return m_SelPart
+ End Get
+ Set(value As Print3dPartVM)
+ m_SelPart = value
+ If Not IsNothing(value) Then
+ ' Eseguo la selezione
+ EgtDeselectAll()
+ EgtSelectPartObjs(m_SelPart.nPartId)
+ EgtDraw()
+ ' imposto lavorazione del pezzo selezionato
+ Map.refCurrMachiningPanelVM.ReadMachParamFromSelPart()
+ SetSelMachining(MachiningList.FirstOrDefault(Function(x) x.sGUID = Map.refCurrMachiningPanelVM.CurrMachining.OrigMachining.sGUID))
+ ' notifico posizione pezzo
+ Map.refDispositionPanelVM.RefreshPos()
+ End If
+ End Set
+ End Property
+
+#End Region ' Parts Manager
+
+#Region "Material"
+
+ Private m_MaterialList As New List(Of MaterialIndex)
+ Public ReadOnly Property MaterialList As List(Of MaterialIndex)
+ Get
+ Return m_MaterialList
+ End Get
+ End Property
+
+ Private m_SelMaterial As MaterialIndex
+ Public Property SelMaterial As MaterialIndex
+ Get
+ Return m_SelMaterial
+ End Get
+ Set(value As MaterialIndex)
+ m_SelMaterial = value
+ WriteMainPrivateProfileString(S_PRINTING3D, K_CURRMATERIAL, value.sName)
+ ' ricarico lista lavorazioni valide per il materiale selezionato
+ InitMachiningsList()
+ End Set
+ End Property
+
+#End Region ' Material
+
+#Region "Machining"
+
+ Private m_MachiningList As New ObservableCollection(Of MachiningIndex)
+ Public ReadOnly Property MachiningList As ObservableCollection(Of MachiningIndex)
+ Get
+ Return m_MachiningList
+ End Get
+ End Property
+
+ Private m_SelMachining As MachiningIndex
+ Public Property SelMachining As MachiningIndex
+ Get
+ Return m_SelMachining
+ End Get
+ Set(value As MachiningIndex)
+ ' verifico se vecchia modificata e chiedo se salvare??
+
+ If Not IsNothing(m_SelMachining) Then WriteMainPrivateProfileString(S_PRINTING3D, K_CURRMACHINING, value.sName)
+ ' imposto selezionata come corrente
+ If Not IsNothing(m_SelPart) AndAlso value.sGUID <> m_SelMachining.sGUID Then
+ Map.refCurrMachiningPanelVM.SetCurrMachining(New CurrMachining(value))
+ 'm_CurrMachining.UpdateMachParam()
+ End If
+ m_SelMachining = value
+ '' riporto parametri nel pezzo selezionato
+ 'WriteMachParamOnSelPart()
+ ' aggiorno parametri mostrati nella barra
+ If Not IsNothing(CurrMachining) Then CurrMachining.UpdateMachParam()
+ End Set
+ End Property
+ Friend Sub SetSelMachining(SelMachining As MachiningIndex)
+ m_SelMachining = SelMachining
+ NotifyPropertyChanged(NameOf(SelMachining))
+ End Sub
+
+ 'Private m_CurrMachining As CurrMachining
+ Public ReadOnly Property CurrMachining As CurrMachining
+ Get
+ Return Map.refCurrMachiningPanelVM.CurrMachining
+ End Get
+ End Property
+ Friend Sub UpdateCurrMachining()
+ NotifyPropertyChanged(NameOf(CurrMachining))
+ End Sub
+ 'Private Sub SetCurrMachining(CurrMachining As CurrMachining)
+ ' m_CurrMachining = CurrMachining
+ ' Map.refCurrMachiningPanelVM.SetCurrMachining(CurrMachining)
+ 'End Sub
+
+#End Region ' Machining
+
+ ' Definizione comandi
+ Private m_cmdMachining As ICommand
+ Private m_cmdMaterialDb As ICommand
+ Private m_cmdPrintParamDb As ICommand
+
+#End Region ' FIELDS & PROPERTIES
+
+#Region "CONSTRUCTORS"
+
+ Sub New()
+ ' Creo riferimento a questa classe in Map
+ Map.SetRefTopPanelVM(Me)
+ ' carico lista materiali
+ InitMaterialList()
+ ' carico lista parametri di stampa
+ InitMachiningsList()
+ End Sub
+
+#End Region ' CONSTRUCTORS
+
+#Region "METHODS"
+
+#Region "Materials"
+
+ Friend Sub InitMaterialList()
+ Dim nIndex As Integer = 1
+ Dim sGUID As String = ""
+ Dim sName As String = ""
+ While GetPrivateProfileString(nIndex, MAT_GUID, "", sGUID, Map.refMainWindowVM.MainWindowM.sMaterialsDir & "/Materials.ini") > 0
+ ' leggo nome
+ GetPrivateProfileString(nIndex, MAT_NAME, "", sName, Map.refMainWindowVM.MainWindowM.sMaterialsDir & "/Materials.ini")
+ MaterialList.Add(New MaterialIndex(nIndex, sGUID, sName))
+ nIndex += 1
+ End While
+ Dim sCurrMaterial As String = ""
+ GetMainPrivateProfileString(S_PRINTING3D, K_CURRMATERIAL, "", sCurrMaterial)
+ m_SelMaterial = m_MaterialList.FirstOrDefault(Function(x) x.sName = sCurrMaterial)
+ End Sub
+
+ Friend Function GetSelMaterialData() As Material
+ Return New Material(m_SelMaterial.nIndex, m_SelMaterial.sGUID, m_SelMaterial.sName)
+ End Function
+
+#End Region ' Materials
+
+#Region "Machining"
+
+ Friend Sub InitMachiningsList()
+ MachiningList.Clear()
+ Dim nIndex As Integer = 1
+ Dim sGUID As String = ""
+ Dim sName As String = ""
+ Dim sMaterials As String = ""
+ While GetPrivateProfileString(nIndex, MAC_GUID, "", sGUID, Map.refMainWindowVM.MainWindowM.sMachiningsDir & "/Machinings.ini") > 0
+ GetPrivateProfileString(nIndex, MAC_NAME, "", sName, Map.refMainWindowVM.MainWindowM.sMachiningsDir & "/Machinings.ini")
+ ' leggo materiali che usa
+ GetPrivateProfileString(nIndex, MAC_MATERIALS, "", sMaterials, Map.refMainWindowVM.MainWindowM.sMachiningsDir & "/Machinings.ini")
+ Dim MacMaterials() As String = sMaterials.Split(";"c)
+ If MacMaterials.Contains(SelMaterial.sGUID) Then
+ MachiningList.Add(New MachiningIndex(nIndex, sGUID, sName))
+ End If
+ nIndex += 1
+ End While
+ Dim sCurrMachining As String = ""
+ GetMainPrivateProfileString(S_PRINTING3D, K_CURRMACHINING, "", sCurrMachining)
+ m_SelMachining = MachiningList.FirstOrDefault(Function(x) x.sName = sCurrMachining)
+ End Sub
+
+ Friend Function GetSelMachining() As Machining
+ If IsNothing(m_SelMachining) Then Return Nothing
+ Return New Machining(m_SelMachining.nIndex, m_SelMachining.sGUID, m_SelMachining.sName)
+ End Function
+
+
+ 'Friend Sub WriteMachParamOnSelPart()
+ ' If IsNothing(m_SelPart) OrElse IsNothing(m_CurrMachining) Then Return
+ ' m_CurrMachining.WriteMachParamOnPart(m_SelPart.nPartId)
+ 'End Sub
+
+#End Region ' Machining
+
+#Region "Pages"
+
+ Private Sub InitIMPORT()
+ Map.refLeftPanelVM.SetSelPanel(LeftPanelVM.Panels.IMPORT)
+ Map.refImportPanelVM.Init()
+ End Sub
+
+ Private Function ExitIMPORT()
+ Return True
+ End Function
+
+ Private Sub InitMODIFY()
+ SetSelModifyMode(ModifyModes.DISPOSITION)
+ Map.refRightPanelVM.SetSelPanel(RightPanelVM.Panels.NULL)
+ End Sub
+
+ Private Function ExitMODIFY()
+ Map.refLeftPanelVM.SetSelPanel(LeftPanelVM.Panels.NULL)
+ Return True
+ End Function
+
+ Private Sub InitSLICE()
+ Map.refSliceManagerVM.UpdateState(True)
+ Map.refRightPanelVM.SetSelPanel(RightPanelVM.Panels.TFSEDITOR)
+ End Sub
+
+ Private Function ExitSLICE()
+ Map.refSliceManagerVM.UpdateState(False)
+ Map.refRightPanelVM.SetSelPanel(RightPanelVM.Panels.NULL)
+ Return True
+ End Function
+
+ Private Sub InitSIMULATION()
+
+ End Sub
+
+ Private Function ExitSIMULATION()
+
+ Return True
+ End Function
+
+ Private Sub InitMATERIALDB()
+
+ End Sub
+
+ Private Function ExitMATERIALDB()
+
+ Return True
+ End Function
+
+ Private Sub InitMACHININGDB()
+ End Sub
+
+ Private Function ExitMACHININGDB()
+
+ Return True
+ End Function
+
+ Private Sub InitCURRMACHINING()
+ Map.refRightPanelVM.SetSelPanel(RightPanelVM.Panels.PRINTPARAMDB)
+ End Sub
+
+ Private Function ExitCURRMACHINING()
+
+ Return True
+ End Function
+
+ Private Sub InitNULL()
+ Map.refLeftPanelVM.SetSelPanel(LeftPanelVM.Panels.NULL)
+ End Sub
+
+#End Region ' Pages
+
+#Region "Parts Manager"
+
+ Friend Sub AddNewPart(sFile As String)
+ ' rinomino pezzo e layer
+ Dim nPartId As Integer = EgtGetLastPart()
+ EgtSetName(nPartId, PART)
+ Dim nLayerId As Integer = EgtGetFirstInGroup(nPartId)
+ EgtSetName(nLayerId, ORIGINAL_SOLID)
+
+ '' Recupero o creo layer ausiliario
+ 'Dim nAuxId As Integer = EgtGetFirstNameInGroup(nPartId, LAY_AUX)
+ 'If Not nAuxId Then
+ ' nAuxId = EgtCreateGroup(nPartId)
+ ' EgtSetName(nAuxId, LAY_AUX)
+ 'End If
+
+ ' Richiedo posizione origine e offset pezzo
+ Dim b3Part As New BBox3d
+ EgtGetBBoxGlob(nPartId, GDB_BB.EXACT, b3Part)
+ Dim nRefX As Integer = 1
+ Dim nRefY As Integer = 1
+ Dim dPosX As Double = CurrentMachine.b3Tab.DimX / 2 - b3Part.DimX / 2
+ Dim dPosY As Double = CurrentMachine.b3Tab.DimY / 2 - b3Part.DimY / 2
+ ' Dim Positions = EgtDialogBox( 'Part position on table:', { 'Reference', 'CB:Left,Center,Right'},
+ ' { '', 'CB:Bottom,Middle,Top'},
+ ' { 'X', EgtNumToString( EgtToUiUnits( dPosX), 1)},
+ ' { 'Y', EgtNumToString( EgtToUiUnits( dPosY), 1)})
+
+ Dim ChooseReferenceWndVM As New ChooseReferenceWndVM
+ Dim ChooseReferenceWndV As New ChooseReferenceWndV(Application.Current.MainWindow, ChooseReferenceWndVM)
+ If Not ChooseReferenceWndV.ShowDialog() Then Return
+
+ Dim gg = ChooseReferenceWndVM.SelReference
+ '' Aggiungo il box del solido
+ 'Dim nBoxId As Integer = EgtSurftmb(nAuxId, b3Solid, False, GDB_RT.GLOB)
+
+ '' posiziono il pezzo al centro
+ 'Dim b3Part As New BBox3d
+ 'EgtGetBBoxGlob(nPartId, GDB_BB.EXACT, b3Part)
+ 'Dim dPosX As Double = (CurrentMachine.b3Tab.DimX() / 2) - (b3Part.DimX() / 2)
+ 'Dim dPosY As Double = (CurrentMachine.b3Tab.DimY() / 2) - (b3Part.DimY() / 2)
+
+ ' Posiziono il pezzo e aggiorno il suo box
+ Dim vtMove As Vector3d = New Point3d(dPosX, dPosY, 0) - b3Part.Min()
+ EgtMove(nPartId, vtMove)
+ b3Part.Move(vtMove)
+
+ ' Creo il frame del pezzo
+ Dim frPart = New Frame3d(b3Part.Center() - 0.5 * b3Part.DimZ() * Vector3d.Z_AX(), Frame3d.TYPE.TOP)
+ Dim nFrameId = EgtCreateGeoFrame(nPartId, frPart, GDB_RT.GLOB)
+ If nFrameId <> GDB_ID.NULL Then
+ EgtSetName(nFrameId, "FramePart")
+ EgtSetMode(nFrameId, GDB_MD.LOCKED)
+ End If
+
+ EgtAddMachGroup("3dPrint")
+ EgtSetTable("Tab")
+
+ Dim nRawId As Integer = EgtAddRawPart(b3Part.Min, b3Part.DimX, b3Part.DimY, b3Part.DimZ, New Color3d(128, 128, 128, 30))
+ EgtAddPartToRawPart(nPartId, b3Part.Min, nRawId)
+ EgtMoveToCornerRawPart(nRawId, New Point3d(dPosX, dPosY, 0), MCH_CR.BL)
+
+ EgtResetCurrMachGroup()
+
+ ' creo lo start point
+ Dim ptStart As Point3d = b3Part.Center() - 0.6 * b3Part.DimY() * Vector3d.Y_AX() - 0.5 * b3Part.DimZ() * Vector3d.Z_AX()
+ Dim nPtStartId As Integer = EgtCreateGeoPoint(nPartId, ptStart, GDB_RT.GLOB)
+ If nPtStartId <> GDB_ID.NULL Then
+ EgtSetName(nPtStartId, "StartPoint")
+ EgtSetColor(nPtStartId, New Color3d(255, 0, 0))
+ End If
+
+ ' aggiungo a lista pezzi e seleziono
+ Dim NewPart As New Print3dPartVM(nPartId, sFile)
+ PartList.Add(NewPart)
+ SelPart = NewPart
+ NotifyPropertyChanged(NameOf(SelPart))
+
+ End Sub
+
+ Friend Sub SelPartFromId(nPartId As Integer)
+ Dim PartToSel As Print3dPartVM = m_PartList.First(Function(x) x.nPartId = nPartId)
+ If Not IsNothing(PartToSel) Then
+ SelPart = PartToSel
+ NotifyPropertyChanged(NameOf(SelPart))
+ End If
+ End Sub
+
+ Friend Sub SelLastPart()
+ If PartList.Count > 0 Then
+ SelPart = PartList.LastOrDefault()
+ NotifyPropertyChanged(NameOf(SelPart))
+ End If
+ End Sub
+
+ Friend Sub SelFirstPart()
+ If PartList.Count > 0 Then
+ SelPart = PartList.FirstOrDefault()
+ NotifyPropertyChanged(NameOf(SelPart))
+ End If
+ End Sub
+
+#End Region ' Parts Manager
+
+#End Region ' METHODS
+
+#Region "COMMANDS"
+
+#Region "Machining"
+
+ '''
+ ''' Returns a command that do CPlaneTop.
+ '''
+ Public ReadOnly Property Machining_Command As ICommand
+ Get
+ If m_cmdMachining Is Nothing Then
+ m_cmdMachining = New Command(AddressOf Machining)
+ End If
+ Return m_cmdMachining
+ End Get
+ End Property
+
+ '''
+ ''' Execute the CPlaneTop. This method is invoked by the CPlaneTopCommand.
+ '''
+ Public Sub Machining()
+ SelPage = Pages.CURRMACHINING
+ End Sub
+
+#End Region ' Machining
+
+#Region "PrintParamDb"
+
+ '''
+ ''' Returns a command that do CPlaneTop.
+ '''
+ Public ReadOnly Property PrintParamDb_Command As ICommand
+ Get
+ If m_cmdPrintParamDb Is Nothing Then
+ m_cmdPrintParamDb = New Command(AddressOf PrintParamDb)
+ End If
+ Return m_cmdPrintParamDb
+ End Get
+ End Property
+
+ '''
+ ''' Execute the CPlaneTop. This method is invoked by the CPlaneTopCommand.
+ '''
+ Public Sub PrintParamDb()
+ 'Map.refRightPanelVM.SetSelPanel(RightPanelVM.Panels.PRINTPARAMDB)
+ 'Map.refTopPanelVM.SelPage = Pages.SLICE
+ End Sub
+
+#End Region ' PrintParamDb
+
+#Region "MaterialDb"
+
+ '''
+ ''' Returns a command that do CPlaneTop.
+ '''
+ Public ReadOnly Property MaterialDb_Command As ICommand
+ Get
+ If m_cmdMaterialDb Is Nothing Then
+ m_cmdMaterialDb = New Command(AddressOf MaterialDb)
+ End If
+ Return m_cmdMaterialDb
+ End Get
+ End Property
+
+ '''
+ ''' Execute the CPlaneTop. This method is invoked by the CPlaneTopCommand.
+ '''
+ Public Sub MaterialDb()
+ 'Map.refRightPanelVM.SetSelPanel(RightPanelVM.Panels.PRINTPARAMDB)
+ 'Map.refTopPanelVM.SelPage = Pages.SLICE
+ End Sub
+
+#End Region ' MaterialDb
+
+#End Region ' COMMANDS
+
+End Class
+
+Public Class ModifyModeButton
+ Inherits VMBase
+
+ Private m_sName As String
+ Public ReadOnly Property sName As String
+ Get
+ Return m_sName
+ End Get
+ End Property
+
+ Private m_ModifyMode As ModifyModes
+ Public ReadOnly Property ModifyMode As ModifyModes
+ Get
+ Return m_ModifyMode
+ End Get
+ End Property
+
+ Sub New(sName As String, ModifyMode As ModifyModes)
+ m_sName = sName
+ m_ModifyMode = ModifyMode
+ End Sub
+
End Class
diff --git a/3dPrintApp/Utility/Dictionary.xaml b/3dPrintApp/Utility/Dictionary.xaml
index 515dfc6..c03dbf5 100644
--- a/3dPrintApp/Utility/Dictionary.xaml
+++ b/3dPrintApp/Utility/Dictionary.xaml
@@ -24,6 +24,16 @@
+
+
+
+
+
+
+
+
+
+
@@ -279,8 +312,8 @@
+
+
+
+
@@ -389,9 +455,14 @@
-
+
+
@@ -835,7 +906,50 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/3dPrintApp/Utility/LuaExec.vb b/3dPrintApp/Utility/LuaExec.vb
index 43df526..9b31dec 100644
--- a/3dPrintApp/Utility/LuaExec.vb
+++ b/3dPrintApp/Utility/LuaExec.vb
@@ -4,206 +4,48 @@ Imports EgtWPFLib5
Module LuaExec
- Friend Function ExecBeam(sFile As String, sMachine As String, nFlag As Integer, bBtl As Boolean) As Boolean
- EgtOutLog("-- Start ExecBeam --")
- ' Recupero lo script da eseguire
- Dim sExecPath As String = ""
- Dim sExecName As String = ""
- GetMainPrivateProfileString(S_BEAM, K_BEAMBWEEXEC, "", sExecName)
- sExecPath = (Map.refMainWindowVM.MainWindowM.sBeamRoot & "\" & sExecName).TrimEnd({"\"c})
+ Friend Function ExecSlice(bSlice As Boolean, bCalcTFS As Boolean) As Boolean
+ EgtOutLog("-- Start ExecSlice --")
+ ' eseguo slice
+ If bSlice Then Map.refSceneHostVM.ExecScript(Map.refMainWindowVM.MainWindowM.s3dPrintingDir & "\Slicing.lua")
+ If Not bCalcTFS Then Return True
+ ' eseguo calcolo T,F,S da parametri materiale
+ Dim sExecPath As String = Map.refMainWindowVM.MainWindowM.s3dPrintingDir & "\LuaLibs\CalcMachParamFromSW.lua"
If Not My.Computer.FileSystem.FileExists(sExecPath) Then
- EgtOutLog("Not found BeamExec script " & sExecPath)
+ EgtOutLog("Not found 3DPrint script " & sExecPath)
Return False
End If
' Assegno i dati
- EgtLuaCreateGlobTable("BEAM")
- EgtLuaSetGlobStringVar("BEAM.BASEDIR", Map.refMainWindowVM.MainWindowM.sBeamRoot)
- EgtLuaSetGlobStringVar("BEAM.FILE", sFile)
- EgtLuaSetGlobStringVar("BEAM.MACHINE", sMachine)
- EgtLuaSetGlobIntVar("BEAM.FLAG", nFlag)
- ' Eseguo lo script
- Dim bOk As Boolean = False
- If EgtLuaExecFile(sExecPath) Then
- ' Recupero i risultati
- Dim nErr As Integer = 999
- EgtLuaGetGlobIntVar("BEAM.ERR", nErr)
- bOk = (nErr <= 0)
- If Not bOk Then EgtOutLog("BeamExec Err=" & nErr.ToString())
- Else
- EgtOutLog("Error executing Beam Exec script " & sExecPath)
- Return False
- End If
- ' Cancello tavola globale
- EgtLuaResetGlobVar("BEAM")
- Return bOk
- End Function
-
- Friend Function ExecWall(sFile As String, sMachine As String, nFlag As Integer, bBtl As Boolean, bNestingCornerBL As Boolean) As Boolean
- EgtOutLog("-- Start ExecWall --")
- ' Recupero lo script da eseguire
- Dim sExecPath As String = ""
- Dim sExecName As String = ""
- GetMainPrivateProfileString(S_WALL, K_WALLBWEEXEC, "", sExecName)
- sExecPath = (Map.refMainWindowVM.MainWindowM.sWallRoot & "\" & sExecName).TrimEnd({"\"c})
- If Not My.Computer.FileSystem.FileExists(sExecPath) Then
- EgtOutLog("Not found WallExec script " & sExecPath)
- Return False
- End If
- ' Assegno i dati
- EgtLuaCreateGlobTable("WALL")
- EgtLuaSetGlobStringVar("WALL.BASEDIR", Map.refMainWindowVM.MainWindowM.sWallRoot)
- EgtLuaSetGlobStringVar("WALL.FILE", sFile)
- EgtLuaSetGlobStringVar("WALL.MACHINE", sMachine)
- EgtLuaSetGlobIntVar("WALL.FLAG", nFlag)
- EgtLuaSetGlobBoolVar("WALL.NESTINGCORNERBL", bNestingCornerBL)
- ' Eseguo lo script
- Dim bOk As Boolean = False
- If EgtLuaExecFile(sExecPath) Then
- ' Recupero i risultati
- Dim nErr As Integer = 999
- EgtLuaGetGlobIntVar("WALL.ERR", nErr)
- bOk = (nErr <= 0)
- If Not bOk Then EgtOutLog("WallExec Err=" & nErr.ToString())
- Else
- bOk = False
- EgtOutLog("Error executing Wall Exec script " & sExecPath)
- End If
- ' Cancello tavola globale
- EgtLuaResetGlobVar("WALL")
- Return bOk
- End Function
-
- Friend Function ExecNesting(sFile As String, sMachine As String, PartList As List(Of BTLPartM), SectionList As List(Of SParam), dStartOffset As Double, dOffset As Double, dKerf As Double, bLDIntersOther As Boolean, nMinScore As Integer, nNestTime As Integer) As Boolean
- If PartList.Count = 0 Then
- EgtOutLog("Exit nesting: no parts received!")
- Return True
- End If
- EgtOutLog("-- Start ExecNest --")
- ' Recupero lo script da eseguire
- Dim sExecPath As String = ""
- Dim sExecName As String = ""
- GetMainPrivateProfileString(S_NEST, K_NESTEXEC, "", sExecName)
- Dim sRoot As String = ""
- If Map.refProjectVM.BTLStructureVM.nPROJTYPE = MachineType.BEAM Then
- sRoot = Map.refMainWindowVM.MainWindowM.sBeamRoot
- ElseIf Map.refProjectVM.BTLStructureVM.nPROJTYPE = MachineType.WALL Then
- sRoot = Map.refMainWindowVM.MainWindowM.sWallRoot
- End If
- sExecPath = (sRoot & "\" & sExecName).TrimEnd({"\"c})
- If Not My.Computer.FileSystem.FileExists(sExecPath) Then
- EgtOutLog("Not found NestExec script " & sExecPath)
- Return False
- End If
- ' Assegno i dati
- EgtLuaCreateGlobTable("NEST")
- EgtLuaSetGlobStringVar("NEST.BASEDIR", sRoot)
- EgtLuaSetGlobStringVar("NEST.FILE", sFile)
- EgtLuaSetGlobStringVar("NEST.MACHINE", sMachine)
- 'EgtLuaSetGlobNumVar("NEST.LEN", dLength)
- 'EgtLuaSetGlobNumVar("NEST.WIDTH", dWidth)
- EgtLuaSetGlobNumVar("NEST.STARTOFFSET", dStartOffset)
- EgtLuaSetGlobNumVar("NEST.OFFSET", dOffset)
- EgtLuaSetGlobNumVar("NEST.KERF", dKerf)
- EgtLuaSetGlobNumVar("NEST.DRILL_MACH_AREA", If(bLDIntersOther, 1, 0))
- EgtLuaSetGlobNumVar("NEST.MIN_ANGLE_PNT", nMinScore)
- Dim nNestCorner As Integer
- Select Case CurrentMachine.NestingCorner
- Case MCH_CR.TL
- nNestCorner = 1
- Case MCH_CR.TR
- nNestCorner = 3
- Case MCH_CR.BL
- nNestCorner = 0
- Case MCH_CR.BR
- nNestCorner = 2
- End Select
- EgtLuaSetGlobNumVar("NEST.CORNER", nNestCorner)
- EgtLuaSetGlobStringVar("NEST.MATERIAL", PartList(0).sMATERIAL)
- 'EgtLuaSetGlobNumVar("NEST.QTY", nQty)
- EgtLuaSetGlobNumVar("NEST.TIME", nNestTime)
- EgtLuaSetGlobNumVar("NEST.PRODID", Map.refProdManagerVM.CurrProd.nProdId)
- EgtLuaCreateGlobTable("PART")
- For PartIndex = 0 To PartList.Count - 1
- EgtLuaSetGlobIntVar("PART." & PartList(PartIndex).nPartId.ToString(), PartList(PartIndex).m_nCNT + PartList(PartIndex).m_nADDED - PartList(PartIndex).nINPROD)
- Next
- EgtLuaCreateGlobTable("LEN")
- For SectionIndex = 0 To SectionList.Count - 1
- EgtLuaSetGlobNumVar("LEN." & SectionIndex + 1, SectionList(SectionIndex).dL)
- Next
- EgtLuaCreateGlobTable("WIDTH")
- For SectionIndex = 0 To SectionList.Count - 1
- EgtLuaSetGlobNumVar("WIDTH." & SectionIndex + 1, SectionList(SectionIndex).dW)
- Next
- EgtLuaCreateGlobTable("QTY")
- For SectionIndex = 0 To SectionList.Count - 1
- EgtLuaSetGlobNumVar("QTY." & SectionIndex + 1, SectionList(SectionIndex).nQuantity)
- Next
+ Dim SelMaterialParam As Material = Map.refTopPanelVM.GetSelMaterialData()
EgtLuaCreateGlobTable("MATERIAL")
- For SectionIndex = 0 To SectionList.Count - 1
- EgtLuaSetGlobStringVar("MATERIAL." & SectionIndex + 1, SectionList(SectionIndex).SectXMat.sSectionXMaterial)
- Next
+ EgtLuaSetGlobNumVar("MATERIAL.K", SelMaterialParam.dK)
+ EgtLuaSetGlobNumVar("MATERIAL.C1", SelMaterialParam.dC1)
+ EgtLuaSetGlobNumVar("MATERIAL.C2", SelMaterialParam.dC2)
+ EgtLuaSetGlobNumVar("MATERIAL.Density", SelMaterialParam.dDensity)
+ EgtLuaSetGlobNumVar("MATERIAL.AMax", SelMaterialParam.dAMax)
+ EgtLuaSetGlobNumVar("MATERIAL.ATrg", SelMaterialParam.dATrg)
+ EgtLuaSetGlobNumVar("MATERIAL.AMin", SelMaterialParam.dAMin)
+ EgtLuaSetGlobNumVar("MATERIAL.BMax", SelMaterialParam.dBMax)
+ EgtLuaSetGlobNumVar("MATERIAL.BTrg", SelMaterialParam.dBTrg)
+ EgtLuaSetGlobNumVar("MATERIAL.BMin", SelMaterialParam.dBMin)
+ EgtLuaSetGlobNumVar("MATERIAL.KW", SelMaterialParam.dKW)
+ EgtLuaSetGlobNumVar("MATERIAL.KZ", SelMaterialParam.dKZ)
+ EgtLuaSetGlobNumVar("MATERIAL.KN", SelMaterialParam.dKN)
' Eseguo lo script
Dim bOk As Boolean = False
If EgtLuaExecFile(sExecPath) Then
' Recupero i risultati
Dim nErr As Integer = 999
- EgtLuaGetGlobIntVar("NEST.ERR", nErr)
+ EgtLuaGetGlobIntVar("MATERIAL.ERR", nErr)
bOk = (nErr <= 0)
- If Not bOk Then EgtOutLog("NestExec Err=" & nErr.ToString())
+ If Not bOk Then EgtOutLog("ExecSlice Err=" & nErr.ToString())
Else
- bOk = False
- EgtOutLog("Error executing Nest Exec script " & sExecPath)
+ EgtOutLog("Error executing Slice Exec script " & sExecPath)
+ Return False
End If
' Cancello tavola globale
- EgtLuaResetGlobVar("NEST")
- EgtLuaResetGlobVar("PART")
- EgtLuaResetGlobVar("LEN")
- EgtLuaResetGlobVar("WIDTH")
- EgtLuaResetGlobVar("QTY")
EgtLuaResetGlobVar("MATERIAL")
Return bOk
End Function
- Friend Function ExecRotFlip(nPartId As Integer) As Boolean
- If IsNothing(nPartId) OrElse nPartId = GDB_ID.NULL Then
- EgtOutLog("Exit nesting: no parts received!")
- Return True
- End If
- EgtOutLog("-- Start ExecFlipRot --")
- ' Recupero lo script da eseguire
- Dim sExecPath As String = ""
- Dim sExecName As String = ""
- GetMainPrivateProfileString(S_NEST, K_FLIPROT, "", sExecName)
- Dim sRoot As String = ""
- If Map.refProjectVM.BTLStructureVM.nPROJTYPE = MachineType.BEAM Then
- sRoot = Map.refMainWindowVM.MainWindowM.sBeamRoot
- ElseIf Map.refProjectVM.BTLStructureVM.nPROJTYPE = MachineType.WALL Then
- sRoot = Map.refMainWindowVM.MainWindowM.sWallRoot
- End If
- sExecPath = (sRoot & "\" & sExecName).TrimEnd({"\"c})
- If Not My.Computer.FileSystem.FileExists(sExecPath) Then
- EgtOutLog("Not found NestExec script " & sExecPath)
- Return False
- End If
- ' Assegno i dati
- EgtLuaCreateGlobTable("NFAR")
- EgtLuaSetGlobStringVar("NFAR.BASEDIR", sRoot)
- EgtLuaSetGlobStringVar("NFAR.PARTID", nPartId)
- ' Eseguo lo script
- Dim bOk As Boolean = False
- If EgtLuaExecFile(sExecPath) Then
- ' Recupero i risultati
- Dim nErr As Integer = 999
- EgtLuaGetGlobIntVar("NFAR.ERR", nErr)
- bOk = (nErr <= 0)
- If Not bOk Then EgtOutLog("FlipRot Err=" & nErr.ToString())
- Else
- bOk = False
- EgtOutLog("Error executing Nest FlipRot script " & sExecPath)
- End If
- ' Cancello tavola globale
- EgtLuaResetGlobVar("NFAR")
- Return bOk
- End Function
-
End Module
diff --git a/3dPrintApp/Utility/Map.vb b/3dPrintApp/Utility/Map.vb
index d3d0508..0454d82 100644
--- a/3dPrintApp/Utility/Map.vb
+++ b/3dPrintApp/Utility/Map.vb
@@ -12,7 +12,11 @@ Module Map
'Private m_refMainMenuVM As MainMenuVM
Private m_refMachinePanelVM As MachinePanelVM
''Private m_refMyMachGroupPanelVM As MyMachGroupPanelVM
- 'Private m_refLeftPanelVM As LeftPanelVM
+ Private m_refLeftPanelVM As LeftPanelVM
+ Private m_refRightPanelVM As RightPanelVM
+ Private m_refDispositionPanelVM As DispositionPanelVM
+ Private m_refStartMachPanelVM As StartMachPanelVM
+ Private m_refControllerInputPanelVM As ControllerInputPanelVM
'Private m_refBottomPanelVM As BottomPanelVM
'Private m_refShowBeamPanelVM As ShowBeamPanelVM
'Private m_refConfigurationPageVM As ConfigurationPageVM
@@ -24,7 +28,7 @@ Module Map
'Private m_refFreeContourInputVM As FreeContourInputVM
'Private m_refPartManagerVM As PartManagerVM
Private m_refInstrumentPanelVM As InstrumentPanelVM
- 'Private m_refTopPanelVM As TopPanelVM
+ Private m_refTopPanelVM As TopPanelVM
'Private m_refOptimizePanelVM As OptimizePanelVM
'Private m_refCALCPanelVM As CALCPanelVM
'Private m_refPartListVM As BTLPartListVM
@@ -42,6 +46,10 @@ Module Map
'Private m_refSplitModeVM As SplitModeVM
'Private m_refMoveRawModeVM As MoveRawModeVM
'Private m_refSimulTabVM As SimulTabVM
+ Private m_refImportPanelVM As ImportPanelVM
+ Private m_refSliceManagerVM As SliceManagerVM
+ Private m_refTFSEditorVM As TFSEditorVM
+ Private m_refCurrMachiningPanelVM As CurrMachiningPanelVM
#Region "Get"
@@ -104,11 +112,35 @@ Module Map
End Get
End Property
- 'Public ReadOnly Property refLeftPanelVM As LeftPanelVM
- ' Get
- ' Return m_refLeftPanelVM
- ' End Get
- 'End Property
+ Public ReadOnly Property refLeftPanelVM As LeftPanelVM
+ Get
+ Return m_refLeftPanelVM
+ End Get
+ End Property
+
+ Public ReadOnly Property refRightPanelVM As RightPanelVM
+ Get
+ Return m_refRightPanelVM
+ End Get
+ End Property
+
+ Public ReadOnly Property refDispositionPanelVM As DispositionPanelVM
+ Get
+ Return m_refDispositionPanelVM
+ End Get
+ End Property
+
+ Public ReadOnly Property refStartMachPanelVM As StartMachPanelVM
+ Get
+ Return m_refStartMachPanelVM
+ End Get
+ End Property
+
+ Public ReadOnly Property refControllerInputPanelVM As ControllerInputPanelVM
+ Get
+ Return m_refControllerInputPanelVM
+ End Get
+ End Property
'Public ReadOnly Property refMachGroupPanelVM As MyMachGroupPanelVM
' Get
@@ -182,11 +214,11 @@ Module Map
End Get
End Property
- 'Public ReadOnly Property refTopPanelVM As TopPanelVM
- ' Get
- ' Return m_refTopPanelVM
- ' End Get
- 'End Property
+ Public ReadOnly Property refTopPanelVM As TopPanelVM
+ Get
+ Return m_refTopPanelVM
+ End Get
+ End Property
'Public ReadOnly Property refOptimizePanelVM As OptimizePanelVM
' Get
@@ -296,6 +328,30 @@ Module Map
' End Get
'End Property
+ Public ReadOnly Property refImportPanelVM As ImportPanelVM
+ Get
+ Return m_refImportPanelVM
+ End Get
+ End Property
+
+ Public ReadOnly Property refSliceManagerVM As SliceManagerVM
+ Get
+ Return m_refSliceManagerVM
+ End Get
+ End Property
+
+ Public ReadOnly Property refTFSEditorVM As TFSEditorVM
+ Get
+ Return m_refTFSEditorVM
+ End Get
+ End Property
+
+ Public ReadOnly Property refCurrMachiningPanelVM As CurrMachiningPanelVM
+ Get
+ Return m_refCurrMachiningPanelVM
+ End Get
+ End Property
+
#End Region ' Get
#Region "Set"
@@ -349,10 +405,30 @@ Module Map
Return Not IsNothing(m_refMachinePanelVM)
End Function
- 'Friend Function SetRefLeftPanelVM(LeftPanelVM As LeftPanelVM) As Boolean
- ' m_refLeftPanelVM = LeftPanelVM
- ' Return Not IsNothing(m_refLeftPanelVM)
- 'End Function
+ Friend Function SetRefLeftPanelVM(LeftPanelVM As LeftPanelVM) As Boolean
+ m_refLeftPanelVM = LeftPanelVM
+ Return Not IsNothing(m_refLeftPanelVM)
+ End Function
+
+ Friend Function SetRefRightPanelVM(RightPanelVM As RightPanelVM) As Boolean
+ m_refRightPanelVM = RightPanelVM
+ Return Not IsNothing(m_refRightPanelVM)
+ End Function
+
+ Friend Function SetRefDispositionPanelVM(DispositionPanelVM As DispositionPanelVM) As Boolean
+ m_refDispositionPanelVM = DispositionPanelVM
+ Return Not IsNothing(m_refDispositionPanelVM)
+ End Function
+
+ Friend Function SetRefStartMachPanelVM(StartMachPanelVM As StartMachPanelVM) As Boolean
+ m_refStartMachPanelVM = StartMachPanelVM
+ Return Not IsNothing(m_refStartMachPanelVM)
+ End Function
+
+ Friend Function SetRefControllerInputPanelVM(ControllerInputPanelVM As ControllerInputPanelVM) As Boolean
+ m_refControllerInputPanelVM = ControllerInputPanelVM
+ Return Not IsNothing(m_refControllerInputPanelVM)
+ End Function
'Friend Function SetRefMachGroupPanelVM(MachGroupPanelVM As MyMachGroupPanelVM) As Boolean
' CoreMap.SetRefMachGroupPanelVM(MachGroupPanelVM)
@@ -414,10 +490,10 @@ Module Map
Return Not IsNothing(m_refInstrumentPanelVM)
End Function
- 'Friend Function SetRefTopPanelVM(TopPanelVM As TopPanelVM) As Boolean
- ' m_refTopPanelVM = TopPanelVM
- ' Return Not IsNothing(m_refTopPanelVM)
- 'End Function
+ Friend Function SetRefTopPanelVM(TopPanelVM As TopPanelVM) As Boolean
+ m_refTopPanelVM = TopPanelVM
+ Return Not IsNothing(m_refTopPanelVM)
+ End Function
'Friend Function SetRefOptimizePanelVM(OptimizePanelVM As OptimizePanelVM) As Boolean
' m_refOptimizePanelVM = OptimizePanelVM
@@ -509,6 +585,26 @@ Module Map
' Return Not IsNothing(m_refSimulTabVM)
'End Function
+ Friend Function SetRefImportPanelVM(ImportPanelVM As ImportPanelVM) As Boolean
+ m_refImportPanelVM = ImportPanelVM
+ Return Not IsNothing(m_refImportPanelVM)
+ End Function
+
+ Friend Function SetRefSliceManagerVM(SliceManagerVM As SliceManagerVM) As Boolean
+ m_refSliceManagerVM = SliceManagerVM
+ Return Not IsNothing(m_refSliceManagerVM)
+ End Function
+
+ Friend Function SetRefTFSEditorVM(TFSEditorVM As TFSEditorVM) As Boolean
+ m_refTFSEditorVM = TFSEditorVM
+ Return Not IsNothing(m_refTFSEditorVM)
+ End Function
+
+ Friend Function SetRefCurrMachiningPanelVM(CurrMachiningPanelVM As CurrMachiningPanelVM) As Boolean
+ m_refCurrMachiningPanelVM = CurrMachiningPanelVM
+ Return Not IsNothing(m_refCurrMachiningPanelVM)
+ End Function
+
#End Region ' Set
#Region "Init"
diff --git a/3dPrintApp/ViewModel/Print3dPartVM.vb b/3dPrintApp/ViewModel/Print3dPartVM.vb
index b489cb8..4f25e13 100644
--- a/3dPrintApp/ViewModel/Print3dPartVM.vb
+++ b/3dPrintApp/ViewModel/Print3dPartVM.vb
@@ -1,4 +1,5 @@
Imports System.Collections.ObjectModel
+Imports EgtUILib
Public Class Print3dPartVM
@@ -9,14 +10,71 @@ Public Class Print3dPartVM
End Get
End Property
- Private m_sImportedFileName As String
- Public Property sImportedFileName As String
+ ' solido/superficie da stampare
+ Private m_nPrintSolidLayerId As Integer = GDB_ID.NULL
+ Public ReadOnly Property nPrintSolidLayerId As Integer
Get
- Return m_sImportedFileName
+ Return m_nPrintSolidLayerId
+ End Get
+ End Property
+ Private m_nPrintSolidId As Integer = GDB_ID.NULL
+ Public ReadOnly Property nPrintSolidId As Integer
+ Get
+ Return m_nPrintSolidId
+ End Get
+ End Property
+
+ ' solido/superficie originale
+ Private m_nOriginalPartLayerId As Integer = GDB_ID.NULL
+ Public ReadOnly Property nOriginalPartLayerId As Integer
+ Get
+ Return m_nOriginalPartLayerId
+ End Get
+ End Property
+
+ ' riferimento del solido/superficie di stampa
+ Private m_nReferenceId As Integer = GDB_ID.NULL
+ Public ReadOnly Property nReferenceId As Integer
+ Get
+ Return m_nReferenceId
+ End Get
+ End Property
+
+ ' punto/curva di inizio stampa
+ Private m_nMachStartLayerId As Integer = GDB_ID.NULL
+ Public ReadOnly Property nMachStartLayerId As Integer
+ Get
+ Return m_nMachStartLayerId
+ End Get
+ End Property
+ Private m_nMachStartId As Integer = GDB_ID.NULL
+ Public ReadOnly Property nMachStartId As Integer
+ Get
+ Return m_nMachStartId
+ End Get
+ End Property
+
+ ' solidi ausiliari
+ Private m_nAuxSolidsLayerId As Integer = GDB_ID.NULL
+ Public ReadOnly Property nAuxSolidsLayerId As Integer
+ Get
+ Return m_nAuxSolidsLayerId
+ End Get
+ End Property
+
+ ' setti
+ Private m_nRibsLayerId As Integer = GDB_ID.NULL
+ Public ReadOnly Property nRibsLayerId As Integer
+ Get
+ Return m_nRibsLayerId
+ End Get
+ End Property
+
+ Private m_sImportedFileName As String
+ Public ReadOnly Property sImportedFileName As String
+ Get
+ Return If(Not String.IsNullOrWhiteSpace(m_sImportedFilePath), IO.Path.GetFileName(m_sImportedFilePath), "")
End Get
- Set(value As String)
- m_sImportedFileName = value
- End Set
End Property
Private m_sImportedFilePath As String
@@ -47,4 +105,18 @@ Public Class Print3dPartVM
m_sImportedFileName = IO.Path.GetFileName(m_sImportedFilePath)
End Sub
+ Sub New(nPartId As Integer, nPrintSolidLayerdId As Integer, nPrintSolidId As Integer, nOriginalPartLayerId As Integer, nReferenceId As Integer, nMachStartLayerId As Integer,
+ nMachStartId As Integer, nAuxSolidsLayerId As Integer, nRibsLayerId As Integer, sImportedFilePath As String)
+ m_nPartId = nPartId
+ m_nPrintSolidLayerId = nPrintSolidLayerdId
+ m_nPrintSolidId = nPrintSolidId
+ m_nOriginalPartLayerId = nOriginalPartLayerId
+ m_nReferenceId = nReferenceId
+ m_nMachStartLayerId = nMachStartLayerId
+ m_nMachStartId = nMachStartId
+ m_nAuxSolidsLayerId = nAuxSolidsLayerId
+ m_nRibsLayerId = nRibsLayerId
+ m_sImportedFilePath = sImportedFilePath
+ End Sub
+
End Class