OmagCut :
- miglioramenti vari.
This commit is contained in:
@@ -89,6 +89,12 @@ Public Class CadCutPageUC
|
||||
Private Sub SaveBtn_Click(sender As Object, e As RoutedEventArgs) Handles SaveBtn.Click
|
||||
Dim sPath As String = m_MainWindow.GetTempDir() & "\" & "CurrProj.nge"
|
||||
EgtSaveFile(sPath, NGE.CMPTEXT)
|
||||
' Ripristino visualizzazione di eventuali pezzi in parcheggio (save li nasconde)
|
||||
Dim nPartId As Integer = EgtGetFirstPart()
|
||||
While nPartId <> GDB_ID.NULL
|
||||
EgtSetStatus(nPartId, GDB_ST.ON_)
|
||||
nPartId = EgtGetNextPart(nPartId)
|
||||
End While
|
||||
End Sub
|
||||
|
||||
Private Sub SimulateBtn_Click(sender As Object, e As RoutedEventArgs) Handles SimulateBtn.Click
|
||||
|
||||
@@ -38,14 +38,14 @@
|
||||
<!-- Definizione della Grid laterale -->
|
||||
<Grid Grid.RowSpan="3">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="7*"/>
|
||||
<RowDefinition Height="2*"/>
|
||||
<RowDefinition Height="7*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<!-- Definizione della Grid con le caratteristiche del progetto -->
|
||||
|
||||
<Border Name="CurrProjGrid" Style="{StaticResource CustomBorder}" Grid.Row="2" >
|
||||
<Border Name="CurrProjGrid" Style="{StaticResource CustomBorder}" Grid.Row="0" >
|
||||
<Grid >
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
|
||||
@@ -105,7 +105,8 @@ Public Class ImportPageUC
|
||||
ImportScene.SetStatusNull()
|
||||
|
||||
' imposto misura
|
||||
If EgtUiUnitsAreMM() Then
|
||||
m_bMM = EgtUiUnitsAreMM()
|
||||
If m_bMM Then
|
||||
mmBtn.IsChecked = True
|
||||
Else
|
||||
inchBtn.IsChecked = True
|
||||
|
||||
+52
-16
@@ -1,22 +1,18 @@
|
||||
Imports System.Collections.ObjectModel
|
||||
Imports EgtUILib
|
||||
Imports System.ComponentModel
|
||||
Imports System.Threading
|
||||
Imports System.Windows.Threading
|
||||
|
||||
'Imports System.Runtime.InteropServices
|
||||
'Imports System.Threading
|
||||
'Imports System.Windows.Controls
|
||||
'Imports System.Globalization
|
||||
'Imports EgtUILib.EgtInterface
|
||||
'Imports EgtUILib.Scene
|
||||
'Imports System.Text
|
||||
|
||||
Class MainWindow
|
||||
|
||||
'Dichiarazione della MachineStatusBar
|
||||
' Mutex per avere una sola istanza del programma in esecuzione
|
||||
Private m_objMutex As New Mutex
|
||||
|
||||
' Dichiarazione della MachineStatusBar
|
||||
Friend m_MachineStatusUC As MachineStatusUC
|
||||
|
||||
'Dichiarazione delle Page UserControl
|
||||
' Dichiarazione delle Page UserControl
|
||||
Friend m_WorkInProgressPageUC As WorkInProgressPageUC
|
||||
Friend m_CurrentProjectPageUC As CurrentProjectPageUC
|
||||
Friend m_DirectCutPageUC As DirectCutPageUC
|
||||
@@ -30,10 +26,10 @@ Class MainWindow
|
||||
Friend m_AlarmsPageUC As AlarmsPageUC
|
||||
Friend m_OptionsPageUC As OptionsPageUC
|
||||
|
||||
'Riferimento alla NumericKeyboard necessario per poter impedire il click fuori da essa quando attiva
|
||||
' Riferimento alla NumericKeyboard necessario per poter impedire il click fuori da essa quando attiva
|
||||
Friend m_NumericKeyboardWD As NumericKeyboardWD
|
||||
|
||||
'Dichiarazione variabili direttori
|
||||
' Dichiarazione variabili direttori
|
||||
Private m_sDataRoot As String = String.Empty
|
||||
Private m_sConfigDir As String = String.Empty
|
||||
Private m_sResourcesDir As String = String.Empty
|
||||
@@ -42,14 +38,14 @@ Class MainWindow
|
||||
Private Shared m_sIniFile As String = String.Empty
|
||||
Private m_nDebug As Integer = 0
|
||||
|
||||
'Dichiarazione lista per ListBox della ImportPage
|
||||
' Dichiarazione lista per ListBox della ImportPage
|
||||
Friend m_ImportItemList As New ObservableCollection(Of IconListBoxItem)
|
||||
|
||||
'Dichiarazione lista materiali e materiale corrente
|
||||
' Dichiarazione lista materiali e materiale corrente
|
||||
Friend m_MaterialsList As New List(Of Material)
|
||||
Friend m_nCurrentMaterial As Integer = 0
|
||||
|
||||
'Riferimento alla pagina correntemente attiva
|
||||
' Riferimento alla pagina correntemente attiva
|
||||
Friend m_ActivePage As Pages
|
||||
|
||||
Enum Pages
|
||||
@@ -83,7 +79,8 @@ Class MainWindow
|
||||
End Function
|
||||
|
||||
Private Sub Window_Initialized(sender As Object, e As EventArgs)
|
||||
|
||||
' Verifico sia l'unica istanza
|
||||
ManageSingleIstance()
|
||||
' Impostazione path radice per i dati
|
||||
m_sDataRoot = System.AppDomain.CurrentDomain.BaseDirectory
|
||||
If GetPrivateProfileString(S_DATA, K_DATAROOT, "", m_sDataRoot, m_sDataRoot & "\" & DAT_FILE_NAME) = 0 Then
|
||||
@@ -221,6 +218,41 @@ Class MainWindow
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub ManageSingleIstance()
|
||||
Dim bCreated As Boolean
|
||||
Try
|
||||
m_objMutex = New Mutex(False, "Global\OmagCut", bCreated)
|
||||
Catch
|
||||
bCreated = False
|
||||
End Try
|
||||
If Not bCreated Then
|
||||
' porto in primo piano la prima istanza
|
||||
Dim bFound As Boolean = False
|
||||
' processi del programma a 32 bit
|
||||
Dim localProc As Process() = Process.GetProcessesByName("OmagCutR32")
|
||||
For Each p As Process In localProc
|
||||
If p.Id <> Process.GetCurrentProcess().Id Then
|
||||
bFound = True
|
||||
ShowWindow(p.MainWindowHandle, 1)
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
' se non trovati processi a 32 bit provo a 64 bit
|
||||
If Not bFound Then
|
||||
localProc = Process.GetProcessesByName("OmagCutR64")
|
||||
For Each p As Process In localProc
|
||||
If p.Id <> Process.GetCurrentProcess().Id Then
|
||||
bFound = True
|
||||
ShowWindow(p.MainWindowHandle, SW.RESTORE)
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
End If
|
||||
' esco dal programma
|
||||
End
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub Window_Loaded(ByVal sender As Object, ByVal e As RoutedEventArgs)
|
||||
|
||||
'Assegno AboutBoxWD come child della MainWindow
|
||||
@@ -577,6 +609,10 @@ Class MainWindow
|
||||
If m_nCurrentMaterial >= 0 And m_nCurrentMaterial < m_MaterialsList.Count() Then
|
||||
WritePrivateProfileString("Materials", "CurrMaterial", m_MaterialsList(m_nCurrentMaterial).Name, GetIniFile())
|
||||
End If
|
||||
' Terminazione generale di EgtInterface
|
||||
EgtExit()
|
||||
' Rilascio mutex
|
||||
m_objMutex.Close()
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
|
||||
+9
-9
@@ -19,16 +19,16 @@
|
||||
<ColumnDefinition Width="1*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="0.5*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="0.5*"/>
|
||||
<RowDefinition Height="2*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="0.5*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="0.5*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<Label Name="PositioningLbl" Grid.ColumnSpan="3" VerticalAlignment="Center"
|
||||
|
||||
@@ -87,7 +87,7 @@ Public Class RawPartPageUC
|
||||
|
||||
Private Sub MaterialsCmbx_SelectionChanged(sender As Object, e As SelectionChangedEventArgs) Handles MaterialsCmbx.SelectionChanged
|
||||
m_MainWindow.m_nCurrentMaterial = MaterialsCmbx.SelectedIndex
|
||||
m_CurrProjPage.MaterialLbl.Content = m_MainWindow.m_MaterialsList(m_MainWindow.m_nCurrentMaterial).Name
|
||||
m_CurrProjPage.MaterialTxBx.Text = m_MainWindow.m_MaterialsList(m_MainWindow.m_nCurrentMaterial).Name
|
||||
End Sub
|
||||
|
||||
Private Sub ExitBtnUC_Click(sender As Object, e As RoutedEventArgs)
|
||||
|
||||
Reference in New Issue
Block a user