Migliorata gestione avvio programma in cieco
This commit is contained in:
@@ -1017,8 +1017,10 @@ Public Class AssemblyManagerVM
|
||||
If OptionModule.AdjustDDT Then
|
||||
DdfFile.WriteDDFPart(OpenedAssName.SelAssembly.ListPartDoor(0).Door, OptionModule.SaveFileNameFromArgs, True, False)
|
||||
' TERMINO TUTTO SUBITO
|
||||
BlindProgLog("Scrittura file '.ddf' terminata")
|
||||
End
|
||||
EgtOutLog("Scrittura file '.ddf' terminata")
|
||||
EgtExit()
|
||||
Application.Current.Shutdown(0)
|
||||
Return True
|
||||
End If
|
||||
' aggiorno elenco quotature
|
||||
Map.refDimensioningPanelVM.LoadHardwareDimList()
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
Imports EgtWPFLib5
|
||||
Imports EgtUILib
|
||||
|
||||
Class MainWindowV
|
||||
|
||||
@@ -12,6 +13,7 @@ Class MainWindowV
|
||||
InitializeComponent()
|
||||
' Per leggere più argomenti devono essere scritti ognuno tra doppi apici e separati da spazio
|
||||
' Esempio:"Argomento 1 di prova" "Argomento 2 di prova"
|
||||
EgtOutLog(" 1 Numero argomenti: " & args.Length.ToString)
|
||||
If args.Length > 0 Then
|
||||
m_args = args
|
||||
RunBlindCode()
|
||||
@@ -32,7 +34,7 @@ Class MainWindowV
|
||||
|
||||
Private Sub MainWindowV_Unloaded(sender As Object, e As System.ComponentModel.CancelEventArgs) Handles Me.Closing
|
||||
' Salvo posizione finestra (se non minimizzata)
|
||||
If WindowState <> WindowState.Minimized Then
|
||||
If WindowState <> WindowState.Minimized And Not OptionModule.AdjustDDT Then
|
||||
WinPosFromWindowToIni(Me, S_GENERAL, K_WINPLACE)
|
||||
End If
|
||||
End Sub
|
||||
@@ -50,33 +52,34 @@ Class MainWindowV
|
||||
' Lettura degli argomenti e scrittura di un file di Log con i parametri caricati
|
||||
Private Sub ReadArgs()
|
||||
If Not IsNothing(m_args) Then
|
||||
StartBlinProgdLog(IniFile.m_sTempDir & "\BlindProgLog.txt")
|
||||
' leggo gli argomenti: Il programma si chiude appena termina la scrittura del file DDF
|
||||
Dim Items() As String = m_args(0).Split(";"c)
|
||||
EgtOutLog(" Argomenti: " & m_args.ToString)
|
||||
If Items.Length >= 5 Then
|
||||
' Avvio progetto - LauncherOpt.Open_last_project (1)
|
||||
OptionModule.m_bLauncherOpenOnce = True
|
||||
' Indico il percorso del file
|
||||
OptionModule.FileNameFromArgs = Items(0)
|
||||
BlindProgLog(" File '.ddt' input : " & OptionModule.FileNameFromArgs)
|
||||
EgtOutLog(" File '.ddt' input : " & OptionModule.FileNameFromArgs)
|
||||
' Assegno i valore Width, Height, Thickness
|
||||
OptionModule.m_Width = Items(1)
|
||||
BlindProgLog(" width : " & OptionModule.m_Width)
|
||||
EgtOutLog(" width : " & OptionModule.m_Width)
|
||||
OptionModule.m_Height = Items(2)
|
||||
BlindProgLog(" height : " & OptionModule.m_Height)
|
||||
EgtOutLog(" height : " & OptionModule.m_Height)
|
||||
OptionModule.m_Thickness = Items(3)
|
||||
BlindProgLog(" thickness : " & OptionModule.m_Thickness)
|
||||
EgtOutLog(" thickness : " & OptionModule.m_Thickness)
|
||||
' Indico il percoso di salvataggio file DDF
|
||||
OptionModule.SaveFileNameFromArgs = Items(4)
|
||||
BlindProgLog(" File '.ddf' output : " & OptionModule.SaveFileNameFromArgs)
|
||||
EgtOutLog(" File '.ddf' output : " & OptionModule.SaveFileNameFromArgs)
|
||||
' Nuovo parametro da laggere per gestione Swing
|
||||
If Items.Length = 6 Then
|
||||
OptionModule.ForcesSideSwing = Items(5)
|
||||
BlindProgLog(" swing : " & OptionModule.ForcesSideSwing)
|
||||
EgtOutLog(" swing : " & OptionModule.ForcesSideSwing)
|
||||
End If
|
||||
' abilito lettura dati
|
||||
OptionModule.AdjustDDT = True
|
||||
Else
|
||||
EgtOutLog(" Argomenti non conformi")
|
||||
' blocco lettura dati
|
||||
OptionModule.AdjustDDT = False
|
||||
' TERMINO TUTTO SUBITO!
|
||||
|
||||
+16
-12
@@ -89,20 +89,20 @@ Public Class MainWindowVM
|
||||
Public ReadOnly Property PageControl As ContentControl
|
||||
Get
|
||||
If m_SelectedPage = ListPageEnum.nDDFPage Then
|
||||
If OptionModule.m_SingleDoor then
|
||||
If OptionModule.m_SingleDoor Then
|
||||
VisibilityAssemblyManager = Visibility.Hidden
|
||||
Else
|
||||
VisibilityAssemblyManager = Visibility.Visible
|
||||
End If
|
||||
End If
|
||||
NotifyPropertyChanged("AssemblyManagerControl")
|
||||
NotifyPropertyChanged("ProjectManagerControl")
|
||||
Return m_PartPage
|
||||
ElseIf m_SelectedPage = ListPageEnum.nAssemblyPage Then
|
||||
If OptionModule.m_SingleDoor then
|
||||
If OptionModule.m_SingleDoor Then
|
||||
VisibilityAssemblyManager = Visibility.Hidden
|
||||
Else
|
||||
VisibilityAssemblyManager = Visibility.Visible
|
||||
End If
|
||||
End If
|
||||
NotifyPropertyChanged("AssemblyManagerControl")
|
||||
NotifyPropertyChanged("ProjectManagerControl")
|
||||
Return m_AssemblyPage
|
||||
@@ -112,11 +112,11 @@ Public Class MainWindowVM
|
||||
NotifyPropertyChanged("ProjectManagerControl")
|
||||
Return m_HardwarePage
|
||||
Else
|
||||
If OptionModule.m_SingleDoor then
|
||||
If OptionModule.m_SingleDoor Then
|
||||
VisibilityAssemblyManager = Visibility.Hidden
|
||||
Else
|
||||
VisibilityAssemblyManager = Visibility.Visible
|
||||
End If
|
||||
End If
|
||||
NotifyPropertyChanged("AssemblyManagerControl")
|
||||
NotifyPropertyChanged("ProjectManagerControl")
|
||||
Return Nothing
|
||||
@@ -142,7 +142,7 @@ Public Class MainWindowVM
|
||||
|
||||
Public ReadOnly Property ProjectManagerControl As ContentControl
|
||||
Get
|
||||
If m_SelectedPage <> ListPageEnum.nHardwarePage then
|
||||
If m_SelectedPage <> ListPageEnum.nHardwarePage Then
|
||||
Return m_ProjectManager
|
||||
Else
|
||||
ProjectNameMsg = "HardwareManager"
|
||||
@@ -158,6 +158,8 @@ Public Class MainWindowVM
|
||||
End Property
|
||||
|
||||
Sub New()
|
||||
EgtOutLog(" Creazione e inizializzazone MainWondowVM ")
|
||||
|
||||
Map.SetRefMainWindowVM(Me)
|
||||
m_AssemblyPage = New AssemblyPageV
|
||||
m_AssemblyPage.DataContext = New AssemblyPageVM
|
||||
@@ -167,8 +169,10 @@ Public Class MainWindowVM
|
||||
m_ProjectManager.DataContext = New ProjectManagerVM
|
||||
m_PartPage = New PartPageV
|
||||
m_PartPage.DataContext = New PartPageVM
|
||||
m_HardwarePage = New HardwarePageV
|
||||
m_HardwarePage.DataContext = New HardwarePageVM
|
||||
If OptionModule.AdjustDDT Then
|
||||
m_HardwarePage = New HardwarePageV
|
||||
m_HardwarePage.DataContext = New HardwarePageVM
|
||||
End If
|
||||
m_AssemblyManager = New AssemblyManagerV
|
||||
m_AssemblyManager.DataContext = New AssemblyManagerVM
|
||||
' inserisco la scena
|
||||
@@ -316,7 +320,7 @@ Public Class MainWindowVM
|
||||
If m_SelectedPage = ListPageEnum.nHardwarePage Then Return
|
||||
If StartReload Then Return
|
||||
' 50545 = It has been deleted file: {0}, {1}.
|
||||
Dim Message As String = String.Format(EgtMsg(50545), e.FullPath, e.ChangeType)
|
||||
Dim Message As String = String.Format(EgtMsg(50545), e.FullPath, e.ChangeType)
|
||||
selectedWatcher = WatcherCalling.OnDeleted
|
||||
Application.Current.Dispatcher.BeginInvoke(New Action(Sub()
|
||||
RaiseEvent Er(Message, e.FullPath)
|
||||
@@ -329,7 +333,7 @@ Public Class MainWindowVM
|
||||
If m_SelectedPage = ListPageEnum.nHardwarePage Then Return
|
||||
If StartReload Then Return
|
||||
' 50543 = It has been renamed file: {0}, {1}.
|
||||
Dim Message As String = String.Format(EgtMsg(50543), e.FullPath, e.ChangeType)
|
||||
Dim Message As String = String.Format(EgtMsg(50543), e.FullPath, e.ChangeType)
|
||||
selectedWatcher = WatcherCalling.OnRenamed
|
||||
Application.Current.Dispatcher.BeginInvoke(New Action(Sub()
|
||||
RaiseEvent Er(Message, e.FullPath)
|
||||
@@ -342,7 +346,7 @@ Public Class MainWindowVM
|
||||
If m_SelectedPage = ListPageEnum.nHardwarePage Then Return
|
||||
If StartReload Then Return
|
||||
' 50544 = It has been created new file: {0}, {1}.
|
||||
Dim Message As String =String.Format(EgtMsg(50544), e.FullPath, e.ChangeType)
|
||||
Dim Message As String = String.Format(EgtMsg(50544), e.FullPath, e.ChangeType)
|
||||
selectedWatcher = WatcherCalling.OnCreated
|
||||
Application.Current.Dispatcher.BeginInvoke(New Action(Sub()
|
||||
RaiseEvent Er(Message, e.FullPath)
|
||||
|
||||
@@ -72,5 +72,5 @@ Imports System.Windows
|
||||
' by using the '*' as shown below:
|
||||
' <Assembly: AssemblyVersion("1.0.*")>
|
||||
|
||||
<Assembly: AssemblyVersion("2.6.12.2")>
|
||||
<Assembly: AssemblyFileVersion("2.6.12.2")>
|
||||
<Assembly: AssemblyVersion("2.6.12.3")>
|
||||
<Assembly: AssemblyFileVersion("2.6.12.3")>
|
||||
|
||||
@@ -1006,6 +1006,10 @@ Public Class ProjectManagerVM
|
||||
Else
|
||||
EgtOutLog("LastProject '" & OptionModule.m_sLastProject & "' is not a file or does not exist!")
|
||||
Map.refMainWindowVM.SelectedPage = MainWindowVM.ListPageEnum.nNothingSelected
|
||||
If OptionModule.AdjustDDT Then
|
||||
EgtExit()
|
||||
Application.Current.Shutdown(3)
|
||||
End If
|
||||
Return
|
||||
End If
|
||||
Else
|
||||
|
||||
-22
@@ -719,28 +719,6 @@ Public Module Utility
|
||||
Next
|
||||
End Sub
|
||||
|
||||
#Region "Create Log"
|
||||
Private sFileBlindProgLog As System.IO.StreamWriter
|
||||
Private sFilePath As String = String.Empty
|
||||
|
||||
Public Sub StartBlinProgdLog(sPath As String)
|
||||
sFilePath = sPath
|
||||
sFileBlindProgLog = New System.IO.StreamWriter(sPath, True)
|
||||
Dim sInfoStart As String = Date.Now.ToString & " Avvio programma in cieco"
|
||||
sInfoStart &= vbCrLf & My.Application.Info.Version.Major.ToString() & "." & My.Application.Info.Version.Minor.ToString() &
|
||||
(ChrW(97 - 1 + My.Application.Info.Version.Build)).ToString() & My.Application.Info.Version.Revision.ToString()
|
||||
sFileBlindProgLog.WriteLine(sInfoStart)
|
||||
sFileBlindProgLog.Close()
|
||||
End Sub
|
||||
|
||||
Public Sub BlindProgLog(sMsg As String)
|
||||
sFileBlindProgLog = File.AppendText(sFilePath)
|
||||
sFileBlindProgLog.WriteLine(sMsg)
|
||||
sFileBlindProgLog.Close()
|
||||
End Sub
|
||||
|
||||
#End Region
|
||||
|
||||
End Module
|
||||
|
||||
Public Class CompoBrandDir
|
||||
|
||||
Reference in New Issue
Block a user