Merge branch 'Features/Svuotature'
This commit is contained in:
@@ -0,0 +1,256 @@
|
||||
<UserControl x:Class="AlzFrontUC"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:EgtWPFLib="clr-namespace:EgtWPFLib;assembly=EgtWPFLib"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="768" d:DesignWidth="256">
|
||||
<!-- Definizione della Grid Laterale -->
|
||||
<Grid Name="VariablesCompoGrid" Grid.RowSpan="2">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="0.3*"/>
|
||||
<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*"/>
|
||||
<RowDefinition Height="0.2*"/>
|
||||
<RowDefinition Height="4*"/>
|
||||
<!--<RowDefinition Height="0.5*"/>
|
||||
<RowDefinition Height="0.5*"/>
|
||||
<RowDefinition Height="0.5*"/>-->
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<!--Titolo della colonna della ALZATINE-->
|
||||
<TextBlock Name="SideAngleBl" Grid.Row="0" Grid.Column="2" Text="Alz."
|
||||
Style="{StaticResource OmagCut_CenteredLowerCaseCharacterTextBlock}"
|
||||
FontSize="{DynamicResource FontSize_LowerCaseCharacter}"/>
|
||||
|
||||
<!--Titolo della colonna dei FRONTALINI-->
|
||||
<TextBlock Name="HeelBl" Grid.Row="0" Grid.Column="3" Text="Front."
|
||||
Style="{StaticResource OmagCut_CenteredLowerCaseCharacterTextBlock}"
|
||||
FontSize="{DynamicResource FontSize_LowerCaseCharacter}"/>
|
||||
|
||||
<TextBlock Name="Entity1" Grid.Row="1" Style="{StaticResource OmagCut_CenteredLowerCaseCharacterTextBlock}"/>
|
||||
<CheckBox Name="A1" Grid.Column="2" Grid.Row="1" Height="30" Width="40" HorizontalAlignment="Right"
|
||||
Margin="-10,0,0,0"/>
|
||||
<CheckBox Name="F1" Grid.Column="3" Grid.Row="1" Height="30" Width="40" HorizontalAlignment="Right"
|
||||
Margin="-10,0,0,0"/>
|
||||
|
||||
<!--<EgtWPFLib:EgtTextBox Name="A1TxBx" Grid.Column="2" Grid.Row="1" Width="60"
|
||||
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
|
||||
<EgtWPFLib:EgtTextBox Name="H1TxBx" Grid.Column="3" Grid.Row="1" Width="60"
|
||||
Style="{StaticResource OmagCut_CalculatorTextBox}"/>-->
|
||||
|
||||
<TextBlock Name="Entity2" Grid.Row="2" Style="{StaticResource OmagCut_CenteredLowerCaseCharacterTextBlock}"/>
|
||||
<CheckBox Name="A2" Grid.Column="2" Grid.Row="2" Height="30" Width="40" HorizontalAlignment="Right"
|
||||
Margin="-20,0,0,0"/>
|
||||
<CheckBox Name="F2" Grid.Column="3" Grid.Row="2" Height="30" Width="40" HorizontalAlignment="Right"
|
||||
Margin="-20,0,0,0"/>
|
||||
|
||||
<!--<EgtWPFLib:EgtTextBox Name="A2TxBx" Grid.Column="2" Grid.Row="2" Width="60"
|
||||
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
|
||||
<EgtWPFLib:EgtTextBox Name="H2TxBx" Grid.Column="3" Grid.Row="2" Width="60"
|
||||
Style="{StaticResource OmagCut_CalculatorTextBox}"/>-->
|
||||
|
||||
<TextBlock Name="Entity3" Grid.Row="3" Style="{StaticResource OmagCut_CenteredLowerCaseCharacterTextBlock}"/>
|
||||
<CheckBox Name="A3" Grid.Column="2" Grid.Row="3" Height="30" Width="40" HorizontalAlignment="Right"
|
||||
Margin="-20,0,0,0"/>
|
||||
<CheckBox Name="F3" Grid.Column="3" Grid.Row="3" Height="30" Width="40" HorizontalAlignment="Right"
|
||||
Margin="-20,0,0,0"/>
|
||||
|
||||
<!--<EgtWPFLib:EgtTextBox Name="A3TxBx" Grid.Column="2" Grid.Row="3" Width="60"
|
||||
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
|
||||
<EgtWPFLib:EgtTextBox Name="H3TxBx" Grid.Column="3" Grid.Row="3" Width="60"
|
||||
Style="{StaticResource OmagCut_CalculatorTextBox}"/>-->
|
||||
|
||||
<TextBlock Name="Entity4" Grid.Row="4" Style="{StaticResource OmagCut_CenteredLowerCaseCharacterTextBlock}"/>
|
||||
<CheckBox Name="A4" Grid.Column="2" Grid.Row="4" Height="30" Width="40" HorizontalAlignment="Right"
|
||||
Margin="-20,0,0,0"/>
|
||||
<CheckBox Name="F4" Grid.Column="3" Grid.Row="4" Height="30" Width="40" HorizontalAlignment="Right"
|
||||
Margin="-20,0,0,0"/>
|
||||
|
||||
<!--<EgtWPFLib:EgtTextBox Name="A4TxBx" Grid.Column="2" Grid.Row="4" Width="60"
|
||||
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
|
||||
<EgtWPFLib:EgtTextBox Name="H4TxBx" Grid.Column="3" Grid.Row="4" Width="60"
|
||||
Style="{StaticResource OmagCut_CalculatorTextBox}"/>-->
|
||||
|
||||
<TextBlock Name="Entity5" Grid.Row="5" Style="{StaticResource OmagCut_CenteredLowerCaseCharacterTextBlock}"/>
|
||||
<CheckBox Name="A5" Grid.Column="2" Grid.Row="5" Height="30" Width="40" HorizontalAlignment="Right"
|
||||
Margin="-20,0,0,0"/>
|
||||
<CheckBox Name="F5" Grid.Column="3" Grid.Row="5" Height="30" Width="40" HorizontalAlignment="Right"
|
||||
Margin="-20,0,0,0"/>
|
||||
|
||||
<!--<EgtWPFLib:EgtTextBox Name="A5TxBx" Grid.Column="2" Grid.Row="5" Width="60"
|
||||
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
|
||||
<EgtWPFLib:EgtTextBox Name="H5TxBx" Grid.Column="3" Grid.Row="5" Width="60"
|
||||
Style="{StaticResource OmagCut_CalculatorTextBox}"/>-->
|
||||
|
||||
<TextBlock Name="Entity6" Grid.Row="6" Style="{StaticResource OmagCut_CenteredLowerCaseCharacterTextBlock}"/>
|
||||
<CheckBox Name="A6" Grid.Column="2" Grid.Row="6" Height="30" Width="40" HorizontalAlignment="Right"
|
||||
Margin="-20,0,0,0"/>
|
||||
<CheckBox Name="F6" Grid.Column="3" Grid.Row="6" Height="30" Width="40" HorizontalAlignment="Right"
|
||||
Margin="-20,0,0,0"/>
|
||||
|
||||
<!--<EgtWPFLib:EgtTextBox Name="A6TxBx" Grid.Column="2" Grid.Row="6" Width="60"
|
||||
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
|
||||
<EgtWPFLib:EgtTextBox Name="H6TxBx" Grid.Column="3" Grid.Row="6" Width="60"
|
||||
Style="{StaticResource OmagCut_CalculatorTextBox}"/>-->
|
||||
|
||||
<TextBlock Name="Entity7" Grid.Row="7" Style="{StaticResource OmagCut_CenteredLowerCaseCharacterTextBlock}"/>
|
||||
<CheckBox Name="A7" Grid.Column="2" Grid.Row="7" Height="30" Width="40" HorizontalAlignment="Right"
|
||||
Margin="-20,0,0,0"/>
|
||||
<CheckBox Name="F7" Grid.Column="3" Grid.Row="7" Height="30" Width="40" HorizontalAlignment="Right"
|
||||
Margin="-20,0,0,0"/>
|
||||
|
||||
|
||||
<!--<EgtWPFLib:EgtTextBox Name="A7TxBx" Grid.Column="2" Grid.Row="7" Width="60"
|
||||
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
|
||||
<EgtWPFLib:EgtTextBox Name="H7TxBx" Grid.Column="3" Grid.Row="7" Width="60"
|
||||
Style="{StaticResource OmagCut_CalculatorTextBox}"/>-->
|
||||
|
||||
<TextBlock Name="Entity8" Grid.Row="8" Style="{StaticResource OmagCut_CenteredLowerCaseCharacterTextBlock}"/>
|
||||
<CheckBox Name="A8" Grid.Column="2" Grid.Row="8" Height="30" Width="40" HorizontalAlignment="Right"
|
||||
Margin="-20,0,0,0"/>
|
||||
<CheckBox Name="F8" Grid.Column="3" Grid.Row="8" Height="30" Width="40" HorizontalAlignment="Right"
|
||||
Margin="-20,0,0,0"/>
|
||||
|
||||
<!--<EgtWPFLib:EgtTextBox Name="A8TxBx" Grid.Column="2" Grid.Row="8" Width="60"
|
||||
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
|
||||
<EgtWPFLib:EgtTextBox Name="H8TxBx" Grid.Column="3" Grid.Row="8" Width="60"
|
||||
Style="{StaticResource OmagCut_CalculatorTextBox}"/>-->
|
||||
|
||||
<TextBlock Name="Entity9" Grid.Row="9" Style="{StaticResource OmagCut_CenteredLowerCaseCharacterTextBlock}"/>
|
||||
<CheckBox Name="A9" Grid.Column="2" Grid.Row="9" Height="30" Width="40" HorizontalAlignment="Right"
|
||||
Margin="-20,0,0,0"/>
|
||||
<CheckBox Name="F9" Grid.Column="3" Grid.Row="9" Height="30" Width="40" HorizontalAlignment="Right"
|
||||
Margin="-20,0,0,0"/>
|
||||
|
||||
<!--<EgtWPFLib:EgtTextBox Name="A9TxBx" Grid.Column="2" Grid.Row="9" Width="60"
|
||||
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
|
||||
<EgtWPFLib:EgtTextBox Name="H9TxBx" Grid.Column="3" Grid.Row="9" Width="60"
|
||||
Style="{StaticResource OmagCut_CalculatorTextBox}"/>-->
|
||||
|
||||
<TextBlock Name="Entity10" Grid.Row="10" Style="{StaticResource OmagCut_CenteredLowerCaseCharacterTextBlock}"/>
|
||||
<CheckBox Name="A10" Grid.Column="2" Grid.Row="10" Height="30" Width="40" HorizontalAlignment="Right"
|
||||
Margin="-20,0,0,0"/>
|
||||
|
||||
<CheckBox Name="F10" Grid.Column="3" Grid.Row="10" Height="30" Width="40" HorizontalAlignment="Right"
|
||||
Margin="-20,0,0,0"/>
|
||||
|
||||
<!--<EgtWPFLib:EgtTextBox Name="A10TxBx" Grid.Column="2" Grid.Row="10" Width="60"
|
||||
Margin="0,0,0,-2"
|
||||
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
|
||||
<EgtWPFLib:EgtTextBox Name="H10TxBx" Grid.Column="3" Grid.Row="10" Width="60"
|
||||
Margin="0,0,0,-2"
|
||||
Style="{StaticResource OmagCut_CalculatorTextBox}"/>-->
|
||||
|
||||
<Grid Grid.Column="0" Grid.Row="12" Grid.ColumnSpan="4">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="0.3*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
<!--<RowDefinition Height="1*"/>-->
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<TextBlock Name="Parameter1TxBl" Grid.Row="0" Grid.ColumnSpan="2"
|
||||
Text="Offset"
|
||||
Style="{StaticResource OmagCut_CenteredLowerCaseCharacterTextBlock}"
|
||||
FontSize="{DynamicResource FontSize_LowerCaseCharacter}"/>
|
||||
|
||||
<EgtWPFLib:EgtTextBox Name="Parameter1ATxBx"
|
||||
Grid.Column="2" Grid.Row="0"
|
||||
HorizontalAlignment="Right"
|
||||
Width="60" Height="30" Margin="0,0,0,0"
|
||||
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
|
||||
<EgtWPFLib:EgtTextBox Name="Parameter1FTxBx"
|
||||
Grid.Column="3" Grid.Row="0"
|
||||
HorizontalAlignment="Right"
|
||||
Width="60" Height="30" Margin="0,0,0,0"
|
||||
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
|
||||
|
||||
|
||||
<TextBlock Name="Parameter2TxBl" Grid.Row="1" Grid.ColumnSpan="2"
|
||||
Text="Offset2"
|
||||
Style="{StaticResource OmagCut_CenteredLowerCaseCharacterTextBlock}"
|
||||
FontSize="{DynamicResource FontSize_LowerCaseCharacter}"/>
|
||||
<EgtWPFLib:EgtTextBox Name="Parameter2ATxBx"
|
||||
Grid.Column="2" Grid.Row="1"
|
||||
HorizontalAlignment="Right"
|
||||
Width="60" Height="30" Margin="0,0,0,0"
|
||||
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
|
||||
<EgtWPFLib:EgtTextBox Name="Parameter2FTxBx"
|
||||
Grid.Column="3" Grid.Row="1"
|
||||
HorizontalAlignment="Right"
|
||||
Width="60" Height="30" Margin="0,0,0,0"
|
||||
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
|
||||
|
||||
<!--Gestisco nello spazio di una TextBox due TextBoxs--><!--
|
||||
<UniformGrid Rows="1" Grid.Column="2" Grid.Row="1" Grid.ColumnSpan="2" Width="90" >
|
||||
<EgtWPFLib:EgtTextBox Name="Parameter2aTxBx"
|
||||
Grid.Column="2" Grid.Row="12"
|
||||
Width="40" Height="30"
|
||||
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
|
||||
<EgtWPFLib:EgtTextBox Name="Parameter2bTxBx"
|
||||
Grid.Column="3" Grid.Row="12"
|
||||
Width="40" Height="30"
|
||||
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
|
||||
</UniformGrid>-->
|
||||
|
||||
|
||||
<!--<TextBlock Name="Parameter3TxBl" Grid.Row="2" Grid.ColumnSpan="2"
|
||||
Text="Affondamento"
|
||||
Style="{StaticResource OmagCut_CenteredLowerCaseCharacterTextBlock}"
|
||||
FontSize="{DynamicResource FontSize_LowerCaseCharacter}"/>
|
||||
<EgtWPFLib:EgtTextBox Name="Parameter3TxBx"
|
||||
Grid.Column="2" Grid.ColumnSpan="2" Grid.Row="2"
|
||||
Margin="0,0,0,-2"
|
||||
Width="85" Height="30"
|
||||
Style="{StaticResource OmagCut_CalculatorTextBox}"/>-->
|
||||
|
||||
<!--<TextBlock Name="Parameter4TxBl" Grid.Row="3" Grid.ColumnSpan="2"
|
||||
Text="Accorciamento"
|
||||
Style="{StaticResource OmagCut_CenteredLowerCaseCharacterTextBlock}"
|
||||
FontSize="{DynamicResource FontSize_LowerCaseCharacter}"/>
|
||||
<EgtWPFLib:EgtTextBox Name="Parameter4TxBx"
|
||||
Grid.Column="2" Grid.ColumnSpan="2" Grid.Row="3"
|
||||
Margin="0,0,0,-2"
|
||||
Width="85" Height="30"
|
||||
Style="{StaticResource OmagCut_CalculatorTextBox}"/>-->
|
||||
|
||||
<UniformGrid Columns="2" Grid.ColumnSpan="4" Grid.Row="2">
|
||||
<!--questo bottone è stato creato solo per garantire il corretto allinaemento-->
|
||||
<Button Name="Vuoto" Visibility="Hidden"/>
|
||||
<!--Bottone per tornare indietro alla selezione di CompoInterni e Alz&Front-->
|
||||
<Button Name="BackBtn"
|
||||
Style="{DynamicResource OmagCut_YellowIconButton}">
|
||||
<Image Source="{DynamicResource NumericKeyboardArrowImg}" Style="{StaticResource OmagCut_ButtonIcon}"/>
|
||||
</Button>
|
||||
</UniformGrid>
|
||||
|
||||
</Grid>
|
||||
|
||||
|
||||
|
||||
</Grid>
|
||||
|
||||
</UserControl>
|
||||
|
||||
@@ -0,0 +1,829 @@
|
||||
Imports System.Globalization
|
||||
Imports EgtUILib
|
||||
Imports EgtWPFLib
|
||||
|
||||
Public Class AlzFrontUC
|
||||
Private Const NUM_VAR As Integer = 10
|
||||
Private Const LUA_CMP_VARS As String = "CMP"
|
||||
Private Const LUA_CMP_DRAW As String = "CMP_Draw"
|
||||
Private Const INFO_VAR As String = "Var"
|
||||
Private Const INFO_CMP As String = "CMP"
|
||||
Private Const INFO_ID As String = "ID"
|
||||
Friend Const LUA_CMP_INDEX As String = LUA_CMP_VARS & ".Ind"
|
||||
Friend Const LUA_CMP_INTERNAL As String = LUA_CMP_VARS & ".Int"
|
||||
Friend Const LUA_REMOVEHOLE As String = "RemoveHole"
|
||||
|
||||
' Costanti layer componenti
|
||||
Friend Const COMPO_LAYER_AUX As String = "LayAux"
|
||||
Friend Const COMPO_LAYER_QUOTATURE As String = "Quotature"
|
||||
Friend Const COMPO_LAYER_ETICHETTE As String = "Etichette"
|
||||
|
||||
' nome della info riferita alle alzatine e ai frontalini (1=Alz, 2=Front, 0=niente)
|
||||
Private Const INFO_ALZFRONT As String = "AF"
|
||||
|
||||
' Properties
|
||||
Private m_sCompoDir As String = String.Empty
|
||||
Private m_sCompoName As String = String.Empty
|
||||
Friend m_bDrawOk As Boolean = False
|
||||
Private m_bFirst As Boolean = True
|
||||
|
||||
' Riferimento alla MainWindow
|
||||
Private m_MainWindow As MainWindow = DirectCast(Application.Current.MainWindow, MainWindow)
|
||||
' Riferimento alla pagina che ha aperto SideAngleUC
|
||||
Private m_CallingPage As MainWindow.Pages
|
||||
|
||||
' Gestione pagine
|
||||
Private Const MAX_LINES As Integer = 10
|
||||
' lista dei lati, in cui indico il tipo di entità da associare
|
||||
Private AlzFrontEntityList As New List(Of AlzFrontEntity)
|
||||
|
||||
' numero di lati presenti nella figura
|
||||
Private m_nCount As Integer = 0
|
||||
' numero di righe rese disponibili nella pagina -> m_nShow = min(m_nCount, MAX_LINE)
|
||||
Private m_nShow As Integer = MAX_LINES
|
||||
|
||||
Private bInternalSelection As Boolean = False
|
||||
|
||||
' raggio circoscritto al pezzo
|
||||
Private m_dBBoxRad As Double
|
||||
|
||||
Private Sub AlzFrontPage_Loaded(sender As Object, e As RoutedEventArgs) Handles Me.Loaded
|
||||
|
||||
m_MainWindow.m_DrawPageUC.m_ActiveComponentPage = DrawPageUC.Pages.AlzFront
|
||||
|
||||
' numero di elemnti presenti nella lista SideAngle/DripEntity
|
||||
m_nCount = 0
|
||||
' numero di righe rese disponibili nella pagina -> m_nShow = min(m_nCount, MAX_LINE)
|
||||
m_nShow = 0
|
||||
|
||||
' carico la lista dei lati della figura
|
||||
InitSides()
|
||||
' aggiorno la visualizzazione delle TextBox e dei CheckBox
|
||||
TxBlChBxView()
|
||||
' imposto lo stato delle checkbox
|
||||
SetCheck()
|
||||
|
||||
' nascondo il bottone Back della pagina Draw
|
||||
m_MainWindow.m_DrawPageUC.BackBtn.Visibility = Visibility.Hidden
|
||||
m_MainWindow.m_DrawPageUC.MessageGrid.Visibility = Visibility.Hidden
|
||||
' Abilito bottoni angoli di fianco e lavorazioni da sotto
|
||||
m_MainWindow.m_DrawPageUC.SideAngleBtn.IsEnabled = m_MainWindow.m_DrawPageUC.bEnableSideAngle
|
||||
m_MainWindow.m_DrawPageUC.FiloTopBtn.IsEnabled = m_MainWindow.m_CurrentMachine.bMilling
|
||||
m_MainWindow.m_DrawPageUC.EngraveBtn.IsEnabled = True
|
||||
m_MainWindow.m_DrawPageUC.DripCutBtn.IsEnabled = m_MainWindow.GetKeyOption(MainWindow.KEY_OPT.UNDER_CUT) And
|
||||
Not String.IsNullOrWhiteSpace(m_MainWindow.m_CurrentMachine.sCurrDripSaw)
|
||||
|
||||
' nome dei parametri condivisi
|
||||
Parameter1TxBl.Text = "Altezza"
|
||||
Parameter2TxBl.Text = "Delta angolo"
|
||||
|
||||
EgtZoom(ZM.ALL)
|
||||
End Sub
|
||||
|
||||
' carico la lista dei lati della figura corrente
|
||||
Private Sub InitSides()
|
||||
' pulisco la lista dei lati
|
||||
AlzFrontEntityList.Clear()
|
||||
|
||||
' Id del pezzo
|
||||
Dim PartId As Integer = GDB_ID.NULL
|
||||
' Id del loop eseterno
|
||||
Dim LoopId As Integer = GDB_ID.NULL
|
||||
' Id delle label
|
||||
Dim LabelId As Integer = GDB_ID.NULL
|
||||
|
||||
' definisco i valori delle altezza e degli angoli di spoglia per le alzatine e i frontalini (letti da file ini del programma)
|
||||
GetPrivateProfileString("Alz&Front", "A_Height", "0", Parameter1ATxBx.Text, m_MainWindow.GetIniFile)
|
||||
GetPrivateProfileString("Alz&Front", "F_Height", "0", Parameter1FTxBx.Text, m_MainWindow.GetIniFile)
|
||||
GetPrivateProfileString("Alz&Front", "A_DeltaAng", "0", Parameter2ATxBx.Text, m_MainWindow.GetIniFile)
|
||||
GetPrivateProfileString("Alz&Front", "F_DeltaAng", "0", Parameter2FTxBx.Text, m_MainWindow.GetIniFile)
|
||||
|
||||
' Imposto contesto corrente
|
||||
EgtSetCurrentContext(m_MainWindow.m_DrawPageUC.DrawScene.GetCtx())
|
||||
' Ricavo nome primo pezzo
|
||||
PartId = EgtGetFirstPart()
|
||||
' se non esiste un pezzo corrente allora esco
|
||||
If PartId = GDB_ID.NULL Then Return
|
||||
|
||||
' Recupero nome layer con geometria di contorno (esterno o interno) del pezzo
|
||||
LoopId = EgtGetFirstNameInGroup(EgtGetFirstPart(), NAME_OUTLOOP)
|
||||
|
||||
' Recupero il layer "Etichette" per inserirvi il nome dei lati
|
||||
LabelId = EgtGetFirstNameInGroup(EgtGetFirstPart(), COMPO_LAYER_ETICHETTE)
|
||||
If LabelId = GDB_ID.NULL Then
|
||||
LabelId = EgtCreateGroup(PartId)
|
||||
EgtSetName(LabelId, COMPO_LAYER_ETICHETTE)
|
||||
Else
|
||||
' se esistente allora lo svuoto
|
||||
EgtEmptyGroup(LabelId)
|
||||
End If
|
||||
EgtSetStatus(LabelId, GDB_ST.ON_)
|
||||
|
||||
'Determino se loop esterno o interno
|
||||
Dim sLoopName As String = ""
|
||||
Dim bOutLoop As Boolean = (EgtGetName(LoopId, sLoopName) AndAlso sLoopName = NAME_OUTLOOP)
|
||||
' Calcolo dimensione ingombro Loop
|
||||
Dim ptMin, ptMax As Point3d
|
||||
EgtGetBBoxGlob(LoopId, GDB_BB.STANDARD, ptMin, ptMax)
|
||||
' utilizzato per definire la dimensione dei caratteri delle label per i lati
|
||||
m_dBBoxRad = 0.5 * Point3d.DistXY(ptMin, ptMax)
|
||||
|
||||
' Recupero Id della curva del Loop Esterno
|
||||
Dim PrevLine As Integer = EgtGetLastInGroup(LoopId)
|
||||
Dim CurrLine As Integer = EgtGetFirstInGroup(LoopId)
|
||||
' Creo indice per numerare le entità in ImportPage
|
||||
Dim nEntityIndex As Integer = 1
|
||||
Dim nOtherIndex As Integer = 1
|
||||
|
||||
' inserisco il lato nella lista
|
||||
While CurrLine <> GDB_ID.NULL
|
||||
' escludo tutte le forme che non sono delle linee
|
||||
If EgtGetType(CurrLine) = GDB_TY.CRV_LINE Then
|
||||
' Aggiungo il lato alla lista di quelli su cui è possibile mettere una alzatina o un frontalino
|
||||
Dim sNameCurrLine As String = String.Empty
|
||||
Dim nInfo As Integer = 0
|
||||
EgtSetName(CurrLine, "A" & nEntityIndex.ToString)
|
||||
EgtGetName(CurrLine, sNameCurrLine)
|
||||
' inserisco la numerazione dei lati della figura
|
||||
AddTextToLine(sNameCurrLine, LabelId, CurrLine, 20, m_dBBoxRad, True)
|
||||
' recupero l'informazione
|
||||
EgtGetInfo(CurrLine, INFO_ALZFRONT, nInfo)
|
||||
If nInfo = 1 Then
|
||||
AlzFrontEntityList.Add(New AlzFrontEntity(sNameCurrLine, CurrLine, AlzFrontEntity.AlzFront.ALZATINA))
|
||||
ElseIf nInfo = 2 Then
|
||||
AlzFrontEntityList.Add(New AlzFrontEntity(sNameCurrLine, CurrLine, AlzFrontEntity.AlzFront.FRONTALINO))
|
||||
Else
|
||||
AlzFrontEntityList.Add(New AlzFrontEntity(sNameCurrLine, CurrLine))
|
||||
End If
|
||||
nEntityIndex += 1
|
||||
Else
|
||||
EgtSetName(CurrLine, "B" & nOtherIndex.ToString)
|
||||
nOtherIndex = nOtherIndex + 1
|
||||
End If
|
||||
|
||||
PrevLine = CurrLine
|
||||
CurrLine = EgtGetNext(CurrLine)
|
||||
End While
|
||||
|
||||
' Aggiorno numero di lati carciati
|
||||
m_nCount = AlzFrontEntityList.Count()
|
||||
' Aggiorno numero item visualizzati nella pagina iniziale
|
||||
m_nShow = Math.Min(m_nCount, MAX_LINES)
|
||||
|
||||
' Se non ci sono lati su cui operare, messaggio utente
|
||||
If LoopId <> GDB_ID.NULL Then
|
||||
If m_nCount = 0 Then
|
||||
If m_CallingPage = MainWindow.Pages.Draw Then
|
||||
m_MainWindow.m_DrawPageUC.MessageTxBx.Text = EgtMsg(MSG_DRAWPAGEUC + 7) ' Non ci sono lati modificabili
|
||||
m_MainWindow.m_DrawPageUC.MessageBrd.Background = Application.Current.FindResource("OmagCut_Yellow")
|
||||
Else
|
||||
m_MainWindow.m_ImportPageUC.MessageTxBx.Text = EgtMsg(MSG_DRAWPAGEUC + 7) ' Non ci sono lati modificabili
|
||||
m_MainWindow.m_ImportPageUC.MessageBrd.Background = Application.Current.FindResource("OmagCut_Yellow")
|
||||
End If
|
||||
Else
|
||||
If m_CallingPage = MainWindow.Pages.Draw Then
|
||||
m_MainWindow.m_DrawPageUC.MessageTxBx.Text = ""
|
||||
m_MainWindow.m_DrawPageUC.MessageBrd.Background = Brushes.Transparent
|
||||
Else
|
||||
m_MainWindow.m_ImportPageUC.MessageTxBx.Text = ""
|
||||
m_MainWindow.m_ImportPageUC.MessageBrd.Background = Brushes.Transparent
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
|
||||
|
||||
|
||||
End Sub
|
||||
|
||||
' Imposto la visibilità degli oggetti nella pagina: qui eseguo l'impaginazione
|
||||
Private Sub TxBlChBxView()
|
||||
|
||||
If m_nCount = 0 Then
|
||||
' nascondo il nome delle colonne
|
||||
SideAngleBl.Visibility = Windows.Visibility.Hidden
|
||||
HeelBl.Visibility = Windows.Visibility.Hidden
|
||||
Else
|
||||
' definisco il posizionamento del nome (Alz.) delle colonne all'interno della grigia
|
||||
Grid.SetRow(SideAngleBl, MAX_LINES - m_nShow)
|
||||
SideAngleBl.Text = "Alz."
|
||||
SideAngleBl.Visibility = Windows.Visibility.Visible
|
||||
' definisco il posizionamento del nome (Front.) delle colonne all'interno della grigia
|
||||
Grid.SetRow(HeelBl, MAX_LINES - m_nShow)
|
||||
HeelBl.Text = "Front."
|
||||
HeelBl.Visibility = Windows.Visibility.Visible
|
||||
End If
|
||||
|
||||
' Lati visibili
|
||||
For nI As Integer = 1 To m_nShow
|
||||
Dim Index As Integer = MAX_LINES - m_nShow + nI
|
||||
' definisco la visibilità della label
|
||||
GetTxBlFromIndex(Index).Visibility = Windows.Visibility.Visible
|
||||
GetTxBlFromIndex(Index).Text = "A" & nI.ToString
|
||||
GetChBxAlzFromIndex(Index).Visibility = Windows.Visibility.Visible
|
||||
GetChBxFrontFromIndex(Index).Visibility = Windows.Visibility.Visible
|
||||
' annulo le eventuali selezioni
|
||||
bInternalSelection = True
|
||||
GetChBxAlzFromIndex(Index).IsChecked = False
|
||||
bInternalSelection = True
|
||||
GetChBxFrontFromIndex(Index).IsChecked = False
|
||||
|
||||
' aggiungo i campi per allungare e accorciare i lati (adesso sostituito con le CheckBox)
|
||||
'GetAngleTxBxFromIndex(Index).Visibility = Windows.Visibility.Visible
|
||||
'GetHeelTxBxFromIndex(Index).Visibility = Windows.Visibility.Visible
|
||||
Next
|
||||
|
||||
' Lati nascosti: nascondo i lati partendo dall'alto (se ho 4 lati la prima TextBx disponibile è la settima -> 11-4 = 7 lati nascosti)
|
||||
For Index As Integer = 1 To MAX_LINES - m_nShow
|
||||
' definisco la visibilità della label
|
||||
GetTxBlFromIndex(Index).Visibility = Windows.Visibility.Hidden
|
||||
GetChBxAlzFromIndex(Index).Visibility = Windows.Visibility.Hidden
|
||||
GetChBxFrontFromIndex(Index).Visibility = Windows.Visibility.Hidden
|
||||
bInternalSelection = True
|
||||
GetChBxAlzFromIndex(Index).IsChecked = False
|
||||
bInternalSelection = True
|
||||
GetChBxFrontFromIndex(Index).IsChecked = False
|
||||
'GetAngleTxBxFromIndex(Index).Visibility = Windows.Visibility.Hidden
|
||||
'GetHeelTxBxFromIndex(Index).Visibility = Windows.Visibility.Hidden
|
||||
|
||||
Next
|
||||
bInternalSelection = False
|
||||
End Sub
|
||||
|
||||
Private Sub SetCheck()
|
||||
For IndexSide As Integer = 0 To AlzFrontEntityList.Count() - 1
|
||||
Dim sNameSide As String = AlzFrontEntityList(IndexSide).SideName
|
||||
Dim IndexCh As Integer = IndexSide + MAX_LINES - m_nShow + 1
|
||||
If AlzFrontEntityList(IndexSide).Type = AlzFrontEntity.AlzFront.ALZATINA Then
|
||||
bInternalSelection = True
|
||||
GetChBxAlzFromIndex(IndexCh).IsChecked = True
|
||||
ElseIf AlzFrontEntityList(IndexSide).Type = AlzFrontEntity.AlzFront.FRONTALINO Then
|
||||
bInternalSelection = True
|
||||
GetChBxFrontFromIndex(IndexCh).IsChecked = True
|
||||
End If
|
||||
Next
|
||||
bInternalSelection = False
|
||||
End Sub
|
||||
|
||||
|
||||
' Permette di aggiugere accanto alla linea passata
|
||||
Friend Function AddTextToLine(sText As String, TextLayer As Integer, CurrLine As Integer, dDistance As Double,
|
||||
dBBoxRad As Double, bTextExt As Boolean, Optional bRot As Boolean = False) As Integer
|
||||
' Calcolo altezza testo
|
||||
Dim dH As Double = 0.05 * dBBoxRad
|
||||
' Creo testo
|
||||
Dim nText As Integer = EgtCreateTextAdv(TextLayer, Point3d.ORIG(), 0, sText, "", 500, False, dH, 1, 0, INS_POS.MC)
|
||||
' Calcolo posizionamento
|
||||
' BBox del testo e suo centro
|
||||
Dim ptMinBBox As Point3d
|
||||
Dim ptMaxBBox As Point3d
|
||||
EgtGetBBox(nText, GDB_BB.STANDARD, ptMinBBox, ptMaxBBox)
|
||||
Dim ptMidBBox As Point3d
|
||||
ptMidBBox = Point3d.Media(ptMinBBox, ptMaxBBox)
|
||||
' Punto medio della curva
|
||||
Dim ptMid As Point3d
|
||||
EgtMidPoint(CurrLine, nText, ptMid)
|
||||
' Versore sul punto medio della curva
|
||||
Dim vtMid As Vector3d
|
||||
EgtMidVector(CurrLine, nText, vtMid)
|
||||
' versore perpendicolare alla CurrLine che punta verso il testo
|
||||
Dim vtOrto As New Vector3d(vtMid)
|
||||
If bTextExt Then
|
||||
vtOrto.Rotate(Vector3d.Z_AX(), -90)
|
||||
Else
|
||||
vtOrto.Rotate(Vector3d.Z_AX(), 90)
|
||||
End If
|
||||
' eventuale rotazione del testo
|
||||
Dim dRotAng As Double = 0
|
||||
If bRot Then
|
||||
dRotAng = Math.Atan2(vtMid.y, vtMid.x) * 180 / Math.PI
|
||||
Dim dSpecRotAng = dRotAng
|
||||
If dSpecRotAng > 91 Then
|
||||
dSpecRotAng -= 180
|
||||
ElseIf dSpecRotAng < -89 Then
|
||||
dSpecRotAng += 180
|
||||
End If
|
||||
EgtRotate(nText, Point3d.ORIG(), Vector3d.Z_AX(), dSpecRotAng)
|
||||
End If
|
||||
' vettore dal centro del BBox all'estremo più vicino
|
||||
Dim vtptExtptMC As Vector3d
|
||||
If bRot Then
|
||||
vtptExtptMC = New Vector3d(0, ptMidBBox.y - ptMinBBox.y, 0)
|
||||
vtptExtptMC.Rotate(Vector3d.Z_AX(), dRotAng)
|
||||
Else
|
||||
If bTextExt Then
|
||||
If vtMid.x > 0 Then
|
||||
If vtMid.y > 0 Then
|
||||
vtptExtptMC = ptMidBBox - New Point3d(ptMinBBox.x, ptMaxBBox.y, 0)
|
||||
Else
|
||||
vtptExtptMC = ptMidBBox - ptMaxBBox
|
||||
End If
|
||||
Else
|
||||
If vtMid.y > 0 Then
|
||||
vtptExtptMC = ptMidBBox - ptMinBBox
|
||||
Else
|
||||
vtptExtptMC = ptMidBBox - New Point3d(ptMaxBBox.x, ptMinBBox.y, 0)
|
||||
End If
|
||||
End If
|
||||
Else
|
||||
If vtMid.x > 0 Then
|
||||
If vtMid.y > 0 Then
|
||||
vtptExtptMC = ptMidBBox - New Point3d(ptMaxBBox.x, ptMinBBox.y, 0)
|
||||
Else
|
||||
vtptExtptMC = ptMidBBox - ptMinBBox
|
||||
End If
|
||||
Else
|
||||
If vtMid.y > 0 Then
|
||||
vtptExtptMC = ptMidBBox - ptMaxBBox
|
||||
Else
|
||||
vtptExtptMC = ptMidBBox - New Point3d(ptMinBBox.x, ptMaxBBox.y, 0)
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
' Calcolo il centro del testo
|
||||
Dim ptTextMC As Point3d = ptMid + vtOrto * (dDistance + (vtOrto * vtptExtptMC))
|
||||
EgtMove(nText, (ptTextMC - Point3d.ORIG()))
|
||||
Return nText
|
||||
End Function
|
||||
|
||||
#Region "CHIAMATA ALLE TEXT/CHECK/LABEL"
|
||||
Private Function GetChBxAlzFromIndex(Index As Integer) As CheckBox
|
||||
Select Case Index
|
||||
Case 1
|
||||
Return A1
|
||||
Case 2
|
||||
Return A2
|
||||
Case 3
|
||||
Return A3
|
||||
Case 4
|
||||
Return A4
|
||||
Case 5
|
||||
Return A5
|
||||
Case 6
|
||||
Return A6
|
||||
Case 7
|
||||
Return A7
|
||||
Case 8
|
||||
Return A8
|
||||
Case 9
|
||||
Return A9
|
||||
Case Else
|
||||
Return A10
|
||||
End Select
|
||||
End Function
|
||||
|
||||
Private Function GetChBxAalZFromName(sName As String) As CheckBox
|
||||
Select Case sName
|
||||
Case "A1"
|
||||
Return A1
|
||||
Case "A2"
|
||||
Return A2
|
||||
Case "A3"
|
||||
Return A3
|
||||
Case "A4"
|
||||
Return A4
|
||||
Case "A5"
|
||||
Return A5
|
||||
Case "A6"
|
||||
Return A6
|
||||
Case "A7"
|
||||
Return A7
|
||||
Case "A8"
|
||||
Return A8
|
||||
Case "A9"
|
||||
Return A9
|
||||
Case Else
|
||||
Return A10
|
||||
End Select
|
||||
End Function
|
||||
|
||||
Private Function GetChBxFrontFromIndex(Index As Integer) As CheckBox
|
||||
Select Case Index
|
||||
Case 1
|
||||
Return F1
|
||||
Case 2
|
||||
Return F2
|
||||
Case 3
|
||||
Return F3
|
||||
Case 4
|
||||
Return F4
|
||||
Case 5
|
||||
Return F5
|
||||
Case 6
|
||||
Return F6
|
||||
Case 7
|
||||
Return F7
|
||||
Case 8
|
||||
Return F8
|
||||
Case 9
|
||||
Return F9
|
||||
Case Else
|
||||
Return F10
|
||||
End Select
|
||||
End Function
|
||||
|
||||
Private Function GetChBxFrontFromName(sName As String) As CheckBox
|
||||
Select Case sName
|
||||
Case "F1"
|
||||
Return F1
|
||||
Case "F2"
|
||||
Return F2
|
||||
Case "F3"
|
||||
Return F3
|
||||
Case "F4"
|
||||
Return F4
|
||||
Case "F5"
|
||||
Return F5
|
||||
Case "F6"
|
||||
Return F6
|
||||
Case "F7"
|
||||
Return F7
|
||||
Case "F8"
|
||||
Return F8
|
||||
Case "F9"
|
||||
Return F9
|
||||
Case Else
|
||||
Return F10
|
||||
End Select
|
||||
End Function
|
||||
|
||||
'Private Function GetAngleTxBxFromIndex(Index As Integer) As EgtWPFLib.EgtTextBox
|
||||
' Select Case Index
|
||||
' Case 1
|
||||
' Return A1TxBx
|
||||
' Case 2
|
||||
' Return A2TxBx
|
||||
' Case 3
|
||||
' Return A3TxBx
|
||||
' Case 4
|
||||
' Return A4TxBx
|
||||
' Case 5
|
||||
' Return A5TxBx
|
||||
' Case 6
|
||||
' Return A6TxBx
|
||||
' Case 7
|
||||
' Return A7TxBx
|
||||
' Case 8
|
||||
' Return A8TxBx
|
||||
' Case 9
|
||||
' Return A9TxBx
|
||||
' Case Else
|
||||
' Return A10TxBx
|
||||
' End Select
|
||||
'End Function
|
||||
|
||||
'Private Function GetHeelTxBxFromIndex(Index As Integer) As EgtWPFLib.EgtTextBox
|
||||
' Select Case Index
|
||||
' Case 1
|
||||
' Return H1TxBx
|
||||
' Case 2
|
||||
' Return H2TxBx
|
||||
' Case 3
|
||||
' Return H3TxBx
|
||||
' Case 4
|
||||
' Return H4TxBx
|
||||
' Case 5
|
||||
' Return H5TxBx
|
||||
' Case 6
|
||||
' Return H6TxBx
|
||||
' Case 7
|
||||
' Return H7TxBx
|
||||
' Case 8
|
||||
' Return H8TxBx
|
||||
' Case 9
|
||||
' Return H9TxBx
|
||||
' Case Else
|
||||
' Return H10TxBx
|
||||
' End Select
|
||||
'End Function
|
||||
|
||||
Private Function GetTxBlFromIndex(Index As Integer) As TextBlock
|
||||
Select Case Index
|
||||
Case 1
|
||||
Return Entity1
|
||||
Case 2
|
||||
Return Entity2
|
||||
Case 3
|
||||
Return Entity3
|
||||
Case 4
|
||||
Return Entity4
|
||||
Case 5
|
||||
Return Entity5
|
||||
Case 6
|
||||
Return Entity6
|
||||
Case 7
|
||||
Return Entity7
|
||||
Case 8
|
||||
Return Entity8
|
||||
Case 9
|
||||
Return Entity9
|
||||
Case Else
|
||||
Return Entity10
|
||||
End Select
|
||||
End Function
|
||||
|
||||
#End Region ' Chiamata elle Text/Check/Label
|
||||
|
||||
#Region "SELEZIONE CHECKBOX"
|
||||
|
||||
' Per gestire la selezione/deselezione delle Alzatine
|
||||
Private Sub A_Checked(sender As Object, e As RoutedEventArgs) Handles A1.Checked, A2.Checked, A3.Checked, A4.Checked, A5.Checked, A6.Checked, A7.Checked, A8.Checked, A9.Checked, A10.Checked,
|
||||
A1.Unchecked, A2.Unchecked, A3.Unchecked, A4.Unchecked, A5.Unchecked, A6.Unchecked, A7.Unchecked, A8.Unchecked, A9.Unchecked, A10.Unchecked
|
||||
' recupero il nome della Check selezionata
|
||||
Dim bIsAlzatina As Boolean = True
|
||||
Dim sChName As String = DirectCast(sender, CheckBox).Name
|
||||
Dim bIsChecked As Boolean = DirectCast(sender, CheckBox).IsChecked
|
||||
Dim sSideName As String = GetSideFromCheck(sChName, bIsAlzatina)
|
||||
Dim sOppositeCheckBox As String = GetOppositeCheck(sChName, bIsAlzatina)
|
||||
' se la modifica della stato della checkbox avviene internamente al programma allora non devo eseguire nessun aggiornamento
|
||||
If bInternalSelection Then
|
||||
bInternalSelection = False
|
||||
Return
|
||||
End If
|
||||
RefreshList(sSideName, sOppositeCheckBox, bIsAlzatina, bIsChecked)
|
||||
|
||||
EgtZoom(ZM.ALL)
|
||||
End Sub
|
||||
|
||||
' Per gestire la selezione/deselezione dei Frontalini
|
||||
Private Sub F_Checked(sender As Object, e As RoutedEventArgs) Handles F1.Checked, F2.Checked, F3.Checked, F4.Checked, F5.Checked, F6.Checked, F7.Checked, F8.Checked, F9.Checked, F10.Checked,
|
||||
F1.Unchecked, F2.Unchecked, F3.Unchecked, F4.Unchecked, F5.Unchecked, F6.Unchecked, F7.Unchecked, F8.Unchecked, F9.Unchecked, F10.Unchecked
|
||||
' recupero il nome della Check selezionata
|
||||
Dim bIsAlzatina As Boolean = False
|
||||
Dim sChName As String = DirectCast(sender, CheckBox).Name
|
||||
Dim bIsChecked As Boolean = DirectCast(sender, CheckBox).IsChecked
|
||||
Dim sSideName As String = GetSideFromCheck(sChName, bIsAlzatina)
|
||||
Dim sOppositeCheckBox As String = GetOppositeCheck(sChName, bIsAlzatina)
|
||||
' se la modifica della stato della checkbox avviene internamente al programma allora non devo eseguire nessun aggiornamento
|
||||
If bInternalSelection Then
|
||||
bInternalSelection = False
|
||||
Return
|
||||
End If
|
||||
RefreshList(sSideName, sOppositeCheckBox, bIsAlzatina, bIsChecked)
|
||||
|
||||
EgtZoom(ZM.ALL)
|
||||
End Sub
|
||||
|
||||
#End Region ' Selezione CheckBox
|
||||
|
||||
#Region "ALTEZZA, DELTA ANGOLO DI SPOGLIA"
|
||||
|
||||
' altezza ALZATINA
|
||||
Private Sub ParameterA1TxBx_EgtClosed(sender As Object, e As EventArgs) Handles Parameter1ATxBx.EgtClosed
|
||||
' Nuovo angolo di inclinazione
|
||||
Dim dValue As Double
|
||||
StringToDouble(Parameter1ATxBx.Text, dValue)
|
||||
' salvo il valore nel file ini e inserisco il valore nel file lua
|
||||
WritePrivateProfileString("Alz&Front", "A_Height", Parameter1ATxBx.Text, m_MainWindow.GetIniFile())
|
||||
' aggiorno il disegno
|
||||
LoadCurrentCompo()
|
||||
End Sub
|
||||
|
||||
' altezza FRONTALINO
|
||||
Private Sub Parameter1FTxBx_EgtClosed(sender As Object, e As EventArgs) Handles Parameter1FTxBx.EgtClosed
|
||||
' Nuovo angolo di inclinazione
|
||||
Dim dValue As Double
|
||||
StringToDouble(Parameter1FTxBx.Text, dValue)
|
||||
' salvo il valore nel file ini e inserisco il valore nel file lua
|
||||
WritePrivateProfileString("Alz&Front", "F_Height", Parameter1FTxBx.Text, m_MainWindow.GetIniFile())
|
||||
' aggiorno il disegno
|
||||
LoadCurrentCompo()
|
||||
End Sub
|
||||
|
||||
' angolo di spoglia ALZATINA
|
||||
Private Sub ParameterA2TxBx_EgtClosed(sender As Object, e As EventArgs) Handles Parameter2ATxBx.EgtClosed
|
||||
' Nuovo angolo di inclinazione
|
||||
Dim dValue As Double
|
||||
StringToDouble(Parameter2ATxBx.Text, dValue)
|
||||
' salvo il valore nel file ini e inserisco il valore nel file lua
|
||||
WritePrivateProfileString("Alz&Front", "A_DeltaAng", Parameter2ATxBx.Text, m_MainWindow.GetIniFile())
|
||||
' aggiorno il disegno
|
||||
LoadCurrentCompo()
|
||||
End Sub
|
||||
|
||||
' angolo di spoglia FRONTALINO
|
||||
Private Sub Parameter2FTxBx_EgtClosed(sender As Object, e As EventArgs) Handles Parameter2FTxBx.EgtClosed
|
||||
' Nuovo angolo di inclinazione
|
||||
Dim dValue As Double
|
||||
StringToDouble(Parameter2FTxBx.Text, dValue)
|
||||
' salvo il valore nel file ini e inserisco il valore nel file lua
|
||||
WritePrivateProfileString("Alz&Front", "F_DeltaAng", Parameter2FTxBx.Text, m_MainWindow.GetIniFile())
|
||||
' aggiorno il disegno
|
||||
LoadCurrentCompo()
|
||||
End Sub
|
||||
|
||||
#End Region ' Altezza, delta angolo di spoglia
|
||||
|
||||
#Region "METHODS"
|
||||
|
||||
' noto il nome della checkbox (scritta nel codice xaml) selezionata restituisce il nome del lato (associato al disegno)
|
||||
Private Function GetSideFromCheck(sNameCheck As String, bIsAlz As Boolean) As String
|
||||
Dim sSideName As String = String.Empty
|
||||
Dim sTypeCheck As String = "A"
|
||||
If Not bIsAlz Then
|
||||
sTypeCheck = "F"
|
||||
End If
|
||||
' separo il nome in due
|
||||
Dim sItems As String() = Split(sNameCheck, sTypeCheck)
|
||||
Dim nIndex As Integer
|
||||
' costruisco il nome del lato
|
||||
If sItems.Count > 1 Then
|
||||
nIndex = CInt(sItems(1))
|
||||
nIndex = nIndex - (MAX_LINES - m_nShow)
|
||||
sSideName = "A" & nIndex.ToString
|
||||
End If
|
||||
|
||||
Return sSideName
|
||||
End Function
|
||||
|
||||
' restituisce il nome del check opposto (Se passo una alzaztina restituisco il nome della checbox del frontalino)
|
||||
Private Function GetOppositeCheck(sNameCheck As String, bIsAlz As Boolean) As String
|
||||
Dim sSideName As String = String.Empty
|
||||
Dim sTypeCheck As String = "A"
|
||||
If Not bIsAlz Then
|
||||
sTypeCheck = "F"
|
||||
End If
|
||||
' separo il nome in due
|
||||
Dim sItems As String() = Split(sNameCheck, sTypeCheck)
|
||||
|
||||
' estraggo l'indice del lato selezionato e costruisco il nome del CheckBox opposto
|
||||
If sItems.Count > 1 Then
|
||||
If bIsAlz Then
|
||||
sSideName = "F" & sItems(1).Trim
|
||||
Else
|
||||
sSideName = "A" & sItems(1).Trim
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
Return sSideName
|
||||
End Function
|
||||
|
||||
' aggiorno lo stato della dell'oggetto
|
||||
Private Sub RefreshList(sSideName As String, sOppositeNameCheck As String, bIsAlz As Boolean, bIsChecked As Boolean)
|
||||
For j As Integer = 0 To AlzFrontEntityList.Count() - 1
|
||||
If AlzFrontEntityList(j).SideName = sSideName Then
|
||||
' se deseleziono
|
||||
If Not bIsChecked Then
|
||||
AlzFrontEntityList(j).Type = AlzFrontEntity.AlzFront.NONE
|
||||
' insrisco l'informazione nelle info del lato
|
||||
EgtSetInfo(AlzFrontEntityList(j).Id, INFO_ALZFRONT, 0)
|
||||
Exit For
|
||||
End If
|
||||
' se selezione di Alz. o Front.
|
||||
If bIsAlz Then
|
||||
AlzFrontEntityList(j).Type = AlzFrontEntity.AlzFront.ALZATINA
|
||||
' deseleziono il Check opposto
|
||||
If GetChBxFrontFromName(sOppositeNameCheck).IsChecked Then
|
||||
bInternalSelection = True
|
||||
GetChBxFrontFromName(sOppositeNameCheck).IsChecked = False
|
||||
End If
|
||||
' insrisco l'informazione nelle info del lato
|
||||
EgtSetInfo(AlzFrontEntityList(j).Id, INFO_ALZFRONT, 1)
|
||||
Else
|
||||
AlzFrontEntityList(j).Type = AlzFrontEntity.AlzFront.FRONTALINO
|
||||
' deseleziono il Check opposto
|
||||
If GetChBxAalZFromName(sOppositeNameCheck).IsChecked Then
|
||||
bInternalSelection = True
|
||||
GetChBxAalZFromName(sOppositeNameCheck).IsChecked = False
|
||||
End If
|
||||
' inserisco l'informazione nelle info del lato
|
||||
EgtSetInfo(AlzFrontEntityList(j).Id, INFO_ALZFRONT, 2)
|
||||
End If
|
||||
' termino il ciclo
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
' questa funzione deve essere lanciata al termine di ogno selezione o modifica dei parametri di dimensione
|
||||
LoadCurrentCompo()
|
||||
End Sub
|
||||
|
||||
#End Region ' Methods
|
||||
|
||||
' eseguo il file per generare le Alzatine e i Frontalini (stesso file Lua)
|
||||
Private Sub LoadCurrentCompo()
|
||||
' !! ATTENZIONE !! : per problemi di spazio è stata spenta la text per stampare i messaggi (ma potrebbe servire?)
|
||||
' Pulisco l'ambiente lua
|
||||
EgtLuaResetGlobVar(LUA_CMP_VARS)
|
||||
EgtLuaResetGlobVar(LUA_CMP_DRAW)
|
||||
|
||||
Dim nCompoName As Integer
|
||||
Dim sCompoFile As String = ""
|
||||
Dim sCompoImage As String = ""
|
||||
|
||||
' recupero il nome del direttorio
|
||||
Dim sCompoDir As String = String.Empty
|
||||
GetPrivateProfileString("Alz&Front", K_COMPODIR, "", sCompoDir, m_MainWindow.GetIniFile())
|
||||
' leggo le info inserite nel campo "Alz&Front"
|
||||
m_MainWindow.m_DrawPageUC.m_MainComponentPage.GetPrivateProfileCompo("Alz&Front", "Alz&Front", nCompoName, sCompoFile, sCompoImage, m_MainWindow.GetIniFile())
|
||||
'Dim sCompoImageSource As ImageSource
|
||||
|
||||
' Costruisco path completa del componente
|
||||
Dim sPath = sCompoDir & "\" & sCompoFile
|
||||
' Carico il file
|
||||
EgtLuaExecFile(sPath)
|
||||
|
||||
' carico la lista di variabili
|
||||
Dim dVal As Double
|
||||
If StringToLen(Parameter1ATxBx.Text, dVal) Then
|
||||
EgtLuaSetGlobNumVar("CMP.A_Height", dVal)
|
||||
End If
|
||||
If StringToLen(Parameter1FTxBx.Text, dVal) Then
|
||||
EgtLuaSetGlobNumVar("CMP.F_Height", dVal)
|
||||
End If
|
||||
If StringToLen(Parameter2ATxBx.Text, dVal) Then
|
||||
EgtLuaSetGlobNumVar("CMP.A_DeltaAng", dVal)
|
||||
End If
|
||||
If StringToLen(Parameter2FTxBx.Text, dVal) Then
|
||||
EgtLuaSetGlobNumVar("CMP.F_DeltaAng", dVal)
|
||||
End If
|
||||
|
||||
Dim sMsg As String = String.Empty
|
||||
' eseguo la funzione per il disegno della componente (CMP_Draw)
|
||||
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
|
||||
' aggiorno la grafica
|
||||
EgtZoom(ZM.ALL)
|
||||
End Sub
|
||||
|
||||
|
||||
' metodo utilizzato per tornare indietro alla pagina di selezione "CompoInterni/Alz&Front"
|
||||
Private Sub BackBtn_Click(sender As Object, e As RoutedEventArgs) Handles BackBtn.Click
|
||||
m_MainWindow.m_DrawPageUC.m_SceneButtons.MeasureBtn.IsChecked = False
|
||||
|
||||
' torno alla pagina iniziale di selezione del piano (Compo)
|
||||
'm_MainWindow.m_DrawPageUC.BackBtn_Click(sender, e)
|
||||
|
||||
'--------- NUOVA GESTIONE ---------
|
||||
' rimuovo l'elenco di bottoni per selezionare il tipo di componente interna
|
||||
m_MainWindow.m_DrawPageUC.LeftButtonGrd.Children.Remove(Me)
|
||||
' inserisco nella Grid VaribalsesGrid lo UeserControl per definire le dimensioni della componente
|
||||
m_MainWindow.m_DrawPageUC.VariablesGrd.Children.Add(m_MainWindow.m_DrawPageUC.m_CompoDimension)
|
||||
' nascondo la lista dei parametri
|
||||
m_MainWindow.m_DrawPageUC.m_CompoDimension.CollapsedAllParam()
|
||||
' sto uscendo dalla componente interna (quindi comunico il cambio di componente)
|
||||
m_MainWindow.m_DrawPageUC.m_bInternalCompo = False
|
||||
' comunico che sto arrivando da una componente interna
|
||||
m_MainWindow.m_DrawPageUC.m_bBackFromInternalCompo = True
|
||||
|
||||
'm_MainWindow.m_DrawPageUC.SelectedComponent(m_MainWindow.m_DrawPageUC.m_sMainCompo)
|
||||
'm_MainWindow.m_DrawPageUC.m_ActiveComponentPage = DrawPageUC.Pages.CompoDimension
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
End Class
|
||||
|
||||
Public Class AlzFrontEntity
|
||||
Public Enum AlzFront
|
||||
ALZATINA
|
||||
FRONTALINO
|
||||
NONE
|
||||
End Enum
|
||||
|
||||
Private m_SideName As String
|
||||
Private m_Id As Integer
|
||||
Private m_Type As AlzFront = AlzFront.NONE
|
||||
|
||||
' nome del lato scritto nel file nge (il nome deve avere la forma: A1, A2, .., An)
|
||||
Public Property SideName As String
|
||||
Get
|
||||
Return m_SideName
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_SideName = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property Type As AlzFront
|
||||
Get
|
||||
Return m_Type
|
||||
End Get
|
||||
Set(value As AlzFront)
|
||||
m_Type = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property Id As Integer
|
||||
Get
|
||||
Return m_Id
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
m_Id = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Sub New(Name As String, CurrId As Integer, Optional CurrType As AlzFront = AlzFront.NONE)
|
||||
m_SideName = Name
|
||||
m_Id = CurrId
|
||||
m_Type = CurrType
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
@@ -26,7 +26,7 @@
|
||||
<RowDefinition Height="0.5*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
</Grid.RowDefinitions>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<TextBlock Name="Label1" Grid.Row="0"
|
||||
Style="{StaticResource OmagCut_CenteredLowerCaseCharacterTextBlock}"/>
|
||||
@@ -69,12 +69,18 @@
|
||||
<EgtWPFLib:EgtTextBox Name="TextBox10" Grid.Column="1" Grid.Row="9" Width="90"
|
||||
Style="{DynamicResource OmagCut_CalculatorTextBox}"/>
|
||||
|
||||
<Button Name="InternComponentBtn" Grid.Row="11" Grid.ColumnSpan="2"
|
||||
Style="{DynamicResource OmagCut_YellowTextButton}"/>
|
||||
<!--Per confermare l'inserimento CompoInterno-->
|
||||
<Button Name="AddBtn" Grid.Row="10" Style="{DynamicResource OmagCut_YellowTextButton}"/>
|
||||
<Button Name="CancelBtn" Grid.Column="1" Grid.Row="10" Style="{DynamicResource OmagCut_YellowTextButton}"/>
|
||||
|
||||
<Button Name="AddBtn" Grid.Row="10" Style="{DynamicResource OmagCut_YellowTextButton}"/>
|
||||
<Button Name="CancelBtn" Grid.Column="1" Grid.Row="10" Style="{DynamicResource OmagCut_YellowTextButton}"/>
|
||||
<!--Selezione delle componenti interne-->
|
||||
<Button Name="InternComponentBtn" Grid.Row="10" Grid.ColumnSpan="2"
|
||||
Style="{DynamicResource OmagCut_YellowTextButton}"/>
|
||||
|
||||
</Grid>
|
||||
<!--Selezione di Alz&Front-->
|
||||
<Button Name="AlzFrontBtn" Grid.Row="11" Grid.ColumnSpan="2"
|
||||
Style="{DynamicResource OmagCut_YellowTextButton}"/>
|
||||
|
||||
</Grid>
|
||||
|
||||
</UserControl>
|
||||
|
||||
@@ -13,15 +13,25 @@ Public Class CompoDimensionUC
|
||||
|
||||
' Riferimento alla pagina di selezione dei componenti interni
|
||||
Friend m_InternalCompoPage As InternalComponentPageUC
|
||||
' Riferimento alla pagina di selezione della alzatine
|
||||
Friend m_AlzFrontPage As AlzFrontUC
|
||||
|
||||
Private Sub CompoDimensionUC_Initialized(sender As Object, e As EventArgs) Handles Me.Initialized
|
||||
'Creazione delle Page UserControl
|
||||
'Creazione delle Page UserControl (per le componenti interne)
|
||||
m_InternalCompoPage = New InternalComponentPageUC
|
||||
'Posizionemento nella griglia delle Page UserControl
|
||||
'Posizionemento nella griglia delle Page UserControl
|
||||
m_InternalCompoPage.SetValue(Grid.ColumnSpanProperty, 2)
|
||||
m_InternalCompoPage.SetValue(Grid.RowSpanProperty, 4)
|
||||
|
||||
'Creazione della Page UserControl (per le alzatine e i frontalini)
|
||||
m_AlzFrontPage = New AlzFrontUC
|
||||
'Posizionamento nella griglia della Page UserControl
|
||||
m_AlzFrontPage.SetValue(Grid.ColumnSpanProperty, 2)
|
||||
m_AlzFrontPage.SetValue(Grid.RowSpanProperty, 4)
|
||||
|
||||
' definisco il nome dei comandi presenti nella pagine
|
||||
InternComponentBtn.Content = EgtMsg(MSG_COMPONENTPAGEUC + 47) ' Componenti interni
|
||||
AlzFrontBtn.Content = "Alzatine & Frontalini"
|
||||
AddBtn.Content = EgtMsg(MSG_COMPONENTPAGEUC + 48) ' Aggiungi
|
||||
CancelBtn.Content = EgtMsg(MSG_COMPONENTPAGEUC + 49) ' Rimuovi
|
||||
End Sub
|
||||
@@ -33,6 +43,19 @@ Public Class CompoDimensionUC
|
||||
' Imposto questa come pagina correntemente visualizzata nella drawpage
|
||||
m_DrawPage.m_ActiveComponentPage = DrawPageUC.Pages.CompoDimension
|
||||
|
||||
' se arrivo dalla pagina delle componenti interne allora esco (non devo ricalcolare i parametri)
|
||||
If m_DrawPage.m_bBackFromInternalCompo Then
|
||||
ShowInternalBtn(True)
|
||||
ShowAlzFrontBtn(True)
|
||||
' Se componente interno visualizzo bottoni aggiungi rimuovi
|
||||
ShowAddRemoveBtn(m_DrawPage.m_bInternalCompo)
|
||||
' Imposto contesto corrente e faccio uno ZoomAll della scena con il componente
|
||||
EgtSetCurrentContext(m_MainWindow.m_DrawPageUC.DrawScene.GetCtx())
|
||||
EgtZoom(ZM.ALL)
|
||||
' termino il caricamento della pagina
|
||||
Return
|
||||
End If
|
||||
|
||||
' Se componente interno disabilito il bottone di ok della drawpage
|
||||
If m_DrawPage.m_bInternalCompo Then
|
||||
m_DrawPage.OkBtn.IsEnabled = False
|
||||
@@ -41,8 +64,10 @@ Public Class CompoDimensionUC
|
||||
If m_DrawPage.sCompoName.StartsWith("PCucina") Or
|
||||
m_DrawPage.sCompoName.StartsWith("PBagno") Then
|
||||
ShowInternalBtn(True)
|
||||
ShowAlzFrontBtn(True)
|
||||
Else
|
||||
ShowInternalBtn(False)
|
||||
ShowAlzFrontBtn(False)
|
||||
End If
|
||||
|
||||
' Se componente interno visualizzo bottoni aggiungi rimuovi
|
||||
@@ -58,6 +83,7 @@ Public Class CompoDimensionUC
|
||||
m_DrawPage.OkBtn.IsEnabled = True
|
||||
End Sub
|
||||
|
||||
' rende visibile il bottone per inserire le componenti interne: solo nella pagine delle componenti
|
||||
Friend Sub ShowInternalBtn(value As Boolean)
|
||||
If value Then
|
||||
InternComponentBtn.Visibility = Windows.Visibility.Visible
|
||||
@@ -66,6 +92,16 @@ Public Class CompoDimensionUC
|
||||
End If
|
||||
End Sub
|
||||
|
||||
' rende visibile il bottone per inserire le azatine e i frontalini: solo nella pagina delle componenti
|
||||
Friend Sub ShowAlzFrontBtn(ByVal value As Boolean)
|
||||
If value Then
|
||||
AlzFrontBtn.Visibility = Visibility.Visible
|
||||
Else
|
||||
AlzFrontBtn.Visibility = Visibility.Hidden
|
||||
End If
|
||||
End Sub
|
||||
|
||||
' definisce se rendere visbile oppure no i bottone "Aggiungi" e "Rimuovi": presenti solo nella componenti interne
|
||||
Friend Sub ShowAddRemoveBtn(value As Boolean)
|
||||
If value Then
|
||||
m_DrawPage.SideAngleBtn.IsEnabled = False
|
||||
@@ -233,7 +269,18 @@ Public Class CompoDimensionUC
|
||||
m_DrawPage.UpdateView()
|
||||
End Sub
|
||||
|
||||
Public Sub CollapsedAllParam()
|
||||
For i As Integer = 1 To NUM_VAR
|
||||
GetNameEdit(i).Visibility = Visibility.Collapsed
|
||||
GetValueEdit(i).Visibility = Visibility.Collapsed
|
||||
Next
|
||||
End Sub
|
||||
|
||||
#Region "METHODS for InternalCompo"
|
||||
|
||||
' visualizzo la pagina per la selezione delle componenti interne
|
||||
Private Sub InternComponentBtn_Click(sender As Object, e As RoutedEventArgs) Handles InternComponentBtn.Click
|
||||
m_DrawPage.m_bBackFromInternalCompo = False
|
||||
' imposto contesto
|
||||
EgtSetCurrentContext(m_DrawPage.DrawScene.GetCtx())
|
||||
' Nascondo layer etichette e quotature
|
||||
@@ -248,6 +295,25 @@ Public Class CompoDimensionUC
|
||||
m_DrawPage.LeftButtonGrd.Children.Add(m_InternalCompoPage)
|
||||
End Sub
|
||||
|
||||
' visualizzo la pagina per la selezione delle componenti interne
|
||||
Private Sub AlzFrontBtn_Click(sender As Object, e As RoutedEventArgs) Handles AlzFrontBtn.Click
|
||||
m_DrawPage.m_bBackFromInternalCompo = False
|
||||
' imposto contesto
|
||||
EgtSetCurrentContext(m_DrawPage.DrawScene.GetCtx())
|
||||
' Nascondo layer etichette e quotature
|
||||
Dim Pz As Integer = EgtGetFirstGroupInGroup(GDB_ID.ROOT)
|
||||
EgtSetStatus(EgtGetFirstNameInGroup(Pz, "LayAux"), GDB_ST.OFF)
|
||||
EgtSetStatus(EgtGetFirstNameInGroup(Pz, "Etichette"), GDB_ST.OFF)
|
||||
EgtSetStatus(EgtGetFirstNameInGroup(Pz, "Quotature"), GDB_ST.OFF)
|
||||
EgtDraw()
|
||||
|
||||
m_DrawPage.VariablesGrd.Children.Remove(Me)
|
||||
m_DrawPage.m_bInternalCompo = True
|
||||
m_DrawPage.LeftButtonGrd.Children.Add(m_AlzFrontPage)
|
||||
End Sub
|
||||
|
||||
|
||||
' Bottone utilizzato per inserire le componenti interne
|
||||
Private Sub AddBtn_Click(sender As Object, e As RoutedEventArgs) Handles AddBtn.Click
|
||||
' Se componente errato, non faccio alcunché
|
||||
If Not m_DrawPage.m_bDrawOk Then Return
|
||||
@@ -266,15 +332,10 @@ Public Class CompoDimensionUC
|
||||
End While
|
||||
End If
|
||||
' Esco dalla pagina
|
||||
m_DrawPage.VariablesGrd.Children.Remove(Me)
|
||||
m_DrawPage.LeftButtonGrd.Children.Add(m_InternalCompoPage)
|
||||
' Reset componente
|
||||
m_MainWindow.m_DrawPageUC.ResetCompoName()
|
||||
' Deseleziono oggetto corrente e aggiorno visualizzazione
|
||||
EgtDeselectAll()
|
||||
EgtDraw()
|
||||
ExitInternalVariable()
|
||||
End Sub
|
||||
|
||||
' annulla l'inserimento della componente corrente
|
||||
Private Sub CancelBtn_Click(sender As Object, e As RoutedEventArgs) Handles CancelBtn.Click
|
||||
' Cancello layer con contorno errato
|
||||
Dim nId As Integer = EgtGetFirstNameInGroup(EgtGetFirstGroupInGroup(GDB_ID.ROOT), "ErrorLay")
|
||||
@@ -292,7 +353,13 @@ Public Class CompoDimensionUC
|
||||
Else
|
||||
m_DrawPage.m_bDrawOk = True
|
||||
End If
|
||||
' Sistemo interfaccia
|
||||
' Esco dalla pagina
|
||||
ExitInternalVariable()
|
||||
End Sub
|
||||
|
||||
' Esco dalla pagine delle variabili della componente interna: reimposto la pagina della componenti interne
|
||||
Private Sub ExitInternalVariable()
|
||||
' Esco dalla pagina
|
||||
m_DrawPage.VariablesGrd.Children.Remove(Me)
|
||||
m_DrawPage.LeftButtonGrd.Children.Add(m_InternalCompoPage)
|
||||
' Reset componente
|
||||
@@ -302,4 +369,5 @@ Public Class CompoDimensionUC
|
||||
EgtDraw()
|
||||
End Sub
|
||||
|
||||
#End Region ' METHODS for InternalCompo
|
||||
End Class
|
||||
|
||||
@@ -30,8 +30,9 @@ Public Class DrawPageUC
|
||||
Friend m_SideAngleUC As SideAngleUC
|
||||
Friend m_FiloTopUC As FiloTopUC
|
||||
|
||||
' Variabile che indica se componenti interni o esterni
|
||||
' Variabile che indica se componenti interni o esterni (usato anche per definire le alzatine e i fronatlini)
|
||||
Friend m_bInternalCompo As Boolean = False
|
||||
Friend m_bBackFromInternalCompo As Boolean = False
|
||||
|
||||
' Properties
|
||||
Private m_sCompoDir As String = String.Empty
|
||||
@@ -40,6 +41,10 @@ Public Class DrawPageUC
|
||||
Friend m_bDrawOk As Boolean = False
|
||||
Private m_bFirst As Boolean = True
|
||||
|
||||
' questa variabile serve per risalire al nome della componente che ospita i componenti interni att
|
||||
Friend m_sMainCompo As String = String.Empty
|
||||
|
||||
|
||||
' Trf Data
|
||||
Private m_bTrfData As Boolean = False
|
||||
Private m_TrfOrderCode As String = ""
|
||||
@@ -109,6 +114,7 @@ Public Class DrawPageUC
|
||||
CompoDimension
|
||||
SideAngle
|
||||
FiloTop
|
||||
AlzFront
|
||||
End Enum
|
||||
|
||||
Private Sub DrawPage_Initialized(sender As Object, e As EventArgs)
|
||||
@@ -179,6 +185,7 @@ Public Class DrawPageUC
|
||||
|
||||
End Sub
|
||||
|
||||
' carico le impostazioni grafiche della scena (solo al primo avvio)
|
||||
Private Sub DrawPage_Loaded(sender As Object, e As RoutedEventArgs)
|
||||
|
||||
If m_bFirst Then
|
||||
@@ -264,16 +271,20 @@ Public Class DrawPageUC
|
||||
m_sCsvName = ""
|
||||
End Sub
|
||||
|
||||
' recupero il click sulla scena ed assegno il metodo a secondo della pagina aperta
|
||||
Private Sub OnMouseDownScene(sender As Object, e As System.Windows.Forms.MouseEventArgs) Handles DrawScene.OnMouseDownScene
|
||||
' Si può selezionare solo con il tasto sinistro e se stato NULL
|
||||
If e.Button <> Windows.Forms.MouseButtons.Left Or Not DrawScene.IsStatusNull() Then Return
|
||||
' Si può selezionare solo se non si sta già editando un componente
|
||||
If m_ActiveComponentPage = Pages.InternalComponent Then
|
||||
OnMouseDownSceneInternalComponent( e)
|
||||
OnMouseDownSceneInternalComponent(e)
|
||||
ElseIf m_ActiveComponentPage = Pages.SideAngle Then
|
||||
OnMouseDownSceneSideAngle( e)
|
||||
OnMouseDownSceneSideAngle(e)
|
||||
ElseIf m_ActiveComponentPage = Pages.FiloTop Then
|
||||
OnMouseDownSceneFiloTop( e)
|
||||
OnMouseDownSceneFiloTop(e)
|
||||
ElseIf m_ActiveComponentPage = Pages.AlzFront Then
|
||||
' da definire
|
||||
|
||||
End If
|
||||
End Sub
|
||||
|
||||
@@ -497,6 +508,7 @@ Public Class DrawPageUC
|
||||
If sCompo = m_sCompoName Then
|
||||
Return
|
||||
End If
|
||||
|
||||
m_sCompoName = sCompo
|
||||
' Pulisco l'ambiente lua
|
||||
ResetLuaVariables()
|
||||
@@ -858,6 +870,9 @@ Public Class DrawPageUC
|
||||
End Function
|
||||
|
||||
Private Sub OkBtn_Click(sender As Object, e As RoutedEventArgs) Handles OkBtn.Click
|
||||
m_bBackFromInternalCompo = False
|
||||
m_bInternalCompo = False
|
||||
|
||||
m_SceneButtons.MeasureBtn.IsChecked = False
|
||||
' se sto definendo un componente interno non posso uscire
|
||||
If m_ActiveComponentPage = Pages.CompoDimension And m_bInternalCompo Then Return
|
||||
@@ -876,7 +891,9 @@ Public Class DrawPageUC
|
||||
' Reset inclinazioni
|
||||
m_SideAngleUC.DeleteSideAngle()
|
||||
' Chiudo compo interni nel caso siano aperti
|
||||
LeftButtonGrd.Children.Remove(m_MainComponentPage.m_SecondaryComponentPage)
|
||||
LeftButtonGrd.Children.Remove(m_CompoDimension.m_InternalCompoPage)
|
||||
LeftButtonGrd.Children.Remove(m_CompoDimension.m_AlzFrontPage)
|
||||
' Istruzioni per chiudere ImportPageUC e aprire CadCutPageUC
|
||||
m_MainWindow.MainWindowGrid.Children.Remove(m_MainWindow.m_DrawPageUC)
|
||||
m_MainWindow.MainWindowGrid.Children.Add(m_MainWindow.m_CurrentProjectPageUC)
|
||||
@@ -884,7 +901,11 @@ Public Class DrawPageUC
|
||||
|
||||
End Sub
|
||||
|
||||
' esco dalla pagina corrente
|
||||
Private Sub ExitBtn_Click(sender As Object, e As RoutedEventArgs) Handles ExitBtn.Click
|
||||
m_bBackFromInternalCompo = False
|
||||
m_bInternalCompo = False
|
||||
|
||||
m_SceneButtons.MeasureBtn.IsChecked = False
|
||||
' Elimino nome del componente precedente
|
||||
m_sCompoName = String.Empty
|
||||
@@ -893,6 +914,7 @@ Public Class DrawPageUC
|
||||
' Chiudo compo secondari e interni nel caso siano aperti
|
||||
LeftButtonGrd.Children.Remove(m_MainComponentPage.m_SecondaryComponentPage)
|
||||
LeftButtonGrd.Children.Remove(m_CompoDimension.m_InternalCompoPage)
|
||||
LeftButtonGrd.Children.Remove(m_CompoDimension.m_AlzFrontPage)
|
||||
' Istruzioni per chiudere ImportPageUC e aprire CadCutPageUC
|
||||
m_MainWindow.MainWindowGrid.Children.Remove(m_MainWindow.m_DrawPageUC)
|
||||
m_MainWindow.MainWindowGrid.Children.Add(m_MainWindow.m_CurrentProjectPageUC)
|
||||
@@ -926,6 +948,9 @@ Public Class DrawPageUC
|
||||
ElseIf m_ActiveComponentPage = Pages.InternalComponent Then
|
||||
m_PrevSideAnglePage = Pages.InternalComponent
|
||||
LeftButtonGrd.Children.Remove(m_CompoDimension.m_InternalCompoPage)
|
||||
ElseIf m_ActiveComponentPage = Pages.AlzFront Then
|
||||
m_PrevSideAnglePage = Pages.AlzFront
|
||||
LeftButtonGrd.Children.Remove(m_CompoDimension.m_AlzFrontPage)
|
||||
End If
|
||||
VariablesGrd.Children.Add(m_SideAngleUC)
|
||||
FiloTopBtn.IsEnabled = False
|
||||
@@ -987,6 +1012,9 @@ Public Class DrawPageUC
|
||||
ElseIf m_ActiveComponentPage = Pages.InternalComponent Then
|
||||
m_PrevSideAnglePage = Pages.InternalComponent
|
||||
LeftButtonGrd.Children.Remove(m_CompoDimension.m_InternalCompoPage)
|
||||
ElseIf m_ActiveComponentPage = Pages.AlzFront Then
|
||||
m_PrevSideAnglePage = Pages.AlzFront
|
||||
LeftButtonGrd.Children.Remove(m_CompoDimension.m_AlzFrontPage)
|
||||
End If
|
||||
VariablesGrd.Children.Add(m_SideAngleUC)
|
||||
FiloTopBtn.IsEnabled = False
|
||||
@@ -1045,6 +1073,9 @@ Public Class DrawPageUC
|
||||
ElseIf m_ActiveComponentPage = Pages.InternalComponent Then
|
||||
m_PrevSideAnglePage = Pages.InternalComponent
|
||||
LeftButtonGrd.Children.Remove(m_CompoDimension.m_InternalCompoPage)
|
||||
ElseIf m_ActiveComponentPage = Pages.AlzFront Then
|
||||
m_PrevSideAnglePage = Pages.AlzFront
|
||||
LeftButtonGrd.Children.Remove(m_CompoDimension.m_AlzFrontPage)
|
||||
End If
|
||||
VariablesGrd.Children.Add(m_SideAngleUC)
|
||||
SideAngleBtn.IsEnabled = False
|
||||
@@ -1098,10 +1129,13 @@ Public Class DrawPageUC
|
||||
' Imposto modalità
|
||||
If m_ActiveComponentPage = Pages.CompoDimension Then
|
||||
m_PrevSideAnglePage = Pages.CompoDimension
|
||||
VariablesGrd.Children.Remove( m_CompoDimension)
|
||||
VariablesGrd.Children.Remove(m_CompoDimension)
|
||||
ElseIf m_ActiveComponentPage = Pages.InternalComponent Then
|
||||
m_PrevSideAnglePage = Pages.InternalComponent
|
||||
LeftButtonGrd.Children.Remove( m_CompoDimension.m_InternalCompoPage)
|
||||
LeftButtonGrd.Children.Remove(m_CompoDimension.m_InternalCompoPage)
|
||||
ElseIf m_ActiveComponentPage = Pages.AlzFront Then
|
||||
m_PrevSideAnglePage = Pages.AlzFront
|
||||
LeftButtonGrd.Children.Remove(m_CompoDimension.m_AlzFrontPage)
|
||||
End If
|
||||
VariablesGrd.Children.Add( m_FiloTopUC)
|
||||
SideAngleBtn.IsEnabled = False
|
||||
@@ -1159,7 +1193,7 @@ Public Class DrawPageUC
|
||||
Case Pages.SideAngle
|
||||
VariablesGrd.Children.Remove( m_SideAngleUC)
|
||||
Case Pages.FiloTop
|
||||
VariablesGrd.Children.Remove( m_FiloTopUC)
|
||||
VariablesGrd.Children.Remove(m_FiloTopUC)
|
||||
End Select
|
||||
|
||||
' Pulisco l'ambiente lua
|
||||
|
||||
@@ -17,9 +17,10 @@ Public Class InternalComponentPageUC
|
||||
m_bIsFirstPage = True
|
||||
LoadPage()
|
||||
CurrentBtn = Nothing
|
||||
' bottone per selezionare la seconda pagina di componenti interni
|
||||
Compo9.SetValue(Grid.ColumnProperty, 0)
|
||||
Compo9.SetValue(Grid.ColumnSpanProperty, 2)
|
||||
LabelCompo9.Text = EgtMsg(MSG_COMPONENTPAGEUC + 9)
|
||||
LabelCompo9.Text = EgtMsg(MSG_COMPONENTPAGEUC + 9) ' Altri
|
||||
ImageCompo9.Visibility = Windows.Visibility.Hidden
|
||||
LabelCompo9.Visibility = Windows.Visibility.Visible
|
||||
' Se i componenti interni sono più di 8 viene visualizzato il bottone "Altri" altrimenti no
|
||||
@@ -284,7 +285,8 @@ Public Class InternalComponentPageUC
|
||||
' Verifico presenza immagine e la aggiungo
|
||||
If sCompoImage.Length <> 0 Then
|
||||
Try
|
||||
sCompoImageSource = ImageConverter.ConvertFromString(m_MainWindow.GetResourcesDir() & "\" & sCompoImage)
|
||||
Dim sPath As String = m_MainWindow.GetResourcesDir() & "\" & sCompoImage
|
||||
sCompoImageSource = ImageConverter.ConvertFromString(sPath)
|
||||
GetImage(index).Height = 65
|
||||
GetImage(index).Width = 65
|
||||
GetImage(index).Source = sCompoImageSource
|
||||
@@ -364,7 +366,24 @@ Public Class InternalComponentPageUC
|
||||
|
||||
Private Sub BackBtn_Click(sender As Object, e As RoutedEventArgs) Handles BackBtn.Click
|
||||
m_MainWindow.m_DrawPageUC.m_SceneButtons.MeasureBtn.IsChecked = False
|
||||
m_MainWindow.m_DrawPageUC.BackBtn_Click(sender, e)
|
||||
|
||||
' torno alla pagina iniziale di selezione del piano (Compo)
|
||||
'm_MainWindow.m_DrawPageUC.BackBtn_Click(sender, e)
|
||||
|
||||
'--------- NUOVA GESTIONE ---------
|
||||
' rimuovo l'elenco di bottoni per selezionare il tipo di componente interna
|
||||
m_MainWindow.m_DrawPageUC.LeftButtonGrd.Children.Remove(Me)
|
||||
' inserisco nella Grid VaribalsesGrid lo UeserControl per definire le dimensioni della componente
|
||||
m_MainWindow.m_DrawPageUC.VariablesGrd.Children.Add(m_MainWindow.m_DrawPageUC.m_CompoDimension)
|
||||
' nascondo la lista dei parametri
|
||||
m_MainWindow.m_DrawPageUC.m_CompoDimension.CollapsedAllParam()
|
||||
' sto uscendo dalla componente interna (quindi comunico il cambio di componente)
|
||||
m_MainWindow.m_DrawPageUC.m_bInternalCompo = False
|
||||
' comunico che sto arrivando da una componente interna
|
||||
m_MainWindow.m_DrawPageUC.m_bBackFromInternalCompo = True
|
||||
|
||||
'm_MainWindow.m_DrawPageUC.SelectedComponent(m_MainWindow.m_DrawPageUC.m_sMainCompo)
|
||||
'm_MainWindow.m_DrawPageUC.m_ActiveComponentPage = DrawPageUC.Pages.CompoDimension
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
|
||||
@@ -14,6 +14,7 @@ Public Class SecondaryComponentPageUC
|
||||
' Variabile che contiene il nome del componente selezionato
|
||||
Friend m_sCurrCompo As String = String.Empty
|
||||
|
||||
' dopo aver definito la forma della componente definisco quali parametri usare per la sua definizione
|
||||
Private Sub SecondaryComponentPage_Loaded(sender As Object, e As RoutedEventArgs)
|
||||
|
||||
m_MainComponentPage = m_MainWindow.m_DrawPageUC.m_MainComponentPage
|
||||
@@ -219,8 +220,10 @@ Public Class SecondaryComponentPageUC
|
||||
|
||||
' Carico componente
|
||||
m_MainWindow.m_DrawPageUC.SelectedComponent(sCompo)
|
||||
m_MainWindow.m_DrawPageUC.m_sMainCompo = sCompo
|
||||
m_sCurrCompo = "Compo" & GetButtonNumber(CurrentBtn.Name)
|
||||
m_MainWindow.m_DrawPageUC.VariablesGrd.Children.Add(m_MainWindow.m_DrawPageUC.m_CompoDimension)
|
||||
|
||||
'm_MainWindow.m_DrawPageUC.DimensionBtn.IsChecked = True
|
||||
m_MainWindow.m_DrawPageUC.SideAngleBtn.IsChecked = False
|
||||
m_MainWindow.m_DrawPageUC.FiloTopBtn.IsChecked = False
|
||||
|
||||
@@ -173,6 +173,9 @@
|
||||
<Compile Include="DirectCuts\SingleCutAuto.xaml.vb">
|
||||
<DependentUpon>SingleCutAuto.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="DrawImport\AlzFrontUC.xaml.vb">
|
||||
<DependentUpon>AlzFrontUC.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="DrawImport\CompoCsvData.xaml.vb">
|
||||
<DependentUpon>CompoCsvData.xaml</DependentUpon>
|
||||
</Compile>
|
||||
@@ -394,6 +397,10 @@
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="DrawImport\AlzFrontUC.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="DrawImport\CompoCsvData.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
|
||||
Reference in New Issue
Block a user