|
|
|
@@ -49,9 +49,8 @@ Public Class MySceneHostVM
|
|
|
|
|
AddHandler MainController.OnOpenProject, AddressOf OnOpenProject
|
|
|
|
|
AddHandler MainController.OnSavingProject, AddressOf OnSavingProject
|
|
|
|
|
AddHandler MainController.OnSavedProject, AddressOf OnSavedProject
|
|
|
|
|
AddHandler MainController.OnInsertingProject, AddressOf OnInsertingProject
|
|
|
|
|
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
|
|
|
|
@@ -83,17 +82,32 @@ Public Class MySceneHostVM
|
|
|
|
|
' 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)
|
|
|
|
|
If Not EgtGetNetHwKey() Then
|
|
|
|
|
EgtOutLog("Missing Dongle")
|
|
|
|
|
' Box di avviso chiave mancante : "Chiave non presente. \n Inserirla e riavviare il programma." "Errore"
|
|
|
|
|
Dim sText As String = EgtMsg(10102) & vbCrLf & EgtMsg(10103)
|
|
|
|
|
Dim sTitle As String = EgtMsg(10101)
|
|
|
|
|
MessageBox.Show(sText, sTitle, MessageBoxButton.OK, MessageBoxImage.Error)
|
|
|
|
|
Else
|
|
|
|
|
EgtOutLog("NetDongle is full")
|
|
|
|
|
' Box di avviso slot chiave di rete occupato : "Chiave di Rete completamente occupata. \n Uscire dal programma su un altro PC." "Errore"
|
|
|
|
|
Dim sText As String = EgtMsg(10110) & vbCrLf & EgtMsg(10111)
|
|
|
|
|
Dim sTitle As String = EgtMsg(10101)
|
|
|
|
|
MessageBox.Show(sText, sTitle, MessageBoxButton.OK, MessageBoxImage.Error)
|
|
|
|
|
End If
|
|
|
|
|
' Se altrimenti manca il collegamento con la chiave di rete
|
|
|
|
|
ElseIf Map.refMainWindowVM.MainWindowM.nKeyLevel = -9 Then
|
|
|
|
|
EgtOutLog("Missing Link with Net Dongle")
|
|
|
|
|
' Box di avviso chiave mancante : "Collegamento con la Chiave di rete non riuscito. \n Verificare la connessione." "Errore"
|
|
|
|
|
Dim sText As String = EgtMsg(10108) & vbCrLf & EgtMsg(10109)
|
|
|
|
|
Dim sTitle As String = EgtMsg(10101)
|
|
|
|
|
MessageBox.Show(sText, sTitle, MessageBoxButton.OK, MessageBoxImage.Error)
|
|
|
|
|
' Altrimenti manca la licenza
|
|
|
|
|
' 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)
|
|
|
|
|
Dim sText As String = EgtMsg(10105) & vbCrLf & EgtMsg(10106)
|
|
|
|
|
Dim sTitle As String = EgtMsg(10101)
|
|
|
|
|
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 {
|
|
|
|
@@ -347,8 +361,7 @@ Public Class MySceneHostVM
|
|
|
|
|
Return False
|
|
|
|
|
End If
|
|
|
|
|
WriteMainPrivateProfileString(S_PRINTING3D, K_IMPORTCURREXTENSION, OpenFileDialog.FilterIndex)
|
|
|
|
|
Dim sFile As String = String.Empty
|
|
|
|
|
sFile = OpenFileDialog.FileName
|
|
|
|
|
Dim sFile As String = OpenFileDialog.FileName
|
|
|
|
|
' disabilito ProjManager, TopPanel, TFS, Slider, bottoni e uscita dal programma
|
|
|
|
|
Map.refProjManagerVM.SetProjCmdIsEnabled(False)
|
|
|
|
|
Map.refTopPanelVM.SetTopPanelIsEnabled(False)
|
|
|
|
@@ -403,6 +416,7 @@ Public Class MySceneHostVM
|
|
|
|
|
"|Step files (*.stp;*.step)|*.stp;*.step" &
|
|
|
|
|
"|3D Manufacturing format (*.3mf)|*.3mf" &
|
|
|
|
|
"|New geometry EgalTech(*.nge)|*.nge" &
|
|
|
|
|
"|Imported Files (*.*)|*.stl;*.igs;*.iges;*.stp;*.step;*.3mf;*.nge" &
|
|
|
|
|
"|All Files (*.*)|*.*",
|
|
|
|
|
.FilterIndex = 1,
|
|
|
|
|
.InitialDirectory = sDir}
|
|
|
|
@@ -474,14 +488,14 @@ Public Class MySceneHostVM
|
|
|
|
|
"|Step files (*.stp;*.step)|*.stp;*.step" &
|
|
|
|
|
"|3D Manufacturing format (*.3mf)|*.3mf" &
|
|
|
|
|
"|New geometry EgalTech(*.nge)|*.nge" &
|
|
|
|
|
"|Imported Files (*.*)|*.stl;*.igs;*.iges;*.stp;*.step;*.3mf;*.nge" &
|
|
|
|
|
"|All Files (*.*)|*.*",
|
|
|
|
|
.FilterIndex = 1,
|
|
|
|
|
.InitialDirectory = sDir}
|
|
|
|
|
If Not OpenFileDialog.ShowDialog Then
|
|
|
|
|
Return False
|
|
|
|
|
End If
|
|
|
|
|
Dim sFile As String = String.Empty
|
|
|
|
|
sFile = OpenFileDialog.FileName
|
|
|
|
|
Dim sFile As String = OpenFileDialog.FileName
|
|
|
|
|
' importo la nuova geometria
|
|
|
|
|
Dim bOk As Boolean = MainController.InsertProject(sFile, False)
|
|
|
|
|
If bOk Then
|
|
|
|
@@ -532,6 +546,7 @@ Public Class MySceneHostVM
|
|
|
|
|
"|Step files (*.stp;*.step)|*.stp;*.step" &
|
|
|
|
|
"|3D Manufacturing format (*.3mf)|*.3mf" &
|
|
|
|
|
"|New geometry EgalTech(*.nge)|*.nge" &
|
|
|
|
|
"|Imported Files (*.*)|*.stl;*.igs;*.iges;*.stp;*.step;*.3mf;*.nge" &
|
|
|
|
|
"|All Files (*.*)|*.*",
|
|
|
|
|
.FilterIndex = 1,
|
|
|
|
|
.InitialDirectory = sDir}
|
|
|
|
@@ -603,6 +618,7 @@ Public Class MySceneHostVM
|
|
|
|
|
"|Step files (*.stp;*.step)|*.stp;*.step" &
|
|
|
|
|
"|3D Manufacturing format (*.3mf)|*.3mf" &
|
|
|
|
|
"|New geometry EgalTech(*.nge)|*.nge" &
|
|
|
|
|
"|Imported Files (*.*)|*.stl;*.igs;*.iges;*.stp;*.step;*.3mf;*.nge" &
|
|
|
|
|
"|All Files (*.*)|*.*",
|
|
|
|
|
.FilterIndex = 1,
|
|
|
|
|
.InitialDirectory = sDir}
|
|
|
|
@@ -1186,6 +1202,15 @@ Public Class MySceneHostVM
|
|
|
|
|
End If
|
|
|
|
|
End Sub
|
|
|
|
|
|
|
|
|
|
Private Sub OnInsertingProject(sender As Object, nType As Integer, ByRef nFlag As Integer)
|
|
|
|
|
If nType = FT.OBJ Or nType = FT.IGES Or nType = FT.STEP_ Or nType = FT.ACIS Or
|
|
|
|
|
nType = FT.PARASOLID Or nType = FT.JT Or nType = FT.VRML Or nType = FT.C3D Then
|
|
|
|
|
nFlag = GetMainPrivateProfileInt(S_IMPORT, K_ADVFLAG, 0)
|
|
|
|
|
Else
|
|
|
|
|
nFlag = 0
|
|
|
|
|
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
|
|
|
|
@@ -1198,37 +1223,6 @@ Public Class MySceneHostVM
|
|
|
|
|
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.refControllerInputPanelVM.PrepareInputBox(sTitle, sLabel, sCheckLabel, bShowCombo, bShowBtn)
|
|
|
|
|