- Aggiornamento di tutte le messagebox a egtmessagebox

This commit is contained in:
Demetrio Cassarino
2023-05-26 10:21:46 +02:00
parent d74bc0f4d2
commit d4b55f730a
21 changed files with 182 additions and 124 deletions
@@ -66,7 +66,8 @@ Public Class ChooseMachineWndVM
RaiseEvent m_CloseWindow(True)
Else
' se non seleziono nessuna macchina lo segnalo con un MessageBox
MessageBox.Show("No machine selected", "Error", MessageBoxButton.OK, MessageBoxImage.Error)
' MessageBox.Show("No machine selected", "Error", MessageBoxButton.OK, MessageBoxImage.Error)
EgtMessageBoxV.Show(Application.Current.MainWindow, "No machine selected", "Error", MessageBoxButton.OK, MessageBoxImage.Error)
End If
End Sub
+3 -1
View File
@@ -24,7 +24,8 @@
Style="{StaticResource DialogWindow_TextBlock}"/>
</Grid>
<ItemsControl Grid.Row="1"
ItemsSource="{Binding ButtonList}">
ItemsSource="{Binding ButtonList}"
HorizontalAlignment="Center">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<UniformGrid Rows="1"/>
@@ -35,6 +36,7 @@
<Button IsDefault="{Binding bIsDefault}"
Content="{Binding sMessage}"
Command="{Binding Command_Command}"
Margin="2.5,0,2.5,0"
Style="{StaticResource RightPanel_HalfRound_Button}"/>
</DataTemplate>
</ItemsControl.ItemTemplate>
+15 -25
View File
@@ -1,4 +1,5 @@
Imports EgtWPFLib5
Imports EgtUILib
Imports EgtWPFLib5
Public Class EgtMessageBoxVM
Inherits VMBase
@@ -66,7 +67,6 @@ Public Class EgtMessageBoxVM
EgtMsgBoxButton.SetOwner(Me)
m_sMessage = sMessageBoxText
m_Button = MessageBoxButton.OK
m_ButtonList.Add(New EgtMsgBoxButton(EgtMsgBoxButton.Types.OK))
m_Icon = MessageBoxImage.None
NotifyPropertyChanged(NameOf(ButtonList))
NotifyPropertyChanged(NameOf(sIconSource))
@@ -176,36 +176,26 @@ Public Class EgtMsgBoxButton
m_Type = Type
Select Case m_Type
Case Types.OK
m_sMessage = "Ok"
Case Types.CANCEL
m_sMessage = "Cancel"
Case Types.YES
m_sMessage = "Yes"
Case Types.NO
m_sMessage = "No"
End Select
m_sMessage = EgtMsg(35001)
Case Types.CANCEL
m_sMessage = EgtMsg(35002)
Case Types.YES
m_sMessage = EgtMsg(35003)
Case Types.NO
m_sMessage = EgtMsg(35004)
End Select
End Sub
Sub New(Type As Types, bIsDefault As Boolean)
m_Type = Type
Select Case m_Type
Case Types.OK
m_sMessage = "Ok"
Case Types.CANCEL
m_sMessage = "Cancel"
Case Types.YES
m_sMessage = "Yes"
Case Types.NO
m_sMessage = "No"
End Select
m_bIsDefault = bIsDefault
End Sub
Sub New(Type As Types, bIsDefault As Boolean)
MyClass.New(Type)
m_bIsDefault = bIsDefault
End Sub
#End Region ' CONTRUCTORS
#Region "METHODS"
Friend Shared Sub SetOwner(value As EgtMessageBoxVM)
Friend Shared Sub SetOwner(value As EgtMessageBoxVM)
Owner = value
End Sub
@@ -157,7 +157,8 @@ Public Class ImportExportMachiningPanelVM
nIndex += 1
End While
If bIsOriginal AndAlso bIsCustom Then
MessageBox.Show("Corrupted file! Impossible to import it!")
'MessageBox.Show("Corrupted file! Impossible to import it!")
EgtMessageBoxV.Show(Application.Current.MainWindow, "Corrupted file! Impossible to import it!")
ElseIf bIsOriginal Then
LoadOriginalMaterial()
End If
@@ -301,9 +302,12 @@ Public Class ImportExportMachiningPanelVM
sDuplicatedMaterialList &= " - " & m_MachiningList(Index).sName & Environment.NewLine
End If
Next
MessageBox.Show("Impossible to import the package because materials named:" & Environment.NewLine &
sDuplicatedMaterialList & Environment.NewLine &
"Please modify the names of these machining and then retry to import the materials.")
'MessageBox.Show("Impossible to import the package because materials named:" & Environment.NewLine &
' sDuplicatedMaterialList & Environment.NewLine &
' "Please modify the names of these machining and then retry to import the materials.")
EgtMessageBoxV.Show(Application.Current.MainWindow, "Impossible to import the package because materials named:" & Environment.NewLine &
sDuplicatedMaterialList & Environment.NewLine &
"Please modify the names of these machining and then retry to import the materials.")
Return
End If
' aggiorno/aggiungo materiali
@@ -353,9 +357,12 @@ Public Class ImportExportMachiningPanelVM
For Index = 0 To ImportedMaterialList.Count - 1
sMaterialList &= " - " & m_MachiningList(Index).sName & " (" & If(ImportedMaterialList(Index) = MaterialState.NOTFOUND, "New", "Updated") & ")" & Environment.NewLine
Next
MessageBox.Show("List of the materials:" & Environment.NewLine &
sMaterialList & Environment.NewLine &
"Import successfully completed.")
'MessageBox.Show("List of the materials:" & Environment.NewLine &
' sMaterialList & Environment.NewLine &
' "Import successfully completed.")
EgtMessageBoxV.Show(Application.Current.MainWindow, "List of the materials:" & Environment.NewLine &
sMaterialList & Environment.NewLine &
"Import successfully completed.")
Return
End Sub
@@ -471,7 +478,7 @@ Public Class ImportExportMachiningPanelVM
End Select
Case WindowModeEnum.EXPORT, WindowModeEnum.EXPORT_ORIG
' chiedo il nome con cui salvare il file
Dim sExtension As String =""
Dim sExtension As String = ""
If m_WindowType = WindowTypeEnum.MATERIAL Then
If m_WindowMode = WindowModeEnum.EXPORT_ORIG Then
sExtension = OriginalMaterialDataExtension
@@ -580,7 +587,8 @@ Public Class ImpExpMachiningItem
If m_AlreadyExist Then
Select Case m_WindowType
Case WindowTypeEnum.MATERIAL
Select Case System.Windows.MessageBox.Show("Material already existing in Db. Overwrite it?", "", MessageBoxButton.YesNoCancel)
Select Case EgtMessageBoxV.Show(Application.Current.MainWindow, "Material will be imported with the name: " & m_sName, "", MessageBoxButton.OK)
'System.Windows.MessageBox.Show("Material already existing in Db. Overwrite it?", "", MessageBoxButton.YesNoCancel)
Case MessageBoxResult.Yes
m_ChangeName = False
m_Active = True
@@ -594,7 +602,8 @@ Public Class ImpExpMachiningItem
End While
End If
m_sName = m_sOrigName & IMPEXPNAME & If(nImpNameIndex > 0, "_" & nImpNameIndex, "")
System.Windows.MessageBox.Show("Material will be imported with the name: " & m_sName, "", MessageBoxButton.OK)
'System.Windows.MessageBox.Show("Material will be imported with the name: " & m_sName, "", MessageBoxButton.OK)
EgtMessageBoxV.Show(Application.Current.MainWindow, "Material will be imported with the name: " & m_sName, "", MessageBoxButton.OK)
NotifyPropertyChanged(NameOf(sName))
m_ChangeName = True
m_Active = True
@@ -602,7 +611,8 @@ Public Class ImpExpMachiningItem
m_Active = False
End Select
Case WindowTypeEnum.MACHINING
Select Case System.Windows.MessageBox.Show("Machining already existing in Db. Overwrite it?", "", MessageBoxButton.YesNoCancel)
Select Case EgtMessageBoxV.Show(Application.Current.MainWindow, "Machining already existing in Db. Overwrite it?", "", MessageBoxButton.YesNoCancel)
'System.Windows.MessageBox.Show("Machining already existing in Db. Overwrite it?", "", MessageBoxButton.YesNoCancel)
Case MessageBoxResult.Yes
m_ChangeName = False
m_Active = True
@@ -616,7 +626,8 @@ Public Class ImpExpMachiningItem
End While
End If
m_sName = m_sOrigName & IMPEXPNAME & If(nImpNameIndex > 0, "_" & nImpNameIndex, "")
System.Windows.MessageBox.Show("Machining will be imported with the name: " & m_sName, "", MessageBoxButton.OK)
'System.Windows.MessageBox.Show("Machining will be imported with the name: " & m_sName, "", MessageBoxButton.OK)
EgtMessageBoxV.Show(Application.Current.MainWindow, "Machining will be imported with the name: " & m_sName, "", MessageBoxButton.OK)
NotifyPropertyChanged(NameOf(sName))
m_ChangeName = True
m_Active = True
@@ -96,8 +96,9 @@ Public Class MyInstrumentPanelVM
EgtDraw()
' Ripristino stato segnalazione modifica
DisableMgr.ReEnable()
MessageBox.Show(sResult)
Else
'MessageBox.Show(sResult)
EgtMessageBoxV.Show(Application.Current.MainWindow, sResult)
Else
' Disabilito segnalazione modificato
Dim DisableMgr As New DisableModifiedMgr
' cancello tutti i gruppi con i chunk
+2 -1
View File
@@ -48,7 +48,8 @@ Public Class MachSaveInDbWndVM
Public Sub Ok()
If Map.refTopPanelVM.MachiningList.Any(Function(x As MachiningIndex) x.sName = m_sName) Then
MessageBox.Show("Name already used in Db! Please insert a different name.", "Warning", MessageBoxButton.OK, MessageBoxImage.Warning)
'MessageBox.Show("Name already used in Db! Please insert a different name.", "Warning", MessageBoxButton.OK, MessageBoxImage.Warning)
EgtMessageBoxV.Show(Application.Current.MainWindow, "Name already used in Db! Please insert a different name.", "Warning", MessageBoxButton.OK, MessageBoxImage.Warning)
Return
End If
RaiseEvent m_CloseWindow(True)
+6 -3
View File
@@ -26,7 +26,8 @@ Public Class MachiningDbVM
' verifico se modificato
If m_SelMachining.bIsModified Then
' chiedo se salvare
Select Case MessageBox.Show("Do you want to save the modification done on the selected machining?", "Info", MessageBoxButton.YesNoCancel, MessageBoxImage.Question)
Select Case EgtMessageBoxV.Show(Application.Current.MainWindow, "Do you want to save the modification done on the selected machining?", "Info", MessageBoxButton.YesNoCancel, MessageBoxImage.Question)
'MessageBox.Show("Do you want to save the modification done on the selected machining?", "Info", MessageBoxButton.YesNoCancel, MessageBoxImage.Question)
Case MessageBoxResult.Yes
m_SelMachining.Save()
Case MessageBoxResult.No
@@ -198,7 +199,8 @@ Public Class MachiningDbVM
Public Sub Ok()
If Not IsNothing(m_SelMachining) AndAlso m_SelMachining.bIsModified Then
' chiedo se salvare
Select Case MessageBox.Show("Do you want to save modified parameters?", "Warning", MessageBoxButton.YesNoCancel, MessageBoxImage.Warning)
Select Case EgtMessageBoxV.Show(Application.Current.MainWindow, "Do you want to save modified parameters?", "Warning", MessageBoxButton.YesNoCancel, MessageBoxImage.Warning)
'MessageBox.Show("Do you want to save modified parameters?", "Warning", MessageBoxButton.YesNoCancel, MessageBoxImage.Warning)
Case MessageBoxResult.Yes
m_SelMachining.Save()
Case MessageBoxResult.No
@@ -309,7 +311,8 @@ Public Class MachiningDbVM
Public Sub Delete()
If IsNothing(m_SelMachining) Then Return
' chiedo conferma
Select Case MessageBox.Show("Are you sure you want to delete the selected machining?", "Warning", MessageBoxButton.YesNo, MessageBoxImage.Warning)
Select Case EgtMessageBoxV.Show(Application.Current.MainWindow, "Are you sure you want to delete the selected machining?", "Warning", MessageBoxButton.YesNo, MessageBoxImage.Warning)
'MessageBox.Show("Are you sure you want to delete the selected machining?", "Warning", MessageBoxButton.YesNo, MessageBoxImage.Warning)
Case MessageBoxResult.Yes
m_MachiningList.Remove(m_SelMachining)
SetIsModified(True)
+2 -1
View File
@@ -226,7 +226,8 @@ Public Class MainWindowVM
' Manage the MainWindow_Unloaded event. This method is invoked by the cmdMainWindow_Unloaded.
Public Sub CloseApplication(ByVal param As Object)
If Map.refSliceManagerVM.bCalculating Then
MessageBox.Show("Impossible closing software! Wait end of calculation!", "Error", MessageBoxButton.OK, MessageBoxImage.Error)
'MessageBox.Show("Impossible closing software! Wait end of calculation!", "Error", MessageBoxButton.OK, MessageBoxImage.Error)
EgtMessageBoxV.Show(Application.Current.MainWindow, "Impossible closing software! Wait end of calculation!", "Error", MessageBoxButton.OK, MessageBoxImage.Error)
Return
End If
CloseApplication()
+2 -1
View File
@@ -286,7 +286,8 @@ Public Class ManagePartPanelVM
Next
Next
If sErr.Count > 0 Then
MessageBox.Show(String.Concat(sErr), "Error")
'MessageBox.Show(String.Concat(sErr), "Error")
EgtMessageBoxV.Show(Application.Current.MainWindow, String.Concat(sErr), "Error")
Return
Else
' Creo pezzi e layer necessari
+4 -2
View File
@@ -629,7 +629,8 @@ Public Class GeomEntity_MenuItem
Map.refManagePartPanelVM.SetIsEnabled(True)
Return
ElseIf m_Type = ManagePart_Layer.LayerType.DELETE Then
If MessageBox.Show("Are you sure you want to delete this entity?", "Delete confirmation", MessageBoxButton.YesNo, MessageBoxImage.Question) = MessageBoxResult.Yes Then
'If MessageBox.Show("Are you sure you want to delete this entity?", "Delete confirmation", MessageBoxButton.YesNo, MessageBoxImage.Question) = MessageBoxResult.Yes Then
If EgtMessageBoxV.Show(Application.Current.MainWindow, "Are you sure you want to delete this entity?", "Delete confirmation", MessageBoxButton.YesNo, MessageBoxImage.Question) = MessageBoxResult.Yes Then
EgtErase(m_OrigEntity.nId)
' se l'entita' e' gia' in lista pezzi
If Not IsNothing(m_OrigEntity.OrigLayer) Then
@@ -1037,7 +1038,8 @@ Public Class ManagerLayer_MenuItem
Case Else ' PartMenuCmd.IMPORTPRINT
Dim bDeleteOldPrint As Boolean = False
If m_OrigLayer.EntityList.Count > 0 Then
If MessageBox.Show("Importing a new print solid the current one will be deleted. Are you sure you want to proced?", "Warning", MessageBoxButton.YesNo, MessageBoxImage.Warning) <> MessageBoxResult.Yes Then
'If MessageBox.Show("Importing a new print solid the current one will be deleted. Are you sure you want to proced?", "Warning", MessageBoxButton.YesNo, MessageBoxImage.Warning) <> MessageBoxResult.Yes Then
If EgtMessageBoxV.Show(Application.Current.MainWindow, "Importing a new print solid the current one will be deleted. Are you sure you want to proced?", "Warning", MessageBoxButton.YesNo, MessageBoxImage.Warning) <> MessageBoxResult.Yes Then
Return
Else
bDeleteOldPrint = True
+2 -1
View File
@@ -769,7 +769,8 @@ Public Class StringMaterialParam
End Property
Public Sub Original()
If MessageBox.Show("Are you sure you want to set this material as original?", "Original material confirmation", MessageBoxButton.YesNo, MessageBoxImage.Question) = MessageBoxResult.Yes Then
'If MessageBox.Show("Are you sure you want to set this material as original?", "Original material confirmation", MessageBoxButton.YesNo, MessageBoxImage.Question) = MessageBoxResult.Yes Then
If EgtMessageBoxV.Show(Application.Current.MainWindow, "Are you sure you want to set this material as original?", "Original material confirmation", MessageBoxButton.YesNo, MessageBoxImage.Question) = MessageBoxResult.Yes Then
m_sGUID = ORIG_MATERIAL
m_sValue = ORIG_MATERIAL
NotifyPropertyChanged(NameOf(sValue))
+10 -5
View File
@@ -24,7 +24,8 @@ Public Class MaterialDbVM
' verifico se modificato
If Not IsNothing(m_SelMaterial) AndAlso m_SelMaterial.bIsModified Then
' chiedo se salvare
Select Case MessageBox.Show("Do you want to save material modification?", "Info", MessageBoxButton.YesNoCancel, MessageBoxImage.Question)
'Select Case MessageBox.Show("Do you want to save material modification?", "Info", MessageBoxButton.YesNoCancel, MessageBoxImage.Question)
Select Case EgtMessageBoxV.Show(Application.Current.MainWindow, "Do you want to save material modification?", "Info", MessageBoxButton.YesNoCancel, MessageBoxImage.Question)
Case MessageBoxResult.Yes
m_SelMaterial.Save()
Case MessageBoxResult.No
@@ -236,7 +237,8 @@ Public Class MaterialDbVM
Public Sub Ok()
If Not IsNothing(m_SelMaterial) AndAlso m_SelMaterial.bIsModified Then
' chiedo se salvare
Select Case MessageBox.Show("Do you want to save material modification?", "Warning", MessageBoxButton.YesNoCancel, MessageBoxImage.Warning)
'Select Case MessageBox.Show("Do you want to save material modification?", "Warning", MessageBoxButton.YesNoCancel, MessageBoxImage.Warning)
Select Case EgtMessageBoxV.Show(Application.Current.MainWindow, "Do you want to save material modification?", "Warning", MessageBoxButton.YesNoCancel, MessageBoxImage.Warning)
Case MessageBoxResult.Yes
m_SelMaterial.Save()
Case MessageBoxResult.No
@@ -365,17 +367,20 @@ Public Class MaterialDbVM
' se materiale originale, esco
If SelMaterialIsOriginal() Then
If Map.refMainWindowVM.MainWindowM.nUserLevel >= 5 Then
If MessageBox.Show("Trying to delete an Original Material! Are you sure you want to delete it?", "", MessageBoxButton.YesNo, MessageBoxImage.Warning) <> MessageBoxResult.Yes Then
'If MessageBox.Show("Trying to delete an Original Material! Are you sure you want to delete it?", "", MessageBoxButton.YesNo, MessageBoxImage.Warning) <> MessageBoxResult.Yes Then
If EgtMessageBoxV.Show(Application.Current.MainWindow, "Trying to delete an Original Material! Are you sure you want to delete it?", "", MessageBoxButton.YesNo, MessageBoxImage.Warning) <> MessageBoxResult.Yes Then
Return
End If
sCheckMessage = "Trying to delete an Original Material! Are you ABSOLUTELY sure you want to delete it?"
Else
MessageBox.Show("Original material impossible to delete!")
'MessageBox.Show("Original material impossible to delete!")
EgtMessageBoxV.Show(Application.Current.MainWindow, "Original material impossible to delete!")
Return
End If
End If
' chiedo conferma
Select Case MessageBox.Show(sCheckMessage, "Warning", MessageBoxButton.YesNo, MessageBoxImage.Warning)
Select Case EgtMessageBoxV.Show(Application.Current.MainWindow, sCheckMessage, "Warning", MessageBoxButton.YesNo, MessageBoxImage.Warning)
'MessageBox.Show(sCheckMessage, "Warning", MessageBoxButton.YesNo, MessageBoxImage.Warning)
Case MessageBoxResult.Yes
m_MaterialList.Remove(m_SelMaterial)
SetIsModified(True)
+31 -26
View File
@@ -563,17 +563,17 @@ Public Class OptionWindowVM
End Property
Public ReadOnly Property ThickLineMsg As String
Get
Return EgtMsg( 6536) ' Linee spesse
Return EgtMsg(6536) ' Linee spesse
End Get
End Property
Public ReadOnly Property SmoothTriMeshMsg As String
Get
Return EgtMsg( 6518) ' Superfici smussate
Return EgtMsg(6518) ' Superfici smussate
End Get
End Property
Public ReadOnly Property UpdateLicenceMsg As String
Get
Return EgtMsg( 6553) ' Aggiorna licenza
Return EgtMsg(6553) ' Aggiorna licenza
End Get
End Property
@@ -953,31 +953,32 @@ Public Class OptionWindowVM
Dim sMachDir As String = Path.Combine(Map.refMainWindowVM.MainWindowM.sMachinesRoot, sMachName)
' Preparo direttorio temporaneo
Dim sTempDir As String = Path.Combine(Map.refMainWindowVM.MainWindowM.sMachinesRoot, "Temp")
If My.Computer.FileSystem.DirectoryExists( sTempDir) Then
My.Computer.FileSystem.DeleteDirectory( sTempDir, FileIO.DeleteDirectoryOption.DeleteAllContents)
If My.Computer.FileSystem.DirectoryExists(sTempDir) Then
My.Computer.FileSystem.DeleteDirectory(sTempDir, FileIO.DeleteDirectoryOption.DeleteAllContents)
End If
My.Computer.FileSystem.CreateDirectory( sTempDir)
My.Computer.FileSystem.CreateDirectory(sTempDir)
' Unzip nel direttorio temporaneo
Using zip As New Ionic.Zip.ZipFile(sMachZip)
zip.ExtractAll( sTempDir, Ionic.Zip.ExtractExistingFileAction.DoNotOverwrite)
zip.ExtractAll(sTempDir, Ionic.Zip.ExtractExistingFileAction.DoNotOverwrite)
End Using
' Se non è una macchina segnalo il problema ed esco
If Not My.Computer.FileSystem.FileExists( Path.Combine( sTempDir, sMachName, sMachName & ".ini")) Or
Not My.Computer.FileSystem.FileExists( Path.Combine( sTempDir, sMachName, sMachName & ".mlde")) Then
If Not My.Computer.FileSystem.FileExists(Path.Combine(sTempDir, sMachName, sMachName & ".ini")) Or
Not My.Computer.FileSystem.FileExists(Path.Combine(sTempDir, sMachName, sMachName & ".mlde")) Then
' Il file {0} non contiene una macchina - Avviso
Dim sOut As String = String.Format(EgtMsg(6529), sMachZip)
MessageBox.Show(sOut, EgtMsg(MSG_MESSAGEBOX + 2), MessageBoxButton.OK, MessageBoxImage.Warning)
'MessageBox.Show(sOut, EgtMsg(MSG_MESSAGEBOX + 2), MessageBoxButton.OK, MessageBoxImage.Warning)
EgtMessageBoxV.Show(Application.Current.MainWindow, sOut, EgtMsg(MSG_MESSAGEBOX + 2), MessageBoxButton.OK, MessageBoxImage.Warning)
' Rimuovo il direttorio temporaneo ed esco
My.Computer.FileSystem.DeleteDirectory( sTempDir, FileIO.DeleteDirectoryOption.DeleteAllContents)
My.Computer.FileSystem.DeleteDirectory(sTempDir, FileIO.DeleteDirectoryOption.DeleteAllContents)
Return
End If
' Imposto data e ora correnti al file mlde della macchina
Try
File.SetLastWriteTime( Path.Combine( sTempDir, sMachName, sMachName & ".mlde"), System.DateTime.Now)
File.SetLastWriteTime(Path.Combine(sTempDir, sMachName, sMachName & ".mlde"), System.DateTime.Now)
Catch ex As Exception
End Try
' Verifico esistenza di una macchina con lo stesso nome
Dim bOldExists As Boolean = My.Computer.FileSystem.DirectoryExists( sMachDir)
Dim bOldExists As Boolean = My.Computer.FileSystem.DirectoryExists(sMachDir)
Dim bUpdate As Boolean = True
If bOldExists Then
Dim MachBox As New UpdateMachineV(Application.Current.MainWindow, New UpdateMachineVM(sMachName))
@@ -994,23 +995,24 @@ Public Class OptionWindowVM
End Select
' Faccio una copia di backup della macchina corrente
Dim sBackupDir As String = sMachDir & ".old"
If My.Computer.FileSystem.DirectoryExists( sBackupDir) Then
My.Computer.FileSystem.DeleteDirectory( sBackupDir, FileIO.DeleteDirectoryOption.DeleteAllContents)
If My.Computer.FileSystem.DirectoryExists(sBackupDir) Then
My.Computer.FileSystem.DeleteDirectory(sBackupDir, FileIO.DeleteDirectoryOption.DeleteAllContents)
End If
Try
My.Computer.FileSystem.MoveDirectory( sMachDir, sBackupDir, True)
My.Computer.FileSystem.MoveDirectory(sMachDir, sBackupDir, True)
Catch ex As Exception
' Ripristino lo stato originale ed esco
My.Computer.FileSystem.MoveDirectory( sBackupDir, sMachDir, True)
My.Computer.FileSystem.MoveDirectory(sBackupDir, sMachDir, True)
' L'aggiornamento della macchina "{0}" non è riuscito.
Dim sKo As String = String.Format(EgtMsg(6535), sMachName)
EgtOutLog( sKo)
MessageBox.Show(sKo, EgtMsg(MSG_MESSAGEBOX + 1), MessageBoxButton.OK)
EgtOutLog(sKo)
'MessageBox.Show(sKo, EgtMsg(MSG_MESSAGEBOX + 1), MessageBoxButton.OK)
EgtMessageBoxV.Show(Application.Current.MainWindow, sKo, EgtMsg(MSG_MESSAGEBOX + 1), MessageBoxButton.OK)
Return
End Try
End If
' Installo la macchina
My.Computer.FileSystem.MoveDirectory( Path.Combine( sTempDir, sMachName), sMachDir, True)
My.Computer.FileSystem.MoveDirectory(Path.Combine(sTempDir, sMachName), sMachDir, True)
' Se è un aggiornamento, recupero utensili, lavorazioni, attrezzaggi e dati per travi
If bOldExists And bUpdate Then
Dim sBackupDir As String = sMachDir & ".old"
@@ -1047,10 +1049,11 @@ Public Class OptionWindowVM
End If
'La macchina "{0}" è stata aggiornata con successo.
Dim sOk As String = String.Format(EgtMsg(6530), sMachName)
EgtOutLog( sOk)
MessageBox.Show(sOk, EgtMsg(MSG_MESSAGEBOX + 3), MessageBoxButton.OK)
EgtOutLog(sOk)
'MessageBox.Show(sOk, EgtMsg(MSG_MESSAGEBOX + 3), MessageBoxButton.OK)
EgtMessageBoxV.Show(Application.Current.MainWindow, sOk, EgtMsg(MSG_MESSAGEBOX + 3), MessageBoxButton.OK)
' Rimuovo il direttorio temporaneo
My.Computer.FileSystem.DeleteDirectory( sTempDir, FileIO.DeleteDirectoryOption.DeleteAllContents)
My.Computer.FileSystem.DeleteDirectory(sTempDir, FileIO.DeleteDirectoryOption.DeleteAllContents)
' Aggiorno la lista delle macchina
MyMachine.InsertMachine(sMachDir, Map.refMachinePanelVM.MachineList)
End Sub
@@ -1096,7 +1099,7 @@ Public Class OptionWindowVM
' aggiungo i file della Macchina
Dim sMachineDir As String = Map.refMainWindowVM.MainWindowM.sMachinesRoot & "\" & sCurrMachineName
If Directory.Exists(sMachineDir) Then
zip.AddSelectedFiles( "name != *\.git\*.* and name != *.git*", sMachineDir, sCurrMachineName, True)
zip.AddSelectedFiles("name != *\.git\*.* and name != *.git*", sMachineDir, sCurrMachineName, True)
End If
' salvo lo zip
zip.Save()
@@ -1106,12 +1109,14 @@ Public Class OptionWindowVM
' L'esportazione della macchina "{0}" non è riuscita.
Dim sKo As String = String.Format(EgtMsg(6551), sCurrMachineName)
EgtOutLog(sKo)
MessageBox.Show(sKo, EgtMsg(MSG_MESSAGEBOX + 1), MessageBoxButton.OK)
'MessageBox.Show(sKo, EgtMsg(MSG_MESSAGEBOX + 1), MessageBoxButton.OK)
EgtMessageBoxV.Show(Application.Current.MainWindow, sKo, EgtMsg(MSG_MESSAGEBOX + 1), MessageBoxButton.OK)
End Try
'La macchina "{0}" è stata esportata con successo.
Dim sOk As String = String.Format(EgtMsg(6552), sCurrMachineName)
EgtOutLog(sOk)
MessageBox.Show(sOk, EgtMsg(MSG_MESSAGEBOX + 3), MessageBoxButton.OK)
'MessageBox.Show(sOk, EgtMsg(MSG_MESSAGEBOX + 3), MessageBoxButton.OK)
EgtMessageBoxV.Show(Application.Current.MainWindow, sOk, EgtMsg(MSG_MESSAGEBOX + 3), MessageBoxButton.OK)
End Sub
#End Region ' ExportMachine
+11 -7
View File
@@ -149,8 +149,8 @@ Public Class ProjManagerVM
''' Execute the Save. This method is invoked by the SaveCommand.
''' </summary>
Public Sub NewProjectCmd()
'MessageBox.Show("Testo di prova EgtMessageBox", "Titolo di prova")
Dim x = EgtMessageBoxV.Show(Application.Current.MainWindow, "Testo di prova EgtMessageBox", "Titolo di prova", MessageBoxButton.YesNoCancel, MessageBoxImage.Warning, MessageBoxResult.Yes)
' 'MessageBox.Show("Testo di prova EgtMessageBox", "Titolo di prova")
' Dim x = EgtMessageBoxV.Show(Application.Current.MainWindow, "Testo di prova EgtMessageBox", "Titolo di prova", MessageBoxButton.YesNoCancel, MessageBoxImage.Warning, MessageBoxResult.Yes)
NewProject(True)
End Sub
@@ -373,7 +373,8 @@ Public Class ProjManagerVM
GetMainPrivateProfileString(S_GENERAL, K_SUPPORT, "support@egaltech.com", sSupportAddress)
' se vuoto do messaggio di errore ed esco
If String.IsNullOrWhiteSpace(sSupportAddress) Then
MessageBox.Show(EgtMsg(MSG_TOPCOMMANDBAR + 10), EgtMsg(MSG_MESSAGEBOX + 1), MessageBoxButton.OK, MessageBoxImage.Error)
'MessageBox.Show(EgtMsg(MSG_TOPCOMMANDBAR + 10), EgtMsg(MSG_MESSAGEBOX + 1), MessageBoxButton.OK, MessageBoxImage.Error)
EgtMessageBoxV.Show(Application.Current.MainWindow, EgtMsg(MSG_TOPCOMMANDBAR + 10), EgtMsg(MSG_MESSAGEBOX + 1), MessageBoxButton.OK, MessageBoxImage.Error)
Return
End If
' Recupero numero chiave
@@ -384,14 +385,16 @@ Public Class ProjManagerVM
EgtGetCurrFilePath(sCurrProject)
' se nome file vuoto o con estensione non valida, chiedo se si vuole salvare
If String.IsNullOrWhiteSpace(sCurrProject) Or EgtGetFileType(sCurrProject) <> FT.NGE Then
If MessageBox.Show(EgtMsg(MSG_TOPCOMMANDBAR + 11), "", MessageBoxButton.YesNo, MessageBoxImage.Question) = MessageBoxResult.Yes Then
'If MessageBox.Show(EgtMsg(MSG_TOPCOMMANDBAR + 11), "", MessageBoxButton.YesNo, MessageBoxImage.Question) = MessageBoxResult.Yes Then
If EgtMessageBoxV.Show(Application.Current.MainWindow, EgtMsg(MSG_TOPCOMMANDBAR + 11), "", MessageBoxButton.YesNo, MessageBoxImage.Question) = MessageBoxResult.Yes Then
Map.refSceneHostVM.SaveProject()
End If
EgtGetCurrFilePath(sCurrProject)
' se modificato, chiedo se si vuole salvare
' se modificato, chiedo se si vuole salvare
Else
If EgtGetModified() Then
If MessageBox.Show(EgtMsg(MSG_TOPCOMMANDBAR + 11), "", MessageBoxButton.YesNo, MessageBoxImage.Question) = MessageBoxResult.Yes Then
'If MessageBox.Show(EgtMsg(MSG_TOPCOMMANDBAR + 11), "", MessageBoxButton.YesNo, MessageBoxImage.Question) = MessageBoxResult.Yes Then
If EgtMessageBoxV.Show(Application.Current.MainWindow, EgtMsg(MSG_TOPCOMMANDBAR + 11), "", MessageBoxButton.YesNo, MessageBoxImage.Question) = MessageBoxResult.Yes Then
Map.refSceneHostVM.SaveProject()
End If
End If
@@ -478,7 +481,8 @@ Public Class ProjManagerVM
bEx = True
End Try
If bEx OrElse EgtWPFLib5.MapiMailMessage.m_ErrorCode <> 0 Then
MessageBox.Show(String.Format(EgtMsg(MSG_TOPCOMMANDBAR + 12), sSupportAddress, sZipToCreate), EgtMsg(MSG_MESSAGEBOX + 3), MessageBoxButton.OK, MessageBoxImage.Information)
'MessageBox.Show(String.Format(EgtMsg(MSG_TOPCOMMANDBAR + 12), sSupportAddress, sZipToCreate), EgtMsg(MSG_MESSAGEBOX + 3), MessageBoxButton.OK, MessageBoxImage.Information)
EgtMessageBoxV.Show(Application.Current.MainWindow, String.Format(EgtMsg(MSG_TOPCOMMANDBAR + 12), sSupportAddress, sZipToCreate), EgtMsg(MSG_MESSAGEBOX + 3), MessageBoxButton.OK, MessageBoxImage.Information)
Else
Map.refMyStatusBarVM.SetOutputMessage(EgtMsg(MSG_TOPCOMMANDBAR + 14), 5)
End If
+2 -1
View File
@@ -51,7 +51,8 @@ Public Class CopyFromWndVM
Public Sub Ok()
If IsNothing(m_SelRib) Then
MessageBox.Show("Please select the rib from which to copy the parameters!", "Warning", MessageBoxButton.OK, MessageBoxImage.Warning)
'MessageBox.Show("Please select the rib from which to copy the parameters!", "Warning", MessageBoxButton.OK, MessageBoxImage.Warning)
EgtMessageBoxV.Show(Application.Current.MainWindow, "Please select the rib from which to copy the parameters!", "Warning", MessageBoxButton.OK, MessageBoxImage.Warning)
Return
End If
' copio i parametri nella rib corrente
+28 -16
View File
@@ -85,21 +85,23 @@ Public Class MySceneHostVM
' 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)
'MessageBox.Show(sText, sTitle, MessageBoxButton.OK, MessageBoxImage.Error)
EgtMessageBoxV.Show(Application.Current.MainWindow, 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
'If MessageBox.Show(sText, sTitle, MessageBoxButton.OKCancel, MessageBoxImage.Error) = MessageBoxResult.OK Then
If EgtMessageBoxV.Show(Application.Current.MainWindow, 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
}
.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)
@@ -497,7 +499,8 @@ Public Class MySceneHostVM
Dim nNewLayerId As Integer = EgtGetFirstGroupInGroup(nNewPartId)
' verifico che ci sia una sola entita'
If EgtGetGroupObjs(nNewLayerId) <> 1 Then
MessageBox.Show("Impossible importing file that contains more than one entity.", "Error", MessageBoxButton.OK, MessageBoxImage.Error)
'MessageBox.Show("Impossible importing file that contains more than one entity.", "Error", MessageBoxButton.OK, MessageBoxImage.Error)
EgtMessageBoxV.Show(Application.Current.MainWindow, "Impossible importing file that contains more than one entity.", "Error", MessageBoxButton.OK, MessageBoxImage.Error)
Else
' elimino eventuale entita' vecchia
If MenuItem.OrigLayer.EntityList.Count > 0 AndAlso MenuItem.OrigLayer.EntityList(0).nId <> GDB_ID.NULL Then EgtErase(MenuItem.OrigLayer.EntityList(0).nId)
@@ -1021,7 +1024,8 @@ Public Class MySceneHostVM
EgtErase(EgtGetFirstPart())
CurrentMachine.CreateMachineTable()
If Not bOk Then
MessageBox.Show(Application.Current.MainWindow, EgtMsg(10002), EgtMsg(10001), MessageBoxButton.OK, MessageBoxImage.Error) ' Error on new file - Error
'MessageBox.Show(Application.Current.MainWindow, EgtMsg(10002), EgtMsg(10001), MessageBoxButton.OK, MessageBoxImage.Error) ' Error on new file - Error
EgtMessageBoxV.Show(Application.Current.MainWindow, EgtMsg(10002), EgtMsg(10001), MessageBoxButton.OK, MessageBoxImage.Error)
End If
Map.refTopPanelVM.PartList.Clear()
@@ -1050,7 +1054,8 @@ Public Class MySceneHostVM
Else
sMsg = EgtMsg(10009) & " '" & sFile & "'" 'Missing file
End If
MessageBox.Show(Application.Current.MainWindow, sMsg, EgtMsg(10001), MessageBoxButton.OK, MessageBoxImage.Error) 'Error
'MessageBox.Show(Application.Current.MainWindow, sMsg, EgtMsg(10001), MessageBoxButton.OK, MessageBoxImage.Error) 'Error
EgtMessageBoxV.Show(Application.Current.MainWindow, sMsg, EgtMsg(10001), MessageBoxButton.OK, MessageBoxImage.Error)
End If
' leggo materiale e macchina
Dim nTabPartId As Integer = EgtGetFirstNameInGroup(GDB_ID.ROOT, TABLE)
@@ -1062,7 +1067,8 @@ Public Class MySceneHostVM
' imposto la macchina
Map.refMachinePanelVM.SelectedMachine = ProjectMachine
Else
MessageBox.Show("Project machine not found! Impossible to open the project.", "Error", MessageBoxButton.OK, MessageBoxImage.Error)
'MessageBox.Show("Project machine not found! Impossible to open the project.", "Error", MessageBoxButton.OK, MessageBoxImage.Error)
EgtMessageBoxV.Show(Application.Current.MainWindow, "Project machine not found! Impossible to open the project.", "Error", MessageBoxButton.OK, MessageBoxImage.Error)
Map.refProjManagerVM.NewProject(False)
Return
End If
@@ -1085,7 +1091,9 @@ Public Class MySceneHostVM
Else
Dim sMaterialName As String = ""
EgtGetInfo(nTabPartId, KEY_MATERIAL_NAME, sMaterialName)
MessageBox.Show("Project material (Guid:" & sMaterialGuid & " Name:""" & sMaterialName & """) not found!" & Environment.NewLine &
'MessageBox.Show("Project material (Guid:" & sMaterialGuid & " Name:""" & sMaterialName & """) not found!" & Environment.NewLine &
' "Please select another material!", "Warning", MessageBoxButton.OK, MessageBoxImage.Warning)
EgtMessageBoxV.Show(Application.Current.MainWindow, "Project material (Guid:" & sMaterialGuid & " Name:""" & sMaterialName & """) not found!" & Environment.NewLine &
"Please select another material!", "Warning", MessageBoxButton.OK, MessageBoxImage.Warning)
End If
End If
@@ -1169,7 +1177,8 @@ Public Class MySceneHostVM
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
'MessageBox.Show(Application.Current.MainWindow, sMsg, EgtMsg(10001), MessageBoxButton.OK, MessageBoxImage.Error) ' Error
EgtMessageBoxV.Show(Application.Current.MainWindow, sMsg, EgtMsg(10001), MessageBoxButton.OK, MessageBoxImage.Error)
End If
End Sub
@@ -1177,7 +1186,8 @@ Public Class MySceneHostVM
' 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
'MessageBox.Show(Application.Current.MainWindow, sMsg, EgtMsg(10001), MessageBoxButton.OK, MessageBoxImage.Error) ' Error
EgtMessageBoxV.Show(Application.Current.MainWindow, sMsg, EgtMsg(10001), MessageBoxButton.OK, MessageBoxImage.Error)
End If
Map.refProjManagerVM.MruImportFiles.Add(sFile)
EgtSetInfo(EgtGetLastPart(), FILE_PATH, sFile)
@@ -1195,7 +1205,8 @@ Public Class MySceneHostVM
' 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
'MessageBox.Show(Application.Current.MainWindow, EgtMsg(10005), EgtMsg(10001), MessageBoxButton.OK, MessageBoxImage.Error) ' File type unknown - Error
EgtMessageBoxV.Show(Application.Current.MainWindow, EgtMsg(10005), EgtMsg(10001), MessageBoxButton.OK, MessageBoxImage.Error) ' File type unknown - Error
End If
End Sub
@@ -1208,7 +1219,8 @@ Public Class MySceneHostVM
' 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
'MessageBox.Show(Application.Current.MainWindow, sMsg, EgtMsg(10001), MessageBoxButton.OK, MessageBoxImage.Error) ' Error
EgtMessageBoxV.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.
+2 -1
View File
@@ -183,7 +183,8 @@ Public Class SecondaryWindowVM
' Manage the MainWindow_Unloaded event. This method is invoked by the cmdMainWindow_Unloaded.
Public Sub CloseApplication(ByVal param As Object)
If Map.refSliceManagerVM.bCalculating Then
MessageBox.Show("Impossible closing software! Wait end of calculation!", "Error", MessageBoxButton.OK, MessageBoxImage.Error)
'MessageBox.Show("Impossible closing software! Wait end of calculation!", "Error", MessageBoxButton.OK, MessageBoxImage.Error)
EgtMessageBoxV.Show(Application.Current.MainWindow, "Impossible closing software! Wait end of calculation!", "Error", MessageBoxButton.OK, MessageBoxImage.Error)
Return
End If
Map.refMainWindowVM.CloseApplication()
+6 -3
View File
@@ -71,11 +71,14 @@ Public Class MySimulation
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 ...
'MessageBox.Show(EgtMsg(MSG_SIMULATIONPAGEUC + 2) & " " & sInfo, EgtMsg(MSG_SIMULATIONPAGEUC + 5), MessageBoxButton.OK, MessageBoxImage.Stop) 'Extracorsa ...
EgtMessageBoxV.Show(Application.Current.MainWindow, EgtMsg(MSG_SIMULATIONPAGEUC + 2) & " " & sInfo, EgtMsg(MSG_SIMULATIONPAGEUC + 5), MessageBoxButton.OK, MessageBoxImage.Stop)
Case MCH_SIM.DIR_ERR
MessageBox.Show(EgtMsg(MSG_SIMULATIONPAGEUC + 3), EgtMsg(MSG_SIMULATIONPAGEUC + 5), MessageBoxButton.OK, MessageBoxImage.Stop) 'Direzione utensile irraggiungibile
'MessageBox.Show(EgtMsg(MSG_SIMULATIONPAGEUC + 3), EgtMsg(MSG_SIMULATIONPAGEUC + 5), MessageBoxButton.OK, MessageBoxImage.Stop) 'Direzione utensile irraggiungibile
EgtMessageBoxV.Show(Application.Current.MainWindow, EgtMsg(MSG_SIMULATIONPAGEUC + 3), EgtMsg(MSG_SIMULATIONPAGEUC + 5), MessageBoxButton.OK, MessageBoxImage.Stop)
Case Else
MessageBox.Show(EgtMsg(MSG_SIMULATIONPAGEUC + 4), EgtMsg(MSG_SIMULATIONPAGEUC + 5), MessageBoxButton.OK, MessageBoxImage.Stop) 'Errore
'MessageBox.Show(EgtMsg(MSG_SIMULATIONPAGEUC + 4), EgtMsg(MSG_SIMULATIONPAGEUC + 5), MessageBoxButton.OK, MessageBoxImage.Stop) 'Errore
EgtMessageBoxV.Show(Application.Current.MainWindow, EgtMsg(MSG_SIMULATIONPAGEUC + 4), EgtMsg(MSG_SIMULATIONPAGEUC + 5), MessageBoxButton.OK, MessageBoxImage.Stop)
End Select
End If
' Aggiorno stato visualizzazione macchina (dipende anche da utensile)
+6 -4
View File
@@ -88,10 +88,12 @@ Public Class SimulationPanelVM
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
'MessageBox.Show(sErr, EgtMsg(MSG_SIMULATION + 5), MessageBoxButton.OK, MessageBoxImage.Exclamation)
EgtMessageBoxV.Show(Application.Current.MainWindow, sErr, EgtMsg(MSG_SIMULATION + 5), MessageBoxButton.OK, MessageBoxImage.Exclamation)
Else
'MessageBox.Show(EgtMsg(MSG_MESSAGEBOX + 10), EgtMsg(MSG_SIMULATION + 5), MessageBoxButton.OK, MessageBoxImage.Error)
EgtMessageBoxV.Show(Application.Current.MainWindow, 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)
+20 -10
View File
@@ -322,7 +322,8 @@ Public Class SliceManagerVM
End If
EgtGetCurrFilePath(sCurrProject)
If String.IsNullOrWhiteSpace(sCurrProject) Or EgtGetFileType(sCurrProject) <> FT.NGE Then
MessageBox.Show("Save project before calculating slices!", "Error", MessageBoxButton.OK, MessageBoxImage.Error)
'MessageBox.Show("Save project before calculating slices!", "Error", MessageBoxButton.OK, MessageBoxImage.Error)
EgtMessageBoxV.Show(Application.Current.MainWindow, "Save project before calculating slices!", "Error", MessageBoxButton.OK, MessageBoxImage.Error)
Return False
End If
' mostro barre di caricamento
@@ -396,7 +397,8 @@ Public Class SliceManagerVM
Map.refTopPanelVM.SelPart.RefreshPrintLayers()
' in caso di errore, segnalazione
If Not bOk Then
MessageBox.Show("Error in slicing! See log file.", "Error", MessageBoxButton.OK, MessageBoxImage.Error)
'MessageBox.Show("Error in slicing! See log file.", "Error", MessageBoxButton.OK, MessageBoxImage.Error)
EgtMessageBoxV.Show(Application.Current.MainWindow, "Error in slicing! See log file.", "Error", MessageBoxButton.OK, MessageBoxImage.Error)
End If
If bOk And m_bGenerate Then
' verifico esistenza e correttezza machgroup
@@ -424,7 +426,8 @@ Public Class SliceManagerVM
Else
sOut &= sMsg
End If
MessageBox.Show(sOut, "Error", MessageBoxButton.OK, MessageBoxImage.Error)
'MessageBox.Show(sOut, "Error", MessageBoxButton.OK, MessageBoxImage.Error)
EgtMessageBoxV.Show(Application.Current.MainWindow, sOut, "Error", MessageBoxButton.OK, MessageBoxImage.Error)
End If
End If
' aggiorno tempo e massa
@@ -481,7 +484,8 @@ Public Class SliceManagerVM
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)
'MessageBox.Show(EgtMsg(5463) & " " & sInitMachScriptPath, EgtMsg(5461), MessageBoxButton.OK, MessageBoxImage.Error)
EgtMessageBoxV.Show(Application.Current.MainWindow, EgtMsg(5463) & " " & sInitMachScriptPath, EgtMsg(5461), MessageBoxButton.OK, MessageBoxImage.Error)
Return False
End If
Dim nErr As Integer = 999
@@ -500,7 +504,8 @@ Public Class SliceManagerVM
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)
'MessageBox.Show(EgtMsg(5464) & " " & sExitMachScriptPath, EgtMsg(5461), MessageBoxButton.OK, MessageBoxImage.Error)
EgtMessageBoxV.Show(Application.Current.MainWindow, EgtMsg(5464) & " " & sExitMachScriptPath, EgtMsg(5461), MessageBoxButton.OK, MessageBoxImage.Error)
Return False
End If
Dim nErr As Integer = 999
@@ -536,23 +541,27 @@ Public Class SliceManagerVM
If m_bCalculating Then Return
m_bCalculating = True
If IsNothing(Map.refTopPanelVM.SelPart) Then
MessageBox.Show("No parts to slice!", "Error", MessageBoxButton.OK, MessageBoxImage.Error)
'MessageBox.Show("No parts to slice!", "Error", MessageBoxButton.OK, MessageBoxImage.Error)
EgtMessageBoxV.Show(Application.Current.MainWindow, "No parts to slice!", "Error", MessageBoxButton.OK, MessageBoxImage.Error)
m_bCalculating = False
Return
End If
If IsNothing(Map.refTopPanelVM.SelMaterial) Then
MessageBox.Show("No print material set!", "Error", MessageBoxButton.OK, MessageBoxImage.Error)
'MessageBox.Show("No print material set!", "Error", MessageBoxButton.OK, MessageBoxImage.Error)
EgtMessageBoxV.Show(Application.Current.MainWindow, "No print material set!", "Error", MessageBoxButton.OK, MessageBoxImage.Error)
m_bCalculating = False
Return
End If
If IsNothing(Map.refTopPanelVM.SelMachining) OrElse IsNothing(Map.refTopPanelVM.CurrMachining) OrElse Map.refTopPanelVM.CurrMachining.dCurrStrandH <= 0 Then
MessageBox.Show("No print parameters set!", "Error", MessageBoxButton.OK, MessageBoxImage.Error)
'MessageBox.Show("No print parameters set!", "Error", MessageBoxButton.OK, MessageBoxImage.Error)
EgtMessageBoxV.Show(Application.Current.MainWindow, "No print parameters set!", "Error", MessageBoxButton.OK, MessageBoxImage.Error)
m_bCalculating = False
Return
End If
Dim b3Print As BBox3d = Map.refDispositionPanelVM.GetSolidForReferenceBBox(Map.refTopPanelVM.SelPart)
If Not String.IsNullOrWhiteSpace(CurrentMachine.sMachDataIniFile) AndAlso Not CurrentMachine.b3ExtrusionArea.EnclosesXY(b3Print) Then
MessageBox.Show("Part outside the extrusion area!", "Error", MessageBoxButton.OK, MessageBoxImage.Error)
'MessageBox.Show("Part outside the extrusion area!", "Error", MessageBoxButton.OK, MessageBoxImage.Error)
EgtMessageBoxV.Show(Application.Current.MainWindow, "Part outside the extrusion area!", "Error", MessageBoxButton.OK, MessageBoxImage.Error)
m_bCalculating = False
Return
End If
@@ -714,7 +723,8 @@ Public Class SliceManagerVM
Process.Start("Notepad.exe", sIsoFilePath)
' altrimenti lo segnalo
Else
MessageBox.Show("Edit failed, missing part program file" & " (" & sIsoFilePath & ")")
'MessageBox.Show("Edit failed, missing part program file" & " (" & sIsoFilePath & ")")
EgtMessageBoxV.Show(Application.Current.MainWindow, "Edit failed, missing part program file" & " (" & sIsoFilePath & ")")
End If
End If
NotifyPropertyChanged(NameOf(Time_Visibility))
+2 -1
View File
@@ -752,7 +752,8 @@ Public Class TopPanelVM
Public Sub Machining()
If IsNothing(m_SelPart) OrElse IsNothing(CurrMachining) Then Return
If IsNothing(m_SelMachining) Then
MessageBox.Show("Select current Db Machining first!", "Warning", MessageBoxButton.OK, MessageBoxImage.Exclamation)
'MessageBox.Show("Select current Db Machining first!", "Warning", MessageBoxButton.OK, MessageBoxImage.Exclamation)
EgtMessageBoxV.Show(Application.Current.MainWindow, "Select current Db Machining first!", "Warning", MessageBoxButton.OK, MessageBoxImage.Exclamation)
Return
End If
SelPage = Pages.CURRMACHINING