Merge branch 'FlowDocument'
This commit is contained in:
@@ -242,13 +242,14 @@ Public Class MySceneHostVM
|
||||
|
||||
#Region "ProjectManager"
|
||||
|
||||
Public Overrides Sub NewProject()
|
||||
Public Overrides Function NewProject() As Boolean
|
||||
EgtSetCurrentContext(MainScene.GetCtx())
|
||||
Dim bOk As Boolean = MainController.NewProject()
|
||||
MainScene.SetStatusNull()
|
||||
End Sub
|
||||
Return bOk
|
||||
End Function
|
||||
|
||||
Public Overrides Sub OpenProject(sFilePath As String)
|
||||
Public Overrides Function OpenProject(sFilePath As String) As Boolean
|
||||
EgtSetCurrentContext(MainScene.GetCtx())
|
||||
Dim bOk As Boolean = False
|
||||
If String.IsNullOrEmpty(sFilePath) Then
|
||||
@@ -267,7 +268,7 @@ Public Class MySceneHostVM
|
||||
.FilterIndex = 1,
|
||||
.InitialDirectory = sDir
|
||||
}
|
||||
If Not OpenFileDialog.ShowDialog() = Windows.Forms.DialogResult.OK Then Return
|
||||
If Not OpenFileDialog.ShowDialog() = Windows.Forms.DialogResult.OK Then Return False
|
||||
sFilePath = OpenFileDialog.FileName
|
||||
End If
|
||||
bOk = MainController.OpenProject(sFilePath, False)
|
||||
@@ -275,19 +276,22 @@ Public Class MySceneHostVM
|
||||
MainScene.SetStatusNull()
|
||||
' imposto modalita' import
|
||||
Map.refTopPanelVM.SelPage = Pages.NULL
|
||||
End Sub
|
||||
Return bOk
|
||||
End Function
|
||||
|
||||
Public Overrides Sub SaveProject()
|
||||
Public Overrides Function SaveProject() As Boolean
|
||||
' Se nome progetto non definito o con estensione non valida lo chiedo
|
||||
Dim sCurrFile As String = ""
|
||||
EgtGetCurrFilePath(sCurrFile)
|
||||
Dim bOk As Boolean = False
|
||||
If String.IsNullOrWhiteSpace(sCurrFile) Or EgtGetFileType(sCurrFile) <> FT.NGE Then
|
||||
SaveAsProject()
|
||||
bOk = SaveAsProject()
|
||||
Else
|
||||
Dim bDeleteNgeFile As Boolean = Path.GetExtension(sCurrFile) = ".nge"
|
||||
EgtSetCurrFilePath(Path.ChangeExtension(sCurrFile, "icrs"))
|
||||
' Salvataggio standard
|
||||
If MainController.SaveProject() AndAlso bDeleteNgeFile AndAlso File.Exists(sCurrFile) Then
|
||||
bOk = MainController.SaveProject()
|
||||
If bOk AndAlso bDeleteNgeFile AndAlso File.Exists(sCurrFile) Then
|
||||
Try
|
||||
File.Delete(sCurrFile)
|
||||
Catch ex As Exception
|
||||
@@ -297,12 +301,14 @@ Public Class MySceneHostVM
|
||||
End If
|
||||
' Imposto stato gestione mouse diretto della scena a nessuno
|
||||
MainScene.SetStatusNull()
|
||||
End Sub
|
||||
Return bOk
|
||||
End Function
|
||||
|
||||
Public Overrides Sub SaveAsProject()
|
||||
Public Overrides Function SaveAsProject() As Boolean
|
||||
m_bIsSaveAs = True
|
||||
Dim sFile As String = ""
|
||||
EgtGetCurrFilePath(sFile)
|
||||
Dim bOk As Boolean = False
|
||||
' Se nome vuoto, assegno "New"
|
||||
If String.IsNullOrWhiteSpace(sFile) Then sFile = "New.icrs"
|
||||
' Eventuale sistemazione estensione
|
||||
@@ -318,15 +324,15 @@ Public Class MySceneHostVM
|
||||
Dim sFileName As String = SaveFileDialog.FileName
|
||||
EgtSetCurrFilePath(sFileName)
|
||||
' Salvataggio standard
|
||||
MainController.SaveProject()
|
||||
bOk = MainController.SaveProject()
|
||||
End If
|
||||
m_bIsSaveAs = False
|
||||
' Imposto stato gestione mouse diretto della scena a nessuno
|
||||
MainScene.SetStatusNull()
|
||||
End Sub
|
||||
Return bOk
|
||||
End Function
|
||||
|
||||
Public Overrides Sub InsertProject()
|
||||
' eseguo
|
||||
Public Overrides Function InsertProject() As Boolean
|
||||
' Recupero cartella dell'ultimo progetto aperto
|
||||
Dim sDir As String = MainController.GetCurrFile()
|
||||
If String.IsNullOrWhiteSpace(sDir) Then
|
||||
@@ -347,7 +353,7 @@ Public Class MySceneHostVM
|
||||
.FilterIndex = ExtIndex,
|
||||
.InitialDirectory = sDir}
|
||||
If Not OpenFileDialog.ShowDialog Then
|
||||
Return
|
||||
Return False
|
||||
End If
|
||||
WriteMainPrivateProfileString(S_PRINTING3D, K_IMPORTCURREXTENSION, OpenFileDialog.FilterIndex)
|
||||
Dim sFile As String = String.Empty
|
||||
@@ -365,7 +371,8 @@ Public Class MySceneHostVM
|
||||
Dim ImportLoadingWnd As ImportLoadingWndV = New ImportLoadingWndV(Application.Current.MainWindow, New ImportLoadingWndVM)
|
||||
ImportLoadingWnd.Show()
|
||||
' importo la nuova geometria
|
||||
If MainController.InsertProject(sFile, False) Then
|
||||
Dim bOk As Boolean = MainController.InsertProject(sFile, False)
|
||||
If bOk Then
|
||||
Map.refViewLayerManagerVM.SetViewLayerManagerIsEnabled(True)
|
||||
' la sposto in centro tavola
|
||||
Dim nNewPartId As Integer = EgtGetLastPart()
|
||||
@@ -386,9 +393,10 @@ Public Class MySceneHostVM
|
||||
' chiudo finestra di caricamento
|
||||
ImportLoadingWnd.Close()
|
||||
EgtDraw()
|
||||
End Sub
|
||||
Return bOk
|
||||
End Function
|
||||
|
||||
Public Sub InsertRib()
|
||||
Public Function InsertRib() As Boolean
|
||||
' Recupero cartella dell'ultimo progetto aperto
|
||||
Dim sDir As String = MainController.GetCurrFile()
|
||||
If String.IsNullOrWhiteSpace(sDir) Then
|
||||
@@ -408,12 +416,13 @@ Public Class MySceneHostVM
|
||||
.FilterIndex = 1,
|
||||
.InitialDirectory = sDir}
|
||||
If Not OpenFileDialog.ShowDialog Then
|
||||
Return
|
||||
Return False
|
||||
End If
|
||||
Dim sFile As String = String.Empty
|
||||
sFile = OpenFileDialog.FileName
|
||||
' importo la nuova geometria
|
||||
If MainController.InsertProject(sFile, False) Then
|
||||
Dim bOk As Boolean = MainController.InsertProject(sFile, False)
|
||||
If bOk Then
|
||||
' sposto le nuove geometrie nel layer rib del pezzo
|
||||
Dim nNewPartId As Integer = EgtGetLastPart()
|
||||
Dim nNewLayerId As Integer = EgtGetFirstGroupInGroup(nNewPartId)
|
||||
@@ -455,9 +464,10 @@ Public Class MySceneHostVM
|
||||
' Imposto flag di ricalcolo slice
|
||||
EgtSetInfo(Map.refTopPanelVM.SelPart.nPartId, MAC_TORECALC_SLICE, True)
|
||||
End If
|
||||
End Sub
|
||||
Return bOk
|
||||
End Function
|
||||
|
||||
Public Sub InsertPrint(MenuItem As ManagerLayer_MenuItem)
|
||||
Public Function InsertPrint(MenuItem As ManagerLayer_MenuItem) As Boolean
|
||||
' Recupero cartella dell'ultimo progetto aperto
|
||||
Dim sDir As String = MainController.GetCurrFile()
|
||||
If String.IsNullOrWhiteSpace(sDir) Then
|
||||
@@ -477,12 +487,13 @@ Public Class MySceneHostVM
|
||||
.FilterIndex = 1,
|
||||
.InitialDirectory = sDir}
|
||||
If Not OpenFileDialog.ShowDialog Then
|
||||
Return
|
||||
Return False
|
||||
End If
|
||||
Dim sFile As String = String.Empty
|
||||
sFile = OpenFileDialog.FileName
|
||||
' importo la nuova geometria
|
||||
If MainController.InsertProject(sFile, False) Then
|
||||
Dim bOk As Boolean = MainController.InsertProject(sFile, False)
|
||||
If bOk Then
|
||||
' sposto le nuove geometrie nel layer rib del pezzo
|
||||
Dim nNewPartId As Integer = EgtGetLastPart()
|
||||
Dim nNewLayerId As Integer = EgtGetFirstGroupInGroup(nNewPartId)
|
||||
@@ -511,9 +522,10 @@ Public Class MySceneHostVM
|
||||
EgtErase(nNewPartId)
|
||||
EgtDraw()
|
||||
End If
|
||||
End Sub
|
||||
Return bOk
|
||||
End Function
|
||||
|
||||
Public Sub InsertShellNumber()
|
||||
Public Function InsertShellNumber() As Boolean
|
||||
' Recupero cartella dell'ultimo progetto aperto
|
||||
Dim sDir As String = MainController.GetCurrFile()
|
||||
If String.IsNullOrWhiteSpace(sDir) Then
|
||||
@@ -533,12 +545,13 @@ Public Class MySceneHostVM
|
||||
.FilterIndex = 1,
|
||||
.InitialDirectory = sDir}
|
||||
If Not OpenFileDialog.ShowDialog Then
|
||||
Return
|
||||
Return False
|
||||
End If
|
||||
Dim sFile As String = String.Empty
|
||||
sFile = OpenFileDialog.FileName
|
||||
' importo la nuova geometria
|
||||
If MainController.InsertProject(sFile, False) Then
|
||||
Dim bOk As Boolean = MainController.InsertProject(sFile, False)
|
||||
If bOk Then
|
||||
' sposto le nuove geometrie nel layer ShellNumber del pezzo
|
||||
Dim nNewPartId As Integer = EgtGetLastPart()
|
||||
Dim nNewLayerId As Integer = EgtGetFirstGroupInGroup(nNewPartId)
|
||||
@@ -580,9 +593,10 @@ Public Class MySceneHostVM
|
||||
' Imposto flag di ricalcolo slice
|
||||
EgtSetInfo(Map.refTopPanelVM.SelPart.nPartId, MAC_TORECALC_SLICE, True)
|
||||
End If
|
||||
End Sub
|
||||
Return bOk
|
||||
End Function
|
||||
|
||||
Public Sub InsertFilledSolid()
|
||||
Public Function InsertFilledSolid() As Boolean
|
||||
' Recupero cartella dell'ultimo progetto aperto
|
||||
Dim sDir As String = MainController.GetCurrFile()
|
||||
If String.IsNullOrWhiteSpace(sDir) Then
|
||||
@@ -602,12 +616,13 @@ Public Class MySceneHostVM
|
||||
.FilterIndex = 1,
|
||||
.InitialDirectory = sDir}
|
||||
If Not OpenFileDialog.ShowDialog Then
|
||||
Return
|
||||
Return False
|
||||
End If
|
||||
Dim sFile As String = String.Empty
|
||||
sFile = OpenFileDialog.FileName
|
||||
' importo la nuova geometria
|
||||
If MainController.InsertProject(sFile, False) Then
|
||||
Dim bOk As Boolean = MainController.InsertProject(sFile, False)
|
||||
If bOk Then
|
||||
' sposto le nuove geometrie nel layer ShellNumber del pezzo
|
||||
Dim nNewPartId As Integer = EgtGetLastPart()
|
||||
Dim nNewLayerId As Integer = EgtGetFirstGroupInGroup(nNewPartId)
|
||||
@@ -649,21 +664,10 @@ Public Class MySceneHostVM
|
||||
' Imposto flag di ricalcolo slice
|
||||
EgtSetInfo(Map.refTopPanelVM.SelPart.nPartId, MAC_TORECALC_SLICE, True)
|
||||
End If
|
||||
End Sub
|
||||
Return bOk
|
||||
End Function
|
||||
|
||||
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
|
||||
|
||||
Public Overrides Sub ExportProject()
|
||||
Public Overrides Function ExportProject() As Boolean
|
||||
' Reset controller e scena
|
||||
MainController.ResetStatus()
|
||||
'Assegnazione nome file con dialogo
|
||||
@@ -675,18 +679,19 @@ Public Class MySceneHostVM
|
||||
.FileName = Path.ChangeExtension(MainController.GetCurrFile(), "").TrimEnd("."c)
|
||||
}
|
||||
Dim DialogResult As Boolean? = SaveFileDialog.ShowDialog
|
||||
If IsNothing(DialogResult) OrElse Not DialogResult Then Return
|
||||
If IsNothing(DialogResult) OrElse Not DialogResult Then Return False
|
||||
MainController.SetDefaultFilterForExport(EEX_FLT.DEFAULT + EEX_FLT.LEV_TEMP)
|
||||
MainController.ExportProject(SaveFileDialog.FileName, False)
|
||||
End Sub
|
||||
Return MainController.ExportProject(SaveFileDialog.FileName, False)
|
||||
End Function
|
||||
|
||||
Friend Shadows Sub ExecScript(sFilePath As String)
|
||||
Public Overrides Function ExecScript(sFilePath As String) As Boolean
|
||||
Dim bOk As Boolean = False
|
||||
If String.IsNullOrEmpty(sFilePath) Then
|
||||
Dim sDir As String = String.Empty
|
||||
'GetMainPrivateProfileString(S_GENERAL, K_LASTLUADIR, "", sDir)
|
||||
MainController.Exec(sDir)
|
||||
bOk = MainController.Exec(sDir)
|
||||
Else
|
||||
MainController.Exec(sFilePath, False)
|
||||
bOk = MainController.Exec(sFilePath, False)
|
||||
End If
|
||||
Dim bMachiningMode As Boolean = EgtGetCurrMachGroup() <> GDB_ID.NULL
|
||||
If Not bMachiningMode And EgtGetCurrLayer() = GDB_ID.NULL Then
|
||||
@@ -695,7 +700,8 @@ Public Class MySceneHostVM
|
||||
EgtResetCurrPartLayer()
|
||||
End If
|
||||
End If
|
||||
End Sub
|
||||
Return bOk
|
||||
End Function
|
||||
|
||||
#End Region ' ProjectManager
|
||||
|
||||
|
||||
@@ -308,11 +308,7 @@ Public Class ViewLayer
|
||||
Case ViewLayerType.AUX_SOLIDS
|
||||
nStatus = GetMainPrivateProfileInt(S_VIEWLAYER, K_SLC_AUXSOLIDS, 1)
|
||||
Case ViewLayerType.SOLID_SLICE
|
||||
If Map.refSliceManagerVM.bCalculating AndAlso Map.refSliceManagerVM.bSlice Then
|
||||
nStatus = 1
|
||||
Else
|
||||
nStatus = GetMainPrivateProfileInt(S_VIEWLAYER, K_SLC_SOLIDSLICE, 1)
|
||||
End If
|
||||
nStatus = GetMainPrivateProfileInt(S_VIEWLAYER, K_SLC_SOLIDSLICE, 1)
|
||||
Case ViewLayerType.SLICE_TOOLPATH
|
||||
If Map.refSliceManagerVM.bCalculating AndAlso Map.refSliceManagerVM.bSlice Then
|
||||
nStatus = 1
|
||||
|
||||
Reference in New Issue
Block a user