OmagCUT :

- aggiungo file mancanti.
This commit is contained in:
Emmanuele Sassi
2015-08-23 09:50:47 +00:00
parent ed7e8c4226
commit c529c9dd59
42 changed files with 3183 additions and 0 deletions
+7
View File
@@ -0,0 +1,7 @@
<Application x:Class="Application"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" >
<Application.Resources>
</Application.Resources>
</Application>
+47
View File
@@ -0,0 +1,47 @@
Imports System.Windows.Forms
Class Application
' Application-level events, such as Startup, Exit, and DispatcherUnhandledException
' can be handled in this file.
Protected Overrides Sub OnStartup(e As StartupEventArgs)
MyBase.OnStartup(e)
Dim mainWindow As New MainWindow
Dim thisDpiWidthFactor As Double
Dim thisDpiHeightFactor As Double
mainWindow.Show()
'Controllo che abbia creato la finestra per evitare crash se non c'è la chiave
If (IsNothing(Application.Current.MainWindow)) Then
Exit Sub
End If
CalculateDpiFactors(mainWindow, thisDpiWidthFactor, thisDpiHeightFactor)
If (Screen.AllScreens.Length > 1) Then
Dim s2 As Screen = Screen.AllScreens(1)
Dim r2 As System.Drawing.Rectangle = s2.WorkingArea
mainWindow.Top = r2.Top / thisDpiHeightFactor
mainWindow.Left = r2.Left / thisDpiWidthFactor
Else
Dim s1 As Screen = Screen.AllScreens(0)
Dim r1 As System.Drawing.Rectangle = s1.WorkingArea
mainWindow.Top = r1.Top
mainWindow.Left = r1.Left
End If
End Sub
Private Shared Sub CalculateDpiFactors(ByRef mainwindow As Window, ByRef thisDpiWidthFactor As Double, ByRef thisDpiHeightFactor As Double)
Dim MainWindowPresentationSource As PresentationSource = PresentationSource.FromVisual(Application.Current.MainWindow)
Dim m As New Matrix
m = PresentationSource.FromVisual(Application.Current.MainWindow).CompositionTarget.TransformToDevice
thisDpiWidthFactor = m.M11
thisDpiHeightFactor = m.M22
End Sub
End Class
+14
View File
@@ -0,0 +1,14 @@
<UserControl x:Class="BarLavoraUC"
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>
</UserControl>
+3
View File
@@ -0,0 +1,3 @@
Public Class BarLavoraUC
End Class
+14
View File
@@ -0,0 +1,14 @@
<UserControl x:Class="BarNestingUC"
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>
</UserControl>
+3
View File
@@ -0,0 +1,3 @@
Public Class BarNestingUC
End Class
+130
View File
@@ -0,0 +1,130 @@
<UserControl x:Class="ComponentiUC"
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="ComponentiUC_Loaded" Unloaded="ComponentiUC_Unloaded" Initialized="ComponentiUC_Initialized">
<!-- Chiamata al dizionario -->
<UserControl.Resources>
<ResourceDictionary Source="OmagCUTDictionary.xaml"/>
</UserControl.Resources>
<!-- Definizione della PAGINA Componenti -->
<Grid Name="BackGroundGridComponenti">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="3*"/>
<ColumnDefinition Width="9*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="1*"/>
<RowDefinition Height="5*"/>
<RowDefinition Height="5*"/>
</Grid.RowDefinitions>
<!-- Definizione della Grid per gli Expander sulla Column 0 -->
<Grid Grid.Column="0" Grid.Row="0" Grid.RowSpan="3">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Button Content="Triangolo" Grid.Row="0"
Height="40" FontSize="25" Click="TriangleBtnUC_Click" />
<Button Content="Rettangolo" Grid.Row="1"
Height="40" FontSize="25" />
<Expander Header="Trapezio"
Grid.Row="2"
FontSize="25"
VerticalAlignment="Top"
BorderBrush="Gray"
Background="LightGray"
BorderThickness="2" >
<Border BorderThickness="0" BorderBrush="Gray" Background="Gray">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="1*"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
<Button Content="Rettangolo" Grid.Row="0" Click="RectangleTrapeziumBtnUC_Click"/>
<Button Content="Isoscele" Grid.Row="1" />
<Button Content="Scaleno" Grid.Row="2" />
</Grid>
</Border>
</Expander>
<Button Content="Quadrilatero" Grid.Row="3"
Height="40" FontSize="25" />
<Button Content="Piedoca" Grid.Row="4"
Height="40" FontSize="25"/>
<Button Content="Soglia" Grid.Row="5"
Height="40" FontSize="25"/>
<Button Content="Piano Cucina" Grid.Row="6"
Height="40" FontSize="25"/>
<Button Content="Piano Bagno" Grid.Row="7"
Height="40" FontSize="25"/>
</Grid>
<!-- Definizione della Grid per i TextBox Nella cella 2,1 -->
<Grid Grid.Column="1"
Grid.Row="2">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="3*"/>
<ColumnDefinition Width="3*"/>
<ColumnDefinition Width="3*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<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*"/>
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
<TextBox Grid.Row="0" Grid.Column="0" Name="tbName1"/>
<TextBox Grid.Row="1" Grid.Column="0" Name="tbName2"/>
<TextBox Grid.Row="2" Grid.Column="0" Name="tbName3"/>
<TextBox Grid.Row="3" Grid.Column="0" Name="tbName4"/>
<TextBox Grid.Row="4" Grid.Column="0" Name="tbName5"/>
<TextBox Grid.Row="5" Grid.Column="0" Name="tbName6"/>
<TextBox Grid.Row="6" Grid.Column="0" Name="tbName7"/>
<TextBox Grid.Row="7" Grid.Column="0" Name="tbName8"/>
<TextBox Grid.Row="8" Grid.Column="0" Name="tbName9"/>
<TextBox Grid.Row="9" Grid.Column="0" Name="tbName10"/>
<TextBox Grid.Row="0" Grid.Column="1" Name="tbValue1"/>
<TextBox Grid.Row="1" Grid.Column="1" Name="tbValue2"/>
<TextBox Grid.Row="2" Grid.Column="1" Name="tbValue3"/>
<TextBox Grid.Row="3" Grid.Column="1" Name="tbValue4"/>
<TextBox Grid.Row="4" Grid.Column="1" Name="tbValue5"/>
<TextBox Grid.Row="5" Grid.Column="1" Name="tbValue6"/>
<TextBox Grid.Row="6" Grid.Column="1" Name="tbValue7"/>
<TextBox Grid.Row="7" Grid.Column="1" Name="tbValue8"/>
<TextBox Grid.Row="8" Grid.Column="1" Name="tbValue9"/>
<TextBox Grid.Row="9" Grid.Column="1" Name="tbValue10"/>
<TextBox Grid.Row="10" Grid.Column="0" Name="tbMsg" Grid.ColumnSpan="2"/>
<Button Grid.Row="3" Grid.Column="3" Grid.RowSpan="2" Grid.ColumnSpan="3" Name="btnView"
Content="View" FontSize="25" Click="ViewBtnUC_Click" />
<Button Grid.Row="5" Grid.Column="3" Grid.RowSpan="2" Grid.ColumnSpan="3" Name="btnInsert"
Content="Insert" FontSize="25" Click="InsertBtnUC_Click" />
<Button Grid.Row="9" Grid.Column="5" Grid.RowSpan="2" Name="btnX" Click="CloseBtnUC_Click" >
<Image Style="{StaticResource ButtonImage}" Source="Resources/ExitIcon.png"/>
</Button>
<TextBox Grid.Row="7" Grid.Column="3" Grid.ColumnSpan="3" Name="tbNbr"/>
</Grid>
</Grid>
</UserControl>
+428
View File
@@ -0,0 +1,428 @@
Imports EgtUILib
Imports System.Globalization
Public Class ComponentiUC
Dim MainWindowUC As MainWindow = Application.Current.MainWindow
Private WithEvents m_Controller3 As New Controller
'Per creazione Scene
Friend Shared WithEvents ScenaComponenti As New Scene
Dim ScenaComponentiHost As New System.Windows.Forms.Integration.WindowsFormsHost
'Per Scena Componenti
' Constants
Private Const NUM_VAR As Integer = 10
Private Const LUA_CMP_VARS As String = "CMP"
Private Const LUA_CMP_DRAW As String = "CMP_Draw"
' 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
Private Sub ComponentiUC_Initialized(sender As Object, e As EventArgs)
ScenaComponentiHost.Child = ScenaComponenti
ScenaComponentiHost.SetValue(Grid.ColumnProperty, 1)
ScenaComponentiHost.SetValue(Grid.RowProperty, 0)
ScenaComponentiHost.SetValue(Grid.RowSpanProperty, 2)
Me.BackGroundGridComponenti.Children.Add(ScenaComponentiHost)
End Sub
Private Sub ComponentiUC_Loaded(sender As Object, e As RoutedEventArgs)
If (Not m_bFirst) Then
EgtSetCurrentContext(ScenaComponenti.GetCtx())
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
End Sub
Private Sub TriangleBtnUC_Click(sender As Object, e As RoutedEventArgs)
' Carico componente
LoadCurrentCompo("Triangolo3L")
End Sub
Private Sub RectangleTrapeziumBtnUC_Click(sender As Object, e As RoutedEventArgs)
End Sub
Private Sub LoadCurrentCompo(ByVal sCompo As String)
' verifico se cambiato
'If sCompo = m_sCompoName Then
' Return
'End If
m_sCompoName = sCompo
'Pulisco l'ambiente lua
ResetLuaVariables()
' Carico il file ed eseguo in modalità anteprima
Dim bOk As Boolean = ExecCompoFile()
Dim sMsg As String = String.Empty
bOk = bOk AndAlso MakePreview(sMsg)
If Not bOk Then
EgtNewFile()
End If
tbMsg.Text = sMsg
tbMsg.Background = If(m_bDrawOk, Brushes.White, Brushes.Tomato)
ScenaComponenti.ZoomAll()
' leggo variabili e aggiorno griglia
ReadAndShowVariables()
' abilito bottoni Vista e Inserisci
btnView.IsEnabled = True
btnInsert.IsEnabled = True
' un pezzo da inserire
tbNbr.Text = "1"
End Sub
Private Sub ViewBtnUC_Click(sender As Object, e As RoutedEventArgs)
ViewRefresh()
End Sub
Private Sub ViewRefresh()
' aggiorno le variabili dalla griglia
UpdateVariables()
' ricalcolo il disegno
Dim sMsg As String = String.Empty
MakePreview(sMsg)
tbMsg.Text = sMsg
tbMsg.Background = If(m_bDrawOk, Brushes.White, Brushes.Tomato)
' aggiorno visualizzazione
EgtSetView(VT.TOP, False)
EgtZoom(ZM.ALL)
End Sub
Private Sub InsertBtnUC_Click(sender As Object, e As RoutedEventArgs)
' aggiorno visualizzazione
ViewRefresh()
' se errore esco
If Not m_bDrawOk Then
Return
End If
' Leggo numero di pezzi da inserire
Dim InsNbr As Integer = tbNbr.Text
'Pulisco la scena dl componente
EgtNewFile()
' Passo al contesto principale
EgtSetCurrentContext(MainWindowUC.ActiveScene.GetCtx())
' Inserisco il componente nel DB geometrico principale
MakeInsert(InsNbr)
' Aggiorno ambiente principale
EgtZoom(ZM.ALL)
'Reset nome componente corrente
m_sCompoName = String.Empty
ResetLuaVariables()
' Chiudo il dialogo
MainWindowUC.TagliCadContent.Content = MainWindowUC.m_TagliCadUC
End Sub
Private Function ExecCompoFile() As Boolean
' Costruisco path completa del componente
Dim sPath = m_sCompoDir & "\" & m_sCompoName & ".lua"
' Carico il file
Return EgtLuaExecFile(sPath)
End Function
Private Function ReadAndShowVariables() As Boolean
' recupero nome, tipo e valore delle variabili globali
For i As Integer = 1 To NUM_VAR
Dim CVar = New CompoVar
If CVar.NameTypeValueFromLua(i) Then
m_CVars(i - 1) = CVar
Else
m_CVars(i - 1) = Nothing
End If
Next
' aggiorno la griglia dalle variabili
For i As Integer = 1 To NUM_VAR
If m_CVars(i - 1) IsNot Nothing Then
GetNameEdit(i).Text = m_CVars(i - 1).m_sName
GetNameEdit(i).Visibility = Windows.Visibility.Visible
GetValueEdit(i).Text = m_CVars(i - 1).ToString()
GetValueEdit(i).Visibility = Windows.Visibility.Visible
Else
GetNameEdit(i).Visibility = Windows.Visibility.Hidden
GetValueEdit(i).Visibility = Windows.Visibility.Hidden
End If
Next
Return True
End Function
Private Function UpdateVariables() As Boolean
' aggiorno le variabili
For i As Integer = 1 To NUM_VAR
If m_CVars(i - 1) IsNot Nothing Then
' interpreto il valore, se non riesco ripristino default
If Not m_CVars(i - 1).FromString(GetValueEdit(i).Text) Then
GetValueEdit(i).Text = m_CVars(i - 1).ToString()
End If
' aggiorno la corrispondente variabile lua
If Not m_CVars(i - 1).ToLua(i) Then
Dim sErr As String = String.Empty
EgtLuaGetLastError(sErr)
EgtOutLog(sErr)
End If
End If
Next
Return True
End Function
Private Function ResetLuaVariables() As Boolean
EgtLuaResetGlobVar(LUA_CMP_VARS)
EgtLuaResetGlobVar(LUA_CMP_DRAW)
Return False
End Function
Private Function MakePreview(ByRef sMsg As String) As Boolean
If Not EgtLuaExecLine(LUA_CMP_DRAW & "(true)") Then
sMsg = "Error in component execution"
m_bDrawOk = False
Else
EgtLuaGetGlobStringVar(LUA_CMP_VARS & ".MSG", sMsg)
Dim nErr As Integer = 0
EgtLuaGetGlobIntVar(LUA_CMP_VARS & ".ERR", nErr)
m_bDrawOk = (nErr = 0)
End If
Return m_bDrawOk
End Function
Private Function MakeInsert(ByVal nNbr As Integer) As Boolean
' abilito registrazione
EgtEnableCommandLogger()
' ricarico componente corrente
ExecCompoFile()
' aggiorno variabili
UpdateVariables()
' elimino eventuali precedenti pezzi vuoti
EgtEraseEmptyParts()
' eseguo inserimento
For i As Integer = 1 To nNbr
' Inserisco il componente
If Not EgtLuaExecLine(LUA_CMP_DRAW & "(false)") Then
Dim sErr As String = String.Empty
EgtLuaGetLastError(sErr)
EgtOutLog(sErr)
Exit For
End If
' Ne recupero l'Id
Dim nId2 As Integer = EgtGetLastPart()
' Lo posiziono in ordine
EgtPackPart(nId2, PACK_MAX_X, PACK_OFFS)
Next
' disabilito registrazione
EgtDisableCommandLogger()
Return True
End Function
Private Function GetNameEdit(ByVal nInd As Integer) As TextBox
Select Case nInd
Case 1
Return tbName1
Case 2
Return tbName2
Case 3
Return tbName3
Case 4
Return tbName4
Case 5
Return tbName5
Case 6
Return tbName6
Case 7
Return tbName7
Case 8
Return tbName8
Case 9
Return tbName9
Case Else
Return tbName10
End Select
End Function
Private Function GetValueEdit(ByVal nInd As Integer) As TextBox
Select Case nInd
Case 1
Return tbValue1
Case 2
Return tbValue2
Case 3
Return tbValue3
Case 4
Return tbValue4
Case 5
Return tbValue5
Case 6
Return tbValue6
Case 7
Return tbValue7
Case 8
Return tbValue8
Case 9
Return tbValue9
Case Else
Return tbValue10
End Select
End Function
Private Class CompoVar
' Public Members
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_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("F4", CultureInfo.InvariantCulture)
Case 4 ' double
Return m_dVal.ToString("F4", 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(ByVal nInd As Integer) As Boolean
Select Case m_nType
Case 1
Return EgtLuaSetGlobBoolVar(LUA_VALUE & nInd.ToString(), m_bVal)
Case 2
Return EgtLuaSetGlobIntVar(LUA_VALUE & nInd.ToString(), m_nVal)
Case 3, 4
Return EgtLuaSetGlobNumVar(LUA_VALUE & nInd.ToString(), m_dVal)
Case 5
Return EgtLuaSetGlobStringVar(LUA_VALUE & nInd.ToString(), m_sVal)
End Select
Return False
End Function
Public Function NameTypeValueFromLua(ByVal nInd As Integer) As Boolean
Dim bOk As Boolean = True
bOk = bOk AndAlso EgtLuaGetGlobStringVar(LUA_NAME & nInd.ToString(), m_sName)
bOk = bOk AndAlso EgtLuaGetGlobIntVar(LUA_TYPE & nInd.ToString(), m_nType)
Select Case m_nType
Case 1
Return bOk AndAlso EgtLuaGetGlobBoolVar(LUA_VALUE & nInd.ToString(), m_bVal)
Case 2
Return bOk AndAlso EgtLuaGetGlobIntVar(LUA_VALUE & nInd.ToString(), m_nVal)
Case 3, 4
Return bOk AndAlso EgtLuaGetGlobNumVar(LUA_VALUE & nInd.ToString(), m_dVal)
Case 5
Return bOk AndAlso EgtLuaGetGlobStringVar(LUA_VALUE & nInd.ToString(), m_sVal)
End Select
Return False
End Function
End Class
Private Sub CloseBtnUC_Click(sender As Object, e As RoutedEventArgs)
'Pulisco la scena dl componente
EgtNewFile()
' Passo al contesto principale
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
End Sub
Private Sub ComponentiUC_Unloaded(sender As Object, e As RoutedEventArgs)
'ScenaComponenti.Terminate()
End Sub
End Class
+45
View File
@@ -0,0 +1,45 @@
'----------------------------------------------------------------------------
' EgalTech 2015-2015
'----------------------------------------------------------------------------
' File : ConstGen.vb Data : 12.02.15 Versione : 1.6b3
' Contenuto : Modulo costanti generali.
'
'
'
' Modifiche : 12.02.15 DS Creazione modulo.
'
'
'----------------------------------------------------------------------------
Module ConstGen
' File con direttorio radice dei dati
Public Const DAT_FILE_NAME As String = "DataRoot.Ini"
Public Const S_DATA As String = "Data"
Public Const K_DATAROOT As String = "DataRoot"
' File con dati di licenza
Public Const LIC_FILE_NAME As String = "OmagCUT.lic"
Public Const S_LICENCE As String = "Licence"
Public Const K_KEY As String = "Key"
' File di log generale
Public Const GENLOG_FILE_NAME As String = "OmagCUTLog.txt"
' File di log dei comandi
Public Const CMDLOG_FILE_NAME As String = "OmagCUTLog.tua"
' Sottodirettorio di configurazione
Public Const CONF_DIR As String = "Config"
' Sottodirettorio temporaneo
Public Const TEMP_DIR As String = "Temp"
' Sottodirettorio di default per le macchine
Public Const MACHINES_DFL_DIR As String = "Machines"
' Costanti per Pack dei pezzi in Special
Public Const PACK_MAX_X As Double = 2500
Public Const PACK_OFFS As Double = 20
End Module
+91
View File
@@ -0,0 +1,91 @@
'----------------------------------------------------------------------------
' EgalTech 2015-2015
'----------------------------------------------------------------------------
' File : ConstIni.vb Data : 12.02.15 Versione : 1.6b3
' Contenuto : Modulo costanti sezione e chiavi per file Ini.
'
'
'
' Modifiche : 12.02.15 DS Creazione modulo.
'
'
'----------------------------------------------------------------------------
Module ConstIni
Public Const INI_FILE_NAME As String = "OmagCUT.ini"
Public Const S_GENERAL As String = "General"
Public Const K_DEBUG As String = "Debug"
Public Const K_LICENCE As String = "Licence"
Public Const K_USERLEVEL As String = "UserLevel"
Public Const K_MAXINST As String = "MaxInstances"
Public Const K_INSTANCES As String = "Instances"
Public Const K_COMMANDLOG As String = "CommandLog"
Public Const K_MESSAGES As String = "Messages"
Public Const K_WINPLACE As String = "WinPlace"
Public Const K_LASTNGEDIR As String = "LastNgeDir"
Public Const K_LASTNGEOBJDIR As String = "LastNgeObjDir"
Public Const K_LASTLUADIR As String = "LastLuaDir"
Public Const K_LASTIMPDIR As String = "LastImpDir"
Public Const K_LASTEXPDIR As String = "LastExpDir"
Public Const S_LUA As String = "Lua"
Public Const K_LIBSDIR As String = "LibsDir"
Public Const K_BASELIB As String = "BaseLib"
Public Const S_GEOMDB As String = "GeomDB"
Public Const K_DEFAULTFONT As String = "DefaultFont"
Public Const K_NFEFONTDIR As String = "NfeFontDir"
Public Const K_DEFAULTCOLOR As String = "DefaultColor"
Public Const K_SAVETYPE As String = "SaveType"
Public Const S_OPENGL As String = "OpenGL"
Public Const K_DOUBLEBUFFER As String = "DoubleBuffer"
Public Const K_COLORBITS As String = "ColorBits"
Public Const K_DEPTHBITS As String = "DepthBits"
Public Const K_DRIVER As String = "Driver"
Public Const S_SCENE As String = "Scene"
Public Const K_BACKTOP As String = "BackTop"
Public Const K_BACKBOTTOM As String = "BackBottom"
Public Const K_SHOWGFRAME As String = "ShowGFrame"
Public Const K_MARK As String = "Mark"
Public Const K_SELSURF As String = "SelSurf"
Public Const K_SHOWMODE As String = "ShowMode"
Public Const K_CURVEDIR As String = "CurveDir"
Public Const K_SHOWTRIAADV As String = "ShowTriaAdv"
Public Const K_ZOOMWIN As String = "ZoomWin"
Public Const K_DISTLINE As String = "DistLine"
Public Const K_MMUNITS As String = "MmUnits"
Public Const S_GRID As String = "Grid"
Public Const K_SHOWGRID As String = "ShowGrid"
Public Const K_SHOWFRAME As String = "ShowFrame"
Public Const K_SNAPSTEP As String = "SnapStep"
Public Const K_SNAPSTEPINCH As String = "SnapStepInch"
Public Const K_MINLINESSTEP As String = "MinLineSStep"
Public Const K_MAJLINESSTEP As String = "MajLineSStep"
Public Const K_EXTSSTEP As String = "ExtSStep"
Public Const K_MINLNCOLOR As String = "MinLnColor"
Public Const K_MAJLNCOLOR As String = "MajLnColor"
Public Const S_TABSPECIAL As String = "TabSpecial"
Public Const K_TSSHOW As String = "Show"
Public Const S_COMPO As String = "Compo"
Public Const K_CMPWINPLACE As String = "WinPlace"
Public Const K_COMPODIR As String = "CompoDir"
Public Const S_FLATPARTS As String = "FlatParts"
Public Const K_FLPWINPLACE As String = "WinPlace"
Public Const K_FLPCURRDIR As String = "CurrDir"
Public Const S_MACH As String = "Mach"
Public Const K_MACHINESDIR As String = "MachinesDir"
Public Const S_MRUFILES As String = "MruFiles"
Public Const S_MRUSCRIPTS As String = "MruScripts"
Public Const K_FILE As String = "File"
End Module
+5
View File
@@ -0,0 +1,5 @@
Module ConstMsg
Public Const MSG_TAGLICAD As Integer = 9000
End Module
+27
View File
@@ -0,0 +1,27 @@
<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>
+3
View File
@@ -0,0 +1,3 @@
Public Class CorniciUC
End Class
+37
View File
@@ -0,0 +1,37 @@
<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" />
<ListView Name="ListView1" Grid.Row="1" Grid.RowSpan="2" SelectionChanged="ScenaFlatPartsImportUC_SelectionChanged">
<ListView.View>
<GridView>
<GridViewColumn/>
</GridView>
</ListView.View>
</ListView>
</Grid>
</UserControl>
+113
View File
@@ -0,0 +1,113 @@
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
+143
View File
@@ -0,0 +1,143 @@
<UserControl x:Class="GrezzoUC"
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="255.9"
Background="Gray" Loaded="GrezzoUC_Loaded" Initialized="GrezzoUC_Initialized">
<!-- Chiamata al dizionario che contiene Styles e Colori -->
<UserControl.Resources>
<ResourceDictionary Source="OmagCUTDictionary.xaml"></ResourceDictionary>
</UserControl.Resources>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="3*"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="2*"/>
<RowDefinition Height="1.5*"/>
<RowDefinition Height="1.5*"/>
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
<Border Style="{StaticResource CustomBorder}" Grid.ColumnSpan="3"
Grid.Column="0" Grid.Row="0" >
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="1*"/>
<RowDefinition Height="0.5*"/>
<RowDefinition Height="0.5*"/>
<RowDefinition Height="0.5*"/>
<RowDefinition Height="0.5*"/>
</Grid.RowDefinitions>
<Button Name="RectangleBtn" FontSize="20" FontWeight="Bold"/>
<Button Name="ByPointsBtn" Content="Per Punti" Grid.Column="1" FontSize="20" FontWeight="Bold" Click="ByPointsBtnUC_Click"/>
<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"
HorizontalAlignment="Center" VerticalAlignment="Center" Width="60" TextAlignment="Right"
Style="{StaticResource NumericKeyboard}" Name="WidthTxBx" />
<Label Content="Lunghezza" Grid.Row="2" FontSize="20" HorizontalAlignment="Center"
VerticalAlignment="Center"/>
<TextBox Grid.Column="1" Grid.Row="2" Text="200" FontSize="20"
HorizontalAlignment="Center" VerticalAlignment="Center" Width="60" TextAlignment="Right"/>
<Label Content="Offset X" Grid.Row="3" FontSize="20" HorizontalAlignment="Center"
VerticalAlignment="Center" />
<TextBox Grid.Column="1" Grid.Row="3" Text="200" FontSize="20"
HorizontalAlignment="Center" VerticalAlignment="Center" Width="60" TextAlignment="Right"/>
<Label Content="Offset Y" Grid.Row="4" FontSize="20" HorizontalAlignment="Center"
VerticalAlignment="Center" />
<TextBox Grid.Column="1" Grid.Row="4" Text="200" FontSize="20"
HorizontalAlignment="Center" VerticalAlignment="Center" Width="60" TextAlignment="Right"/>
</Grid>
</Border>
<Border Style="{StaticResource CustomBorder}" Grid.ColumnSpan="3"
Grid.Column="0" Grid.Row="1" >
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="0.5*"/>
<RowDefinition Height="0.5*"/>
</Grid.RowDefinitions>
<Label Content="Kerf" Grid.Row="0" FontSize="20" HorizontalAlignment="Center"
VerticalAlignment="Center" Name="KerfLbl" />
<UniformGrid Grid.Column="1" Columns="2">
<Button Name="KerfBtn" Content="Int" FontSize="20"/>
<Button Content="Ext" Grid.Column="1" FontSize="20"/>
</UniformGrid>
<Label Content="Spessore" Grid.Row="1" FontSize="20" HorizontalAlignment="Center"
VerticalAlignment="Center" Name="KerfThicknessLbl"/>
<TextBox Grid.Column="1" Grid.Row="1" Text="200" FontSize="20"
HorizontalAlignment="Center" VerticalAlignment="Center" Width="60" TextAlignment="Right"/>
</Grid>
</Border>
<Border Style="{StaticResource CustomBorder}" Grid.ColumnSpan="3"
Grid.Column="0" Grid.Row="2" >
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="0.5*"/>
<RowDefinition Height="0.5*"/>
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
<Label Content="Zona rovinata" Grid.Row="0" FontSize="20" HorizontalAlignment="Left"
VerticalAlignment="Center" Name="Lbl" Grid.ColumnSpan="2" Margin="8,0,0,0" FontWeight="Bold"/>
<Label Content="N° punti" Grid.Row="1" FontSize="20" HorizontalAlignment="Center"
VerticalAlignment="Center" />
<TextBox Grid.Column="1" Grid.Row="1" Text="200" FontSize="20"
HorizontalAlignment="Center" VerticalAlignment="Center" Width="60" TextAlignment="Right"/>
<Button Content="Nuova" Grid.Row="2" FontSize="20"/>
<Button Content="Elimina" Grid.Row="2" Grid.Column="1" FontSize="20"/>
</Grid>
</Border>
<Border Style="{StaticResource CustomBorder}" Grid.ColumnSpan="3"
Grid.Column="0" Grid.Row="4" >
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="0.5*"/>
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
<Label Content="Punti" Grid.Row="0" FontSize="20" HorizontalAlignment="Left"
VerticalAlignment="Center" Name="Ldfbl" Grid.ColumnSpan="2" Margin="8,0,0,0" FontWeight="Bold"/>
<Button Content="Aggiungi" Grid.Row="1" FontSize="20"/>
<Button Content="Rimuovi" Grid.Row="1" Grid.Column="1" FontSize="20"/>
</Grid>
</Border>
<Button Content="X" Grid.Column="2" Grid.Row="5" Click="ExitBtnUC_Click" />
<Button Content="V" Grid.Column="1" Grid.Row="5" Click="ConfirmBtn_Click" />
</Grid>
</UserControl>
+43
View File
@@ -0,0 +1,43 @@
Imports EgtUILib
Public Class GrezzoUC
Dim MainWindowUC 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
End Sub
Private Sub GrezzoUC_Loaded(sender As Object, e As RoutedEventArgs)
'RectangleBtn.Content = EgtMsg(9001)
WidthTxBx.Tag = WidthLbl
End Sub
Private Sub ExitBtnUC_Click(sender As Object, e As RoutedEventArgs)
MainWindowUC.MainGrid.Children.Remove(MainWindowUC.m_GrezzoUC)
End Sub
Private Sub ConfirmBtn_Click(sender As Object, e As RoutedEventArgs)
MainWindowUC.MainGrid.Children.Remove(MainWindowUC.m_GrezzoUC)
End Sub
Private Sub RectangleBtnUC_Click(sender As Object, e As RoutedEventArgs) Handles RectangleBtn.Click
If Not m_bRectangle Then
m_bRectangle = True
RectangleBtn.IsEnabled = True
ByPointsBtn.IsEnabled = False
'Funzione Egt che imposta modalità rettangolo
End If
End Sub
Private Sub ByPointsBtnUC_Click(sender As Object, e As RoutedEventArgs)
If m_bRectangle Then
m_bRectangle = False
RectangleBtn.IsEnabled = False
ByPointsBtn.IsEnabled = True
'Funzione Egt che imposta modalità per punti
End If
End Sub
End Class
+26
View File
@@ -0,0 +1,26 @@
<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>
+12
View File
@@ -0,0 +1,12 @@
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
+300
View File
@@ -0,0 +1,300 @@
<Window x:Class="MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
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 -->
<Window.Resources>
<ResourceDictionary Source="OmagCUTDictionary.xaml"></ResourceDictionary>
</Window.Resources>
<Grid Name="MainGrid">
<!-- ** Definizione della Grid di base della finestra ** -->
<Grid.RowDefinitions>
<RowDefinition Height="1*"/>
<RowDefinition Height="5*"/>
<RowDefinition Height="5*"/>
<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">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="3*"/>
<ColumnDefinition Width="11*"/>
<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>
<!-- *************************************************************************** -->
<!-- ** Definizione del TABITEM LAVORAZIONE CORNICI ** -->
<TabItem Name="TabLavorazioneCornici">
<!-- 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>
+292
View File
@@ -0,0 +1,292 @@
Imports System.Runtime.InteropServices
Imports System.Threading
Imports System.Windows.Controls
Imports System.Globalization
Imports EgtUILib
Imports EgtUILib.EgtInterface
Imports EgtUILib.Scene
Imports System.Text
Class MainWindow
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
'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 textbox che ha aperto la tastiera
'Friend m_TxBxGotKeyboardFocus As TextBox
'***********************************************
Public Shared Function GetIniFile() As String
Return m_sIniFile
End Function
Private Sub Window_Initialized(sender As Object, e As EventArgs)
' 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
'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
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
'Eventi da UserControl
'TagliCadUC
AddHandler m_TagliCadUC.ComponentsBtnMW_Click, AddressOf ComponentsBtnMW_Click
AddHandler m_TagliCadUC.ZoomAllBtnMW_Click, AddressOf ZoomAllBtnMW_Click
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
End If
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
End Sub
Private Sub ExitBtnMW_Click(sender As Object, e As RoutedEventArgs)
Close()
End Sub
'-- ** Eventi del TABITEM LAVORAZIONI PIANE ** --
Private Sub ComponentsBtnMW_Click(sender As Object, e As RoutedEventArgs)
TagliCadContent.Content = m_ComponentiUC
End Sub
Private Sub ZoomAllBtnMW_Click(sender As Object, e As RoutedEventArgs)
MachiningScene.ZoomAll()
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_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
End Sub
End Class
+59
View File
@@ -0,0 +1,59 @@
Imports System
Imports System.Reflection
Imports System.Runtime.InteropServices
Imports System.Globalization
Imports System.Resources
Imports System.Windows
' General Information about an assembly is controlled through the following
' set of attributes. Change these attribute values to modify the information
' associated with an assembly.
' Review the values of the assembly attributes
<Assembly: AssemblyTitle("OmagCUT")>
<Assembly: AssemblyDescription("")>
<Assembly: AssemblyCompany("")>
<Assembly: AssemblyProduct("OmagCUT")>
<Assembly: AssemblyCopyright("Copyright © 2015")>
<Assembly: AssemblyTrademark("")>
<Assembly: ComVisible(false)>
'In order to begin building localizable applications, set
'<UICulture>CultureYouAreCodingWith</UICulture> in your .vbproj file
'inside a <PropertyGroup>. For example, if you are using US english
'in your source files, set the <UICulture> to "en-US". Then uncomment the
'NeutralResourceLanguage attribute below. Update the "en-US" in the line
'below to match the UICulture setting in the project file.
'<Assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)>
'The ThemeInfo attribute describes where any theme specific and generic resource dictionaries can be found.
'1st parameter: where theme specific resource dictionaries are located
'(used if a resource is not found in the page,
' or application resource dictionaries)
'2nd parameter: where the generic resource dictionary is located
'(used if a resource is not found in the page,
'app, and any theme specific resource dictionaries)
<Assembly: ThemeInfo(ResourceDictionaryLocation.None, ResourceDictionaryLocation.SourceAssembly)>
'The following GUID is for the ID of the typelib if this project is exposed to COM
<Assembly: Guid("5f7e2879-e4a4-430d-bcf2-f9a3724762be")>
' Version information for an assembly consists of the following four values:
'
' Major Version
' Minor Version
' Build Number
' Revision
'
' You can specify all the values or you can default the Build and Revision Numbers
' by using the '*' as shown below:
' <Assembly: AssemblyVersion("1.0.*")>
<Assembly: AssemblyVersion("1.0.0.0")>
<Assembly: AssemblyFileVersion("1.0.0.0")>
+121
View File
@@ -0,0 +1,121 @@
#If _MyType <> "Empty" Then
Namespace My
''' <summary>
''' Module used to define the properties that are available in the My Namespace for WPF
''' </summary>
''' <remarks></remarks>
<Global.Microsoft.VisualBasic.HideModuleName()> _
Module MyWpfExtension
Private s_Computer As New ThreadSafeObjectProvider(Of Global.Microsoft.VisualBasic.Devices.Computer)
Private s_User As New ThreadSafeObjectProvider(Of Global.Microsoft.VisualBasic.ApplicationServices.User)
Private s_Windows As New ThreadSafeObjectProvider(Of MyWindows)
Private s_Log As New ThreadSafeObjectProvider(Of Global.Microsoft.VisualBasic.Logging.Log)
''' <summary>
''' Returns the application object for the running application
''' </summary>
<Global.System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")> _
Friend ReadOnly Property Application() As Application
Get
Return CType(Global.System.Windows.Application.Current, Application)
End Get
End Property
''' <summary>
''' Returns information about the host computer.
''' </summary>
<Global.System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")> _
Friend ReadOnly Property Computer() As Global.Microsoft.VisualBasic.Devices.Computer
Get
Return s_Computer.GetInstance()
End Get
End Property
''' <summary>
''' Returns information for the current user. If you wish to run the application with the current
''' Windows user credentials, call My.User.InitializeWithWindowsUser().
''' </summary>
<Global.System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")> _
Friend ReadOnly Property User() As Global.Microsoft.VisualBasic.ApplicationServices.User
Get
Return s_User.GetInstance()
End Get
End Property
''' <summary>
''' Returns the application log. The listeners can be configured by the application's configuration file.
''' </summary>
<Global.System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")> _
Friend ReadOnly Property Log() As Global.Microsoft.VisualBasic.Logging.Log
Get
Return s_Log.GetInstance()
End Get
End Property
''' <summary>
''' Returns the collection of Windows defined in the project.
''' </summary>
<Global.System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")> _
Friend ReadOnly Property Windows() As MyWindows
<Global.System.Diagnostics.DebuggerHidden()> _
Get
Return s_Windows.GetInstance()
End Get
End Property
<Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Never)> _
<Global.Microsoft.VisualBasic.MyGroupCollection("System.Windows.Window", "Create__Instance__", "Dispose__Instance__", "My.MyWpfExtenstionModule.Windows")> _
Friend NotInheritable Class MyWindows
<Global.System.Diagnostics.DebuggerHidden()> _
Private Shared Function Create__Instance__(Of T As {New, Global.System.Windows.Window})(ByVal Instance As T) As T
If Instance Is Nothing Then
If s_WindowBeingCreated IsNot Nothing Then
If s_WindowBeingCreated.ContainsKey(GetType(T)) = True Then
Throw New Global.System.InvalidOperationException("The window cannot be accessed via My.Windows from the Window constructor.")
End If
Else
s_WindowBeingCreated = New Global.System.Collections.Hashtable()
End If
s_WindowBeingCreated.Add(GetType(T), Nothing)
Return New T()
s_WindowBeingCreated.Remove(GetType(T))
Else
Return Instance
End If
End Function
<Global.System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1822:MarkMembersAsStatic")> _
<Global.System.Diagnostics.DebuggerHidden()> _
Private Sub Dispose__Instance__(Of T As Global.System.Windows.Window)(ByRef instance As T)
instance = Nothing
End Sub
<Global.System.Diagnostics.DebuggerHidden()> _
<Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Never)> _
Public Sub New()
MyBase.New()
End Sub
<Global.System.ThreadStatic()> Private Shared s_WindowBeingCreated As Global.System.Collections.Hashtable
<Global.System.ComponentModel.EditorBrowsable(Global.System.ComponentModel.EditorBrowsableState.Never)> Public Overrides Function Equals(ByVal o As Object) As Boolean
Return MyBase.Equals(o)
End Function
<Global.System.ComponentModel.EditorBrowsable(Global.System.ComponentModel.EditorBrowsableState.Never)> Public Overrides Function GetHashCode() As Integer
Return MyBase.GetHashCode
End Function
<Global.System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1822:MarkMembersAsStatic")> _
<Global.System.ComponentModel.EditorBrowsable(Global.System.ComponentModel.EditorBrowsableState.Never)> _
Friend Overloads Function [GetType]() As Global.System.Type
Return GetType(MyWindows)
End Function
<Global.System.ComponentModel.EditorBrowsable(Global.System.ComponentModel.EditorBrowsableState.Never)> Public Overrides Function ToString() As String
Return MyBase.ToString
End Function
End Class
End Module
End Namespace
Partial Class Application
Inherits Global.System.Windows.Application
<Global.System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")> _
<Global.System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1822:MarkMembersAsStatic")> _
Friend ReadOnly Property Info() As Global.Microsoft.VisualBasic.ApplicationServices.AssemblyInfo
<Global.System.Diagnostics.DebuggerHidden()> _
Get
Return New Global.Microsoft.VisualBasic.ApplicationServices.AssemblyInfo(Global.System.Reflection.Assembly.GetExecutingAssembly())
End Get
End Property
End Class
#End If
+63
View File
@@ -0,0 +1,63 @@
'------------------------------------------------------------------------------
' <auto-generated>
' This code was generated by a tool.
' Runtime Version:4.0.30319.34209
'
' Changes to this file may cause incorrect behavior and will be lost if
' the code is regenerated.
' </auto-generated>
'------------------------------------------------------------------------------
Option Strict On
Option Explicit On
Imports System
Namespace My.Resources
'This class was auto-generated by the StronglyTypedResourceBuilder
'class via a tool like ResGen or Visual Studio.
'To add or remove a member, edit your .ResX file then rerun ResGen
'with the /str option, or rebuild your VS project.
'''<summary>
''' A strongly-typed resource class, for looking up localized strings, etc.
'''</summary>
<Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0"), _
Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _
Global.Microsoft.VisualBasic.HideModuleNameAttribute()> _
Friend Module Resources
Private resourceMan As Global.System.Resources.ResourceManager
Private resourceCulture As Global.System.Globalization.CultureInfo
'''<summary>
''' Returns the cached ResourceManager instance used by this class.
'''</summary>
<Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
Friend ReadOnly Property ResourceManager() As Global.System.Resources.ResourceManager
Get
If Object.ReferenceEquals(resourceMan, Nothing) Then
Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("OmagCUT.Resources", GetType(Resources).Assembly)
resourceMan = temp
End If
Return resourceMan
End Get
End Property
'''<summary>
''' Overrides the current thread's CurrentUICulture property for all
''' resource lookups using this strongly typed resource class.
'''</summary>
<Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
Friend Property Culture() As Global.System.Globalization.CultureInfo
Get
Return resourceCulture
End Get
Set
resourceCulture = value
End Set
End Property
End Module
End Namespace
+117
View File
@@ -0,0 +1,117 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>
+71
View File
@@ -0,0 +1,71 @@
'------------------------------------------------------------------------------
' <auto-generated>
' This code was generated by a tool.
' Runtime Version:4.0.30319.34209
'
' Changes to this file may cause incorrect behavior and will be lost if
' the code is regenerated.
' </auto-generated>
'------------------------------------------------------------------------------
Option Strict On
Option Explicit On
<Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _
Global.System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "12.0.0.0"), _
Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
Partial Friend NotInheritable Class MySettings
Inherits Global.System.Configuration.ApplicationSettingsBase
Private Shared defaultInstance As MySettings = CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New MySettings()),MySettings)
#Region "My.Settings Auto-Save Functionality"
#If _MyType = "WindowsForms" Then
Private Shared addedHandler As Boolean
Private Shared addedHandlerLockObject As New Object
<Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
Private Shared Sub AutoSaveSettings(ByVal sender As Global.System.Object, ByVal e As Global.System.EventArgs)
If My.Application.SaveMySettingsOnExit Then
My.Settings.Save()
End If
End Sub
#End If
#End Region
Public Shared ReadOnly Property [Default]() As MySettings
Get
#If _MyType = "WindowsForms" Then
If Not addedHandler Then
SyncLock addedHandlerLockObject
If Not addedHandler Then
AddHandler My.Application.Shutdown, AddressOf AutoSaveSettings
addedHandler = True
End If
End SyncLock
End If
#End If
Return defaultInstance
End Get
End Property
End Class
Namespace My
<Global.Microsoft.VisualBasic.HideModuleNameAttribute(), _
Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute()> _
Friend Module MySettingsProperty
<Global.System.ComponentModel.Design.HelpKeywordAttribute("My.Settings")> _
Friend ReadOnly Property Settings() As Global.OmagCUT.MySettings
Get
Return Global.OmagCUT.MySettings.Default
End Get
End Property
End Module
End Namespace
+7
View File
@@ -0,0 +1,7 @@
<?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" UseMySettingsClassName="true">
<Profiles>
<Profile Name="(Default)" />
</Profiles>
<Settings />
</SettingsFile>
+74
View File
@@ -0,0 +1,74 @@
<Window x:Class="NumericKeyboardWD"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="NumericKeyboardWD" Height="1024" Width="1280" Background="Transparent" WindowStyle="None" ResizeMode="NoResize" AllowsTransparency="True" Unloaded="NumericKeyboardWD_Unloaded" KeyDown="NumericKeyboardWD_KeyDown" IsVisibleChanged="NumericKeyboardWD_IsVisibleChanged" ShowInTaskbar="False">
<!-- Chiamata al dizionario che contiene Styles e Colori -->
<Window.Resources>
<ResourceDictionary Source="OmagCUTDictionary.xaml"></ResourceDictionary>
</Window.Resources>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="1*"/>
<RowDefinition Height="5*"/>
<RowDefinition Height="5*"/>
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="3*"/>
<ColumnDefinition Width="7*"/>
<ColumnDefinition Width="5*"/>
</Grid.ColumnDefinitions>
<Border Style="{StaticResource CustomBorder}" Grid.Row="2" Grid.Column="2" >
<Grid Grid.Row="2" Grid.Column="2" >
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="0.5*"/>
<RowDefinition Height="0.5*"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
<TextBlock Text="Lato A" Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="5"
FontSize="30" Name="NumericKeyboardWDTitle" />
<TextBox Text="100" Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="5"
TextAlignment="Right" FontSize="30" Name="NumericKeyboardWDTextBox" />
<Button Content="7" Grid.Row="2" Grid.Column="0" FontSize="50" Click="Btn7WD_Click" />
<Button Content="8" Grid.Row="2" Grid.Column="1" FontSize="50" Click="Btn8WD_Click" />
<Button Content="9" Grid.Row="2" Grid.Column="2" FontSize="50" Click="Btn9WD_Click" />
<Button Content="+" Grid.Row="2" Grid.Column="3" FontSize="50" Click="BtnPlusWD_Click" />
<Button Content="!-" Grid.Row="2" Grid.Column="4" FontSize="50" Click="BtnDeleteWD_Click" />
<Button Content="4" Grid.Row="3" Grid.Column="0" FontSize="50" Click="Btn4WD_Click" />
<Button Content="5" Grid.Row="3" Grid.Column="1" FontSize="50" Click="Btn5WD_Click" />
<Button Content="6" Grid.Row="3" Grid.Column="2" FontSize="50" Click="Btn6WD_Click" />
<Button Content="-" Grid.Row="3" Grid.Column="3" FontSize="50" Click="BtnMinusWD_Click" />
<Button Content="C" Grid.Row="3" Grid.Column="4" FontSize="50" Click="BtnCancelWD_Click" />
<Button Content="1" Grid.Row="4" Grid.Column="0" FontSize="50" Click="Btn1WD_Click" />
<Button Content="2" Grid.Row="4" Grid.Column="1" FontSize="50" Click="Btn2WD_Click" />
<Button Content="3" Grid.Row="4" Grid.Column="2" FontSize="50" Click="Btn3WD_Click" />
<Button Content="*" Grid.Row="4" Grid.Column="3" FontSize="50" Click="BtnMultiplicationWD_Click" />
<Button Content="X" Grid.Row="4" Grid.Column="4" FontSize="50" Click="BtnExitWD_Click" />
<Button Content="0" Grid.Row="5" Grid.Column="0" FontSize="50" Click="Btn0WD_Click"/>
<Button Content="." Grid.Row="5" Grid.Column="1" FontSize="50" Click="BtnDotWD_Click" />
<Button Content="=" Grid.Row="5" Grid.Column="2" FontSize="50" Click="BtnEvaluateWD_Click" />
<Button Content="/" Grid.Row="5" Grid.Column="3" FontSize="50" Click="BtnDivisionWD_Click" />
<Button Content="V" Grid.Row="5" Grid.Column="4" FontSize="50" Click="BtnApplyWD_Click" />
</Grid>
</Border>
</Grid>
</Window>
+134
View File
@@ -0,0 +1,134 @@
Imports System.Globalization
Public Class NumericKeyboardWD
Dim MainWindowUC As MainWindow = Application.Current.MainWindow
Public m_CurrentTxBx As TextBox
Public m_CurrentLbl As String = String.Empty
Dim m_bErrorState As Boolean = False
'Private Sub NumericKeyboardWD_Initialized(sender As Object, e As EventArgs)
' Me.Owner = MainWindowUC
'End Sub
Private Sub NumericKeyboardWD_IsVisibleChanged(sender As Object, e As DependencyPropertyChangedEventArgs)
If Me.IsVisible Then
NumericKeyboardWDTextBox.Text = m_CurrentTxBx.Text
NumericKeyboardWDTitle.Text = m_CurrentLbl
End If
End Sub
Private Sub NumericKeyboardWD_Unloaded(sender As Object, e As RoutedEventArgs)
MainWindowUC.Focus()
End Sub
Private Sub NumericKeyboardWD_KeyDown(sender As Object, e As KeyEventArgs)
If (e.Key = Key.Enter) Then
Visibility = Windows.Visibility.Hidden
End If
End Sub
Private Sub Btn0WD_Click(sender As Object, e As RoutedEventArgs)
NumericKeyboardWDTextBox.Text &= "0"
End Sub
Private Sub Btn1WD_Click(sender As Object, e As RoutedEventArgs)
NumericKeyboardWDTextBox.Text &= "1"
End Sub
Private Sub Btn2WD_Click(sender As Object, e As RoutedEventArgs)
NumericKeyboardWDTextBox.Text &= "2"
End Sub
Private Sub Btn3WD_Click(sender As Object, e As RoutedEventArgs)
NumericKeyboardWDTextBox.Text &= "3"
End Sub
Private Sub Btn4WD_Click(sender As Object, e As RoutedEventArgs)
NumericKeyboardWDTextBox.Text &= "4"
End Sub
Private Sub Btn5WD_Click(sender As Object, e As RoutedEventArgs)
NumericKeyboardWDTextBox.Text &= "5"
End Sub
Private Sub Btn6WD_Click(sender As Object, e As RoutedEventArgs)
NumericKeyboardWDTextBox.Text &= "6"
End Sub
Private Sub Btn7WD_Click(sender As Object, e As RoutedEventArgs)
NumericKeyboardWDTextBox.Text &= "7"
End Sub
Private Sub Btn8WD_Click(sender As Object, e As RoutedEventArgs)
NumericKeyboardWDTextBox.Text &= "8"
End Sub
Private Sub Btn9WD_Click(sender As Object, e As RoutedEventArgs)
NumericKeyboardWDTextBox.Text &= "9"
End Sub
Private Sub BtnDotWD_Click(sender As Object, e As RoutedEventArgs)
NumericKeyboardWDTextBox.Text &= "."
End Sub
Private Sub BtnEvaluateWD_Click(sender As Object, e As RoutedEventArgs)
Evaluate()
End Sub
Private Sub BtnPlusWD_Click(sender As Object, e As RoutedEventArgs)
NumericKeyboardWDTextBox.Text &= "+"
End Sub
Private Sub BtnMinusWD_Click(sender As Object, e As RoutedEventArgs)
NumericKeyboardWDTextBox.Text &= "-"
End Sub
Private Sub BtnMultiplicationWD_Click(sender As Object, e As RoutedEventArgs)
NumericKeyboardWDTextBox.Text &= "*"
End Sub
Private Sub BtnDivisionWD_Click(sender As Object, e As RoutedEventArgs)
NumericKeyboardWDTextBox.Text &= "/"
End Sub
Private Sub BtnDeleteWD_Click(sender As Object, e As RoutedEventArgs)
NumericKeyboardWDTextBox.Text = NumericKeyboardWDTextBox.Text.Substring(0, NumericKeyboardWDTextBox.Text.Length - 1)
End Sub
Private Sub BtnCancelWD_Click(sender As Object, e As RoutedEventArgs)
NumericKeyboardWDTextBox.Text = String.Empty
End Sub
Private Sub BtnExitWD_Click(sender As Object, e As RoutedEventArgs)
NumericKeyboardWDTextBox.Text = String.Empty
Visibility = Windows.Visibility.Hidden
End Sub
Private Sub BtnApplyWD_Click(sender As Object, e As RoutedEventArgs)
Evaluate()
If m_bErrorState Then
Else
m_CurrentTxBx.Text = NumericKeyboardWDTextBox.Text
NumericKeyboardWDTextBox.Text = String.Empty
Visibility = Windows.Visibility.Hidden
End If
End Sub
Private Sub Evaluate()
Dim DoubleResult As Double = 0
Dim bOk As Boolean = EgtUILib.EgtLuaEvalNumExpr(NumericKeyboardWDTextBox.Text, DoubleResult)
If (bOk) Then
NumericKeyboardWDTextBox.Text = DoubleResult.ToString(CultureInfo.InvariantCulture)
If m_bErrorState Then
m_bErrorState = False
NumericKeyboardWDTitle.Text = m_CurrentLbl
End If
Else
m_bErrorState = True
NumericKeyboardWDTitle.Text &= " ESPRESSIONE ERRATA"
End If
End Sub
End Class
+22
View File
@@ -0,0 +1,22 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2013
VisualStudioVersion = 12.0.40629.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "OmagCUT", "OmagCUT.vbproj", "{AC6C1390-231E-401C-89DD-AE0844B524E7}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|x86 = Debug|x86
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{AC6C1390-231E-401C-89DD-AE0844B524E7}.Debug|x86.ActiveCfg = Debug|x86
{AC6C1390-231E-401C-89DD-AE0844B524E7}.Debug|x86.Build.0 = Debug|x86
{AC6C1390-231E-401C-89DD-AE0844B524E7}.Release|x86.ActiveCfg = Release|x86
{AC6C1390-231E-401C-89DD-AE0844B524E7}.Release|x86.Build.0 = Release|x86
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
+263
View File
@@ -0,0 +1,263 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{AC6C1390-231E-401C-89DD-AE0844B524E7}</ProjectGuid>
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{F184B08F-C81C-45F6-A57F-5ABD9991F28F}</ProjectTypeGuids>
<OutputType>WinExe</OutputType>
<RootNamespace>OmagCUT</RootNamespace>
<AssemblyName>OmagCUT</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<MyType>Custom</MyType>
<TargetFrameworkProfile>Client</TargetFrameworkProfile>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<DefineDebug>true</DefineDebug>
<DefineTrace>true</DefineTrace>
<IncrementalBuild>true</IncrementalBuild>
<OutputPath>bin\Debug\</OutputPath>
<DocumentationFile>OmagCUT.xml</DocumentationFile>
<NoWarn>41999,42016,42017,42018,42019,42020,42021,42022,42032,42036,42314</NoWarn>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<DebugSymbols>false</DebugSymbols>
<DefineDebug>false</DefineDebug>
<DefineTrace>true</DefineTrace>
<IncrementalBuild>false</IncrementalBuild>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DocumentationFile>OmagCUT.xml</DocumentationFile>
<NoWarn>41999,42016,42017,42018,42019,42020,42021,42022,42032,42036,42314</NoWarn>
</PropertyGroup>
<PropertyGroup>
<OptionExplicit>On</OptionExplicit>
</PropertyGroup>
<PropertyGroup>
<OptionCompare>Binary</OptionCompare>
</PropertyGroup>
<PropertyGroup>
<OptionStrict>Off</OptionStrict>
</PropertyGroup>
<PropertyGroup>
<OptionInfer>On</OptionInfer>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
<DebugSymbols>true</DebugSymbols>
<DefineDebug>true</DefineDebug>
<DefineTrace>true</DefineTrace>
<OutputPath>bin\x86\Debug\</OutputPath>
<DocumentationFile>OmagCUT.xml</DocumentationFile>
<NoWarn>41999,42016,42017,42018,42019,42020,42021,42022,42032,42036,42314</NoWarn>
<DebugType>full</DebugType>
<PlatformTarget>x86</PlatformTarget>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
<DefineTrace>false</DefineTrace>
<OutputPath>bin\x86\Release\</OutputPath>
<DocumentationFile>OmagCUT.xml</DocumentationFile>
<Optimize>true</Optimize>
<NoWarn>41999,42016,42017,42018,42019,42020,42021,42022,42032,42036,42314</NoWarn>
<DebugType>None</DebugType>
<PlatformTarget>x86</PlatformTarget>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup>
<StartupObject />
</PropertyGroup>
<PropertyGroup>
<RunPostBuildEvent>OnOutputUpdated</RunPostBuildEvent>
</PropertyGroup>
<ItemGroup>
<Reference Include="EgtUILib, Version=1.6.8.1, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\EgtProg\DllD32\EgtUILib.dll</HintPath>
</Reference>
<Reference Include="System.Core" />
<Reference Include="System.Drawing" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
<Reference Include="System.Xaml">
<RequiredTargetFramework>4.0</RequiredTargetFramework>
</Reference>
<Reference Include="WindowsBase" />
<Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" />
<Reference Include="WindowsFormsIntegration" />
</ItemGroup>
<ItemGroup>
<ApplicationDefinition Include="Application.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</ApplicationDefinition>
<Compile Include="BarLavoraUC.xaml.vb">
<DependentUpon>BarLavoraUC.xaml</DependentUpon>
</Compile>
<Compile Include="BarNestingUC.xaml.vb">
<DependentUpon>BarNestingUC.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>
<Compile Include="FlatPartsImportUC.xaml.vb">
<DependentUpon>FlatPartsImportUC.xaml</DependentUpon>
</Compile>
<Compile Include="GrezzoUC.xaml.vb">
<DependentUpon>GrezzoUC.xaml</DependentUpon>
</Compile>
<Compile Include="LavoroInCorsoUC.xaml.vb">
<DependentUpon>LavoroInCorsoUC.xaml</DependentUpon>
</Compile>
<Compile Include="NumericKeyboardWD.xaml.vb">
<DependentUpon>NumericKeyboardWD.xaml</DependentUpon>
</Compile>
<Compile Include="OmagCUTDictionary.xaml.vb">
<DependentUpon>OmagCUTDictionary.xaml</DependentUpon>
</Compile>
<Compile Include="TagliCadUC.xaml.vb">
<DependentUpon>TagliCadUC.xaml</DependentUpon>
</Compile>
<Compile Include="TagliDirettiUC.xaml.vb">
<DependentUpon>TagliDirettiUC.xaml</DependentUpon>
</Compile>
<Page Include="BarLavoraUC.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="BarNestingUC.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="ComponentiUC.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="CorniciUC.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="FlatPartsImportUC.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="GrezzoUC.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="LavoroInCorsoUC.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="MainWindow.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Compile Include="Application.xaml.vb">
<DependentUpon>Application.xaml</DependentUpon>
<SubType>Code</SubType>
</Compile>
<Compile Include="ConstGen.vb" />
<Compile Include="ConstIni.vb" />
<Compile Include="MainWindow.xaml.vb">
<DependentUpon>MainWindow.xaml</DependentUpon>
<SubType>Code</SubType>
</Compile>
<Page Include="NumericKeyboardWD.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="OmagCUTDictionary.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">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
</ItemGroup>
<ItemGroup>
<Import Include="System.Linq" />
<Import Include="System.Xml.Linq" />
<Import Include="Microsoft.VisualBasic" />
<Import Include="System" />
<Import Include="System.Collections" />
<Import Include="System.Collections.Generic" />
<Import Include="System.Diagnostics" />
<Import Include="System.Windows" />
<Import Include="System.Windows.Controls" />
<Import Include="System.Windows.Data" />
<Import Include="System.Windows.Documents" />
<Import Include="System.Windows.Input" />
<Import Include="System.Windows.Shapes" />
<Import Include="System.Windows.Media" />
<Import Include="System.Windows.Media.Imaging" />
<Import Include="System.Windows.Navigation" />
</ItemGroup>
<ItemGroup>
<Compile Include="My Project\AssemblyInfo.vb">
<SubType>Code</SubType>
</Compile>
<Compile Include="My Project\MyExtensions\MyWpfExtension.vb">
<VBMyExtensionTemplateID>Microsoft.VisualBasic.WPF.MyExtension</VBMyExtensionTemplateID>
<VBMyExtensionTemplateVersion>1.0.0.0</VBMyExtensionTemplateVersion>
</Compile>
<Compile Include="My Project\Resources.Designer.vb">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<Compile Include="My Project\Settings.Designer.vb">
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
<EmbeddedResource Include="My Project\Resources.resx">
<Generator>VbMyResourcesResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.vb</LastGenOutput>
<CustomToolNamespace>My.Resources</CustomToolNamespace>
</EmbeddedResource>
<None Include="app.config" />
<None Include="My Project\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.vb</LastGenOutput>
</None>
<AppDesigner Include="My Project\" />
</ItemGroup>
<ItemGroup />
<ItemGroup>
<Resource Include="Resources\ExitIcon.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\Lama.jpg" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\LogoOmag.jpg" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\ZigZag.jpg" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />
<PropertyGroup>
<PostBuildEvent>IF "$(PlatformName)"=="x86" IF "$(ConfigurationName)" == "Release" copy $(TargetPath) c:\EgtProg\OmagCUT\OmagCUTR32.exe
IF "$(PlatformName)"=="x86" IF "$(ConfigurationName)" == "Debug" copy $(TargetPath) c:\EgtProg\OmagCUT\OmagCUTD32.exe</PostBuildEvent>
</PropertyGroup>
</Project>
+285
View File
@@ -0,0 +1,285 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:sys="clr-namespace:System;assembly=mscorlib"
x:Class="OmagCUTDictionary">
<!-- ** COLORI ** -->
<!-- ** TAB CONTROL ** -->
<!-- ** Tab Item ** -->
<SolidColorBrush x:Key="TabItemBorderColor_Unselected" Color="Gray" />
<SolidColorBrush x:Key="TabItemBackground_Unselected" Color="Gray" />
<SolidColorBrush x:Key="TabItemTextColor_Unselected" Color="White" />
<SolidColorBrush x:Key="TabItemBorderColor_Selected" Color="DarkGray" />
<SolidColorBrush x:Key="TabItemBackground_Selected" Color="LightGray" />
<SolidColorBrush x:Key="TabItemTextColor_Selected" Color="Black" />
<!-- ** Tab Page ** -->
<SolidColorBrush x:Key="TabControlBackgroundColor" Color="Gray" />
<SolidColorBrush x:Key="TabPageBorderColor" Color="DarkGray" />
<SolidColorBrush x:Key="TabPageBorderColor_Shadow" Color="LightGray" />
<SolidColorBrush x:Key="TabPageColor" Color="#FFE5E5E5" />
<!-- ** BUTTON ** -->
<SolidColorBrush x:Key="ButtonBorderColor_Unselected" Color="DarkGray" />
<SolidColorBrush x:Key="ButtonBackGroundColor_Unselected" Color="LightGray" />
<SolidColorBrush x:Key="ButtonTextColor_Unselected" Color="Black" />
<SolidColorBrush x:Key="ButtonBorderColor_Selected" Color="LightGray" />
<SolidColorBrush x:Key="ButtonBackGroundColor_Selected" Color="LightGray" />
<SolidColorBrush x:Key="ButtonTextColor_Selected" Color="White" />
<!-- *************************************************************************** -->
<!-- ** PARAMETRI VARI (dimensioni, ecc...) ** -->
<!-- ** TAB CONTROL ** -->
<!-- ** Tab Header ** -->
<sys:Double x:Key="TabHeaderWidth">250</sys:Double>
<sys:Double x:Key="TabHeaderHeight">75</sys:Double>
<GridLength x:Key="TabHeaderImageColumnWidth">1.3*</GridLength>
<GridLength x:Key="TabHeaderTextBlockColumnWidth">3*</GridLength>
<!-- ** Tab Page ** -->
<GridLength x:Key="TabPageColumn0Width">11*</GridLength>
<GridLength x:Key="TabPageColumn1Width">1*</GridLength>
<GridLength x:Key="TabPageColumn2Width">0</GridLength>
<GridLength x:Key="TabPageRow0Width">1*</GridLength>
<GridLength x:Key="TabPageRow1Width">8*</GridLength>
<GridLength x:Key="TabPageRow2Width">1*</GridLength>
<!-- *************************************************************************** -->
<!-- ** STYLES ** -->
<!-- ** TAB CONTROL ** -->
<Style TargetType="{x:Type TabControl}">
<Setter Property="SnapsToDevicePixels" Value="true"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="TabControl">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<!--
The Border around each TabItem will allow us to draw the line
between the TabItemPanel and the TabControl (resp. the
TabPage-container) when a TabItem is NOT selected, which
replaces the bottom line of the TabItemPanel's border.
Thus, we'll avoid drawing the bottom line for the selected
TabItem. Also, since the TabItem, when selected, applies a left
Margin of 4px, we need to add these here as Padding.
-->
<Border Background="{StaticResource TabControlBackgroundColor}"
Padding="5,10,0,5">
<!-- This is the area in which TabItems (the strips) will be drawn. -->
<TabPanel IsItemsHost="True"/>
</Border>
<!--
This is the outer border of the TabControl itself, actually meaning
the Panel that will host a TabItem's content.
The top-border here will not be drawn as, otherwise, the TabItemPanel
would always show a thin line for the selected Tab (which we want
to avoid).
-->
<Border BorderThickness="0"
Grid.Column="1"
Background="{StaticResource TabControlBackgroundColor}" >
<!-- This is the first/outer Border drawn on the TabPage -->
<Border BorderThickness="2"
BorderBrush="{StaticResource TabPageBorderColor}"
CornerRadius="5"
Margin="0,3,3,3">
<!--
This is the second/inner Border drawn on the TabPage.
This Border is drawn with a horizontal Gradient that is transparent
on the left which produces the fading effect.
-->
<Border BorderThickness="2"
BorderBrush="{StaticResource TabPageBorderColor_Shadow}"
Background="{StaticResource TabPageColor}"
CornerRadius="3"
Margin="0"
Padding="2"
>
<!--
This is where the Content of the selected TabPage
will be rendered.
-->
<ContentPresenter ContentSource="SelectedContent" Margin="0"/>
</Border>
</Border>
</Border>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<!-- ** Tab Item ** -->
<Style TargetType="{x:Type TabItem}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type TabItem}">
<!-- The Grid helps defining the general dimension of TabItems. -->
<Grid Width="{StaticResource TabHeaderWidth}" Height="{StaticResource TabHeaderHeight}" Margin="0,0,0,0">
<Border Name="Border"
BorderBrush="Black"
BorderThickness="2,2,0,2"
CornerRadius="4,0,0,4">
<Border.Effect>
<DropShadowEffect ShadowDepth="0" BlurRadius="10"/>
</Border.Effect>
<ContentPresenter x:Name="ContentSite"
VerticalAlignment="Stretch"
HorizontalAlignment="Stretch"
ContentSource="Header"
Margin="0"
RecognizesAccessKey="True"/>
</Border>
</Grid>
<ControlTemplate.Triggers>
<!--The appearance of a TabItem when it's inactive/unselected-->
<Trigger Property="IsSelected" Value="False">
<Setter Property="Panel.ZIndex" Value="90" />
<Setter TargetName="Border" Property="BorderBrush"
Value="Transparent" />
<Setter Property="Foreground"
Value="{StaticResource TabItemTextColor_Unselected}" />
<Setter Property="Effect" TargetName="Border" >
<Setter.Value>
<DropShadowEffect ShadowDepth="0" BlurRadius="0" />
</Setter.Value>
</Setter>
</Trigger>
<!--The appearance of a TabItem when it's active/selected-->
<Trigger Property="IsSelected" Value="True">
<!--We want the selected TabItem to always be on top.-->
<Setter Property="Panel.ZIndex" Value="100" />
<Setter TargetName="Border" Property="BorderBrush"
Value="{StaticResource TabItemBorderColor_Selected}" />
<Setter TargetName="Border" Property="Background"
Value="{StaticResource TabItemBackground_Selected}" />
<Setter Property="Foreground"
Value="{StaticResource TabItemTextColor_Selected}"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<!-- Tab Header Image Style -->
<Style TargetType="Image" x:Key="TabHeaderImage">
<Setter Property="Stretch" Value="Uniform"/>
<Setter Property="Grid.Column" Value="0"/>
</Style>
<!-- Tab Header TextBlock Style -->
<Style TargetType="TextBlock" x:Key="TabHeaderTextBlock">
<Setter Property="FontSize" Value="25"/>
<Setter Property="Grid.Column" Value="1"/>
<Setter Property="Padding" Value="0,17,0,0"/>
</Style>
<!-- *************************************************************************** -->
<!-- ** BUTTON ** -->
<Style TargetType="Button">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Button">
<Border Name="Border"
CornerRadius="5"
Background="{StaticResource ButtonBackGroundColor_Unselected}"
BorderThickness="2"
BorderBrush="{StaticResource ButtonBorderColor_Unselected}"
Margin="2">
<Border.Effect>
<DropShadowEffect ShadowDepth="0" BlurRadius="10"/>
</Border.Effect>
<ContentPresenter HorizontalAlignment="Center"
VerticalAlignment="Center">
</ContentPresenter>
</Border>
<ControlTemplate.Triggers>
<!--The appearance of a Button when it's pressed-->
<Trigger Property="IsPressed" Value="True">
<Setter Property="Panel.ZIndex" Value="90" />
<Setter TargetName="Border" Property="BorderBrush"
Value="Transparent" />
<Setter TargetName="Border" Property="Background"
Value="Transparent" />
<Setter Property="Foreground"
Value="{StaticResource ButtonTextColor_Selected}" />
<Setter Property="Effect" TargetName="Border" >
<Setter.Value>
<DropShadowEffect ShadowDepth="0" BlurRadius="0" />
</Setter.Value>
</Setter>
</Trigger>
<!--The appearance of a Button when it's not pressed-->
<Trigger Property="IsPressed" Value="False">
<Setter Property="Foreground"
Value="{StaticResource ButtonTextColor_Unselected}"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<!-- Button Image Style -->
<Style TargetType="Image" x:Key="ButtonImage">
<Setter Property="Stretch" Value="UniformToFill"/>
<Setter Property="Width" Value="35"/>
<Setter Property="Height" Value="35"/>
</Style>
<!-- Button TextBlock Style -->
<Style TargetType="TextBlock" x:Key="ButtonTextBlock">
<Setter Property="FontSize" Value="12"/>
<!--<Setter Property="Padding" Value="0,17,0,0"/>-->
<Setter Property="TextAlignment" Value="Center"/>
</Style>
<!-- *************************************************************************** -->
<!-- ** BORDER ** -->
<Style TargetType="Border" x:Key="CustomBorder">
<Setter Property="CornerRadius" Value="4"/>
<Setter Property="Background" Value="LightGray"/>
<Setter Property="BorderThickness" Value="2"/>
<Setter Property="BorderBrush" Value="DarkGray"/>
<Setter Property="Margin" Value="2" />
<Setter Property="Effect">
<Setter.Value>
<DropShadowEffect ShadowDepth="0" BlurRadius="10"/>
</Setter.Value>
</Setter>
</Style>
<!-- *************************************************************************** -->
<!-- ** TEXTBOX ** -->
<Style TargetType="{x:Type TextBox}" x:Key="NumericKeyboard">
<EventSetter Event="PreviewMouseDown" Handler="PreviewMouseDown"/>
</Style>
</ResourceDictionary>
+22
View File
@@ -0,0 +1,22 @@
Partial Class OmagCUTDictionary
Inherits ResourceDictionary
Dim MainWindowUC As MainWindow = Application.Current.MainWindow
Dim m_NumericKeyboardWD As NumericKeyboardWD
'TEXTBOX
Private Sub PreviewMouseDown(sender As Object, e As MouseButtonEventArgs)
m_NumericKeyboardWD = MainWindowUC.m_NumericKeyboardWD
m_NumericKeyboardWD.m_CurrentTxBx = e.Source
Dim AssocLabel As Label = m_NumericKeyboardWD.m_CurrentTxBx.Tag
If (Not IsNothing(AssocLabel)) Then
m_NumericKeyboardWD.m_CurrentLbl = AssocLabel.Content
End If
m_NumericKeyboardWD.Top = MainWindowUC.Top
m_NumericKeyboardWD.Left = MainWindowUC.Left
m_NumericKeyboardWD.Height = MainWindowUC.Height
m_NumericKeyboardWD.Width = MainWindowUC.Width
m_NumericKeyboardWD.Visibility = Visibility.Visible
End Sub
End Class
Binary file not shown.

After

Width:  |  Height:  |  Size: 5.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

+69
View File
@@ -0,0 +1,69 @@
<UserControl x:Class="TagliCadUC"
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="TagliCadUC_Loaded" Initialized="TagliCadUC_Initialized">
<!-- Chiamata al dizionario -->
<UserControl.Resources>
<ResourceDictionary Source="OmagCUTDictionary.xaml"/>
</UserControl.Resources>
<!-- Definizione della PAGINA TAGLI CAD -->
<Grid Name="BackGroundGridLavorazioniPiane">
<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>
<!-- Definizione barra dei tasti sopra -->
<UniformGrid Grid.ColumnSpan="2" Rows="1" Columns="12">
<!-- Definizione del Button Components -->
<Button Click="ComponentsBtnUC_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="Componenti" />
</StackPanel>
</Button>
<!-- Definizione del Button Zoom All -->
<Button Click="ZoomAllBtnUC_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="Zoom All" />
</StackPanel>
</Button>
<!-- Definizione del Button Lavora -->
<Button Click="LavoraBtnUC_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="Lavora" />
</StackPanel>
</Button>
<!-- Definizione del Button Grezzo -->
<Button Click="GrezzoBtnUC_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="Grezzo" />
</StackPanel>
</Button>
</UniformGrid>
<!-- Riferimento al User Control della barra dei tasti a destra -->
<ContentPresenter Grid.Column="1" Grid.Row="1" Grid.RowSpan="2" Name="RightBtnBarContent" />
</Grid>
</UserControl>
+41
View File
@@ -0,0 +1,41 @@
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
Private Sub TagliCadUC_Initialized(sender As Object, e As EventArgs)
m_BarLavoraUC = New BarLavoraUC
m_BarNestingUC = New BarNestingUC
End Sub
Private Sub TagliCadUC_Loaded(sender As Object, e As RoutedEventArgs)
RightBtnBarContent.Content = m_BarNestingUC
End Sub
Private Sub ComponentsBtnUC_Click(sender As Object, e As RoutedEventArgs)
RaiseEvent ComponentsBtnMW_Click(sender, e)
End Sub
Private Sub ZoomAllBtnUC_Click(sender As Object, e As RoutedEventArgs)
RaiseEvent ZoomAllBtnMW_Click(sender, e)
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
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)
End Sub
End Class
+26
View File
@@ -0,0 +1,26 @@
<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>
+3
View File
@@ -0,0 +1,3 @@
Public Class TagliDirettiUC
End Class
+23
View File
@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.diagnostics>
<sources>
<!-- This section defines the logging configuration for My.Application.Log -->
<source name="DefaultSource" switchName="DefaultSwitch">
<listeners>
<add name="FileLog"/>
<!-- Uncomment the below section to write to the Application Event Log -->
<!--<add name="EventLog"/>-->
</listeners>
</source>
</sources>
<switches>
<add name="DefaultSwitch" value="Information"/>
</switches>
<sharedListeners>
<add name="FileLog" type="Microsoft.VisualBasic.Logging.FileLogTraceListener, Microsoft.VisualBasic, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" initializeData="FileLogWriter"/>
<!-- Uncomment the below section and replace APPLICATION_NAME with the name of your application to write to the Application Event Log -->
<!--<add name="EventLog" type="System.Diagnostics.EventLogTraceListener" initializeData="APPLICATION_NAME"/> -->
</sharedListeners>
</system.diagnostics>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0,Profile=Client"/></startup></configuration>