diff --git a/Icarus/Constants/Const3dPrint.vb b/Icarus/Constants/Const3dPrint.vb
index 5359e83..fc7ea12 100644
--- a/Icarus/Constants/Const3dPrint.vb
+++ b/Icarus/Constants/Const3dPrint.vb
@@ -1,6 +1,7 @@
Public Module Const3dPrint
Public Const TABLE = "Table"
+ Public Const TABLE_OUTLINE = "TableOutline"
Public Const PART = "Part"
Public Const ORIGINAL_SOLID = "OriginalSolid"
Public Const PRINT_SOLID = "PrintSolid"
@@ -31,6 +32,7 @@
Public Const KEY_LENGTH = "Length"
Public Const KEY_SPEED = "Speed"
Public Const KEY_SLICEID = "SliceId"
+ Public Const KEY_MASS = "PrintMass"
' parametri Materiali
diff --git a/Icarus/Constants/ConstMachIni.vb b/Icarus/Constants/ConstMachIni.vb
index ead4012..624bb60 100644
--- a/Icarus/Constants/ConstMachIni.vb
+++ b/Icarus/Constants/ConstMachIni.vb
@@ -24,6 +24,10 @@
Public Const TS3DATA_FILE As String = "Ts3Data.lua"
+ Public Const S_MACHINING As String = "Machining"
+ Public Const K_MACH_INITSCRIPT As String = "InitScript"
+ Public Const K_MACH_EXITSCRIPT As String = "ExitScript"
+
' Public Const S_PRINTING3D As String = "3dPrinting"
Public Const K_SPEED_MIN As String = "SpeedMin"
Public Const K_SPEED_MAX As String = "SpeedMax"
diff --git a/Icarus/Icarus.vbproj b/Icarus/Icarus.vbproj
index e4b1545..cd7c403 100644
--- a/Icarus/Icarus.vbproj
+++ b/Icarus/Icarus.vbproj
@@ -176,6 +176,12 @@
ShowPanelV.xaml
+
+
+
+ SimulationPanelV.xaml
+
+ SliceManagerV.xaml
@@ -319,6 +325,10 @@
MSBuild:CompileDesigner
+
+ Designer
+ XamlIntelliSenseFileGenerator
+ DesignerMSBuild:Compile
@@ -512,6 +522,22 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ IF "$(PlatformName)"=="x64" IF "$(ConfigurationName)" == "Release" copy $(TargetPath) c:\EgtProg\Icarus\IcarusR64.exe
diff --git a/Icarus/Resources/SimulTab/Pause.png b/Icarus/Resources/SimulTab/Pause.png
new file mode 100644
index 0000000..f7c5176
Binary files /dev/null and b/Icarus/Resources/SimulTab/Pause.png differ
diff --git a/Icarus/Resources/SimulTab/Play.png b/Icarus/Resources/SimulTab/Play.png
new file mode 100644
index 0000000..322e67e
Binary files /dev/null and b/Icarus/Resources/SimulTab/Play.png differ
diff --git a/Icarus/Resources/SimulationPanel/HeadMode.png b/Icarus/Resources/SimulationPanel/HeadMode.png
new file mode 100644
index 0000000..ff90ba9
Binary files /dev/null and b/Icarus/Resources/SimulationPanel/HeadMode.png differ
diff --git a/Icarus/Resources/SimulationPanel/MachMode.png b/Icarus/Resources/SimulationPanel/MachMode.png
new file mode 100644
index 0000000..5765f57
Binary files /dev/null and b/Icarus/Resources/SimulationPanel/MachMode.png differ
diff --git a/Icarus/Resources/SimulationPanel/Pause.png b/Icarus/Resources/SimulationPanel/Pause.png
new file mode 100644
index 0000000..f7c5176
Binary files /dev/null and b/Icarus/Resources/SimulationPanel/Pause.png differ
diff --git a/Icarus/Resources/SimulationPanel/Play.png b/Icarus/Resources/SimulationPanel/Play.png
new file mode 100644
index 0000000..322e67e
Binary files /dev/null and b/Icarus/Resources/SimulationPanel/Play.png differ
diff --git a/Icarus/Resources/SimulationPanel/PlayStep.png b/Icarus/Resources/SimulationPanel/PlayStep.png
new file mode 100644
index 0000000..60e8c55
Binary files /dev/null and b/Icarus/Resources/SimulationPanel/PlayStep.png differ
diff --git a/Icarus/Resources/SimulationPanel/Stop.png b/Icarus/Resources/SimulationPanel/Stop.png
new file mode 100644
index 0000000..adecf17
Binary files /dev/null and b/Icarus/Resources/SimulationPanel/Stop.png differ
diff --git a/Icarus/Resources/SimulationPanel/ToolMode.png b/Icarus/Resources/SimulationPanel/ToolMode.png
new file mode 100644
index 0000000..199aada
Binary files /dev/null and b/Icarus/Resources/SimulationPanel/ToolMode.png differ
diff --git a/Icarus/RightPanel/RightPanelV.xaml b/Icarus/RightPanel/RightPanelV.xaml
index a4c4d29..5692a12 100644
--- a/Icarus/RightPanel/RightPanelV.xaml
+++ b/Icarus/RightPanel/RightPanelV.xaml
@@ -35,6 +35,9 @@
+
+
+
diff --git a/Icarus/RightPanel/RightPanelVM.vb b/Icarus/RightPanel/RightPanelVM.vb
index 72f0eb7..9dad6ef 100644
--- a/Icarus/RightPanel/RightPanelVM.vb
+++ b/Icarus/RightPanel/RightPanelVM.vb
@@ -14,6 +14,7 @@ Public Class RightPanelVM
SHELLNUMBER = 5
AUXSOLIDPARAM = 6
TFSEDITOR = 7
+ SIMULATION = 8
End Enum
Private m_SelPanel As Panels
@@ -27,6 +28,20 @@ Public Class RightPanelVM
End Property
Friend Sub SetSelPanel(Panel As Panels)
If Panel = m_SelPanel Then Return
+ Select Case m_SelPanel
+ Case Panels.NULL
+
+ Case Panels.MATERIALDB
+
+ Case Panels.PRINTPARAMDB
+
+ Case Panels.RIBPARAM
+
+ Case Panels.TFSEDITOR
+
+ Case Panels.SIMULATION
+ Map.refSimulationPanelVM.ExitSimulation()
+ End Select
m_SelPanel = Panel
Select Case Panel
Case Panels.NULL
@@ -40,6 +55,8 @@ Public Class RightPanelVM
Case Panels.TFSEDITOR
'Map.refTFSEditorVM.Refresh()
+ Case Panels.SIMULATION
+ Map.refSimulationPanelVM.InitSimulation()
End Select
NotifyPropertyChanged(NameOf(SelPanel))
End Sub
diff --git a/Icarus/SimulationPanel/MachineAxis.vb b/Icarus/SimulationPanel/MachineAxis.vb
new file mode 100644
index 0000000..02023c7
--- /dev/null
+++ b/Icarus/SimulationPanel/MachineAxis.vb
@@ -0,0 +1,116 @@
+Imports System.ComponentModel
+Imports EgtUILib
+Imports EgtWPFLib5
+
+Public Class MachineAxis
+ Inherits VMBase
+
+ Private m_IsReadOnlyAxesValue As Boolean
+ Public Property IsReadOnlyAxesValue As Boolean
+ Get
+ Return m_IsReadOnlyAxesValue
+ End Get
+ Set(value As Boolean)
+ If value <> m_IsReadOnlyAxesValue Then
+ m_IsReadOnlyAxesValue = value
+ NotifyPropertyChanged("IsReadOnlyAxesValue")
+ NotifyPropertyChanged("IsEnabledAxesValue")
+ End If
+ End Set
+ End Property
+
+ Public ReadOnly Property IsEnabledAxesValue As Boolean
+ Get
+ Return Not m_IsReadOnlyAxesValue
+ End Get
+ End Property
+
+ ' Definizione comandi
+ Private m_cmdManualAxisModify As ICommand
+
+ Private m_Name As String
+ Public Property Name As String
+ Get
+ Return m_Name
+ End Get
+ Set(value As String)
+ m_Name = value
+ End Set
+ End Property
+
+ Private m_Token As String
+ Public Property Token As String
+ Get
+ Return m_Token
+ End Get
+ Set(value As String)
+ If value <> m_Token Then
+ m_Token = value
+ NotifyPropertyChanged("Token")
+ End If
+ End Set
+ End Property
+
+ Private m_Linear As Boolean
+ Public WriteOnly Property Linear As Boolean
+ Set(value As Boolean)
+ m_Linear = value
+ End Set
+ End Property
+
+ Private m_Value As String
+ Public Property Value As String
+ Get
+ Return m_Value
+ End Get
+ Set(value As String)
+ m_Value = value
+ NotifyPropertyChanged("Value")
+ End Set
+ End Property
+
+ Sub New()
+ IsReadOnlyAxesValue = True
+ End Sub
+
+#Region "COMMANDS"
+
+#Region "ManualAxisModifyCommand"
+
+ '''
+ ''' Returns a command that create a new tool.
+ '''
+ Public ReadOnly Property ManualAxisModifyCommand As ICommand
+ Get
+ If m_cmdManualAxisModify Is Nothing Then
+ m_cmdManualAxisModify = New Command(AddressOf ManualAxisModify)
+ End If
+ Return m_cmdManualAxisModify
+ End Get
+ End Property
+
+ '''
+ ''' Creata the new tool. This method is invoked by the NewCommand.
+ '''
+ Public Sub ManualAxisModify(ByVal param As Object)
+ Dim dVal As Double
+ If m_Linear Then
+ StringToLen(m_Value, dVal)
+ Else
+ StringToDouble(m_Value, dVal)
+ End If
+ EgtSetAxisPos(m_Name, dVal)
+ EgtGetAxisPos(m_Name, dVal)
+ If m_Linear Then
+ Value = LenToString(dVal, 3)
+ Else
+ Value = DoubleToString(dVal, 3)
+ End If
+ EgtDraw()
+ End Sub
+
+#End Region ' ManualAxisModifyCommand
+
+#End Region
+
+End Class
diff --git a/Icarus/SimulationPanel/MyEstimations.vb b/Icarus/SimulationPanel/MyEstimations.vb
new file mode 100644
index 0000000..dd6fc8a
--- /dev/null
+++ b/Icarus/SimulationPanel/MyEstimations.vb
@@ -0,0 +1,97 @@
+Imports System.Collections.ObjectModel
+Imports System.IO
+Imports EgtUILib
+Imports EgtWPFLib5
+
+Public Class MyEstimations
+ Inherits EstimationsVM
+
+#Region "FIELDS & PROPERTIES"
+
+ Private m_Estimation_IsEnabled As Boolean = False
+ Public Property Estimation_IsEnabled As Boolean
+ Get
+ Return m_Estimation_IsEnabled
+ End Get
+ Set(value As Boolean)
+ m_Estimation_IsEnabled = value
+ NotifyPropertyChanged("Estimation_IsEnabled")
+ End Set
+ End Property
+
+#End Region ' FIELDS & PROPERTIES
+
+#Region "CONSTRUCTOR"
+
+ Sub New()
+
+ End Sub
+
+#End Region ' CONSTRUCTOR
+
+#Region "METHODS"
+
+ Public Overrides Function GetEstimationFileName(bAskSave As Boolean, ByRef sEstFile As String, ByRef sInfo As String) As Boolean
+ Dim bOk As Boolean = True
+ ' Recupero e verifico la path del progetto corrente
+ Dim sCurrFilePath As String = String.Empty
+ EgtGetCurrFilePath(sCurrFilePath)
+ If bAskSave Then
+ If String.IsNullOrEmpty(sCurrFilePath) OrElse EgtGetModified() Then
+ ' Il progetto deve essere salvato prima di poter essere generato. Vuoi farlo ?
+ If MessageBox.Show(EgtMsg(MSG_SIMULATION + 31), EgtMsg(MSG_SIMULATION + 15), MessageBoxButton.YesNo, MessageBoxImage.Warning) = MessageBoxResult.No Then
+ ' Abbandono
+ bOk = False
+ Else
+ ' Lancio salvataggio
+ 'OmagOFFICEMap.refSceneHostVM.SaveProject()
+ EgtGetCurrFilePath(sCurrFilePath)
+ ' Se non salvato, abbandono
+ If EgtGetModified() Then bOk = False
+ End If
+ End If
+ Else
+ If String.IsNullOrEmpty(sCurrFilePath) Then
+ ' File delle stime non trovato
+ MessageBox.Show(EgtMsg(MSG_SIMULATION + 18), EgtMsg(MSG_SIMULATION + 15), MessageBoxButton.OK, MessageBoxImage.Warning)
+ bOk = False
+ End If
+ End If
+ ' Creo la path del file di stima e relativo info (con nome gruppo se gestiti)
+ If Not String.IsNullOrEmpty(sCurrFilePath) Then
+ sEstFile = Path.ChangeExtension(sCurrFilePath, Nothing)
+ sInfo = "EgtCAM5 - " & sCurrFilePath
+ Dim sMGrpName As String = String.Empty
+ If EgtGetMachGroupName(EgtGetCurrMachGroup(), sMGrpName) Then
+ sEstFile &= "_" & sMGrpName & ".html"
+ sInfo &= "-" & sMGrpName
+ Else
+ sEstFile &= ".html"
+ End If
+ End If
+ Return bOk
+ End Function
+
+#Region "Details"
+
+ Public Overrides Sub Details(ByVal param As Object)
+ '' Determino il nome del file contenente le stime
+ 'Dim sEstFile As String = OmagOFFICEMap.refMainWindowVM.MainWindowM.sTempDir & "\MachProj.html"
+ 'Dim sInfo As String = ""
+ ''GetEstimationFileName(False, sEstFile, sInfo)
+ '' Verifico che il file esista
+ 'If Not File.Exists(sEstFile) Then
+ ' ' File delle stime non trovato
+ ' MessageBox.Show(EgtMsg(MSG_SIMULATION + 15), EgtMsg(MSG_SIMULATION + 14), MessageBoxButton.OK, MessageBoxImage.Warning)
+ ' Return
+ 'End If
+ '' Visualizzazione
+ 'Dim EstimationsWnd As New EstimationsDetailsWndV(Application.Current.MainWindow, New EstimationsDetailsWndVM(sEstFile, CurrentMachine.sMachIniFile))
+ 'EstimationsWnd.ShowDialog()
+ End Sub
+
+#End Region ' Details
+
+#End Region ' METHODS
+
+End Class
diff --git a/Icarus/SimulationPanel/MySimulation.vb b/Icarus/SimulationPanel/MySimulation.vb
new file mode 100644
index 0000000..7308161
--- /dev/null
+++ b/Icarus/SimulationPanel/MySimulation.vb
@@ -0,0 +1,111 @@
+Imports System.Collections.ObjectModel
+Imports System.IO
+Imports EgtUILib
+Imports EgtWPFLib5
+
+Public Class MySimulation
+ Inherits SimulationVM
+
+#Region "FIELDS & PROPERTIES"
+
+ Public Overrides Property SliderValue As Double
+ Get
+ Return m_SliderValue
+ End Get
+ Set(value As Double)
+ If Math.Abs(value - m_SliderValue) > EPS_SMALL Then
+ m_SliderValue = value
+ EgtSimSetStep(m_SliderValue * GetSliderX())
+ NotifyPropertyChanged("SliderValue")
+ End If
+ End Set
+ End Property
+
+#End Region ' FIELDS & PROPERTIES
+
+#Region "CONSTRUCTOR"
+
+ Sub New()
+ SetPlayImagePath("/Resources/SimulTab/Play.png")
+ SetPauseImagePath("/Resources/SimulTab/Pause.png")
+ SetPauseMsg(EgtMsg(90561)) ' Pausa
+ SetStopMsg(EgtMsg(90562)) ' Simulazione interrotta
+ SetHomeMsg(EgtMsg(90564)) ' Home
+ End Sub
+
+#End Region ' CONSTRUCTOR
+
+#Region "METHODS"
+
+ Public Overrides Sub ExecSim()
+ EgtSimStart(False)
+ EgtSimSetStep(SliderValue * GetSliderX())
+ Dim nShowDataCounter As Integer = 0
+ While GetStatus() <> MCH_SIM_ST.UI_STOP
+ ' Se simulazione in svolgimento
+ If GetStatus() = MCH_SIM_ST.UI_PLAY Or GetStatus() = MCH_SIM_ST.UI_STEP Then
+ ' Eseguo movimento
+ Dim nMove As Integer
+ Dim bMove As Boolean = EgtSimMove(nMove)
+ ' Se arrivato a fine step e sono in step
+ If bMove Then
+ If GetStatus() = MCH_SIM_ST.UI_STEP And nMove = MCH_SIM.END_STEP Then
+ ' Imposto stato Pausa
+ SetSimulationStatus(MCH_SIM_ST.UI_PAUSE)
+ StatusMsg = EgtMsg(MSG_SIMULATIONPAGEUC + 11) ' Pausa
+ ' Aggiornamenti per bottone Play/Pause
+ SetShowPlay(True)
+ NotifyPropertyChanged("PlayPauseImage")
+ End If
+ ' Se movimento non riuscito
+ Else
+ SetSimulationStatus(MCH_SIM_ST.UI_STOP)
+ ' Aggiornamenti per bottone Play/Pause
+ SetShowPlay(True)
+ NotifyPropertyChanged("PlayPauseImage")
+ Select Case nMove
+ Case MCH_SIM.END_
+ StatusMsg = EgtMsg(MSG_SIMULATIONPAGEUC + 1) 'Simulazione completata
+ Case MCH_SIM.STOP_
+ ' Simulazione fermata dall'utente (non necessita messaggio)
+ Case MCH_SIM.OUTSTROKE
+ Dim sInfo As String = String.Empty
+ EgtGetOutstrokeInfo(sInfo)
+ MessageBox.Show(EgtMsg(MSG_SIMULATIONPAGEUC + 2) & " " & sInfo, EgtMsg(MSG_SIMULATIONPAGEUC + 5), MessageBoxButton.OK, MessageBoxImage.Stop) 'Extracorsa ...
+ Case MCH_SIM.DIR_ERR
+ MessageBox.Show(EgtMsg(MSG_SIMULATIONPAGEUC + 3), EgtMsg(MSG_SIMULATIONPAGEUC + 5), MessageBoxButton.OK, MessageBoxImage.Stop) 'Direzione utensile irraggiungibile
+ Case Else
+ MessageBox.Show(EgtMsg(MSG_SIMULATIONPAGEUC + 4), EgtMsg(MSG_SIMULATIONPAGEUC + 5), MessageBoxButton.OK, MessageBoxImage.Stop) 'Errore
+ End Select
+ End If
+ ' Aggiorno stato visualizzazione macchina (dipende anche da utensile)
+ UpdateMachView()
+ ' Aggiorno visualizzazione
+ EgtDraw()
+ ' Aggiorno dati CNC
+ ShowCncData()
+ Else
+ ' Per evitare di ciclare rapidissimamente e consumare inutilmente CPU
+ System.Threading.Thread.Sleep(1)
+ End If
+ ' Costringo ad aggiornare UI
+ UpdateUI()
+ End While
+ End Sub
+
+ Public Overrides Sub OnPostSetSimulationStatus(value As MCH_SIM_ST)
+ 'If OmagOFFICE.refMainWindowVM.MainWindowM.nUserLevel >= 10 AndAlso
+ ' (GetStatus() = MCH_SIM_ST.UI_PAUSE OrElse GetStatus() = MCH_SIM_ST.UI_STOP) Then
+ ' For Index = 0 To MachineAxisList.Count - 1
+ ' MachineAxisList(Index).IsReadOnlyAxesValue = False
+ ' Next
+ 'Else
+ ' For Index = 0 To MachineAxisList.Count - 1
+ ' MachineAxisList(Index).IsReadOnlyAxesValue = True
+ ' Next
+ 'End If
+ End Sub
+
+#End Region ' METHODS
+
+End Class
diff --git a/Icarus/SimulationPanel/SimulationPanelV.xaml b/Icarus/SimulationPanel/SimulationPanelV.xaml
new file mode 100644
index 0000000..0f07085
--- /dev/null
+++ b/Icarus/SimulationPanel/SimulationPanelV.xaml
@@ -0,0 +1,128 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Icarus/SimulationPanel/SimulationPanelV.xaml.vb b/Icarus/SimulationPanel/SimulationPanelV.xaml.vb
new file mode 100644
index 0000000..86bbc00
--- /dev/null
+++ b/Icarus/SimulationPanel/SimulationPanelV.xaml.vb
@@ -0,0 +1,3 @@
+Public Class SimulationPanelV
+
+End Class
diff --git a/Icarus/SimulationPanel/SimulationPanelVM.vb b/Icarus/SimulationPanel/SimulationPanelVM.vb
new file mode 100644
index 0000000..f806c4b
--- /dev/null
+++ b/Icarus/SimulationPanel/SimulationPanelVM.vb
@@ -0,0 +1,358 @@
+Imports System.Collections.ObjectModel
+Imports System.IO
+Imports EgtUILib
+Imports EgtWPFLib5
+
+Public Class SimulationPanelVM
+ Inherits VMBase
+
+#Region "FIELDS & PROPERTIES"
+
+ Public Enum MachViews As Integer
+ TOOL = 0
+ HEAD = 1
+ MACHINE = 2
+ End Enum
+
+ Private m_dPrevAngVertDegView As Double
+ Private m_dPrevAngHorizDegView As Double
+
+ Private m_MySimul As MySimulation
+ Public Property MySimul As MySimulation
+ Get
+ Return m_MySimul
+ End Get
+ Set(value As MySimulation)
+ m_MySimul = value
+ NotifyPropertyChanged("MySimul")
+ End Set
+ End Property
+
+ Private m_MachViewList As New List(Of String)({"Tool", "Head", "Machine"})
+ Public ReadOnly Property MachViewList As List(Of String)
+ Get
+ Return m_MachViewList
+ End Get
+ End Property
+
+ Private m_nSelMachView As MachViews
+ Public Property nSelMachView As Integer
+ Get
+ Return m_nSelMachView
+ End Get
+ Set(value As Integer)
+ m_nSelMachView = value
+ Select Case m_nSelMachView
+ Case MachViews.TOOL
+ ToolMode()
+ Case MachViews.HEAD
+ HeadMode()
+ Case MachViews.MACHINE
+ MachMode()
+ End Select
+ End Set
+ End Property
+ Friend Sub SetSelMachView(value As MachViews)
+ nSelMachView = value
+ NotifyPropertyChanged(NameOf(nSelMachView))
+ End Sub
+
+ ' Definizione comandi
+ Private m_cmdOk As ICommand
+ Private m_cmdToolMode As ICommand
+ Private m_cmdHeadMode As ICommand
+ Private m_cmdMachMode As ICommand
+
+#Region "Messages"
+
+ Public ReadOnly Property MachViewMsg As String
+ Get
+ Return "View"
+ End Get
+ End Property
+
+#End Region ' Messages
+
+#Region "ToolTip"
+
+ Public ReadOnly Property OneStepToolTip As String
+ Get
+ Return EgtMsg(MSG_SIMULATION + 8)
+ End Get
+ End Property
+ Public ReadOnly Property PlayPauseToolTip As String
+ Get
+ Return EgtMsg(MSG_SIMULATION + 9)
+ End Get
+ End Property
+ Public ReadOnly Property StopHomeToolTip As String
+ Get
+ Return EgtMsg(MSG_SIMULATION + 10)
+ End Get
+ End Property
+
+#End Region ' ToolTip
+
+#End Region ' FIELDS & PROPERTIES
+
+#Region "CONSTRUCTOR"
+
+ Sub New()
+ ' Creo riferimento a questa classe in OmagOFFICEMap
+ Map.SetRefSimulationPanelVM(Me)
+ MySimul = New MySimulation
+ ' leggo vista macchina da ini e la imposto
+ SetSelMachView(MachViews.MACHINE)
+ End Sub
+
+#End Region ' CONSTRUCTOR
+
+#Region "METHODS"
+
+ Friend Sub Refresh(PrevMeasureUnit As MeasureUnitOpt)
+
+ End Sub
+
+ Friend Sub InitSimulation()
+
+
+ 'EgtSetCurrentContext(Map.refSceneHostVM.MainScene.GetCtx())
+ ' Disabilito Machine Panel (utensili, lavoraz...)
+ 'OmagOFFICEMap.refMachinePanelVM.MachPanel_IsEnabled = False
+ ' Deseleziono pezzi
+ EgtDeselectAll()
+ ' L'attrezzaggio utensili è verificato all'avvio simulazione (con attrezzaggio salvato)
+ ' Costringo ad aggiornare UI
+ UpdateUI()
+ '' Se non c'è ordine delle lavorazioni, ne faccio uno automatico
+ 'Dim bOk As Boolean = True
+ 'If Not EstCalc.GetOrderMachiningFlag() Then
+ ' ResetAllMachinings()
+ ' bOk = SortAllMachinings()
+ ' If bOk Then EstCalc.SetOrderMachiningFlag()
+ ' Dim bModif As Boolean = TestAllMachiningsForStrict()
+ ' If bModif Then
+ ' ' Ridotte alcune lavorazioni per evitare interferenze
+ ' OmagOFFICEMap.refStatusBarVM.SetOutputMessage(EgtMsg(90321), 3, MSG_TYPE.WARNING)
+ ' Else
+ ' ' Aggiornate tutte le lavorazioni
+ ' OmagOFFICEMap.refStatusBarVM.SetOutputMessage(EgtMsg(90399), 3, MSG_TYPE.INFO)
+ ' End If
+ 'End If
+ '' Costringo ad aggiornare UI
+ 'UpdateUI()
+ ' Disabilito impostazione modificato
+ EgtDisableModified()
+ '' Aggiorno le lavorazioni
+ 'bOk = UpdateAllMachiningsToolpaths() And bOk
+ '' Se errore in generazione, segnalo l'errore
+ 'If Not bOk Then
+ ' ' Errore nella generazione del programma CN
+ ' OmagOFFICEMap.refStatusBarVM.SetOutputMessage(EgtMsg(90314), MSG_TYPE.ERROR_)
+ 'End If
+ '' Eseguo la stima di tempi, lunghezze ...
+ 'Dim bEstim As Boolean = (GetPrivateProfileInt(S_MACH_ESTIMATIONS, K_ENABLEEST, 0, CurrentMachine.sMachIniFile) <> 0)
+ 'If bEstim Then
+ ' MyEstim.Estimation_IsEnabled = True
+ ' EgtSetCurrPhase(1)
+ ' EgtEstimate(OmagOFFICEMap.refMainWindowVM.MainWindowM.sTempDir & "\MachProj.html", "OmagCut ver." & OmagOFFICEMap.refMainWindowVM.MainWindowM.sVersion)
+ 'Else
+ ' MyEstim.Estimation_IsEnabled = False
+ 'End If
+ '' Impostazioni box stime
+ 'NotifyPropertyChanged("Time")
+ 'NotifyPropertyChanged("CutLen")
+ 'NotifyPropertyChanged("NetArea")
+ 'NotifyPropertyChanged("Usage")
+ '' Nascondo eventuali pezzi in parcheggio
+ 'HideParkedParts()
+ '' Nascondo eventuale contorno da foto
+ 'EstPhoto.ShowContour(False)
+ ' Imposto prima fase
+ EgtSetCurrPhase(1)
+ 'ShowAllCurrPhaseMachinings()
+ ' Costringo ad aggiornare UI
+ UpdateUI()
+ 'Cambio la vista della scena
+ EgtGetGenericView(m_dPrevAngVertDegView, m_dPrevAngHorizDegView)
+ EgtSetView(VT.ISO_SE, False)
+ MySimul.SetMachLook(MCH_LOOK.ALL)
+ EgtSetMachineLook(MySimul.GetMachLook())
+ EgtZoom(ZM.ALL)
+ ' Avvio ambiente di simulazione
+ If Not EgtSimInit() OrElse Not EgtSimStart() Then
+ If EgtGetLastMachMgrErrorId() <> 0 Then
+ Dim sErr As String = EgtGetLastMachMgrErrorString()
+ MessageBox.Show(sErr, EgtMsg(MSG_SIMULATION + 5), MessageBoxButton.OK, MessageBoxImage.Exclamation)
+ Else
+ MessageBox.Show(EgtMsg(MSG_MESSAGEBOX + 10), EgtMsg(MSG_SIMULATION + 5), MessageBoxButton.OK, MessageBoxImage.Error)
+ End If
+ End If
+ ' Imposto stato corrente
+ MySimul.SetSimulationStatus(MCH_SIM_ST.UI_STOP)
+ MySimul.SetShowPlay(True)
+ MySimul.SetSliderX(GetMainPrivateProfileDouble(S_SIMUL, K_SLIDERX, 1))
+ Dim SliderVal As Double = GetMainPrivateProfileDouble(S_SIMUL, K_SLIDERVAL, 10)
+ MySimul.SliderValue = SliderVal
+ ' Carico utensili specializzato
+ ' LoadCurrTools()
+ EgtDraw()
+ MySimul.ShowCncData()
+ MySimul.StatusMsg = EgtMsg(MSG_SIMULATIONPAGEUC + 14) ' Home
+ End Sub
+
+ Private Function LoadCurrTools() As Boolean
+ '' Se macchina con cambio utensile non devo fare alcunché
+ 'If CurrentMachine.MountedToolConfig = CurrentMachine.MountedToolConfigs.TOOLCHANGER Then
+ ' Return True
+ 'End If
+ '' Imposto la lama corrente
+ 'Dim sSaw As String = CurrentMachine.sCurrSaw
+ 'If Not EgtLoadTool("H1", 1, sSaw) Then
+ ' Return False
+ 'End If
+ '' Imposto eventuale secondo utensile montato
+ 'If CurrentMachine.MountedToolConfig = CurrentMachine.MountedToolConfigs.SAWANDAUXTOOL Then
+ ' Dim sTool As String = CurrentMachine.sCurrDrill
+ ' If String.IsNullOrEmpty(sTool) Then sTool = CurrentMachine.sCurrMill
+ ' If Not String.IsNullOrEmpty(sTool) AndAlso Not EgtLoadTool("H1", 2, sTool) Then
+ ' Return False
+ ' End If
+ 'End If
+ 'Return True
+ End Function
+
+ Friend Sub ExitSimulation()
+ Map.refMyStatusBarVM.ClearOutputMessage()
+ ' Mi assicuro di terminare la simulazione
+ MySimul.ResetSimulation()
+ ' Ripristino visibilità standard
+ MySimul.SetMachLook(MCH_LOOK.TAB)
+ EgtSetMachineLook(MySimul.GetMachLook())
+ '' Nascondo tutte le lavorazioni
+ 'CamAuto.HideAllMachinings()
+ ' Abilito impostazione modificato
+ EgtEnableModified()
+ ' Cambio la vista della scena
+ EgtSetGenericView(m_dPrevAngVertDegView, m_dPrevAngHorizDegView, False)
+ EgtZoom(ZM.ALL)
+ '' Riabilito Machine Panel (utensili, lavoraz...)
+ 'OmagOFFICEMap.refMachinePanelVM.MachPanel_IsEnabled = True
+ End Sub
+
+#End Region ' METHODS
+
+#Region "COMMANDS"
+
+#Region "Ok"
+
+ Public ReadOnly Property Ok_Command As ICommand
+ Get
+ If m_cmdOk Is Nothing Then
+ m_cmdOk = New Command(AddressOf Ok)
+ End If
+ Return m_cmdOk
+ End Get
+ End Property
+
+ Public Sub Ok()
+ ' reset gruppo
+ EgtResetCurrMachGroup()
+ ' eseguo script di uscita da gruppo corrente
+ Map.refSliceManagerVM.ExecExitMachScript()
+ ' ripristino modalita' standard
+ Map.refTopPanelVM.SelPage = Pages.SLICE
+ End Sub
+
+#End Region ' Ok
+
+#Region "ToolModeCommand"
+
+ '''
+ ''' Returns a command that create a new tool.
+ '''
+ Public ReadOnly Property ToolModeCommand As ICommand
+ Get
+ If m_cmdToolMode Is Nothing Then
+ m_cmdToolMode = New Command(AddressOf ToolMode)
+ End If
+ Return m_cmdToolMode
+ End Get
+ End Property
+
+ '''
+ ''' Creata the new tool. This method is invoked by the NewCommand.
+ '''
+ Public Sub ToolMode()
+ ' aggiorno lo stato
+ If MySimul.GetMachLook() <> MCH_LOOK.TAB_TOOL Then
+ MySimul.SetMachLook(MCH_LOOK.TAB_TOOL)
+ End If
+ ' aggiorno lo stato della macchina e la sua visualizzazione
+ EgtSetMachineLook(MySimul.GetMachLook())
+ EgtDraw()
+ End Sub
+
+#End Region ' ToolModeCommand
+
+#Region "HeadModeCommand"
+
+ '''
+ ''' Returns a command that create a new tool.
+ '''
+ Public ReadOnly Property HeadModeCommand As ICommand
+ Get
+ If m_cmdHeadMode Is Nothing Then
+ m_cmdHeadMode = New Command(AddressOf HeadMode)
+ End If
+ Return m_cmdHeadMode
+ End Get
+ End Property
+
+ '''
+ ''' Creata the new tool. This method is invoked by the NewCommand.
+ '''
+ Public Sub HeadMode()
+ ' aggiorno lo stato
+ If MySimul.GetMachLook() <> MCH_LOOK.TAB_HEAD Then
+ MySimul.SetMachLook(MCH_LOOK.TAB_HEAD)
+ End If
+ ' aggiorno lo stato della macchina e la sua visualizzazione
+ EgtSetMachineLook(MySimul.GetMachLook())
+ EgtDraw()
+ End Sub
+
+#End Region ' HeadModeCommand
+
+#Region "MachModeCommand"
+
+ '''
+ ''' Returns a command that create a new tool.
+ '''
+ Public ReadOnly Property MachModeCommand As ICommand
+ Get
+ If m_cmdMachMode Is Nothing Then
+ m_cmdMachMode = New Command(AddressOf MachMode)
+ End If
+ Return m_cmdMachMode
+ End Get
+ End Property
+
+ '''
+ ''' Creata the new tool. This method is invoked by the NewCommand.
+ '''
+ Public Sub MachMode()
+ ' aggiorno lo stato
+ If MySimul.GetMachLook() <> MCH_LOOK.ALL Then
+ MySimul.SetMachLook(MCH_LOOK.ALL)
+ End If
+ ' aggiorno lo stato della macchina e la sua visualizzazione
+ EgtSetMachineLook(MySimul.GetMachLook())
+ EgtDraw()
+ End Sub
+
+#End Region ' MachModeCommand
+
+#End Region ' COMMANDS
+
+End Class
diff --git a/Icarus/SliceManager/SliceManagerV.xaml b/Icarus/SliceManager/SliceManagerV.xaml
index 05a5d66..9b33c42 100644
--- a/Icarus/SliceManager/SliceManagerV.xaml
+++ b/Icarus/SliceManager/SliceManagerV.xaml
@@ -2,58 +2,45 @@
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Width="260">
-
+
-
-
+
+ Text="{Binding ghMass}"
+ Visibility="{Binding SliceMode_Visibility}"/>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
-
+
+
+
-
+ Visibility="{Binding SliceMode_Visibility}"/>
+
diff --git a/Icarus/SliceManager/SliceManagerVM.vb b/Icarus/SliceManager/SliceManagerVM.vb
index 34c1bdf..c9df832 100644
--- a/Icarus/SliceManager/SliceManagerVM.vb
+++ b/Icarus/SliceManager/SliceManagerVM.vb
@@ -9,6 +9,21 @@ Public Class SliceManagerVM
Private m_SliceManagerState As CalcStates
+ Private m_dMass As Double = 0
+ Public ReadOnly Property ghMass As String
+ Get
+ Return DoubleToString(m_dMass, 1) & " kg"
+ End Get
+ End Property
+
+ Private m_dTime As Double = 0
+ Public ReadOnly Property ghTime As String
+ Get
+ Dim dtTime As TimeSpan = TimeSpan.FromSeconds(m_dTime)
+ Return Math.Floor(dtTime.TotalHours) & "hours " & Math.Floor(dtTime.Minutes) & "min " & Math.Ceiling(dtTime.Seconds) & "sec"
+ End Get
+ End Property
+
Private m_Loading_Value As Integer = 0
Public Property Loading_Value As Integer
Get
@@ -37,34 +52,18 @@ Public Class SliceManagerVM
NotifyPropertyChanged(NameOf(Loading_Visibility))
End Sub
- Private m_SimGen_Visibility As Visibility = Visibility.Collapsed
- Public Property SimGen_Visibility As Visibility
+ Private m_ModifyMode_Visibility As Visibility = Visibility.Collapsed
+ Public ReadOnly Property ModifyMode_Visibility As Visibility
Get
- Return m_SimGen_Visibility
+ Return m_ModifyMode_Visibility
End Get
- Set(value As Visibility)
- m_SimGen_Visibility = value
- End Set
End Property
- Private m_Slice_Visibility As Visibility = Visibility.Collapsed
- Public Property Slice_Visibility As Visibility
+ Private m_SliceMode_Visibility As Visibility = Visibility.Collapsed
+ Public ReadOnly Property SliceMode_Visibility As Visibility
Get
- Return m_Slice_Visibility
+ Return m_SliceMode_Visibility
End Get
- Set(value As Visibility)
- m_Slice_Visibility = value
- End Set
- End Property
-
- Private m_SliceExit_Visibility As Visibility = Visibility.Collapsed
- Public Property SliceExit_Visibility As Visibility
- Get
- Return m_SliceExit_Visibility
- End Get
- Set(value As Visibility)
- m_SliceExit_Visibility = value
- End Set
End Property
' Definizione comandi
@@ -89,17 +88,14 @@ Public Class SliceManagerVM
Friend Sub UpdateState(bState As Boolean)
If bState Then
- m_Slice_Visibility = Visibility.Collapsed
- m_SliceExit_Visibility = Visibility.Visible
- m_SimGen_Visibility = Visibility.Visible
+ m_ModifyMode_Visibility = Visibility.Collapsed
+ m_SliceMode_Visibility = Visibility.Visible
Else
- m_Slice_Visibility = Visibility.Visible
- m_SliceExit_Visibility = Visibility.Hidden
- m_SimGen_Visibility = Visibility.Collapsed
+ m_ModifyMode_Visibility = Visibility.Visible
+ m_SliceMode_Visibility = Visibility.Collapsed
End If
- NotifyPropertyChanged(NameOf(Slice_Visibility))
- NotifyPropertyChanged(NameOf(SliceExit_Visibility))
- NotifyPropertyChanged(NameOf(SimGen_Visibility))
+ NotifyPropertyChanged(NameOf(ModifyMode_Visibility))
+ NotifyPropertyChanged(NameOf(SliceMode_Visibility))
End Sub
Private Function ProcessEvents(ByVal nProg As Integer, ByVal nPause As Integer) As Integer
@@ -124,16 +120,99 @@ Public Class SliceManagerVM
'End If
End Function
- Friend Sub CalcSlice(bSlice As Boolean, bCalcTFS As Boolean)
+ Friend Function CalcSlice(bSlice As Boolean, bCalcTFS As Boolean, bGenerate As Boolean) As Boolean
+ Dim bok As Boolean = True
If bCalcTFS Then Map.refTFSEditorVM.UpdateSpeedMinMax()
' eseguo file Lua
SetLoadingVisibility(True)
- ExecSlice(bSlice, bCalcTFS)
+ bok = ExecSlice(bSlice, bCalcTFS)
SetLoadingVisibility(False)
+ If bSlice Then
+ ' aggiorno massa
+ Dim nLayTFSCalcId As Integer = EgtGetFirstNameInGroup(GDB_ID.ROOT, LAY_TFSCALC)
+ EgtGetInfo(nLayTFSCalcId, KEY_MASS, m_dMass)
+ NotifyPropertyChanged(NameOf(ghMass))
+ End If
Map.refTFSEditorVM.Refresh()
Map.refTopPanelVM.SelPart.RefreshPrintLayers()
+ If bGenerate Then
+ ' verifico esistenza e correttezza machgroup
+ InitMachGroup(True)
+ ' eseguo file Lua
+ bok = bok AndAlso ExecGenerate()
+ EgtGetInfo(EgtGetFirstMachGroup(), "Ttot", m_dTime)
+ NotifyPropertyChanged(NameOf(ghTime))
+ ' eseguo script di uscita da gruppo corrente
+ ExecExitMachScript()
+ End If
+ Return bok
+ End Function
+
+ Friend Sub InitMachGroup(bGenerate As Boolean)
+ ' esecuzione script prima di inizio Mach
+ ExecInitMachScript()
+ If bGenerate Then
+ Dim nMachGroupId As Integer = EgtGetFirstMachGroup()
+ While nMachGroupId <> GDB_ID.NULL
+ EgtRemoveMachGroup(nMachGroupId)
+ nMachGroupId = EgtGetFirstMachGroup()
+ End While
+ ' Definisco e posiziono il grezzo sulla tavola
+ EgtAddMachGroup("3dPrint")
+ EgtSetTable("Tab")
+ For Each CurrPart In Map.refTopPanelVM.PartList
+ Dim b3Part As New BBox3d
+ Dim b3PrintSolid As New BBox3d
+ EgtGetBBoxGlob(CurrPart.nPartId, GDB_BB.STANDARD, b3Part)
+ EgtGetBBoxGlob(CurrPart.nPrintSolidId, GDB_BB.STANDARD, b3PrintSolid)
+ Dim nRawId As Integer = EgtAddRawPart(b3PrintSolid.Min, b3PrintSolid.DimX, b3PrintSolid.DimY, b3PrintSolid.DimZ, New Color3d(128, 128, 128, 30))
+ EgtAddPartToRawPart(CurrPart.nPartId, Point3d.ORIG() + (b3Part.Min - b3PrintSolid.Min), nRawId)
+ EgtMoveToCornerRawPart(nRawId, b3PrintSolid.Min, MCH_CR.BL)
+ Next
+ EgtResetCurrMachGroup()
+ Else
+ EgtSetCurrMachGroup(EgtGetFirstMachGroup())
+ End If
End Sub
+ Private Function ExecInitMachScript() As Boolean
+ ' Recupero il nome dello script e verifico esista
+ Dim sInitMachScriptPath As String = ""
+ If EgtUILib.GetPrivateProfileString(S_MACHINING, K_MACH_INITSCRIPT, "", sInitMachScriptPath, CurrentMachine.sMachIniFile) = 0 Then Return True
+ sInitMachScriptPath = (CurrentMachine.sMachScriptDir & "\" & sInitMachScriptPath).TrimEnd({"\"c})
+ If Not My.Computer.FileSystem.FileExists(sInitMachScriptPath) Then Return True
+ ' Eseguo lo script
+ EgtLuaCreateGlobTable("MACH")
+ If Not EgtLuaExecFile(sInitMachScriptPath) Then
+ EgtOutLog("Error executing Machining init script " & sInitMachScriptPath)
+ MessageBox.Show(EgtMsg(5463) & " " & sInitMachScriptPath, EgtMsg(5461), MessageBoxButton.OK, MessageBoxImage.Error)
+ Return False
+ End If
+ Dim nErr As Integer = 999
+ EgtLuaGetGlobIntVar("MACH.ERR", nErr)
+ EgtLuaResetGlobVar("MACH")
+ Return nErr = 0
+ End Function
+
+ Friend Function ExecExitMachScript() As Boolean
+ ' Recupero il nome dello script e verifico esista
+ Dim sExitMachScriptPath As String = ""
+ If EgtUILib.GetPrivateProfileString(S_MACHINING, K_MACH_EXITSCRIPT, "", sExitMachScriptPath, CurrentMachine.sMachIniFile) = 0 Then Return True
+ sExitMachScriptPath = CurrentMachine.sMachScriptDir & "\" & sExitMachScriptPath
+ If Not My.Computer.FileSystem.FileExists(sExitMachScriptPath) Then Return True
+ ' Eseguo lo script
+ EgtLuaCreateGlobTable("MACH")
+ If Not EgtLuaExecFile(sExitMachScriptPath) Then
+ EgtOutLog("Error executing Machining exit script " & sExitMachScriptPath)
+ MessageBox.Show(EgtMsg(5464) & " " & sExitMachScriptPath, EgtMsg(5461), MessageBoxButton.OK, MessageBoxImage.Error)
+ Return False
+ End If
+ Dim nErr As Integer = 999
+ EgtLuaGetGlobIntVar("MACH.ERR", nErr)
+ EgtLuaResetGlobVar("MACH")
+ Return nErr = 0
+ End Function
+
#End Region ' METHODS
#Region "COMMANDS"
@@ -167,60 +246,14 @@ Public Class SliceManagerVM
If Map.refTopPanelVM.SelPage <> Pages.SLICE Then
End If
- ' eseguo file Lua
- CalcSlice(True, True)
+ ' eseguo calcoli
+ CalcSlice(True, True, True)
Map.refTopPanelVM.SelPage = Pages.SLICE
Map.refSliderManagerVM.SetLayerIndexToMax()
End Sub
#End Region ' Slice
-#Region "Exit"
-
- '''
- ''' Returns a command that do CPlaneTop.
- '''
- Public ReadOnly Property Exit_Command As ICommand
- Get
- If m_cmdExit Is Nothing Then
- m_cmdExit = New Command(AddressOf ExitCmd)
- End If
- Return m_cmdExit
- End Get
- End Property
-
- '''
- ''' Execute the CPlaneTop. This method is invoked by the CPlaneTopCommand.
- '''
- Public Sub ExitCmd()
- Map.refTopPanelVM.SelPage = Pages.MODIFY
- End Sub
-
-#End Region ' Exit
-
-#Region "Simulate"
-
- '''
- ''' Returns a command that do CPlaneTop.
- '''
- Public ReadOnly Property Simulate_Command As ICommand
- Get
- If m_cmdSimulate Is Nothing Then
- m_cmdSimulate = New Command(AddressOf Simulate)
- End If
- Return m_cmdSimulate
- End Get
- End Property
-
- '''
- ''' Execute the CPlaneTop. This method is invoked by the CPlaneTopCommand.
- '''
- Public Sub Simulate()
-
- End Sub
-
-#End Region ' Simulate
-
#Region "Generate"
'''
@@ -239,12 +272,66 @@ Public Class SliceManagerVM
''' Execute the CPlaneTop. This method is invoked by the CPlaneTopCommand.
'''
Public Sub Generate()
- ' eseguo file Lua
- ExecGenerate()
+ ' eseguo calcoli
+ CalcSlice(False, True, True)
End Sub
#End Region ' Generate
+#Region "Simulate"
+
+ '''
+ ''' Returns a command that do CPlaneTop.
+ '''
+ Public ReadOnly Property Simulate_Command As ICommand
+ Get
+ If m_cmdSimulate Is Nothing Then
+ m_cmdSimulate = New Command(AddressOf Simulate)
+ End If
+ Return m_cmdSimulate
+ End Get
+ End Property
+
+ '''
+ ''' Execute the CPlaneTop. This method is invoked by the CPlaneTopCommand.
+ '''
+ Public Sub Simulate()
+ ' verifico esistenza e correttezza machgroup
+ InitMachGroup(False)
+ ' apro simulazione
+ Map.refRightPanelVM.SetSelPanel(RightPanelVM.Panels.SIMULATION)
+ End Sub
+
+#End Region ' Simulate
+
+#Region "Exit"
+
+ '''
+ ''' Returns a command that do CPlaneTop.
+ '''
+ Public ReadOnly Property Exit_Command As ICommand
+ Get
+ If m_cmdExit Is Nothing Then
+ m_cmdExit = New Command(AddressOf ExitCmd)
+ End If
+ Return m_cmdExit
+ End Get
+ End Property
+
+ '''
+ ''' Execute the CPlaneTop. This method is invoked by the CPlaneTopCommand.
+ '''
+ Public Sub ExitCmd()
+ ' se in simulazione
+ If Map.refRightPanelVM.SelPanel = RightPanelVM.Panels.SIMULATION Then
+ ' la chiudo
+ Map.refSimulationPanelVM.Ok()
+ End If
+ Map.refTopPanelVM.SelPage = Pages.MODIFY
+ End Sub
+
+#End Region ' Exit
+
#End Region ' COMMANDS
End Class
diff --git a/Icarus/TSFEditor/TFSEditorVM.vb b/Icarus/TSFEditor/TFSEditorVM.vb
index cb4804e..e973bc3 100644
--- a/Icarus/TSFEditor/TFSEditorVM.vb
+++ b/Icarus/TSFEditor/TFSEditorVM.vb
@@ -311,15 +311,15 @@ Public Class TFSEditorVM
For Each SelLayer In m_SelLayers
SelIndexList.Add(SelLayer.nIndex)
Next
- ' ricalcolo valori
- Map.refSliceManagerVM.CalcSlice(False, True)
- ' ripristino layer selezionati
- For Each Index In SelIndexList
- Dim NewLayer As TFSLayer = m_LayerList.FirstOrDefault(Function(x) x.nIndex = Index)
- If Not IsNothing(NewLayer) Then
- m_SelLayers.Add(NewLayer)
- End If
- Next
+ '' ricalcolo valori
+ 'Map.refSliceManagerVM.CalcSlice(False, True)
+ '' ripristino layer selezionati
+ 'For Each Index In SelIndexList
+ ' Dim NewLayer As TFSLayer = m_LayerList.FirstOrDefault(Function(x) x.nIndex = Index)
+ ' If Not IsNothing(NewLayer) Then
+ ' m_SelLayers.Add(NewLayer)
+ ' End If
+ 'Next
End Sub
#End Region ' Set
@@ -403,15 +403,15 @@ Public Class TFSEditorVM
For Each SelLayer In m_SelLayers
SelIndexList.Add(SelLayer.nIndex)
Next
- ' ricalcolo valori
- Map.refSliceManagerVM.CalcSlice(False, True)
- ' ripristino layer selezionati
- For Each Index In SelIndexList
- Dim NewLayer As TFSLayer = m_LayerList.FirstOrDefault(Function(x) x.nIndex = Index)
- If Not IsNothing(NewLayer) Then
- m_SelLayers.Add(NewLayer)
- End If
- Next
+ '' ricalcolo valori
+ 'Map.refSliceManagerVM.CalcSlice(False, True)
+ '' ripristino layer selezionati
+ 'For Each Index In SelIndexList
+ ' Dim NewLayer As TFSLayer = m_LayerList.FirstOrDefault(Function(x) x.nIndex = Index)
+ ' If Not IsNothing(NewLayer) Then
+ ' m_SelLayers.Add(NewLayer)
+ ' End If
+ 'Next
End Sub
#End Region ' Media
@@ -437,7 +437,7 @@ Public Class TFSEditorVM
' cancello gruppo della tabella
Dim nLayTFSCalcId As Integer = EgtGetFirstNameInGroup(GDB_ID.ROOT, LAY_TFSCALC)
EgtEmptyGroup(nLayTFSCalcId)
- Map.refSliceManagerVM.CalcSlice(False, True)
+ Map.refSliceManagerVM.CalcSlice(False, True, True)
End Sub
#End Region ' Reset
diff --git a/Icarus/Utility/CurrentMachine.vb b/Icarus/Utility/CurrentMachine.vb
index 82775e8..2c0848e 100644
--- a/Icarus/Utility/CurrentMachine.vb
+++ b/Icarus/Utility/CurrentMachine.vb
@@ -12,6 +12,8 @@ Public Module CurrentMachine
Private m_sMachDir As String = String.Empty
' File ini della macchina
Private m_sMachIniFile As String = String.Empty
+ ' File script della macchina
+ Private m_sMachScriptDir As String = String.Empty
' box della tavola macchina
Private m_b3Tab As New BBox3d
@@ -40,6 +42,12 @@ Public Module CurrentMachine
End Get
End Property
+ Friend ReadOnly Property sMachScriptDir As String
+ Get
+ Return m_sMachScriptDir
+ End Get
+ End Property
+
#End Region
#Region "Init"
@@ -51,6 +59,8 @@ Public Module CurrentMachine
m_sMachDir = sMachinesRootDir & "\" & sMachineName
' Impostazione path MachIni file
m_sMachIniFile = sMachinesRootDir & "\" & sMachineName & "\" & sMachineName & ".ini"
+ ' impostazione cartella script
+ m_sMachScriptDir = sMachinesRootDir & "\" & sMachineName & "\Scripts"
' Disabilito segnalazione modificato
Dim DisableMgr As New DisableModifiedMgr
' recupero box macchina
@@ -82,11 +92,11 @@ Public Module CurrentMachine
EgtSetLevel(nTabPartId, GDB_LV.SYSTEM)
EgtSetMode(nTabPartId, GDB_MD.LOCKED)
EgtSetStatus(nTabPartId, GDB_ST.ON_)
- EgtSetName(nTabPartId, "TABLE")
+ EgtSetName(nTabPartId, TABLE)
Dim nTabLayerId As Integer = EgtCreateGroup(nTabPartId)
- EgtSetName(nTabLayerId, "TABLE")
+ EgtSetName(nTabLayerId, TABLE)
Dim nTabOutlineId As Integer = EgtCreateRectangle2P(nTabLayerId, New Point3d(0, 0, 0), New Point3d(dTabX, dTabY, 0))
- EgtSetName(nTabOutlineId, "TABLE_OUTLINE")
+ EgtSetName(nTabOutlineId, TABLE_OUTLINE)
' Ripristino stato segnalazione modifica
DisableMgr.ReEnable()
End Sub
diff --git a/Icarus/Utility/Dictionary.xaml b/Icarus/Utility/Dictionary.xaml
index 645d81f..b071d45 100644
--- a/Icarus/Utility/Dictionary.xaml
+++ b/Icarus/Utility/Dictionary.xaml
@@ -39,6 +39,7 @@
+