Merge branch 'SplashScreen' into develop

This commit is contained in:
Emmanuele Sassi
2022-10-28 09:47:34 +02:00
11 changed files with 135 additions and 7 deletions
+8
View File
@@ -5,6 +5,14 @@
Protected Overrides Sub OnStartup(e As StartupEventArgs)
MyBase.OnStartup(e)
ShutdownMode = System.Windows.ShutdownMode.OnMainWindowClose
If e.Args.Count = 0 Then
' creo finestra SplashScreen
Dim SplashScreen As New SplashScreen
Me.MainWindow = SplashScreen
Me.MainWindow.Show()
Map.SetRefSplashScreen(SplashScreen)
End If
' Creo la View principale
Me.MainWindow = New MainWindowV
' Mostro la View principale
+13 -1
View File
@@ -240,6 +240,9 @@
</Compile>
<Compile Include="Special-3dPrinting\Printing3DPanelVM.vb" />
<Compile Include="Special-3dPrinting\Printing3DUtility.vb" />
<Compile Include="SplashScreen\SplashScreen.xaml.vb">
<DependentUpon>SplashScreen.xaml</DependentUpon>
</Compile>
<Compile Include="StartMachPanel\StartMachPanelV.xaml.vb">
<DependentUpon>StartMachPanelV.xaml</DependentUpon>
</Compile>
@@ -429,6 +432,10 @@
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="SplashScreen\SplashScreen.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="StartMachPanel\StartMachPanelV.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
@@ -633,7 +640,12 @@
<ItemGroup>
<Resource Include="Resources\TopPanel\Edit.png" />
</ItemGroup>
<ItemGroup />
<ItemGroup>
<Resource Include="Resources\SplashScreen\GoldSplashscreen.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\SplashScreen\LogoEgalware.png" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />
<PropertyGroup>
<PostBuildEvent>IF "$(PlatformName)"=="x64" IF "$(ConfigurationName)" == "Release" copy $(TargetPath) c:\EgtProg\Icarus\IcarusR64.exe
+4 -4
View File
@@ -202,7 +202,7 @@ Public Class ProjManagerVM
OpenProject(Nothing)
End Sub
Friend Sub OpenProject(sFilePath As String)
Friend Function OpenProject(sFilePath As String) As Boolean
If String.IsNullOrEmpty(sFilePath) Then
' Recupero cartella dell'ultimo progetto aperto
Dim sDir As String = Map.refSceneHostVM.MainController.GetCurrFile()
@@ -212,11 +212,11 @@ Public Class ProjManagerVM
If Not String.IsNullOrWhiteSpace(sDir) Then
sDir = Path.GetDirectoryName(sDir)
End If
Map.refSceneHostVM.MainController.OpenProject(sDir)
Return Map.refSceneHostVM.MainController.OpenProject(sDir)
Else
Map.refSceneHostVM.MainController.OpenProject(sFilePath, False)
Return Map.refSceneHostVM.MainController.OpenProject(sFilePath, False)
End If
End Sub
End Function
#End Region ' OpenCommand
Binary file not shown.

After

Width:  |  Height:  |  Size: 312 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

+47 -2
View File
@@ -1,9 +1,13 @@
Imports EgtWPFLib5
Imports EgtUILib
Imports System.Windows.Threading
Public Class SecondaryWindowVM
Inherits VMBase
Private m_SplashScreen_Timer As New DispatcherTimer
Private m_WaitAfterRender As Integer = 0
' Titolo
Private m_sTitle As String
Public Property sTitle As String
@@ -47,6 +51,12 @@ Public Class SecondaryWindowVM
Sub New()
' Creo riferimento a questa classe in Map
Map.SetRefSecondaryWindowVM(Me)
' imposto e avvio contatore SplashScreen
m_SplashScreen_Timer.Interval = New TimeSpan(0, 0, 0, 0, 500)
AddHandler m_SplashScreen_Timer.Tick, AddressOf SplashScreenTimer_Tick
If Not IsNothing(Map.refSplashScreen) Then
m_SplashScreen_Timer.Start()
End If
End Sub
#End Region ' CONSTRUCTOR
@@ -59,14 +69,49 @@ Public Class SecondaryWindowVM
Map.refMyStatusBarVM.SetSnapPointType(Map.refSceneHostVM.SnapType)
Map.refMyStatusBarVM.SetMeasureUnit(EgtUiUnitsAreMM)
EgtSetView(VT.ISO_SW, False)
' creo nuovo progetto di partenza
Map.refProjManagerVM.NewProject(False)
' provo a caricare progetto da linea di comando
If Not ProcessCommandLine() Then
' altrimenti creo nuovo progetto di partenza
Map.refProjManagerVM.NewProject(False)
End If
' leggo stati visualizzazione layer
Map.refViewLayerManagerVM.UpdateIsVisibleFromIni()
' resetto segnalazione modifiche
EgtResetModified()
' segno su contatore splashscreen render finito
m_WaitAfterRender = 1
End Sub
Private Sub SplashScreenTimer_Tick()
If m_WaitAfterRender > 4 Then
' chiudo SplashScreen
Map.refSplashScreen.Close()
ElseIf m_WaitAfterRender >= 1 Then
m_WaitAfterRender += 1
End If
End Sub
Friend Function ProcessCommandLine() As Boolean
' Se non ci sono veri parametri su linea di comando, esco (il primo è sempre il nome del programma)
If Environment.GetCommandLineArgs.Count() <= 1 Then Return False
' Recupero il primo vero parametro che dovrebbe essere il nome con estensione di un file
Dim sFile As String = Environment.GetCommandLineArgs(1)
Dim sExt As String = IO.Path.GetExtension(sFile).ToLower()
If String.IsNullOrWhiteSpace(sFile) OrElse String.IsNullOrWhiteSpace(sExt) Then Return False
Return OpenStdFile(sFile)
End Function
Friend Function OpenStdFile(sFile As String) As Boolean
Dim nFileType As Integer = EgtGetFileType(sFile)
Select Case nFileType
Case FT.NGE
Return Map.refProjManagerVM.OpenProject(sFile)
'Case FT.DXF, FT.STL, FT._3MF, FT.OBJ, FT.CNC, FT.CSF, FT.BTL, FT.BTLX, FT.IMG, FT.PNT, FT.IGES, FT.STEP_, FT.ACIS, FT.PARASOLID, FT.JT, FT.VRML, FT.C3D
' Return m_Controller.ImportProject(sFile, False)
End Select
Return False
End Function
#Region "COMMANDS"
#Region "AboutBoxCommand"
+41
View File
@@ -0,0 +1,41 @@
<Window x:Class="SplashScreen"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
WindowStartupLocation="CenterScreen"
WindowStyle="None"
AllowsTransparency="True"
Background="Transparent"
Topmost="True"
ShowInTaskbar="False"
Height="600"
Width="1000">
<Grid>
<Image Source="/Resources/SplashScreen/GoldSplashscreen.png"
Stretch="UniformToFill"/>
<TextBlock Text="ICARUS"
Foreground="#b9984c"
FontSize="47"
FontFamily="/Resources/Fonts/#Roboto"
FontWeight="Light"
Margin="463,125,0,0"/>
<TextBlock x:Name="VersionTxBl"
FontSize="14"
FontFamily="/Resources/Fonts/#Roboto"
Margin="500,175,0,0"/>
<Grid Height="180"
Width="92"
VerticalAlignment="Bottom"
Margin="620,0,0,0">
<Image Source="/Resources/SplashScreen/LogoEgalware.png"
Height="180"
Width="92"
Stretch="UniformToFill"/>
<TextBlock Text="2022"
FontSize="12"
FontFamily="/Resources/Fonts/#Roboto"
HorizontalAlignment="Center"
Margin="0,140,0,0"/>
</Grid>
</Grid>
</Window>
+10
View File
@@ -0,0 +1,10 @@
Public Class SplashScreen
Private Sub SplashScreen_Initialized(sender As Object, e As EventArgs) Handles Me.Initialized
VersionTxBl.Text = "Version " & 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()
End Sub
End Class
+12
View File
@@ -60,6 +60,7 @@ Module Map
Private m_refViewLayerManagerVM As ViewLayerManagerVM
Private m_refShellNumberPanelVM As ShellNumberPanelVM
Private m_refShellNumberParamPanelVM As ShellNumberParamPanelVM
Private m_refSplashScreen As SplashScreen
Private m_refModifyPartPanelVM As ModifyPartPanelVM
#Region "Get"
@@ -423,6 +424,12 @@ Module Map
End Get
End Property
Public ReadOnly Property refSplashScreen As SplashScreen
Get
Return m_refSplashScreen
End Get
End Property
Public ReadOnly Property refModifyPartPanelVM As ModifyPartPanelVM
Get
Return m_refModifyPartPanelVM
@@ -732,6 +739,11 @@ Module Map
Return Not IsNothing(m_refShellNumberParamPanelVM)
End Function
Friend Function SetRefSplashScreen(SplashScreen As SplashScreen) As Boolean
m_refSplashScreen = SplashScreen
Return Not IsNothing(m_refSplashScreen)
End Function
Friend Function SetRefModifyPartPanelVM(ModifyPartPanelVM As ModifyPartPanelVM) As Boolean
m_refModifyPartPanelVM = ModifyPartPanelVM
Return Not IsNothing(m_refModifyPartPanelVM)