OmagCUT 2.2d5 :

- sistemazioni per Polishing
- dopo la scelta nuova licenza il programma si riavvia automaticamente.
This commit is contained in:
Dario Sassi
2020-05-04 06:10:37 +00:00
parent 758290bd76
commit 174e6fd47c
6 changed files with 161 additions and 94 deletions
+7
View File
@@ -61,6 +61,9 @@ Public Class Polishing
m_bPoliOk = False
UpdateSimulOkBtn()
End If
' Rendo semitrasparente il grezzo
Dim nRawSolidId = EgtGetFirstNameInGroup(m_CurrProjPage.m_nRawId, NAME_RAW_SOLID)
EgtSetAlpha( nRawSolidId, 60)
' Aggiorno visualizzazione
EgtDraw()
End Sub
@@ -79,6 +82,10 @@ Public Class Polishing
' Nascondo la macchina
m_MainWindow.m_DirectCutPageUC.m_bShowMachine = False
EgtSetMachineLook(MCH_LOOK.TAB)
' Ripristino opacità del grezzo
Dim nRawSolidId = EgtGetFirstNameInGroup(m_CurrProjPage.m_nRawId, NAME_RAW_SOLID)
EgtSetAlpha( nRawSolidId, 100)
' Aggiorno visualizzazione
EgtDraw()
End If
' Dichiaro pagina non attiva
+96 -46
View File
@@ -9,9 +9,14 @@ Public Class SetUpPage
' Riferimento alla MainWindow
Private m_MainWindow As MainWindow = DirectCast(Application.Current.MainWindow, MainWindow)
' Riferimento alla macchina corrente
Private m_CurrMachine As CurrentMachine = m_MainWindow.m_CurrentMachine
Private m_ToolTreeList As New ObservableCollection(Of CathegoryItem)
Private m_DrillbitsList As CathegoryItem
Private m_MillsList As CathegoryItem
Private m_CupsList As CathegoryItem
Private m_PolishingsList As CathegoryItem
Private m_SetUpToolsList As New CathegoryItem(String.Empty, 0)
Private Sub SetUpPage_Initialized(sender As Object, e As EventArgs) Handles Me.Initialized
@@ -21,10 +26,10 @@ Public Class SetUpPage
' Assegno la lista utensili come sorgente dell'albero
ToolTree.ItemsSource = m_ToolTreeList
If m_MainWindow.m_CurrentMachine.MountedToolConfig = CurrentMachine.MountedToolConfigs.TOOLCHANGER Then
If m_CurrMachine.MountedToolConfig = CurrentMachine.MountedToolConfigs.TOOLCHANGER Then
'' Cambio utensile macchina
' Modifico numero colonne della griglia in base al numero di porta utensili disponibili sulla macchina
Dim ColNum As Integer = CInt(Math.Ceiling(m_MainWindow.m_CurrentMachine.ToolChangerNbr / 5.0))
Dim ColNum As Integer = CInt( Math.Ceiling( m_CurrMachine.ToolChangerNbr / 5.0))
If ColNum > 12 Then
EgtOutLog("TC warning : too many tools (max 12 * 5)")
ColNum = 12
@@ -38,15 +43,15 @@ Public Class SetUpPage
TlChGrid.ColumnDefinitions.RemoveAt(Index * 2 - 2)
Next
' Modifico il numero di elementi presenti sull'ultima colonna
For Index = ColNum * 5 To m_MainWindow.m_CurrentMachine.ToolChangerNbr + 1 Step -1
For Index = ColNum * 5 To m_CurrMachine.ToolChangerNbr + 1 Step -1
TlChGrid.Children.Remove(GetTlChPosFromIndex(Index))
TlChGrid.Children.Remove(GetTxBxFromIndex(Index))
Next
' Assegno lunghezza alla scrollviewer
TlChGrid.Width = m_MainWindow.ActualWidth / 15 * 1.6 * ColNum * 2
' Carico i nomi dei portautensili
For Index = 1 To m_MainWindow.m_CurrentMachine.ToolChangerNbr
GetTlChPosFromIndex(Index).PositionNameTxBl.Text = m_MainWindow.m_CurrentMachine.ToolChangerName(Index - 1)
For Index = 1 To m_CurrMachine.ToolChangerNbr
GetTlChPosFromIndex(Index).PositionNameTxBl.Text = m_CurrMachine.ToolChangerName(Index - 1)
Next
Else
SetUpPageGrid.Children.Remove(TlChScVw)
@@ -54,7 +59,7 @@ Public Class SetUpPage
'' Cambio utensile manuale
' Modifico numero colonne della griglia in base al numero di porta utensili disponibili sulla macchina
Dim ManColNum As Integer = CInt(Math.Ceiling(m_MainWindow.m_CurrentMachine.ManualToolChangerNbr / 5.0))
Dim ManColNum As Integer = CInt( Math.Ceiling( m_CurrMachine.ManualToolChangerNbr / 5.0))
If ManColNum > 12 Then
EgtOutLog("ManTC warning : too many tools (max 12 * 5)")
ManColNum = 12
@@ -68,24 +73,24 @@ Public Class SetUpPage
ManTlChGrid.ColumnDefinitions.RemoveAt(Index * 2 - 2)
Next
' Modifico il numero di elementi presenti sull'ultima colonna
For Index = ManColNum * 5 To m_MainWindow.m_CurrentMachine.ManualToolChangerNbr + 1 Step -1
For Index = ManColNum * 5 To m_CurrMachine.ManualToolChangerNbr + 1 Step -1
ManTlChGrid.Children.Remove(GetManTlChPosFromIndex(Index))
ManTlChGrid.Children.Remove(GetManTxBxFromIndex(Index))
Next
' Assegno lunghezza alla scrollviewer
ManTlChGrid.Width = m_MainWindow.ActualWidth / 15 * 1.6 * ManColNum * 2
' Carico i nomi dei portautensili
For Index = 1 To m_MainWindow.m_CurrentMachine.ManualToolChangerNbr
GetManTlChPosFromIndex(Index).PositionNameTxBl.Text = m_MainWindow.m_CurrentMachine.ManualToolChangerName(Index - 1)
For Index = 1 To m_CurrMachine.ManualToolChangerNbr
GetManTlChPosFromIndex(Index).PositionNameTxBl.Text = m_CurrMachine.ManualToolChangerName(Index - 1)
Next
' Se portautensili della macchina presente
If m_MainWindow.m_CurrentMachine.MountedToolConfig = CurrentMachine.MountedToolConfigs.TOOLCHANGER Then
If m_CurrMachine.MountedToolConfig = CurrentMachine.MountedToolConfigs.TOOLCHANGER Then
' Apro quello
TlChScVw.Visibility = Windows.Visibility.Visible
ToolChangerBtn.IsChecked = True
' Lascio bottoni di scelta solo se ci sono anche utensili manuali
If m_MainWindow.m_CurrentMachine.ManualToolChangerNbr = 0 Then
If m_CurrMachine.ManualToolChangerNbr = 0 Then
ToolChangerBtn.Visibility = Windows.Visibility.Hidden
ManualToolChangerBtn.Visibility = Windows.Visibility.Hidden
End If
@@ -101,13 +106,15 @@ Public Class SetUpPage
Private Sub SetUpPage_Loaded(sender As Object, e As RoutedEventArgs) Handles Me.Loaded
' Inizializzo le famiglie di utensili nell'albero
EgtSetCurrentContext(m_MainWindow.m_CurrentProjectPageUC.CurrentProjectScene.GetCtx())
InitializeToolFamily(K_DRILLBIT, MCH_TF.DRILLBIT, EgtMsg(MSG_TOOLSDBPAGEUC + 32), m_DrillbitsList)
InitializeToolFamily(K_MILL, MCH_TF.MILL, EgtMsg(MSG_TOOLSDBPAGEUC + 33), m_MillsList)
InitializeToolGroup( m_CurrMachine.bDrill, MCH_TY.DRILL_STD, EgtMsg( 90752), m_DrillbitsList)
InitializeToolGroup( m_CurrMachine.bMill, MCH_TY.MILL_STD, EgtMsg( 90753), m_MillsList)
InitializeToolGroup( m_CurrMachine.bCupWheel, MCH_TY.MILL_NOTIP, EgtMsg( 90754), m_CupsList)
InitializeToolGroup( m_CurrMachine.bPolishingWheel, MCH_TY.MILL_POLISHING, EgtMsg( 90756), m_PolishingsList)
' Posiziono utensili già posizionati sul portautensili
For Each ToolPosition In m_MainWindow.m_CurrentMachine.ToolChanger
For Each ToolPosition In m_CurrMachine.ToolChanger
If ToolPosition.sTool <> String.Empty Then
If Not IsNothing(m_DrillbitsList) Then
If Not IsNothing( m_DrillbitsList) Then
For Each Item In m_DrillbitsList.Items
If Item.Name = ToolPosition.sTool Then
m_SetUpToolsList.Items.Add(Item)
@@ -116,7 +123,7 @@ Public Class SetUpPage
End If
Next
End If
If Not IsNothing(m_MillsList) Then
If Not IsNothing( m_MillsList) Then
For Each Item In m_MillsList.Items
If Item.Name = ToolPosition.sTool Then
m_SetUpToolsList.Items.Add(Item)
@@ -125,15 +132,33 @@ Public Class SetUpPage
End If
Next
End If
If Not IsNothing( m_CupsList) Then
For Each Item In m_CupsList.Items
If Item.Name = ToolPosition.sTool Then
m_SetUpToolsList.Items.Add(Item)
m_CupsList.Items.Remove(Item)
Exit For
End If
Next
End If
If Not IsNothing( m_PolishingsList) Then
For Each Item In m_PolishingsList.Items
If Item.Name = ToolPosition.sTool Then
m_SetUpToolsList.Items.Add(Item)
m_PolishingsList.Items.Remove(Item)
Exit For
End If
Next
End If
GetTlChPosFromIndex(ToolPosition.nPosition).Tool.IsChecked = True
GetTxBxFromIndex(ToolPosition.nPosition).Text = ToolPosition.sTool
End If
Next
' Posiziono utensili già posizionati sul portautensili manuale
For Each ToolPosition In m_MainWindow.m_CurrentMachine.ManualToolChanger
For Each ToolPosition In m_CurrMachine.ManualToolChanger
If ToolPosition.sTool <> String.Empty Then
If Not IsNothing(m_DrillbitsList) Then
If Not IsNothing( m_DrillbitsList) Then
For Each Item In m_DrillbitsList.Items
If Item.Name = ToolPosition.sTool Then
m_SetUpToolsList.Items.Add(Item)
@@ -142,7 +167,7 @@ Public Class SetUpPage
End If
Next
End If
If Not IsNothing(m_MillsList) Then
If Not IsNothing( m_MillsList) Then
For Each Item In m_MillsList.Items
If Item.Name = ToolPosition.sTool Then
m_SetUpToolsList.Items.Add(Item)
@@ -151,6 +176,24 @@ Public Class SetUpPage
End If
Next
End If
If Not IsNothing( m_CupsList) Then
For Each Item In m_CupsList.Items
If Item.Name = ToolPosition.sTool Then
m_SetUpToolsList.Items.Add(Item)
m_CupsList.Items.Remove(Item)
Exit For
End If
Next
End If
If Not IsNothing( m_PolishingsList) Then
For Each Item In m_PolishingsList.Items
If Item.Name = ToolPosition.sTool Then
m_SetUpToolsList.Items.Add(Item)
m_PolishingsList.Items.Remove(Item)
Exit For
End If
Next
End If
GetManTlChPosFromIndex(ToolPosition.nPosition).Tool.IsChecked = True
GetManTxBxFromIndex(ToolPosition.nPosition).Text = ToolPosition.sTool
End If
@@ -667,19 +710,18 @@ Public Class SetUpPage
End Function
' Funzione che carica gli utensili del Db nell'albero
Friend Sub InitializeToolFamily(sFIniConst As String, nFType As Integer, sFName As String, ByRef ToolCathegory As CathegoryItem)
If GetPrivateProfileInt(S_TOOLS, sFIniConst, 0, m_MainWindow.GetMachIniFile()) = 1 Then
ToolCathegory = New CathegoryItem(sFName, nFType)
Dim nType As Integer = 0
Dim ToolName As String = String.Empty
If EgtTdbGetFirstTool(nFType, ToolName, nType) Then
ToolCathegory.Items.Add(New CustomItem(ToolName, nType))
While EgtTdbGetNextTool(nFType, ToolName, nType)
ToolCathegory.Items.Add(New CustomItem(ToolName, nType))
End While
End If
m_ToolTreeList.Add(ToolCathegory)
End If
Friend Sub InitializeToolGroup( bEnabled As Boolean, nTType As Integer, sFName As String, ByRef ToolCathegory As CathegoryItem)
If Not bEnabled Then Return
' Inserisco categoria ed eventuali elementi
ToolCathegory = New CathegoryItem( sFName, nTType)
Dim nType As Integer = 0
Dim ToolName As String = String.Empty
Dim bFound As Boolean = EgtTdbGetFirstTool( nTType, ToolName, nType)
While bFound
If nType = nTType Then ToolCathegory.Items.Add( New CustomItem( ToolName, nType))
bFound = EgtTdbGetNextTool( nTType, ToolName, nType)
End While
m_ToolTreeList.Add(ToolCathegory)
End Sub
' Funzione che attrezza l'utensile quando viene clickato il portautensile
@@ -729,10 +771,14 @@ Public Class SetUpPage
' Funzione che rimuove l'utensile selezionato dall'albero
Private Sub RemoveToolFromList()
If m_DrillbitsList.Items.Contains(ToolTree.SelectedItem) Then
m_DrillbitsList.Items.Remove(ToolTree.SelectedItem)
ElseIf m_MillsList.Items.Contains(ToolTree.SelectedItem) Then
m_MillsList.Items.Remove(ToolTree.SelectedItem)
If Not IsNothing( m_DrillbitsList) AndAlso m_DrillbitsList.Items.Contains( ToolTree.SelectedItem) Then
m_DrillbitsList.Items.Remove( ToolTree.SelectedItem)
ElseIf Not IsNothing( m_MillsList) AndAlso m_MillsList.Items.Contains( ToolTree.SelectedItem) Then
m_MillsList.Items.Remove( ToolTree.SelectedItem)
ElseIf Not IsNothing( m_CupsList) AndAlso m_CupsList.Items.Contains( ToolTree.SelectedItem) Then
m_CupsList.Items.Remove( ToolTree.SelectedItem)
ElseIf Not IsNothing( m_PolishingsList) AndAlso m_PolishingsList.Items.Contains( ToolTree.SelectedItem) Then
m_PolishingsList.Items.Remove( ToolTree.SelectedItem)
End If
End Sub
@@ -740,10 +786,14 @@ Public Class SetUpPage
Private Sub RestoreToolInList(sToolName As String)
For Each Tool In m_SetUpToolsList.Items
If Tool.Name = sToolName Then
If Tool.nType = 256 Then
If Tool.nType = MCH_TY.DRILL_STD Then
m_DrillbitsList.Items.Add(Tool)
ElseIf Tool.nType = 1024 Then
ElseIf Tool.nType = MCH_TY.MILL_STD Then
m_MillsList.Items.Add(Tool)
ElseIf Tool.nType = MCH_TY.MILL_NOTIP Then
m_CupsList.Items.Add(Tool)
ElseIf Tool.nType = MCH_TY.MILL_POLISHING Then
m_PolishingsList.Items.Add(Tool)
End If
m_SetUpToolsList.Items.Remove(Tool)
Return
@@ -1023,12 +1073,12 @@ Public Class SetUpPage
' Funzione che salva lo stato dei portautensili
Private Sub SaveToolChangerStatus()
' Salvo attrezzaggio automatico
For Index As Integer = 1 To m_MainWindow.m_CurrentMachine.ToolChangerNbr
m_MainWindow.m_CurrentMachine.ToolPos(Index - 1) = GetTxBxFromIndex(Index).Text
For Index As Integer = 1 To m_CurrMachine.ToolChangerNbr
m_CurrMachine.ToolPos(Index - 1) = GetTxBxFromIndex(Index).Text
Next
' Salvo attrezzaggio manuale
For Index As Integer = 1 To m_MainWindow.m_CurrentMachine.ManualToolChangerNbr
m_MainWindow.m_CurrentMachine.ManualToolPos(Index - 1) = GetManTxBxFromIndex(Index).Text
For Index As Integer = 1 To m_CurrMachine.ManualToolChangerNbr
m_CurrMachine.ManualToolPos(Index - 1) = GetManTxBxFromIndex(Index).Text
Next
' Salvo DB utensili
EgtTdbSave()
@@ -1069,7 +1119,7 @@ Public Class SetUpPage
EgtTdbGetCurrToolParam(MCH_TP.TCPOS, ToolPositionName)
If String.IsNullOrEmpty(ToolPositionName) Then Return
' Cerco il portautensile nella lista degli automatici per vederne lo stato
For Each TlChPos In m_MainWindow.m_CurrentMachine.ToolChanger
For Each TlChPos In m_CurrMachine.ToolChanger
If TlChPos.sName = ToolPositionName Then
' Se la posizione è libera
If GetTxBxFromIndex(TlChPos.nPosition).Text = String.Empty Then
@@ -1081,13 +1131,13 @@ Public Class SetUpPage
RemoveToolFromList()
Else
' Altrimenti segnalo che la posizione è già occupata
Dim InfoMsgBox As New EgtMsgBox(m_MainWindow, "IMPOSSIBILE ESEGUIRE IL COMANDO", "Portautensile predefinito già occupato", EgtMsgBox.Buttons.OK, EgtMsgBox.Icons.ESCLAMATION)
Dim InfoMsgBox As New EgtMsgBox(m_MainWindow, "", EgtMsg( 90759), EgtMsgBox.Buttons.OK, EgtMsgBox.Icons.ESCLAMATION)
End If
Return
End If
Next
' Cerco il portautensile nella lista dei manuali per vederne lo stato
For Each ManTlChPos In m_MainWindow.m_CurrentMachine.ManualToolChanger
For Each ManTlChPos In m_CurrMachine.ManualToolChanger
If ManTlChPos.sName = ToolPositionName Then
' Se la posizione è libera
If GetManTxBxFromIndex(ManTlChPos.nPosition).Text = String.Empty Then
@@ -1099,7 +1149,7 @@ Public Class SetUpPage
RemoveToolFromList()
Else
' Altrimenti segnalo che la posizione è già occupata
Dim InfoMsgBox As New EgtMsgBox(m_MainWindow, "IMPOSSIBILE ESEGUIRE IL COMANDO", "Portautensile predefinito già occupato", EgtMsgBox.Buttons.OK, EgtMsgBox.Icons.ESCLAMATION)
Dim InfoMsgBox As New EgtMsgBox(m_MainWindow, "", EgtMsg( 90759), EgtMsgBox.Buttons.OK, EgtMsgBox.Icons.ESCLAMATION)
End If
Return
End If
+1 -1
View File
@@ -1706,8 +1706,8 @@ Class MainWindow
EgtLuaResetGlobVar( "CHM")
' Riavvio
If nRestart = 1 Then
Close()
Process.Start( Application.ResourceAssembly.Location)
Application.Current.Shutdown()
End If
End If
End If
+2 -2
View File
@@ -62,5 +62,5 @@ Imports System.Windows
' by using the '*' as shown below:
' <Assembly: AssemblyVersion("1.0.*")>
<Assembly: AssemblyVersion("2.2.3.1")>
<Assembly: AssemblyFileVersion("2.2.3.1")>
<Assembly: AssemblyVersion("2.2.4.5")>
<Assembly: AssemblyFileVersion("2.2.4.5")>
+40 -35
View File
@@ -96,49 +96,54 @@ Public Class CurrentProjectPageUC
If Not CurrentProjectScene.Init() Then
' Rimuovo l'host della scena perchè altrimenti rimarrebbe il buco!!
Me.CurrentProjectPageGrid.Children.Remove(CurrentProjectSceneHost)
Dim MissingKeyWnd As EgtMsgBox
' Flag per riavvio programma
Dim bRestart As Boolean = False
#If TRIAL Then
MissingKeyWnd = New EgtMsgBox(m_MainWindow, EgtMsg(MSG_MISSINGKEYWD + 1), EgtMsg(MSG_MISSINGKEYWD + 5) & " " & EgtMsg(MSG_MISSINGKEYWD + 7), EgtMsgBox.Buttons.OK, EgtMsgBox.Icons.NULL, 0, 1)
Dim MissingKeyWnd As New EgtMsgBox(m_MainWindow, EgtMsg(MSG_MISSINGKEYWD + 1), EgtMsg(MSG_MISSINGKEYWD + 5) & " " & EgtMsg(MSG_MISSINGKEYWD + 7), EgtMsgBox.Buttons.OK, EgtMsgBox.Icons.NULL, 0, 1)
#Else
If m_MainWindow.GetKeyLevel() = -1 Or m_MainWindow.GetKeyLevel() = -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)
MissingKeyWnd = New EgtMsgBox(m_MainWindow, EgtMsg(MSG_MISSINGKEYWD + 1), EgtMsg(MSG_MISSINGKEYWD + 2) & " " & EgtMsg(MSG_MISSINGKEYWD + 3), EgtMsgBox.Buttons.OK, EgtMsgBox.Icons.NULL)
' Se manca la chiave
If m_MainWindow.GetKeyLevel() = -1 Or m_MainWindow.GetKeyLevel() = -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)
Dim MissingKeyWnd As New EgtMsgBox(m_MainWindow, EgtMsg(MSG_MISSINGKEYWD + 1), EgtMsg(MSG_MISSINGKEYWD + 2) & " " & EgtMsg(MSG_MISSINGKEYWD + 3), EgtMsgBox.Buttons.OK, EgtMsgBox.Icons.NULL)
' 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 sKeyInfo As String = "" : EgtGetKeyInfo( sKeyInfo)
Dim sText As String = sKeyInfo & vbCrLf & EgtMsg(MSG_MISSINGKEYWD + 5) & vbCrLf & EgtMsg(MSG_MISSINGKEYWD + 6)
Dim sTitle As String = EgtMsg(MSG_MISSINGKEYWD + 1)
MissingKeyWnd = New EgtMsgBox(m_MainWindow, sTitle, sText, EgtMsgBox.Buttons.OK, EgtMsgBox.Icons.NULL, 0, 2)
If MissingKeyWnd.DialogResult = True 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
}
If LicDlg.ShowDialog() = True Then
' Recupero il direttorio del file
Dim sDir As String = System.IO.Path.GetDirectoryName(LicDlg.FileName)
' Se il file non è già nel direttorio di configurazione lo copio
If Not String.Equals(System.IO.Path.GetFullPath(sDir), System.IO.Path.GetFullPath(m_MainWindow.GetConfigDir()), StringComparison.OrdinalIgnoreCase) Then
Try
System.IO.File.Copy(LicDlg.FileName, System.IO.Path.Combine(m_MainWindow.GetConfigDir(), LicDlg.SafeFileName), True)
Catch ex As Exception
End Try
Else
EgtOutLog("Problems with Licence")
' Box di avviso licenza con problemi : "Programma senza licenza. \n Caricala e riavvia il programma." "Errore"
Dim sKeyInfo As String = "" : EgtGetKeyInfo( sKeyInfo)
Dim sText As String = sKeyInfo & vbCrLf & EgtMsg(MSG_MISSINGKEYWD + 5) & vbCrLf & EgtMsg(MSG_MISSINGKEYWD + 6)
Dim sTitle As String = EgtMsg(MSG_MISSINGKEYWD + 1)
Dim MissingKeyWnd As New EgtMsgBox(m_MainWindow, sTitle, sText, EgtMsgBox.Buttons.OK, EgtMsgBox.Icons.NULL, 0, 2)
If MissingKeyWnd.DialogResult = True 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
}
If LicDlg.ShowDialog() = True Then
' Recupero il direttorio del file
Dim sDir As String = System.IO.Path.GetDirectoryName(LicDlg.FileName)
' Se il file non è già nel direttorio di configurazione lo copio
If Not String.Equals(System.IO.Path.GetFullPath(sDir), System.IO.Path.GetFullPath(m_MainWindow.GetConfigDir()), StringComparison.OrdinalIgnoreCase) Then
Try
System.IO.File.Copy(LicDlg.FileName, System.IO.Path.Combine(m_MainWindow.GetConfigDir(), LicDlg.SafeFileName), True)
Catch ex As Exception
End Try
End If
' Imposto il nuovo file di licenza nell'Ini
WritePrivateProfileString(S_GENERAL, K_LICENCE, LicDlg.SafeFileName, m_MainWindow.GetIniFile())
' Imposto riavvio
bRestart = True
End If
' Imposto il nuovo file di licenza nell'Ini
WritePrivateProfileString(S_GENERAL, K_LICENCE, LicDlg.SafeFileName, m_MainWindow.GetIniFile())
End If
End If
End If
#End If
m_MainWindow.Close()
If bRestart Then Process.Start( Application.ResourceAssembly.Location)
End If
' visualizzazione avanzata dei triangoli costituenti le superfici
Dim bShowTriaAdv As Boolean = (GetPrivateProfileInt(S_SCENE, K_SHOWTRIAADV, 1, m_MainWindow.GetIniFile()) <> 0)
+15 -10
View File
@@ -309,32 +309,34 @@ Public Class WorkInProgressPageUC
If Not WorkInProgressScene.Init() Then
' Rimuovo l'host della scena perchè altrimenti rimarrebbe il buco!!
Me.WorkInProgressPageGrid.Children.Remove(WorkInProgressSceneHost)
Dim MissingKeyWnd As EgtMsgBox
' Flag per riavvio programma
Dim bRestart As Boolean = False
#If TRIAL Then
MissingKeyWnd = New EgtMsgBox(m_MainWindow, EgtMsg(MSG_MISSINGKEYWD + 1), EgtMsg(MSG_MISSINGKEYWD + 5) & " " & EgtMsg(MSG_MISSINGKEYWD + 7), EgtMsgBox.Buttons.OK, EgtMsgBox.Icons.NULL, 0, 1)
Dim MissingKeyWnd As New EgtMsgBox(m_MainWindow, EgtMsg(MSG_MISSINGKEYWD + 1), EgtMsg(MSG_MISSINGKEYWD + 5) & " " & EgtMsg(MSG_MISSINGKEYWD + 7), EgtMsgBox.Buttons.OK, EgtMsgBox.Icons.NULL, 0, 1)
#Else
' Se manca la chiave
If m_MainWindow.GetKeyLevel() = -1 Or m_MainWindow.GetKeyLevel() = -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)
MissingKeyWnd = New EgtMsgBox(m_MainWindow, EgtMsg(MSG_MISSINGKEYWD + 1), EgtMsg(MSG_MISSINGKEYWD + 2) & " " & EgtMsg(MSG_MISSINGKEYWD + 3), EgtMsgBox.Buttons.OK, EgtMsgBox.Icons.NULL)
' Altrimenti manca la licenza
Dim MissingKeyWnd As New EgtMsgBox(m_MainWindow, EgtMsg(MSG_MISSINGKEYWD + 1), EgtMsg(MSG_MISSINGKEYWD + 2) & " " & EgtMsg(MSG_MISSINGKEYWD + 3), EgtMsgBox.Buttons.OK, EgtMsgBox.Icons.NULL)
' 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 sKeyInfo As String = "" : EgtGetKeyInfo( sKeyInfo)
Dim sText As String = sKeyInfo & vbCrLf & EgtMsg(MSG_MISSINGKEYWD + 5) & vbCrLf & EgtMsg(MSG_MISSINGKEYWD + 6)
Dim sTitle As String = EgtMsg(MSG_MISSINGKEYWD + 1)
MissingKeyWnd = New EgtMsgBox(m_MainWindow, sTitle, sText, EgtMsgBox.Buttons.OK, EgtMsgBox.Icons.NULL, 0, 2)
Dim MissingKeyWnd As New EgtMsgBox(m_MainWindow, sTitle, sText, EgtMsgBox.Buttons.OK, EgtMsgBox.Icons.NULL, 0, 2)
If MissingKeyWnd.DialogResult = True 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 = System.IO.Path.GetDirectoryName(LicDlg.FileName)
@@ -347,11 +349,14 @@ Public Class WorkInProgressPageUC
End If
' Imposto il nuovo file di licenza nell'Ini
WritePrivateProfileString(S_GENERAL, K_LICENCE, LicDlg.SafeFileName, m_MainWindow.GetIniFile())
' Imposto riavvio
bRestart = True
End If
End If
End If
#End If
m_MainWindow.Close()
If bRestart Then Process.Start( Application.ResourceAssembly.Location)
End If
' dimensione lineare max in pixel delle textures
Dim nTxrMaxLinPix As Integer = GetPrivateProfileInt(S_SCENE, K_TEXMAXLINPIX, 4096, m_MainWindow.GetIniFile())