OmagCUT :
- Rinnovamento iniziale interfaccia sul modello di SarmaxWall.
@@ -1,14 +1,11 @@
|
||||
<UserControl x:Class="BarNestingUC"
|
||||
<UserControl x:Class="AlarmsPageUC"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="853.3" d:DesignWidth="85.3">
|
||||
|
||||
<!-- Definizione barra dei tasti a destra -->
|
||||
<UniformGrid Rows="10" Columns="1">
|
||||
|
||||
</UniformGrid>
|
||||
|
||||
d:DesignHeight="300" d:DesignWidth="300">
|
||||
<Grid>
|
||||
|
||||
</Grid>
|
||||
</UserControl>
|
||||
@@ -0,0 +1,3 @@
|
||||
Public Class AlarmsPageUC
|
||||
|
||||
End Class
|
||||
@@ -1,3 +0,0 @@
|
||||
Public Class BarLavoraUC
|
||||
|
||||
End Class
|
||||
@@ -1,3 +0,0 @@
|
||||
Public Class BarNestingUC
|
||||
|
||||
End Class
|
||||
@@ -0,0 +1,40 @@
|
||||
<UserControl x:Class="CadCutPageUC"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="853.3" d:DesignWidth="1280" Initialized="CadCutPage_Initialized">
|
||||
|
||||
<!-- Chiamata al Dictionary -->
|
||||
<UserControl.Resources>
|
||||
<ResourceDictionary Source="OmagCutDictionary.xaml"/>
|
||||
</UserControl.Resources>
|
||||
|
||||
<!-- Definizione della CadCutPage -->
|
||||
<Grid Name="CadCutPageGrid" >
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="9*"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<!-- Definizione della Grid superiore -->
|
||||
<Grid Name="ButtonsGrid" Grid.Column="0" Grid.Row="0" >
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="4*"/>
|
||||
<ColumnDefinition Width="7*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<Button Name="RawPartBtn" Grid.Column="1" Content="Grezzo"/>
|
||||
<Button Name="DrawBtn" Grid.Column="2" Content="Componenti"/>
|
||||
<Button Name="ImportBtn" Grid.Column="3" Content="Importa"/>
|
||||
|
||||
</Grid>
|
||||
|
||||
</Grid>
|
||||
|
||||
</UserControl>
|
||||
@@ -0,0 +1,38 @@
|
||||
Imports EgtUILib
|
||||
|
||||
Public Class CadCutPageUC
|
||||
|
||||
' Riferimento alla MainWindow
|
||||
Private m_MainWindow As MainWindow = Application.Current.MainWindow
|
||||
|
||||
' Dichiarazione del UserControl SceneButtons
|
||||
Friend m_SceneButtons As SceneButtonsUC
|
||||
|
||||
Private Sub CadCutPage_Initialized(sender As Object, e As EventArgs)
|
||||
|
||||
'Creazione del UserCOntrol SceneButtons
|
||||
m_SceneButtons = New SceneButtonsUC
|
||||
|
||||
'Posizionemento nella griglia del UserControl SceneButtons
|
||||
m_SceneButtons.SetValue(Grid.ColumnProperty, 5)
|
||||
ButtonsGrid.Children.Add(m_SceneButtons)
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub RawPartBtn_Click(sender As Object, e As RoutedEventArgs) Handles RawPartBtn.Click
|
||||
m_MainWindow.m_CurrentProjectPageUC.CurrentProjectPageGrid.Children.Add(m_MainWindow.m_GrezzoUC)
|
||||
End Sub
|
||||
|
||||
Private Sub DrawBtn_Click(sender As Object, e As RoutedEventArgs) Handles DrawBtn.Click
|
||||
m_MainWindow.MainWindowGrid.Children.Remove(m_MainWindow.m_CurrentProjectPageUC)
|
||||
m_MainWindow.MainWindowGrid.Children.Add(m_MainWindow.m_DrawPageUC)
|
||||
m_MainWindow.m_ActivePage = MainWindow.Pages.Draw
|
||||
End Sub
|
||||
|
||||
Private Sub ImportBtn_Click(sender As Object, e As RoutedEventArgs) Handles ImportBtn.Click
|
||||
m_MainWindow.MainWindowGrid.Children.Remove(m_MainWindow.m_CurrentProjectPageUC)
|
||||
m_MainWindow.MainWindowGrid.Children.Add(m_MainWindow.m_ImportPageUC)
|
||||
m_MainWindow.m_ActivePage = MainWindow.Pages.Import
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
@@ -40,45 +40,47 @@ Public Class ComponentiUC
|
||||
Return
|
||||
End If
|
||||
|
||||
' imposto colore di default
|
||||
Dim DefColor As New Color3d(0, 0, 0)
|
||||
GetPrivateProfileColor(S_GEOMDB, K_DEFAULTCOLOR, DefColor, MainWindow.GetIniFile())
|
||||
ScenaComponenti.SetDefaultMaterial(DefColor)
|
||||
' imposto colori sfondo
|
||||
Dim BackTopColor As New Color3d(192, 192, 192)
|
||||
GetPrivateProfileColor(S_SCENE, K_BACKTOP, BackTopColor, MainWindow.GetIniFile())
|
||||
Dim BackBotColor As New Color3d(BackTopColor)
|
||||
GetPrivateProfileColor(S_SCENE, K_BACKBOTTOM, BackBotColor, MainWindow.GetIniFile())
|
||||
ScenaComponenti.SetViewBackground(BackTopColor, BackBotColor)
|
||||
' imposto colore di evidenziazione
|
||||
Dim MarkColor As New Color3d(255, 255, 0)
|
||||
GetPrivateProfileColor(S_SCENE, K_MARK, MarkColor, MainWindow.GetIniFile())
|
||||
ScenaComponenti.SetMarkMaterial(MarkColor)
|
||||
' imposto colore per superfici selezionate
|
||||
Dim SelSurfColor As New Color3d(255, 255, 192)
|
||||
GetPrivateProfileColor(S_SCENE, K_SELSURF, SelSurfColor, MainWindow.GetIniFile())
|
||||
ScenaComponenti.SetSelSurfMaterial(SelSurfColor)
|
||||
' imposto tipo e colore del rettangolo di zoom
|
||||
Dim bOutline As Boolean = True
|
||||
Dim ZwColor As New Color3d(0, 0, 0)
|
||||
GetPrivateProfileZoomWin(S_SCENE, K_ZOOMWIN, bOutline, ZwColor, MainWindow.GetIniFile())
|
||||
ScenaComponenti.SetZoomWinAttribs(bOutline, ZwColor)
|
||||
' imposto colore della linea di distanza
|
||||
Dim DstLnColor As New Color3d(255, 0, 0)
|
||||
GetPrivateProfileColor(S_SCENE, K_DISTLINE, DstLnColor, MainWindow.GetIniFile())
|
||||
ScenaComponenti.SetDistLineMaterial(DstLnColor)
|
||||
' imposto parametri OpenGL
|
||||
Dim nDriver As Integer = GetPrivateProfileInt(S_OPENGL, K_DRIVER, 3, MainWindow.GetIniFile())
|
||||
Dim b2Buff As Boolean = (GetPrivateProfileInt(S_OPENGL, K_DOUBLEBUFFER, 1, MainWindow.GetIniFile()) <> 0)
|
||||
Dim nColorBits As Integer = GetPrivateProfileInt(S_OPENGL, K_COLORBITS, 32, MainWindow.GetIniFile())
|
||||
Dim nDepthBits As Integer = GetPrivateProfileInt(S_OPENGL, K_DEPTHBITS, 32, MainWindow.GetIniFile())
|
||||
ScenaComponenti.SetViewAttributes(nDriver, b2Buff, nColorBits, nDepthBits)
|
||||
'Inizializzazione delle viste
|
||||
ScenaComponenti.Init()
|
||||
m_Controller3.SetScene(ScenaComponenti)
|
||||
' leggo direttorio componenti
|
||||
GetPrivateProfileString(S_COMPO, K_COMPODIR, "", m_sCompoDir, MainWindow.GetIniFile())
|
||||
m_bFirst = False
|
||||
'' imposto colore di default
|
||||
'Dim DefColor As New Color3d(0, 0, 0)
|
||||
'GetPrivateProfileColor(S_GEOMDB, K_DEFAULTCOLOR, DefColor, MainWindowUC.GetIniFile())
|
||||
'ScenaComponenti.SetDefaultMaterial(DefColor)
|
||||
'' imposto colori sfondo
|
||||
'Dim BackTopColor As New Color3d(192, 192, 192)
|
||||
'GetPrivateProfileColor(S_SCENE, K_BACKTOP, BackTopColor, MainWindowUC.GetIniFile())
|
||||
'Dim BackBotColor As New Color3d(BackTopColor)
|
||||
'GetPrivateProfileColor(S_SCENE, K_BACKBOTTOM, BackBotColor, MainWindowUC.GetIniFile())
|
||||
'ScenaComponenti.SetViewBackground(BackTopColor, BackBotColor)
|
||||
'' imposto colore di evidenziazione
|
||||
'Dim MarkColor As New Color3d(255, 255, 0)
|
||||
'GetPrivateProfileColor(S_SCENE, K_MARK, MarkColor, MainWindowUC.GetIniFile())
|
||||
'ScenaComponenti.SetMarkMaterial(MarkColor)
|
||||
'' imposto colore per superfici selezionate
|
||||
'Dim SelSurfColor As New Color3d(255, 255, 192)
|
||||
'GetPrivateProfileColor(S_SCENE, K_SELSURF, SelSurfColor, MainWindow.GetIniFile())
|
||||
'ScenaComponenti.SetSelSurfMaterial(SelSurfColor)
|
||||
'' imposto tipo e colore del rettangolo di zoom
|
||||
'Dim bOutline As Boolean = True
|
||||
'Dim ZwColor As New Color3d(0, 0, 0)
|
||||
'GetPrivateProfileZoomWin(S_SCENE, K_ZOOMWIN, bOutline, ZwColor, MainWindow.GetIniFile())
|
||||
'ScenaComponenti.SetZoomWinAttribs(bOutline, ZwColor)
|
||||
'' imposto colore della linea di distanza
|
||||
'Dim DstLnColor As New Color3d(255, 0, 0)
|
||||
'GetPrivateProfileColor(S_SCENE, K_DISTLINE, DstLnColor, MainWindow.GetIniFile())
|
||||
'ScenaComponenti.SetDistLineMaterial(DstLnColor)
|
||||
'' imposto parametri OpenGL
|
||||
'Dim nDriver As Integer = GetPrivateProfileInt(S_OPENGL, K_DRIVER, 3, MainWindow.GetIniFile())
|
||||
'Dim b2Buff As Boolean = (GetPrivateProfileInt(S_OPENGL, K_DOUBLEBUFFER, 1, MainWindow.GetIniFile()) <> 0)
|
||||
'Dim nColorBits As Integer = GetPrivateProfileInt(S_OPENGL, K_COLORBITS, 32, MainWindow.GetIniFile())
|
||||
'Dim nDepthBits As Integer = GetPrivateProfileInt(S_OPENGL, K_DEPTHBITS, 32, MainWindow.GetIniFile())
|
||||
'ScenaComponenti.SetViewAttributes(nDriver, b2Buff, nColorBits, nDepthBits)
|
||||
''Inizializzazione delle viste
|
||||
'ScenaComponenti.Init()
|
||||
'' inibisco selezione diretta da Scene
|
||||
'ScenaComponenti.SetStatusNull()
|
||||
'm_Controller3.SetScene(ScenaComponenti)
|
||||
'' leggo direttorio componenti
|
||||
'GetPrivateProfileString(S_COMPO, K_COMPODIR, "", m_sCompoDir, MainWindow.GetIniFile())
|
||||
'm_bFirst = False
|
||||
End Sub
|
||||
|
||||
Private Sub TriangleBtnUC_Click(sender As Object, e As RoutedEventArgs)
|
||||
@@ -146,7 +148,7 @@ Public Class ComponentiUC
|
||||
'Pulisco la scena dl componente
|
||||
EgtNewFile()
|
||||
' Passo al contesto principale
|
||||
EgtSetCurrentContext(MainWindowUC.ActiveScene.GetCtx())
|
||||
'EgtSetCurrentContext(MainWindowUC.ActiveScene.GetCtx())
|
||||
' Inserisco il componente nel DB geometrico principale
|
||||
MakeInsert(InsNbr)
|
||||
' Aggiorno ambiente principale
|
||||
@@ -155,7 +157,7 @@ Public Class ComponentiUC
|
||||
m_sCompoName = String.Empty
|
||||
ResetLuaVariables()
|
||||
' Chiudo il dialogo
|
||||
MainWindowUC.TagliCadContent.Content = MainWindowUC.m_TagliCadUC
|
||||
'MainWindowUC.TagliCadContent.Content = MainWindowUC.m_TagliCadUC
|
||||
End Sub
|
||||
|
||||
Private Function ExecCompoFile() As Boolean
|
||||
@@ -249,7 +251,7 @@ Public Class ComponentiUC
|
||||
' Ne recupero l'Id
|
||||
Dim nId2 As Integer = EgtGetLastPart()
|
||||
' Lo posiziono in ordine
|
||||
EgtPackPart(nId2, PACK_MAX_X, PACK_OFFS)
|
||||
'EgtPackPart(nId2, PACK_MAX_X, PACK_OFFS)
|
||||
Next
|
||||
' disabilito registrazione
|
||||
EgtDisableCommandLogger()
|
||||
@@ -411,14 +413,14 @@ Public Class ComponentiUC
|
||||
'Pulisco la scena dl componente
|
||||
EgtNewFile()
|
||||
' Passo al contesto principale
|
||||
EgtSetCurrentContext(MainWindowUC.ActiveScene.GetCtx())
|
||||
'EgtSetCurrentContext(MainWindowUC.ActiveScene.GetCtx())
|
||||
' Aggiorno ambiente principale
|
||||
EgtZoom(ZM.ALL)
|
||||
'Reset nome componente corrente
|
||||
m_sCompoName = String.Empty
|
||||
ResetLuaVariables()
|
||||
' Chiudo il dialogo
|
||||
MainWindowUC.TagliCadContent.Content = MainWindowUC.m_TagliCadUC
|
||||
'MainWindowUC.TagliCadContent.Content = MainWindowUC.m_TagliCadUC
|
||||
End Sub
|
||||
|
||||
Private Sub ComponentiUC_Unloaded(sender As Object, e As RoutedEventArgs)
|
||||
|
||||
@@ -1,5 +1,10 @@
|
||||
Module ConstMsg
|
||||
|
||||
Public Const MSG_TAGLICAD As Integer = 9000
|
||||
Public Const MSG_GENERAL As Integer = 90000
|
||||
Public Const MSG_CADCUTPAGEUC As Integer = 90100
|
||||
Public Const MSG_DRAWPAGE As Integer = 90300
|
||||
Public Const MSG_COMPONENTPAGE As Integer = 90350
|
||||
Public Const MSG_IMPORTPAGEUC As Integer = 90400
|
||||
Public Const MSG_MISSINGKEYWD As Integer = 101500
|
||||
|
||||
End Module
|
||||
|
||||
@@ -1,27 +0,0 @@
|
||||
<UserControl x:Class="CorniciUC"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="300" d:DesignWidth="300">
|
||||
|
||||
<!-- Chiamata al dizionario -->
|
||||
<UserControl.Resources>
|
||||
<ResourceDictionary Source="OmagCUTDictionary.xaml"/>
|
||||
</UserControl.Resources>
|
||||
|
||||
<!-- Definizione della PAGINA LAVORAZIONE CORNICI -->
|
||||
<Grid Name="BackGroundGridLavorazioneCornici">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="{StaticResource TabPageColumn0Width}"/>
|
||||
<ColumnDefinition Width="{StaticResource TabPageColumn1Width}"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="{StaticResource TabPageRow0Width}"/>
|
||||
<RowDefinition Height="{StaticResource TabPageRow1Width}"/>
|
||||
<RowDefinition Height="{StaticResource TabPageRow2Width}"/>
|
||||
</Grid.RowDefinitions>
|
||||
</Grid>
|
||||
|
||||
</UserControl>
|
||||
@@ -1,3 +0,0 @@
|
||||
Public Class CorniciUC
|
||||
|
||||
End Class
|
||||
@@ -0,0 +1,32 @@
|
||||
<UserControl x:Class="CurrentProjectPageUC"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="853.3" d:DesignWidth="1280" Initialized="CurrentProjectPage_Initialized" Loaded="CurrentProjectPage_Loaded">
|
||||
|
||||
<!-- Chiamata al Dictionary -->
|
||||
<UserControl.Resources>
|
||||
<ResourceDictionary Source="OmagCutDictionary.xaml"/>
|
||||
</UserControl.Resources>
|
||||
|
||||
<!-- Definizione della CurrentProjectPage -->
|
||||
<Border Style="{StaticResource CustomBorder}" >
|
||||
|
||||
<Grid Name="CurrentProjectPageGrid" >
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="3*"/>
|
||||
<ColumnDefinition Width="12*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="8*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
</Grid>
|
||||
|
||||
</Border>
|
||||
|
||||
</UserControl>
|
||||
@@ -0,0 +1,86 @@
|
||||
Imports EgtUILib
|
||||
|
||||
Public Class CurrentProjectPageUC
|
||||
|
||||
' Riferimento alla MainWindow
|
||||
Private m_MainWindow As MainWindow = Application.Current.MainWindow
|
||||
|
||||
' Properties
|
||||
Private m_bFirst As Boolean = True
|
||||
|
||||
' Dichiarazione Scene
|
||||
Friend WithEvents CurrentProjectScene As New Scene
|
||||
Private CurrentProjectSceneHost As New System.Windows.Forms.Integration.WindowsFormsHost
|
||||
|
||||
Private Sub CurrentProjectPage_Initialized(sender As Object, e As EventArgs)
|
||||
|
||||
m_MainWindow.m_GrezzoUC.SetValue(Grid.ColumnProperty, 0)
|
||||
m_MainWindow.m_GrezzoUC.SetValue(Grid.RowSpanProperty, 3)
|
||||
m_MainWindow.m_DirectCutPageUC.SetValue(Grid.RowSpanProperty, 3)
|
||||
m_MainWindow.m_DirectCutPageUC.SetValue(Grid.ColumnSpanProperty, 2)
|
||||
m_MainWindow.m_CadCutPageUC.SetValue(Grid.RowSpanProperty, 3)
|
||||
m_MainWindow.m_CadCutPageUC.SetValue(Grid.ColumnSpanProperty, 2)
|
||||
m_MainWindow.m_FrameCutPageUC.SetValue(Grid.RowSpanProperty, 3)
|
||||
m_MainWindow.m_FrameCutPageUC.SetValue(Grid.ColumnSpanProperty, 2)
|
||||
|
||||
'Assegnazione scena all'host e posizionamento nella PlacePageGrid
|
||||
CurrentProjectSceneHost.Child = CurrentProjectScene
|
||||
CurrentProjectSceneHost.SetValue(Grid.ColumnProperty, 1)
|
||||
CurrentProjectSceneHost.SetValue(Grid.RowProperty, 1)
|
||||
Me.CurrentProjectPageGrid.Children.Add(CurrentProjectSceneHost)
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub CurrentProjectPage_Loaded(sender As Object, e As RoutedEventArgs)
|
||||
|
||||
If m_bFirst Then
|
||||
' imposto colore di default
|
||||
Dim DefColor As New Color3d(0, 0, 0)
|
||||
GetPrivateProfileColor(S_GEOMDB, K_DEFAULTCOLOR, DefColor, m_MainWindow.GetIniFile())
|
||||
CurrentProjectScene.SetDefaultMaterial(DefColor)
|
||||
' imposto colori sfondo
|
||||
Dim BackTopColor As New Color3d(192, 192, 192)
|
||||
GetPrivateProfileColor(S_SCENE, K_BACKTOP, BackTopColor, m_MainWindow.GetIniFile())
|
||||
Dim BackBotColor As New Color3d(BackTopColor)
|
||||
GetPrivateProfileColor(S_SCENE, K_BACKBOTTOM, BackBotColor, m_MainWindow.GetIniFile())
|
||||
CurrentProjectScene.SetViewBackground(BackTopColor, BackBotColor)
|
||||
' imposto colore di evidenziazione
|
||||
Dim MarkColor As New Color3d(255, 255, 0)
|
||||
GetPrivateProfileColor(S_SCENE, K_MARK, MarkColor, m_MainWindow.GetIniFile())
|
||||
CurrentProjectScene.SetMarkMaterial(MarkColor)
|
||||
' imposto colore per superfici selezionate
|
||||
Dim SelSurfColor As New Color3d(255, 255, 192)
|
||||
GetPrivateProfileColor(S_SCENE, K_SELSURF, SelSurfColor, m_MainWindow.GetIniFile())
|
||||
CurrentProjectScene.SetSelSurfMaterial(SelSurfColor)
|
||||
' imposto tipo e colore del rettangolo di zoom
|
||||
Dim bOutline As Boolean = True
|
||||
Dim ZwColor As New Color3d(0, 0, 0)
|
||||
GetPrivateProfileZoomWin(S_SCENE, K_ZOOMWIN, bOutline, ZwColor, m_MainWindow.GetIniFile())
|
||||
CurrentProjectScene.SetZoomWinAttribs(bOutline, ZwColor)
|
||||
' imposto colore della linea di distanza
|
||||
Dim DstLnColor As New Color3d(255, 0, 0)
|
||||
GetPrivateProfileColor(S_SCENE, K_DISTLINE, DstLnColor, m_MainWindow.GetIniFile())
|
||||
CurrentProjectScene.SetDistLineMaterial(DstLnColor)
|
||||
' imposto parametri OpenGL
|
||||
Dim nDriver As Integer = GetPrivateProfileInt(S_OPENGL, K_DRIVER, 3, m_MainWindow.GetIniFile())
|
||||
Dim b2Buff As Boolean = (GetPrivateProfileInt(S_OPENGL, K_DOUBLEBUFFER, 1, m_MainWindow.GetIniFile()) <> 0)
|
||||
Dim nColorBits As Integer = GetPrivateProfileInt(S_OPENGL, K_COLORBITS, 32, m_MainWindow.GetIniFile())
|
||||
Dim nDepthBits As Integer = GetPrivateProfileInt(S_OPENGL, K_DEPTHBITS, 32, m_MainWindow.GetIniFile())
|
||||
CurrentProjectScene.SetViewAttributes(nDriver, b2Buff, nColorBits, nDepthBits)
|
||||
' inizializzo la scena (DB geometrico + visualizzazione) e verifico presenza chiave
|
||||
If Not CurrentProjectScene.Init() Then
|
||||
Dim m_MissingKeyWindow As New MissingKeyWD
|
||||
m_MissingKeyWindow.Top = m_MainWindow.Top + (m_MainWindow.Height / 2 - m_MissingKeyWindow.Height / 2)
|
||||
m_MissingKeyWindow.Left = m_MainWindow.Left + (m_MainWindow.Width / 2 - m_MissingKeyWindow.Width / 2)
|
||||
m_MainWindow.Close()
|
||||
m_MissingKeyWindow.Show()
|
||||
End If
|
||||
m_bFirst = False
|
||||
Else
|
||||
EgtSetCurrentContext(CurrentProjectScene.GetCtx())
|
||||
End If
|
||||
' inibisco selezione diretta da Scene
|
||||
CurrentProjectScene.SetStatusNull()
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
@@ -0,0 +1,44 @@
|
||||
<UserControl x:Class="DirectCutPageUC"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="853.3" d:DesignWidth="1024">
|
||||
|
||||
<!-- Chiamata al Dictionary -->
|
||||
<UserControl.Resources>
|
||||
<ResourceDictionary Source="OmagCutDictionary.xaml"/>
|
||||
</UserControl.Resources>
|
||||
|
||||
<!-- Definizione della DirectCutPage -->
|
||||
<Grid Name="DirectCutPageGrid" >
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="9*"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<!-- Definizione della Grid superiore -->
|
||||
<Grid Grid.Column="0" Grid.Row="0" Background="Yellow" >
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
|
||||
|
||||
</Grid>
|
||||
|
||||
</Grid>
|
||||
|
||||
</UserControl>
|
||||
@@ -0,0 +1,3 @@
|
||||
Public Class DirectCutPageUC
|
||||
|
||||
End Class
|
||||
@@ -0,0 +1,50 @@
|
||||
<UserControl x:Class="DrawPageUC"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="853.3" d:DesignWidth="1280" Initialized="DrawPage_Initialized" Loaded="DrawPage_Loaded">
|
||||
|
||||
<!-- Chiamata al Dictionary -->
|
||||
<UserControl.Resources>
|
||||
<ResourceDictionary Source="OmagCutDictionary.xaml"/>
|
||||
</UserControl.Resources>
|
||||
|
||||
<!-- Definizione della DrawPage -->
|
||||
<Border Style="{StaticResource CustomBorder}" >
|
||||
<Grid Name="DrawPageGrid" >
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="3*"/>
|
||||
<ColumnDefinition Width="12*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="9*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<!-- Definizione della Grid Inferiore per i Button V e X -->
|
||||
<Grid Name="BottomButtonsGrid" Grid.Column="1" Grid.Row="3">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="7*"/>
|
||||
<ColumnDefinition Width="3*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<Button Name="OkBtn" Grid.Column="2" >
|
||||
<Image Source="Resources/V.png" Width="65" Height="65" HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center" />
|
||||
</Button>
|
||||
<Button Name="ExitBtn" Grid.Column="3" >
|
||||
<Image Source="Resources/X.png" Width="65" Height="65" HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center" />
|
||||
</Button>
|
||||
|
||||
</Grid>
|
||||
|
||||
</Grid>
|
||||
|
||||
</Border>
|
||||
|
||||
</UserControl>
|
||||
@@ -0,0 +1,227 @@
|
||||
Imports EgtUILib
|
||||
Imports System.Globalization
|
||||
|
||||
Public Class DrawPageUC
|
||||
|
||||
' Constants
|
||||
Private Const NUM_VAR As Integer = 4
|
||||
Private Const LUA_CMP_VARS As String = "CMP"
|
||||
Private Const LUA_CMP_DRAW As String = "CMP_Draw"
|
||||
Private Const LUA_REMOVEHOLE As String = "RemoveHole"
|
||||
Private Const LUA_PREINSERT As String = "PreInsert"
|
||||
Private Const INFO_CMP As String = "CMP"
|
||||
Private Const LUA_CMP_WALL As String = "Wall"
|
||||
Private Const LUA_CMP_DOOR As String = "Door"
|
||||
Private Const LUA_CMP_WINDOW As String = "Window"
|
||||
Private Const LUA_CMP_INDEX As String = LUA_CMP_VARS & ".Ind"
|
||||
|
||||
'Riferimento alla MainWindow
|
||||
Private m_MainWindow As MainWindow = Application.Current.MainWindow
|
||||
|
||||
'Dichiarazione delle Page UserControl
|
||||
Friend m_ComponentPage As MainComponentPageUC
|
||||
|
||||
' Properties
|
||||
Private m_sCompoDir As String = String.Empty
|
||||
Private m_sCompoName As String = String.Empty
|
||||
Private m_CVars(NUM_VAR - 1) As CompoVar
|
||||
Private m_bDrawOk As Boolean = False
|
||||
Private m_bFirst As Boolean = True
|
||||
|
||||
' Dichiarazione Scene
|
||||
Friend WithEvents DrawScene As New Scene
|
||||
Dim DrawSceneHost As New System.Windows.Forms.Integration.WindowsFormsHost
|
||||
|
||||
Private Sub DrawPage_Initialized(sender As Object, e As EventArgs)
|
||||
|
||||
'Creazione delle Page UserControl
|
||||
m_ComponentPage = New MainComponentPageUC
|
||||
'Posizionemento nella griglia delle Page UserControl
|
||||
m_ComponentPage.SetValue(Grid.ColumnProperty, 0)
|
||||
m_ComponentPage.SetValue(Grid.RowProperty, 0)
|
||||
|
||||
'Assegnazione scena all'host e posizionamento nella ImportPageGrid
|
||||
DrawSceneHost.Child = DrawScene
|
||||
DrawSceneHost.SetValue(Grid.ColumnProperty, 1)
|
||||
DrawSceneHost.SetValue(Grid.RowProperty, 0)
|
||||
Me.DrawPageGrid.Children.Add(DrawSceneHost)
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub DrawPage_Loaded(sender As Object, e As RoutedEventArgs)
|
||||
|
||||
If m_bFirst Then
|
||||
' imposto colore di default
|
||||
Dim DefColor As New Color3d(0, 0, 0)
|
||||
GetPrivateProfileColor(S_GEOMDB, K_DEFAULTCOLOR, DefColor, m_MainWindow.GetIniFile())
|
||||
DrawScene.SetDefaultMaterial(DefColor)
|
||||
' imposto colori sfondo
|
||||
Dim BackTopColor As New Color3d(192, 192, 192)
|
||||
GetPrivateProfileColor(S_SCENE, K_BACKTOP, BackTopColor, m_MainWindow.GetIniFile())
|
||||
Dim BackBotColor As New Color3d(BackTopColor)
|
||||
GetPrivateProfileColor(S_SCENE, K_BACKBOTTOM, BackBotColor, m_MainWindow.GetIniFile())
|
||||
DrawScene.SetViewBackground(BackTopColor, BackBotColor)
|
||||
' imposto colore di evidenziazione
|
||||
Dim MarkColor As New Color3d(255, 255, 0)
|
||||
GetPrivateProfileColor(S_SCENE, K_MARK, MarkColor, m_MainWindow.GetIniFile())
|
||||
DrawScene.SetMarkMaterial(MarkColor)
|
||||
' imposto colore per superfici selezionate
|
||||
Dim SelSurfColor As New Color3d(255, 255, 192)
|
||||
GetPrivateProfileColor(S_SCENE, K_SELSURF, SelSurfColor, m_MainWindow.GetIniFile())
|
||||
DrawScene.SetSelSurfMaterial(SelSurfColor)
|
||||
' imposto tipo e colore del rettangolo di zoom
|
||||
Dim bOutline As Boolean = True
|
||||
Dim ZwColor As New Color3d(0, 0, 0)
|
||||
GetPrivateProfileZoomWin(S_SCENE, K_ZOOMWIN, bOutline, ZwColor, m_MainWindow.GetIniFile())
|
||||
DrawScene.SetZoomWinAttribs(bOutline, ZwColor)
|
||||
' imposto colore della linea di distanza
|
||||
Dim DstLnColor As New Color3d(255, 0, 0)
|
||||
GetPrivateProfileColor(S_SCENE, K_DISTLINE, DstLnColor, m_MainWindow.GetIniFile())
|
||||
DrawScene.SetDistLineMaterial(DstLnColor)
|
||||
' imposto parametri OpenGL
|
||||
Dim nDriver As Integer = GetPrivateProfileInt(S_OPENGL, K_DRIVER, 3, m_MainWindow.GetIniFile())
|
||||
Dim b2Buff As Boolean = (GetPrivateProfileInt(S_OPENGL, K_DOUBLEBUFFER, 1, m_MainWindow.GetIniFile()) <> 0)
|
||||
Dim nColorBits As Integer = GetPrivateProfileInt(S_OPENGL, K_COLORBITS, 32, m_MainWindow.GetIniFile())
|
||||
Dim nDepthBits As Integer = GetPrivateProfileInt(S_OPENGL, K_DEPTHBITS, 32, m_MainWindow.GetIniFile())
|
||||
DrawScene.SetViewAttributes(nDriver, b2Buff, nColorBits, nDepthBits)
|
||||
' inizializzo la scena (DB geometrico + visualizzazione)
|
||||
DrawScene.Init()
|
||||
' Imposto griglia
|
||||
'LoadGridData()
|
||||
' leggo direttorio componenti
|
||||
GetPrivateProfileString(S_COMPO, K_COMPODIR, "", m_sCompoDir, m_MainWindow.GetIniFile())
|
||||
m_bFirst = False
|
||||
Else
|
||||
EgtSetCurrentContext(DrawScene.GetCtx())
|
||||
End If
|
||||
|
||||
' inibisco selezione diretta da Scene
|
||||
DrawScene.SetStatusNull()
|
||||
|
||||
'Seleziono la Tab e la Page di apertura
|
||||
DrawPageGrid.Children.Add(m_ComponentPage)
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub OkBtn_Click(sender As Object, e As RoutedEventArgs) Handles OkBtn.Click
|
||||
'Istruzioni per chiudere ImportPageUC e aprire CadCutPageUC
|
||||
m_MainWindow.MainWindowGrid.Children.Remove(m_MainWindow.m_DrawPageUC)
|
||||
m_MainWindow.MainWindowGrid.Children.Add(m_MainWindow.m_CurrentProjectPageUC)
|
||||
m_MainWindow.m_ActivePage = MainWindow.Pages.CadCut
|
||||
End Sub
|
||||
|
||||
Private Sub ExitBtn_Click(sender As Object, e As RoutedEventArgs) Handles ExitBtn.Click
|
||||
'Istruzioni per chiudere ImportPageUC e aprire CadCutPageUC
|
||||
m_MainWindow.MainWindowGrid.Children.Remove(m_MainWindow.m_DrawPageUC)
|
||||
m_MainWindow.MainWindowGrid.Children.Add(m_MainWindow.m_CurrentProjectPageUC)
|
||||
m_MainWindow.m_ActivePage = MainWindow.Pages.CadCut
|
||||
End Sub
|
||||
|
||||
Private Class CompoVar
|
||||
|
||||
' Public Members
|
||||
Public m_nInd As Integer
|
||||
Public m_sName As String
|
||||
Public m_nType As Integer
|
||||
Public m_bVal As Boolean
|
||||
Public m_nVal As Integer
|
||||
Public m_dVal As Double
|
||||
Public m_sVal As String
|
||||
|
||||
' Constants
|
||||
Const LUA_NAME As String = LUA_CMP_VARS & ".N"
|
||||
Const LUA_TYPE As String = LUA_CMP_VARS & ".T"
|
||||
Const LUA_VALUE As String = LUA_CMP_VARS & ".V"
|
||||
|
||||
Public Sub New()
|
||||
m_nInd = 0
|
||||
m_nType = 0
|
||||
End Sub
|
||||
|
||||
Public Overrides Function ToString() As String
|
||||
Select Case m_nType
|
||||
Case 1 ' booleano
|
||||
Return m_bVal.ToString()
|
||||
Case 2 ' intero
|
||||
Return m_nVal.ToString()
|
||||
Case 3 ' lunghezza
|
||||
Return EgtToUiUnits(m_dVal).ToString("F0", CultureInfo.InvariantCulture)
|
||||
Case 4 ' double
|
||||
Return m_dVal.ToString("F0", CultureInfo.InvariantCulture)
|
||||
Case 5 ' stringa
|
||||
Return m_sVal
|
||||
End Select
|
||||
Return ""
|
||||
End Function
|
||||
|
||||
Public Function FromString(ByVal sVal As String) As Boolean
|
||||
Select Case m_nType
|
||||
Case 1 ' booleano
|
||||
Dim bVal As Boolean = False
|
||||
If Boolean.TryParse(sVal, bVal) Then
|
||||
m_bVal = bVal
|
||||
Return True
|
||||
End If
|
||||
Case 2 ' intero
|
||||
Dim dVal As Double
|
||||
If EgtLuaEvalNumExpr(sVal, dVal) Then
|
||||
m_nVal = CInt(dVal)
|
||||
Return True
|
||||
End If
|
||||
Case 3 ' lunghezza
|
||||
Dim dVal As Double
|
||||
If EgtLuaEvalNumExpr(sVal, dVal) Then
|
||||
m_dVal = EgtFromUiUnits(dVal)
|
||||
Return True
|
||||
End If
|
||||
Case 4 ' double
|
||||
Dim dVal As Double
|
||||
If EgtLuaEvalNumExpr(sVal, dVal) Then
|
||||
m_dVal = dVal
|
||||
Return True
|
||||
End If
|
||||
Case 5 'stringa
|
||||
m_sVal = sVal
|
||||
Return True
|
||||
End Select
|
||||
Return False
|
||||
End Function
|
||||
|
||||
Public Function ToLua() As Boolean
|
||||
Select Case m_nType
|
||||
Case 1
|
||||
Return EgtLuaSetGlobBoolVar(LUA_VALUE & m_nInd.ToString(), m_bVal)
|
||||
Case 2
|
||||
Return EgtLuaSetGlobIntVar(LUA_VALUE & m_nInd.ToString(), m_nVal)
|
||||
Case 3, 4
|
||||
Return EgtLuaSetGlobNumVar(LUA_VALUE & m_nInd.ToString(), m_dVal)
|
||||
Case 5
|
||||
Return EgtLuaSetGlobStringVar(LUA_VALUE & m_nInd.ToString(), m_sVal)
|
||||
End Select
|
||||
Return False
|
||||
End Function
|
||||
|
||||
Public Function FromLua() As Boolean
|
||||
Select Case m_nType
|
||||
Case 1
|
||||
Return EgtLuaGetGlobBoolVar(LUA_VALUE & m_nInd.ToString(), m_bVal)
|
||||
Case 2
|
||||
Return EgtLuaGetGlobIntVar(LUA_VALUE & m_nInd.ToString(), m_nVal)
|
||||
Case 3, 4
|
||||
Return EgtLuaGetGlobNumVar(LUA_VALUE & m_nInd.ToString(), m_dVal)
|
||||
Case 5
|
||||
Return EgtLuaGetGlobStringVar(LUA_VALUE & m_nInd.ToString(), m_sVal)
|
||||
End Select
|
||||
Return False
|
||||
End Function
|
||||
|
||||
Public Function NameTypeValueFromLua() As Boolean
|
||||
Dim bOk As Boolean = True
|
||||
bOk = bOk AndAlso EgtLuaGetGlobStringVar(LUA_NAME & m_nInd.ToString(), m_sName)
|
||||
bOk = bOk AndAlso EgtLuaGetGlobIntVar(LUA_TYPE & m_nInd.ToString(), m_nType)
|
||||
Return bOk AndAlso FromLua()
|
||||
End Function
|
||||
|
||||
End Class
|
||||
|
||||
End Class
|
||||
@@ -1,33 +0,0 @@
|
||||
<UserControl x:Class="FlatPartsImportUC"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="853.3" d:DesignWidth="1024" Loaded="FlatPartsImportUC_Loaded" Initialized="FlatPartsImportUC_Initialized">
|
||||
|
||||
<!-- Chiamata al dizionario -->
|
||||
<UserControl.Resources>
|
||||
<ResourceDictionary Source="OmagCUTDictionary.xaml"/>
|
||||
</UserControl.Resources>
|
||||
|
||||
<!-- Definizione della PAGINA FLAT PARTS IMPORT -->
|
||||
<Grid Name="BackGroundGridFlatPartsImport">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="3*"/>
|
||||
<ColumnDefinition Width="9*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="{StaticResource TabPageRow0Width}"/>
|
||||
<RowDefinition Height="{StaticResource TabPageRow1Width}"/>
|
||||
<RowDefinition Height="{StaticResource TabPageRow2Width}"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<TextBlock Text="TextBlock" />
|
||||
|
||||
<ListBox Name="ListView1" Grid.Row="1" Grid.RowSpan="2" SelectionChanged="ScenaFlatPartsImportUC_SelectionChanged">
|
||||
|
||||
</ListBox>
|
||||
|
||||
</Grid>
|
||||
</UserControl>
|
||||
@@ -1,113 +0,0 @@
|
||||
Imports EgtUILib
|
||||
|
||||
Public Class FlatPartsImportUC
|
||||
|
||||
''Per creazione Scene
|
||||
'Friend Shared WithEvents ScenaFlatPartsImport As New Scene
|
||||
'Dim ScenaFlatPartsImportHost As New System.Windows.Forms.Integration.WindowsFormsHost
|
||||
|
||||
''Per ScenaFlatPartsImport
|
||||
'' Properties
|
||||
'Private m_sCurrDir As String = String.Empty
|
||||
'Private m_sCurrFile As String = String.Empty
|
||||
'Private m_nFileType As Integer = FT.NULL
|
||||
'Private m_bFirst As Boolean = True
|
||||
|
||||
Private Sub FlatPartsImportUC_Initialized(sender As Object, e As EventArgs)
|
||||
|
||||
' ScenaFlatPartsImportHost.Child = ScenaFlatPartsImport
|
||||
' ScenaFlatPartsImportHost.SetValue(Grid.ColumnProperty, 1)
|
||||
' ScenaFlatPartsImportHost.SetValue(Grid.RowProperty, 0)
|
||||
' ScenaFlatPartsImportHost.SetValue(Grid.RowSpanProperty, 2)
|
||||
' Me.BackGroundGridFlatPartsImport.Children.Add(ScenaFlatPartsImportHost)
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub FlatPartsImportUC_Loaded(sender As Object, e As RoutedEventArgs)
|
||||
|
||||
' If (Not m_bFirst) Then
|
||||
' EgtSetCurrentContext(ScenaFlatPartsImport.GetCtx())
|
||||
' Return
|
||||
' End If
|
||||
|
||||
' ' imposto colore di default
|
||||
' Dim DefColor As New Color3d(0, 0, 0)
|
||||
' GetPrivateProfileColor(S_GEOMDB, K_DEFAULTCOLOR, DefColor, MainWindow.GetIniFile())
|
||||
' ScenaFlatPartsImport.SetDefaultMaterial(DefColor)
|
||||
' ' imposto colori sfondo
|
||||
' Dim BackTopColor As New Color3d(192, 192, 192)
|
||||
' GetPrivateProfileColor(S_SCENE, K_BACKTOP, BackTopColor, MainWindow.GetIniFile())
|
||||
' Dim BackBotColor As New Color3d(BackTopColor)
|
||||
' GetPrivateProfileColor(S_SCENE, K_BACKBOTTOM, BackBotColor, MainWindow.GetIniFile())
|
||||
' ScenaFlatPartsImport.SetViewBackground(BackTopColor, BackBotColor)
|
||||
' ' imposto colore di evidenziazione
|
||||
' Dim MarkColor As New Color3d(255, 255, 0)
|
||||
' GetPrivateProfileColor(S_SCENE, K_MARK, MarkColor, MainWindow.GetIniFile())
|
||||
' ScenaFlatPartsImport.SetMarkMaterial(MarkColor)
|
||||
' ' imposto colore per superfici selezionate
|
||||
' Dim SelSurfColor As New Color3d(255, 255, 192)
|
||||
' GetPrivateProfileColor(S_SCENE, K_SELSURF, SelSurfColor, MainWindow.GetIniFile())
|
||||
' ScenaFlatPartsImport.SetSelSurfMaterial(SelSurfColor)
|
||||
' ' imposto tipo e colore del rettangolo di zoom
|
||||
' Dim bOutline As Boolean = True
|
||||
' Dim ZwColor As New Color3d(0, 0, 0)
|
||||
' GetPrivateProfileZoomWin(S_SCENE, K_ZOOMWIN, bOutline, ZwColor, MainWindow.GetIniFile())
|
||||
' ScenaFlatPartsImport.SetZoomWinAttribs(bOutline, ZwColor)
|
||||
' ' imposto colore della linea di distanza
|
||||
' Dim DstLnColor As New Color3d(255, 0, 0)
|
||||
' GetPrivateProfileColor(S_SCENE, K_DISTLINE, DstLnColor, MainWindow.GetIniFile())
|
||||
' ScenaFlatPartsImport.SetDistLineMaterial(DstLnColor)
|
||||
' ' imposto parametri OpenGL
|
||||
' Dim nDriver As Integer = GetPrivateProfileInt(S_OPENGL, K_DRIVER, 3, MainWindow.GetIniFile())
|
||||
' Dim b2Buff As Boolean = (GetPrivateProfileInt(S_OPENGL, K_DOUBLEBUFFER, 1, MainWindow.GetIniFile()) <> 0)
|
||||
' Dim nColorBits As Integer = GetPrivateProfileInt(S_OPENGL, K_COLORBITS, 32, MainWindow.GetIniFile())
|
||||
' Dim nDepthBits As Integer = GetPrivateProfileInt(S_OPENGL, K_DEPTHBITS, 32, MainWindow.GetIniFile())
|
||||
' ScenaFlatPartsImport.SetViewAttributes(nDriver, b2Buff, nColorBits, nDepthBits)
|
||||
' ' inizializzo la scena (DB geometrico + visualizzazione)
|
||||
' ScenaFlatPartsImport.Init()
|
||||
' ' leggo direttorio corrente
|
||||
' GetPrivateProfileString(S_FLATPARTS, K_FLPCURRDIR, "", m_sCurrDir, MainWindow.GetIniFile())
|
||||
' ' lo carico
|
||||
' LoadCurrDir()
|
||||
' ' imposto misura
|
||||
' If EgtUiUnitsAreMM() Then
|
||||
' rbMm.Select()
|
||||
' Else
|
||||
' rbInch.Select()
|
||||
' End If
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub ScenaFlatPartsImportUC_SelectionChanged(sender As Object, e As SelectionChangedEventArgs)
|
||||
' ' Recupero item selezionato
|
||||
' Dim vItems As ListView.SelectedListViewItemCollection = ListView1.SelectedItems
|
||||
' If vItems.Count() = 0 Then
|
||||
' Return
|
||||
' End If
|
||||
' ' A seconda del tipo
|
||||
' Select Case vItems(0).ImageIndex
|
||||
' Case 0 ' Vai nel direttorio padre
|
||||
' m_sCurrDir = IO.Path.GetDirectoryName(m_sCurrDir)
|
||||
' m_sCurrFile = ""
|
||||
' LoadCurrDir()
|
||||
' ListView1.Items(0).Selected = True
|
||||
' ListView1.Items(0).Focused = True
|
||||
' Case 1 ' Vai nella radice del disco
|
||||
' m_sCurrDir = vItems(0).Text
|
||||
' m_sCurrFile = ""
|
||||
' LoadCurrDir()
|
||||
' ListView1.Items(0).Selected = True
|
||||
' ListView1.Items(0).Focused = True
|
||||
' Case 2 ' Vai nel sottodirettorio
|
||||
' m_sCurrDir = IO.Path.Combine(m_sCurrDir, vItems(0).Text)
|
||||
' m_sCurrFile = ""
|
||||
' LoadCurrDir()
|
||||
' ListView1.Items(0).Selected = True
|
||||
' ListView1.Items(0).Focused = True
|
||||
' Case 3 ' File
|
||||
' m_sCurrFile = vItems(0).Text
|
||||
' LoadCurrFile()
|
||||
' End Select
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
@@ -0,0 +1,43 @@
|
||||
<UserControl x:Class="FrameCutPageUC"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="853.3" d:DesignWidth="1280">
|
||||
|
||||
<!-- Chiamata al Dictionary -->
|
||||
<UserControl.Resources>
|
||||
<ResourceDictionary Source="OmagCutDictionary.xaml"/>
|
||||
</UserControl.Resources>
|
||||
|
||||
<!-- Definizione della FrameCutPage -->
|
||||
<Grid Name="FrameCutPageGrid" >
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="9*"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<!-- Definizione della Grid superiore -->
|
||||
<Grid Grid.Column="0" Grid.Row="0" Background="Green" >
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="4*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
|
||||
|
||||
</Grid>
|
||||
|
||||
</Grid>
|
||||
</UserControl>
|
||||
@@ -0,0 +1,3 @@
|
||||
Public Class FrameCutPageUC
|
||||
|
||||
End Class
|
||||
@@ -5,7 +5,7 @@
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="853.3" d:DesignWidth="255.9"
|
||||
Background="Gray" Loaded="GrezzoUC_Loaded" Initialized="GrezzoUC_Initialized">
|
||||
Background="LightGray" Loaded="GrezzoUC_Loaded" Initialized="GrezzoUC_Initialized">
|
||||
|
||||
<!-- Chiamata al dizionario che contiene Styles e Colori -->
|
||||
<UserControl.Resources>
|
||||
@@ -28,7 +28,7 @@
|
||||
<RowDefinition Height="1*"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<Border Style="{StaticResource CustomBorder}" Grid.ColumnSpan="3"
|
||||
<Border Grid.ColumnSpan="3"
|
||||
Grid.Column="0" Grid.Row="0" >
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
@@ -45,7 +45,7 @@
|
||||
<RadioButton Name="RectangleBtn" Style="{StaticResource {x:Type ToggleButton}}"
|
||||
FontSize="20" FontWeight="Bold" GroupName="DefinitionMethod_GrezzoUC"/>
|
||||
<RadioButton Name="ByPointsBtn" Style="{StaticResource {x:Type ToggleButton}}"
|
||||
Content="Per Punti" Grid.Column="1" FontSize="20" FontWeight="Bold" Click="ByPointsBtnUC_Click" GroupName="DefinitionMethod_GrezzoUC"/>
|
||||
Content="Per Punti" Grid.Column="1" FontSize="20" FontWeight="Bold" GroupName="DefinitionMethod_GrezzoUC"/>
|
||||
<Label Content="Larghezza" Grid.Row="1" FontSize="20" HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center" Name="WidthLbl"/>
|
||||
<TextBox Grid.Column="1" Grid.Row="1" Text="200" FontSize="20"
|
||||
@@ -81,7 +81,7 @@
|
||||
<Label Content="Kerf" Grid.Row="0" FontSize="20" HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center" Name="KerfLbl" />
|
||||
<UniformGrid Grid.Column="1" Columns="2">
|
||||
<RadioButton Style="{StaticResource {x:Type ToggleButton}}" Content="Int" FontSize="20" GroupName="KerfGroup_GrezzoUC"/>
|
||||
<RadioButton Style="{StaticResource {x:Type ToggleButton}}" Content="Int" FontSize="20" GroupName="KerfGroup_GrezzoUC" />
|
||||
<RadioButton Style="{StaticResource {x:Type ToggleButton}}" Content="Ext" Grid.Column="1" FontSize="20" GroupName="KerfGroup_GrezzoUC"/>
|
||||
</UniformGrid>
|
||||
<Label Content="Spessore" Grid.Row="1" FontSize="20" HorizontalAlignment="Center"
|
||||
|
||||
@@ -2,11 +2,11 @@
|
||||
|
||||
Public Class GrezzoUC
|
||||
|
||||
Dim MainWindowUC As MainWindow = Application.Current.MainWindow
|
||||
Dim m_MainWindow As MainWindow = Application.Current.MainWindow
|
||||
'Dim m_bRectangle As Boolean
|
||||
|
||||
Private Sub GrezzoUC_Initialized(sender As Object, e As EventArgs)
|
||||
RectangleBtn.Content = EgtMsg(MSG_TAGLICAD + 1) 'Rettangolo
|
||||
RectangleBtn.Content = EgtMsg(MSG_CADCUTPAGEUC + 1) 'Rettangolo
|
||||
End Sub
|
||||
|
||||
Private Sub GrezzoUC_Loaded(sender As Object, e As RoutedEventArgs)
|
||||
@@ -15,19 +15,15 @@ Public Class GrezzoUC
|
||||
End Sub
|
||||
|
||||
Private Sub ExitBtnUC_Click(sender As Object, e As RoutedEventArgs)
|
||||
MainWindowUC.MainGrid.Children.Remove(MainWindowUC.m_GrezzoUC)
|
||||
m_MainWindow.m_CurrentProjectPageUC.CurrentProjectPageGrid.Children.remove(m_MainWindow.m_GrezzoUC)
|
||||
End Sub
|
||||
|
||||
Private Sub ConfirmBtn_Click(sender As Object, e As RoutedEventArgs)
|
||||
MainWindowUC.MainGrid.Children.Remove(MainWindowUC.m_GrezzoUC)
|
||||
m_MainWindow.m_CurrentProjectPageUC.CurrentProjectPageGrid.Children.remove(m_MainWindow.m_GrezzoUC)
|
||||
End Sub
|
||||
|
||||
Private Sub RectangleBtnUC_Click(sender As Object, e As RoutedEventArgs) Handles RectangleBtn.Click
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub ByPointsBtnUC_Click(sender As Object, e As RoutedEventArgs)
|
||||
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
|
||||
@@ -0,0 +1,76 @@
|
||||
<UserControl x:Class="ImportPageUC"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="853.3" d:DesignWidth="1280" Initialized="ImportPage_Initialized" Loaded="ImportPage_Loaded" Unloaded="ImportPage_Unloaded">
|
||||
|
||||
<!-- Chiamata al Dictionary -->
|
||||
<UserControl.Resources>
|
||||
<ResourceDictionary Source="OmagCutDictionary.xaml"/>
|
||||
</UserControl.Resources>
|
||||
|
||||
<!-- Definizione della ImportPage -->
|
||||
<Border Style="{StaticResource CustomBorder}" >
|
||||
<Grid Name="ImportPageGrid" >
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="3*"/>
|
||||
<ColumnDefinition Width="12*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="0.5*"/>
|
||||
<RowDefinition Height="0.5*"/>
|
||||
<RowDefinition Height="8*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<Label Name="FilePathTxBl" Background="White" FontSize="15"/>
|
||||
<ListBox Name="FileListBox" Grid.Row="1" Grid.RowSpan="2" ItemTemplate="{DynamicResource DataTemplateItem}"
|
||||
ItemsSource="{Binding ItemList}"/>
|
||||
|
||||
<Grid Grid.Column="1" Grid.Row="0" Grid.RowSpan="2">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="2*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="2*"/>
|
||||
<ColumnDefinition Width="2*"/>
|
||||
<ColumnDefinition Width="2*"/>
|
||||
<ColumnDefinition Width="2*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<TextBlock Name="MeasurementUnitTxBx" FontSize="22" TextWrapping="Wrap" HorizontalAlignment="Center" VerticalAlignment="Center"/>
|
||||
<RadioButton Name="mmBtn" Grid.Column="1" FontSize="22"
|
||||
Style="{StaticResource {x:Type ToggleButton}}" />
|
||||
<RadioButton Name="inchBtn" Grid.Column="2" FontSize="22"
|
||||
Style="{StaticResource {x:Type ToggleButton}}" />
|
||||
|
||||
<Button Name="UseLayerBtn" Grid.Column="4" FontSize="22" />
|
||||
<Button Name="UseRegionBtn" Grid.Column="5" FontSize="22" />
|
||||
<Button Name="ResetBtn" Grid.Column="6" FontSize="22" />
|
||||
|
||||
</Grid>
|
||||
|
||||
<!-- Definizione della Grid Inferiore per i Button V e X -->
|
||||
<Grid Name="BottomButtonsGrid" Grid.Column="1" Grid.Row="3">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="7*"/>
|
||||
<ColumnDefinition Width="3*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Button Name="OkBtn" Grid.Column="2" >
|
||||
<Image Source="Resources/V.png" Width="65" Height="65" HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center" />
|
||||
</Button>
|
||||
<Button Name="ExitBtn" Grid.Column="3" >
|
||||
<Image Source="Resources/X.png" Width="65" Height="65" HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center" />
|
||||
</Button>
|
||||
</Grid>
|
||||
|
||||
</Grid>
|
||||
</Border>
|
||||
|
||||
</UserControl>
|
||||
@@ -0,0 +1,394 @@
|
||||
Imports System.Collections.ObjectModel
|
||||
Imports System.IO
|
||||
Imports EgtUILib
|
||||
Imports System.Runtime.InteropServices
|
||||
|
||||
Public Class ImportPageUC
|
||||
|
||||
'Riferimento alla MainWindow
|
||||
Private m_MainWindow As MainWindow = Application.Current.MainWindow
|
||||
|
||||
'Dichiarazione del UserControl SceneButtons
|
||||
Friend m_SceneButtons As SceneButtonsUC
|
||||
|
||||
' Properties
|
||||
Private m_sCurrDir As String = String.Empty
|
||||
Private m_sCurrFile As String = String.Empty
|
||||
Private m_nFileType As Integer = FT.NULL
|
||||
Private m_bFirst As Boolean = True
|
||||
|
||||
'Dichiarazione Scene
|
||||
Friend WithEvents ImportScene As New Scene
|
||||
Dim ImportSceneHost As New System.Windows.Forms.Integration.WindowsFormsHost
|
||||
|
||||
Private Sub ImportPage_Initialized(sender As Object, e As EventArgs)
|
||||
|
||||
'Creazione del UserCOntrol SceneButtons
|
||||
m_SceneButtons = New SceneButtonsUC
|
||||
|
||||
'Posizionemento nella griglia del UserControl SceneButtons
|
||||
m_SceneButtons.SetValue(Grid.ColumnProperty, 0)
|
||||
BottomButtonsGrid.Children.Add(m_SceneButtons)
|
||||
|
||||
'Assegnazione scena all'host e posizionamento nella ImportPageGrid
|
||||
ImportSceneHost.Child = ImportScene
|
||||
ImportSceneHost.SetValue(Grid.ColumnProperty, 1)
|
||||
ImportSceneHost.SetValue(Grid.RowProperty, 2)
|
||||
'ImportSceneHost.SetValue(Grid.RowSpanProperty, 2)
|
||||
Me.ImportPageGrid.Children.Add(ImportSceneHost)
|
||||
|
||||
'Imposto i messaggi letti dal file dei messaggi
|
||||
MeasurementUnitTxBx.Text = EgtMsg(MSG_IMPORTPAGEUC + 1) 'Unità di misura - Measurement Unit
|
||||
mmBtn.Content = EgtMsg(MSG_IMPORTPAGEUC + 2) 'mm
|
||||
inchBtn.Content = EgtMsg(MSG_IMPORTPAGEUC + 3) 'inch
|
||||
UseLayerBtn.Content = EgtMsg(MSG_IMPORTPAGEUC + 4) 'Utilizza layer - Use layer
|
||||
UseRegionBtn.Content = EgtMsg(MSG_IMPORTPAGEUC + 5) 'Utilizza regione - Use region
|
||||
ResetBtn.Content = EgtMsg(MSG_IMPORTPAGEUC + 6) 'Reset
|
||||
|
||||
'Definizione del collegamento tra ItemList e ListBox1
|
||||
FileListBox.ItemsSource = m_MainWindow.ImportItemList
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub ImportPage_Loaded(sender As Object, e As RoutedEventArgs)
|
||||
|
||||
If m_bFirst Then
|
||||
' imposto colore di default
|
||||
Dim DefColor As New Color3d(0, 0, 0)
|
||||
GetPrivateProfileColor(S_GEOMDB, K_DEFAULTCOLOR, DefColor, m_MainWindow.GetIniFile())
|
||||
ImportScene.SetDefaultMaterial(DefColor)
|
||||
' imposto colori sfondo
|
||||
Dim BackTopColor As New Color3d(192, 192, 192)
|
||||
GetPrivateProfileColor(S_SCENE, K_BACKTOP, BackTopColor, m_MainWindow.GetIniFile())
|
||||
Dim BackBotColor As New Color3d(BackTopColor)
|
||||
GetPrivateProfileColor(S_SCENE, K_BACKBOTTOM, BackBotColor, m_MainWindow.GetIniFile())
|
||||
ImportScene.SetViewBackground(BackTopColor, BackBotColor)
|
||||
' imposto colore di evidenziazione
|
||||
Dim MarkColor As New Color3d(255, 255, 0)
|
||||
GetPrivateProfileColor(S_SCENE, K_MARK, MarkColor, m_MainWindow.GetIniFile())
|
||||
ImportScene.SetMarkMaterial(MarkColor)
|
||||
' imposto colore per superfici selezionate
|
||||
Dim SelSurfColor As New Color3d(255, 255, 192)
|
||||
GetPrivateProfileColor(S_SCENE, K_SELSURF, SelSurfColor, m_MainWindow.GetIniFile())
|
||||
ImportScene.SetSelSurfMaterial(SelSurfColor)
|
||||
' imposto tipo e colore del rettangolo di zoom
|
||||
Dim bOutline As Boolean = True
|
||||
Dim ZwColor As New Color3d(0, 0, 0)
|
||||
GetPrivateProfileZoomWin(S_SCENE, K_ZOOMWIN, bOutline, ZwColor, m_MainWindow.GetIniFile())
|
||||
ImportScene.SetZoomWinAttribs(bOutline, ZwColor)
|
||||
' imposto colore della linea di distanza
|
||||
Dim DstLnColor As New Color3d(255, 0, 0)
|
||||
GetPrivateProfileColor(S_SCENE, K_DISTLINE, DstLnColor, m_MainWindow.GetIniFile())
|
||||
ImportScene.SetDistLineMaterial(DstLnColor)
|
||||
' imposto parametri OpenGL
|
||||
Dim nDriver As Integer = GetPrivateProfileInt(S_OPENGL, K_DRIVER, 3, m_MainWindow.GetIniFile())
|
||||
Dim b2Buff As Boolean = (GetPrivateProfileInt(S_OPENGL, K_DOUBLEBUFFER, 1, m_MainWindow.GetIniFile()) <> 0)
|
||||
Dim nColorBits As Integer = GetPrivateProfileInt(S_OPENGL, K_COLORBITS, 32, m_MainWindow.GetIniFile())
|
||||
Dim nDepthBits As Integer = GetPrivateProfileInt(S_OPENGL, K_DEPTHBITS, 32, m_MainWindow.GetIniFile())
|
||||
ImportScene.SetViewAttributes(nDriver, b2Buff, nColorBits, nDepthBits)
|
||||
' Inizializzazione delle viste
|
||||
ImportScene.Init()
|
||||
' Imposto griglia
|
||||
LoadGridData()
|
||||
' leggo direttorio corrente
|
||||
GetPrivateProfileString(S_FLATPARTS, K_FLPCURRDIR, "", m_sCurrDir, m_MainWindow.GetIniFile())
|
||||
' lo carico
|
||||
LoadCurrDir()
|
||||
m_bFirst = False
|
||||
Else
|
||||
EgtSetCurrentContext(ImportScene.GetCtx())
|
||||
End If
|
||||
|
||||
' Pulisco tutto
|
||||
ClearView()
|
||||
' inibisco selezione diretta da Scene
|
||||
ImportScene.SetStatusNull()
|
||||
|
||||
' imposto misura
|
||||
If EgtUiUnitsAreMM() Then
|
||||
mmBtn.IsChecked = True
|
||||
Else
|
||||
inchBtn.IsChecked = True
|
||||
End If
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub LoadGridData()
|
||||
Dim dSnapStep As Double = GetPrivateProfileDouble(S_GRID, K_SNAPSTEP, 10, m_MainWindow.GetIniFile())
|
||||
Dim nMinLineSStep As Integer = GetPrivateProfileInt(S_GRID, K_MINLINESSTEP, 1, m_MainWindow.GetIniFile())
|
||||
Dim nMajLineSStep As Integer = GetPrivateProfileInt(S_GRID, K_MAJLINESSTEP, 10, m_MainWindow.GetIniFile())
|
||||
Dim nExtSStep As Integer = GetPrivateProfileInt(S_GRID, K_EXTSSTEP, 50, m_MainWindow.GetIniFile())
|
||||
Dim MinLnColor As New Color3d(160, 160, 160)
|
||||
GetPrivateProfileColor(S_GRID, K_MINLNCOLOR, MinLnColor, m_MainWindow.GetIniFile())
|
||||
Dim MajLnColor As New Color3d(160, 160, 160)
|
||||
GetPrivateProfileColor(S_GRID, K_MAJLNCOLOR, MajLnColor, m_MainWindow.GetIniFile())
|
||||
EgtSetGridFrame(Frame3d.GLOB)
|
||||
EgtSetGridGeo(dSnapStep, nMinLineSStep, nMajLineSStep, nExtSStep)
|
||||
EgtSetGridColor(MinLnColor, MajLnColor)
|
||||
Dim bShowGrid As Boolean = (GetPrivateProfileInt(S_GRID, K_SHOWGRID, 1, m_MainWindow.GetIniFile()) <> 0)
|
||||
EgtSetGridShow(bShowGrid, False)
|
||||
End Sub
|
||||
|
||||
Private Function LoadCurrDir() As Boolean
|
||||
' se direttorio corrente non valido, carico l'elenco dei dischi
|
||||
If String.IsNullOrWhiteSpace(m_sCurrDir) OrElse Not IO.Directory.Exists(m_sCurrDir) Then
|
||||
Return LoadDisks()
|
||||
End If
|
||||
Dim TempPath As New Text.StringBuilder(260)
|
||||
PathCompactPathEx(TempPath, m_sCurrDir, 28, 0)
|
||||
' lo visualizzo
|
||||
FilePathTxBl.Content = TempPath.ToString
|
||||
' pulisco la lista
|
||||
m_MainWindow.ImportItemList.Clear()
|
||||
' per risalire al direttorio padre
|
||||
m_MainWindow.ImportItemList.Add(New IconListBoxItem("..", 0))
|
||||
' elenco dei sottodirettori
|
||||
Dim DirInfo As New DirectoryInfo(m_sCurrDir)
|
||||
Dim vDirI As DirectoryInfo() = DirInfo.GetDirectories("*")
|
||||
Dim DirI As DirectoryInfo
|
||||
For Each DirI In vDirI
|
||||
If (DirI.Attributes And FileAttributes.Hidden) <> FileAttributes.Hidden Then
|
||||
m_MainWindow.ImportItemList.Add(New IconListBoxItem(DirI.Name, 2))
|
||||
End If
|
||||
Next
|
||||
' elenco dei file
|
||||
Dim vFileI As FileInfo() = DirInfo.GetFiles()
|
||||
Dim FileI As FileInfo
|
||||
For Each FileI In vFileI
|
||||
Dim sExt As String = Path.GetExtension(FileI.Name).ToUpper()
|
||||
If sExt = ".DXF" Or sExt = ".NGE" Then
|
||||
m_MainWindow.ImportItemList.Add(New IconListBoxItem(FileI.Name, 3))
|
||||
End If
|
||||
Next
|
||||
' pulisco la vista
|
||||
ClearView()
|
||||
Return True
|
||||
End Function
|
||||
|
||||
Private Function LoadDisks() As Boolean
|
||||
' dir corrente vuoto
|
||||
m_sCurrDir = ""
|
||||
' lo visualizzo
|
||||
FilePathTxBl.Content = m_sCurrDir
|
||||
' pulisco la lista
|
||||
m_MainWindow.ImportItemList.Clear()
|
||||
' elenco dei dischi
|
||||
Dim vDriI As DriveInfo() = DriveInfo.GetDrives()
|
||||
Dim DriI As DriveInfo
|
||||
For Each DriI In vDriI
|
||||
m_MainWindow.ImportItemList.Add(New IconListBoxItem(DriI.Name, 1))
|
||||
Next
|
||||
' pulisco la vista
|
||||
ClearView()
|
||||
Return True
|
||||
End Function
|
||||
|
||||
Private Sub FileListBox_PreviewMouseUp(sender As Object, e As MouseButtonEventArgs) Handles FileListBox.PreviewMouseUp
|
||||
' Recupero item selezionato
|
||||
If FileListBox.SelectedItems.Count() = 0 Then
|
||||
Return
|
||||
End If
|
||||
Dim vItems As IconListBoxItem = FileListBox.SelectedItems(0)
|
||||
|
||||
' A seconda del tipo
|
||||
Select Case vItems.PictureID
|
||||
Case 0 ' Vai nel direttorio padre
|
||||
m_sCurrDir = IO.Path.GetDirectoryName(m_sCurrDir)
|
||||
m_sCurrFile = ""
|
||||
LoadCurrDir()
|
||||
Case 1 ' Vai nella radice del disco
|
||||
m_sCurrDir = vItems.Name
|
||||
m_sCurrFile = ""
|
||||
LoadCurrDir()
|
||||
Case 2 ' Vai nel sottodirettorio
|
||||
m_sCurrDir = IO.Path.Combine(m_sCurrDir, vItems.Name)
|
||||
m_sCurrFile = ""
|
||||
LoadCurrDir()
|
||||
Case 3 ' File
|
||||
m_sCurrFile = vItems.Name
|
||||
LoadCurrFile()
|
||||
End Select
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub FileListBox_SelectionChanged(sender As Object, e As SelectionChangedEventArgs) Handles FileListBox.SelectionChanged
|
||||
' Recupero item selezionato
|
||||
If FileListBox.SelectedItems.Count() = 0 Then
|
||||
Return
|
||||
End If
|
||||
Dim vItems As IconListBoxItem = FileListBox.SelectedItems(0)
|
||||
|
||||
' Gestisco solo aggiornamento visualizzazione file
|
||||
If vItems.PictureID = 3 Then
|
||||
m_sCurrFile = vItems.Name
|
||||
LoadCurrFile()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Function ClearView() As Boolean
|
||||
' Pulisco il DB geometrico locale
|
||||
EgtNewFile()
|
||||
' Eseguo zoom
|
||||
ImportScene.ZoomAll()
|
||||
' disabilito bottoni Process e Insert
|
||||
UseLayerBtn.IsEnabled = False
|
||||
UseRegionBtn.IsEnabled = False
|
||||
ResetBtn.IsEnabled = False
|
||||
Return True
|
||||
End Function
|
||||
|
||||
Private Function LoadCurrFile() As Boolean
|
||||
' Pulisco il DB geometrico locale
|
||||
Dim bOk As Boolean = EgtNewFile()
|
||||
' Costruisco path completa del componente
|
||||
Dim sPath = IO.Path.Combine(m_sCurrDir, m_sCurrFile)
|
||||
' Riconoscimento tipo
|
||||
m_nFileType = EgtGetFileType(sPath)
|
||||
If m_nFileType = FT.DXF Then
|
||||
' recupero unità di misura del file
|
||||
Dim dScale As Double = If(mmBtn.IsChecked, ONEMM, ONEINCH)
|
||||
' Importo file DXF
|
||||
bOk = bOk AndAlso EgtImportDxf(sPath, dScale)
|
||||
ElseIf m_nFileType = FT.NGE Then
|
||||
' Carico Nge
|
||||
bOk = bOk AndAlso EgtOpenFile(sPath)
|
||||
Else
|
||||
' Formato sconosciuto
|
||||
EgtNewFile()
|
||||
bOk = False
|
||||
End If
|
||||
' Eseguo zoom
|
||||
ImportScene.ZoomAll()
|
||||
' abilito bottoni UseLayer e UseRegion, disabilito Reset e Insert
|
||||
UseLayerBtn.IsEnabled = True
|
||||
UseRegionBtn.IsEnabled = True
|
||||
ResetBtn.IsEnabled = False
|
||||
Return bOk
|
||||
End Function
|
||||
|
||||
Private Sub OnMouseDownScene(sender As Object, e As System.Windows.Forms.MouseEventArgs) Handles ImportScene.OnMouseDownScene
|
||||
' Si può selezionare solo con il tasto sinistro e se stato NULL
|
||||
If e.Button <> Windows.Forms.MouseButtons.Left Or Not ImportScene.IsStatusNull() Then
|
||||
Return
|
||||
End If
|
||||
' Verifico se selezionato indicativo di pezzo
|
||||
EgtSetObjFilterForSelect(True, True, True, True, True)
|
||||
Dim nSel As Integer
|
||||
EgtSelect(e.Location, Scene.DIM_SEL, Scene.DIM_SEL, nSel)
|
||||
Dim nId As Integer = EgtGetFirstObjInSelWin()
|
||||
While nId <> GDB_ID.NULL
|
||||
' Recupero l'identificativo del pezzo cui appartiene
|
||||
Dim nPartId As Integer = EgtGetParent(EgtGetParent(nId))
|
||||
If EgtIsPart(nPartId) Then
|
||||
Dim nStat As Integer = GDB_ST.ON_
|
||||
EgtGetStatus(nPartId, nStat)
|
||||
If nStat = GDB_ST.SEL Then
|
||||
EgtDeselectObj(nPartId)
|
||||
Else
|
||||
EgtSelectObj(nPartId)
|
||||
End If
|
||||
EgtDraw()
|
||||
Exit While
|
||||
End If
|
||||
nId = EgtGetNextObjInSelWin()
|
||||
End While
|
||||
End Sub
|
||||
|
||||
Private Sub ConfirmBtn_Click(sender As Object, e As RoutedEventArgs) Handles OkBtn.Click
|
||||
' Vettore nomi file temporanei
|
||||
Dim sTmpFiles As New ArrayList()
|
||||
' Ciclo di salvataggio dei pezzi selezionati
|
||||
Dim nId As Integer = EgtGetFirstSelectedObj()
|
||||
While nId <> GDB_ID.NULL
|
||||
' Esporto il pezzo in un file temporaneo
|
||||
Dim sTmpFile As String = m_MainWindow.GetTempDir() & "\Wall" & nId & ".Nge"
|
||||
sTmpFiles.Add(sTmpFile)
|
||||
If Not EgtSaveObjToFile(nId, sTmpFile, NGE.BIN) Then
|
||||
Return
|
||||
End If
|
||||
' Passo al pezzo successivo
|
||||
nId = EgtGetNextSelectedObj()
|
||||
End While
|
||||
' Passo al contesto principale
|
||||
EgtSetCurrentContext(m_MainWindow.m_CurrentProjectPageUC.CurrentProjectScene.GetCtx())
|
||||
' Ciclo di caricamento dei pezzi
|
||||
For Each sTmpfile As String In sTmpFiles
|
||||
If My.Computer.FileSystem.FileExists(sTmpfile) Then
|
||||
' Inserisco il pezzo
|
||||
EgtInsertFile(sTmpfile)
|
||||
' Ne recupero l'Id
|
||||
Dim nId2 As Integer = EgtGetLastPart()
|
||||
' Lo posiziono nel parcheggio
|
||||
EgtPackPart(nId2, 0, -INFINITO, 3000, -1000, 100, False)
|
||||
' Cerco di spostarlo nella tavola
|
||||
EgtPackPart(nId2, 0, 0, 3000, 2000, 10, True)
|
||||
' Cancello il file
|
||||
My.Computer.FileSystem.DeleteFile(sTmpfile)
|
||||
End If
|
||||
Next
|
||||
' Aggiorno ambiente principale
|
||||
EgtZoom(ZM.ALL)
|
||||
'Istruzioni per chiudere ImportPageUC e aprire CadCutPageUC
|
||||
m_MainWindow.MainWindowGrid.Children.Remove(m_MainWindow.m_ImportPageUC)
|
||||
m_MainWindow.MainWindowGrid.Children.Add(m_MainWindow.m_CurrentProjectPageUC)
|
||||
m_MainWindow.m_ActivePage = MainWindow.Pages.CadCut
|
||||
End Sub
|
||||
|
||||
Private Sub ExitBtn_Click(sender As Object, e As RoutedEventArgs) Handles ExitBtn.Click
|
||||
'Istruzioni per chiudere ImportPageUC e aprire CadCutPageUC
|
||||
m_MainWindow.MainWindowGrid.Children.Remove(m_MainWindow.m_ImportPageUC)
|
||||
m_MainWindow.MainWindowGrid.Children.Add(m_MainWindow.m_CurrentProjectPageUC)
|
||||
m_MainWindow.m_ActivePage = MainWindow.Pages.CadCut
|
||||
End Sub
|
||||
|
||||
Private Sub ImportPage_Unloaded(sender As Object, e As RoutedEventArgs)
|
||||
' Salvo direttorio corrente
|
||||
WritePrivateProfileString(S_FLATPARTS, K_FLPCURRDIR, m_sCurrDir, m_MainWindow.GetIniFile())
|
||||
End Sub
|
||||
|
||||
Private Sub OkBtn_Click(sender As Object, e As RoutedEventArgs)
|
||||
|
||||
End Sub
|
||||
End Class
|
||||
|
||||
Public Class IconListBoxItem
|
||||
|
||||
Private m_iPictureID As Integer
|
||||
Private m_sName As String
|
||||
|
||||
Public Property PictureID() As Integer
|
||||
Get
|
||||
Return m_iPictureID
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
m_iPictureID = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property Name() As String
|
||||
Get
|
||||
Return m_sName
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_sName = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property PictureString() As String
|
||||
Get
|
||||
Return "/Resources/ImportPageListBoxImages/" + PictureID.ToString() + ".png"
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Sub New()
|
||||
Me.Name = String.Empty
|
||||
Me.PictureID = 0
|
||||
End Sub
|
||||
|
||||
Sub New(Name As String, PictureID As Integer)
|
||||
Me.Name = Name
|
||||
Me.PictureID = PictureID
|
||||
End Sub
|
||||
|
||||
|
||||
End Class
|
||||
@@ -1,14 +1,11 @@
|
||||
<UserControl x:Class="BarLavoraUC"
|
||||
<UserControl x:Class="InternalComponentPageUC"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="853.3" d:DesignWidth="85.3">
|
||||
|
||||
<!-- Definizione barra dei tasti a destra -->
|
||||
<UniformGrid Rows="10" Columns="1">
|
||||
|
||||
</UniformGrid>
|
||||
|
||||
d:DesignHeight="768" d:DesignWidth="256">
|
||||
<Grid>
|
||||
|
||||
</Grid>
|
||||
</UserControl>
|
||||
@@ -0,0 +1,3 @@
|
||||
Public Class InternalComponentPageUC
|
||||
|
||||
End Class
|
||||
@@ -1,26 +0,0 @@
|
||||
<UserControl x:Class="LavoroInCorsoUC"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" mc:Ignorable="d"
|
||||
d:DesignHeight="853.3" d:DesignWidth="1024" Unloaded="LavoroInCorsoUC_Unloaded" Loaded="LavoroInCorsoUC_Loaded" >
|
||||
|
||||
<!-- Chiamata al dizionario -->
|
||||
<UserControl.Resources>
|
||||
<ResourceDictionary Source="OmagCUTDictionary.xaml"/>
|
||||
</UserControl.Resources>
|
||||
|
||||
<!-- Definizione della PAGINA LAVORO IN CORSO -->
|
||||
<Grid x:Name="BackGroundGridLavoroInCorso">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="{StaticResource TabPageColumn0Width}"/>
|
||||
<ColumnDefinition Width="{StaticResource TabPageColumn1Width}"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="{StaticResource TabPageRow0Width}"/>
|
||||
<RowDefinition Height="{StaticResource TabPageRow1Width}"/>
|
||||
<RowDefinition Height="{StaticResource TabPageRow2Width}"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
</Grid>
|
||||
</UserControl>
|
||||
@@ -1,12 +0,0 @@
|
||||
Public Class LavoroInCorsoUC
|
||||
|
||||
Dim MainWindowUC As MainWindow = Application.Current.MainWindow
|
||||
|
||||
Private Sub LavoroInCorsoUC_Unloaded(sender As Object, e As RoutedEventArgs)
|
||||
'BackGroundGridLavoroInCorso.Children.Remove(MainWindowUC.TavolaInLavorazioneHost)
|
||||
End Sub
|
||||
|
||||
Private Sub LavoroInCorsoUC_Loaded(sender As Object, e As RoutedEventArgs)
|
||||
'BackGroundGridLavoroInCorso.Children.Add(MainWindowUC.TavolaInLavorazioneHost)
|
||||
End Sub
|
||||
End Class
|
||||
@@ -0,0 +1,11 @@
|
||||
<UserControl x:Class="MachinePageUC"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="300" d:DesignWidth="300">
|
||||
<Grid>
|
||||
|
||||
</Grid>
|
||||
</UserControl>
|
||||
@@ -0,0 +1,3 @@
|
||||
Public Class MachinePageUC
|
||||
|
||||
End Class
|
||||
@@ -0,0 +1,85 @@
|
||||
<UserControl x:Class="MachineStatusUC"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="85.3" d:DesignWidth="1280">
|
||||
|
||||
<!-- ** Definizione della Grid della Barra in basso ** -->
|
||||
<Grid >
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
</Grid.RowDefinitions>
|
||||
<TextBlock Grid.Column="1" Grid.Row="0"
|
||||
Grid.ColumnSpan="1" Grid.RowSpan="2" Text="100" FontSize="30"/>
|
||||
<TextBlock Grid.Column="2" Grid.Row="0"
|
||||
Grid.ColumnSpan="1" Grid.RowSpan="2" Text="F" FontSize="30"/>
|
||||
<TextBlock Grid.Column="3" Grid.Row="0"
|
||||
Grid.ColumnSpan="1" Grid.RowSpan="2" Text="4.72" FontSize="30"/>
|
||||
<TextBlock Grid.Column="4" Grid.Row="0"
|
||||
Grid.ColumnSpan="1" Grid.RowSpan="2" Text="X" FontSize="30"/>
|
||||
<TextBlock Grid.Column="5" Grid.Row="0"
|
||||
Grid.ColumnSpan="1" Grid.RowSpan="1" Text="-581.26" FontSize="15"/>
|
||||
<TextBlock Grid.Column="5" Grid.Row="1"
|
||||
Grid.ColumnSpan="1" Grid.RowSpan="1" Text="4.7" FontSize="15"/>
|
||||
<TextBlock Grid.Column="6" Grid.Row="0"
|
||||
Grid.ColumnSpan="1" Grid.RowSpan="2" Text="Y" FontSize="30"/>
|
||||
<TextBlock Grid.Column="7" Grid.Row="0"
|
||||
Grid.ColumnSpan="1" Grid.RowSpan="1" Text="0.00" FontSize="15"/>
|
||||
<TextBlock Grid.Column="7" Grid.Row="1"
|
||||
Grid.ColumnSpan="1" Grid.RowSpan="1" Text="33.0" FontSize="15"/>
|
||||
<TextBlock Grid.Column="8" Grid.Row="0"
|
||||
Grid.ColumnSpan="1" Grid.RowSpan="2" Text="Z" FontSize="30"/>
|
||||
<TextBlock Grid.Column="9" Grid.Row="0"
|
||||
Grid.ColumnSpan="1" Grid.RowSpan="1" Text="-53.0" FontSize="15"/>
|
||||
<TextBlock Grid.Column="9" Grid.Row="1"
|
||||
Grid.ColumnSpan="1" Grid.RowSpan="1" Text="3.6" FontSize="15"/>
|
||||
<TextBlock Grid.Column="10" Grid.Row="0"
|
||||
Grid.ColumnSpan="1" Grid.RowSpan="2" Text="W" FontSize="30"/>
|
||||
<TextBlock Grid.Column="11" Grid.Row="0"
|
||||
Grid.ColumnSpan="1" Grid.RowSpan="1" Text="0.00" FontSize="15"/>
|
||||
<TextBlock Grid.Column="11" Grid.Row="1"
|
||||
Grid.ColumnSpan="1" Grid.RowSpan="1" Text="11.00" FontSize="15"/>
|
||||
<TextBlock Grid.Column="12" Grid.Row="0"
|
||||
Grid.ColumnSpan="1" Grid.RowSpan="2" Text="R" FontSize="30"/>
|
||||
<TextBlock Grid.Column="13" Grid.Row="0"
|
||||
Grid.ColumnSpan="1" Grid.RowSpan="1" Text="0.00" FontSize="15"/>
|
||||
<TextBlock Grid.Column="13" Grid.Row="1"
|
||||
Grid.ColumnSpan="1" Grid.RowSpan="1" Text="6.00" FontSize="15"/>
|
||||
<TextBlock Grid.Column="15" Grid.Row="0"
|
||||
Grid.ColumnSpan="1" Grid.RowSpan="1" Text="1700[rpm]" FontSize="15"/>
|
||||
<TextBlock Grid.Column="15" Grid.Row="1"
|
||||
Grid.ColumnSpan="1" Grid.RowSpan="1" Text="1700[rpm]" FontSize="15"/>
|
||||
<TextBlock Grid.Column="16" Grid.Row="0"
|
||||
Grid.ColumnSpan="1" Grid.RowSpan="1" Text="25[A]" FontSize="15"/>
|
||||
<TextBlock Grid.Column="16" Grid.Row="1"
|
||||
Grid.ColumnSpan="1" Grid.RowSpan="1" Text="15[A]" FontSize="15"/>
|
||||
<Image Grid.Column="14" Grid.Row="0"
|
||||
Grid.ColumnSpan="1" Grid.RowSpan="2" Source="Resources/Lama.jpg"/>
|
||||
<Image Grid.Column="0" Grid.Row="0"
|
||||
Grid.ColumnSpan="1" Grid.RowSpan="2" Source="Resources/ZigZag.jpg" HorizontalAlignment="Left" />
|
||||
|
||||
</Grid>
|
||||
|
||||
</UserControl>
|
||||
@@ -0,0 +1,3 @@
|
||||
Public Class MachineStatusUC
|
||||
|
||||
End Class
|
||||
@@ -0,0 +1,42 @@
|
||||
<UserControl x:Class="MainComponentPageUC"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="768" d:DesignWidth="256" Initialized="MainComponentPage_Initialized">
|
||||
|
||||
<!-- Chiamata al Dictionary -->
|
||||
<UserControl.Resources>
|
||||
<ResourceDictionary Source="OmagCutDictionary.xaml"/>
|
||||
</UserControl.Resources>
|
||||
|
||||
<!-- Definizione della MainComponentPage -->
|
||||
<Grid Name="MainComponentPageGrid">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<!-- Attenzione! Questi Button devono avere lo stesso nome dei componenti nel file Ini -->
|
||||
<Button Name="Compo1" Grid.Row="0" FontSize="22"/>
|
||||
<Button Name="Compo2" Grid.Row="1" FontSize="22"/>
|
||||
<Button Name="Compo3" Grid.Row="2" FontSize="22"/>
|
||||
<Button Name="Compo4" Grid.Row="3" FontSize="22"/>
|
||||
<Button Name="Compo5" Grid.Row="4" FontSize="22"/>
|
||||
<Button Name="Compo6" Grid.Row="5" FontSize="22"/>
|
||||
<Button Name="Compo7" Grid.Row="6" FontSize="22"/>
|
||||
<Button Name="Compo8" Grid.Row="7" FontSize="22"/>
|
||||
<Button Name="Compo9" Grid.Row="8" FontSize="22"/>
|
||||
|
||||
</Grid>
|
||||
|
||||
</UserControl>
|
||||
@@ -0,0 +1,59 @@
|
||||
Imports EgtUILib
|
||||
|
||||
Public Class MainComponentPageUC
|
||||
|
||||
'Riferimento alla MainWindow
|
||||
Private m_MainWindow As MainWindow = Application.Current.MainWindow
|
||||
|
||||
'Dichiarazione delle Page UserControl
|
||||
Dim m_SecondaryComponentPage As SecondaryComponentPageUC
|
||||
|
||||
Friend CurrentBtn As Button = Nothing
|
||||
|
||||
Private Sub MainComponentPage_Initialized(sender As Object, e As EventArgs)
|
||||
|
||||
'Creazione delle Page UserControl
|
||||
m_SecondaryComponentPage = New SecondaryComponentPageUC
|
||||
|
||||
Dim nCompoNumber As Integer = GetPrivateProfileInt("Compo", "Count", 0, m_MainWindow.GetIniFile())
|
||||
For index As Integer = 1 To nCompoNumber
|
||||
Dim nCompoName As Integer = GetPrivateProfileInt("Compo" & index, "Name", 0, m_MainWindow.GetIniFile())
|
||||
GetButton(index).Content = EgtMsg(MSG_COMPONENTPAGE + nCompoName)
|
||||
Next
|
||||
|
||||
End Sub
|
||||
|
||||
Private Function GetButton(ByVal nInd As Integer) As Button
|
||||
Select Case nInd
|
||||
Case 1
|
||||
Return Compo1
|
||||
Case 2
|
||||
Return Compo2
|
||||
Case 3
|
||||
Return Compo3
|
||||
Case 4
|
||||
Return Compo4
|
||||
Case 5
|
||||
Return Compo5
|
||||
Case 6
|
||||
Return Compo6
|
||||
Case 7
|
||||
Return Compo7
|
||||
Case 8
|
||||
Return Compo8
|
||||
Case Else
|
||||
Return Compo9
|
||||
End Select
|
||||
End Function
|
||||
|
||||
Private Sub Compo_Click(sender As Object, e As RoutedEventArgs) Handles Compo1.Click, Compo2.Click, Compo3.Click, Compo4.Click, Compo5.Click, Compo6.Click, Compo7.Click, Compo8.Click, Compo9.Click
|
||||
CurrentBtn = e.Source
|
||||
Dim nCount As Integer = GetPrivateProfileInt(CurrentBtn.Name, "Count", 0, m_MainWindow.GetIniFile())
|
||||
If nCount > 1 Then
|
||||
m_MainWindow.m_DrawPageUC.DrawPageGrid.Children.Add(m_SecondaryComponentPage)
|
||||
Else
|
||||
GetPrivateProfileInt(CurrentBtn.Name, "Count", 0, m_MainWindow.GetIniFile())
|
||||
End If
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
@@ -4,297 +4,48 @@
|
||||
xmlns:local="clr-namespace:OmagCUT"
|
||||
Title="MainWindow" Height="1024" Width="1280" Loaded="Window_Loaded" Background="Gray" ResizeMode="NoResize" WindowStyle="None" Initialized="Window_Initialized" PreviewMouseDown="MainWindow_PreviewMouseDown" KeyDown="MainWindow_KeyDown">
|
||||
|
||||
<!-- Chiamata al dizionario che contiene Styles e Colori -->
|
||||
<!-- Chiamata al Dictionary -->
|
||||
<Window.Resources>
|
||||
<ResourceDictionary Source="OmagCUTDictionary.xaml"></ResourceDictionary>
|
||||
<ResourceDictionary Source="OmagCUTDictionary.xaml" />
|
||||
</Window.Resources>
|
||||
|
||||
<Grid Name="MainGrid">
|
||||
|
||||
<!-- ** Definizione della Grid di base della finestra ** -->
|
||||
<!-- ** Definizione della Grid della MainWindow ** -->
|
||||
<Grid Name="MainWindowGrid">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="5*"/>
|
||||
<RowDefinition Height="5*"/>
|
||||
<RowDefinition Height="10*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="3*"/>
|
||||
<ColumnDefinition Width="7*"/>
|
||||
<ColumnDefinition Width="5*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<!-- *************************************************************************** -->
|
||||
|
||||
<!-- ** Definizione della Grid della Barra in alto ** -->
|
||||
|
||||
<Grid Grid.ColumnSpan="3">
|
||||
<!-- ** Definizione della Grid della Row 0 (Barra superiore) ** -->
|
||||
<Grid >
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="3*"/>
|
||||
<ColumnDefinition Width="11*"/>
|
||||
<ColumnDefinition Width="2*"/>
|
||||
<ColumnDefinition Width="2*"/>
|
||||
<ColumnDefinition Width="2*"/>
|
||||
<ColumnDefinition Width="2*"/>
|
||||
<ColumnDefinition Width="2*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Button Grid.Column="2" Click="ExitBtnMW_Click">
|
||||
<Image Style="{StaticResource ButtonImage}" Source="Resources/ExitIcon.png"/>
|
||||
</Button>
|
||||
|
||||
<Image Source="Resources/LogoOmag.jpg" Stretch="Fill"/>
|
||||
</Grid>
|
||||
|
||||
<!-- *************************************************************************** -->
|
||||
<!-- ** Definizione del TABCONTROL ** -->
|
||||
|
||||
<TabControl Name="TabControl" Grid.ColumnSpan="3" Grid.Row="1" Grid.RowSpan="2"
|
||||
TabStripPlacement="Left" SelectionChanged="TabControl_SelectionChanged">
|
||||
|
||||
<!-- ** Definizione del TABITEM LAVORO IN CORSO ** -->
|
||||
<TabItem Name="TabLavoroInCorso">
|
||||
|
||||
<!-- Definizione dell'HEADER LAVORO IN CORSO -->
|
||||
<TabItem.Header>
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="{StaticResource TabHeaderImageColumnWidth}"/>
|
||||
<ColumnDefinition Width="{StaticResource TabHeaderTextBlockColumnWidth}"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Image Style="{StaticResource TabHeaderImage}"
|
||||
Source="c:\Users\Emmanuele\Documents\Visual Studio 2013\Projects\ProvaTab2\ProvaTab2\Images\Import.png"/>
|
||||
<TextBlock Style="{StaticResource TabHeaderTextBlock}"
|
||||
Text="Lavoro in corso" />
|
||||
</Grid>
|
||||
</TabItem.Header>
|
||||
|
||||
<!-- Riferimento al User Control della PAGINA LAVORO IN CORSO -->
|
||||
<local:LavoroInCorsoUC x:Name="LavoroInCorsoUC"/>
|
||||
|
||||
</TabItem>
|
||||
|
||||
<!-- *************************************************************************** -->
|
||||
|
||||
<!-- ** Definizione del TABITEM TAGLI DIRETTI ** -->
|
||||
<TabItem Name="TabTagliDiretti">
|
||||
|
||||
<!-- Definizione dell'HEADER TAGLI DIRETTI -->
|
||||
<TabItem.Header>
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="{StaticResource TabHeaderImageColumnWidth}"/>
|
||||
<ColumnDefinition Width="{StaticResource TabHeaderTextBlockColumnWidth}"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Image Style="{StaticResource TabHeaderImage}"
|
||||
Source="c:\Users\Emmanuele\Documents\Visual Studio 2013\Projects\ProvaTab2\ProvaTab2\Images\Import.png" />
|
||||
<TextBlock Style="{StaticResource TabHeaderTextBlock}"
|
||||
Text="Tagli Diretti" />
|
||||
</Grid>
|
||||
</TabItem.Header>
|
||||
|
||||
<!-- Riferimento al User Control della PAGINA TAGLI DIRETTI -->
|
||||
<local:TagliDirettiUC x:Name="TagliDirettiUC"/>
|
||||
|
||||
</TabItem>
|
||||
|
||||
<!-- *************************************************************************** -->
|
||||
|
||||
<!-- ** Definizione del TABITEM TAGLI CAD ** -->
|
||||
<TabItem Name="TabTagliCad">
|
||||
|
||||
<!-- Definizione dell'HEADER TAGLI CAD -->
|
||||
<TabItem.Header>
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="{StaticResource TabHeaderImageColumnWidth}"/>
|
||||
<ColumnDefinition Width="{StaticResource TabHeaderTextBlockColumnWidth}"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Image Style="{StaticResource TabHeaderImage}"
|
||||
Source="c:\Users\Emmanuele\Documents\Visual Studio 2013\Projects\ProvaTab2\ProvaTab2\Images\Import.png"/>
|
||||
<TextBlock Style="{StaticResource TabHeaderTextBlock}"
|
||||
Text="Tagli Cad" />
|
||||
</Grid>
|
||||
</TabItem.Header>
|
||||
|
||||
<!-- Riferimento al User Control della PAGINA TAGLI CAD -->
|
||||
<ContentPresenter Name="TagliCadContent" />
|
||||
|
||||
</TabItem>
|
||||
|
||||
<!-- *************************************************************************** -->
|
||||
<ToggleButton Name="WorkInProgressBtn" Grid.Column="1" FontSize="20" FontWeight="Bold" />
|
||||
<ToggleButton Name="DirectCutBtn" Grid.Column="2" FontSize="20" FontWeight="Bold" />
|
||||
<ToggleButton Name="CadCutBtn" Grid.Column="3" FontSize="20" FontWeight="Bold" />
|
||||
<ToggleButton Name="FrameCutBtn" Grid.Column="4" FontSize="20" FontWeight="Bold" />
|
||||
<ToggleButton Name="MachineBtn" Grid.Column="5" FontSize="20" FontWeight="Bold" />
|
||||
<ToggleButton Name="OptionsBtn" Grid.Column="6" FontSize="20" FontWeight="Bold" />
|
||||
|
||||
<!-- ** Definizione del TABITEM LAVORAZIONE CORNICI ** -->
|
||||
<TabItem Name="TabLavorazioneCornici">
|
||||
<Button Grid.Column="7" Click="ExitBtn_Click">
|
||||
<Image Style="{StaticResource ButtonImage}" Source="Resources/ExitIcon.png"/>
|
||||
</Button>
|
||||
|
||||
<!-- Definizione dell'HEADER LAVORAZIONE CORNICI -->
|
||||
<TabItem.Header>
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="{StaticResource TabHeaderImageColumnWidth}"/>
|
||||
<ColumnDefinition Width="{StaticResource TabHeaderTextBlockColumnWidth}"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Image Style="{StaticResource TabHeaderImage}"
|
||||
Source="c:\Users\Emmanuele\Documents\Visual Studio 2013\Projects\ProvaTab2\ProvaTab2\Images\Import.png"/>
|
||||
<TextBlock Style="{StaticResource TabHeaderTextBlock}"
|
||||
Text="Cornici" />
|
||||
</Grid>
|
||||
</TabItem.Header>
|
||||
|
||||
<!-- Riferimento al User Control della PAGINA TAGLI DIRETTI -->
|
||||
<local:CorniciUC x:Name="CorniciUC"/>
|
||||
|
||||
</TabItem>
|
||||
|
||||
<!-- *************************************************************************** -->
|
||||
|
||||
<!-- ** Definizione del TABITEM COMANDI MACCHINA ** -->
|
||||
<TabItem Name="TabComandiMacchina">
|
||||
|
||||
<!-- Definizione dell'HEADER COMANDI MACCHINA -->
|
||||
<TabItem.Header>
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="{StaticResource TabHeaderImageColumnWidth}"/>
|
||||
<ColumnDefinition Width="{StaticResource TabHeaderTextBlockColumnWidth}"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Image Style="{StaticResource TabHeaderImage}"
|
||||
Source="c:\Users\Emmanuele\Documents\Visual Studio 2013\Projects\ProvaTab2\ProvaTab2\Images\Import.png"/>
|
||||
<TextBlock Style="{StaticResource TabHeaderTextBlock}"
|
||||
Text="Macchina" />
|
||||
</Grid>
|
||||
</TabItem.Header>
|
||||
|
||||
<!-- Definizione della PAGINA COMANDI MACCHINA -->
|
||||
<Grid>
|
||||
|
||||
</Grid>
|
||||
</TabItem>
|
||||
|
||||
<!-- *************************************************************************** -->
|
||||
|
||||
<!-- ** Definizione del TABITEM ALLARMI ** -->
|
||||
<TabItem Name="TabAllarmi">
|
||||
|
||||
<!-- Definizione dell'HEADER ALLARMI -->
|
||||
<TabItem.Header>
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="{StaticResource TabHeaderImageColumnWidth}"/>
|
||||
<ColumnDefinition Width="{StaticResource TabHeaderTextBlockColumnWidth}"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Image Style="{StaticResource TabHeaderImage}"
|
||||
Source="c:\Users\Emmanuele\Documents\Visual Studio 2013\Projects\ProvaTab2\ProvaTab2\Images\Import.png"/>
|
||||
<TextBlock Style="{StaticResource TabHeaderTextBlock}"
|
||||
Text="Allarmi" />
|
||||
</Grid>
|
||||
</TabItem.Header>
|
||||
|
||||
<!-- Definizione della PAGINA ALLARMI -->
|
||||
<Grid>
|
||||
|
||||
</Grid>
|
||||
</TabItem>
|
||||
|
||||
<!-- *************************************************************************** -->
|
||||
|
||||
<!-- ** Definizione del TABITEM CONFIGURAZIONE ** -->
|
||||
<TabItem Name="TabComandiConfigurazione">
|
||||
|
||||
<!-- Definizione dell'HEADER CONFIGURAZIONE -->
|
||||
<TabItem.Header>
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="{StaticResource TabHeaderImageColumnWidth}"/>
|
||||
<ColumnDefinition Width="{StaticResource TabHeaderTextBlockColumnWidth}"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Image Style="{StaticResource TabHeaderImage}"
|
||||
Source="c:\Users\Emmanuele\Documents\Visual Studio 2013\Projects\ProvaTab2\ProvaTab2\Images\Import.png"/>
|
||||
<TextBlock Style="{StaticResource TabHeaderTextBlock}"
|
||||
Text="Configurazione" />
|
||||
</Grid>
|
||||
</TabItem.Header>
|
||||
|
||||
<!-- Definizione della PAGINA CONFIGURAZIONE -->
|
||||
<Grid>
|
||||
|
||||
</Grid>
|
||||
</TabItem>
|
||||
|
||||
<!-- *************************************************************************** -->
|
||||
|
||||
</TabControl>
|
||||
|
||||
<!-- ** Definizione del TABITEM CONFIGURAZIONE ** -->
|
||||
<Grid Grid.Row="3" Grid.ColumnSpan="3" Background="White">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
</Grid.RowDefinitions>
|
||||
<TextBlock Grid.Column="1" Grid.Row="0"
|
||||
Grid.ColumnSpan="1" Grid.RowSpan="2" Text="100" FontSize="30"/>
|
||||
<TextBlock Grid.Column="2" Grid.Row="0"
|
||||
Grid.ColumnSpan="1" Grid.RowSpan="2" Text="F" FontSize="30"/>
|
||||
<TextBlock Grid.Column="3" Grid.Row="0"
|
||||
Grid.ColumnSpan="1" Grid.RowSpan="2" Text="4.72" FontSize="30"/>
|
||||
<TextBlock Grid.Column="4" Grid.Row="0"
|
||||
Grid.ColumnSpan="1" Grid.RowSpan="2" Text="X" FontSize="30"/>
|
||||
<TextBlock Grid.Column="5" Grid.Row="0"
|
||||
Grid.ColumnSpan="1" Grid.RowSpan="1" Text="-581.26" FontSize="15"/>
|
||||
<TextBlock Grid.Column="5" Grid.Row="1"
|
||||
Grid.ColumnSpan="1" Grid.RowSpan="1" Text="4.7" FontSize="15"/>
|
||||
<TextBlock Grid.Column="6" Grid.Row="0"
|
||||
Grid.ColumnSpan="1" Grid.RowSpan="2" Text="Y" FontSize="30"/>
|
||||
<TextBlock Grid.Column="7" Grid.Row="0"
|
||||
Grid.ColumnSpan="1" Grid.RowSpan="1" Text="0.00" FontSize="15"/>
|
||||
<TextBlock Grid.Column="7" Grid.Row="1"
|
||||
Grid.ColumnSpan="1" Grid.RowSpan="1" Text="33.0" FontSize="15"/>
|
||||
<TextBlock Grid.Column="8" Grid.Row="0"
|
||||
Grid.ColumnSpan="1" Grid.RowSpan="2" Text="Z" FontSize="30"/>
|
||||
<TextBlock Grid.Column="9" Grid.Row="0"
|
||||
Grid.ColumnSpan="1" Grid.RowSpan="1" Text="-53.0" FontSize="15"/>
|
||||
<TextBlock Grid.Column="9" Grid.Row="1"
|
||||
Grid.ColumnSpan="1" Grid.RowSpan="1" Text="3.6" FontSize="15"/>
|
||||
<TextBlock Grid.Column="10" Grid.Row="0"
|
||||
Grid.ColumnSpan="1" Grid.RowSpan="2" Text="W" FontSize="30"/>
|
||||
<TextBlock Grid.Column="11" Grid.Row="0"
|
||||
Grid.ColumnSpan="1" Grid.RowSpan="1" Text="0.00" FontSize="15"/>
|
||||
<TextBlock Grid.Column="11" Grid.Row="1"
|
||||
Grid.ColumnSpan="1" Grid.RowSpan="1" Text="11.00" FontSize="15"/>
|
||||
<TextBlock Grid.Column="12" Grid.Row="0"
|
||||
Grid.ColumnSpan="1" Grid.RowSpan="2" Text="R" FontSize="30"/>
|
||||
<TextBlock Grid.Column="13" Grid.Row="0"
|
||||
Grid.ColumnSpan="1" Grid.RowSpan="1" Text="0.00" FontSize="15"/>
|
||||
<TextBlock Grid.Column="13" Grid.Row="1"
|
||||
Grid.ColumnSpan="1" Grid.RowSpan="1" Text="6.00" FontSize="15"/>
|
||||
<TextBlock Grid.Column="15" Grid.Row="0"
|
||||
Grid.ColumnSpan="1" Grid.RowSpan="1" Text="1700[rpm]" FontSize="15"/>
|
||||
<TextBlock Grid.Column="15" Grid.Row="1"
|
||||
Grid.ColumnSpan="1" Grid.RowSpan="1" Text="1700[rpm]" FontSize="15"/>
|
||||
<TextBlock Grid.Column="16" Grid.Row="0"
|
||||
Grid.ColumnSpan="1" Grid.RowSpan="1" Text="25[A]" FontSize="15"/>
|
||||
<TextBlock Grid.Column="16" Grid.Row="1"
|
||||
Grid.ColumnSpan="1" Grid.RowSpan="1" Text="15[A]" FontSize="15"/>
|
||||
<Image Grid.Column="14" Grid.Row="0"
|
||||
Grid.ColumnSpan="1" Grid.RowSpan="2" Source="Resources/Lama.jpg"/>
|
||||
<Image Grid.Column="0" Grid.Row="0"
|
||||
Grid.ColumnSpan="1" Grid.RowSpan="2" Source="Resources/ZigZag.jpg" HorizontalAlignment="Left" />
|
||||
<!--<Image Source="c:\EgalTech\BarraSotto.jpg" Stretch="Fill"/>-->
|
||||
</Grid>
|
||||
|
||||
</Grid>
|
||||
|
||||
|
||||
</Window>
|
||||
|
||||
@@ -1,45 +1,64 @@
|
||||
Imports System.Runtime.InteropServices
|
||||
Imports System.Threading
|
||||
|
||||
Imports System.Windows.Controls
|
||||
Imports System.Globalization
|
||||
Imports System.Collections.ObjectModel
|
||||
Imports EgtUILib
|
||||
Imports EgtUILib.EgtInterface
|
||||
Imports EgtUILib.Scene
|
||||
Imports System.Text
|
||||
|
||||
'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 delle Page UserControl
|
||||
Friend m_GrezzoUC As GrezzoUC
|
||||
Friend m_WorkInProgressPageUC As WorkInProgressPageUC
|
||||
Friend m_CurrentProjectPageUC As CurrentProjectPageUC
|
||||
Friend m_DirectCutPageUC As DirectCutPageUC
|
||||
Friend m_CadCutPageUC As CadCutPageUC
|
||||
Friend m_DrawPageUC As DrawPageUC
|
||||
Friend m_ImportPageUC As ImportPageUC
|
||||
Friend m_FrameCutPageUC As FrameCutPageUC
|
||||
Friend m_MachinePageUC As MachinePageUC
|
||||
Friend m_AlarmsPageUC As AlarmsPageUC
|
||||
Friend m_OptionsPageUC As OptionsPageUC
|
||||
Friend m_NumericKeyboardWD As NumericKeyboardWD
|
||||
|
||||
'Dichiarazione variabili direttori
|
||||
Private m_sDataRoot As String = String.Empty
|
||||
Private m_sConfigDir As String = String.Empty
|
||||
Private m_sTempDir As String = String.Empty
|
||||
Private m_sMachinesRoot As String = String.Empty
|
||||
Private Shared m_sIniFile As String = String.Empty
|
||||
Private m_nDebug As Integer = 0
|
||||
Private WithEvents m_Controller1 As New Controller
|
||||
Private WithEvents m_Controller2 As New Controller
|
||||
|
||||
'Per creazione Scene
|
||||
Friend WithEvents MachiningScene As Scene
|
||||
Friend WithEvents ActiveScene As Scene
|
||||
Friend TavolaInLavorazioneHost As New System.Windows.Forms.Integration.WindowsFormsHost
|
||||
Friend TavolaInProgettoHost As New System.Windows.Forms.Integration.WindowsFormsHost
|
||||
'Dichiarazione lista per ListBox della ImportPage
|
||||
Friend ImportItemList As New ObservableCollection(Of IconListBoxItem)
|
||||
|
||||
'Per TagliCadUC
|
||||
Friend m_TagliCadUC As TagliCadUC
|
||||
Private m_ComponentiUC As ComponentiUC
|
||||
Friend m_GrezzoUC As GrezzoUC
|
||||
Friend WithEvents m_NumericKeyboardWD As NumericKeyboardWD
|
||||
'Riferimento alla pagina correntemente attiva
|
||||
Friend m_ActivePage As Pages
|
||||
|
||||
'Riferimento alla textbox che ha aperto la tastiera
|
||||
'Friend m_TxBxGotKeyboardFocus As TextBox
|
||||
Enum Pages
|
||||
WorkInProgress
|
||||
DirectCut
|
||||
CadCut
|
||||
Draw
|
||||
Import
|
||||
FrameCut
|
||||
Machine
|
||||
Alarms
|
||||
Options
|
||||
End Enum
|
||||
|
||||
'***********************************************
|
||||
|
||||
Public Shared Function GetIniFile() As String
|
||||
Public Function GetIniFile() As String
|
||||
Return m_sIniFile
|
||||
End Function
|
||||
|
||||
Public Function GetTempDir() As String
|
||||
Return m_sTempDir
|
||||
End Function
|
||||
|
||||
Private Sub Window_Initialized(sender As Object, e As EventArgs)
|
||||
|
||||
' Impostazione path radice per i dati
|
||||
@@ -76,217 +95,388 @@ Class MainWindow
|
||||
If Not EgtLoadMessages(sMsgFilePath) Then
|
||||
EgtOutLog("Error in EgtLoadMessages")
|
||||
End If
|
||||
|
||||
'Creazione UserControl dinamici
|
||||
m_TagliCadUC = New TagliCadUC
|
||||
m_ComponentiUC = New ComponentiUC
|
||||
m_GrezzoUC = New GrezzoUC
|
||||
m_NumericKeyboardWD = New NumericKeyboardWD
|
||||
|
||||
'Posiziono gli Host nelle rispettive griglie
|
||||
TavolaInLavorazioneHost.SetValue(Grid.ColumnProperty, 0)
|
||||
TavolaInLavorazioneHost.SetValue(Grid.RowProperty, 1)
|
||||
TavolaInProgettoHost.SetValue(Grid.ColumnProperty, 0)
|
||||
TavolaInProgettoHost.SetValue(Grid.RowProperty, 1)
|
||||
|
||||
'Assegno l'host TavolaInLavorazioneHost a LavoroInCorsoUC
|
||||
LavoroInCorsoUC.BackGroundGridLavoroInCorso.Children.Add(TavolaInLavorazioneHost)
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub Window_Loaded(ByVal sender As Object, ByVal e As RoutedEventArgs)
|
||||
|
||||
'Assegno la NumericKeyboardWD come child della MainWindow
|
||||
m_NumericKeyboardWD.Owner = Me
|
||||
|
||||
'Creo la scena
|
||||
Me.MachiningScene = New Scene
|
||||
Me.ActiveScene = New Scene
|
||||
|
||||
'Assegno il controllo Scena come Child dell'host
|
||||
TavolaInLavorazioneHost.Child = MachiningScene
|
||||
TavolaInProgettoHost.Child = ActiveScene
|
||||
|
||||
'' 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
|
||||
' m_sDataRoot = System.AppDomain.CurrentDomain.BaseDirectory
|
||||
'End If
|
||||
'' Impostazione direttorio di configurazione
|
||||
'm_sConfigDir = m_sDataRoot & "\" & CONF_DIR
|
||||
'' Impostazione direttorio per file temporanei
|
||||
'm_sTempDir = m_sDataRoot & "\" & TEMP_DIR
|
||||
'' Impostazione path Ini file
|
||||
'm_sIniFile = m_sConfigDir & "\" & INI_FILE_NAME
|
||||
'' Impostazione direttorio per le macchine
|
||||
'If GetPrivateProfileString(S_MACH, K_MACHINESDIR, "", m_sMachinesRoot, m_sIniFile) = 0 Then
|
||||
' m_sMachinesRoot = m_sDataRoot & "\" & MACHINES_DFL_DIR
|
||||
'End If
|
||||
'' Leggo e imposto chiave di protezione
|
||||
'Dim sLicFileName As String = String.Empty
|
||||
'GetPrivateProfileString(S_GENERAL, K_LICENCE, LIC_FILE_NAME, sLicFileName, m_sIniFile)
|
||||
'Dim sLicFile As String = m_sConfigDir & "\" & sLicFileName
|
||||
'Dim sKey As String = String.Empty
|
||||
'GetPrivateProfileString(S_LICENCE, K_KEY, "", sKey, sLicFile)
|
||||
'EgtSetKey(sKey)
|
||||
''Inizializzazione generale di EgtInterface
|
||||
'm_nDebug = GetPrivateProfileInt(S_GENERAL, K_DEBUG, 0, m_sIniFile)
|
||||
'Dim sLogFile As String = m_sTempDir & "\" & GENLOG_FILE_NAME
|
||||
'Dim sLogMsg As String = My.Application.Info.Description.ToString() & " ver. " & My.Application.Info.Version.ToString()
|
||||
'EgtInit(m_nDebug, sLogFile, sLogMsg)
|
||||
'' Leggo file messaggi
|
||||
'Dim sMsgFile As String = String.Empty
|
||||
'GetPrivateProfileString(S_GENERAL, K_MESSAGES, "", sMsgFile, m_sIniFile)
|
||||
'Dim sMsgFilePath As String = m_sConfigDir & "\" & sMsgFile
|
||||
'If Not EgtLoadMessages(sMsgFilePath) Then
|
||||
' EgtOutLog("Error in EgtLoadMessages")
|
||||
'End If
|
||||
' imposto dir font Nfe e font default
|
||||
Dim sNfeDir As String = String.Empty
|
||||
GetPrivateProfileString(S_GEOMDB, K_NFEFONTDIR, "", sNfeDir, m_sIniFile)
|
||||
Dim sDefFont As String = String.Empty
|
||||
GetPrivateProfileString(S_GEOMDB, K_DEFAULTFONT, "", sDefFont, m_sIniFile)
|
||||
EgtSetFont(sNfeDir, sDefFont)
|
||||
' imposto direttorio di default per libreria Lua
|
||||
' imposto dir di default per libreria Lua e lancio libreria di base
|
||||
Dim sLuaLibsDir As String = String.Empty
|
||||
GetPrivateProfileString(S_LUA, K_LIBSDIR, "", sLuaLibsDir, m_sIniFile)
|
||||
EgtSetLuaLibs(sLuaLibsDir)
|
||||
' imposto colore di default
|
||||
Dim DefColor As New Color3d(0, 0, 0)
|
||||
GetPrivateProfileColor(S_GEOMDB, K_DEFAULTCOLOR, DefColor, m_sIniFile)
|
||||
MachiningScene.SetDefaultMaterial(DefColor)
|
||||
ActiveScene.SetDefaultMaterial(DefColor)
|
||||
' imposto colori sfondo
|
||||
Dim BackTopColor As New Color3d(192, 192, 192)
|
||||
GetPrivateProfileColor(S_SCENE, K_BACKTOP, BackTopColor, m_sIniFile)
|
||||
Dim BackBotColor As New Color3d(BackTopColor)
|
||||
GetPrivateProfileColor(S_SCENE, K_BACKBOTTOM, BackBotColor, m_sIniFile)
|
||||
MachiningScene.SetViewBackground(BackTopColor, BackBotColor)
|
||||
ActiveScene.SetViewBackground(BackTopColor, BackBotColor)
|
||||
' imposto colore di evidenziazione
|
||||
Dim MarkColor As New Color3d(255, 255, 0)
|
||||
GetPrivateProfileColor(S_SCENE, K_MARK, MarkColor, m_sIniFile)
|
||||
MachiningScene.SetMarkMaterial(MarkColor)
|
||||
ActiveScene.SetMarkMaterial(MarkColor)
|
||||
' imposto colore per superfici selezionate
|
||||
Dim SelSurfColor As New Color3d(255, 255, 192)
|
||||
GetPrivateProfileColor(S_SCENE, K_SELSURF, SelSurfColor, m_sIniFile)
|
||||
MachiningScene.SetSelSurfMaterial(SelSurfColor)
|
||||
ActiveScene.SetSelSurfMaterial(SelSurfColor)
|
||||
' imposto tipo e colore del rettangolo di zoom
|
||||
Dim bOutline As Boolean = True
|
||||
Dim ZwColor As New Color3d(0, 0, 0)
|
||||
GetPrivateProfileZoomWin(S_SCENE, K_ZOOMWIN, bOutline, ZwColor, m_sIniFile)
|
||||
MachiningScene.SetZoomWinAttribs(bOutline, ZwColor)
|
||||
ActiveScene.SetZoomWinAttribs(bOutline, ZwColor)
|
||||
' imposto colore della linea di distanza
|
||||
Dim DstLnColor As New Color3d(255, 0, 0)
|
||||
GetPrivateProfileColor(S_SCENE, K_DISTLINE, DstLnColor, m_sIniFile)
|
||||
MachiningScene.SetDistLineMaterial(DstLnColor)
|
||||
ActiveScene.SetDistLineMaterial(DstLnColor)
|
||||
' imposto parametri OpenGL
|
||||
Dim nDriver As Integer = GetPrivateProfileInt(S_OPENGL, K_DRIVER, 3, m_sIniFile)
|
||||
Dim b2Buff As Boolean = (GetPrivateProfileInt(S_OPENGL, K_DOUBLEBUFFER, 1, m_sIniFile) <> 0)
|
||||
Dim nColorBits As Integer = GetPrivateProfileInt(S_OPENGL, K_COLORBITS, 32, m_sIniFile)
|
||||
Dim nDepthBits As Integer = GetPrivateProfileInt(S_OPENGL, K_DEPTHBITS, 32, m_sIniFile)
|
||||
MachiningScene.SetViewAttributes(nDriver, b2Buff, nColorBits, nDepthBits)
|
||||
ActiveScene.SetViewAttributes(nDriver, b2Buff, nColorBits, nDepthBits)
|
||||
'Inizializzazione delle viste
|
||||
If Not MachiningScene.Init() Then
|
||||
Close()
|
||||
End If
|
||||
ActiveScene.Init()
|
||||
'Impostazioni modificabili vista 2 (vanno fatte dopo Init)
|
||||
'EgtSetMarkAttribs(New Color3d(128, 255, 255))
|
||||
'EgtSetGeoLineAttribs(New Color3d(0, 255, 0))
|
||||
'EgtSetWinRectAttribs(False, New Color3d(255, 128, 128, 30))
|
||||
' Impostazione dei controller
|
||||
m_Controller1.SetScene(MachiningScene)
|
||||
m_Controller2.SetScene(ActiveScene)
|
||||
'Attiva scena 1
|
||||
'OnMouseDownScene(scene1)
|
||||
'Posizione e dimensioni del Form
|
||||
'If ModifierKeys <> Keys.Shift Then
|
||||
' Dim nFlag As Integer
|
||||
' Dim nLeft As Integer
|
||||
' Dim nTop As Integer
|
||||
' Dim nWidth As Integer
|
||||
' Dim nHeight As Integer
|
||||
' GetPrivateProfileWinPos("General", "WinPlace", nFlag, nLeft, nTop, nWidth, nHeight, m_sIniFile)
|
||||
' Me.StartPosition = System.Windows.Forms.FormStartPosition.Manual
|
||||
' Me.Location = New Point(nLeft, nTop)
|
||||
' Me.Size = New Size(nWidth, nHeight)
|
||||
' WindowState = IIf(nFlag = 1, FormWindowState.Maximized, FormWindowState.Normal)
|
||||
'End If
|
||||
Dim sLuaBaseLib As String = String.Empty
|
||||
GetPrivateProfileString(S_LUA, K_BASELIB, "EgtBase", sLuaBaseLib, m_sIniFile)
|
||||
EgtLuaRequire(sLuaBaseLib)
|
||||
|
||||
'Eventi da UserControl
|
||||
'TagliCadUC
|
||||
AddHandler m_TagliCadUC.ComponentsBtnMW_Click, AddressOf ComponentsBtnMW_Click
|
||||
AddHandler m_TagliCadUC.ZoomAllBtnMW_Click, AddressOf ZoomAllBtnMW_Click
|
||||
' Imposto posizione e dimensioni della MainWindow
|
||||
Dim nFlag As Integer
|
||||
Dim nLeft As Integer
|
||||
Dim nTop As Integer
|
||||
Dim nWidth As Integer
|
||||
Dim nHeight As Integer
|
||||
GetPrivateProfileWinPos(S_GENERAL, K_WINPLACE, nFlag, nLeft, nTop, nWidth, nHeight, m_sIniFile)
|
||||
Me.WindowStartupLocation = Windows.WindowStartupLocation.Manual
|
||||
Me.Top = nTop
|
||||
Me.Left = nLeft
|
||||
Me.Height = nHeight
|
||||
Me.Width = nWidth
|
||||
WindowState = If(nFlag = 1, WindowState.Maximized, WindowState.Normal)
|
||||
|
||||
'Creazione delle Page UserControl
|
||||
m_GrezzoUC = New GrezzoUC
|
||||
m_WorkInProgressPageUC = New WorkInProgressPageUC
|
||||
m_DirectCutPageUC = New DirectCutPageUC
|
||||
m_CadCutPageUC = New CadCutPageUC
|
||||
m_DrawPageUC = New DrawPageUC
|
||||
m_ImportPageUC = New ImportPageUC
|
||||
m_FrameCutPageUC = New FrameCutPageUC
|
||||
m_CurrentProjectPageUC = New CurrentProjectPageUC
|
||||
m_MachinePageUC = New MachinePageUC
|
||||
m_AlarmsPageUC = New AlarmsPageUC
|
||||
m_OptionsPageUC = New OptionsPageUC
|
||||
m_NumericKeyboardWD = New NumericKeyboardWD
|
||||
|
||||
'Posizionemento nella griglia delle Page UserControl
|
||||
m_WorkInProgressPageUC.SetValue(Grid.ColumnProperty, 0)
|
||||
m_WorkInProgressPageUC.SetValue(Grid.RowProperty, 1)
|
||||
m_DrawPageUC.SetValue(Grid.ColumnProperty, 0)
|
||||
m_DrawPageUC.SetValue(Grid.RowProperty, 1)
|
||||
m_ImportPageUC.SetValue(Grid.ColumnProperty, 0)
|
||||
m_ImportPageUC.SetValue(Grid.RowProperty, 1)
|
||||
m_CurrentProjectPageUC.SetValue(Grid.ColumnProperty, 0)
|
||||
m_CurrentProjectPageUC.SetValue(Grid.RowProperty, 1)
|
||||
m_MachinePageUC.SetValue(Grid.ColumnProperty, 0)
|
||||
m_MachinePageUC.SetValue(Grid.RowProperty, 1)
|
||||
m_AlarmsPageUC.SetValue(Grid.ColumnProperty, 0)
|
||||
m_AlarmsPageUC.SetValue(Grid.RowProperty, 1)
|
||||
m_OptionsPageUC.SetValue(Grid.ColumnProperty, 0)
|
||||
m_OptionsPageUC.SetValue(Grid.RowProperty, 1)
|
||||
|
||||
'Disabilita la possibilità di imitare il click del tasto destro del mouse tenendo premuto il dito sul touch
|
||||
'NB: Se abilitato impedisce di utilizzare lo stato Pressed dei Button che quindi non si evidenziano quando premuti
|
||||
Stylus.SetIsPressAndHoldEnabled(Me, False)
|
||||
|
||||
'Imposto i messaggi letti dal file dei messaggi
|
||||
WorkInProgressBtn.Content = EgtMsg(MSG_GENERAL + 1)
|
||||
DirectCutBtn.Content = EgtMsg(MSG_GENERAL + 2)
|
||||
CadCutBtn.Content = EgtMsg(MSG_GENERAL + 3)
|
||||
FrameCutBtn.Content = EgtMsg(MSG_GENERAL + 4)
|
||||
MachineBtn.Content = EgtMsg(MSG_GENERAL + 5)
|
||||
'AlarmsBtn.Content = EgtMsg(MSG_GENERAL + 6)
|
||||
OptionsBtn.Content = EgtMsg(MSG_GENERAL + 7)
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub TabControl_SelectionChanged(sender As Object, e As SelectionChangedEventArgs)
|
||||
If (e.RemovedItems.Count > 0) Then
|
||||
If (e.RemovedItems.Item(0).Equals(TabTagliDiretti)) Then
|
||||
TagliDirettiUC.BackGroundGridTagliDiretti.Children.Remove(TavolaInProgettoHost)
|
||||
End If
|
||||
If (TabTagliCad.IsSelected = False) Then
|
||||
m_TagliCadUC.BackGroundGridLavorazioniPiane.Children.Remove(TavolaInProgettoHost)
|
||||
End If
|
||||
If (TabLavorazioneCornici.IsSelected = False) Then
|
||||
CorniciUC.BackGroundGridLavorazioneCornici.Children.Remove(TavolaInProgettoHost)
|
||||
End If
|
||||
Private Sub Window_Loaded(ByVal sender As Object, ByVal e As RoutedEventArgs)
|
||||
|
||||
End If
|
||||
'Assegno NumericKeyboardWD e AboutBoxWD come child della MainWindow
|
||||
m_NumericKeyboardWD.Owner = Me
|
||||
'm_AboutBoxWD.Owner = Me
|
||||
|
||||
If (TabTagliDiretti.IsSelected) Then
|
||||
TagliDirettiUC.BackGroundGridTagliDiretti.Children.Add(TavolaInProgettoHost)
|
||||
Exit Sub
|
||||
End If
|
||||
If (TabTagliCad.IsSelected) Then
|
||||
TagliCadContent.Content = m_TagliCadUC
|
||||
m_TagliCadUC.BackGroundGridLavorazioniPiane.Children.Add(TavolaInProgettoHost)
|
||||
Exit Sub
|
||||
End If
|
||||
If (TabLavorazioneCornici.IsSelected) Then
|
||||
CorniciUC.BackGroundGridLavorazioneCornici.Children.Add(TavolaInProgettoHost)
|
||||
Exit Sub
|
||||
End If
|
||||
'Seleziono la Tab e la Page di apertura
|
||||
MainWindowGrid.Children.Add(m_WorkInProgressPageUC)
|
||||
m_ActivePage = Pages.WorkInProgress
|
||||
WorkInProgressBtn.IsChecked = True
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub ExitBtnMW_Click(sender As Object, e As RoutedEventArgs)
|
||||
Close()
|
||||
Private Sub WorkInProgressBtn_Click(sender As Object, e As RoutedEventArgs) Handles WorkInProgressBtn.Click
|
||||
Select Case m_ActivePage
|
||||
Case Pages.WorkInProgress
|
||||
WorkInProgressBtn.IsChecked = True
|
||||
Case Pages.DirectCut
|
||||
WorkInProgressBtn.IsChecked = True
|
||||
DirectCutBtn.IsChecked = False
|
||||
m_CurrentProjectPageUC.CurrentProjectPageGrid.Children.Remove(m_DirectCutPageUC)
|
||||
MainWindowGrid.Children.Remove(m_CurrentProjectPageUC)
|
||||
MainWindowGrid.Children.Add(m_WorkInProgressPageUC)
|
||||
m_ActivePage = Pages.WorkInProgress
|
||||
Case Pages.CadCut
|
||||
WorkInProgressBtn.IsChecked = True
|
||||
CadCutBtn.IsChecked = False
|
||||
m_CurrentProjectPageUC.CurrentProjectPageGrid.Children.Remove(m_CadCutPageUC)
|
||||
MainWindowGrid.Children.Remove(m_CurrentProjectPageUC)
|
||||
MainWindowGrid.Children.Add(m_WorkInProgressPageUC)
|
||||
m_ActivePage = Pages.WorkInProgress
|
||||
Case Pages.Draw
|
||||
WorkInProgressBtn.IsChecked = False
|
||||
CadCutBtn.IsChecked = True
|
||||
Case Pages.Import
|
||||
WorkInProgressBtn.IsChecked = False
|
||||
CadCutBtn.IsChecked = True
|
||||
Case Pages.FrameCut
|
||||
WorkInProgressBtn.IsChecked = True
|
||||
FrameCutBtn.IsChecked = False
|
||||
m_CurrentProjectPageUC.CurrentProjectPageGrid.Children.Remove(m_FrameCutPageUC)
|
||||
MainWindowGrid.Children.Remove(m_CurrentProjectPageUC)
|
||||
MainWindowGrid.Children.Add(m_WorkInProgressPageUC)
|
||||
m_ActivePage = Pages.WorkInProgress
|
||||
Case Pages.Machine
|
||||
WorkInProgressBtn.IsChecked = True
|
||||
MachineBtn.IsChecked = False
|
||||
MainWindowGrid.Children.Remove(m_MachinePageUC)
|
||||
MainWindowGrid.Children.Add(m_WorkInProgressPageUC)
|
||||
m_ActivePage = Pages.WorkInProgress
|
||||
Case Pages.Options
|
||||
WorkInProgressBtn.IsChecked = True
|
||||
OptionsBtn.IsChecked = False
|
||||
MainWindowGrid.Children.Remove(m_OptionsPageUC)
|
||||
MainWindowGrid.Children.Add(m_WorkInProgressPageUC)
|
||||
m_ActivePage = Pages.WorkInProgress
|
||||
End Select
|
||||
End Sub
|
||||
|
||||
'-- ** Eventi del TABITEM LAVORAZIONI PIANE ** --
|
||||
|
||||
Private Sub ComponentsBtnMW_Click(sender As Object, e As RoutedEventArgs)
|
||||
TagliCadContent.Content = m_ComponentiUC
|
||||
Private Sub DirectCutBtn_Click(sender As Object, e As RoutedEventArgs) Handles DirectCutBtn.Click
|
||||
Select Case m_ActivePage
|
||||
Case Pages.WorkInProgress
|
||||
WorkInProgressBtn.IsChecked = False
|
||||
DirectCutBtn.IsChecked = True
|
||||
MainWindowGrid.Children.Remove(m_WorkInProgressPageUC)
|
||||
MainWindowGrid.Children.Add(m_CurrentProjectPageUC)
|
||||
m_CurrentProjectPageUC.CurrentProjectPageGrid.Children.Add(m_DirectCutPageUC)
|
||||
m_ActivePage = Pages.DirectCut
|
||||
Case Pages.DirectCut
|
||||
DirectCutBtn.IsChecked = True
|
||||
Case Pages.CadCut
|
||||
DirectCutBtn.IsChecked = True
|
||||
CadCutBtn.IsChecked = False
|
||||
m_CurrentProjectPageUC.CurrentProjectPageGrid.Children.Remove(m_CadCutPageUC)
|
||||
m_CurrentProjectPageUC.CurrentProjectPageGrid.Children.Add(m_DirectCutPageUC)
|
||||
m_ActivePage = Pages.DirectCut
|
||||
Case Pages.Draw
|
||||
DirectCutBtn.IsChecked = False
|
||||
CadCutBtn.IsChecked = True
|
||||
Case Pages.Import
|
||||
DirectCutBtn.IsChecked = False
|
||||
CadCutBtn.IsChecked = True
|
||||
Case Pages.FrameCut
|
||||
DirectCutBtn.IsChecked = True
|
||||
FrameCutBtn.IsChecked = False
|
||||
m_CurrentProjectPageUC.CurrentProjectPageGrid.Children.Remove(m_FrameCutPageUC)
|
||||
m_CurrentProjectPageUC.CurrentProjectPageGrid.Children.Add(m_DirectCutPageUC)
|
||||
m_ActivePage = Pages.DirectCut
|
||||
Case Pages.Machine
|
||||
DirectCutBtn.IsChecked = True
|
||||
MachineBtn.IsChecked = False
|
||||
MainWindowGrid.Children.Remove(m_MachinePageUC)
|
||||
MainWindowGrid.Children.Add(m_CurrentProjectPageUC)
|
||||
m_CurrentProjectPageUC.CurrentProjectPageGrid.Children.Add(m_DirectCutPageUC)
|
||||
m_ActivePage = Pages.DirectCut
|
||||
Case Pages.Options
|
||||
DirectCutBtn.IsChecked = True
|
||||
OptionsBtn.IsChecked = False
|
||||
MainWindowGrid.Children.Remove(m_OptionsPageUC)
|
||||
MainWindowGrid.Children.Add(m_CurrentProjectPageUC)
|
||||
m_CurrentProjectPageUC.CurrentProjectPageGrid.Children.Add(m_DirectCutPageUC)
|
||||
m_ActivePage = Pages.DirectCut
|
||||
End Select
|
||||
End Sub
|
||||
|
||||
Private Sub ZoomAllBtnMW_Click(sender As Object, e As RoutedEventArgs)
|
||||
MachiningScene.ZoomAll()
|
||||
Private Sub CadCutBtn_Click(sender As Object, e As RoutedEventArgs) Handles CadCutBtn.Click
|
||||
Select Case m_ActivePage
|
||||
Case Pages.WorkInProgress
|
||||
WorkInProgressBtn.IsChecked = False
|
||||
CadCutBtn.IsChecked = True
|
||||
MainWindowGrid.Children.Remove(m_WorkInProgressPageUC)
|
||||
MainWindowGrid.Children.Add(m_CurrentProjectPageUC)
|
||||
m_CurrentProjectPageUC.CurrentProjectPageGrid.Children.Add(m_CadCutPageUC)
|
||||
m_ActivePage = Pages.DirectCut
|
||||
m_ActivePage = Pages.CadCut
|
||||
Case Pages.DirectCut
|
||||
DirectCutBtn.IsChecked = False
|
||||
CadCutBtn.IsChecked = True
|
||||
m_CurrentProjectPageUC.CurrentProjectPageGrid.Children.Remove(m_DirectCutPageUC)
|
||||
m_CurrentProjectPageUC.CurrentProjectPageGrid.Children.Add(m_CadCutPageUC)
|
||||
m_ActivePage = Pages.CadCut
|
||||
Case Pages.CadCut
|
||||
CadCutBtn.IsChecked = True
|
||||
Case Pages.Draw
|
||||
CadCutBtn.IsChecked = True
|
||||
Case Pages.Import
|
||||
CadCutBtn.IsChecked = True
|
||||
Case Pages.FrameCut
|
||||
CadCutBtn.IsChecked = True
|
||||
FrameCutBtn.IsChecked = False
|
||||
m_CurrentProjectPageUC.CurrentProjectPageGrid.Children.Remove(m_FrameCutPageUC)
|
||||
m_CurrentProjectPageUC.CurrentProjectPageGrid.Children.Add(m_CadCutPageUC)
|
||||
m_ActivePage = Pages.CadCut
|
||||
Case Pages.Machine
|
||||
CadCutBtn.IsChecked = True
|
||||
MachineBtn.IsChecked = False
|
||||
MainWindowGrid.Children.Remove(m_MachinePageUC)
|
||||
MainWindowGrid.Children.Add(m_CurrentProjectPageUC)
|
||||
m_CurrentProjectPageUC.CurrentProjectPageGrid.Children.Add(m_CadCutPageUC)
|
||||
m_ActivePage = Pages.CadCut
|
||||
Case Pages.Options
|
||||
CadCutBtn.IsChecked = True
|
||||
OptionsBtn.IsChecked = False
|
||||
MainWindowGrid.Children.Remove(m_OptionsPageUC)
|
||||
MainWindowGrid.Children.Add(m_CurrentProjectPageUC)
|
||||
m_CurrentProjectPageUC.CurrentProjectPageGrid.Children.Add(m_CadCutPageUC)
|
||||
m_ActivePage = Pages.CadCut
|
||||
End Select
|
||||
End Sub
|
||||
|
||||
|
||||
Private Sub FrameCutBtn_Click(sender As Object, e As RoutedEventArgs) Handles FrameCutBtn.Click
|
||||
Select Case m_ActivePage
|
||||
Case Pages.WorkInProgress
|
||||
WorkInProgressBtn.IsChecked = False
|
||||
FrameCutBtn.IsChecked = True
|
||||
MainWindowGrid.Children.Remove(m_WorkInProgressPageUC)
|
||||
MainWindowGrid.Children.Add(m_CurrentProjectPageUC)
|
||||
m_CurrentProjectPageUC.CurrentProjectPageGrid.Children.Add(m_FrameCutPageUC)
|
||||
m_ActivePage = Pages.FrameCut
|
||||
Case Pages.DirectCut
|
||||
DirectCutBtn.IsChecked = False
|
||||
FrameCutBtn.IsChecked = True
|
||||
m_CurrentProjectPageUC.CurrentProjectPageGrid.Children.Remove(m_DirectCutPageUC)
|
||||
m_CurrentProjectPageUC.CurrentProjectPageGrid.Children.Add(m_FrameCutPageUC)
|
||||
m_ActivePage = Pages.FrameCut
|
||||
Case Pages.CadCut
|
||||
CadCutBtn.IsChecked = False
|
||||
FrameCutBtn.IsChecked = True
|
||||
m_CurrentProjectPageUC.CurrentProjectPageGrid.Children.Remove(m_CadCutPageUC)
|
||||
m_CurrentProjectPageUC.CurrentProjectPageGrid.Children.Add(m_FrameCutPageUC)
|
||||
m_ActivePage = Pages.FrameCut
|
||||
Case Pages.Draw
|
||||
CadCutBtn.IsChecked = True
|
||||
FrameCutBtn.IsChecked = False
|
||||
Case Pages.Import
|
||||
CadCutBtn.IsChecked = True
|
||||
FrameCutBtn.IsChecked = False
|
||||
Case Pages.FrameCut
|
||||
FrameCutBtn.IsChecked = True
|
||||
Case Pages.Machine
|
||||
FrameCutBtn.IsChecked = True
|
||||
MachineBtn.IsChecked = False
|
||||
MainWindowGrid.Children.Remove(m_MachinePageUC)
|
||||
MainWindowGrid.Children.Add(m_CurrentProjectPageUC)
|
||||
m_CurrentProjectPageUC.CurrentProjectPageGrid.Children.Add(m_FrameCutPageUC)
|
||||
m_ActivePage = Pages.FrameCut
|
||||
Case Pages.Options
|
||||
FrameCutBtn.IsChecked = True
|
||||
OptionsBtn.IsChecked = False
|
||||
MainWindowGrid.Children.Remove(m_OptionsPageUC)
|
||||
MainWindowGrid.Children.Add(m_CurrentProjectPageUC)
|
||||
m_CurrentProjectPageUC.CurrentProjectPageGrid.Children.Add(m_FrameCutPageUC)
|
||||
m_ActivePage = Pages.FrameCut
|
||||
End Select
|
||||
End Sub
|
||||
|
||||
Private Sub MachineBtn_Click(sender As Object, e As RoutedEventArgs) Handles MachineBtn.Click
|
||||
Select Case m_ActivePage
|
||||
Case Pages.WorkInProgress
|
||||
WorkInProgressBtn.IsChecked = False
|
||||
MachineBtn.IsChecked = True
|
||||
MainWindowGrid.Children.Remove(m_WorkInProgressPageUC)
|
||||
MainWindowGrid.Children.Add(m_MachinePageUC)
|
||||
m_ActivePage = Pages.Machine
|
||||
Case Pages.DirectCut
|
||||
DirectCutBtn.IsChecked = False
|
||||
MachineBtn.IsChecked = True
|
||||
m_CurrentProjectPageUC.CurrentProjectPageGrid.Children.Remove(m_DirectCutPageUC)
|
||||
MainWindowGrid.Children.Remove(m_CurrentProjectPageUC)
|
||||
MainWindowGrid.Children.Add(m_MachinePageUC)
|
||||
m_ActivePage = Pages.Machine
|
||||
Case Pages.CadCut
|
||||
CadCutBtn.IsChecked = False
|
||||
MachineBtn.IsChecked = True
|
||||
m_CurrentProjectPageUC.CurrentProjectPageGrid.Children.Remove(m_CadCutPageUC)
|
||||
MainWindowGrid.Children.Remove(m_CurrentProjectPageUC)
|
||||
MainWindowGrid.Children.Add(m_MachinePageUC)
|
||||
m_ActivePage = Pages.Machine
|
||||
Case Pages.Draw
|
||||
CadCutBtn.IsChecked = True
|
||||
MachineBtn.IsChecked = False
|
||||
Case Pages.Import
|
||||
CadCutBtn.IsChecked = True
|
||||
MachineBtn.IsChecked = False
|
||||
Case Pages.FrameCut
|
||||
FrameCutBtn.IsChecked = False
|
||||
MachineBtn.IsChecked = True
|
||||
m_CurrentProjectPageUC.CurrentProjectPageGrid.Children.Remove(m_FrameCutPageUC)
|
||||
MainWindowGrid.Children.Remove(m_CurrentProjectPageUC)
|
||||
MainWindowGrid.Children.Add(m_MachinePageUC)
|
||||
m_ActivePage = Pages.Machine
|
||||
Case Pages.Machine
|
||||
MachineBtn.IsChecked = True
|
||||
Case Pages.Options
|
||||
MachineBtn.IsChecked = True
|
||||
OptionsBtn.IsChecked = False
|
||||
MainWindowGrid.Children.Remove(m_OptionsPageUC)
|
||||
MainWindowGrid.Children.Add(m_MachinePageUC)
|
||||
m_ActivePage = Pages.Machine
|
||||
End Select
|
||||
End Sub
|
||||
|
||||
Private Sub OptionsBtn_Click(sender As Object, e As RoutedEventArgs) Handles OptionsBtn.Click
|
||||
Select Case m_ActivePage
|
||||
Case Pages.WorkInProgress
|
||||
WorkInProgressBtn.IsChecked = False
|
||||
OptionsBtn.IsChecked = True
|
||||
MainWindowGrid.Children.Remove(m_WorkInProgressPageUC)
|
||||
MainWindowGrid.Children.Add(m_OptionsPageUC)
|
||||
m_ActivePage = Pages.Options
|
||||
Case Pages.DirectCut
|
||||
DirectCutBtn.IsChecked = False
|
||||
OptionsBtn.IsChecked = True
|
||||
m_CurrentProjectPageUC.CurrentProjectPageGrid.Children.Remove(m_DirectCutPageUC)
|
||||
MainWindowGrid.Children.Remove(m_CurrentProjectPageUC)
|
||||
MainWindowGrid.Children.Add(m_OptionsPageUC)
|
||||
m_ActivePage = Pages.Options
|
||||
Case Pages.CadCut
|
||||
CadCutBtn.IsChecked = False
|
||||
OptionsBtn.IsChecked = True
|
||||
m_CurrentProjectPageUC.CurrentProjectPageGrid.Children.Remove(m_CadCutPageUC)
|
||||
MainWindowGrid.Children.Remove(m_CurrentProjectPageUC)
|
||||
MainWindowGrid.Children.Add(m_OptionsPageUC)
|
||||
m_ActivePage = Pages.Options
|
||||
Case Pages.Draw
|
||||
CadCutBtn.IsChecked = True
|
||||
OptionsBtn.IsChecked = False
|
||||
Case Pages.Import
|
||||
CadCutBtn.IsChecked = True
|
||||
OptionsBtn.IsChecked = False
|
||||
Case Pages.FrameCut
|
||||
FrameCutBtn.IsChecked = False
|
||||
OptionsBtn.IsChecked = True
|
||||
m_CurrentProjectPageUC.CurrentProjectPageGrid.Children.Remove(m_FrameCutPageUC)
|
||||
MainWindowGrid.Children.Remove(m_CurrentProjectPageUC)
|
||||
MainWindowGrid.Children.Add(m_OptionsPageUC)
|
||||
m_ActivePage = Pages.Options
|
||||
Case Pages.Machine
|
||||
MachineBtn.IsChecked = False
|
||||
OptionsBtn.IsChecked = True
|
||||
MainWindowGrid.Children.Remove(m_MachinePageUC)
|
||||
MainWindowGrid.Children.Add(m_OptionsPageUC)
|
||||
m_ActivePage = Pages.Options
|
||||
Case Pages.Options
|
||||
OptionsBtn.IsChecked = True
|
||||
End Select
|
||||
End Sub
|
||||
|
||||
'Impedisce di clickare fuori dal UC Componenti finchè questo è aperto
|
||||
Private Sub MainWindow_PreviewMouseDown(sender As Object, e As MouseButtonEventArgs)
|
||||
If (m_ComponentiUC.IsVisible And Not m_ComponentiUC.IsMouseOver) Then
|
||||
e.Handled = True
|
||||
End If
|
||||
If (m_GrezzoUC.IsVisible And Not m_GrezzoUC.IsMouseOver) Then
|
||||
e.Handled = True
|
||||
End If
|
||||
'If (m_ComponentiUC.IsVisible And Not m_ComponentiUC.IsMouseOver) Then
|
||||
' e.Handled = True
|
||||
'End If
|
||||
'If (m_GrezzoUC.IsVisible And Not m_GrezzoUC.IsMouseOver) Then
|
||||
' e.Handled = True
|
||||
'End If
|
||||
If (m_NumericKeyboardWD.IsVisible And Not m_NumericKeyboardWD.IsMouseOver) Then
|
||||
e.Handled = True
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub MainWindow_KeyDown(sender As Object, e As KeyEventArgs)
|
||||
If (m_NumericKeyboardWD.IsVisible And e.Key = Key.Enter) Then
|
||||
m_NumericKeyboardWD.Visibility = Windows.Visibility.Hidden
|
||||
End If
|
||||
'If (m_NumericKeyboardWD.IsVisible And e.Key = Key.Enter) Then
|
||||
' m_NumericKeyboardWD.Visibility = Windows.Visibility.Hidden
|
||||
'End If
|
||||
End Sub
|
||||
|
||||
Private Sub ExitBtn_Click(sender As Object, e As RoutedEventArgs)
|
||||
Me.Close()
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
@@ -0,0 +1,44 @@
|
||||
<Window x:Class="MissingKeyWD"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
Title="MissingKeyWD" Height="256" Width="409.2" Initialized="MissingKeyWD_Initialized" WindowStyle="None" ShowInTaskbar="False" ResizeMode="NoResize">
|
||||
|
||||
<!-- Chiamata al Dictionary -->
|
||||
<Window.Resources>
|
||||
<ResourceDictionary Source="OmagCutDictionary.xaml"/>
|
||||
</Window.Resources>
|
||||
|
||||
<!-- Definizione della MissingKeyWindow -->
|
||||
<Border BorderBrush="Black" BorderThickness="1">
|
||||
|
||||
<!-- ** Definizione della Grid della MissingKeyWindow ** -->
|
||||
<Grid Name="MissingKeyGrid">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="0.5*"/>
|
||||
<ColumnDefinition Width="5*"/>
|
||||
<ColumnDefinition Width="0.5*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="0.5*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="0.25*"/>
|
||||
<RowDefinition Height="0.5*"/>
|
||||
<RowDefinition Height="0.5*"/>
|
||||
<RowDefinition Height="0.25*"/>
|
||||
<RowDefinition Height="0.5*"/>
|
||||
<RowDefinition Height="0.5*"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<Label Name="ErrorLbl" Grid.Column="1" Grid.Row="1" HorizontalAlignment="Center" VerticalAlignment="Center"
|
||||
Foreground="Red" FontSize="25" />
|
||||
<Label Name="MissingKeyLbl" Grid.Column="1" Grid.Row="3" HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center" FontSize="15"/>
|
||||
<Label Name="InsertKeyLbl" Grid.Column="1" Grid.Row="4" HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center" FontSize="15" />
|
||||
<Button Name="ExitBtn" Grid.Column="1" Grid.Row="6" FontSize="18"/>
|
||||
|
||||
</Grid>
|
||||
|
||||
</Border>
|
||||
|
||||
</Window>
|
||||
@@ -0,0 +1,18 @@
|
||||
Imports EgtUILib
|
||||
|
||||
Public Class MissingKeyWD
|
||||
|
||||
Private Sub MissingKeyWD_Initialized(sender As Object, e As EventArgs)
|
||||
'Imposto i messaggi letti dal file dei messaggi
|
||||
ErrorLbl.Content = EgtMsg(MSG_MISSINGKEYWD + 1) 'Error! - Errore
|
||||
MissingKeyLbl.Content = EgtMsg(MSG_MISSINGKEYWD + 2) 'Missing key - Chiave non presente
|
||||
InsertKeyLbl.Content = EgtMsg(MSG_MISSINGKEYWD + 3) 'Insert it and reload program - Inserirla e riavviare il programma
|
||||
ExitBtn.Content = EgtMsg(MSG_MISSINGKEYWD + 4) 'Ok
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub ExitBtn_Click(sender As Object, e As RoutedEventArgs) Handles ExitBtn.Click
|
||||
Close()
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
@@ -101,27 +101,48 @@
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</ApplicationDefinition>
|
||||
<Compile Include="BarLavoraUC.xaml.vb">
|
||||
<DependentUpon>BarLavoraUC.xaml</DependentUpon>
|
||||
<Compile Include="AlarmsPageUC.xaml.vb">
|
||||
<DependentUpon>AlarmsPageUC.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="BarNestingUC.xaml.vb">
|
||||
<DependentUpon>BarNestingUC.xaml</DependentUpon>
|
||||
<Compile Include="CadCutPageUC.xaml.vb">
|
||||
<DependentUpon>CadCutPageUC.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="ComponentiUC.xaml.vb">
|
||||
<DependentUpon>ComponentiUC.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="ConstMsg.vb" />
|
||||
<Compile Include="CorniciUC.xaml.vb">
|
||||
<DependentUpon>CorniciUC.xaml</DependentUpon>
|
||||
<Compile Include="CurrentProjectPageUC.xaml.vb">
|
||||
<DependentUpon>CurrentProjectPageUC.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="FlatPartsImportUC.xaml.vb">
|
||||
<DependentUpon>FlatPartsImportUC.xaml</DependentUpon>
|
||||
<Compile Include="DirectCutPageUC.xaml.vb">
|
||||
<DependentUpon>DirectCutPageUC.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="DrawPageUC.xaml.vb">
|
||||
<DependentUpon>DrawPageUC.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="FrameCutPageUC.xaml.vb">
|
||||
<DependentUpon>FrameCutPageUC.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="GrezzoUC.xaml.vb">
|
||||
<DependentUpon>GrezzoUC.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="LavoroInCorsoUC.xaml.vb">
|
||||
<DependentUpon>LavoroInCorsoUC.xaml</DependentUpon>
|
||||
<Compile Include="ImportPageUC.xaml.vb">
|
||||
<DependentUpon>ImportPageUC.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="InternalComponentPageUC.xaml.vb">
|
||||
<DependentUpon>InternalComponentPageUC.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="MachinePageUC.xaml.vb">
|
||||
<DependentUpon>MachinePageUC.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="MachineStatusUC.xaml.vb">
|
||||
<DependentUpon>MachineStatusUC.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="MainComponentPageUC.xaml.vb">
|
||||
<DependentUpon>MainComponentPageUC.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="MissingKeyWD.xaml.vb">
|
||||
<DependentUpon>MissingKeyWD.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="NumericKeyboardWD.xaml.vb">
|
||||
<DependentUpon>NumericKeyboardWD.xaml</DependentUpon>
|
||||
@@ -129,17 +150,26 @@
|
||||
<Compile Include="OmagCUTDictionary.xaml.vb">
|
||||
<DependentUpon>OmagCUTDictionary.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="OptionsPageUC.xaml.vb">
|
||||
<DependentUpon>OptionsPageUC.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="SceneButtonsUC.xaml.vb">
|
||||
<DependentUpon>SceneButtonsUC.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="SecondaryComponentPageUC.xaml.vb">
|
||||
<DependentUpon>SecondaryComponentPageUC.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="TagliCadUC.xaml.vb">
|
||||
<DependentUpon>TagliCadUC.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="TagliDirettiUC.xaml.vb">
|
||||
<DependentUpon>TagliDirettiUC.xaml</DependentUpon>
|
||||
<Compile Include="WorkInProgressPageUC.xaml.vb">
|
||||
<DependentUpon>WorkInProgressPageUC.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Page Include="BarLavoraUC.xaml">
|
||||
<Page Include="AlarmsPageUC.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="BarNestingUC.xaml">
|
||||
<Page Include="CadCutPageUC.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
@@ -147,19 +177,43 @@
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="CorniciUC.xaml">
|
||||
<Page Include="CurrentProjectPageUC.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="FlatPartsImportUC.xaml">
|
||||
<Page Include="DirectCutPageUC.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="DrawPageUC.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="FrameCutPageUC.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="GrezzoUC.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Include="ImportPageUC.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Include="InternalComponentPageUC.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="LavoroInCorsoUC.xaml">
|
||||
<Page Include="MachinePageUC.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="MachineStatusUC.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="MainComponentPageUC.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
@@ -177,6 +231,10 @@
|
||||
<DependentUpon>MainWindow.xaml</DependentUpon>
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Page Include="MissingKeyWD.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Include="NumericKeyboardWD.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
@@ -185,11 +243,23 @@
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="OptionsPageUC.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="SceneButtonsUC.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Include="SecondaryComponentPageUC.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="TagliCadUC.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="TagliDirettiUC.xaml">
|
||||
<Page Include="WorkInProgressPageUC.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
@@ -242,18 +312,27 @@
|
||||
</None>
|
||||
<AppDesigner Include="My Project\" />
|
||||
</ItemGroup>
|
||||
<ItemGroup />
|
||||
<ItemGroup>
|
||||
<Resource Include="Resources\ClockwiseRotate.png" />
|
||||
<Resource Include="Resources\CounterClockwiseRotate.png" />
|
||||
<Resource Include="Resources\ExitIcon.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Resource Include="Resources\GenericView.png" />
|
||||
<Resource Include="Resources\Lama.jpg" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Resource Include="Resources\LogoOmag.jpg" />
|
||||
<Resource Include="Resources\LookFromTOP.png" />
|
||||
<Resource Include="Resources\NumericKeyboardArrow.png" />
|
||||
<Resource Include="Resources\Pan.png" />
|
||||
<Resource Include="Resources\ZigZag.jpg" />
|
||||
<Resource Include="Resources\ZoomAll.png" />
|
||||
<Resource Include="Resources\ZoomIn.png" />
|
||||
<Resource Include="Resources\ZoomOut.png" />
|
||||
<Resource Include="Resources\ZoomWin.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Resource Include="Resources\ZigZag.jpg" />
|
||||
<Resource Include="Resources\V.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Resource Include="Resources\X.png" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />
|
||||
<PropertyGroup>
|
||||
|
||||
@@ -325,4 +325,23 @@
|
||||
<EventSetter Event="PreviewMouseDown" Handler="PreviewMouseDown"/>
|
||||
</Style>
|
||||
|
||||
<!-- *************************************************************************** -->
|
||||
|
||||
<!-- ** LISTBOX ** -->
|
||||
|
||||
<DataTemplate x:Key="DataTemplateItem">
|
||||
<Grid >
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<Image Grid.Column="0" Source="{Binding PictureString}" Height="32" Width="32" Margin="0,8,6,4" />
|
||||
<TextBlock Grid.Column="1" Text="{Binding Name}" FontSize="15" VerticalAlignment="Center" />
|
||||
|
||||
</Grid>
|
||||
</DataTemplate>
|
||||
|
||||
<!-- *************************************************************************** -->
|
||||
|
||||
</ResourceDictionary>
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
<UserControl x:Class="OptionsPageUC"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="300" d:DesignWidth="300">
|
||||
<Grid>
|
||||
|
||||
</Grid>
|
||||
</UserControl>
|
||||
@@ -0,0 +1,3 @@
|
||||
Public Class OptionsPageUC
|
||||
|
||||
End Class
|
||||
|
After Width: | Height: | Size: 3.0 KiB |
|
After Width: | Height: | Size: 3.0 KiB |
|
After Width: | Height: | Size: 1.8 KiB |
|
After Width: | Height: | Size: 898 B |
|
After Width: | Height: | Size: 624 B |
|
After Width: | Height: | Size: 1.8 KiB |
|
After Width: | Height: | Size: 1.5 KiB |
|
After Width: | Height: | Size: 939 B |
|
After Width: | Height: | Size: 2.8 KiB |
|
After Width: | Height: | Size: 2.2 KiB |
|
After Width: | Height: | Size: 2.1 KiB |
|
After Width: | Height: | Size: 2.2 KiB |
@@ -0,0 +1,57 @@
|
||||
<UserControl x:Class="SceneButtonsUC"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="64" d:DesignWidth="455">
|
||||
|
||||
<!-- Chiamata al Dictionary -->
|
||||
<UserControl.Resources>
|
||||
<ResourceDictionary Source="OmagCutDictionary.xaml"/>
|
||||
</UserControl.Resources>
|
||||
|
||||
<!-- Definizione del controllo SceneButton -->
|
||||
<Grid Name="SceneButtonsGrid">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<Button Name="ZoomAllBtn" Grid.Column="0" >
|
||||
<Image Source="Resources/ZoomAll.png" Width="65" Height="65" HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center" />
|
||||
</Button>
|
||||
<Button Name="ZoomInBtn" Grid.Column="1" >
|
||||
<Image Source="Resources/ZoomIn.png" Width="65" Height="65" HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center" />
|
||||
</Button>
|
||||
<Button Name="ZoomOutBtn" Grid.Column="2" >
|
||||
<Image Source="Resources/ZoomOut.png" Width="65" Height="65" HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center" />
|
||||
</Button>
|
||||
<Button Name="ZoomWinBtn" Grid.Column="3" >
|
||||
<Image Source="Resources/ZoomWin.png" Width="65" Height="65" HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center" />
|
||||
</Button>
|
||||
<Button Name="PanBtn" Grid.Column="4" >
|
||||
<Image Source="Resources/Pan.png" Width="65" Height="65" HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center" />
|
||||
</Button>
|
||||
<Button Name="GenericViewBtn" Grid.Column="5">
|
||||
<Image Source="Resources/GenericView.png" Width="65" Height="65" HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center" />
|
||||
</Button>
|
||||
<Button Name="TopViewBtn" Grid.Column="6">
|
||||
<Image Source="Resources/LookFromTOP.png" Width="65" Height="65" HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center" />
|
||||
</Button>
|
||||
|
||||
</Grid>
|
||||
|
||||
</UserControl>
|
||||
@@ -0,0 +1,51 @@
|
||||
Imports EgtUILib
|
||||
|
||||
Public Class SceneButtonsUC
|
||||
|
||||
'Riferimento alla MainWindow
|
||||
Dim m_MainWindow As MainWindow = Application.Current.MainWindow
|
||||
|
||||
Private Sub ZoomAllBtn_Click(sender As Object, e As RoutedEventArgs) Handles ZoomAllBtn.Click
|
||||
EgtZoom(ZM.ALL)
|
||||
End Sub
|
||||
|
||||
Private Sub ZoomInBtn_Click(sender As Object, e As RoutedEventArgs) Handles ZoomInBtn.Click
|
||||
EgtZoom(ZM.IN_)
|
||||
End Sub
|
||||
|
||||
Private Sub ZoomOutBtn_Click(sender As Object, e As RoutedEventArgs) Handles ZoomOutBtn.Click
|
||||
EgtZoom(ZM.OUT)
|
||||
End Sub
|
||||
|
||||
Private Sub ZoomWinBtn_Click(sender As Object, e As RoutedEventArgs) Handles ZoomWinBtn.Click
|
||||
GetCurrScene.SetStatusZoomWin()
|
||||
End Sub
|
||||
|
||||
Private Sub PanBtn_Click(sender As Object, e As RoutedEventArgs) Handles PanBtn.Click
|
||||
GetCurrScene.SetStatusPan()
|
||||
End Sub
|
||||
|
||||
Private Sub GenericViewBtn_Click(sender As Object, e As RoutedEventArgs) Handles GenericViewBtn.Click
|
||||
GetCurrScene.SetStatusRot()
|
||||
End Sub
|
||||
|
||||
Private Sub TopViewBtn_Click(sender As Object, e As RoutedEventArgs) Handles TopViewBtn.Click
|
||||
EgtSetView(VT.TOP)
|
||||
End Sub
|
||||
|
||||
Private Function GetCurrScene() As EgtUILib.Scene
|
||||
Select Case m_MainWindow.m_ActivePage
|
||||
Case MainWindow.Pages.DirectCut
|
||||
Return m_MainWindow.m_CurrentProjectPageUC.CurrentProjectScene
|
||||
Case MainWindow.Pages.CadCut
|
||||
Return m_MainWindow.m_CurrentProjectPageUC.CurrentProjectScene
|
||||
Case MainWindow.Pages.FrameCut
|
||||
Return m_MainWindow.m_CurrentProjectPageUC.CurrentProjectScene
|
||||
Case MainWindow.Pages.Import
|
||||
Return m_MainWindow.m_ImportPageUC.ImportScene
|
||||
Case Else
|
||||
Return m_MainWindow.m_CurrentProjectPageUC.CurrentProjectScene
|
||||
End Select
|
||||
End Function
|
||||
|
||||
End Class
|
||||
@@ -0,0 +1,43 @@
|
||||
<UserControl x:Class="SecondaryComponentPageUC"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="768" d:DesignWidth="256" Loaded="SecondaryComponentPage_Loaded">
|
||||
|
||||
<!-- Chiamata al Dictionary -->
|
||||
<UserControl.Resources>
|
||||
<ResourceDictionary Source="OmagCutDictionary.xaml"/>
|
||||
</UserControl.Resources>
|
||||
|
||||
<!-- Definizione della SecondaryComponentPage -->
|
||||
<Grid Name="SecondaryComponentPageGrid" Background="LightGray">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<!-- Attenzione! Questi Button devono avere lo stesso nome dei componenti nel file Ini -->
|
||||
<Button Name="Compo1" Grid.Row="0" FontSize="22"/>
|
||||
<Button Name="Compo2" Grid.Row="1" FontSize="22"/>
|
||||
<Button Name="Compo3" Grid.Row="2" FontSize="22"/>
|
||||
<Button Name="Compo4" Grid.Row="3" FontSize="22"/>
|
||||
<Button Name="Compo5" Grid.Row="4" FontSize="22"/>
|
||||
<Button Name="Compo6" Grid.Row="5" FontSize="22"/>
|
||||
<Button Name="Compo7" Grid.Row="6" FontSize="22"/>
|
||||
<Button Name="Compo8" Grid.Row="7" FontSize="22"/>
|
||||
<Button Name="Compo9" Grid.Row="8" FontSize="22"/>
|
||||
|
||||
<Button Name="Indietro" Grid.Row="9" FontSize="22"/>
|
||||
|
||||
</Grid>
|
||||
</UserControl>
|
||||
@@ -0,0 +1,66 @@
|
||||
Imports EgtUILib
|
||||
|
||||
Public Class SecondaryComponentPageUC
|
||||
|
||||
'Riferimento alla MainWindow
|
||||
Private m_MainWindow As MainWindow = Application.Current.MainWindow
|
||||
|
||||
'Riferimento alla MainComponentPage
|
||||
Dim m_MainComponentPage As MainComponentPageUC
|
||||
|
||||
Private Sub SecondaryComponentPage_Loaded(sender As Object, e As RoutedEventArgs)
|
||||
|
||||
m_MainComponentPage = m_MainWindow.m_DrawPageUC.m_ComponentPage
|
||||
|
||||
'Riferimento al Button della MainComponentPage che ha aperto la SecondaryComponentPage
|
||||
Dim CurrentMainBtn As Button = m_MainComponentPage.CurrentBtn
|
||||
|
||||
Dim nCount As Integer = GetPrivateProfileInt(CurrentMainBtn.Name, "Count", 0, m_MainWindow.GetIniFile())
|
||||
ClearButton(nCount)
|
||||
For index As Integer = 1 To nCount
|
||||
Dim nCompoName As Integer = GetPrivateProfileInt(CurrentMainBtn.Name, "Compo" & index, 0, m_MainWindow.GetIniFile())
|
||||
GetButton(index).Content = EgtMsg(MSG_COMPONENTPAGE + nCompoName)
|
||||
Next
|
||||
End Sub
|
||||
|
||||
Private Function GetButton(ByVal nInd As Integer) As Button
|
||||
Select Case nInd
|
||||
Case 1
|
||||
Return Compo1
|
||||
Case 2
|
||||
Return Compo2
|
||||
Case 3
|
||||
Return Compo3
|
||||
Case 4
|
||||
Return Compo4
|
||||
Case 5
|
||||
Return Compo5
|
||||
Case 6
|
||||
Return Compo6
|
||||
Case 7
|
||||
Return Compo7
|
||||
Case 8
|
||||
Return Compo8
|
||||
Case Else
|
||||
Return Compo9
|
||||
End Select
|
||||
End Function
|
||||
|
||||
Private Sub ClearButton(nCount As Integer)
|
||||
For index As Integer = 1 To nCount + 1
|
||||
GetButton(index).Content = String.Empty
|
||||
GetButton(index).Visibility = Windows.Visibility.Visible
|
||||
Next
|
||||
For index As Integer = nCount + 1 To 9
|
||||
GetButton(index).Content = String.Empty
|
||||
GetButton(index).Visibility = Windows.Visibility.Hidden
|
||||
Next
|
||||
End Sub
|
||||
|
||||
Private Sub Indietro_Click(sender As Object, e As RoutedEventArgs) Handles Indietro.Click
|
||||
m_MainWindow.m_DrawPageUC.DrawPageGrid.Children.Remove(Me)
|
||||
m_MainWindow.m_DrawPageUC.DrawPageGrid.Children.Add(m_MainComponentPage)
|
||||
m_MainComponentPage.CurrentBtn = Nothing
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
@@ -57,7 +57,15 @@
|
||||
<TextBlock Style="{StaticResource ButtonTextBlock}" Text="Grezzo" />
|
||||
</StackPanel>
|
||||
</Button>
|
||||
|
||||
|
||||
<!-- Definizione del Button Import -->
|
||||
<Button Click="ImportBtnUC_Click" >
|
||||
<StackPanel Orientation="Vertical">
|
||||
<Image Style="{StaticResource ButtonImage}" Source="c:\Users\Emmanuele\Documents\Visual Studio 2013\Projects\ProvaTab2\ProvaTab2\Images\Import.png"/>
|
||||
<TextBlock Style="{StaticResource ButtonTextBlock}" Text="Import" />
|
||||
</StackPanel>
|
||||
</Button>
|
||||
|
||||
</UniformGrid>
|
||||
|
||||
<!-- Riferimento al User Control della barra dei tasti a destra -->
|
||||
|
||||
@@ -1,41 +1,42 @@
|
||||
Public Class TagliCadUC
|
||||
|
||||
Dim MainWindowUC As MainWindow = Application.Current.MainWindow
|
||||
Dim m_BarLavoraUC As BarLavoraUC
|
||||
Dim m_BarNestingUC As BarNestingUC
|
||||
|
||||
Public Event ComponentsBtnMW_Click As RoutedEventHandler
|
||||
Public Event ZoomAllBtnMW_Click As RoutedEventHandler
|
||||
'Dim m_BarLavoraUC As BarLavoraUC
|
||||
'Dim m_BarNestingUC As BarNestingUC
|
||||
|
||||
Private Sub TagliCadUC_Initialized(sender As Object, e As EventArgs)
|
||||
m_BarLavoraUC = New BarLavoraUC
|
||||
m_BarNestingUC = New BarNestingUC
|
||||
'm_BarLavoraUC = New BarLavoraUC
|
||||
'm_BarNestingUC = New BarNestingUC
|
||||
End Sub
|
||||
|
||||
Private Sub TagliCadUC_Loaded(sender As Object, e As RoutedEventArgs)
|
||||
RightBtnBarContent.Content = m_BarNestingUC
|
||||
'RightBtnBarContent.Content = m_BarNestingUC
|
||||
End Sub
|
||||
|
||||
Private Sub ComponentsBtnUC_Click(sender As Object, e As RoutedEventArgs)
|
||||
RaiseEvent ComponentsBtnMW_Click(sender, e)
|
||||
'MainWindowUC.TagliCadContent.Content = MainWindowUC.m_ComponentiUC
|
||||
End Sub
|
||||
|
||||
Private Sub ZoomAllBtnUC_Click(sender As Object, e As RoutedEventArgs)
|
||||
RaiseEvent ZoomAllBtnMW_Click(sender, e)
|
||||
'MainWindowUC.MachiningScene.ZoomAll()
|
||||
End Sub
|
||||
|
||||
Private Sub LavoraBtnUC_Click(sender As Object, e As RoutedEventArgs)
|
||||
If (RightBtnBarContent.Content = m_BarNestingUC) Then
|
||||
RightBtnBarContent.Content = m_BarLavoraUC
|
||||
Else
|
||||
RightBtnBarContent.Content = m_BarLavoraUC
|
||||
End If
|
||||
'If (RightBtnBarContent.Content = m_BarNestingUC) Then
|
||||
' RightBtnBarContent.Content = m_BarLavoraUC
|
||||
'Else
|
||||
' RightBtnBarContent.Content = m_BarLavoraUC
|
||||
'End If
|
||||
End Sub
|
||||
|
||||
Private Sub GrezzoBtnUC_Click(sender As Object, e As RoutedEventArgs)
|
||||
MainWindowUC.m_GrezzoUC.SetValue(Grid.RowProperty, 1)
|
||||
MainWindowUC.m_GrezzoUC.SetValue(Grid.RowSpanProperty, 2)
|
||||
MainWindowUC.MainGrid.Children.Add(MainWindowUC.m_GrezzoUC)
|
||||
'MainWindowUC.m_GrezzoUC.SetValue(Grid.RowProperty, 1)
|
||||
'MainWindowUC.m_GrezzoUC.SetValue(Grid.RowSpanProperty, 2)
|
||||
'MainWindowUC.MainGrid.Children.Add(MainWindowUC.m_GrezzoUC)
|
||||
End Sub
|
||||
|
||||
Private Sub ImportBtnUC_Click(sender As Object, e As RoutedEventArgs)
|
||||
'MainWindowUC.TagliCadContent.Content = MainWindowUC.m_FlatPartsImportUC
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
|
||||
@@ -1,26 +0,0 @@
|
||||
<UserControl x:Class="TagliDirettiUC"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="300" d:DesignWidth="300">
|
||||
|
||||
<!-- Chiamata al dizionario -->
|
||||
<UserControl.Resources>
|
||||
<ResourceDictionary Source="OmagCUTDictionary.xaml"/>
|
||||
</UserControl.Resources>
|
||||
|
||||
<!-- Definizione della PAGINA TAGLI DIRETTI -->
|
||||
<Grid Name="BackGroundGridTagliDiretti">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="{StaticResource TabPageColumn0Width}"/>
|
||||
<ColumnDefinition Width="{StaticResource TabPageColumn1Width}"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="{StaticResource TabPageRow0Width}"/>
|
||||
<RowDefinition Height="{StaticResource TabPageRow1Width}"/>
|
||||
<RowDefinition Height="{StaticResource TabPageRow2Width}"/>
|
||||
</Grid.RowDefinitions>
|
||||
</Grid>
|
||||
</UserControl>
|
||||
@@ -1,3 +0,0 @@
|
||||
Public Class TagliDirettiUC
|
||||
|
||||
End Class
|
||||
@@ -0,0 +1,32 @@
|
||||
<UserControl x:Class="WorkInProgressPageUC"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="853.3" d:DesignWidth="1024"
|
||||
Initialized="WorkInProgressPage_Initialized" Loaded="WorkInProgressPage_Loaded">
|
||||
|
||||
<!-- Chiamata al Dictionary -->
|
||||
<UserControl.Resources>
|
||||
<ResourceDictionary Source="OmagCutDictionary.xaml"/>
|
||||
</UserControl.Resources>
|
||||
|
||||
<!-- Definizione della WorkInProgressPage -->
|
||||
<Border Style="{StaticResource CustomBorder}" >
|
||||
|
||||
<Grid Name="WorkInProgressPageGrid">
|
||||
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="8*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
|
||||
|
||||
</Grid>
|
||||
|
||||
</Border>
|
||||
|
||||
</UserControl>
|
||||
@@ -0,0 +1,86 @@
|
||||
Imports EgtUILib
|
||||
|
||||
Public Class WorkInProgressPageUC
|
||||
|
||||
' Riferimento alla MainWindow
|
||||
Private m_MainWindow As MainWindow = Application.Current.MainWindow
|
||||
|
||||
' Properties
|
||||
Private m_bFirst As Boolean = True
|
||||
|
||||
' Dichiarazione Scene
|
||||
Friend WithEvents WorkInProgressScene As New Scene
|
||||
Private WorkInProgressSceneHost As New System.Windows.Forms.Integration.WindowsFormsHost
|
||||
|
||||
Private Sub WorkInProgressPage_Initialized(sender As Object, e As EventArgs)
|
||||
|
||||
'Assegnazione scena all'host e posizionamento nella PlacePageGrid
|
||||
WorkInProgressSceneHost.Child = WorkInProgressScene
|
||||
WorkInProgressSceneHost.SetValue(Grid.ColumnProperty, 0)
|
||||
WorkInProgressSceneHost.SetValue(Grid.RowProperty, 1)
|
||||
Me.WorkInProgressPageGrid.Children.Add(WorkInProgressSceneHost)
|
||||
|
||||
'Imposto i messaggi letti dal file dei messaggi
|
||||
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub WorkInProgressPage_Loaded(sender As Object, e As RoutedEventArgs)
|
||||
|
||||
If m_bFirst Then
|
||||
' imposto colore di default
|
||||
Dim DefColor As New Color3d(0, 0, 0)
|
||||
GetPrivateProfileColor(S_GEOMDB, K_DEFAULTCOLOR, DefColor, m_MainWindow.GetIniFile())
|
||||
WorkInProgressScene.SetDefaultMaterial(DefColor)
|
||||
' imposto colori sfondo
|
||||
Dim BackTopColor As New Color3d(192, 192, 192)
|
||||
GetPrivateProfileColor(S_SCENE, K_BACKTOP, BackTopColor, m_MainWindow.GetIniFile())
|
||||
Dim BackBotColor As New Color3d(BackTopColor)
|
||||
GetPrivateProfileColor(S_SCENE, K_BACKBOTTOM, BackBotColor, m_MainWindow.GetIniFile())
|
||||
WorkInProgressScene.SetViewBackground(BackTopColor, BackBotColor)
|
||||
' imposto colore di evidenziazione
|
||||
Dim MarkColor As New Color3d(255, 255, 0)
|
||||
GetPrivateProfileColor(S_SCENE, K_MARK, MarkColor, m_MainWindow.GetIniFile())
|
||||
WorkInProgressScene.SetMarkMaterial(MarkColor)
|
||||
' imposto colore per superfici selezionate
|
||||
Dim SelSurfColor As New Color3d(255, 255, 192)
|
||||
GetPrivateProfileColor(S_SCENE, K_SELSURF, SelSurfColor, m_MainWindow.GetIniFile())
|
||||
WorkInProgressScene.SetSelSurfMaterial(SelSurfColor)
|
||||
' imposto tipo e colore del rettangolo di zoom
|
||||
Dim bOutline As Boolean = True
|
||||
Dim ZwColor As New Color3d(0, 0, 0)
|
||||
GetPrivateProfileZoomWin(S_SCENE, K_ZOOMWIN, bOutline, ZwColor, m_MainWindow.GetIniFile())
|
||||
WorkInProgressScene.SetZoomWinAttribs(bOutline, ZwColor)
|
||||
' imposto colore della linea di distanza
|
||||
Dim DstLnColor As New Color3d(255, 0, 0)
|
||||
GetPrivateProfileColor(S_SCENE, K_DISTLINE, DstLnColor, m_MainWindow.GetIniFile())
|
||||
WorkInProgressScene.SetDistLineMaterial(DstLnColor)
|
||||
' imposto parametri OpenGL
|
||||
Dim nDriver As Integer = GetPrivateProfileInt(S_OPENGL, K_DRIVER, 3, m_MainWindow.GetIniFile())
|
||||
Dim b2Buff As Boolean = (GetPrivateProfileInt(S_OPENGL, K_DOUBLEBUFFER, 1, m_MainWindow.GetIniFile()) <> 0)
|
||||
Dim nColorBits As Integer = GetPrivateProfileInt(S_OPENGL, K_COLORBITS, 32, m_MainWindow.GetIniFile())
|
||||
Dim nDepthBits As Integer = GetPrivateProfileInt(S_OPENGL, K_DEPTHBITS, 32, m_MainWindow.GetIniFile())
|
||||
WorkInProgressScene.SetViewAttributes(nDriver, b2Buff, nColorBits, nDepthBits)
|
||||
' inizializzo la scena (DB geometrico + visualizzazione) e verifico presenza chiave
|
||||
If Not WorkInProgressScene.Init() Then
|
||||
Dim m_MissingKeyWindow As New MissingKeyWD
|
||||
m_MissingKeyWindow.Top = m_MainWindow.Top + (m_MainWindow.Height / 2 - m_MissingKeyWindow.Height / 2)
|
||||
m_MissingKeyWindow.Left = m_MainWindow.Left + (m_MainWindow.Width / 2 - m_MissingKeyWindow.Width / 2)
|
||||
m_MainWindow.Close()
|
||||
m_MissingKeyWindow.Show()
|
||||
End If
|
||||
' carico la macchina
|
||||
'If Not LoadMachine() Then
|
||||
' EgtOutLog("Error loading machine")
|
||||
'End If
|
||||
' carico la griglia
|
||||
'LoadGridData()
|
||||
m_bFirst = False
|
||||
Else
|
||||
EgtSetCurrentContext(WorkInProgressScene.GetCtx())
|
||||
End If
|
||||
' inibisco selezione diretta da Scene
|
||||
WorkInProgressScene.SetStatusNull()
|
||||
End Sub
|
||||
|
||||
End Class
|
||||