Files
Emmanuele Sassi cbe9efacbb - introdotta simulazione
- migliorato SliceManager
- introdotto calcolo tempo e massa materiale
2022-09-09 21:06:35 +02:00

98 lines
3.3 KiB
VB.net

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