EgtDOORCreator 1.8j1 :
- creazione di assemblati
@@ -1,4 +1,4 @@
|
||||
<Window x:Class="AboutBoxView"
|
||||
<Window x:Class="AboutBoxV"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
Title="AboutBox" Height="300" Width="300" WindowStyle="None" ResizeMode="NoResize"
|
||||
@@ -1,16 +1,12 @@
|
||||
Imports EgtUILib
|
||||
|
||||
Public Class AboutBoxView
|
||||
|
||||
' Riferimento alla MainWindow
|
||||
Private m_MainWindow As Window = Application.Current.MainWindow
|
||||
Public Class AboutBoxV
|
||||
|
||||
Sub New()
|
||||
' This call is required by the designer.
|
||||
InitializeComponent()
|
||||
|
||||
' '' Add any initialization after the InitializeComponent() call.
|
||||
Me.Owner = Application.Current.MainWindow
|
||||
End Sub
|
||||
|
||||
Private Sub ExitBtn_Click(sender As Object, e As RoutedEventArgs) Handles ExitBtn.Click
|
||||
@@ -18,6 +14,7 @@ Public Class AboutBoxView
|
||||
End Sub
|
||||
|
||||
Private Sub AboutBoxWD_Loaded(sender As Object, e As RoutedEventArgs) Handles Me.Loaded
|
||||
Me.Owner = Application.Current.MainWindow
|
||||
DescriptionLbl.Text = My.Application.Info.Description.ToString()
|
||||
VersionLbl.Text = "Version : " & My.Application.Info.Version.Major.ToString() &
|
||||
"." & My.Application.Info.Version.Minor.ToString() &
|
||||
@@ -1,9 +1,9 @@
|
||||
Imports System.ComponentModel
|
||||
|
||||
|
||||
Public Class AboutBoxViewModel
|
||||
Public Class AboutBoxVM
|
||||
Implements INotifyPropertyChanged
|
||||
'Inherits ViewModelBase
|
||||
'Inherits VModelBase
|
||||
|
||||
Private m_AboutBoxVisibility As Visibility
|
||||
Public Property AboutBoxVisibility As Visibility
|
||||
@@ -6,14 +6,9 @@
|
||||
MyBase.OnStartup(e)
|
||||
ShutdownMode = System.Windows.ShutdownMode.OnMainWindowClose
|
||||
' Creo la View principale
|
||||
Dim MainWndView As New MainWindow
|
||||
MainWindow = MainWndView
|
||||
' Creo il ViewModel principale
|
||||
Dim MainWndViewModel As New MainWindowViewModel
|
||||
' Assegno il ViewModel alla View
|
||||
MainWndView.DataContext = MainWndViewModel
|
||||
Me.MainWindow = New MainWindowV
|
||||
' Mostro la View principale
|
||||
MainWndView.Show()
|
||||
Me.MainWindow.Show()
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
|
||||
@@ -0,0 +1,459 @@
|
||||
<UserControl x:Class="AssemblyPageV"
|
||||
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"
|
||||
xmlns:EgtDOORCreator="clr-namespace:EgtDOORCreator"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="300" d:DesignWidth="300">
|
||||
|
||||
<UserControl.Resources>
|
||||
<EgtDOORCreator:BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter"/>
|
||||
</UserControl.Resources>
|
||||
|
||||
<Grid>
|
||||
<Grid.InputBindings>
|
||||
<KeyBinding Key="Enter" Command="{Binding DataContext.RefreshCmd,RelativeSource={RelativeSource AncestorType={x:Type UserControl}}}"/>
|
||||
<KeyBinding Key="F1" Command="{Binding DataContext.GuideCmd,RelativeSource={RelativeSource AncestorType={x:Type UserControl}}}"/>
|
||||
</Grid.InputBindings>
|
||||
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="4*"/>
|
||||
<ColumnDefinition Width="3*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<!--Jamb-->
|
||||
<GroupBox Header="{Binding JambPageMsg}" Margin="2,0,2,0" >
|
||||
<Grid Margin="0,0,0,2">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<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*"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<!--UP-->
|
||||
<TextBlock Grid.Row="0" Text="{Binding LightUpMsg}"
|
||||
Style="{StaticResource DoorParamsTxBl}"
|
||||
Margin="2,2,0,2"
|
||||
Grid.Column="0"/>
|
||||
<TextBox Grid.Column="1" Grid.Row="0" Style="{StaticResource DoorParamsTxBx}"
|
||||
Text="{Binding CurrAssembly.LightUp, UpdateSourceTrigger=PropertyChanged}"
|
||||
Margin="0.4,2,39.6,3.2" VerticalAlignment="Stretch" Height="Auto" />
|
||||
<!--Lock-->
|
||||
<TextBlock Grid.Row="1" Text="{Binding LightLockMsg}"
|
||||
Style="{StaticResource DoorParamsTxBl}"
|
||||
Margin="2,0,0,2"
|
||||
Grid.Column="0"/>
|
||||
<TextBox Grid.Column="1" Grid.Row="1" Style="{StaticResource DoorParamsTxBx}"
|
||||
Text="{Binding CurrAssembly.LightLock, UpdateSourceTrigger=PropertyChanged}"
|
||||
Margin="0.4,2,39.6,3.2" VerticalAlignment="Stretch" Height="Auto"/>
|
||||
<!--Hinge-->
|
||||
<TextBlock Grid.Row="2" Text="{Binding LightHingeMsg}"
|
||||
Style="{StaticResource DoorParamsTxBl}"
|
||||
Margin="2,0,0,2"
|
||||
Grid.Column="0"/>
|
||||
<TextBox Grid.Column="1" Grid.Row="2" Style="{StaticResource DoorParamsTxBx}"
|
||||
Text="{Binding CurrAssembly.LightHinge, UpdateSourceTrigger=PropertyChanged}"
|
||||
Margin="0.4,2,39.6,3.2" VerticalAlignment="Stretch" Height="Auto"/>
|
||||
<!--Bottom-->
|
||||
<TextBlock Grid.Row="3" Text="{Binding LightBottomMsg}"
|
||||
Style="{StaticResource DoorParamsTxBl}"
|
||||
Margin="2,0,0,2"
|
||||
Grid.Column="0"/>
|
||||
<TextBox Grid.Column="1" Grid.Row="3" Style="{StaticResource DoorParamsTxBx}"
|
||||
Text="{Binding CurrAssembly.LightBottom, UpdateSourceTrigger=PropertyChanged}"
|
||||
Margin="0.4,2,39.6,3.2" VerticalAlignment="Stretch" Height="Auto"/>
|
||||
<!--ThhicknessHead-->
|
||||
<TextBlock Grid.Row="0" Text="{Binding ThicknessHeadMsg}"
|
||||
Style="{StaticResource DoorParamsTxBl}"
|
||||
Margin="2,2,0,2"
|
||||
Grid.Column="2"/>
|
||||
<TextBox Grid.Row="0" Grid.Column="3"
|
||||
Style="{StaticResource DoorParamsTxBx}"
|
||||
Text="{Binding CurrAssembly.ThicknessHead, UpdateSourceTrigger=PropertyChanged}"
|
||||
Margin="0.4,2,39.6,3.2" VerticalAlignment="Stretch" Height="Auto"/>
|
||||
<!--OverlapHinge-->
|
||||
<TextBlock Grid.Row="1" Text="{Binding OverlapHingeMsg}"
|
||||
Style="{StaticResource DoorParamsTxBl}"
|
||||
Margin="2,0,0,2"
|
||||
Grid.Column="2"/>
|
||||
<TextBox Grid.Row="1" Grid.Column="3"
|
||||
Style="{StaticResource DoorParamsTxBx}"
|
||||
Text="{Binding CurrAssembly.OverlapHinge, UpdateSourceTrigger=PropertyChanged}"
|
||||
Margin="0.4,2,39.6,3.2" VerticalAlignment="Stretch" Height="Auto"/>
|
||||
<!--OverlapLock-->
|
||||
<TextBlock Grid.Row="2" Text="{Binding OverlapLockMsg}"
|
||||
Style="{StaticResource DoorParamsTxBl}"
|
||||
Margin="2,0,0,2"
|
||||
Grid.Column="2"/>
|
||||
<TextBox Grid.Row="2" Grid.Column="3"
|
||||
Style="{StaticResource DoorParamsTxBx}"
|
||||
Text="{Binding CurrAssembly.OverlapLock, UpdateSourceTrigger=PropertyChanged}"
|
||||
Margin="0.4,2,39.6,3.2" VerticalAlignment="Stretch" Height="Auto"
|
||||
IsEnabled="{Binding CurrAssembly.OneDoorProperty}"/>
|
||||
<!--DoorsNumber-->
|
||||
<TextBlock Grid.Row="4" Grid.Column="0" Text="{Binding DoorNumberMsg}"
|
||||
Style="{StaticResource DoorParamsTxBl}"
|
||||
Margin="2,0,0,2"/>
|
||||
<ComboBox Grid.Row="4" Grid.Column="1" Margin="0.4,2,39.6,3.2"
|
||||
ItemsSource="{Binding CurrAssembly.DoorListNumber}"
|
||||
SelectedItem="{Binding CurrAssembly.DoorNumber}"
|
||||
Style="{StaticResource DoorParamsCmBx}"
|
||||
Height="Auto"/>
|
||||
<!--Height-->
|
||||
<TextBlock Grid.Row="3" Text="{Binding ThicknessMsg}"
|
||||
Style="{StaticResource DoorParamsTxBl}"
|
||||
Margin="2,0,0,2"
|
||||
Grid.Column="2"/>
|
||||
<TextBox Grid.Row="3" Grid.Column="3"
|
||||
Style="{StaticResource DoorParamsTxBx}"
|
||||
Text="{Binding CurrAssembly.Thickness, UpdateSourceTrigger=PropertyChanged}"
|
||||
Margin="0.4,2,39.6,3.2" VerticalAlignment="Stretch" Height="Auto"/>
|
||||
<!--Width-->
|
||||
<TextBlock Grid.Row="4" Text="{Binding WidthMsg}"
|
||||
Style="{StaticResource DoorParamsTxBl}"
|
||||
Margin="2,0,0,2"
|
||||
Grid.Column="2"/>
|
||||
<TextBox Grid.Row="4" Grid.Column="3"
|
||||
Style="{StaticResource DoorParamsTxBx}"
|
||||
Text="{Binding CurrAssembly.Width, UpdateSourceTrigger=PropertyChanged}"
|
||||
Margin="0.4,2,39.6,3.2" VerticalAlignment="Stretch" Height="Auto"/>
|
||||
</Grid>
|
||||
</GroupBox>
|
||||
<!--JAmb Definition Machining and Bevel-->
|
||||
<GroupBox Header="{Binding JambPageMsg}" Grid.Row="0" Grid.Column="4" Grid.ColumnSpan="4" Margin="2,0,2,0">
|
||||
|
||||
<Grid Margin="0,0,0,2" >
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<TextBlock Grid.Column="1" Grid.Row="0"
|
||||
Text="{Binding EdgeMsg}"
|
||||
VerticalAlignment="Center"
|
||||
Style="{StaticResource DoorParamsTxBl}"
|
||||
Margin="2,0,5,0"/>
|
||||
<TextBlock Grid.Column="2" Grid.Row="0"
|
||||
Grid.ColumnSpan="3"
|
||||
Text="{Binding OverMaterialMsg}"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
Style="{StaticResource DoorParamsTxBl}"
|
||||
Margin="2,0,5,0"/>
|
||||
|
||||
<TextBlock Grid.Column="0" Grid.Row="1" Text="{Binding LockedgeMsg}"
|
||||
Style="{StaticResource DoorParamsTxBl}"
|
||||
Margin="2,0,0,2" />
|
||||
<ComboBox Grid.Column="1" Grid.Row="1"
|
||||
ItemsSource="{Binding CurrAssembly.EdgeTypeList}"
|
||||
SelectedItem="{Binding CurrAssembly.LockEdgeType}"
|
||||
Style="{StaticResource DoorEdgeParamsCmBx}"
|
||||
Margin="0.4,2,39.6,2"/>
|
||||
|
||||
<TextBlock Grid.Column="0" Grid.Row="2"
|
||||
Text="{Binding HingeedgeMsg}"
|
||||
Style="{StaticResource DoorParamsTxBl}"
|
||||
Margin="2,0,0,2" />
|
||||
<ComboBox Grid.Column="1" Grid.Row="2"
|
||||
ItemsSource="{Binding CurrAssembly.EdgeTypeList}"
|
||||
SelectedItem="{Binding CurrAssembly.HingeEdgeType}"
|
||||
Style="{StaticResource DoorEdgeParamsCmBx}"
|
||||
Margin="0.4,0,39.6,2">
|
||||
</ComboBox>
|
||||
|
||||
<TextBlock Grid.Column="0" Grid.Row="3"
|
||||
Text="{Binding TopMsg}"
|
||||
Style="{StaticResource DoorParamsTxBl}"
|
||||
Margin="2,0,0,2" />
|
||||
<ComboBox Grid.Column="1" Grid.Row="3"
|
||||
ItemsSource="{Binding CurrAssembly.EdgeTypeList}"
|
||||
SelectedItem="{Binding CurrAssembly.TopType}"
|
||||
Style="{StaticResource DoorEdgeParamsCmBx}"
|
||||
Margin="0.4,0,39.6,2"/>
|
||||
|
||||
<TextBlock Grid.Column="0" Grid.Row="4"
|
||||
Text="{Binding BottomMsg}"
|
||||
Style="{StaticResource DoorParamsTxBl}"
|
||||
Margin="2,0,0,2" />
|
||||
<ComboBox Grid.Column="1" Grid.Row="4"
|
||||
ItemsSource="{Binding CurrAssembly.EdgeTypeList}"
|
||||
SelectedItem="{Binding CurrAssembly.BottomType}"
|
||||
Style="{StaticResource DoorEdgeParamsCmBx}"
|
||||
Margin="0.4,0,39.6,2"/>
|
||||
|
||||
<!--Machining-->
|
||||
<CheckBox Grid.Column="2" Grid.Row="1"
|
||||
Name="LockEdge" Style="{StaticResource DoorParamsChBx}"
|
||||
IsChecked="{Binding CurrAssembly.LockEdgeMachining}"
|
||||
/>
|
||||
<CheckBox Grid.Column="2" Grid.Row="2"
|
||||
Name="HingeEdge" Style="{StaticResource DoorParamsChBx}"
|
||||
IsChecked="{Binding CurrAssembly.HingeEdgeMachining}"
|
||||
/>
|
||||
<CheckBox Grid.Column="2" Grid.Row="3"
|
||||
Name="Top" Style="{StaticResource DoorParamsChBx}"
|
||||
IsChecked="{Binding CurrAssembly.TopMachining}"
|
||||
/>
|
||||
<CheckBox Grid.Column="2" Grid.Row="4"
|
||||
Name="Bottom" Style="{StaticResource DoorParamsChBx}"
|
||||
IsChecked="{Binding CurrAssembly.BottomMachining}"
|
||||
/>
|
||||
|
||||
<TextBox Grid.Column="4" Grid.Row="1" Style="{StaticResource DoorParamsTxBx}"
|
||||
Text="{Binding CurrAssembly.LockEdgeOverMaterial, UpdateSourceTrigger=PropertyChanged}"
|
||||
IsEnabled="{Binding IsChecked, ElementName=LockEdge}"
|
||||
Margin="15,2,24.6,3.2"/>
|
||||
<TextBox Grid.Column="4" Grid.Row="2" Style="{StaticResource DoorParamsTxBx}"
|
||||
Text="{Binding CurrAssembly.HingeEdgeOverMaterial, UpdateSourceTrigger=PropertyChanged}"
|
||||
IsEnabled="{Binding IsChecked, ElementName=HingeEdge}"
|
||||
Margin="15,2,24.6,3.2"/>
|
||||
<TextBox Grid.Column="4" Grid.Row="3" Style="{StaticResource DoorParamsTxBx}"
|
||||
Text="{Binding CurrAssembly.TopOverMaterial, UpdateSourceTrigger=PropertyChanged}"
|
||||
IsEnabled="{Binding IsChecked, ElementName=Top}"
|
||||
Margin="15,2,24.6,3.2"/>
|
||||
<TextBox Grid.Column="4" Grid.Row="4" Style="{StaticResource DoorParamsTxBx}"
|
||||
Text="{Binding CurrAssembly.BottomOverMaterial, UpdateSourceTrigger=PropertyChanged}"
|
||||
IsEnabled="{Binding IsChecked, ElementName=Bottom}"
|
||||
Margin="15,2,24.6,3.2"/>
|
||||
|
||||
</Grid>
|
||||
</GroupBox>
|
||||
|
||||
<!--Exterior-->
|
||||
<GroupBox Grid.Row="1" Grid.ColumnSpan="8" Margin="2,0,2,0">
|
||||
<GroupBox.Header>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<CheckBox Grid.Row="0" Grid.Column="5"
|
||||
Name="Exterior"
|
||||
Style="{StaticResource DoorParamsChBx}"
|
||||
IsChecked="{Binding CurrAssembly.Exterior}"
|
||||
Margin="0,0,2,0" VerticalAlignment="Stretch" Height="Auto"/>
|
||||
<TextBlock Text="{Binding ExteriorMsg}" Width="Auto"/>
|
||||
</StackPanel>
|
||||
</GroupBox.Header>
|
||||
|
||||
<Grid Margin="0,0,0,2" IsEnabled="{Binding IsChecked, ElementName=Exterior}">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<!--OverlapTop-->
|
||||
<TextBlock Text="{Binding OverlapTopMsg}"
|
||||
Style="{StaticResource DoorParamsTxBl}"
|
||||
Margin="2,0,0,2"
|
||||
Grid.Column="0"/>
|
||||
<TextBox Grid.Column="1"
|
||||
Style="{StaticResource DoorParamsTxBx}"
|
||||
Text="{Binding CurrAssembly.OverlapTop, UpdateSourceTrigger=PropertyChanged}"
|
||||
Margin="0.4,2,39.6,3.2" VerticalAlignment="Stretch" Height="Auto"/>
|
||||
<!--DeltaThickness-->
|
||||
<TextBlock Text="{Binding DeltaTMsg}"
|
||||
Style="{StaticResource DoorParamsTxBl}"
|
||||
Margin="2,0,0,2"
|
||||
Grid.Column="2"/>
|
||||
<TextBox Grid.Column="3"
|
||||
Style="{StaticResource DoorParamsTxBx}"
|
||||
Text="{Binding CurrAssembly.DeltaThickness, UpdateSourceTrigger=PropertyChanged}"
|
||||
Margin="0.4,2,39.6,3.2" VerticalAlignment="Stretch" Height="Auto"/>
|
||||
</Grid>
|
||||
</GroupBox>
|
||||
|
||||
<!--Parts-->
|
||||
<GroupBox Margin="2,0,2,0" Grid.Column="0" Grid.ColumnSpan="2" Grid.Row="2">
|
||||
<GroupBox.Header >
|
||||
<TextBlock Text="{Binding JambsAndDoorsMsg}" Style="{StaticResource DoorParamsTxBl}" Height="Auto" />
|
||||
</GroupBox.Header>
|
||||
|
||||
<Grid Margin="0,0,0,2" >
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="2*"/>
|
||||
<ColumnDefinition Width="20"/>
|
||||
<ColumnDefinition Width="10"/>
|
||||
<ColumnDefinition Width="{Binding}"/>
|
||||
<ColumnDefinition Width="10"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="10"/>
|
||||
<ColumnDefinition Width="{Binding}"/>
|
||||
<ColumnDefinition Width="10"/>
|
||||
<ColumnDefinition Width="20"/>
|
||||
<ColumnDefinition Width="2*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="3*"/>
|
||||
<RowDefinition Height="2*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="2*"/>
|
||||
<RowDefinition Height="24*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="2*"/>
|
||||
<RowDefinition Height="3*"/>
|
||||
</Grid.RowDefinitions>
|
||||
<!--Jamb Left-->
|
||||
<Button x:Name="TopLeftJamb"
|
||||
Command="{Binding DataContext.JambBtnCommand,
|
||||
RelativeSource={RelativeSource AncestorType={x:Type UserControl}}}"
|
||||
CommandParameter="FL_"
|
||||
Style="{StaticResource DoorButton}"
|
||||
IsEnabled="{Binding IsChecked, ElementName=LeftJambChk}"
|
||||
BorderThickness="1,1,1,0"
|
||||
Grid.Column="1"
|
||||
Grid.Row="3"/>
|
||||
<Button x:Name="LeftLeftJamb"
|
||||
Command="{Binding DataContext.JambBtnCommand,
|
||||
RelativeSource={RelativeSource AncestorType={x:Type UserControl}}}"
|
||||
CommandParameter="FL_"
|
||||
Style="{StaticResource DoorButton}"
|
||||
IsEnabled="{Binding IsChecked, ElementName=LeftJambChk}"
|
||||
BorderThickness="1,0,0,1"
|
||||
Grid.Column="1"
|
||||
Grid.Row="4"
|
||||
Margin="0">
|
||||
</Button>
|
||||
<Button x:Name="RightLeftJamb"
|
||||
Command="{Binding DataContext.JambBtnCommand,
|
||||
RelativeSource={RelativeSource AncestorType={x:Type UserControl}}}"
|
||||
CommandParameter="FL_"
|
||||
Style="{StaticResource DoorButton}"
|
||||
IsEnabled="{Binding IsChecked, ElementName=LeftJambChk}"
|
||||
BorderThickness="0,1,1,1"
|
||||
Grid.Column="2"
|
||||
Grid.Row="4"/>
|
||||
<CheckBox Name="LeftJambChk" Style="{StaticResource DoorParamsChBx}"
|
||||
IsChecked="{Binding CurrAssembly.LeftJamb.IsActive}"
|
||||
Grid.Column="1" Grid.ColumnSpan="2"
|
||||
Grid.Row="4"/>
|
||||
<!--Jamb Top-->
|
||||
<Button x:Name="TopJamb"
|
||||
Command="{Binding DataContext.JambBtnCommand,
|
||||
RelativeSource={RelativeSource AncestorType={x:Type UserControl}}}"
|
||||
CommandParameter="FT_"
|
||||
Style="{StaticResource DoorButton}"
|
||||
IsEnabled="{Binding IsChecked, ElementName=TopJambChk}"
|
||||
Grid.Column="4" Grid.ColumnSpan="3"
|
||||
Grid.Row="1">
|
||||
</Button>
|
||||
<CheckBox Name="TopJambChk" Style="{StaticResource DoorParamsChBx}"
|
||||
IsChecked="{Binding CurrAssembly.TopJamb.IsActive}"
|
||||
Grid.Column="5"
|
||||
Grid.Row="1"/>
|
||||
<!--Jamb Right-->
|
||||
<Button x:Name="LeftRightJamb"
|
||||
Command="{Binding DataContext.JambBtnCommand,
|
||||
RelativeSource={RelativeSource AncestorType={x:Type UserControl}}}"
|
||||
CommandParameter="FR_"
|
||||
Style="{StaticResource DoorButton}"
|
||||
IsEnabled="{Binding IsChecked, ElementName=RightJambChk}"
|
||||
BorderThickness="1,1,0,1"
|
||||
Grid.Column="8"
|
||||
Grid.Row="4"/>
|
||||
<Button x:Name="TopRightJamb"
|
||||
Command="{Binding DataContext.JambBtnCommand,
|
||||
RelativeSource={RelativeSource AncestorType={x:Type UserControl}}}"
|
||||
CommandParameter="FR_"
|
||||
Style="{StaticResource DoorButton}"
|
||||
IsEnabled="{Binding IsChecked, ElementName=RightJambChk}"
|
||||
BorderThickness="1,1,1,0"
|
||||
Grid.Column="9"
|
||||
Grid.Row="3" />
|
||||
<Button x:Name="RightRightJamb"
|
||||
Command="{Binding DataContext.JambBtnCommand,
|
||||
RelativeSource={RelativeSource AncestorType={x:Type UserControl}}}"
|
||||
CommandParameter="FR_"
|
||||
Style="{StaticResource DoorButton}"
|
||||
IsEnabled="{Binding IsChecked, ElementName=RightJambChk}"
|
||||
BorderThickness="0,0,1,1"
|
||||
Grid.Column="9"
|
||||
Grid.Row="4">
|
||||
</Button>
|
||||
<CheckBox Name="RightJambChk" Style="{StaticResource DoorParamsChBx}"
|
||||
IsChecked="{Binding CurrAssembly.RightJamb.IsActive}"
|
||||
Grid.Column="8" Grid.ColumnSpan="2"
|
||||
Grid.Row="4" />
|
||||
|
||||
<!--Jamb Bottom-->
|
||||
<Button x:Name="BottomJamb"
|
||||
Visibility="{Binding IsChecked,
|
||||
ElementName=Exterior,
|
||||
Converter={StaticResource BooleanToVisibilityConverter}}"
|
||||
Command="{Binding DataContext.JambBtnCommand,
|
||||
RelativeSource={RelativeSource AncestorType={x:Type UserControl}}}"
|
||||
CommandParameter="FB_"
|
||||
Style="{StaticResource DoorButton}"
|
||||
IsEnabled="{Binding IsChecked, ElementName=BottomJambChk}"
|
||||
Grid.Column="4" Grid.ColumnSpan="3"
|
||||
Grid.Row="6">
|
||||
</Button>
|
||||
<CheckBox Name="BottomJambChk" Style="{StaticResource DoorParamsChBx}"
|
||||
Visibility="{Binding IsChecked,
|
||||
ElementName=Exterior,
|
||||
Converter={StaticResource BooleanToVisibilityConverter}}"
|
||||
IsChecked="{Binding CurrAssembly.BottomJamb.IsActive}"
|
||||
Grid.Column="5"
|
||||
Grid.Row="6"/>
|
||||
<!--Door-->
|
||||
<ItemsControl ItemsSource="{Binding CurrAssembly.ArrayPartDoor}"
|
||||
Grid.Column="5"
|
||||
Grid.Row="4"
|
||||
Focusable="True">
|
||||
<ItemsControl.ItemContainerStyle>
|
||||
<Style TargetType="{x:Type ContentPresenter}">
|
||||
<Setter Property="Visibility" Value="{Binding IsVisible}"/>
|
||||
</Style>
|
||||
</ItemsControl.ItemContainerStyle>
|
||||
<ItemsControl.ItemsPanel >
|
||||
<ItemsPanelTemplate >
|
||||
<UniformGrid Rows="1" />
|
||||
</ItemsPanelTemplate>
|
||||
</ItemsControl.ItemsPanel>
|
||||
<ItemsControl.ItemTemplate >
|
||||
<DataTemplate>
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="1*"></RowDefinition>
|
||||
</Grid.RowDefinitions>
|
||||
<Button Name="Door"
|
||||
Command="{Binding DataContext.JambBtnCommand,
|
||||
RelativeSource={RelativeSource AncestorType={x:Type UserControl}}}"
|
||||
CommandParameter="{Binding Type}"
|
||||
Width="80"
|
||||
Style="{StaticResource DoorButton}"
|
||||
IsEnabled="{Binding IsChecked, ElementName=DoorChk}"
|
||||
Grid.Column="0" />
|
||||
<CheckBox Name="DoorChk" Style="{StaticResource DoorParamsChBx}"
|
||||
IsChecked="{Binding IsChecked}"
|
||||
Grid.Column="5"
|
||||
Grid.Row="6"/>
|
||||
</Grid>
|
||||
</DataTemplate>
|
||||
</ItemsControl.ItemTemplate>
|
||||
</ItemsControl>
|
||||
</Grid>
|
||||
</GroupBox>
|
||||
|
||||
</Grid>
|
||||
</UserControl>
|
||||
@@ -0,0 +1,34 @@
|
||||
Public Class AssemblyPageV
|
||||
|
||||
Private DoorButton_Static_Background As SolidColorBrush = New BrushConverter().ConvertFrom("#FFD07606")
|
||||
Private DoorButton_Static_Border As SolidColorBrush = New BrushConverter().ConvertFrom("#000000")
|
||||
Private DoorButton_MouseOver_Background As SolidColorBrush = New BrushConverter().ConvertFrom("#3CD07606")
|
||||
Private DoorButton_MouseOver_Border As SolidColorBrush = New BrushConverter().ConvertFrom("#FF3C7FB1")
|
||||
|
||||
Private Sub RightJamb_MouseEnter(sender As Object, e As Input.MouseEventArgs) Handles LeftRightJamb.MouseEnter, TopRightJamb.MouseEnter, RightRightJamb.MouseEnter
|
||||
TopRightJamb.BorderBrush = DoorButton_MouseOver_Border
|
||||
LeftRightJamb.BorderBrush = DoorButton_MouseOver_Border
|
||||
RightRightJamb.BorderBrush = DoorButton_MouseOver_Border
|
||||
End Sub
|
||||
|
||||
Private Sub RightJamb_MouseLeave(sender As Object, e As Input.MouseEventArgs) Handles LeftRightJamb.MouseLeave, TopRightJamb.MouseLeave, RightRightJamb.MouseLeave
|
||||
TopRightJamb.BorderBrush = DoorButton_Static_Border
|
||||
LeftRightJamb.BorderBrush = DoorButton_Static_Border
|
||||
RightRightJamb.BorderBrush = DoorButton_Static_Border
|
||||
End Sub
|
||||
|
||||
Private Sub LeftJamb_MouseEnter(sender As Object, e As Input.MouseEventArgs) Handles LeftLeftJamb.MouseEnter, TopLeftJamb.MouseEnter, RightLeftJamb.MouseEnter
|
||||
If LeftJambChk.IsChecked Then
|
||||
TopLeftJamb.BorderBrush = DoorButton_MouseOver_Border
|
||||
LeftLeftJamb.BorderBrush = DoorButton_MouseOver_Border
|
||||
RightLeftJamb.BorderBrush = DoorButton_MouseOver_Border
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub LeftJamb_MouseLeave(sender As Object, e As Input.MouseEventArgs) Handles LeftLeftJamb.MouseLeave, TopLeftJamb.MouseLeave, RightLeftJamb.MouseLeave
|
||||
TopLeftJamb.BorderBrush = DoorButton_Static_Border
|
||||
LeftLeftJamb.BorderBrush = DoorButton_Static_Border
|
||||
RightLeftJamb.BorderBrush = DoorButton_Static_Border
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
@@ -0,0 +1,265 @@
|
||||
Imports System.ComponentModel
|
||||
Imports System.Collections.ObjectModel
|
||||
Imports System.IO
|
||||
Imports EgtUILib
|
||||
|
||||
Public Class AssemblyPageVM
|
||||
Implements INotifyPropertyChanged
|
||||
|
||||
Private m_CurrAssembly As Assembly
|
||||
Public Property CurrAssembly As Assembly
|
||||
Get
|
||||
Return m_CurrAssembly
|
||||
End Get
|
||||
Set(value As Assembly)
|
||||
m_CurrAssembly = value
|
||||
NotifyPropertyChanged("CurrAssembly")
|
||||
End Set
|
||||
End Property
|
||||
|
||||
' Definizione comando
|
||||
Private m_CmdJambBtn As ICommand
|
||||
Private m_EnterRefreshCmd As ICommand
|
||||
|
||||
Sub New()
|
||||
Map.SetRefJambPageVM(Me)
|
||||
If IsNothing(m_CurrAssembly) Then
|
||||
m_CurrAssembly = New Assembly
|
||||
End If
|
||||
End Sub
|
||||
|
||||
#Region "Messages"
|
||||
|
||||
Public ReadOnly Property JambPageMsg As String
|
||||
Get
|
||||
Return "Jamb"
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property LightUpMsg As String
|
||||
Get
|
||||
Return "Light Up"
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property LightLockMsg As String
|
||||
Get
|
||||
Return "Light Lock"
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property LightBottomMsg As String
|
||||
Get
|
||||
Return "Light Bottom"
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property LightHingeMsg As String
|
||||
Get
|
||||
Return "Light Hinge"
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property ThicknessHeadMsg As String
|
||||
Get
|
||||
Return "Thickness Head"
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property OverlapHingeMsg As String
|
||||
Get
|
||||
Return "Overlap Hinge"
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property OverlapLockMsg As String
|
||||
Get
|
||||
Return "Overlap Lock"
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property OverlapTopMsg As String
|
||||
Get
|
||||
Return "Overlap Top"
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property DeltaTMsg As String
|
||||
Get
|
||||
Return "Delta T"
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property ExteriorMsg As String
|
||||
Get
|
||||
Return "Exterior"
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property DoorNumberMsg As String
|
||||
Get
|
||||
Return "Number of Doors"
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property JambsAndDoorsMsg As String
|
||||
Get
|
||||
Return "Jambs and Doors"
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property LockedgeMsg As String
|
||||
Get
|
||||
Return EgtMsg(50005)
|
||||
End Get
|
||||
End Property
|
||||
Public ReadOnly Property HingeedgeMsg As String
|
||||
Get
|
||||
Return EgtMsg(50006)
|
||||
End Get
|
||||
End Property
|
||||
Public ReadOnly Property TopMsg As String
|
||||
Get
|
||||
Return EgtMsg(50007)
|
||||
End Get
|
||||
End Property
|
||||
Public ReadOnly Property BottomMsg As String
|
||||
Get
|
||||
Return EgtMsg(50008)
|
||||
End Get
|
||||
End Property
|
||||
Public ReadOnly Property EdgeMsg As String
|
||||
Get
|
||||
Return EgtMsg(50044)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property OverMaterialMsg As String
|
||||
Get
|
||||
Return EgtMsg(50045)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property ThicknessMsg As String
|
||||
Get
|
||||
Return EgtMsg(50003)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property WidthMsg As String
|
||||
Get
|
||||
Return EgtMsg(50001)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
#End Region
|
||||
|
||||
#Region "COMMANDS"
|
||||
|
||||
|
||||
#Region "JambBtnCommand"
|
||||
|
||||
''' <summary>
|
||||
''' Returns a command that do Exec.
|
||||
''' </summary>
|
||||
Public ReadOnly Property JambBtnCommand As ICommand
|
||||
Get
|
||||
If m_CmdJambBtn Is Nothing Then
|
||||
m_CmdJambBtn = New Command(AddressOf JambBtn)
|
||||
End If
|
||||
Return m_CmdJambBtn
|
||||
End Get
|
||||
End Property
|
||||
|
||||
''' <summary>
|
||||
''' Execute the Exec. This method is invoked by the ExecCommand.
|
||||
''' </summary>
|
||||
'''
|
||||
Private bLoadSwing As Boolean = False
|
||||
Public Sub JambBtn(param As Object)
|
||||
' il parametro param arriva direttamente dal Jamb del bottone, quindi è gia scritto nella forma FL_ (le porte no! sono passate da binding)
|
||||
Dim SelectPart As String = (CStr(param))
|
||||
' In questa fase manca la gestione degli swing dei Jamb
|
||||
Select Case SelectPart
|
||||
Case "FL_"
|
||||
DdfFile.WriteDDFPart(CurrAssembly.LeftJamb, IniFile.m_sTempDir & "\" & TEMP_FILE, True, False)
|
||||
ExecDoors(Map.refSceneManagerVM.ProjectScene, IniFile.m_sTempDir & "\" & TEMP_FILE)
|
||||
Map.refPartPageVM.CurrPart = CurrAssembly.LeftJamb
|
||||
Map.refCompoPanelVM.IsVisible = Visibility.Hidden
|
||||
Map.refPartPageVM.IsRaedOnly = True
|
||||
Case "FR_"
|
||||
DdfFile.WriteDDFPart(CurrAssembly.RightJamb, IniFile.m_sTempDir & "\" & TEMP_FILE, True, False)
|
||||
ExecDoors(Map.refSceneManagerVM.ProjectScene, IniFile.m_sTempDir & "\" & TEMP_FILE)
|
||||
Map.refPartPageVM.CurrPart = CurrAssembly.RightJamb
|
||||
Map.refCompoPanelVM.IsVisible = Visibility.Hidden
|
||||
Map.refPartPageVM.IsRaedOnly = True
|
||||
Case "FT_"
|
||||
DdfFile.WriteDDFPart(CurrAssembly.TopJamb, IniFile.m_sTempDir & "\" & TEMP_FILE, True, False)
|
||||
ExecDoors(Map.refSceneManagerVM.ProjectScene, IniFile.m_sTempDir & "\" & TEMP_FILE)
|
||||
Map.refPartPageVM.CurrPart = CurrAssembly.TopJamb
|
||||
Map.refCompoPanelVM.IsVisible = Visibility.Hidden
|
||||
Map.refPartPageVM.IsRaedOnly = True
|
||||
Case "FB_"
|
||||
DdfFile.WriteDDFPart(CurrAssembly.BottomJamb, IniFile.m_sTempDir & "\" & TEMP_FILE, True, False)
|
||||
ExecDoors(Map.refSceneManagerVM.ProjectScene, IniFile.m_sTempDir & "\" & TEMP_FILE)
|
||||
Map.refPartPageVM.CurrPart = CurrAssembly.BottomJamb
|
||||
Map.refCompoPanelVM.IsVisible = Visibility.Hidden
|
||||
Map.refPartPageVM.IsRaedOnly = True
|
||||
Case Else
|
||||
' scelta della porta
|
||||
DdfFile.WriteDDFPart(SelectDoor(SelectPart), IniFile.m_sTempDir & "\" & TEMP_FILE, True, False)
|
||||
ExecDoors(Map.refSceneManagerVM.ProjectScene, IniFile.m_sTempDir & "\" & TEMP_FILE)
|
||||
Map.refPartPageVM.CurrPart = SelectDoor(SelectPart)
|
||||
bLoadSwing = False
|
||||
Map.refCompoPanelVM.IsVisible = Visibility.Visible
|
||||
Map.refPartPageVM.IsRaedOnly = False
|
||||
|
||||
End Select
|
||||
Map.refMainWindowVM.SelectedPage = MainWindowVM.ListPageEnum.nDDFPage
|
||||
End Sub
|
||||
|
||||
#End Region ' CompoBtnCommand
|
||||
|
||||
''' <summary>
|
||||
''' Returns a command that do New.
|
||||
''' </summary>
|
||||
Public ReadOnly Property RefreshCmd As ICommand
|
||||
Get
|
||||
If m_EnterRefreshCmd Is Nothing Then
|
||||
m_EnterRefreshCmd = New Command(AddressOf EnterRefresh)
|
||||
End If
|
||||
Return m_EnterRefreshCmd
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Sub EnterRefresh()
|
||||
Map.refSceneManagerVM.RefreshBtn()
|
||||
End Sub
|
||||
|
||||
#End Region ' Comand
|
||||
|
||||
#Region "METHODS"
|
||||
|
||||
' letto il nome della porta restituisce l'oggetto correttamente selezionato dal vettore delle porte
|
||||
Private Function SelectDoor(NamePart As String) As Part
|
||||
Dim Index As Integer
|
||||
Dim ref_Part As Part = Nothing
|
||||
For Index = 0 To CInt(CurrAssembly.DoorNumber) - 1
|
||||
If CurrAssembly.GetArrayPartDoor(Index).Type = NamePart Then
|
||||
ref_Part = CurrAssembly.GetArrayPartDoor(Index).Door
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
Return ref_Part
|
||||
End Function
|
||||
|
||||
#End Region ' Methods
|
||||
|
||||
Public Event PropertyChanged As PropertyChangedEventHandler Implements INotifyPropertyChanged.PropertyChanged
|
||||
|
||||
Public Sub NotifyPropertyChanged(propName As String)
|
||||
RaiseEvent PropertyChanged(Me, New PropertyChangedEventArgs(propName))
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
|
||||
@@ -0,0 +1,55 @@
|
||||
Imports System.ComponentModel
|
||||
|
||||
Public Class PartDoor
|
||||
Implements INotifyPropertyChanged
|
||||
|
||||
Private m_Door As Part
|
||||
Public Property Door As Part
|
||||
Get
|
||||
Return m_Door
|
||||
End Get
|
||||
Set(value As Part)
|
||||
m_Door = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_IsChecked As Boolean
|
||||
Public Property IsChecked As Boolean
|
||||
Get
|
||||
Return m_IsChecked
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
m_IsChecked = value
|
||||
m_Door.IsActive = IsChecked
|
||||
End Set
|
||||
End Property
|
||||
Public Sub SetIsChecked(bIsChecked As Boolean)
|
||||
IsChecked = bIsChecked
|
||||
m_Door.IsActive = IsChecked
|
||||
NotifyPropertyChanged("IsChecked")
|
||||
Map.refAssemblyManagerVM.SelectedAssembly.IsModify = True
|
||||
End Sub
|
||||
|
||||
Private m_IsVisible As Visibility
|
||||
Public Property IsVisible As Visibility
|
||||
Get
|
||||
Return m_IsVisible
|
||||
End Get
|
||||
Set(value As Visibility)
|
||||
m_IsVisible = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property Type As String
|
||||
Get
|
||||
Return Door.TypePart
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Event PropertyChanged(sender As Object, e As PropertyChangedEventArgs) Implements INotifyPropertyChanged.PropertyChanged
|
||||
|
||||
Public Sub NotifyPropertyChanged(propName As String)
|
||||
RaiseEvent PropertyChanged(Me, New PropertyChangedEventArgs(propName))
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
@@ -0,0 +1,53 @@
|
||||
<UserControl x:Class="CompoPanelV"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:EgtDOORCreator="clr-namespace:EgtDOORCreator">
|
||||
|
||||
<UserControl.InputBindings>
|
||||
<KeyBinding Key="Enter" Command="{Binding RefreshCmd}"/>
|
||||
</UserControl.InputBindings>
|
||||
|
||||
<Grid>
|
||||
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="16*"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
|
||||
<ItemsControl ItemsSource="{Binding CompoTypeList}" Focusable="True"
|
||||
Visibility="{Binding IsVisible}">
|
||||
|
||||
<ItemsControl.InputBindings>
|
||||
<KeyBinding Key="Enter" Command="{Binding RefreshCmd}"/>
|
||||
</ItemsControl.InputBindings>
|
||||
|
||||
<ItemsControl.ItemsPanel>
|
||||
<ItemsPanelTemplate>
|
||||
<UniformGrid Columns="1"/>
|
||||
</ItemsPanelTemplate>
|
||||
</ItemsControl.ItemsPanel>
|
||||
<ItemsControl.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<Button Name="Compo" Content="{Binding Name}"
|
||||
Command="{Binding DataContext.CompoBtnCommand,
|
||||
RelativeSource={RelativeSource AncestorType={x:Type UserControl}}}"
|
||||
CommandParameter="{Binding}"
|
||||
Focusable="False"/>
|
||||
</DataTemplate>
|
||||
</ItemsControl.ItemTemplate>
|
||||
</ItemsControl>
|
||||
|
||||
<Button Grid.Row="1"
|
||||
Name="GoToAssembly"
|
||||
Command="{Binding DataContext.GoToAssemblyBtnCommand,
|
||||
RelativeSource={RelativeSource AncestorType={x:Type UserControl}}}"
|
||||
CommandParameter="{Binding}"
|
||||
Visibility="{Binding GoBackVisibility}"
|
||||
MaxHeight="40"
|
||||
Focusable="False">
|
||||
<Image Source="/Resources/Refresh/BackArrow.png" Stretch="Uniform"/>
|
||||
</Button>
|
||||
|
||||
</Grid>
|
||||
</UserControl>
|
||||
@@ -0,0 +1,3 @@
|
||||
Public Class CompoPanelV
|
||||
|
||||
End Class
|
||||
@@ -3,12 +3,14 @@ Imports System.Collections.ObjectModel
|
||||
Imports EgtUILib
|
||||
Imports System.IO
|
||||
|
||||
Public Class CompoPanelViewModel
|
||||
Public Class CompoPanelVM
|
||||
Implements INotifyPropertyChanged
|
||||
|
||||
Private m_rfMainWindowViewModel As MainWindowViewModel
|
||||
Private m_rfDoorParametersViewModel As DoorParametersViewModel
|
||||
Dim m_Chapter As String
|
||||
Public ReadOnly Property GoToAssembly As String
|
||||
Get
|
||||
Return "GoToAssembly"
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private Shared m_CompoTypeList As New ObservableCollection(Of CompoType)
|
||||
Public Shared ReadOnly Property CompoTypeList As ObservableCollection(Of CompoType)
|
||||
@@ -17,20 +19,43 @@ Public Class CompoPanelViewModel
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_IsVisible As Visibility
|
||||
Public Property IsVisible As Visibility
|
||||
Get
|
||||
Return m_IsVisible
|
||||
End Get
|
||||
Set(value As Visibility)
|
||||
m_IsVisible = value
|
||||
NotifyPropertyChanged("IsVisible")
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_GoBackVisibility As Visibility = Visibility.Visible
|
||||
Public Property GoBackVisibility As Visibility
|
||||
Get
|
||||
Return m_GoBackVisibility
|
||||
End Get
|
||||
Set(value As Visibility)
|
||||
m_GoBackVisibility = value
|
||||
NotifyPropertyChanged("GoBackVisibility")
|
||||
End Set
|
||||
End Property
|
||||
|
||||
' Definizione comando
|
||||
Private m_CmdCompoBtn As ICommand
|
||||
Private m_CmdGoToAssemblyBtn As ICommand
|
||||
' definizione comando
|
||||
Private m_EnterRefreshCmd As ICommand
|
||||
|
||||
Sub New(MainWindowViewModel As MainWindowViewModel)
|
||||
m_rfMainWindowViewModel = MainWindowViewModel
|
||||
m_rfDoorParametersViewModel = DirectCast(m_rfMainWindowViewModel.DoorParameters.DataContext, DoorParametersViewModel)
|
||||
Sub New()
|
||||
Map.SetRefCompoPanelVM(Me)
|
||||
Dim IndexCompoOrder = 0
|
||||
Dim CompoPanelList As List(Of String) = OptionModule.m_CompoPaneOrder
|
||||
' Lettura file ini per generare bottoni
|
||||
Dim Index As Integer = 1
|
||||
Dim CompoName As String = String.Empty
|
||||
Dim CompoNameDDF As String = String.Empty
|
||||
Dim Side As String = String.Empty
|
||||
' Carico un vettore con il nome delle Path delle componenti
|
||||
IniFile.m_CompoDir = IniFile.m_sDoorsDirPath & "\Compo"
|
||||
If Not Directory.Exists(IniFile.m_CompoDir) Then
|
||||
@@ -45,8 +70,9 @@ Public Class CompoPanelViewModel
|
||||
Dim CurrCompoPath As String = CompoArray(Index) & "\" & ConstCompo.CONFIGINI_FILE_NAME
|
||||
If File.Exists(CurrCompoPath) Then
|
||||
GetPrivateProfileCompoName(ConstCompo.S_COMPO, ConstCompo.K_NAME, CompoNameDDF, CompoName, CurrCompoPath)
|
||||
GetPrivateProfileJambSide("PositionSide", "Side", Side, CurrCompoPath)
|
||||
If CompoPanelList(IndexCompoOrder) = CompoNameDDF Then
|
||||
m_CompoTypeList.Add(New CompoType(CompoName, CompoNameDDF, CompoArray(Index)))
|
||||
m_CompoTypeList.Add(New CompoType(CompoName, CompoNameDDF, CompoArray(Index), Side))
|
||||
Exit For
|
||||
End If
|
||||
End If
|
||||
@@ -79,10 +105,12 @@ Public Class CompoPanelViewModel
|
||||
|
||||
Public Sub CompoBtn(param As Object)
|
||||
Dim m_CurrCompoType As CompoType = DirectCast(param, CompoType)
|
||||
If Not IsNothing(m_rfDoorParametersViewModel.CurrDoor) Then
|
||||
m_rfDoorParametersViewModel.CurrDoor.AddNewCompo(m_CurrCompoType)
|
||||
''richiamo la pagina della guida ssociata alla componente selezionata
|
||||
'GuideViewModel.m_AddressGuide = "Compo" & "\" & m_CurrCompoType.DDFName
|
||||
If Not IsNothing(Map.refPartPageVM.CurrPart) Then
|
||||
Dim NewCompo As Compo = Map.refPartPageVM.CurrPart.AddNewCompo(m_CurrCompoType)
|
||||
'' appena aggiungo una componente nuova calcolo le sue componenti correttamente modificate
|
||||
If Not IsNothing(NewCompo.refJambCompo) Then
|
||||
Map.refAssemblyPageVM.CurrAssembly.UpDateCurrCompoJamb(NewCompo)
|
||||
End If
|
||||
Else
|
||||
MessageBox.Show(EgtMsg(50108), EgtMsg(50101), MessageBoxButton.OK, MessageBoxImage.Exclamation)
|
||||
End If
|
||||
@@ -90,6 +118,32 @@ Public Class CompoPanelViewModel
|
||||
|
||||
#End Region ' CompoBtnCommand
|
||||
|
||||
#Region "GoToAssemblyBtnCommand"
|
||||
|
||||
''' <summary>
|
||||
''' Returns a command that do Exec.
|
||||
''' </summary>
|
||||
Public ReadOnly Property GoToAssemblyBtnCommand As ICommand
|
||||
Get
|
||||
If m_CmdGoToAssemblyBtn Is Nothing Then
|
||||
m_CmdGoToAssemblyBtn = New Command(AddressOf GoToAssemblyBtn)
|
||||
End If
|
||||
Return m_CmdGoToAssemblyBtn
|
||||
End Get
|
||||
End Property
|
||||
|
||||
''' <summary>
|
||||
''' Execute the Exec. This method is invoked by the ExecCommand.
|
||||
''' </summary>
|
||||
'''
|
||||
|
||||
Public Sub GoToAssemblyBtn(param As Object)
|
||||
Map.refMainWindowVM.SelectedPage = MainWindowVM.ListPageEnum.nAssemblyPage
|
||||
ExecDoors(Map.refSceneManagerVM.ProjectScene, IniFile.m_sTempDir & "\" & TEMP_ASSEMBLY)
|
||||
End Sub
|
||||
|
||||
#End Region ' GoToAssemblyBtnCommand
|
||||
|
||||
#Region "ENTERREFRESH"
|
||||
|
||||
''' <summary>
|
||||
@@ -105,7 +159,7 @@ Public Class CompoPanelViewModel
|
||||
End Property
|
||||
|
||||
Public Sub EnterRefresh()
|
||||
DirectCast(m_rfMainWindowViewModel.SceneManager.DataContext, SceneManagerViewModel).RefreshBtn()
|
||||
Map.refSceneManagerVM.RefreshBtn()
|
||||
End Sub
|
||||
|
||||
#End Region ' EnterRefresh
|
||||
@@ -1,31 +0,0 @@
|
||||
<UserControl x:Class="CompoPanelView"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
|
||||
<UserControl.InputBindings>
|
||||
<KeyBinding Key="Enter" Command="{Binding RefreshCmd}"/>
|
||||
</UserControl.InputBindings>
|
||||
|
||||
<ItemsControl ItemsSource="{Binding CompoTypeList}" Focusable="True">
|
||||
|
||||
<ItemsControl.InputBindings>
|
||||
<KeyBinding Key="Enter" Command="{Binding RefreshCmd}"/>
|
||||
</ItemsControl.InputBindings>
|
||||
|
||||
<ItemsControl.ItemsPanel>
|
||||
<ItemsPanelTemplate>
|
||||
<UniformGrid Columns="1"/>
|
||||
</ItemsPanelTemplate>
|
||||
</ItemsControl.ItemsPanel>
|
||||
<ItemsControl.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<Button Name="Compo" Content="{Binding Name}"
|
||||
Command="{Binding DataContext.CompoBtnCommand,
|
||||
RelativeSource={RelativeSource AncestorType={x:Type UserControl}}}"
|
||||
CommandParameter="{Binding}"
|
||||
Focusable="False"/>
|
||||
</DataTemplate>
|
||||
</ItemsControl.ItemTemplate>
|
||||
</ItemsControl>
|
||||
|
||||
</UserControl>
|
||||
@@ -1,3 +0,0 @@
|
||||
Public Class CompoPanelView
|
||||
|
||||
End Class
|
||||
@@ -6,6 +6,9 @@
|
||||
Return m_Name
|
||||
End Get
|
||||
End Property
|
||||
Public Sub SetName(Name As String)
|
||||
m_Name = Name
|
||||
End Sub
|
||||
|
||||
Private m_DDFName As String
|
||||
Public ReadOnly Property DDFName As String
|
||||
@@ -13,6 +16,9 @@
|
||||
Return m_DDFName
|
||||
End Get
|
||||
End Property
|
||||
Public Sub SetDDFName(DDFName As String)
|
||||
m_DDFName = DDFName
|
||||
End Sub
|
||||
|
||||
Private m_Path As String
|
||||
Public ReadOnly Property Path As String
|
||||
@@ -20,11 +26,25 @@
|
||||
Return m_Path
|
||||
End Get
|
||||
End Property
|
||||
Public Sub SetPath(Path As String)
|
||||
m_Path = Path
|
||||
End Sub
|
||||
|
||||
Sub New(sName As String, sDDFName As String, sPath As String)
|
||||
Private m_JambSide As String
|
||||
Public ReadOnly Property JambSide As String
|
||||
Get
|
||||
Return m_JambSide
|
||||
End Get
|
||||
End Property
|
||||
Public Sub SetJambSide(JambSide As String)
|
||||
m_JambSide = JambSide
|
||||
End Sub
|
||||
|
||||
Sub New(sName As String, sDDFName As String, sPath As String, sJambSide As String)
|
||||
m_Name = sName
|
||||
m_DDFName = sDDFName
|
||||
m_Path = sPath
|
||||
m_JambSide = sJambSide
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
|
||||
@@ -50,7 +50,7 @@ Module ConstCompo
|
||||
Public Const K_PROFILES As String = "profiles"
|
||||
Public Const K_LOCKEDGE As String = "lockedge"
|
||||
Public Const K_MACHINING As String = "machining"
|
||||
Public Const K_OVERMATERAL As String = "overmaterial"
|
||||
Public Const K_OVERMATERIAL As String = "overmaterial"
|
||||
Public Const K_HINGEEDGE As String = "hingeedge"
|
||||
Public Const K_TOP As String = "top"
|
||||
Public Const K_BOTTOM As String = "bottom"
|
||||
@@ -68,4 +68,6 @@ Module ConstCompo
|
||||
Public Const K_NGEEXTENSION As String = ".nge"
|
||||
Public Const K_LUAEXTENSION As String = ".lua"
|
||||
Public Const K_DDTEXTENSION As String = ".ddt"
|
||||
|
||||
Public Const K_DOORNUMBER As Integer = 5
|
||||
End Module
|
||||
|
||||
@@ -42,6 +42,8 @@ Module ConstGen
|
||||
' sottodirettorio Template
|
||||
Public Const TEMPLATE_DIR As String = "Template"
|
||||
' File ddf utilizzato per il disegno corrente
|
||||
Public Const TEMP_FILE As String = "CurrDoor.ddf"
|
||||
Public Const TEMP_FILE As String = "CurrPart.ddf"
|
||||
' File ddf utilizzato per mostrare tutto l'assemblato corrente
|
||||
Public Const TEMP_ASSEMBLY As String = "CurrAssembly.ddf"
|
||||
Public Const TEMP_FILE_TXT As String = "CurrDoor.txt"
|
||||
End Module
|
||||
|
||||
@@ -44,12 +44,16 @@ Module ConstIni
|
||||
Public Const K_BEVELU_INI As String = "BevelUp"
|
||||
Public Const K_BEVELD_INI As String = "BevelDowm"
|
||||
|
||||
Public Const S_MACHININGASSEMBLY As String = "MachiningAssembly"
|
||||
|
||||
Public Const S_MACHINING As String = "Machining"
|
||||
Public Const K_LOCKEDGEISCHECKED_INI As String = "LockEdgeIsChecked"
|
||||
Public Const K_HINGEDGEEISCHECKED_INI As String = "HingeEdgeIsChecked"
|
||||
Public Const K_TOPISCHECKED_INI As String = "TopEdgeIsChecked"
|
||||
Public Const K_BOTTOMISCHECKED_INI As String = "BottomEdgeIsChecked"
|
||||
|
||||
Public Const S_OVERMATERIALASSEMBLY As String = "OverMaterialAssembly"
|
||||
|
||||
Public Const S_OVERMATERIAL As String = "OverMaterial"
|
||||
Public Const K_LOCKEDGEOVERMATERIAL_INI As String = "LockEdgeOverMaterial"
|
||||
Public Const K_HINGEDGEOVERMATERIAL_INI As String = "HingeEdgeOverMaterial"
|
||||
@@ -59,6 +63,33 @@ Module ConstIni
|
||||
Public Const S_COMPOORDER As String = "CompoOrder"
|
||||
Public Const K_COMPOORDER_INI As String = "CompoDDFOrder"
|
||||
|
||||
Public Const S_LIGHT As String = "Light"
|
||||
Public Const K_LIGHTUP As String = "LightUp"
|
||||
Public Const K_LIGHTBOTTOM As String = "LightBottom"
|
||||
Public Const K_LIGHTHINGE As String = "LightHinge"
|
||||
Public Const K_LIGHTLOCK As String = "LightLock"
|
||||
|
||||
Public Const S_SIZEJAMB As String = "SizeJamb"
|
||||
Public Const S_OVERLAP As String = "Overlap"
|
||||
Public Const K_OVERLAPTOP As String = "OverlapTop"
|
||||
Public Const K_OVERLAPHINGE As String = "OverlapHinge"
|
||||
Public Const K_OVERLAPLOCK As String = "OverlapLock"
|
||||
Public Const K_EXTERIOR As String = "Exterior"
|
||||
Public Const K_DELTAT As String = "DeltaT"
|
||||
Public Const K_THICKNESSHEAD As String = "ThicknessHead"
|
||||
|
||||
Public Const S_EDGEASSEMBLY = "EdgeAssembly"
|
||||
|
||||
Public Const S_PART As String = "Part"
|
||||
Public Const K_TOPJAMB As String = "TopJamb"
|
||||
Public Const K_LEFTJAMB As String = "LeftJamb"
|
||||
Public Const K_BOTTOMJAMB As String = "BottomJamb"
|
||||
Public Const K_RIGHTJAMB As String = "RightJamb"
|
||||
|
||||
Public Const S_DOORSNUMBER As String = "DoorsNumber"
|
||||
Public Const K_DOORSLISTNUMBER As String = "DoorsNumberList"
|
||||
Public Const K_DOORSELECTEDTNUMBER As String = "DoorsNumberSelected"
|
||||
|
||||
Public Const S_LANGUAGES As String = "Languages"
|
||||
Public Const K_LANGUAGE As String = "Language"
|
||||
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
Public Class BooleanToVisibilityConverter
|
||||
Implements IValueConverter
|
||||
|
||||
Public Function Convert(value As Object, targetType As Type, parameter As Object, culture As System.Globalization.CultureInfo) As Object Implements IValueConverter.Convert
|
||||
Dim VisbibilityBottom As Visibility = Visibility.Hidden
|
||||
If CBool(value) Then
|
||||
VisbibilityBottom = Visibility.Visible
|
||||
Else
|
||||
VisbibilityBottom = Visibility.Hidden
|
||||
End If
|
||||
Return VisbibilityBottom
|
||||
End Function
|
||||
|
||||
Public Function ConvertBack(value As Object, targetType As Type, parameter As Object, culture As System.Globalization.CultureInfo) As Object Implements IValueConverter.ConvertBack
|
||||
Throw New NotImplementedException
|
||||
End Function
|
||||
|
||||
End Class
|
||||
@@ -0,0 +1,17 @@
|
||||
Imports System.IO
|
||||
|
||||
Public Class PathConverter
|
||||
Implements IValueConverter
|
||||
|
||||
Public Function Convert(value As Object, targetType As Type, parameter As Object, culture As System.Globalization.CultureInfo) As Object Implements IValueConverter.Convert
|
||||
Dim Local_AsseblyName As AssemblyName = DirectCast(value, AssemblyName)
|
||||
Dim sPath As String = Local_AsseblyName.Name
|
||||
Return Path.GetFileNameWithoutExtension(sPath)
|
||||
End Function
|
||||
|
||||
Public Function ConvertBack(value As Object, targetType As Type, parameter As Object, culture As System.Globalization.CultureInfo) As Object Implements IValueConverter.ConvertBack
|
||||
Throw New NotImplementedException
|
||||
End Function
|
||||
|
||||
End Class
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
Imports System.IO
|
||||
|
||||
Public Class ProjectVisibilityConverter
|
||||
Implements IValueConverter
|
||||
|
||||
Public Function Convert(value As Object, targetType As Type, parameter As Object, culture As System.Globalization.CultureInfo) As Object Implements IValueConverter.Convert
|
||||
'Dim Local_Project As New Project
|
||||
'Local_Project = DirectCast(value, Project)
|
||||
Dim sProjectName As String = CStr(value)
|
||||
Return If(Directory.Exists(sProjectName), Visibility.Visible, Visibility.Collapsed)
|
||||
End Function
|
||||
|
||||
Public Function ConvertBack(value As Object, targetType As Type, parameter As Object, culture As System.Globalization.CultureInfo) As Object Implements IValueConverter.ConvertBack
|
||||
Throw New NotImplementedException
|
||||
End Function
|
||||
|
||||
End Class
|
||||
@@ -0,0 +1,11 @@
|
||||
Public Class TrueToFalse
|
||||
Implements IValueConverter
|
||||
|
||||
Public Function Convert(value As Object, targetType As Type, parameter As Object, culture As System.Globalization.CultureInfo) As Object Implements IValueConverter.Convert
|
||||
Return Not CBool(value)
|
||||
End Function
|
||||
|
||||
Public Function ConvertBack(value As Object, targetType As Type, parameter As Object, culture As System.Globalization.CultureInfo) As Object Implements IValueConverter.ConvertBack
|
||||
Throw New NotImplementedException
|
||||
End Function
|
||||
End Class
|
||||
@@ -6,36 +6,167 @@ Imports System.Text.RegularExpressions
|
||||
Friend Module DdfFile
|
||||
|
||||
' il vettore che conterrà tutti le linee del file DDF da leggere
|
||||
Private FileContent As String()
|
||||
Friend FileContent As String()
|
||||
' lista ordinata delle componenti da stampare
|
||||
Friend CompoListOrder As New List(Of String)
|
||||
Friend UnitMeasure As String
|
||||
|
||||
#Region "SCRITTURA DDF"
|
||||
|
||||
'genero le stringhe che dovranno essere scritte nel DDF
|
||||
' !!! attenzione !!! tutte le volte che stampo sul file di CurrDoor.ddf la variabile booelana DEVE essere settata su True
|
||||
Friend Sub WriteDDF(Door As Door, sPath As String, bIsDDf As Boolean)
|
||||
' Door = DirectCast(m_rfMainWindowViewModel.DoorParameters.DataContext, DoorParametersViewModel).CurrDoor
|
||||
''genero le stringhe che dovranno essere scritte nel DDF
|
||||
'' !!! attenzione !!! tutte le volte che stampo sul file di CurrDoor.ddf la variabile booelana DEVE essere settata su True
|
||||
'Friend Sub WriteDDF(Part As Part, sPath As String, bIsDDf As Boolean)
|
||||
' ' pulisco lista prima di iniziare a scrivere
|
||||
' Dim DdfFileContent As New List(Of String)
|
||||
' If String.IsNullOrEmpty(Part.Measure) Then
|
||||
' Part.Measure = OptionModule.m_SelectedMeasureUnit
|
||||
' End If
|
||||
' DdfFileContent.Add("#EGTDOORCREATOR")
|
||||
' 'Genero una lista di stringhe
|
||||
' If Part.Measure = "Inches" Then
|
||||
' Part.Measure = "inches"
|
||||
' End If
|
||||
' DdfFileContent.Add(ConstCompo.K_MEASURES & ": " & Part.Measure)
|
||||
' ' aggiungo una riga vuota per separare la lista successiva
|
||||
' DdfFileContent.Add("")
|
||||
' If String.IsNullOrEmpty(Part.Code) Then
|
||||
' Part.Code = "1111"
|
||||
' End If
|
||||
' DdfFileContent.Add(ConstCompo.K_CODE & ": " & Part.Code)
|
||||
' ' aggiungo una riga vuota per separare la lista successiva
|
||||
' DdfFileContent.Add("")
|
||||
' DdfFileContent.Add(ConstCompo.S_ORDER & ":")
|
||||
' ' Probablimente da cambiare
|
||||
' DdfFileContent.Add(ConstCompo.K_SPACE3 & ConstCompo.K_CUSTOMER & ": ")
|
||||
' DdfFileContent.Add(ConstCompo.K_SPACE3 & ConstCompo.K_ELEVATION & ": ")
|
||||
' DdfFileContent.Add(ConstCompo.K_SPACE3 & ConstCompo.K_PROJECT & ": ")
|
||||
' DdfFileContent.Add(ConstCompo.K_SPACE3 & ConstCompo.K_PO & ": ")
|
||||
' DdfFileContent.Add(ConstCompo.K_SPACE3 & ConstCompo.K_LINE & ": ")
|
||||
' ' aggiungo una riga vuota per separare la lista successiva
|
||||
' DdfFileContent.Add("")
|
||||
' DdfFileContent.Add(ConstCompo.K_DATE & ":" & " " & System.DateTime.Now.ToString("dd/MM/yyyy"))
|
||||
' ' aggiungo una riga vuota per separare la lista successiva
|
||||
' DdfFileContent.Add("")
|
||||
|
||||
' '---------------------------------------------------------------------------------------------------------
|
||||
' ' è specificato il tipo significa che abbiamo un assemblato
|
||||
' If Not IsNothing(Part.TypePart) Then
|
||||
' DdfFileContent.Add("piece: " & Part.TypePart)
|
||||
' End If
|
||||
' DdfFileContent.Add("")
|
||||
' '---------------------------------------------------------------------------------------------------------
|
||||
|
||||
' Dim dVal As Double = 0
|
||||
' DdfFileContent.Add(ConstCompo.K_SIZE & ":")
|
||||
' If Not StringToDouble(Part.Width, dVal) Then
|
||||
' MessageBox.Show(EgtMsg(50106) & K_WIDTH, EgtMsg(50101), MessageBoxButton.OK, MessageBoxImage.Error)
|
||||
' Return
|
||||
' End If
|
||||
' DdfFileContent.Add(ConstCompo.K_SPACE3 & ConstCompo.K_WIDTH & ": " & DoubleToString(dVal, 5))
|
||||
' If Not StringToDouble(Part.Height, dVal) Then
|
||||
' MessageBox.Show(EgtMsg(50106) & K_HEIGHT, EgtMsg(50101), MessageBoxButton.OK, MessageBoxImage.Error)
|
||||
' Return
|
||||
' End If
|
||||
' DdfFileContent.Add(ConstCompo.K_SPACE3 & ConstCompo.K_HEIGHT & ": " & DoubleToString(dVal, 5))
|
||||
' If Not StringToDouble(Part.Thickness, dVal) Then
|
||||
' MessageBox.Show(EgtMsg(50106) & K_THICKNESS, EgtMsg(50101), MessageBoxButton.OK, MessageBoxImage.Error)
|
||||
' Return
|
||||
' End If
|
||||
' DdfFileContent.Add(ConstCompo.K_SPACE3 & ConstCompo.K_THICKNESS & ": " & DoubleToString(dVal, 5))
|
||||
' ' aggiungo il peso della porta
|
||||
' If Part.IsCheckedWeight = Visibility.Visible Then
|
||||
' If Not StringToDouble(Part.Weight, dVal) Then
|
||||
' MessageBox.Show(EgtMsg(50106) & K_WEIGHT, EgtMsg(50101), MessageBoxButton.OK, MessageBoxImage.Error)
|
||||
' Return
|
||||
' End If
|
||||
' DdfFileContent.Add(ConstCompo.K_SPACE3 & ConstCompo.K_WEIGHT & ": " & Part.Weight)
|
||||
' End If
|
||||
' ' aggiungo una riga vuota per separare la lista successiva
|
||||
' DdfFileContent.Add("")
|
||||
' DdfFileContent.Add("" & ConstCompo.K_SWING & ": " & Part.Swing)
|
||||
' ' aggiungo una riga vuota per separare la lista successiva
|
||||
' DdfFileContent.Add("")
|
||||
|
||||
' ' aggiungo il secure nullo al DDF
|
||||
' DdfFileContent.Add("" & ConstCompo.K_SECURE & ": " & "0")
|
||||
' ' aggiungo una riga vuota per separare la lista successiva
|
||||
' DdfFileContent.Add("")
|
||||
' DdfFileContent.Add("" & ConstCompo.K_PROFILES & ":")
|
||||
' DdfFileContent.Add(ConstCompo.K_SPACE3 & ConstCompo.K_LOCKEDGE & ": " & Part.LockEdgeType.Name)
|
||||
' DdfFileContent.Add(ConstCompo.K_SPACE5 & ConstCompo.K_MACHINING & ": " & ConvertBooleanToOnOff(Part.LockEdgeMachining))
|
||||
' If Not StringToDouble(Part.LockEdgeOverMaterial, dVal) Then
|
||||
' MessageBox.Show(EgtMsg(50106) & K_LOCKEDGEOVERMATERIAL_INI, EgtMsg(50101), MessageBoxButton.OK, MessageBoxImage.Error)
|
||||
' Return
|
||||
' End If
|
||||
' DdfFileContent.Add(ConstCompo.K_SPACE5 & ConstCompo.K_OVERMATERIAL & ": " & DoubleToString(dVal, 5))
|
||||
' DdfFileContent.Add(ConstCompo.K_SPACE3 & ConstCompo.K_HINGEEDGE & ": " & Part.HingeEdgeType.Name)
|
||||
' DdfFileContent.Add(ConstCompo.K_SPACE5 & ConstCompo.K_MACHINING & ": " & ConvertBooleanToOnOff(Part.HingeEdgeMachining))
|
||||
' If Not StringToDouble(Part.HingeEdgeOverMaterial, dVal) Then
|
||||
' MessageBox.Show(EgtMsg(50106) & K_HINGEDGEOVERMATERIAL_INI, EgtMsg(50101), MessageBoxButton.OK, MessageBoxImage.Error)
|
||||
' Return
|
||||
' End If
|
||||
' DdfFileContent.Add(ConstCompo.K_SPACE5 & ConstCompo.K_OVERMATERIAL & ": " & DoubleToString(dVal, 5))
|
||||
' DdfFileContent.Add(ConstCompo.K_SPACE3 & ConstCompo.K_TOP & ": " & Part.TopType.Name)
|
||||
' DdfFileContent.Add(ConstCompo.K_SPACE5 & ConstCompo.K_MACHINING & ": " & ConvertBooleanToOnOff(Part.TopMachining))
|
||||
' If Not StringToDouble(Part.TopOverMaterial, dVal) Then
|
||||
' MessageBox.Show(EgtMsg(50106) & K_TOPOVERMATERIAL_INI, EgtMsg(50101), MessageBoxButton.OK, MessageBoxImage.Error)
|
||||
' Return
|
||||
' End If
|
||||
' DdfFileContent.Add(ConstCompo.K_SPACE5 & ConstCompo.K_OVERMATERIAL & ": " & DoubleToString(dVal, 5))
|
||||
' DdfFileContent.Add(ConstCompo.K_SPACE3 & ConstCompo.K_BOTTOM & ": " & Part.BottomType.Name)
|
||||
' DdfFileContent.Add(ConstCompo.K_SPACE5 & ConstCompo.K_MACHINING & ": " & ConvertBooleanToOnOff(Part.BottomMachining))
|
||||
' If Not StringToDouble(Part.BottomOverMaterial, dVal) Then
|
||||
' MessageBox.Show(EgtMsg(50106) & K_BOTTOMOVERMATERIAL_INI, EgtMsg(50101), MessageBoxButton.OK, MessageBoxImage.Error)
|
||||
' Return
|
||||
' End If
|
||||
' DdfFileContent.Add(ConstCompo.K_SPACE5 & ConstCompo.K_OVERMATERIAL & ": " & DoubleToString(dVal, 5))
|
||||
|
||||
' ' Riordino e stampo le compo
|
||||
' SearchCompo(DdfFileContent, Part, bIsDDf)
|
||||
' If Not Directory.Exists(Path.GetDirectoryName(sPath)) Then
|
||||
' Directory.CreateDirectory(Path.GetDirectoryName(sPath))
|
||||
' End If
|
||||
' File.WriteAllLines(sPath, DdfFileContent, Text.Encoding.UTF8)
|
||||
'End Sub
|
||||
|
||||
' Questa funzione dovrà sostituire quella precedente (Scritta sopra)
|
||||
Private IdIndex As Integer = 0
|
||||
|
||||
Friend Sub WriteDDFPart(Part As Part, sPath As String, bIsDDf As Boolean, bIsForAssembly As Boolean)
|
||||
' pulisco lista prima di iniziare a scrivere
|
||||
Dim DdfFileContent As New List(Of String)
|
||||
If String.IsNullOrEmpty(Door.Measure) Then
|
||||
Door.Measure = OptionModule.m_SelectedMeasureUnit
|
||||
' quindi significa che non è mai stato caricato il valore
|
||||
If IsNothing(Part.Measure) Then
|
||||
Part.Measure = OptionModule.m_SelectedMeasureUnit
|
||||
End If
|
||||
DdfFileContent.Add("#EGTDOORCREATOR")
|
||||
If Not IsNothing(Part.TypePart) Then
|
||||
DdfFileContent.Add("#" & PrintTitleDDFPart(Part.TypePart))
|
||||
If Part.IsActive Then
|
||||
DdfFileContent.Add("produce: " & "true")
|
||||
Else
|
||||
DdfFileContent.Add("produce: " & "false")
|
||||
End If
|
||||
End If
|
||||
DdfFileContent.Add("")
|
||||
'Genero una lista di stringhe
|
||||
If Door.Measure = "Inches" Then
|
||||
Door.Measure = "inches"
|
||||
If Part.Measure = "Inches" Then
|
||||
Part.Measure = "inches"
|
||||
End If
|
||||
DdfFileContent.Add(ConstCompo.K_MEASURES & ": " & Door.Measure)
|
||||
DdfFileContent.Add(ConstCompo.K_MEASURES & ": " & Part.Measure)
|
||||
' aggiungo una riga vuota per separare la lista successiva
|
||||
DdfFileContent.Add("")
|
||||
If String.IsNullOrEmpty(Door.Code) Then
|
||||
Door.Code = "1111"
|
||||
If Not IsNothing(Part.TypePart) Then
|
||||
Part.Code = " " & PrintTitleDDFPart(Part.TypePart)
|
||||
DdfFileContent.Add(ConstCompo.K_CODE & ": " & Part.Code)
|
||||
' aggiungo una riga vuota per separare la lista successiva
|
||||
DdfFileContent.Add("")
|
||||
Else
|
||||
DdfFileContent.Add(ConstCompo.K_CODE & ": " & "1111")
|
||||
' aggiungo una riga vuota per separare la lista successiva
|
||||
DdfFileContent.Add("")
|
||||
End If
|
||||
DdfFileContent.Add(ConstCompo.K_CODE & ": " & Door.Code)
|
||||
' aggiungo una riga vuota per separare la lista successiva
|
||||
DdfFileContent.Add("")
|
||||
|
||||
DdfFileContent.Add(ConstCompo.S_ORDER & ":")
|
||||
' Probablimente da cambiare
|
||||
DdfFileContent.Add(ConstCompo.K_SPACE3 & ConstCompo.K_CUSTOMER & ": ")
|
||||
@@ -48,34 +179,90 @@ Friend Module DdfFile
|
||||
DdfFileContent.Add(ConstCompo.K_DATE & ":" & " " & System.DateTime.Now.ToString("dd/MM/yyyy"))
|
||||
' aggiungo una riga vuota per separare la lista successiva
|
||||
DdfFileContent.Add("")
|
||||
' è specificato il tipo significa che abbiamo un assemblato
|
||||
If Not IsNothing(Part.TypePart) And Not Part.IsNotAssembly Then
|
||||
DdfFileContent.Add("piece: " & Part.TypePart)
|
||||
Else
|
||||
DdfFileContent.Add("piece: " & "DO_1")
|
||||
End If
|
||||
DdfFileContent.Add("")
|
||||
|
||||
If Not Part.IsNotAssembly Then
|
||||
If Not IsNothing(Part.TypePart) Then
|
||||
' il posizionamento della prima porta sta nell'origine
|
||||
If Part.TypePart = "DO_1" Then
|
||||
DdfFileContent.Add("position: ")
|
||||
DdfFileContent.Add(ConstCompo.K_SPACE3 & "x: " & "0")
|
||||
DdfFileContent.Add(ConstCompo.K_SPACE3 & "y: " & "0")
|
||||
DdfFileContent.Add(ConstCompo.K_SPACE3 & "z: " & "0")
|
||||
ElseIf Part.TypePart = "DO_2" Then
|
||||
' si trova traslata verso destra dello spessore DO_1 sommato a LightLock"
|
||||
Dim x_DO_1 As Double
|
||||
Dim dLightLock As Double
|
||||
StringToDouble(Map.refAssemblyPageVM.CurrAssembly.GetArrayPartDoor(0).Door.Width, x_DO_1)
|
||||
StringToDouble(Map.refAssemblyPageVM.CurrAssembly.LightLock, dLightLock)
|
||||
Dim x As String = DoubleToString(x_DO_1 + dLightLock, 4)
|
||||
DdfFileContent.Add("position: ")
|
||||
DdfFileContent.Add(ConstCompo.K_SPACE3 & "x: " & x)
|
||||
DdfFileContent.Add(ConstCompo.K_SPACE3 & "y: " & "0")
|
||||
DdfFileContent.Add(ConstCompo.K_SPACE3 & "z: " & "0")
|
||||
' Jamb Sinistro serratura
|
||||
ElseIf Part.TypePart.Contains("FL_") Then
|
||||
Dim x As String = PositionJamb_X(Part)
|
||||
Dim y As String = PositionJamb_Y(Part)
|
||||
Dim z As String = PositionJamb_Z(Part)
|
||||
DdfFileContent.Add("position: ")
|
||||
DdfFileContent.Add(ConstCompo.K_SPACE3 & "x: -" & x)
|
||||
DdfFileContent.Add(ConstCompo.K_SPACE3 & "y: -" & y)
|
||||
DdfFileContent.Add(ConstCompo.K_SPACE3 & "z: -" & z)
|
||||
ElseIf Part.TypePart.Contains("FR_") Then
|
||||
DdfFileContent.Add("position: ")
|
||||
DdfFileContent.Add(ConstCompo.K_SPACE3 & "x: " & PositionJamb_X(Part))
|
||||
DdfFileContent.Add(ConstCompo.K_SPACE3 & "y: -" & PositionJamb_Y(Part))
|
||||
DdfFileContent.Add(ConstCompo.K_SPACE3 & "z: -" & PositionJamb_Z(Part))
|
||||
ElseIf Part.TypePart.Contains("FT_") Then
|
||||
DdfFileContent.Add("position: ")
|
||||
DdfFileContent.Add(ConstCompo.K_SPACE3 & "x: -" & PositionJamb_X(Part))
|
||||
DdfFileContent.Add(ConstCompo.K_SPACE3 & "y: " & PositionJamb_Y(Part))
|
||||
DdfFileContent.Add(ConstCompo.K_SPACE3 & "z: -" & PositionJamb_Z(Part))
|
||||
ElseIf Part.TypePart.Contains("FB_") Then
|
||||
DdfFileContent.Add("position: ")
|
||||
DdfFileContent.Add(ConstCompo.K_SPACE3 & "x: -" & PositionJamb_X(Part))
|
||||
DdfFileContent.Add(ConstCompo.K_SPACE3 & "y: -" & PositionJamb_Y(Part))
|
||||
DdfFileContent.Add(ConstCompo.K_SPACE3 & "z: -" & PositionJamb_Z(Part))
|
||||
End If
|
||||
DdfFileContent.Add("")
|
||||
End If
|
||||
End If
|
||||
|
||||
Dim dVal As Double = 0
|
||||
DdfFileContent.Add(ConstCompo.K_SIZE & ":")
|
||||
If Not StringToDouble(Door.Width, dVal) Then
|
||||
If Not StringToDouble(Part.Width, dVal) Then
|
||||
MessageBox.Show(EgtMsg(50106) & K_WIDTH, EgtMsg(50101), MessageBoxButton.OK, MessageBoxImage.Error)
|
||||
Return
|
||||
End If
|
||||
DdfFileContent.Add(ConstCompo.K_SPACE3 & ConstCompo.K_WIDTH & ": " & DoubleToString(dVal, 5))
|
||||
If Not StringToDouble(Door.Height, dVal) Then
|
||||
If Not StringToDouble(Part.Height, dVal) Then
|
||||
MessageBox.Show(EgtMsg(50106) & K_HEIGHT, EgtMsg(50101), MessageBoxButton.OK, MessageBoxImage.Error)
|
||||
Return
|
||||
End If
|
||||
DdfFileContent.Add(ConstCompo.K_SPACE3 & ConstCompo.K_HEIGHT & ": " & DoubleToString(dVal, 5))
|
||||
If Not StringToDouble(Door.Thickness, dVal) Then
|
||||
If Not StringToDouble(Part.Thickness, dVal) Then
|
||||
MessageBox.Show(EgtMsg(50106) & K_THICKNESS, EgtMsg(50101), MessageBoxButton.OK, MessageBoxImage.Error)
|
||||
Return
|
||||
End If
|
||||
DdfFileContent.Add(ConstCompo.K_SPACE3 & ConstCompo.K_THICKNESS & ": " & DoubleToString(dVal, 5))
|
||||
' aggiungo il peso della porta
|
||||
If Door.IsCheckedWeight = Visibility.Visible Then
|
||||
If Not StringToDouble(Door.Weight, dVal) Then
|
||||
If Part.IsCheckedWeight = Visibility.Visible Then
|
||||
If Not StringToDouble(Part.Weight, dVal) Then
|
||||
MessageBox.Show(EgtMsg(50106) & K_WEIGHT, EgtMsg(50101), MessageBoxButton.OK, MessageBoxImage.Error)
|
||||
Return
|
||||
End If
|
||||
DdfFileContent.Add(ConstCompo.K_SPACE3 & ConstCompo.K_WEIGHT & ": " & Door.Weight)
|
||||
DdfFileContent.Add(ConstCompo.K_SPACE3 & ConstCompo.K_WEIGHT & ": " & Part.Weight)
|
||||
End If
|
||||
' aggiungo una riga vuota per separare la lista successiva
|
||||
DdfFileContent.Add("")
|
||||
DdfFileContent.Add("" & ConstCompo.K_SWING & ": " & Door.Swing)
|
||||
DdfFileContent.Add("" & ConstCompo.K_SWING & ": " & Part.Swing)
|
||||
' aggiungo una riga vuota per separare la lista successiva
|
||||
DdfFileContent.Add("")
|
||||
|
||||
@@ -84,45 +271,203 @@ Friend Module DdfFile
|
||||
' aggiungo una riga vuota per separare la lista successiva
|
||||
DdfFileContent.Add("")
|
||||
DdfFileContent.Add("" & ConstCompo.K_PROFILES & ":")
|
||||
DdfFileContent.Add(ConstCompo.K_SPACE3 & ConstCompo.K_LOCKEDGE & ": " & Door.LockEdgeType.Name)
|
||||
DdfFileContent.Add(ConstCompo.K_SPACE5 & ConstCompo.K_MACHINING & ": " & ConvertBooleanToOnOff(Door.LockEdgeMachining))
|
||||
If Not StringToDouble(Door.LockEdgeOverMaterial, dVal) Then
|
||||
DdfFileContent.Add(ConstCompo.K_SPACE3 & ConstCompo.K_LOCKEDGE & ": " & Part.LockEdgeType.Name)
|
||||
DdfFileContent.Add(ConstCompo.K_SPACE5 & ConstCompo.K_MACHINING & ": " & ConvertBooleanToOnOff(Part.LockEdgeMachining))
|
||||
If Not StringToDouble(Part.LockEdgeOverMaterial, dVal) Then
|
||||
MessageBox.Show(EgtMsg(50106) & K_LOCKEDGEOVERMATERIAL_INI, EgtMsg(50101), MessageBoxButton.OK, MessageBoxImage.Error)
|
||||
Return
|
||||
End If
|
||||
DdfFileContent.Add(ConstCompo.K_SPACE5 & ConstCompo.K_OVERMATERAL & ": " & DoubleToString(dVal, 5))
|
||||
DdfFileContent.Add(ConstCompo.K_SPACE3 & ConstCompo.K_HINGEEDGE & ": " & Door.HingeEdgeType.Name)
|
||||
DdfFileContent.Add(ConstCompo.K_SPACE5 & ConstCompo.K_MACHINING & ": " & ConvertBooleanToOnOff(Door.HingeEdgeMachining))
|
||||
If Not StringToDouble(Door.HingeEdgeOverMaterial, dVal) Then
|
||||
DdfFileContent.Add(ConstCompo.K_SPACE5 & ConstCompo.K_OVERMATERIAL & ": " & DoubleToString(dVal, 5))
|
||||
DdfFileContent.Add(ConstCompo.K_SPACE3 & ConstCompo.K_HINGEEDGE & ": " & Part.HingeEdgeType.Name)
|
||||
DdfFileContent.Add(ConstCompo.K_SPACE5 & ConstCompo.K_MACHINING & ": " & ConvertBooleanToOnOff(Part.HingeEdgeMachining))
|
||||
If Not StringToDouble(Part.HingeEdgeOverMaterial, dVal) Then
|
||||
MessageBox.Show(EgtMsg(50106) & K_HINGEDGEOVERMATERIAL_INI, EgtMsg(50101), MessageBoxButton.OK, MessageBoxImage.Error)
|
||||
Return
|
||||
End If
|
||||
DdfFileContent.Add(ConstCompo.K_SPACE5 & ConstCompo.K_OVERMATERAL & ": " & DoubleToString(dVal, 5))
|
||||
DdfFileContent.Add(ConstCompo.K_SPACE3 & ConstCompo.K_TOP & ": " & Door.TopType.Name)
|
||||
DdfFileContent.Add(ConstCompo.K_SPACE5 & ConstCompo.K_MACHINING & ": " & ConvertBooleanToOnOff(Door.TopMachining))
|
||||
If Not StringToDouble(Door.TopOverMaterial, dVal) Then
|
||||
DdfFileContent.Add(ConstCompo.K_SPACE5 & ConstCompo.K_OVERMATERIAL & ": " & DoubleToString(dVal, 5))
|
||||
DdfFileContent.Add(ConstCompo.K_SPACE3 & ConstCompo.K_TOP & ": " & Part.TopType.Name)
|
||||
DdfFileContent.Add(ConstCompo.K_SPACE5 & ConstCompo.K_MACHINING & ": " & ConvertBooleanToOnOff(Part.TopMachining))
|
||||
If Not StringToDouble(Part.TopOverMaterial, dVal) Then
|
||||
MessageBox.Show(EgtMsg(50106) & K_TOPOVERMATERIAL_INI, EgtMsg(50101), MessageBoxButton.OK, MessageBoxImage.Error)
|
||||
Return
|
||||
End If
|
||||
DdfFileContent.Add(ConstCompo.K_SPACE5 & ConstCompo.K_OVERMATERAL & ": " & DoubleToString(dVal, 5))
|
||||
DdfFileContent.Add(ConstCompo.K_SPACE3 & ConstCompo.K_BOTTOM & ": " & Door.BottomType.Name)
|
||||
DdfFileContent.Add(ConstCompo.K_SPACE5 & ConstCompo.K_MACHINING & ": " & ConvertBooleanToOnOff(Door.BottomMachining))
|
||||
If Not StringToDouble(Door.BottomOverMaterial, dVal) Then
|
||||
DdfFileContent.Add(ConstCompo.K_SPACE5 & ConstCompo.K_OVERMATERIAL & ": " & DoubleToString(dVal, 5))
|
||||
DdfFileContent.Add(ConstCompo.K_SPACE3 & ConstCompo.K_BOTTOM & ": " & Part.BottomType.Name)
|
||||
DdfFileContent.Add(ConstCompo.K_SPACE5 & ConstCompo.K_MACHINING & ": " & ConvertBooleanToOnOff(Part.BottomMachining))
|
||||
If Not StringToDouble(Part.BottomOverMaterial, dVal) Then
|
||||
MessageBox.Show(EgtMsg(50106) & K_BOTTOMOVERMATERIAL_INI, EgtMsg(50101), MessageBoxButton.OK, MessageBoxImage.Error)
|
||||
Return
|
||||
End If
|
||||
DdfFileContent.Add(ConstCompo.K_SPACE5 & ConstCompo.K_OVERMATERAL & ": " & DoubleToString(dVal, 5))
|
||||
DdfFileContent.Add(ConstCompo.K_SPACE5 & ConstCompo.K_OVERMATERIAL & ": " & DoubleToString(dVal, 5))
|
||||
|
||||
' Riordino e stampo le compo
|
||||
SearchCompo(DdfFileContent, Door, bIsDDf)
|
||||
SearchCompo(DdfFileContent, Part, bIsDDf)
|
||||
If Not Directory.Exists(Path.GetDirectoryName(sPath)) Then
|
||||
Directory.CreateDirectory(Path.GetDirectoryName(sPath))
|
||||
End If
|
||||
File.WriteAllLines(sPath, DdfFileContent, Text.Encoding.UTF8)
|
||||
'-----------------------------------------------------------------------------------------------------------------------------------
|
||||
'Stampa su file
|
||||
If bIsForAssembly Then
|
||||
File.AppendAllLines(sPath, DdfFileContent, Text.Encoding.UTF8)
|
||||
Else
|
||||
File.WriteAllLines(sPath, DdfFileContent, Text.Encoding.UTF8)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
#Region "Funzioni per il posizionamento"
|
||||
Private Function PositionJamb_Y(CurrPart As Part) As String
|
||||
Dim y As String
|
||||
Dim dLightBottom As Double
|
||||
Dim dThicknessJamb As Double
|
||||
Dim dLightUp As Double
|
||||
Dim dOverlapTop As Double
|
||||
Dim dHeightDoor As Double
|
||||
StringToDouble(Map.refAssemblyPageVM.CurrAssembly.LightUp, dLightUp)
|
||||
StringToDouble(Map.refAssemblyPageVM.CurrAssembly.OverlapTop, dOverlapTop)
|
||||
StringToDouble(Map.refAssemblyPageVM.CurrAssembly.Width, dThicknessJamb)
|
||||
StringToDouble(Map.refAssemblyPageVM.CurrAssembly.LightBottom, dLightBottom)
|
||||
StringToDouble(Map.refAssemblyPageVM.CurrAssembly.GetArrayPartDoor(0).Door.Height, dHeightDoor)
|
||||
If CurrPart.TypePart.Contains("E") Then
|
||||
If CurrPart.TypePart.Contains("FT_") Then
|
||||
y = DoubleToString(dHeightDoor - dOverlapTop + dLightUp, 4)
|
||||
Else
|
||||
y = DoubleToString(dLightBottom + dThicknessJamb, 4)
|
||||
End If
|
||||
Else
|
||||
If CurrPart.TypePart.Contains("FT_") Then
|
||||
y = DoubleToString(dHeightDoor + dLightUp, 4)
|
||||
Else
|
||||
y = DoubleToString(dLightBottom, 4)
|
||||
End If
|
||||
End If
|
||||
Return y
|
||||
End Function
|
||||
|
||||
Private Function PositionJamb_X(CurrPart As Part) As String
|
||||
Dim x As String = "0"
|
||||
Dim dLightLock As Double
|
||||
Dim dLightHinge As Double
|
||||
Dim dOverlapLock As Double
|
||||
Dim dOverlapHinge As Double
|
||||
Dim dThicknessJamb As Double
|
||||
Dim dWidthDoor_0 As Double
|
||||
Dim dWidthDoor_1 As Double
|
||||
StringToDouble(Map.refAssemblyPageVM.CurrAssembly.LightLock, dLightLock)
|
||||
StringToDouble(Map.refAssemblyPageVM.CurrAssembly.LightHinge, dLightHinge)
|
||||
StringToDouble(Map.refAssemblyPageVM.CurrAssembly.OverlapLock, dOverlapLock)
|
||||
StringToDouble(Map.refAssemblyPageVM.CurrAssembly.OverlapHinge, dOverlapHinge)
|
||||
StringToDouble(Map.refAssemblyPageVM.CurrAssembly.Width, dThicknessJamb)
|
||||
StringToDouble(Map.refAssemblyPageVM.CurrAssembly.GetArrayPartDoor(0).Door.Width, dWidthDoor_0)
|
||||
StringToDouble(Map.refAssemblyPageVM.CurrAssembly.GetArrayPartDoor(1).Door.Width, dWidthDoor_1)
|
||||
If CurrPart.TypePart.Contains("E") Then
|
||||
' posizione del Jamb sinistro
|
||||
If CurrPart.TypePart.Contains("FL_L") Then
|
||||
x = DoubleToString(dThicknessJamb - dOverlapLock + dLightLock, 4)
|
||||
ElseIf CurrPart.TypePart.Contains("FL_H") Then
|
||||
x = DoubleToString(dThicknessJamb - dOverlapHinge + dLightHinge, 4)
|
||||
End If
|
||||
' posiziono il jamb destro
|
||||
If CurrPart.TypePart.Contains("FR_") Then
|
||||
If Map.refAssemblyPageVM.CurrAssembly.DoorNumber = "1" Then
|
||||
If CurrPart.TypePart.Contains("FR_L") Then
|
||||
x = DoubleToString(dWidthDoor_0 - dOverlapLock + dLightLock, 4)
|
||||
ElseIf CurrPart.TypePart.Contains("FR_H") Then
|
||||
x = DoubleToString(dWidthDoor_0 - dOverlapHinge + dLightHinge, 4)
|
||||
End If
|
||||
Else
|
||||
x = DoubleToString(dWidthDoor_0 + dWidthDoor_1 - dOverlapHinge + dLightHinge + dLightLock, 4)
|
||||
End If
|
||||
End If
|
||||
' posiziono il jamb sopra
|
||||
If CurrPart.TypePart.Contains("FT_") Then
|
||||
If CurrPart.Swing.Contains("L") Then
|
||||
x = DoubleToString(dLightHinge, 4)
|
||||
Else
|
||||
x = DoubleToString(dLightLock, 4)
|
||||
End If
|
||||
End If
|
||||
' posiziono il jamb sotto
|
||||
If CurrPart.TypePart.Contains("FB_") Then
|
||||
If CurrPart.Swing.Contains("L") Then
|
||||
x = DoubleToString(dLightHinge, 4)
|
||||
Else
|
||||
x = DoubleToString(dLightLock, 4)
|
||||
End If
|
||||
End If
|
||||
Else
|
||||
' posizione del Jamb sinistro
|
||||
If CurrPart.TypePart.Contains("FL_L") Then
|
||||
x = DoubleToString(dThicknessJamb + dLightLock, 4)
|
||||
ElseIf CurrPart.TypePart.Contains("FL_H") Then
|
||||
x = DoubleToString(dThicknessJamb + dLightHinge, 4)
|
||||
End If
|
||||
' posiziono il jamb destro
|
||||
If CurrPart.TypePart.Contains("FR_") Then
|
||||
If Map.refAssemblyPageVM.CurrAssembly.DoorNumber = "1" Then
|
||||
If CurrPart.TypePart.Contains("FR_L") Then
|
||||
x = DoubleToString(dWidthDoor_0 + dLightLock, 4)
|
||||
ElseIf CurrPart.TypePart.Contains("FR_H") Then
|
||||
x = DoubleToString(dWidthDoor_0 + dLightHinge, 4)
|
||||
End If
|
||||
Else
|
||||
x = DoubleToString(dWidthDoor_0 + dWidthDoor_1 + dLightHinge + dLightLock, 4)
|
||||
End If
|
||||
End If
|
||||
' posiziono il jamb sopra
|
||||
If CurrPart.TypePart.Contains("FT_") Then
|
||||
If CurrPart.Swing.Contains("L") Then
|
||||
x = DoubleToString(dOverlapHinge + dLightHinge, 4)
|
||||
Else
|
||||
x = DoubleToString(dOverlapLock + dLightLock, 4)
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
Return x
|
||||
End Function
|
||||
|
||||
Private Function PositionJamb_Z(CurrPart As Part) As String
|
||||
Dim z As String
|
||||
Dim dDeltaThickness As Double
|
||||
StringToDouble(Map.refAssemblyPageVM.CurrAssembly.DeltaThickness, dDeltaThickness)
|
||||
If CurrPart.Swing.Contains("HR") Then
|
||||
Dim dThicknessDoor As Double
|
||||
Dim dThicknessJamb As Double
|
||||
StringToDouble(Map.refAssemblyPageVM.CurrAssembly.GetArrayPartDoor(0).Door.Thickness, dThicknessDoor)
|
||||
StringToDouble(Map.refAssemblyPageVM.CurrAssembly.Thickness, dThicknessJamb)
|
||||
z = DoubleToString(dThicknessJamb - dThicknessDoor - dDeltaThickness, 4)
|
||||
Else
|
||||
z = DoubleToString(dDeltaThickness, 4)
|
||||
End If
|
||||
Return z
|
||||
End Function
|
||||
|
||||
#End Region ' Funzioni per il posizionamento
|
||||
|
||||
Private Function PrintTitleDDFPart(NamePart As String) As String
|
||||
If NamePart.Contains("F") And NamePart.Count > 3 Then
|
||||
NamePart = NamePart.Remove(3)
|
||||
End If
|
||||
Dim SelectPart As String = NamePart
|
||||
Select Case SelectPart
|
||||
Case "FL_"
|
||||
Return "Frame Left"
|
||||
Case "FR_"
|
||||
Return "Frame Right"
|
||||
Case "FT_"
|
||||
Return "Frame Top"
|
||||
Case "FB_"
|
||||
' eseguo un controllo per verifiacre che sia attivo
|
||||
If Not Map.refAssemblyPageVM.CurrAssembly.Exterior Then
|
||||
Map.refAssemblyPageVM.CurrAssembly.BottomJamb.SetIsActive(False)
|
||||
End If
|
||||
Return "Frame Bottom"
|
||||
Case Else
|
||||
Return "Door" & NamePart(NamePart.Count - 1)
|
||||
End Select
|
||||
End Function
|
||||
|
||||
' stampa le compo seguedo l'ordine della lista delle componenti del ddf
|
||||
Public Sub SearchCompo(DdfFileContent As List(Of String), ByRef Door As Door, bIsDDf As Boolean)
|
||||
Public Sub SearchCompo(DdfFileContent As List(Of String), ByRef Door As Part, bIsDDf As Boolean)
|
||||
Dim NewCompoNameDDF = False
|
||||
Dim WritingError As String = String.Empty
|
||||
' cerco la prima componente da aggiungere alla lista delle componenti
|
||||
@@ -138,7 +483,7 @@ Friend Module DdfFile
|
||||
DdfFileContent.Add("")
|
||||
End If
|
||||
' Carico nella lista dei componenti la lista di stringhe da stampare
|
||||
DdfFileContent.AddRange(GenerateCompolistDDF(Door.CompoList(Index2), WritingError, NewCompoNameDDF, bIsDDF))
|
||||
DdfFileContent.AddRange(GenerateCompolistDDF(Door.CompoList(Index2), WritingError, NewCompoNameDDF, bIsDDf))
|
||||
End If
|
||||
NewCompoNameDDF = False
|
||||
Next
|
||||
@@ -150,7 +495,7 @@ Friend Module DdfFile
|
||||
End Sub
|
||||
|
||||
'Genero la lista di parametri di ogni compo che vedo a video
|
||||
Public Function GenerateCompolistDDF(Compo As Compo, ByRef sErrorList As String, bNewCompoNameDDF As Boolean, bIsDDF As Boolean) As List(Of String)
|
||||
Public Function GenerateCompolistDDF(Compo As Compo, ByRef sErrorList As String, bNewCompoNameDDF As Boolean, bIsDDF As Boolean) As List(Of String)
|
||||
Dim CompoListDDF As New List(Of String)
|
||||
' se il nome non esiste ancora nella lista lo aggiungo
|
||||
If Not bNewCompoNameDDF Then
|
||||
@@ -224,11 +569,194 @@ Friend Module DdfFile
|
||||
End If
|
||||
End If
|
||||
Next
|
||||
' inserisco qui il riferimento da stampare (il codice è scelto dalla porta)
|
||||
If Not IsNothing(Compo.refJambCompo) Then
|
||||
Compo.IdCode = CStr(IdIndex)
|
||||
Compo.refJambCompo.IdCode = Compo.IdCode
|
||||
CompoListDDF.Add(K_SPACE5 & "##IdCodeComponent : " & IdIndex)
|
||||
IdIndex += 1
|
||||
ElseIf Not String.IsNullOrEmpty(Compo.IdCode) Then
|
||||
CompoListDDF.Add(K_SPACE5 & "##IdCodeComponent : " & Compo.IdCode)
|
||||
IdIndex += 1
|
||||
End If
|
||||
Return CompoListDDF
|
||||
End Function
|
||||
|
||||
#End Region ' Scrittura DDF
|
||||
|
||||
#Region "SCRITTURA ASSEMBLATO"
|
||||
' serve per pulire il file temporaneo la prima volta che viene creato
|
||||
Private FirstPart As Boolean = True
|
||||
Friend Sub WriteDDFAssembly(ByVal CurrAssembly As Assembly, sPath As String, bIsDDF As Boolean)
|
||||
' serve per capire se almeno una Part è stata inserita e quindi inserire il separatore
|
||||
Dim bSplit As Boolean = False
|
||||
Dim SplitPart As New List(Of String)
|
||||
SplitPart.Add("")
|
||||
SplitPart.Add("---")
|
||||
Dim EndAssebly As New List(Of String)
|
||||
EndAssebly.Add("")
|
||||
EndAssebly.Add("...")
|
||||
|
||||
' inizio stampando l'elenco delle porte
|
||||
Dim FirstPart As Boolean = False
|
||||
Select Case CurrAssembly.DoorNumber
|
||||
Case "1"
|
||||
WriteDDFPart(CurrAssembly.GetArrayPartDoor(0).Door, sPath, bIsDDF, FirstPart)
|
||||
FirstPart = True
|
||||
File.AppendAllLines(sPath, SplitPart, Text.Encoding.UTF8)
|
||||
Case "2"
|
||||
If Not CurrAssembly.GetArrayPartDoor(0).Door.Swing.Contains("I") Then
|
||||
WriteDDFPart(CurrAssembly.GetArrayPartDoor(0).Door, sPath, bIsDDF, FirstPart)
|
||||
FirstPart = True
|
||||
File.AppendAllLines(sPath, SplitPart, Text.Encoding.UTF8)
|
||||
WriteDDFPart(CurrAssembly.GetArrayPartDoor(1).Door, sPath, bIsDDF, FirstPart)
|
||||
File.AppendAllLines(sPath, SplitPart, Text.Encoding.UTF8)
|
||||
Else
|
||||
WriteDDFPart(CurrAssembly.GetArrayPartDoor(1).Door, sPath, bIsDDF, FirstPart)
|
||||
FirstPart = True
|
||||
File.AppendAllLines(sPath, SplitPart, Text.Encoding.UTF8)
|
||||
WriteDDFPart(CurrAssembly.GetArrayPartDoor(0).Door, sPath, bIsDDF, FirstPart)
|
||||
File.AppendAllLines(sPath, SplitPart, Text.Encoding.UTF8)
|
||||
End If
|
||||
End Select
|
||||
WriteDDFPart(CurrAssembly.LeftJamb, sPath, bIsDDF, FirstPart)
|
||||
File.AppendAllLines(sPath, SplitPart, Text.Encoding.UTF8)
|
||||
WriteDDFPart(CurrAssembly.RightJamb, sPath, bIsDDF, FirstPart)
|
||||
File.AppendAllLines(sPath, SplitPart, Text.Encoding.UTF8)
|
||||
If CurrAssembly.Exterior Then
|
||||
WriteDDFPart(CurrAssembly.TopJamb, sPath, bIsDDF, FirstPart)
|
||||
File.AppendAllLines(sPath, SplitPart, Text.Encoding.UTF8)
|
||||
WriteDDFPart(CurrAssembly.BottomJamb, sPath, bIsDDF, FirstPart)
|
||||
File.AppendAllLines(sPath, EndAssebly, Text.Encoding.UTF8)
|
||||
Else
|
||||
WriteDDFPart(CurrAssembly.TopJamb, sPath, bIsDDF, FirstPart)
|
||||
File.AppendAllLines(sPath, EndAssebly, Text.Encoding.UTF8)
|
||||
End If
|
||||
'------------------------------------------------------------------------------------------------------------------
|
||||
' inizio ora a stampare le caratteristiche generali della finestra JambPageVM
|
||||
Dim dVal As Double = 0
|
||||
Dim GeneralAssembly As New List(Of String)
|
||||
GeneralAssembly.Add("")
|
||||
GeneralAssembly.Add("#GENERAL ASSEMBLY")
|
||||
GeneralAssembly.Add("")
|
||||
GeneralAssembly.Add(" " & "Size : ")
|
||||
If StringToDouble(CurrAssembly.Thickness, dVal) Then
|
||||
GeneralAssembly.Add(ConstCompo.K_SPACE3 & "thickness : " & DoubleToString(dVal, 5))
|
||||
Else
|
||||
MessageBox.Show(ConstCompo.K_SPACE3 & EgtMsg(50106) & "thickness", EgtMsg(50101), MessageBoxButton.OK, MessageBoxImage.Error)
|
||||
Return
|
||||
End If
|
||||
If StringToDouble(CurrAssembly.Width, dVal) Then
|
||||
GeneralAssembly.Add(ConstCompo.K_SPACE3 & "width : " & DoubleToString(dVal, 5))
|
||||
Else
|
||||
MessageBox.Show(ConstCompo.K_SPACE3 & EgtMsg(50106) & "width", EgtMsg(50101), MessageBoxButton.OK, MessageBoxImage.Error)
|
||||
Return
|
||||
End If
|
||||
GeneralAssembly.Add("")
|
||||
GeneralAssembly.Add(" " & "Light : ")
|
||||
If StringToDouble(CurrAssembly.LightUp, dVal) Then
|
||||
GeneralAssembly.Add(ConstCompo.K_SPACE3 & "up : " & DoubleToString(dVal, 5))
|
||||
Else
|
||||
MessageBox.Show(ConstCompo.K_SPACE3 & EgtMsg(50106) & "LightUp", EgtMsg(50101), MessageBoxButton.OK, MessageBoxImage.Error)
|
||||
Return
|
||||
End If
|
||||
If StringToDouble(CurrAssembly.LightLock, dVal) Then
|
||||
GeneralAssembly.Add(ConstCompo.K_SPACE3 & "lock : " & DoubleToString(dVal, 5))
|
||||
Else
|
||||
MessageBox.Show(EgtMsg(50106) & "LightLock", EgtMsg(50101), MessageBoxButton.OK, MessageBoxImage.Error)
|
||||
Return
|
||||
End If
|
||||
If StringToDouble(CurrAssembly.LightHinge, dVal) Then
|
||||
GeneralAssembly.Add(ConstCompo.K_SPACE3 & "hinge : " & DoubleToString(dVal, 5))
|
||||
Else
|
||||
MessageBox.Show(EgtMsg(50106) & "LightHinge", EgtMsg(50101), MessageBoxButton.OK, MessageBoxImage.Error)
|
||||
Return
|
||||
End If
|
||||
If StringToDouble(CurrAssembly.LightBottom, dVal) Then
|
||||
GeneralAssembly.Add(ConstCompo.K_SPACE3 & "bottom : " & DoubleToString(dVal, 5))
|
||||
Else
|
||||
MessageBox.Show(EgtMsg(50106) & "LightBottom", EgtMsg(50101), MessageBoxButton.OK, MessageBoxImage.Error)
|
||||
Return
|
||||
End If
|
||||
GeneralAssembly.Add("")
|
||||
GeneralAssembly.Add(" " & "Overlap : ")
|
||||
If StringToDouble(CurrAssembly.ThicknessHead, dVal) Then
|
||||
GeneralAssembly.Add(ConstCompo.K_SPACE3 & "thickness : " & DoubleToString(dVal, 5))
|
||||
Else
|
||||
MessageBox.Show(EgtMsg(50106) & "ThicknessHead", EgtMsg(50101), MessageBoxButton.OK, MessageBoxImage.Error)
|
||||
Return
|
||||
End If
|
||||
If StringToDouble(CurrAssembly.OverlapHinge, dVal) Then
|
||||
GeneralAssembly.Add(ConstCompo.K_SPACE3 & "hinge : " & DoubleToString(dVal, 5))
|
||||
Else
|
||||
MessageBox.Show(EgtMsg(50106) & "Overlap Hinge", EgtMsg(50101), MessageBoxButton.OK, MessageBoxImage.Error)
|
||||
Return
|
||||
End If
|
||||
If StringToDouble(CurrAssembly.OverlapLock, dVal) Then
|
||||
GeneralAssembly.Add(ConstCompo.K_SPACE3 & "lock : " & DoubleToString(dVal, 5))
|
||||
Else
|
||||
MessageBox.Show(EgtMsg(50106) & "Overlap Lock", EgtMsg(50101), MessageBoxButton.OK, MessageBoxImage.Error)
|
||||
Return
|
||||
End If
|
||||
' i parametri associatia alla condizione di Exterior sono stampati solo se Exterior è true
|
||||
If CurrAssembly.Exterior Then
|
||||
GeneralAssembly.Add(ConstCompo.K_SPACE3 & "Exterior :")
|
||||
If StringToDouble(CurrAssembly.OverlapTop, dVal) Then
|
||||
GeneralAssembly.Add(ConstCompo.K_SPACE3 & "top : " & DoubleToString(dVal, 5))
|
||||
Else
|
||||
MessageBox.Show(EgtMsg(50106) & "Overlap Top", EgtMsg(50101), MessageBoxButton.OK, MessageBoxImage.Error)
|
||||
Return
|
||||
End If
|
||||
If StringToDouble(CurrAssembly.DeltaThickness, dVal) Then
|
||||
GeneralAssembly.Add(ConstCompo.K_SPACE3 & "deltaT : " & DoubleToString(dVal, 5))
|
||||
Else
|
||||
MessageBox.Show(EgtMsg(50106) & "Delta Thickness", EgtMsg(50101), MessageBoxButton.OK, MessageBoxImage.Error)
|
||||
Return
|
||||
End If
|
||||
End If
|
||||
GeneralAssembly.Add("")
|
||||
GeneralAssembly.Add(" " & ConstCompo.K_PROFILES & ":")
|
||||
GeneralAssembly.Add(ConstCompo.K_SPACE3 & ConstCompo.K_LOCKEDGE & ": " & CurrAssembly.LockEdgeType.Name)
|
||||
GeneralAssembly.Add(ConstCompo.K_SPACE5 & ConstCompo.K_MACHINING & ": " & ConvertBooleanToOnOff(CurrAssembly.LockEdgeMachining))
|
||||
If Not StringToDouble(CurrAssembly.LockEdgeOverMaterial, dVal) Then
|
||||
MessageBox.Show(EgtMsg(50106) & K_LOCKEDGEOVERMATERIAL_INI, EgtMsg(50101), MessageBoxButton.OK, MessageBoxImage.Error)
|
||||
Return
|
||||
End If
|
||||
GeneralAssembly.Add(ConstCompo.K_SPACE5 & ConstCompo.K_OVERMATERIAL & ": " & DoubleToString(dVal, 5))
|
||||
GeneralAssembly.Add(ConstCompo.K_SPACE3 & ConstCompo.K_HINGEEDGE & ": " & CurrAssembly.HingeEdgeType.Name)
|
||||
GeneralAssembly.Add(ConstCompo.K_SPACE5 & ConstCompo.K_MACHINING & ": " & ConvertBooleanToOnOff(CurrAssembly.HingeEdgeMachining))
|
||||
If Not StringToDouble(CurrAssembly.HingeEdgeOverMaterial, dVal) Then
|
||||
MessageBox.Show(EgtMsg(50106) & K_HINGEDGEOVERMATERIAL_INI, EgtMsg(50101), MessageBoxButton.OK, MessageBoxImage.Error)
|
||||
Return
|
||||
End If
|
||||
GeneralAssembly.Add(ConstCompo.K_SPACE5 & ConstCompo.K_OVERMATERIAL & ": " & DoubleToString(dVal, 5))
|
||||
GeneralAssembly.Add(ConstCompo.K_SPACE3 & ConstCompo.K_TOP & ": " & CurrAssembly.TopType.Name)
|
||||
GeneralAssembly.Add(ConstCompo.K_SPACE5 & ConstCompo.K_MACHINING & ": " & ConvertBooleanToOnOff(CurrAssembly.TopMachining))
|
||||
If Not StringToDouble(CurrAssembly.TopOverMaterial, dVal) Then
|
||||
MessageBox.Show(EgtMsg(50106) & K_TOPOVERMATERIAL_INI, EgtMsg(50101), MessageBoxButton.OK, MessageBoxImage.Error)
|
||||
Return
|
||||
End If
|
||||
GeneralAssembly.Add(ConstCompo.K_SPACE5 & ConstCompo.K_OVERMATERIAL & ": " & DoubleToString(dVal, 5))
|
||||
GeneralAssembly.Add(ConstCompo.K_SPACE3 & ConstCompo.K_BOTTOM & ": " & CurrAssembly.BottomType.Name)
|
||||
GeneralAssembly.Add(ConstCompo.K_SPACE5 & ConstCompo.K_MACHINING & ": " & ConvertBooleanToOnOff(CurrAssembly.BottomMachining))
|
||||
If Not StringToDouble(CurrAssembly.BottomOverMaterial, dVal) Then
|
||||
MessageBox.Show(EgtMsg(50106) & K_BOTTOMOVERMATERIAL_INI, EgtMsg(50101), MessageBoxButton.OK, MessageBoxImage.Error)
|
||||
Return
|
||||
End If
|
||||
GeneralAssembly.Add(ConstCompo.K_SPACE5 & ConstCompo.K_OVERMATERIAL & ": " & DoubleToString(dVal, 5))
|
||||
|
||||
GeneralAssembly.Add("")
|
||||
If Not IsNothing(CurrAssembly.DoorNumber) Then
|
||||
GeneralAssembly.Add(" " & "doors : " & CurrAssembly.DoorNumber)
|
||||
Else
|
||||
MessageBox.Show(EgtMsg(50106) & "Number of Doors", EgtMsg(50101), MessageBoxButton.OK, MessageBoxImage.Error)
|
||||
Return
|
||||
End If
|
||||
File.AppendAllLines(sPath, GeneralAssembly, Text.Encoding.UTF8)
|
||||
End Sub
|
||||
|
||||
#End Region
|
||||
|
||||
'eseguo il confronto tra il DDF Nuovo e quello in lettura nella finestra grafica: restituisce falso se i due file sono diversi
|
||||
Friend Function ComparisonFileDDF(sPathNewDoor As String, sPathTempDoor As String) As Boolean
|
||||
''Dim FileContentNewDoor As String()
|
||||
@@ -307,8 +835,97 @@ Friend Module DdfFile
|
||||
|
||||
End Function
|
||||
|
||||
#Region "LETTURA ASSEMBLATO"
|
||||
Private m_Assembly As New Assembly
|
||||
|
||||
' controllo che il DDF che voglio leggere esista, e se esiste che non sia vuoto
|
||||
Friend Sub DecomposeAssebly(ByVal sPathAssembly As String)
|
||||
'Dim FileContent() As String
|
||||
Dim nDDF As Integer = 1
|
||||
' controllo che il file esista
|
||||
If Not File.Exists(sPathAssembly) Then Return
|
||||
' acrico tutto il file nel vettore
|
||||
FileContent = File.ReadAllLines(sPathAssembly)
|
||||
' se il file esiste ma è vuoto
|
||||
If FileContent.Count = 0 Then
|
||||
MessageBox.Show(EgtMsg(50107), EgtMsg(50101), MessageBoxButton.OK, MessageBoxImage.Error)
|
||||
End If
|
||||
|
||||
' riga corrente del file
|
||||
Dim LineIndex As Integer = 0
|
||||
' riga associata all'inizio di ogni ddf
|
||||
Dim StartIndex As Integer = 0
|
||||
' riga associata alla fine di ogni ddf
|
||||
Dim StopIndex As Integer = 0
|
||||
' serve per contare quante sono le righe vuote
|
||||
Dim EmptyLine As Integer = 0
|
||||
|
||||
' fino a quando il file non è terminato
|
||||
While (LineIndex < FileContent.Count)
|
||||
' controlla se trova 3 lineette
|
||||
If Search3Score(FileContent(LineIndex)) Or Search3Dots(FileContent(LineIndex)) Then
|
||||
' assegno come riga terminela del ddf quella che precede i tre trattini
|
||||
StopIndex = LineIndex - 1
|
||||
' carica il vettore attraverso un ciclo for
|
||||
For i As Integer = 0 To StopIndex - StartIndex
|
||||
' scommentando le righe
|
||||
FileContent(StartIndex + i) = Utility.FindComments(FileContent(StartIndex + i))
|
||||
' verifico che la riga appena passata non sia vuota
|
||||
If (String.IsNullOrEmpty(FileContent(StartIndex + i)) Or String.IsNullOrWhiteSpace(FileContent(StartIndex + i))) Then
|
||||
EmptyLine += 1
|
||||
End If
|
||||
Next
|
||||
' se il numero di righe bianche è ugule alla dimensione del vettore allora quel ddf non esiste e non deve essere stampato
|
||||
If (EmptyLine = StopIndex - StartIndex + 1) Then
|
||||
' decido quindi di passare a stampare il succesivo
|
||||
nDDF += 1
|
||||
Else
|
||||
DDFFromAssembly(nDDF, StartIndex)
|
||||
nDDF += 1
|
||||
End If
|
||||
EmptyLine = 0
|
||||
' assegno come nuovo punto di partenza la riga successiva ai tre trattini
|
||||
StartIndex = LineIndex + 1
|
||||
|
||||
End If
|
||||
LineIndex += 1
|
||||
End While
|
||||
|
||||
End Sub
|
||||
' il vettore che contiene gli startpoint del file assembly
|
||||
Friend ListPartsStartIndex As New ObservableCollection(Of Integer)
|
||||
'la lista dei nomi della pulsantiera
|
||||
Friend ListParts As New ObservableCollection(Of String)
|
||||
' stampo nel direttorio dei files temporanei il ddf prelevato dall'assemblato
|
||||
Private Sub DDFFromAssembly(ByVal nDDF As Integer, StartPoint As Integer)
|
||||
Dim TempDoor As New Part
|
||||
' con il seguente select-case stampo il file ddf temporaneo che si vuole leggere
|
||||
Select Case nDDF
|
||||
'Case 1
|
||||
' Part.NewReadDDF(StartPoint, TempDoor)
|
||||
' m_Assembly.DoorListAssembly.Add(TempDoor)
|
||||
'Case 2
|
||||
' Part.NewReadDDF(StartPoint, TempDoor)
|
||||
' m_Assembly.DoorListAssembly.Add(TempDoor)
|
||||
'Case 3
|
||||
' Part.NewReadDDF(StartPoint, TempDoor)
|
||||
' m_Assembly.DoorListAssembly.Add(TempDoor)
|
||||
'Case 4
|
||||
' Part.NewReadDDF(StartPoint, TempDoor)
|
||||
' m_Assembly.DoorListAssembly.Add(TempDoor)
|
||||
'Case 5
|
||||
' Part.NewReadDDF(StartPoint, TempDoor)
|
||||
' m_Assembly.DoorListAssembly.Add(TempDoor)
|
||||
'Case 6
|
||||
' Part.NewReadDDF(StartPoint, TempDoor)
|
||||
' m_Assembly.DoorListAssembly.Add(TempDoor)
|
||||
End Select
|
||||
End Sub
|
||||
|
||||
#End Region 'Lettura Assemblato
|
||||
|
||||
' se il titolo presenta * allora vuol dire che era stato modificato, altrinenti no .Trim("*"c)
|
||||
Friend Function SetModify(rMainWindow As MainWindowViewModel) As Boolean
|
||||
Friend Function SetModify(rMainWindow As MainWindowVM) As Boolean
|
||||
If Trim(rMainWindow.ProjectNameMsg) = Trim(rMainWindow.ProjectNameMsg.Trim("*"c)) Then
|
||||
Return True
|
||||
Else
|
||||
|
||||
@@ -1,23 +1,29 @@
|
||||
<UserControl x:Class="DoorManagerView"
|
||||
<UserControl x:Class="AssemblyManagerV"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:local="clr-namespace:EgtDOORCreator"
|
||||
xmlns:EgtDOORCreator="clr-namespace:EgtDOORCreator"
|
||||
Height="30">
|
||||
|
||||
<UserControl.Resources>
|
||||
<local:PathConverter x:Key="PathConverter"/>
|
||||
<local:ProjectVisibilityConverter x:Key="ProjectVisibilityConverter"/>
|
||||
<EgtDOORCreator:PathConverter x:Key="PathConverter"/>
|
||||
<!--<EgtDOORCreator:CurrentNameConverter x:Key="CurrentNameConverter"/>-->
|
||||
<EgtDOORCreator:ProjectVisibilityConverter x:Key="ProjectVisibilityConverter"/>
|
||||
</UserControl.Resources>
|
||||
|
||||
<Grid
|
||||
Visibility="{Binding CurrProject.Name, Converter={StaticResource ProjectVisibilityConverter}, UpdateSourceTrigger=PropertyChanged}">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="18*"/>
|
||||
<RowDefinition Height="18*"/>
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<ListBox ItemsSource="{Binding CurrProject.DoorList}" SelectedItem="{Binding SelectedDoor}"
|
||||
Style="{StaticResource DoorListBox}" Name="DoorList">
|
||||
<ListBox ItemsSource="{Binding CurrProject.AssemblyList}"
|
||||
SelectedItem="{Binding SelectedAssembly}"
|
||||
Style="{StaticResource DoorListBox}" Name="AssemblyList" Grid.ColumnSpan="2" Margin="0,0,28,0.4" Grid.RowSpan="2">
|
||||
<ListBox.ItemsPanel>
|
||||
<ItemsPanelTemplate>
|
||||
<VirtualizingStackPanel IsItemsHost="True" Orientation="Horizontal"/>
|
||||
@@ -38,14 +44,13 @@
|
||||
<ListBox.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<RadioButton GroupName="DoorGroup"
|
||||
Height="30" MaxWidth="150" Margin="0,0,2,0" Padding="5,0,5,0"
|
||||
Height="28" MaxWidth="150" Margin="0,0,2,0" Padding="5,0,5,0"
|
||||
Style="{StaticResource {x:Type ToggleButton}}"
|
||||
IsChecked="{Binding Path=IsSelected, RelativeSource={
|
||||
RelativeSource AncestorType={x:Type ListBoxItem}}}">
|
||||
RelativeSource AncestorType={x:Type ListBoxItem}}}">
|
||||
<RadioButton.Content>
|
||||
<TextBlock Text="{Binding Converter={StaticResource PathConverter}}"/>
|
||||
<TextBlock Text="{Binding GraphicName}"/>
|
||||
</RadioButton.Content>
|
||||
|
||||
</RadioButton>
|
||||
</DataTemplate>
|
||||
</ListBox.ItemTemplate>
|
||||
@@ -53,16 +58,16 @@
|
||||
|
||||
<Button Grid.Column="1"
|
||||
Height="20" Width="20" VerticalAlignment="Center"
|
||||
Margin="3,0,5,0" Command="{Binding AddDoorCommand}"
|
||||
Margin="3,5,5,5.4" Command="{Binding AddAssemblyCommand}"
|
||||
ToolTip="{Binding AddNewDoorToolTip}"
|
||||
Focusable="False">
|
||||
Focusable="False" Grid.RowSpan="2">
|
||||
<Image Source="/Resources/TopCommandBar/Add.png" Stretch="Uniform"/>
|
||||
</Button>
|
||||
<Button Grid.Column="2"
|
||||
Height="20" Width="20" VerticalAlignment="Center"
|
||||
Margin="0,0,5,0" Command="{Binding RemoveDoorCommand}"
|
||||
Margin="0,5,4.8,5.4" Command="{Binding RemoveDoorCommand}"
|
||||
ToolTip="{Binding RemoveDoorToolTip}"
|
||||
Focusable="False">
|
||||
Focusable="False" Grid.RowSpan="2">
|
||||
<Image Source="/Resources/TopCommandBar/Remove.png" Stretch="Uniform"/>
|
||||
</Button>
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
Public Class AssemblyManagerV
|
||||
|
||||
Private Sub Door_MouseLeftButtonDown(sender As Object, e As MouseButtonEventArgs)
|
||||
Dim Item As ListBoxItem = DirectCast(sender, ListBoxItem)
|
||||
e.Handled = Map.refAssemblyManagerVM.OpenSelectedAssembly(DirectCast(Item.DataContext, AssemblyName))
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
@@ -0,0 +1,545 @@
|
||||
Imports System.Collections.ObjectModel
|
||||
Imports System.ComponentModel
|
||||
Imports System.IO
|
||||
Imports EgtUILib
|
||||
|
||||
Public Class AssemblyManagerVM
|
||||
Implements INotifyPropertyChanged
|
||||
|
||||
' percorso della porta corrente (creata o già esistente nella cartella)
|
||||
|
||||
Private NewAssembly As Boolean = False
|
||||
Friend DeleteNewPart As Integer = 1
|
||||
|
||||
Private SelAssembly As New Assembly
|
||||
Friend MsgResult As MessageBoxResult
|
||||
|
||||
' creiamo un nuovo progetto: un nome e una lista di porte
|
||||
Private m_CurrProject As New Project
|
||||
Public Property CurrProject As Project
|
||||
Get
|
||||
Return m_CurrProject
|
||||
End Get
|
||||
Set(value As Project)
|
||||
m_CurrProject = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_SelectedAssembly As New AssemblyName
|
||||
Public Property SelectedAssembly As AssemblyName
|
||||
Get
|
||||
Return m_SelectedAssembly
|
||||
End Get
|
||||
Set(value As AssemblyName)
|
||||
m_SelectedAssembly = value
|
||||
NotifyPropertyChanged("SelectedAssembly")
|
||||
End Set
|
||||
End Property
|
||||
|
||||
#Region "MESSAGES"
|
||||
Public ReadOnly Property AddNewDoorToolTip As String
|
||||
Get
|
||||
Return EgtMsg(50302)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property RemoveDoorToolTip As String
|
||||
Get
|
||||
Return EgtMsg(50303)
|
||||
End Get
|
||||
End Property
|
||||
#End Region 'MESSAGES
|
||||
|
||||
' Definizione comandi
|
||||
Private m_cmdAddAssembly As ICommand
|
||||
Private m_cmdRemoveDoor As ICommand
|
||||
|
||||
Sub New()
|
||||
Map.SetRefDoorManagerVM(Me)
|
||||
End Sub
|
||||
|
||||
#Region "METHODS"
|
||||
Private CreateRabbet As Boolean = False
|
||||
#Region "Apertura e salvataggio"
|
||||
Public Sub RemoveFromAssemblyList()
|
||||
Dim SelIndex As Integer = m_CurrProject.AssemblyList.IndexOf(m_SelectedAssembly)
|
||||
m_CurrProject.AssemblyList.Remove(m_SelectedAssembly)
|
||||
CurrProject.NotifyPropertyChanged("AssemblyList")
|
||||
If m_CurrProject.AssemblyList.Count > 0 Then
|
||||
' aggiorno la porta da visualizzare
|
||||
If SelIndex > m_CurrProject.AssemblyList.Count - 1 Then
|
||||
m_SelectedAssembly = m_CurrProject.AssemblyList(SelIndex - 1)
|
||||
OpenSelectedAssembly(SelectedAssembly)
|
||||
Else
|
||||
m_SelectedAssembly = m_CurrProject.AssemblyList(SelIndex)
|
||||
OpenSelectedAssembly(SelectedAssembly)
|
||||
End If
|
||||
' se non ci sono altre porte nella lista allora
|
||||
Else
|
||||
' elimino qualsiasi resto di porta
|
||||
Map.refAssemblyPageVM.CurrAssembly = Nothing
|
||||
' aggiorni l'immagine a nulla
|
||||
EgtNewFile()
|
||||
EgtZoom(ZM.ALL)
|
||||
End If
|
||||
End Sub
|
||||
' restituisce un intero associato ad un messaggioa a seconda che il file esista oppure no
|
||||
Private Function MsgDeleteOrNotSave(ByVal value As AssemblyName) As Integer
|
||||
If File.Exists(value.Name) Then
|
||||
Return 50109
|
||||
Else
|
||||
Return 50116
|
||||
End If
|
||||
End Function
|
||||
' salva il file corrente o se è stato appena creato lo elimina dalla lista
|
||||
Friend Function SaveCurrentAssembly() As Boolean
|
||||
' se nessun elemento è selezionato allora continua
|
||||
If Not IsNothing(m_SelectedAssembly) Then
|
||||
' se il file è modificato allora chiedo se salvare o non salvare o continuare
|
||||
If m_SelectedAssembly.IsModify Then
|
||||
MsgResult = MessageBox.Show(String.Format(EgtMsg(MsgDeleteOrNotSave(m_SelectedAssembly)), Path.GetFileNameWithoutExtension(m_SelectedAssembly.Name)), EgtMsg(50110), MessageBoxButton.YesNoCancel, MessageBoxImage.Warning)
|
||||
' decido di salvare
|
||||
If MsgResult = MessageBoxResult.Yes Then
|
||||
m_SelectedAssembly.IsModify = False
|
||||
Part.FirstReadingEdge = False
|
||||
SelectedAssembly.NotifyPropertyChanged("IsModify")
|
||||
If Map.refAssemblyPageVM.CurrAssembly.GetArrayPartDoor(0).Door.IsNotAssembly Then
|
||||
DdfFile.WriteDDFPart(Map.refAssemblyPageVM.CurrAssembly.GetArrayPartDoor(0).Door, m_SelectedAssembly.Name, True, False)
|
||||
Else
|
||||
DdfFile.WriteDDFAssembly(Map.refAssemblyPageVM.CurrAssembly, m_SelectedAssembly.Name, True)
|
||||
End If
|
||||
'Map.refPartPageVM.bSetChange = False
|
||||
Return True
|
||||
' decido di non salvare
|
||||
ElseIf MsgResult = MessageBoxResult.No Then
|
||||
' devo eliminare dall'elenco degli assemblati o non salvare nulla
|
||||
Part.FirstReadingEdge = False
|
||||
If Not File.Exists(m_SelectedAssembly.Name) Then
|
||||
CurrProject.AssemblyList.Remove(m_SelectedAssembly)
|
||||
Else
|
||||
m_SelectedAssembly.IsModify = False
|
||||
End If
|
||||
Return True
|
||||
' decido di interrompere la selezione
|
||||
Else
|
||||
' interrompi le operazioni di creazione o selezione
|
||||
Return False
|
||||
End If
|
||||
Else
|
||||
'se il file non è stato modificato allora posso procedere
|
||||
Return True
|
||||
End If
|
||||
Else
|
||||
' altrimenti il progetto è vuoto quindi non accade nulla nel salvataggio
|
||||
Return True
|
||||
End If
|
||||
End Function
|
||||
' Apre il File in selzionato o crea un nuovo oggetto
|
||||
Public Function OpenSelectedAssembly(value As AssemblyName) As Boolean
|
||||
If SaveCurrentAssembly() Then
|
||||
SelectedAssembly = value
|
||||
If File.Exists(m_SelectedAssembly.Name) Then
|
||||
Map.refAssemblyPageVM.CurrAssembly = CreateNewAssembly(m_SelectedAssembly.Name)
|
||||
Assembly.ReadDDFAssembly(m_SelectedAssembly.Name, Map.refAssemblyPageVM.CurrAssembly)
|
||||
DdfFile.WriteDDFAssembly(Map.refAssemblyPageVM.CurrAssembly, IniFile.m_sTempDir & "\" & TEMP_ASSEMBLY, True)
|
||||
'Map.refMainWindowVM.SelectedPage = MainWindowVM.ListPageEnum.nAssemblyPage
|
||||
NotifyPropertyChanged("SelectedAssembly")
|
||||
' se è avvenuta la modifica dei valori dei bevel devo avvisare che vi è stata una modifica
|
||||
' dopo aver caricato tutti i valori all'apertura del progetto devo riportare la modifica a false
|
||||
m_SelectedAssembly.IsModify = Part.FirstReadingEdge
|
||||
If Not Map.refAssemblyPageVM.CurrAssembly.GetArrayPartDoor(0).Door.IsNotAssembly Then
|
||||
ExecDoors(Map.refSceneManagerVM.ProjectScene, IniFile.m_sTempDir & "\" & TEMP_ASSEMBLY)
|
||||
End If
|
||||
Return True
|
||||
Else
|
||||
' modifico il nome dell'assemblato
|
||||
m_SelectedAssembly.IsModify = True
|
||||
'Map.refAssemblyPageVM.CurrAssembly = Nothing
|
||||
CreateRabbet = True
|
||||
Map.refAssemblyPageVM.CurrAssembly = CreateNewAssembly(m_SelectedAssembly.Name)
|
||||
DdfFile.WriteDDFAssembly(Map.refAssemblyPageVM.CurrAssembly, IniFile.m_sTempDir & "\" & TEMP_ASSEMBLY, True)
|
||||
Map.refMainWindowVM.SelectedPage = MainWindowVM.ListPageEnum.nAssemblyPage
|
||||
CreateRabbet = False
|
||||
ExecDoors(Map.refSceneManagerVM.ProjectScene, IniFile.m_sTempDir & "\" & TEMP_ASSEMBLY)
|
||||
NotifyPropertyChanged("SelectedAssembly")
|
||||
Return True
|
||||
End If
|
||||
'NotifyPropertyChanged("SelectedAssembly")
|
||||
Else
|
||||
Return False
|
||||
End If
|
||||
End Function
|
||||
#End Region ' Apertura e salvataggio
|
||||
|
||||
#Region "Creazione e caricamento degli oggetti dell'assemblato"
|
||||
' Caricamento dei dati della pagina generale degli assemblati
|
||||
Friend Function CreateNewAssembly(value As String) As Assembly
|
||||
'' se non esisteva nessuna porta allora posso procedere
|
||||
'm_SelectedAssembly.Name = value
|
||||
'NotifyPropertyChanged("SelectedAssembly")
|
||||
' costruisco un nuvo assemblato e lo carico con i valori
|
||||
Dim Local_SelAssembly As New Assembly
|
||||
Local_SelAssembly.NewAssembly = NewAssembly
|
||||
Local_SelAssembly.SetExterior(OptionModule.m_Exterior)
|
||||
Local_SelAssembly.DoorListNumber = OptionModule.m_DoorsListNumber
|
||||
' Carico tutti i vettori in sola lettura (i metodi set non contengono nessuna operazione)
|
||||
Local_SelAssembly.SetThickness(OptionModule.m_ThicknessJamb)
|
||||
Local_SelAssembly.SetWidth(OptionModule.m_WidthJamb)
|
||||
Local_SelAssembly.SetLightUp(OptionModule.m_LightUp)
|
||||
Local_SelAssembly.SetLightLock(OptionModule.m_LightLock)
|
||||
Local_SelAssembly.SetLightBottom(OptionModule.m_LightBottom)
|
||||
Local_SelAssembly.SetLightHinge(OptionModule.m_LightHinge)
|
||||
Local_SelAssembly.SetThicknessHead(OptionModule.m_ThicknessHead)
|
||||
Local_SelAssembly.SetOverlapHinge(OptionModule.m_OverlapHinge)
|
||||
Local_SelAssembly.SetOverlapLock(OptionModule.m_OverlapLock)
|
||||
Local_SelAssembly.SetOverlapTop(OptionModule.m_OverlapTop)
|
||||
Local_SelAssembly.SetDeltaThickness(OptionModule.m_DeltaThickness)
|
||||
Local_SelAssembly.SetLockEdgeType(OptionModule.m_LockEdgeTypeAssembly)
|
||||
Local_SelAssembly.SetHingeEdgeType(OptionModule.m_HingeEdgeTypeAssembly)
|
||||
Local_SelAssembly.SetTopType(OptionModule.m_TopTypeAssembly)
|
||||
Local_SelAssembly.SetBottomType(OptionModule.m_BottomTypeAssembly)
|
||||
Local_SelAssembly.SetLockEdgeMachining(OptionModule.m_LockEdgeMachiningAssembly)
|
||||
Local_SelAssembly.SetHingeEdgeMachining(OptionModule.m_HingeEdgeMachiningAssembly)
|
||||
Local_SelAssembly.SetTopMachining(OptionModule.m_TopMachiningAssembly)
|
||||
Local_SelAssembly.SetBottomMachining(OptionModule.m_BottomMachiningAssembly)
|
||||
Local_SelAssembly.SetLockEdgeOverMaterial(OptionModule.m_LockEdgeOverMaterialAssembly)
|
||||
Local_SelAssembly.SetHingeEdgeOverMaterial(OptionModule.m_HingeEdgeOverMaterialAssembly)
|
||||
Local_SelAssembly.SetTopOverMaterial(OptionModule.m_TopOverMaterialAssembly)
|
||||
Local_SelAssembly.SetBottomOverMaterial(OptionModule.m_BottomOverMaterialAssembly)
|
||||
Local_SelAssembly.SetDoorNumber(OptionModule.m_DoorsNumber)
|
||||
' costruisco e carico le parti
|
||||
CreatePart(Local_SelAssembly)
|
||||
' carico l'assemblato che sto creando in locale (così da poter gestire i Jamb)
|
||||
Map.refAssemblyPageVM.CurrAssembly = Local_SelAssembly
|
||||
CreateDoor(Local_SelAssembly)
|
||||
' calcolo la dimensione dei Jambs in funzione del numero di porte visibili
|
||||
Local_SelAssembly.DoorVisibilityNew()
|
||||
Local_SelAssembly.TopRabbetJamb()
|
||||
'Local_SelAssembly.HingeRabbetJamb()
|
||||
Return Local_SelAssembly
|
||||
End Function
|
||||
' creazione dei jamb
|
||||
Private Sub CreatePart(ByRef CurrAssembly As Assembly)
|
||||
CurrAssembly.LeftJamb = New Part
|
||||
CurrAssembly.LeftJamb.TypePart = "FL_"
|
||||
CurrAssembly.LeftJamb.SetThickness(CurrAssembly.Thickness)
|
||||
CurrAssembly.LeftJamb.SetWidth(CurrAssembly.Width)
|
||||
CurrAssembly.LeftJamb.SwingTypeList = OptionModule.m_SwingTypeList
|
||||
CurrAssembly.LeftJamb.IsActive = OptionModule.m_LeftJambChk
|
||||
|
||||
CurrAssembly.RightJamb = New Part
|
||||
CurrAssembly.RightJamb.TypePart = "FR_"
|
||||
CurrAssembly.RightJamb.SetThickness(CurrAssembly.Thickness)
|
||||
CurrAssembly.RightJamb.SetWidth(CurrAssembly.Width)
|
||||
CurrAssembly.RightJamb.SwingTypeList = OptionModule.m_SwingTypeList
|
||||
CurrAssembly.RightJamb.IsActive = OptionModule.m_RightJambChk
|
||||
|
||||
CurrAssembly.TopJamb = New Part
|
||||
CurrAssembly.TopJamb.TypePart = "FT_"
|
||||
CurrAssembly.TopJamb.SetThickness(CurrAssembly.Thickness)
|
||||
CurrAssembly.TopJamb.SetHeight(CurrAssembly.ThicknessHead)
|
||||
CurrAssembly.TopJamb.SwingTypeList = OptionModule.m_SwingTypeList
|
||||
CurrAssembly.TopJamb.IsActive = OptionModule.m_TopJambChk
|
||||
CurrAssembly.BottomJamb = New Part
|
||||
|
||||
CurrAssembly.BottomJamb.TypePart = "FB_"
|
||||
CurrAssembly.BottomJamb.SetThickness(CurrAssembly.Thickness)
|
||||
CurrAssembly.BottomJamb.SetHeight(CurrAssembly.Width)
|
||||
CurrAssembly.BottomJamb.SwingTypeList = OptionModule.m_SwingTypeList
|
||||
CurrAssembly.BottomJamb.IsActive = OptionModule.m_BottomJambChk
|
||||
End Sub
|
||||
' Caricamento del vettore delle porte, Se già ne esite uno esso viene sovrascritto con nuovi oggetti
|
||||
Private Sub CreateDoor(ByRef CurrAssembly As Assembly)
|
||||
CurrAssembly.LockEdgeType = CurrAssembly.LockEdgeType
|
||||
CurrAssembly.HingeEdgeType = CurrAssembly.HingeEdgeType
|
||||
CurrAssembly.TopType = CurrAssembly.TopType
|
||||
CurrAssembly.BottomType = CurrAssembly.BottomType
|
||||
CurrAssembly.LockEdgeMachining = CurrAssembly.LockEdgeMachining
|
||||
CurrAssembly.HingeEdgeMachining = CurrAssembly.HingeEdgeMachining
|
||||
CurrAssembly.TopMachining = CurrAssembly.TopMachining
|
||||
CurrAssembly.BottomMachining = CurrAssembly.BottomMachining
|
||||
CurrAssembly.LockEdgeOverMaterial = CurrAssembly.LockEdgeOverMaterial
|
||||
CurrAssembly.HingeEdgeOverMaterial = CurrAssembly.HingeEdgeOverMaterial
|
||||
CurrAssembly.TopOverMaterial = CurrAssembly.TopOverMaterial
|
||||
CurrAssembly.BottomOverMaterial = CurrAssembly.BottomOverMaterial
|
||||
' qui carico il vettore delle porte (se il vettore è vuoto)
|
||||
Dim ref_PartDoor As PartDoor
|
||||
Dim ref_Door As Part
|
||||
For IndexDoor As Integer = 0 To K_DOORNUMBER
|
||||
ref_PartDoor = New PartDoor
|
||||
ref_Door = New Part
|
||||
ref_Door.TypePart = "DO_" & IndexDoor + 1
|
||||
LoadDefaultPartOne(ref_Door)
|
||||
ref_PartDoor.Door = ref_Door
|
||||
CurrAssembly.ArrayPartDoor.Add(ref_PartDoor)
|
||||
Next
|
||||
End Sub
|
||||
|
||||
' carica i valori di default negli oggetti appena creati
|
||||
Public Sub LoadDefaultPartOne(ByRef ref_Part As Part)
|
||||
'OptionModule.GeneralDoor.CompoList.Clear()
|
||||
'---------------------------------------------------------------------------------------------------------------
|
||||
' Date le dimensioni della porta calcoliamo la dimensione dei Jamb
|
||||
ref_Part.Width = OptionModule.m_Width
|
||||
ref_Part.Height = OptionModule.m_Height
|
||||
ref_Part.Thickness = OptionModule.m_Thickness
|
||||
'---------------------------------------------------------------------------------------------------------------
|
||||
' i parametri che seguono non influenzano in alcun modo i jamb
|
||||
ref_Part.SetSwing(OptionModule.m_Swing)
|
||||
ref_Part.IsActive = False
|
||||
ref_Part.Measure = OptionModule.m_SelectedMeasureUnit
|
||||
ref_Part.Weight = OptionModule.m_Weight
|
||||
ref_Part.LockEdgeType = OptionModule.m_LockEdgeType
|
||||
ref_Part.HingeEdgeType = OptionModule.m_HingeEdgeType
|
||||
ref_Part.TopType = OptionModule.m_TopType
|
||||
ref_Part.BottomType = OptionModule.m_BottomType
|
||||
ref_Part.LockEdgeMachining = OptionModule.m_LockEdgeMachining
|
||||
ref_Part.HingeEdgeMachining = OptionModule.m_HingeEdgeMachining
|
||||
ref_Part.TopMachining = OptionModule.m_TopMachining
|
||||
ref_Part.BottomMachining = OptionModule.m_BottomMachining
|
||||
ref_Part.LockEdgeOverMaterial = OptionModule.m_LockEdgeOverMaterial
|
||||
ref_Part.HingeEdgeOverMaterial = OptionModule.m_HingeEdgeOverMaterial
|
||||
ref_Part.TopOverMaterial = OptionModule.m_TopOverMaterial
|
||||
ref_Part.BottomOverMaterial = OptionModule.m_BottomOverMaterial
|
||||
End Sub
|
||||
|
||||
#End Region ' Creazione e caricamento degli oggetti dell'assemblato
|
||||
|
||||
' controllo che tutti gli oggetti siano stati creati
|
||||
Private Function CurrAssembyIsNotEmpty(ref_CurrAssembly As Assembly) As Boolean
|
||||
Dim bJambExist As Boolean = False
|
||||
Dim bDoorExist As Boolean = False
|
||||
If Not IsNothing(ref_CurrAssembly.BottomJamb) Or Not IsNothing(ref_CurrAssembly.LeftJamb) Or Not IsNothing(ref_CurrAssembly.RightJamb) Or Not IsNothing(ref_CurrAssembly.TopJamb) Then
|
||||
bJambExist = True
|
||||
End If
|
||||
If CInt(ref_CurrAssembly.DoorNumber) > 0 Then
|
||||
bDoorExist = True
|
||||
End If
|
||||
If bJambExist And bDoorExist Then
|
||||
Return True
|
||||
Else
|
||||
Return False
|
||||
End If
|
||||
Return False
|
||||
End Function
|
||||
|
||||
Private Sub DeleteDoorFromList()
|
||||
Dim SelIndex As Integer = m_CurrProject.AssemblyList.IndexOf(m_SelectedAssembly)
|
||||
Dim ExtensionFile As String = Path.GetExtension(m_SelectedAssembly.Name)
|
||||
Dim FileName As String = Path.GetFileName(m_SelectedAssembly.Name)
|
||||
' modifico l'estensione del file
|
||||
FileName = FileName.Replace(ExtensionFile, ".err")
|
||||
' qui modifico il nome del file, ma ancora non è sostituito nel sistema
|
||||
m_SelectedAssembly.Name = m_SelectedAssembly.Name.Replace(Path.GetFileName(m_SelectedAssembly.Name), FileName)
|
||||
m_CurrProject.AssemblyList.RemoveAt(SelIndex)
|
||||
CurrProject.NotifyPropertyChanged("AssemblyList")
|
||||
' se la lista non è rimasta vuota
|
||||
If m_CurrProject.AssemblyList.Count > 0 Then
|
||||
' aggiorno la porta da visualizzare
|
||||
If SelIndex > m_CurrProject.AssemblyList.Count - 1 Then
|
||||
SelectedAssembly = m_CurrProject.AssemblyList(SelIndex - 1)
|
||||
Else
|
||||
SelectedAssembly = m_CurrProject.AssemblyList(SelIndex)
|
||||
End If
|
||||
' se non ci sono altre porte nella lista allora
|
||||
Else
|
||||
' elimino qualsiasi resto di porta
|
||||
Map.refPartPageVM.CurrPart = Nothing
|
||||
' aggiorni l'immagine a nulla
|
||||
EgtNewFile()
|
||||
EgtZoom(ZM.ALL)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
#End Region ' METHODS
|
||||
|
||||
#Region "COMMANDS"
|
||||
|
||||
#Region "AddDoorCommand"
|
||||
|
||||
''' <summary>
|
||||
''' Returns a command that do New.
|
||||
''' </summary>
|
||||
Public ReadOnly Property AddAssemblyCommand As ICommand
|
||||
Get
|
||||
If m_cmdAddAssembly Is Nothing Then
|
||||
m_cmdAddAssembly = New Command(AddressOf AddAssembly)
|
||||
End If
|
||||
Return m_cmdAddAssembly
|
||||
End Get
|
||||
End Property
|
||||
|
||||
''' <summary>
|
||||
''' Execute the New. This method is invoked by the NewCommand.
|
||||
''' </summary>
|
||||
Public Sub AddAssembly()
|
||||
If Not SaveCurrentAssembly() Then
|
||||
Exit Sub
|
||||
End If
|
||||
Dim NameExist As Boolean = True
|
||||
Dim ImportTemplate As String = String.Empty
|
||||
'---------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
' CHIEDO SE SI VUOLE IMPOTRTARE UN TEMPLATE
|
||||
|
||||
''Prima di tutto chiedo se vuole aprire un template
|
||||
'If MessageBox.Show(EgtMsg(50146), EgtMsg(50110), MessageBoxButton.YesNo, MessageBoxImage.Question, MessageBoxResult.Yes) = MessageBoxResult.Yes Then
|
||||
' ' Apro la finestra di dailogo aperta direttamente sulla cartella cercata
|
||||
' Dim OpenFileDialog As New System.Windows.Forms.OpenFileDialog
|
||||
' OpenFileDialog.InitialDirectory = IniFile.m_TemplateDir
|
||||
' If OpenFileDialog.ShowDialog <> Forms.DialogResult.OK Then
|
||||
' ' se la risposta è diversa da OK esce
|
||||
' Return
|
||||
' End If
|
||||
' ' carico l'indirizzo del template che voglio aprire
|
||||
' ImportTemplate = OpenFileDialog.FileName
|
||||
'End If
|
||||
'----------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
' lancio la finestra per la creazione di una nuova porta
|
||||
Dim SaveFileDialog As New EgtWPFLib5.EgtSaveFileDialog
|
||||
SaveFileDialog.Title = K_NEWDOOR
|
||||
SaveFileDialog.Directory = m_CurrProject.Name
|
||||
SaveFileDialog.Extension = K_DDFEXTENSION
|
||||
' se decido di chiuedere la finestra
|
||||
If Not SaveFileDialog.EgtShowDialog Then
|
||||
Return
|
||||
End If
|
||||
' Controllo se ha estensione il nome della porta
|
||||
If Path.HasExtension(SaveFileDialog.FileName) Then
|
||||
Dim sExtension As String = Path.GetExtension(SaveFileDialog.FileName)
|
||||
If Not sExtension.ToLower = K_DDFEXTENSION Then
|
||||
SaveFileDialog.FileName = SaveFileDialog.FileName.Replace(sExtension, K_DDFEXTENSION)
|
||||
End If
|
||||
Else
|
||||
SaveFileDialog.FileName &= K_DDFEXTENSION
|
||||
End If
|
||||
' controllo che il nome non sia presente nella lista
|
||||
Dim bNameExist As Boolean = False
|
||||
Dim IndexDoorList As Integer
|
||||
For IndexDoorList = 0 To CurrProject.AssemblyList.Count - 1
|
||||
If CurrProject.AssemblyList(IndexDoorList).Name = SaveFileDialog.FileName Then
|
||||
' se il nome è nella lista allora esco dal ciclo e rendo falsa la variabile bNameExist
|
||||
bNameExist = True
|
||||
Exit For
|
||||
End If
|
||||
bNameExist = False
|
||||
Next
|
||||
' se il nome è nella lista allora sovrascirvo sulla porta esistente
|
||||
If bNameExist Then
|
||||
' elimino la porta esistente
|
||||
File.Delete(SaveFileDialog.FileName)
|
||||
' elimino dalla lista
|
||||
m_CurrProject.AssemblyList.RemoveAt(IndexDoorList)
|
||||
CurrProject.NotifyPropertyChanged("AssemblyList")
|
||||
End If
|
||||
|
||||
' aggiungo il nome del file alla lista degli assemblati
|
||||
Dim Local_AssemblyName As New AssemblyName
|
||||
Local_AssemblyName.Name = SaveFileDialog.FileName
|
||||
Local_AssemblyName.IsModify = False
|
||||
CurrProject.AssemblyList.Add(Local_AssemblyName)
|
||||
' aggiorno la lista
|
||||
CurrProject.NotifyPropertyChanged("AssemblyList")
|
||||
'------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
' LETTURA DI UN FILE DI TIPO TEMPLATE
|
||||
|
||||
'If String.IsNullOrEmpty(ImportTemplate) Then
|
||||
' NewAssembly = True
|
||||
'Else
|
||||
' ' !!!!se sto aprendo un template significa che devo leggere un file già esistente!!!!
|
||||
' NewAssembly = False
|
||||
' ' creo il file ddf associato al template
|
||||
' Dim TemplateDoor As New Part
|
||||
' Part.ReadDDF(ImportTemplate, TemplateDoor)
|
||||
' WriteDDF(TemplateDoor, SaveFileDialog.FileName, False)
|
||||
'End If
|
||||
'------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
' carico il nome ceme Assemblato selezionato
|
||||
OpenSelectedAssembly(Local_AssemblyName)
|
||||
End Sub
|
||||
|
||||
#End Region ' AddDoorCommand
|
||||
|
||||
#Region "RemoveDoorCommand"
|
||||
|
||||
''' <summary>
|
||||
''' Returns a command that do New.
|
||||
''' </summary>
|
||||
Public ReadOnly Property RemoveDoorCommand As ICommand
|
||||
Get
|
||||
If m_cmdRemoveDoor Is Nothing Then
|
||||
m_cmdRemoveDoor = New Command(AddressOf RemoveAssembly)
|
||||
End If
|
||||
Return m_cmdRemoveDoor
|
||||
End Get
|
||||
End Property
|
||||
|
||||
''' <summary>
|
||||
''' Execute the New. This method is invoked by the NewCommand.
|
||||
''' </summary>
|
||||
Public Sub RemoveAssembly()
|
||||
Dim DeletingQuestion As Integer = 0
|
||||
Dim DeletingResult As MessageBoxResult = MessageBoxResult.No
|
||||
If IsNothing(m_SelectedAssembly) Then Return
|
||||
''DeleteNewPart = -1
|
||||
'' salvo il nome del file che sta per essere eliminato
|
||||
'Dim RemoveDoorName As String = Path.GetFileNameWithoutExtension(m_SelectedAssembly)
|
||||
|
||||
''If Map.refPartPageVM.CurrPart.NewPart Then
|
||||
'' ' se sono arrivato qui signifoca che sto chiudendo il programma con una porta nuova aperta ma non salvata
|
||||
'' ' se ho dichiarato che non voglio salvare significa che devo eliminare
|
||||
'' DeletingResult = MessageBoxResult.Yes
|
||||
'Else
|
||||
' ' stamp a video il messaggio per chiedere se eliminare
|
||||
' DeletingResult = MessageBox.Show(String.Format(EgtMsg(50116), Path.GetFileNameWithoutExtension(m_SelectedAssembly)), EgtMsg(50110), MessageBoxButton.YesNo, MessageBoxImage.Warning, MessageBoxResult.No)
|
||||
'End if
|
||||
DeletingResult = MessageBox.Show(String.Format(EgtMsg(50117), Path.GetFileNameWithoutExtension(m_SelectedAssembly.Name)), EgtMsg(50110), MessageBoxButton.YesNo, MessageBoxImage.Warning, MessageBoxResult.No)
|
||||
' chiedo se devo eliminere il file: se si
|
||||
If DeletingResult = MessageBoxResult.Yes Then
|
||||
' ricerco l'indice del file all'interno della lista delle porte
|
||||
'SetNameCurrAssemblyAsSaved(m_SelectedAssembly)
|
||||
'Dim SelIndex As Integer = m_CurrProject.AssemblyList.IndexOf(m_SelectedAssembly)
|
||||
' elimino dall'elenco dei file
|
||||
If File.Exists(m_SelectedAssembly.Name) Then
|
||||
File.Delete(m_SelectedAssembly.Name)
|
||||
End If
|
||||
RemoveFromAssemblyList()
|
||||
' elimino dalla lista
|
||||
' m_CurrProject.AssemblyList.Remove(m_SelectedAssembly)
|
||||
' CurrProject.NotifyPropertyChanged("AssemblyList")
|
||||
' '' per quando torno nel m_SelectedDoor...per non chiedere di salvare o eliminare
|
||||
' 'DeleteNewPart = -1
|
||||
' '' se la lista non è rimasta vuota
|
||||
' If m_CurrProject.AssemblyList.Count > 0 Then
|
||||
' ' aggiorno la porta da visualizzare
|
||||
' If SelIndex > m_CurrProject.AssemblyList.Count - 1 Then
|
||||
' SelectedAssembly = m_CurrProject.AssemblyList(SelIndex - 1)
|
||||
' OpenSelectedAssembly(SelectedAssembly)
|
||||
' Else
|
||||
' SelectedAssembly = m_CurrProject.AssemblyList(SelIndex)
|
||||
' OpenSelectedAssembly(SelectedAssembly)
|
||||
' End If
|
||||
' ' se non ci sono altre porte nella lista allora
|
||||
' Else
|
||||
' ' elimino qualsiasi resto di porta
|
||||
' Map.refJambPageVM.CurrAssembly = Nothing
|
||||
' ' aggiorni l'immagine a nulla
|
||||
' EgtNewFile()
|
||||
' EgtZoom(ZM.ALL)
|
||||
' End If
|
||||
Else
|
||||
'altrimenti salvo il file
|
||||
DdfFile.WriteDDFAssembly(Map.refAssemblyPageVM.CurrAssembly, m_SelectedAssembly.Name, True)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
#End Region ' RemoveDoorCommand
|
||||
|
||||
#End Region ' Commands
|
||||
|
||||
Public Event PropertyChanged As PropertyChangedEventHandler Implements INotifyPropertyChanged.PropertyChanged
|
||||
|
||||
Public Sub NotifyPropertyChanged(propName As String)
|
||||
RaiseEvent PropertyChanged(Me, New PropertyChangedEventArgs(propName))
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
@@ -1,18 +0,0 @@
|
||||
Public Class DoorManagerView
|
||||
|
||||
Private m_rfDoorManagerViewModel As DoorManagerViewModel
|
||||
|
||||
Sub New(rfDoorManagerViewModel As DoorManagerViewModel)
|
||||
' This call is required by the designer.
|
||||
InitializeComponent()
|
||||
' Add any initialization after the InitializeComponent() call.
|
||||
Me.DataContext = rfDoorManagerViewModel
|
||||
m_rfDoorManagerViewModel = rfDoorManagerViewModel
|
||||
End Sub
|
||||
|
||||
Private Sub Door_MouseLeftButtonDown(sender As Object, e As MouseButtonEventArgs)
|
||||
Dim Item As ListBoxItem = DirectCast(sender, ListBoxItem)
|
||||
e.Handled = Not m_rfDoorManagerViewModel.ChooseSelectedDoor(CStr(Item.DataContext))
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
@@ -1,419 +0,0 @@
|
||||
Imports System.Collections.ObjectModel
|
||||
Imports System.ComponentModel
|
||||
Imports System.IO
|
||||
Imports EgtUILib
|
||||
|
||||
Public Class DoorManagerViewModel
|
||||
Implements INotifyPropertyChanged
|
||||
Private m_rfMainWindowViewModel As MainWindowViewModel
|
||||
' percorso della porta corrente (creata o già esistente nella cartella) !!! attenzione !!!
|
||||
' ora non si parla piu di avere una porta selezoionata ma ben si un assemblay selezionato,
|
||||
' questo comporta che possono esistere anche due porte contemporaneamente
|
||||
Private m_SelectedDoor As String
|
||||
Private NewDoor As Boolean = False
|
||||
Friend DeleteNewDoor As Integer = 1
|
||||
|
||||
Private SelDoor As New Door
|
||||
' devo aggiungere la possibilità di creare anche una seconda porta (o in latermativa di non creare nessuna porta?)
|
||||
Private SelDoor2 As New Door
|
||||
|
||||
Friend MsgResult As MessageBoxResult
|
||||
|
||||
' creiamo un nuovo progetto: un nome e una lista di porte--> questo non deve essere modificato
|
||||
Private m_CurrProject As New Project
|
||||
Public Property CurrProject As Project
|
||||
Get
|
||||
Return m_CurrProject
|
||||
End Get
|
||||
Set(value As Project)
|
||||
m_CurrProject = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
' percorso della porta in lettura (o creazione)--> che in realtà è i percorso dell'assemblay
|
||||
Public Property SelectedDoor As String
|
||||
Get
|
||||
Return m_SelectedDoor
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_SelectedDoor = value
|
||||
NotifyPropertyChanged("SelectedDoor")
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private Sub DeleteDoorFromList()
|
||||
Dim SelIndex As Integer = m_CurrProject.DoorList.IndexOf(m_SelectedDoor)
|
||||
Dim ExtensionFile As String = Path.GetExtension(m_SelectedDoor)
|
||||
Dim FileName As String = Path.GetFileName(m_SelectedDoor)
|
||||
' modifico l'estensione del file
|
||||
FileName = FileName.Replace(ExtensionFile, ".err")
|
||||
' qui modifico il nome del file, ma ancora non è sostituito nel sistema
|
||||
m_SelectedDoor = m_SelectedDoor.Replace(Path.GetFileName(m_SelectedDoor), FileName)
|
||||
m_CurrProject.DoorList.RemoveAt(SelIndex)
|
||||
CurrProject.NotifyPropertyChanged("DoorList")
|
||||
' se la lista non è rimasta vuota
|
||||
If m_CurrProject.DoorList.Count > 0 Then
|
||||
' aggiorno la porta da visualizzare
|
||||
If SelIndex > m_CurrProject.DoorList.Count - 1 Then
|
||||
SelectedDoor = m_CurrProject.DoorList(SelIndex - 1)
|
||||
Else
|
||||
SelectedDoor = m_CurrProject.DoorList(SelIndex)
|
||||
End If
|
||||
' se non ci sono altre porte nella lista allora
|
||||
Else
|
||||
' elimino qualsiasi resto di porta
|
||||
DirectCast(m_rfMainWindowViewModel.DoorParameters.DataContext, DoorParametersViewModel).CurrDoor = Nothing
|
||||
' aggiorni l'immagine a nulla
|
||||
EgtNewFile()
|
||||
EgtZoom(ZM.ALL)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Public ReadOnly Property AddNewDoorToolTip As String
|
||||
Get
|
||||
Return EgtMsg(50302)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property RemoveDoorToolTip As String
|
||||
Get
|
||||
Return EgtMsg(50303)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
' Definizione comandi
|
||||
Private m_cmdAddDoor As ICommand
|
||||
Private m_cmdRemoveDoor As ICommand
|
||||
|
||||
Sub New(ByRef MainWindowViewModel As MainWindowViewModel)
|
||||
m_rfMainWindowViewModel = MainWindowViewModel
|
||||
End Sub
|
||||
|
||||
#Region "METHODS"
|
||||
' questa funzione permetterà di leggere la scelta dell'assemblato (il nome del file da aprire)
|
||||
Friend Function ChooseSelectedDoor(value As String) As Boolean
|
||||
Dim Index As Integer = -1
|
||||
|
||||
If IsNothing(value) Then Return False
|
||||
' riferimento alla porta (per stampare il DDF)
|
||||
Dim DoorParametersViewModel As DoorParametersViewModel = DirectCast(m_rfMainWindowViewModel.DoorParameters.DataContext, DoorParametersViewModel)
|
||||
' se eiste il file selezionato
|
||||
If value = m_SelectedDoor Then
|
||||
Return True
|
||||
Exit Function
|
||||
End If
|
||||
If File.Exists(m_SelectedDoor) Then
|
||||
' prima di cambiare porta selezionata chiedo il salvataggio il quella precedente
|
||||
' se esiste una porta corrente associata al nome allora scrivo il file ddf per il disegno
|
||||
If Not IsNothing(DoorParametersViewModel.CurrDoor) Then
|
||||
' è necessario che il file passato alla grafica non presenti espressioni numeriche
|
||||
DdfFile.WriteDDF(DoorParametersViewModel.CurrDoor, IniFile.m_sTempDir & "\CurrDoor.ddf", True)
|
||||
|
||||
Select Case DeleteNewDoor
|
||||
' se è una porta appena creata
|
||||
Case 0
|
||||
' chiedo se deve essere eliminata la porta che era stata creata
|
||||
RemoveDoor()
|
||||
DeleteNewDoor = 1
|
||||
' se è una porta "vecchia"
|
||||
Case 1
|
||||
' confronto il file della porta originale e quello aggiornato: se i due file sono uguali eccetto la data
|
||||
' non faccio nulla
|
||||
If DdfFile.SetModify(m_rfMainWindowViewModel) Then
|
||||
|
||||
Else
|
||||
' altrimenti chiedo di salvare il file di disegno
|
||||
MsgResult = MessageBox.Show(String.Format(EgtMsg(50109), Path.GetFileNameWithoutExtension(m_SelectedDoor)), EgtMsg(50110), MessageBoxButton.YesNoCancel, MessageBoxImage.Warning)
|
||||
If MsgResult = MessageBoxResult.Yes Then
|
||||
DdfFile.WriteDDF(DoorParametersViewModel.CurrDoor, m_SelectedDoor, True)
|
||||
DirectCast(m_rfMainWindowViewModel.DoorParameters.DataContext, DoorParametersViewModel).bSetChange = False
|
||||
ElseIf MsgResult = MessageBoxResult.Cancel Then
|
||||
|
||||
'NotifyPropertyChanged("SelectedDoor")
|
||||
Return False
|
||||
ElseIf (MsgResult = MessageBoxResult.No AndAlso DoorParametersViewModel.CurrDoor.NewDoor = True) Then
|
||||
RemoveDoor()
|
||||
End If
|
||||
End If
|
||||
|
||||
End Select
|
||||
End If
|
||||
End If
|
||||
' tolgo l'* dal titolo a prescindere che il file sia stato o no salvato
|
||||
Dim SetTitle = DirectCast(m_rfMainWindowViewModel.DoorParameters.DataContext, DoorParametersViewModel).CurrProject.Name
|
||||
m_rfMainWindowViewModel.ProjectNameMsg = SetTitle
|
||||
' se non esisteva nessuna porta allora posso procedere
|
||||
m_SelectedDoor = value
|
||||
NotifyPropertyChanged("SelectedDoor")
|
||||
SelDoor = Nothing
|
||||
SelDoor = New Door
|
||||
SelDoor.NewDoor = NewDoor
|
||||
If SelDoor.NewDoor Then
|
||||
'OptionModule.GeneralDoor.CompoList.Clear()
|
||||
SelDoor.Width = OptionModule.m_Width
|
||||
SelDoor.Height = OptionModule.m_Height
|
||||
SelDoor.Thickness = OptionModule.m_Thickness
|
||||
SelDoor.Weight = OptionModule.m_Weight
|
||||
SelDoor.Swing = OptionModule.m_Swing
|
||||
|
||||
SelDoor.LockEdgeType = OptionModule.m_LockEdgeType
|
||||
SelDoor.HingeEdgeType = OptionModule.m_HingeEdgeType
|
||||
SelDoor.TopType = OptionModule.m_TopType
|
||||
SelDoor.BottomType = OptionModule.m_BottomType
|
||||
|
||||
SelDoor.LockEdgeMachining = OptionModule.m_LockEdgeMachining
|
||||
SelDoor.HingeEdgeMachining = OptionModule.m_HingeEdgeMachining
|
||||
SelDoor.TopMachining = OptionModule.m_TopMachining
|
||||
SelDoor.BottomMachining = OptionModule.m_BottomMachining
|
||||
SelDoor.LockEdgeOverMaterial = OptionModule.m_LockEdgeOverMaterial
|
||||
SelDoor.HingeEdgeOverMaterial = OptionModule.m_HingeEdgeOverMaterial
|
||||
SelDoor.TopOverMaterial = OptionModule.m_TopOverMaterial
|
||||
SelDoor.BottomOverMaterial = OptionModule.m_BottomOverMaterial
|
||||
' assegno la porta creata alla Programma come porta corrente
|
||||
DoorParametersViewModel.CurrDoor = SelDoor
|
||||
' scrivo il ddf della nuova porta come file temp
|
||||
If Not IsNothing(DoorParametersViewModel.CurrDoor) Then DdfFile.WriteDDF(DoorParametersViewModel.CurrDoor, IniFile.m_sTempDir & "\CurrDoor.ddf", True)
|
||||
' e stampo il nuovo ddf
|
||||
DdfFile.WriteDDF(DoorParametersViewModel.CurrDoor, m_SelectedDoor, True)
|
||||
' quindi da ora la nuova porta ha un suo DDF che possiamo trattare come tutti gli altri
|
||||
' assegno il valore falso cosi da non ripetere questa operazione nel caso in cui si arrivi dalla funzione AddDoor
|
||||
SelDoor.NewDoor = True
|
||||
NewDoor = False
|
||||
End If
|
||||
' per aggiornare la parte grafica
|
||||
' se il nome della porta è uno spazio vuoto allora non genero la porta ( per esempio sto aprendo una cartella vuota)
|
||||
If Not String.IsNullOrWhiteSpace(m_SelectedDoor) Then
|
||||
' leggo il file ddf
|
||||
Door.ReadDDF(m_SelectedDoor, SelDoor)
|
||||
' assegno come porta del programma quella aperta
|
||||
DoorParametersViewModel.CurrDoor = SelDoor
|
||||
' copio il file DDF come file DDF temporaneo
|
||||
If Not IsNothing(DoorParametersViewModel.CurrDoor) Then
|
||||
DdfFile.WriteDDF(SelDoor, IniFile.m_sTempDir & "\CurrDoor.ddf", True)
|
||||
ExecDoors(DirectCast(m_rfMainWindowViewModel.SceneManager.DataContext, SceneManagerViewModel).ProjectScene, IniFile.m_sTempDir & "\CurrDoor.ddf")
|
||||
' dal MainWindowViewModel accediamo alla ScenaManagerViewModel (primo DirectCast)
|
||||
' dalla StatusBar accediamo alla proprietà pubblica UnitMeasure
|
||||
DirectCast(DirectCast(m_rfMainWindowViewModel.SceneManager.DataContext, SceneManagerViewModel).StatusBar.DataContext, StatusBarViewModel).UnitMeasure = SelDoor.Measure
|
||||
End If
|
||||
End If
|
||||
If IsNothing(SelDoor) Then
|
||||
MessageBox.Show(EgtMsg(50145), EgtMsg(50118), MessageBoxButton.OK, MessageBoxImage.Exclamation)
|
||||
DoorParametersViewModel.CurrDoor = Nothing
|
||||
DeleteDoorFromList()
|
||||
End If
|
||||
Return True
|
||||
End Function
|
||||
#End Region ' METHODS
|
||||
|
||||
#Region "COMMANDS"
|
||||
|
||||
#Region "AddDoorCommand"
|
||||
|
||||
''' <summary>
|
||||
''' Returns a command that do New.
|
||||
''' </summary>
|
||||
Public ReadOnly Property AddDoorCommand As ICommand
|
||||
Get
|
||||
If m_cmdAddDoor Is Nothing Then
|
||||
m_cmdAddDoor = New Command(AddressOf AddDoor)
|
||||
End If
|
||||
Return m_cmdAddDoor
|
||||
End Get
|
||||
End Property
|
||||
|
||||
''' <summary>
|
||||
''' Execute the New. This method is invoked by the NewCommand.
|
||||
''' </summary>
|
||||
Public Sub AddDoor()
|
||||
Dim NameExist As Boolean = True
|
||||
Dim ImportTemplate As String = String.Empty
|
||||
'Prima di tutto chiedo se vuole aprire un template
|
||||
If MessageBox.Show(EgtMsg(50146), EgtMsg(50110), MessageBoxButton.YesNo, MessageBoxImage.Question, MessageBoxResult.Yes) = MessageBoxResult.Yes Then
|
||||
' Apro la finestra di dailogo aperta direttamente sulla cartella cercata
|
||||
Dim OpenFileDialog As New System.Windows.Forms.OpenFileDialog
|
||||
|
||||
|
||||
OpenFileDialog.InitialDirectory = IniFile.m_TemplateDir
|
||||
If OpenFileDialog.ShowDialog <> Forms.DialogResult.OK Then
|
||||
' se la risposta è diversa da OK esce
|
||||
Return
|
||||
End If
|
||||
' carico l'indirizzo del template che voglio aprire
|
||||
ImportTemplate = OpenFileDialog.FileName
|
||||
End If
|
||||
|
||||
' lancio la finestra per la creazione di una nuova porta
|
||||
Dim SaveFileDialog As New EgtWPFLib5.EgtSaveFileDialog
|
||||
SaveFileDialog.Title = K_NEWDOOR
|
||||
SaveFileDialog.Directory = m_CurrProject.Name
|
||||
SaveFileDialog.Extension = K_DDFEXTENSION
|
||||
'SaveFileDialog.FileName = m_CurrProject.Name & "\"
|
||||
' se decido di chiuedere la finestra
|
||||
If Not SaveFileDialog.EgtShowDialog Then
|
||||
Return
|
||||
End If
|
||||
' Controllo se ha estensione il nome della porta
|
||||
If Path.HasExtension(SaveFileDialog.FileName) Then
|
||||
Dim sExtension As String = Path.GetExtension(SaveFileDialog.FileName)
|
||||
If Not sExtension.ToLower = K_DDFEXTENSION Then
|
||||
SaveFileDialog.FileName = SaveFileDialog.FileName.Replace(sExtension, K_DDFEXTENSION)
|
||||
End If
|
||||
Else
|
||||
SaveFileDialog.FileName &= K_DDFEXTENSION
|
||||
End If
|
||||
' controllo che il nome non sia presente nella lista
|
||||
Dim bNameExist As Boolean = False
|
||||
Dim IndexDoorList As Integer
|
||||
For IndexDoorList = 0 To CurrProject.DoorList.Count - 1
|
||||
If CurrProject.DoorList(IndexDoorList) = SaveFileDialog.FileName Then
|
||||
' se il nome è nella lista allora esco dal ciclo e rendo falsa la variabile bNameExist
|
||||
bNameExist = True
|
||||
Exit For
|
||||
End If
|
||||
bNameExist = False
|
||||
Next
|
||||
|
||||
' se il nome è nella lista allora sovrascirvo sulla porta esistente
|
||||
If bNameExist Then
|
||||
' elimino la porta esistente
|
||||
File.Delete(SaveFileDialog.FileName)
|
||||
' elimino dalla lista
|
||||
m_CurrProject.DoorList.Remove(SaveFileDialog.FileName)
|
||||
CurrProject.NotifyPropertyChanged("DoorList")
|
||||
End If
|
||||
|
||||
' aggiungo il nome del file alla lista delle porte
|
||||
CurrProject.DoorList.Add(SaveFileDialog.FileName)
|
||||
' aggiorno la lista
|
||||
CurrProject.NotifyPropertyChanged("DoorList")
|
||||
NewDoor = True
|
||||
|
||||
If String.IsNullOrEmpty(ImportTemplate) Then
|
||||
NewDoor = True
|
||||
Else
|
||||
NewDoor = False
|
||||
' creo il file ddf associato al template
|
||||
Dim TemplateDoor As New Door
|
||||
Door.ReadDDF(ImportTemplate, TemplateDoor)
|
||||
WriteDDF(TemplateDoor, SaveFileDialog.FileName, False)
|
||||
End If
|
||||
ChooseSelectedDoor(SaveFileDialog.FileName)
|
||||
SelectedDoor = SaveFileDialog.FileName
|
||||
' con la dichiarazione seguente salto non considero più di chiedere se eliminare la porta già esistente
|
||||
DeleteNewDoor = 1
|
||||
End Sub
|
||||
|
||||
#End Region ' AddDoorCommand
|
||||
|
||||
#Region "RemoveDoorCommand"
|
||||
|
||||
''' <summary>
|
||||
''' Returns a command that do New.
|
||||
''' </summary>
|
||||
Public ReadOnly Property RemoveDoorCommand As ICommand
|
||||
Get
|
||||
If m_cmdRemoveDoor Is Nothing Then
|
||||
m_cmdRemoveDoor = New Command(AddressOf RemoveDoor)
|
||||
End If
|
||||
Return m_cmdRemoveDoor
|
||||
End Get
|
||||
End Property
|
||||
|
||||
''' <summary>
|
||||
''' Execute the New. This method is invoked by the NewCommand.
|
||||
''' </summary>
|
||||
Public Sub RemoveDoor()
|
||||
Dim DeletingQuestion As Integer = 0
|
||||
Dim DeletingResult As MessageBoxResult = MessageBoxResult.No
|
||||
|
||||
If Not IsNothing(m_SelectedDoor) Then
|
||||
DeleteNewDoor = -1
|
||||
' salvo il nome del file che sta per essere eliminato
|
||||
Dim RemoveDoorName As String = Path.GetFileNameWithoutExtension(m_SelectedDoor)
|
||||
|
||||
If DirectCast(m_rfMainWindowViewModel.DoorParameters.DataContext, DoorParametersViewModel).CurrDoor.NewDoor Then
|
||||
' se sono arrivato qui signifoca che sto chiudendo il programma con una porta nuova aperta ma non salvata
|
||||
' se ho dichiarato che non voglio salvare significa che devo eliminare
|
||||
DeletingResult = MessageBoxResult.Yes
|
||||
Else
|
||||
' stamp a video il messaggio per chiedere se eliminare
|
||||
DeletingResult = MessageBox.Show(String.Format(EgtMsg(50116), Path.GetFileNameWithoutExtension(m_SelectedDoor)), EgtMsg(50110), MessageBoxButton.YesNo, MessageBoxImage.Warning, MessageBoxResult.No)
|
||||
End If
|
||||
|
||||
' chiedo se devo eliminere il file: se si
|
||||
If DeletingResult = MessageBoxResult.Yes Then
|
||||
' ricerco l'indice del file all'interno della lista delle porte
|
||||
Dim SelIndex As Integer = m_CurrProject.DoorList.IndexOf(m_SelectedDoor)
|
||||
' elimino dall'elenco dei file
|
||||
File.Delete(m_SelectedDoor)
|
||||
' elimino dalla lista
|
||||
m_CurrProject.DoorList.Remove(m_SelectedDoor)
|
||||
CurrProject.NotifyPropertyChanged("DoorList")
|
||||
' per quando torno nel m_SelectedDoor...per non chiedere di salvare o eliminare
|
||||
DeleteNewDoor = -1
|
||||
' se la lista non è rimasta vuota
|
||||
If m_CurrProject.DoorList.Count > 0 Then
|
||||
' aggiorno la porta da visualizzare
|
||||
If SelIndex > m_CurrProject.DoorList.Count - 1 Then
|
||||
SelectedDoor = m_CurrProject.DoorList(SelIndex - 1)
|
||||
ChooseSelectedDoor(SelectedDoor)
|
||||
Else
|
||||
SelectedDoor = m_CurrProject.DoorList(SelIndex)
|
||||
ChooseSelectedDoor(SelectedDoor)
|
||||
End If
|
||||
' se non ci sono altre porte nella lista allora
|
||||
Else
|
||||
' elimino qualsiasi resto di porta
|
||||
DirectCast(m_rfMainWindowViewModel.DoorParameters.DataContext, DoorParametersViewModel).CurrDoor = Nothing
|
||||
' aggiorni l'immagine a nulla
|
||||
EgtNewFile()
|
||||
EgtZoom(ZM.ALL)
|
||||
End If
|
||||
Else
|
||||
' altrimenti salvo il file
|
||||
DdfFile.WriteDDF(DirectCast(m_rfMainWindowViewModel.DoorParameters.DataContext, DoorParametersViewModel).CurrDoor, m_SelectedDoor, True)
|
||||
End If
|
||||
End If
|
||||
End Sub
|
||||
|
||||
#End Region ' RemoveDoorCommand
|
||||
|
||||
#End Region ' Commands
|
||||
|
||||
Public Event PropertyChanged As PropertyChangedEventHandler Implements INotifyPropertyChanged.PropertyChanged
|
||||
|
||||
Public Sub NotifyPropertyChanged(propName As String)
|
||||
RaiseEvent PropertyChanged(Me, New PropertyChangedEventArgs(propName))
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
|
||||
' Restituisce solo il nome del file del progetto aperto
|
||||
Public Class PathConverter
|
||||
Implements IValueConverter
|
||||
|
||||
Public Function Convert(value As Object, targetType As Type, parameter As Object, culture As System.Globalization.CultureInfo) As Object Implements IValueConverter.Convert
|
||||
Dim sPath As String = CStr(value)
|
||||
Return Path.GetFileNameWithoutExtension(sPath)
|
||||
End Function
|
||||
|
||||
Public Function ConvertBack(value As Object, targetType As Type, parameter As Object, culture As System.Globalization.CultureInfo) As Object Implements IValueConverter.ConvertBack
|
||||
Throw New NotImplementedException
|
||||
End Function
|
||||
|
||||
End Class
|
||||
|
||||
' Nasconde i pulsanti +/- se la lista di porte non contiene nulla
|
||||
Public Class ProjectVisibilityConverter
|
||||
Implements IValueConverter
|
||||
|
||||
Public Function Convert(value As Object, targetType As Type, parameter As Object, culture As System.Globalization.CultureInfo) As Object Implements IValueConverter.Convert
|
||||
Dim sProjectName As String = CStr(value)
|
||||
Return If(Directory.Exists(sProjectName), Visibility.Visible, Visibility.Collapsed)
|
||||
End Function
|
||||
|
||||
Public Function ConvertBack(value As Object, targetType As Type, parameter As Object, culture As System.Globalization.CultureInfo) As Object Implements IValueConverter.ConvertBack
|
||||
Throw New NotImplementedException
|
||||
End Function
|
||||
|
||||
End Class
|
||||
@@ -6,24 +6,24 @@ Imports EgtUILib
|
||||
Public Class Compo
|
||||
Implements INotifyPropertyChanged
|
||||
Friend TempFileDDF As String = IniFile.m_sTempDir & "\" & TEMP_FILE
|
||||
Friend m_rfCurrDoor As Door
|
||||
'Friend m_rfCurrDoor As Part
|
||||
|
||||
' definizione della funzione delegato: riceve il valore di modifica della compo e della general
|
||||
'Delegate Function CompareIsModify(rIsModifyCompo As Boolean, rIsModifyDoor As Boolean) As Boolean
|
||||
|
||||
' aggiorno la variabile globale di cambiamento: verifico che sia il template che una combo/text sono state modificate
|
||||
Function IsModify() As Boolean
|
||||
If m_IsModifiedTemplateSelItem Then
|
||||
Return True
|
||||
End If
|
||||
For IndexCompoParamList = 0 To Me.CompoParamList.Count - 1
|
||||
If Me.CompoParamList(IndexCompoParamList).m_IsModifyCompoParam Then
|
||||
m_rfCurrDoor.m_IsModifyDoor = True
|
||||
Return True
|
||||
End If
|
||||
Next
|
||||
Return False
|
||||
End Function
|
||||
'' aggiorno la variabile globale di cambiamento: verifico che sia il template che una combo/text sono state modificate
|
||||
'Function IsModify() As Boolean
|
||||
' If m_IsModifiedTemplateSelItem Then
|
||||
' Return True
|
||||
' End If
|
||||
' For IndexCompoParamList = 0 To Me.CompoParamList.Count - 1
|
||||
' If Me.CompoParamList(IndexCompoParamList).m_IsModifyCompoParam Then
|
||||
' m_rfCurrDoor.m_IsModifyDoor = True
|
||||
' Return True
|
||||
' End If
|
||||
' Next
|
||||
' Return False
|
||||
'End Function
|
||||
|
||||
' creo la stringa che contiene la lista degli errori
|
||||
Dim ErrorList As String = String.Empty
|
||||
@@ -36,6 +36,36 @@ Public Class Compo
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_refCompoJamb As Compo
|
||||
Public Property refJambCompo As Compo
|
||||
Get
|
||||
Return m_refCompoJamb
|
||||
End Get
|
||||
Set(value As Compo)
|
||||
m_refCompoJamb = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_IsReadOnly As Boolean = True
|
||||
Public Property IsReadOnly As Boolean
|
||||
Get
|
||||
Return m_IsReadOnly
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
m_IsReadOnly = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_IdCode As String
|
||||
Public Property IdCode As String
|
||||
Get
|
||||
Return m_IdCode
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_IdCode = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
#Region "Template ComboBox"
|
||||
|
||||
Private m_TemplateName As String
|
||||
@@ -76,8 +106,9 @@ Public Class Compo
|
||||
End Get
|
||||
Set(value As String)
|
||||
SetTemplateSelItem(value)
|
||||
m_IsModifiedTemplateSelItem = True
|
||||
m_rfCurrDoor.SetTitle()
|
||||
'm_IsModifiedTemplateSelItem = True
|
||||
'm_rfCurrDoor.SetTitle()
|
||||
Map.refAssemblyManagerVM.SelectedAssembly.IsModify = True
|
||||
End Set
|
||||
End Property
|
||||
|
||||
@@ -92,7 +123,6 @@ Public Class Compo
|
||||
If Not File.Exists(CurrItemPath) Then Return
|
||||
m_TemplateSelItem = value
|
||||
' creo la stringa che contiene la lista degli errori
|
||||
|
||||
Dim ParamIndex As Integer = 1
|
||||
Dim ConfigDefault As String = String.Empty
|
||||
Dim NewCompoParam As CompoParam = Nothing
|
||||
@@ -113,27 +143,22 @@ Public Class Compo
|
||||
For LineIndex = 0 To ReadCurrCompo.Count - 1
|
||||
' copio il valore della riga
|
||||
Dim CurrCompoFileLine As String = ReadCurrCompo(LineIndex)
|
||||
|
||||
' cerco il titolo [Graphic parameters]: se lo trovo
|
||||
If RegexFunction.IsGraphicParametersTitle(CurrCompoFileLine) Then
|
||||
' mi preparo per leggere la prima riga dopo il titolo
|
||||
|
||||
Dim ParamIndex As Integer = 1
|
||||
Dim NewCompoParam As CompoParam = Nothing
|
||||
Dim bIsFinished As Boolean = False
|
||||
|
||||
' se la lettura del primo parametro "--Default=" restituisce un valore non nullo
|
||||
If Not String.IsNullOrWhiteSpace(ParamLine(ReadCurrCompo(LineIndex + ParamIndex), K_DEFAULT)) Then
|
||||
Dim ConfigDefault As String = Trim(ParamLine(ReadCurrCompo(LineIndex + ParamIndex), K_DEFAULT))
|
||||
If Not IsNumeric(ConfigDefault) Then
|
||||
' se il valore letto non è numerico allora esco dal cilo per la lettura dei parametri
|
||||
Exit For
|
||||
|
||||
Else
|
||||
ReadParamConfig(NewCompoParam, ErrorList, ParamIndex, ConfigDefault)
|
||||
Exit For
|
||||
End If
|
||||
|
||||
Else
|
||||
' se il primo parametro non è "Dafault" allora mi aspetto di leggere i parametri
|
||||
While Not bIsFinished
|
||||
@@ -176,6 +201,54 @@ Public Class Compo
|
||||
End If
|
||||
Next
|
||||
End If
|
||||
'----------------------------------------------------------------------------------------------------------------------------------------------
|
||||
Dim FrameCompoFile As String = String.Empty
|
||||
Dim FrameCompoFileConfig As String = String.Empty
|
||||
If Not IsNothing(Me.refJambCompo) Then
|
||||
If Not File.Exists(Me.CompoType.Path & "\" & "Matching.lua") Then
|
||||
EgtOutLog("SetUp error: SetUp configuration file (" & Me.CompoType.Path & "\" & "Matching.lua)" & " doesn't exist ")
|
||||
'MessageBox.Show(EgtMsg(MSG_SETUPERRORS + 7), EgtMsg(MSG_SETUPERRORS + 1), MessageBoxButton.OK, MessageBoxImage.Error)
|
||||
'Return False
|
||||
Else
|
||||
EgtLuaExecFile(Me.CompoType.Path & "\" & "Matching.lua")
|
||||
EgtLuaSetGlobIntVar("STU.DoorNumber", CInt(Map.refAssemblyPageVM.CurrAssembly.DoorNumber))
|
||||
EgtLuaSetGlobStringVar("STU.CompoPath", Me.CompoType.Path)
|
||||
EgtLuaSetGlobStringVar("STU.Template", Me.TemplateSelItem)
|
||||
EgtLuaCallFunction("STU.Matching")
|
||||
EgtLuaGetGlobStringVar("STU.OutTemplate", FrameCompoFile)
|
||||
' se esite una corrispondenza nella tabella allora procedo
|
||||
If Not String.IsNullOrEmpty(FrameCompoFile) Then
|
||||
If Not SearchFileConfig(FrameCompoFile, FrameCompoFileConfig) Then
|
||||
MessageBox.Show("Compo does not exist", "Error", MessageBoxButton.OK, MessageBoxImage.Error)
|
||||
Else
|
||||
Dim FrameCompoNameDDF As String = String.Empty
|
||||
Dim FrameCompoName As String = String.Empty
|
||||
Dim Side As String = String.Empty
|
||||
Dim CurrCompoPath As String = FrameCompoFileConfig
|
||||
' sostituisco il vecchio CompoType con quello corretto
|
||||
If File.Exists(CurrCompoPath) Then
|
||||
GetPrivateProfileCompoName(ConstCompo.S_COMPO, ConstCompo.K_NAME, FrameCompoNameDDF, FrameCompoName, CurrCompoPath)
|
||||
GetPrivateProfileJambSide("PositionSide", "Side", Side, CurrCompoPath)
|
||||
If String.IsNullOrEmpty(Side) Then Side = Me.CompoType.JambSide
|
||||
Me.refJambCompo.CompoType.SetDDFName(FrameCompoNameDDF)
|
||||
Me.refJambCompo.CompoType.SetName(FrameCompoName)
|
||||
Dim FrameCompoDirectory As String
|
||||
FrameCompoDirectory = FrameCompoFileConfig.Remove(FrameCompoFileConfig.LastIndexOf("\"))
|
||||
Me.refJambCompo.CompoType.SetPath(FrameCompoDirectory)
|
||||
Me.refJambCompo.CompoType.SetJambSide(Side)
|
||||
End If
|
||||
End If
|
||||
If Not IsNothing(Me.refJambCompo) Then
|
||||
' Carico il nome
|
||||
FrameCompoFile = FrameCompoFile.Substring(FrameCompoFileConfig.LastIndexOf("\") + 1)
|
||||
|
||||
Me.refJambCompo.SetTemplateSelItemRefCompo(FrameCompoFile, Me)
|
||||
Map.refAssemblyPageVM.CurrAssembly.UpDateCurrCompoJamb(Me)
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
'----------------------------------------------------------------------------------------------------------------------------------------------
|
||||
End Sub
|
||||
|
||||
' setto la lista dei parametri da caricare la lista dei paramestri
|
||||
@@ -223,6 +296,144 @@ Public Class Compo
|
||||
End If
|
||||
End Sub
|
||||
|
||||
' a differenza delle funzioni sopra queste ricevono come parametro l'oggetto compo che deve essere modificato
|
||||
' il prossimo passo sarà eliminare le funzioni sopra scritte per lasciare solo queste
|
||||
#Region "SettemplateREFCOMPO"
|
||||
Friend Sub SetTemplateSelItemRefCompo(value As String, CurrRefCompo As Compo)
|
||||
Dim CurrConfig As String = CurrRefCompo.refJambCompo.CompoType.Path & "\" & CONFIGINI_FILE_NAME
|
||||
Dim CurrItemPath As String = CurrRefCompo.refJambCompo.CompoType.Path & "\" & value
|
||||
Dim ErrorList As String = String.Empty
|
||||
' se il file ha estensione nge
|
||||
If Path.HasExtension(CurrItemPath) AndAlso Path.GetExtension(CurrItemPath).ToLower = K_NGEEXTENSION Then
|
||||
' controllo che esiste il file altrimenti esco
|
||||
If Not File.Exists(CurrItemPath) Then Return
|
||||
CurrRefCompo.refJambCompo.TemplateSelItem = value
|
||||
' creo la stringa che contiene la lista degli errori
|
||||
Dim ParamIndex As Integer = 1
|
||||
Dim ConfigDefault As String = String.Empty
|
||||
Dim NewCompoParam As CompoParam = Nothing
|
||||
EgtUILib.GetPrivateProfileString(S_NGECONFIG, K_DEFAULT, "", ConfigDefault, CurrConfig)
|
||||
' ricerco la parola chiave Param nella stringa nel file Cinfig.ini
|
||||
ReadParamConfig(NewCompoParam, ErrorList, ParamIndex, ConfigDefault)
|
||||
Else
|
||||
' se il file non ha estensione allora creo l'estensione .lua
|
||||
CurrItemPath &= K_LUAEXTENSION
|
||||
' controllo che esiste il file altrimenti esco
|
||||
If Not File.Exists(CurrItemPath) Then Return
|
||||
CurrRefCompo.refJambCompo.TemplateSelItem = value
|
||||
' carico un vettore con le stringhe del file corrente
|
||||
Dim ReadCurrCompo() As String = File.ReadAllLines(CurrItemPath)
|
||||
Dim EndOfFile As Boolean = False
|
||||
' leggo il vettore di stringhe del file corrente
|
||||
For LineIndex = 0 To ReadCurrCompo.Count - 1
|
||||
' copio il valore della riga
|
||||
Dim CurrCompoFileLine As String = ReadCurrCompo(LineIndex)
|
||||
' cerco il titolo [Graphic parameters]: se lo trovo
|
||||
If RegexFunction.IsGraphicParametersTitle(CurrCompoFileLine) Then
|
||||
' mi preparo per leggere la prima riga dopo il titolo
|
||||
Dim ParamIndex As Integer = 1
|
||||
Dim NewCompoParam As CompoParam = Nothing
|
||||
Dim bIsFinished As Boolean = False
|
||||
' se la lettura del primo parametro "--Default=" restituisce un valore non nullo
|
||||
If Not String.IsNullOrWhiteSpace(ParamLine(ReadCurrCompo(LineIndex + ParamIndex), K_DEFAULT)) Then
|
||||
Dim ConfigDefault As String = Trim(ParamLine(ReadCurrCompo(LineIndex + ParamIndex), K_DEFAULT))
|
||||
If Not IsNumeric(ConfigDefault) Then
|
||||
' se il valore letto non è numerico allora esco dal cilo per la lettura dei parametri
|
||||
Exit For
|
||||
Else
|
||||
ReadParamConfig(NewCompoParam, ErrorList, ParamIndex, ConfigDefault)
|
||||
Exit For
|
||||
End If
|
||||
Else
|
||||
' se il primo parametro non è "Dafault" allora mi aspetto di leggere i parametri
|
||||
While Not bIsFinished
|
||||
' attualizzo il componente a nulla
|
||||
NewCompoParam = Nothing
|
||||
' cerco nella riga successiva al titolo il primo parametro
|
||||
If Not String.IsNullOrWhiteSpace(ReadCurrCompo(LineIndex + ParamIndex)) Then
|
||||
Dim ReadLine As String
|
||||
' carico i valori della stringa che seguono la chiave "--Param1="
|
||||
ReadLine = ParamLine(ReadCurrCompo(LineIndex + ParamIndex), K_PARAM & ParamIndex)
|
||||
|
||||
' se uno dei paraemtri è completamente sbagliato allora restituisce falso e non riempo la NewCompoParam che rimane Nothing
|
||||
bIsFinished = Not ReadParam(ReadLine, NewCompoParam, ErrorList)
|
||||
Else
|
||||
' altrimenti se la riga è vuota mi sposto alla successiva
|
||||
LineIndex += 1
|
||||
' e continuo il ciclo while
|
||||
Continue While
|
||||
End If
|
||||
' insrisco la nuova componenenet: se la riga è vuota o la componente non è stata creata allora il componete è Nothing
|
||||
InsertCompoParam(NewCompoParam, ParamIndex)
|
||||
' se il parametro è stato creato passa alla riga successiva
|
||||
If Not bIsFinished Then ParamIndex += 1
|
||||
End While
|
||||
NotifyPropertyChanged("TemplateSelItem")
|
||||
End If
|
||||
|
||||
' esiste già una lista
|
||||
For DeleteIndex = Me.refJambCompo.CompoParamList.Count - 1 To ParamIndex - 1 Step -1
|
||||
Me.refJambCompo.CompoParamList.RemoveAt(DeleteIndex)
|
||||
Next
|
||||
Exit For
|
||||
ElseIf LineIndex = ReadCurrCompo.Count - 1 Then
|
||||
' se non trovo il capitoletto nel file leggo i parametri di default del file Config.ini
|
||||
|
||||
Dim ParamIndex As Integer = 1
|
||||
Dim NewCompoParam As CompoParam = Nothing
|
||||
ReadParamConfigRefCompo(NewCompoParam, ErrorList, ParamIndex, "", CurrRefCompo)
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
End If
|
||||
End Sub
|
||||
|
||||
' setto la lista dei parametri da caricare la lista dei paramestri
|
||||
Private Sub ReadParamConfigRefCompo(ByRef NewCompoParam As CompoParam, ByRef ErrorList As String, ParamIndex As Integer, DefaultConfig As String, CurrRefCompo As Compo)
|
||||
Dim sParam As String = String.Empty
|
||||
Dim CurrConfig As String = CurrRefCompo.CompoType.Path & "\" & CONFIGINI_FILE_NAME
|
||||
Dim S_CHAPTER As String
|
||||
|
||||
If String.IsNullOrWhiteSpace(DefaultConfig) Then
|
||||
S_CHAPTER = S_GR_PARAM_DEFAULT & "1"
|
||||
Else
|
||||
S_CHAPTER = S_GR_PARAM_DEFAULT & DefaultConfig
|
||||
End If
|
||||
|
||||
While EgtUILib.GetPrivateProfileString(S_CHAPTER, K_PARAM & ParamIndex, "", sParam, CurrConfig) > 0
|
||||
If Not String.IsNullOrWhiteSpace(sParam) Then
|
||||
' leggo il tipo di parametro
|
||||
ReadParam(sParam, NewCompoParam, ErrorList)
|
||||
' carico il parametro nella lista della componente
|
||||
InsertCompoParamRef(NewCompoParam, ParamIndex, CurrRefCompo)
|
||||
End If
|
||||
ParamIndex += 1
|
||||
End While
|
||||
' controllo di aver tolto tutti i parametri che potrrebbero esistere da una precedente chiamata
|
||||
For DeleteIndex = CurrRefCompo.CompoParamList.Count - 1 To ParamIndex - 1 Step -1
|
||||
CurrRefCompo.CompoParamList.RemoveAt(DeleteIndex)
|
||||
Next
|
||||
End Sub
|
||||
|
||||
' inserisco il parametro letto nella lista dei paramtri senza modificare i parametri già esistenti
|
||||
Private Sub InsertCompoParamRef(NewCompoParam As CompoParam, ParamIndex As Integer, CurrRefCompo As Compo)
|
||||
If Not IsNothing(NewCompoParam) Then
|
||||
' se non esiste l'indice
|
||||
If Not CurrRefCompo.CompoParamList.Count > ParamIndex - 1 Then
|
||||
' creo il parametro combo
|
||||
CurrRefCompo.CompoParamList.Insert(ParamIndex - 1, NewCompoParam)
|
||||
Else
|
||||
' se esiste ma è diverso il nome DDF
|
||||
If Not m_CompoParamList(ParamIndex - 1).DDFName = NewCompoParam.DDFName Then
|
||||
' creo il nuovo parametro combo
|
||||
CurrRefCompo.CompoParamList.RemoveAt(ParamIndex - 1)
|
||||
CurrRefCompo.CompoParamList.Insert(ParamIndex - 1, NewCompoParam)
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
End Sub
|
||||
#End Region ' SetTemplateREFCOMPO
|
||||
|
||||
' leggo il nome DDF e il nome, restituisco il nome solo se esiste un messaggio associato
|
||||
Private Function MsgControl(sDDFName As String, sName As String, ByRef sErrorList As String) As String
|
||||
' se è numerico ma non esiste un messaggio associato
|
||||
@@ -269,9 +480,9 @@ Public Class Compo
|
||||
Next
|
||||
' se il nome DDF non è separato dal diviso vuol dire che non c'è nessun messaggio associato, quindi scrivo due volte il messaggio DDF
|
||||
If sItems(1).Split("/"c).Count = 1 Then
|
||||
NewCompoParam = New ComboBoxParam(Trim(sItems(1)), MsgControl(Trim(sItems(1)), "-1", sErrorList), ComboItemList, DDFComboItemList, ComboItemList(0))
|
||||
NewCompoParam = New ComboBoxParam(Trim(sItems(1)), MsgControl(Trim(sItems(1)), "-1", sErrorList), Me, ComboItemList, DDFComboItemList, ComboItemList(0))
|
||||
Else
|
||||
NewCompoParam = New ComboBoxParam(Trim(sItems(1).Split("/"c)(0)), Trim(MsgControl(sItems(1).Split("/"c)(0), sItems(1).Split("/"c)(1), sErrorList)), ComboItemList, DDFComboItemList, ComboItemList(0))
|
||||
NewCompoParam = New ComboBoxParam(Trim(sItems(1).Split("/"c)(0)), Trim(MsgControl(sItems(1).Split("/"c)(0), sItems(1).Split("/"c)(1), sErrorList)), Me, ComboItemList, DDFComboItemList, ComboItemList(0))
|
||||
End If
|
||||
Return True
|
||||
Else
|
||||
@@ -282,9 +493,9 @@ Public Class Compo
|
||||
|
||||
Case "TextBox"
|
||||
'ConvertTextBoxString(sItems)
|
||||
Dim dHeight As Double
|
||||
Dim dHeight As Double = 500
|
||||
' leggo il valore altezza che già esite nella porta
|
||||
StringToDouble(m_rfCurrDoor.Height, dHeight)
|
||||
'------------------------------StringToDouble(m_rfCurrDoor.Height, dHeight)
|
||||
Dim dDefaultValue As Double
|
||||
' verifico che sono presenti "TextBox; NomeDDF/Nome"
|
||||
If sItems.Count > 2 Then
|
||||
@@ -297,58 +508,22 @@ Public Class Compo
|
||||
If dDefaultValue < dHeight Then
|
||||
' verifico che sono presenti "TextBox; NomeDDF/Nome; Valore; NomeLista; NomeElementoLista"
|
||||
If sItems.Count > 4 Then
|
||||
'' ' creo la lista associata alla TextBox se esiste almeno un elemento
|
||||
'' Dim DDFComboValuelList As New List(Of String)
|
||||
'' ' carico gli elementi della lista in un vettore
|
||||
'' Dim sComboItemList() As String = sItems(5).Split(","c)
|
||||
'' ' carico la lista dal vettore
|
||||
'' For ItemIndex = 0 To sComboItemList.Count - 1
|
||||
'' DDFComboValuelList.Add(Trim(sComboItemList(ItemIndex)))
|
||||
'' Next
|
||||
'' ' cerco nella lista dei paraletri già esistenti il nome della lista a cui fa riferimento
|
||||
'' For ParamIndex = 0 To m_CompoParamList.Count - 1
|
||||
'' Dim CurrCompoParam As CompoParam = m_CompoParamList(ParamIndex)
|
||||
'' ' verifico che il nome della lista associata esista
|
||||
'' If CurrCompoParam.DDFName = sItems(4) Then
|
||||
'' ' verifico che il nome del paramertro è di una combobox
|
||||
'' If TypeOf CurrCompoParam Is ComboBoxParam Then
|
||||
'' ' creo la componente nuova
|
||||
'' NewCompoParam = New TextBoxParam(sItems(1), MsgControl(sItems(1), Utility.ReadMsg(sItems(2)), sErrorList), sDefaultValue, DirectCast(CurrCompoParam, ComboBoxParam), DDFComboValuelList)
|
||||
'' Return True
|
||||
'' Else
|
||||
'' ' se esiste il nome della lista associata ma non è una combobox creo il componente senza la lista
|
||||
'' NewCompoParam = New TextBoxParam(sItems(1), MsgControl(sItems(1), sItems(2), sErrorList), sDefaultValue, Nothing, Nothing)
|
||||
'' sErrorList &= String.Format(EgtMsg(50122), sItems(4), m_CompoType.DDFName)
|
||||
'' Return True
|
||||
'' End If
|
||||
'' Exit For
|
||||
'' End If
|
||||
'' Next
|
||||
'' ' se non trovo nella lista dei parametri il nome della lista creo il componente senza la lista
|
||||
'' NewCompoParam = New TextBoxParam(sItems(1), MsgControl(sItems(1), sItems(2), sErrorList), sDefaultValue, Nothing, Nothing)
|
||||
'' sErrorList &= String.Format(EgtMsg(50121), sItems(4), m_CompoType.DDFName)
|
||||
'' Return True
|
||||
''ElseIf sItems.Count = 4 Then
|
||||
'' 'se non esiste una lista ma solo il nome della lista
|
||||
'' NewCompoParam = New TextBoxParam(sItems(1), MsgControl(sItems(1), sItems(2), sErrorList), sDefaultValue, Nothing, Nothing)
|
||||
'' sErrorList &= String.Format(EgtMsg(50123), sItems(4), m_CompoType.DDFName)
|
||||
'' Return True
|
||||
ElseIf sItems.Count = 3 Then
|
||||
' se la text contiente solo 4 parametri
|
||||
If sItems(1).Split("/"c).Count = 1 Then
|
||||
NewCompoParam = New TextBoxParam(Trim(sItems(1)), MsgControl(Trim(sItems(1)), "-1", sErrorList), sDefaultValue, Nothing, Nothing)
|
||||
NewCompoParam = New TextBoxParam(Trim(sItems(1)), MsgControl(Trim(sItems(1)), "-1", sErrorList), Me, sDefaultValue, Nothing, Nothing)
|
||||
Else
|
||||
NewCompoParam = New TextBoxParam(Trim(sItems(1).Split("/"c)(0)), Trim(MsgControl(sItems(1).Split("/"c)(0), sItems(1).Split("/"c)(1), sErrorList)), sDefaultValue, Nothing, Nothing)
|
||||
NewCompoParam = New TextBoxParam(Trim(sItems(1).Split("/"c)(0)), Trim(MsgControl(sItems(1).Split("/"c)(0), sItems(1).Split("/"c)(1), sErrorList)), Me, sDefaultValue, Nothing, Nothing)
|
||||
End If
|
||||
Return True
|
||||
End If
|
||||
Else
|
||||
' se la misura passata è più grande di quella della porta non carico il valore e creo il parametro senza lista
|
||||
If sItems(1).Split("/"c).Count = 1 Then
|
||||
NewCompoParam = New TextBoxParam(Trim(sItems(1)), MsgControl(Trim(sItems(1)), "-1", sErrorList), "0.000", Nothing, Nothing)
|
||||
NewCompoParam = New TextBoxParam(Trim(sItems(1)), MsgControl(Trim(sItems(1)), "-1", sErrorList), Me, "0.000", Nothing, Nothing)
|
||||
sErrorList &= String.Format(EgtMsg(50124), MsgControl(sItems(1), "-1", sErrorList), m_CompoType.DDFName, sDefaultValue)
|
||||
Else
|
||||
NewCompoParam = New TextBoxParam(Trim(sItems(1).Split("/"c)(0)), Trim(MsgControl(sItems(1).Split("/"c)(0), sItems(1).Split("/"c)(1), sErrorList)), "0.000", Nothing, Nothing)
|
||||
NewCompoParam = New TextBoxParam(Trim(sItems(1).Split("/"c)(0)), Trim(MsgControl(sItems(1).Split("/"c)(0), sItems(1).Split("/"c)(1), sErrorList)), Me, "0.000", Nothing, Nothing)
|
||||
sErrorList &= String.Format(EgtMsg(50124), MsgControl(sItems(1).Split("/"c)(0), sItems(1).Split("/"c)(1), sErrorList), m_CompoType.DDFName, sDefaultValue)
|
||||
End If
|
||||
|
||||
@@ -357,9 +532,9 @@ Public Class Compo
|
||||
End If
|
||||
Else
|
||||
If sItems(1).Split("/"c).Count = 1 Then
|
||||
NewCompoParam = New TextBoxParam(Trim(sItems(1)), MsgControl(Trim(sItems(1)), "-1", sErrorList), "0.000", Nothing, Nothing)
|
||||
NewCompoParam = New TextBoxParam(Trim(sItems(1)), MsgControl(Trim(sItems(1)), "-1", sErrorList), Me, "0.000", Nothing, Nothing)
|
||||
Else
|
||||
NewCompoParam = New TextBoxParam(Trim(sItems(1).Split("/"c)(0)), Trim(MsgControl(sItems(1).Split("/"c)(0), sItems(1).Split("/"c)(1), sErrorList)), "0.000", Nothing, Nothing)
|
||||
NewCompoParam = New TextBoxParam(Trim(sItems(1).Split("/"c)(0)), Trim(MsgControl(sItems(1).Split("/"c)(0), sItems(1).Split("/"c)(1), sErrorList)), Me, "0.000", Nothing, Nothing)
|
||||
|
||||
End If
|
||||
Dim ErrorExpression As String = String.Format(EgtMsg(50147), NewCompoParam.Name, sItems(2))
|
||||
@@ -370,10 +545,10 @@ Public Class Compo
|
||||
ElseIf sItems.Count = 2 Then
|
||||
' se la stringa ha 2 elemtni "TextBox; NomeDDF/Nome"
|
||||
If sItems(1).Split("/"c).Count = 1 Then
|
||||
NewCompoParam = New TextBoxParam(Trim(sItems(1)), MsgControl(Trim(sItems(1)), "-1", sErrorList), "0.000", Nothing, Nothing)
|
||||
NewCompoParam = New TextBoxParam(Trim(sItems(1)), MsgControl(Trim(sItems(1)), "-1", sErrorList), Me, "0.000", Nothing, Nothing)
|
||||
sErrorList &= String.Format(EgtMsg(50125), MsgControl(sItems(1), "-1", sErrorList), m_CompoType.DDFName)
|
||||
Else
|
||||
NewCompoParam = New TextBoxParam(Trim(sItems(1).Split("/"c)(0)), Trim(MsgControl(sItems(1).Split("/"c)(0), sItems(1).Split("/"c)(1), sErrorList)), "0.000", Nothing, Nothing)
|
||||
NewCompoParam = New TextBoxParam(Trim(sItems(1).Split("/"c)(0)), Trim(MsgControl(sItems(1).Split("/"c)(0), sItems(1).Split("/"c)(1), sErrorList)), Me, "0.000", Nothing, Nothing)
|
||||
sErrorList &= String.Format(EgtMsg(50125), MsgControl(sItems(1).Split("/"c)(0), sItems(1).Split("/"c)(1), sErrorList), m_CompoType.DDFName)
|
||||
End If
|
||||
Return True
|
||||
@@ -386,9 +561,9 @@ Public Class Compo
|
||||
End If
|
||||
|
||||
Case "TextBoxOnOff"
|
||||
Dim dHeight As Double
|
||||
Dim dHeight As Double = 500
|
||||
' leggo il valore altezza che già esite nella porta
|
||||
StringToDouble(m_rfCurrDoor.Height, dHeight)
|
||||
'------------------------------------------------StringToDouble(m_rfCurrDoor.Height, dHeight)
|
||||
Dim dDefaultValue As Double
|
||||
' verifico che sono presenti "TextBox; NomeDDF/Nome"
|
||||
If sItems.Count > 2 Then
|
||||
@@ -401,58 +576,22 @@ Public Class Compo
|
||||
If dDefaultValue < dHeight Then
|
||||
' verifico che sono presenti "TextBox; NomeDDF/Nome; Valore; NomeLista; NomeElementoLista"
|
||||
If sItems.Count > 4 Then
|
||||
'' ' creo la lista associata alla TextBox se esiste almeno un elemento
|
||||
'' Dim DDFComboValuelList As New List(Of String)
|
||||
'' ' carico gli elementi della lista in un vettore
|
||||
'' Dim sComboItemList() As String = sItems(5).Split(","c)
|
||||
'' ' carico la lista dal vettore
|
||||
'' For ItemIndex = 0 To sComboItemList.Count - 1
|
||||
'' DDFComboValuelList.Add(Trim(sComboItemList(ItemIndex)))
|
||||
'' Next
|
||||
'' ' cerco nella lista dei paraletri già esistenti il nome della lista a cui fa riferimento
|
||||
'' For ParamIndex = 0 To m_CompoParamList.Count - 1
|
||||
'' Dim CurrCompoParam As CompoParam = m_CompoParamList(ParamIndex)
|
||||
'' ' verifico che il nome della lista associata esista
|
||||
'' If CurrCompoParam.DDFName = sItems(4) Then
|
||||
'' ' verifico che il nome del paramertro è di una combobox
|
||||
'' If TypeOf CurrCompoParam Is ComboBoxParam Then
|
||||
'' ' creo la componente nuova
|
||||
'' NewCompoParam = New TextBoxOnOffParam(sItems(1), MsgControl(sItems(1), Utility.ReadMsg(sItems(2)), sErrorList), sDefaultValue, DirectCast(CurrCompoParam, ComboBoxParam), DDFComboValuelList)
|
||||
'' Return True
|
||||
'' Else
|
||||
'' ' se esiste il nome della lista associata ma non è una combobox creo il componente senza la lista
|
||||
'' NewCompoParam = New TextBoxOnOffParam(sItems(1), MsgControl(sItems(1), sItems(2), sErrorList), sDefaultValue, Nothing, Nothing)
|
||||
'' sErrorList &= String.Format(EgtMsg(50122), sItems(4), m_CompoType.DDFName)
|
||||
'' Return True
|
||||
'' End If
|
||||
'' Exit For
|
||||
'' End If
|
||||
'' Next
|
||||
'' ' se non trovo nella lista dei parametri il nome della lista creo il componente senza la lista
|
||||
'' NewCompoParam = New TextBoxOnOffParam(sItems(1), MsgControl(sItems(1), sItems(2), sErrorList), sDefaultValue, Nothing, Nothing)
|
||||
'' sErrorList &= String.Format(EgtMsg(50121), sItems(4), m_CompoType.DDFName)
|
||||
'' Return True
|
||||
''ElseIf sItems.Count = 4 Then
|
||||
'' 'se non esiste una lista ma solo il nome della lista
|
||||
'' NewCompoParam = New TextBoxOnOffParam(sItems(1), MsgControl(sItems(1), sItems(2), sErrorList), sDefaultValue, Nothing, Nothing)
|
||||
'' sErrorList &= String.Format(EgtMsg(50123), sItems(4), m_CompoType.DDFName)
|
||||
'' Return True
|
||||
ElseIf sItems.Count = 3 Then
|
||||
' se la text contiente solo 4 parametri
|
||||
If sItems(1).Split("/"c).Count = 1 Then
|
||||
NewCompoParam = New TextBoxOnOffParam(Trim(sItems(1)), MsgControl(Trim(sItems(1)), "-1", sErrorList), sDefaultValue, Nothing, Nothing)
|
||||
NewCompoParam = New TextBoxOnOffParam(Trim(sItems(1)), MsgControl(Trim(sItems(1)), "-1", sErrorList), Me, sDefaultValue, Nothing, Nothing)
|
||||
Else
|
||||
NewCompoParam = New TextBoxOnOffParam(Trim(sItems(1).Split("/"c)(0)), Trim(MsgControl(sItems(1).Split("/"c)(0), sItems(1).Split("/"c)(1), sErrorList)), sDefaultValue, Nothing, Nothing)
|
||||
NewCompoParam = New TextBoxOnOffParam(Trim(sItems(1).Split("/"c)(0)), Trim(MsgControl(sItems(1).Split("/"c)(0), sItems(1).Split("/"c)(1), sErrorList)), Me, sDefaultValue, Nothing, Nothing)
|
||||
End If
|
||||
Return True
|
||||
End If
|
||||
Else
|
||||
' se la misura passata è più grande di quella della porta non carico il valore e creo il parametro senza lista
|
||||
If sItems(1).Split("/"c).Count = 1 Then
|
||||
NewCompoParam = New TextBoxOnOffParam(Trim(sItems(1)), MsgControl(Trim(sItems(1)), "-1", sErrorList), "0.000", Nothing, Nothing)
|
||||
NewCompoParam = New TextBoxOnOffParam(Trim(sItems(1)), MsgControl(Trim(sItems(1)), "-1", sErrorList), Me, "0.000", Nothing, Nothing)
|
||||
sErrorList &= String.Format(EgtMsg(50124), MsgControl(sItems(1), "-1", sErrorList), m_CompoType.DDFName, sDefaultValue)
|
||||
Else
|
||||
NewCompoParam = New TextBoxOnOffParam(Trim(sItems(1).Split("/"c)(0)), Trim(MsgControl(sItems(1).Split("/"c)(0), sItems(1).Split("/"c)(1), sErrorList)), "0.000", Nothing, Nothing)
|
||||
NewCompoParam = New TextBoxOnOffParam(Trim(sItems(1).Split("/"c)(0)), Trim(MsgControl(sItems(1).Split("/"c)(0), sItems(1).Split("/"c)(1), sErrorList)), Me, "0.000", Nothing, Nothing)
|
||||
sErrorList &= String.Format(EgtMsg(50124), MsgControl(sItems(1).Split("/"c)(0), sItems(1).Split("/"c)(1), sErrorList), m_CompoType.DDFName, sDefaultValue)
|
||||
End If
|
||||
' ma faccio andare avanti nella lettura dei parametri
|
||||
@@ -460,9 +599,9 @@ Public Class Compo
|
||||
End If
|
||||
Else
|
||||
If sItems(1).Split("/"c).Count = 1 Then
|
||||
NewCompoParam = New TextBoxOnOffParam(Trim(sItems(1)), MsgControl(Trim(sItems(1)), "-1", sErrorList), "0.000", Nothing, Nothing)
|
||||
NewCompoParam = New TextBoxOnOffParam(Trim(sItems(1)), MsgControl(Trim(sItems(1)), "-1", sErrorList), Me, "0.000", Nothing, Nothing)
|
||||
Else
|
||||
NewCompoParam = New TextBoxOnOffParam(Trim(sItems(1).Split("/"c)(0)), Trim(MsgControl(sItems(1).Split("/"c)(0), sItems(1).Split("/"c)(1), sErrorList)), "0.000", Nothing, Nothing)
|
||||
NewCompoParam = New TextBoxOnOffParam(Trim(sItems(1).Split("/"c)(0)), Trim(MsgControl(sItems(1).Split("/"c)(0), sItems(1).Split("/"c)(1), sErrorList)), Me, "0.000", Nothing, Nothing)
|
||||
|
||||
End If
|
||||
Dim ErrorExpression As String = String.Format(EgtMsg(50147), NewCompoParam.Name, sItems(2))
|
||||
@@ -473,10 +612,10 @@ Public Class Compo
|
||||
ElseIf sItems.Count = 2 Then
|
||||
' se la stringa ha 2 elemtni "TextBox; NomeDDF/Nome"
|
||||
If sItems(1).Split("/"c).Count = 1 Then
|
||||
NewCompoParam = New TextBoxOnOffParam(Trim(sItems(1)), MsgControl(Trim(sItems(1)), "-1", sErrorList), "0.000", Nothing, Nothing)
|
||||
NewCompoParam = New TextBoxOnOffParam(Trim(sItems(1)), MsgControl(Trim(sItems(1)), "-1", sErrorList), Me, "0.000", Nothing, Nothing)
|
||||
sErrorList &= String.Format(EgtMsg(50125), MsgControl(sItems(1), "-1", sErrorList), m_CompoType.DDFName)
|
||||
Else
|
||||
NewCompoParam = New TextBoxOnOffParam(Trim(sItems(1).Split("/"c)(0)), Trim(MsgControl(sItems(1).Split("/"c)(0), sItems(1).Split("/"c)(1), sErrorList)), "0.000", Nothing, Nothing)
|
||||
NewCompoParam = New TextBoxOnOffParam(Trim(sItems(1).Split("/"c)(0)), Trim(MsgControl(sItems(1).Split("/"c)(0), sItems(1).Split("/"c)(1), sErrorList)), Me, "0.000", Nothing, Nothing)
|
||||
sErrorList &= String.Format(EgtMsg(50125), MsgControl(sItems(1).Split("/"c)(0), sItems(1).Split("/"c)(1), sErrorList), m_CompoType.DDFName)
|
||||
End If
|
||||
Return True
|
||||
@@ -587,7 +726,7 @@ Public Class Compo
|
||||
' Definizione comando
|
||||
Private m_CmdDelete As ICommand
|
||||
|
||||
Sub New(CompoType As CompoType, MyDoor As Door)
|
||||
Sub New(CompoType As CompoType, MyDoor As Part)
|
||||
m_CompoType = CompoType
|
||||
m_rfCurrDoor = MyDoor
|
||||
End Sub
|
||||
@@ -603,7 +742,7 @@ Public Class Compo
|
||||
Get
|
||||
If m_CmdDelete Is Nothing Then
|
||||
m_CmdDelete = New Command(AddressOf Delete)
|
||||
End If
|
||||
End If
|
||||
Return m_CmdDelete
|
||||
End Get
|
||||
End Property
|
||||
@@ -612,7 +751,8 @@ Public Class Compo
|
||||
''' Execute the Exec. This method is invoked by the ExecCommand.
|
||||
''' </summary>
|
||||
Public Sub Delete()
|
||||
m_rfCurrDoor.RemoveCompo(Me)
|
||||
Map.refPartPageVM.CurrPart.RemoveCompo(Me)
|
||||
Map.refAssemblyManagerVM.SelectedAssembly.IsModify = True
|
||||
End Sub
|
||||
|
||||
#End Region ' DeleteCommand
|
||||
@@ -628,7 +768,6 @@ Public Class Compo
|
||||
End Class
|
||||
|
||||
Public Class CompoParam
|
||||
|
||||
Friend Shared m_rfSetTitle As Action
|
||||
|
||||
Friend m_IsModifyCompoParam As Boolean = False
|
||||
@@ -653,9 +792,20 @@ Public Class CompoParam
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Sub New(sDDFName As String, sName As String)
|
||||
Private m_CurrCompo As Compo
|
||||
Public Property CurrCompo As Compo
|
||||
Get
|
||||
Return m_CurrCompo
|
||||
End Get
|
||||
Set(value As Compo)
|
||||
m_CurrCompo = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Sub New(sDDFName As String, sName As String, CurrCompo As Compo)
|
||||
m_DDFName = sDDFName
|
||||
m_Name = sName
|
||||
m_CurrCompo = CurrCompo
|
||||
End Sub
|
||||
End Class
|
||||
|
||||
@@ -663,6 +813,16 @@ Public Class TextBoxParam
|
||||
Inherits CompoParam
|
||||
Implements INotifyPropertyChanged
|
||||
|
||||
Private m_IsReadOnly As Boolean = True
|
||||
Public Property IsReadOnly As Boolean
|
||||
Get
|
||||
Return m_IsReadOnly
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
m_IsReadOnly = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Dim dValue As Double = -1
|
||||
Friend m_Value As String
|
||||
Public Property Value As String
|
||||
@@ -673,9 +833,28 @@ Public Class TextBoxParam
|
||||
m_Value = value
|
||||
NotifyPropertyChanged("ToolTipValue")
|
||||
m_IsModifyCompoParam = True
|
||||
m_rfSetTitle()
|
||||
If Not IsNothing(CurrCompo.refJambCompo) Then
|
||||
Map.refAssemblyPageVM.CurrAssembly.LoadModuleParam(CurrCompo)
|
||||
If Not File.Exists(CurrCompo.CompoType.Path & "\" & "Matching.lua") Then
|
||||
EgtOutLog("SetUp error: SetUp configuration file (" & CurrCompo.CompoType.Path & "\" & "Matching.lua)" & " doesn't exist ")
|
||||
MessageBox.Show("Script Lua (" & CurrCompo.CompoType.Path & "\" & "Matching.lua" & ")has not been found", "Error", MessageBoxButton.OK, MessageBoxImage.Error)
|
||||
Return
|
||||
Else
|
||||
EgtLuaSetGlobIntVar("STU.DoorNumber", CInt(Map.refAssemblyPageVM.CurrAssembly.DoorNumber))
|
||||
EgtLuaSetGlobStringVar("STU.CompoPath", CurrCompo.CompoType.Path)
|
||||
EgtLuaSetGlobStringVar("STU.Template", CurrCompo.TemplateSelItem)
|
||||
EgtLuaCallFunction("STU.Matching")
|
||||
UpdateParam()
|
||||
EgtLuaResetGlobVar("STU")
|
||||
End If
|
||||
End If
|
||||
Map.refAssemblyManagerVM.SelectedAssembly.IsModify = True
|
||||
End Set
|
||||
End Property
|
||||
Public Sub SetValue(sValue As String)
|
||||
m_Value = sValue
|
||||
NotifyPropertyChanged("ToolTipValue")
|
||||
End Sub
|
||||
|
||||
Public ReadOnly Property ToolTipValue As String
|
||||
Get
|
||||
@@ -688,8 +867,6 @@ Public Class TextBoxParam
|
||||
End Get
|
||||
End Property
|
||||
|
||||
|
||||
|
||||
Private m_ComboValuelList As New List(Of String)
|
||||
Public Property ComboValuelList As List(Of String)
|
||||
Get
|
||||
@@ -712,8 +889,37 @@ Public Class TextBoxParam
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Sub New(sDDFName As String, sName As String, sValue As String, ComboBox As ComboBoxParam, ComboValuelList As List(Of String))
|
||||
MyBase.New(sDDFName, sName)
|
||||
Public Sub UpdateParam()
|
||||
For IndexParam As Integer = 0 To CurrCompo.refJambCompo.CompoParamList.Count - 1
|
||||
If TypeOf CurrCompo.refJambCompo.CompoParamList(IndexParam) Is TextBoxParam AndAlso CurrCompo.CompoParamList(IndexParam).DDFName = CurrCompo.refJambCompo.CompoParamList(IndexParam).DDFName Then
|
||||
Dim x = EgtLuaSetGlobStringVar("STU.InParamName", DirectCast(CurrCompo.CompoParamList(IndexParam), TextBoxParam).DDFName)
|
||||
Dim dInParamValue As Double
|
||||
StringToDouble(DirectCast(CurrCompo.CompoParamList(IndexParam), TextBoxParam).m_Value, dInParamValue)
|
||||
EgtLuaSetGlobNumVar("STU.InParamValue", dInParamValue)
|
||||
EgtLuaCallFunction("STU.CalcParam")
|
||||
Dim sVal As String = String.Empty
|
||||
EgtLuaGetGlobStringVar("STU.OutParamValue", sVal)
|
||||
DirectCast(CurrCompo.refJambCompo.CompoParamList(IndexParam), TextBoxParam).SetValue(CStr(sVal))
|
||||
EgtLuaGetGlobBoolVar("STU.IsEnable", DirectCast(CurrCompo.refJambCompo.CompoParamList(IndexParam), TextBoxParam).IsReadOnly)
|
||||
Return
|
||||
ElseIf TypeOf CurrCompo.refJambCompo.CompoParamList(IndexParam) Is ComboBoxParam AndAlso CurrCompo.CompoParamList(IndexParam).DDFName = CurrCompo.refJambCompo.CompoParamList(IndexParam).DDFName Then
|
||||
DirectCast(CurrCompo.refJambCompo.CompoParamList(IndexParam), ComboBoxParam).IsReadOnly = False
|
||||
Return
|
||||
ElseIf TypeOf CurrCompo.refJambCompo.CompoParamList(IndexParam) Is TextBoxOnOffParam AndAlso CurrCompo.CompoParamList(IndexParam).DDFName = CurrCompo.refJambCompo.CompoParamList(IndexParam).DDFName Then
|
||||
EgtLuaSetGlobStringVar("STU.InParamName", DirectCast(CurrCompo.CompoParamList(IndexParam), TextBoxOnOffParam).DDFName)
|
||||
EgtLuaCallFunction("STU.CalcParam")
|
||||
Dim sVal As String = String.Empty
|
||||
EgtLuaSetGlobStringVar("STU.InParamValue", DirectCast(CurrCompo.CompoParamList(IndexParam), TextBoxOnOffParam).m_Value)
|
||||
EgtLuaGetGlobStringVar("STU.OutParamValue", sVal)
|
||||
DirectCast(CurrCompo.refJambCompo.CompoParamList(IndexParam), TextBoxOnOffParam).SetValue(CStr(sVal))
|
||||
EgtLuaGetGlobBoolVar("STU.IsEnable", DirectCast(CurrCompo.refJambCompo.CompoParamList(IndexParam), TextBoxOnOffParam).IsReadOnly)
|
||||
Return
|
||||
End If
|
||||
Next
|
||||
End Sub
|
||||
|
||||
Sub New(sDDFName As String, sName As String, CurrCompo As Compo, sValue As String, ComboBox As ComboBoxParam, ComboValuelList As List(Of String))
|
||||
MyBase.New(sDDFName, sName, CurrCompo)
|
||||
m_Value = sValue
|
||||
m_ComboBox = ComboBox
|
||||
m_ComboValuelList = ComboValuelList
|
||||
@@ -729,6 +935,16 @@ End Class
|
||||
Public Class ComboBoxParam
|
||||
Inherits CompoParam
|
||||
|
||||
Private m_IsReadOnly As Boolean = True
|
||||
Public Property IsReadOnly As Boolean
|
||||
Get
|
||||
Return m_IsReadOnly
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
m_IsReadOnly = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_ItemList As New List(Of String)
|
||||
Public Property ItemList As List(Of String)
|
||||
Get
|
||||
@@ -757,7 +973,7 @@ Public Class ComboBoxParam
|
||||
Set(value As String)
|
||||
m_SelItem = value
|
||||
m_IsModifyCompoParam = True
|
||||
m_rfSetTitle()
|
||||
Map.refAssemblyManagerVM.SelectedAssembly.IsModify = True
|
||||
End Set
|
||||
End Property
|
||||
|
||||
@@ -765,12 +981,11 @@ Public Class ComboBoxParam
|
||||
m_SelItem = value
|
||||
End Sub
|
||||
|
||||
Sub New(sDDFName As String, sName As String, ItemList As List(Of String), ItemListDDF As List(Of String), sSelItem As String)
|
||||
MyBase.New(sDDFName, sName)
|
||||
Sub New(sDDFName As String, sName As String, CurrCompo As Compo, ItemList As List(Of String), ItemListDDF As List(Of String), sSelItem As String)
|
||||
MyBase.New(sDDFName, sName, CurrCompo)
|
||||
m_ItemList = ItemList
|
||||
m_ItemListDDF = ItemListDDF
|
||||
m_SelItem = sSelItem
|
||||
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
@@ -785,10 +1000,11 @@ Public Class TextBoxOnOffParam
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
m_IsActive = value
|
||||
Map.refAssemblyManagerVM.SelectedAssembly.IsModify = True
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Sub New(sDDFName As String, sName As String, sValue As String, ComboBox As ComboBoxParam, ComboValuelList As List(Of String))
|
||||
MyBase.New(sDDFName, sName, sValue, ComboBox, ComboValuelList)
|
||||
Sub New(sDDFName As String, sName As String, CurrCompo As Compo, sValue As String, ComboBox As ComboBoxParam, ComboValuelList As List(Of String))
|
||||
MyBase.New(sDDFName, sName, CurrCompo, sValue, ComboBox, ComboValuelList)
|
||||
End Sub
|
||||
End Class
|
||||
@@ -1,6 +0,0 @@
|
||||
Public Class DoorParametersView
|
||||
|
||||
Private Sub ComboBox_DataContextChanged(sender As Object, e As DependencyPropertyChangedEventArgs)
|
||||
|
||||
End Sub
|
||||
End Class
|
||||
@@ -1,15 +1,25 @@
|
||||
<UserControl x:Class="DoorParametersView"
|
||||
<UserControl x:Class="PartPageV"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:local="clr-namespace:EgtDOORCreator">
|
||||
xmlns:local="clr-namespace:EgtDOORCreator"
|
||||
xmlns:EgtDOORCreator="clr-namespace:EgtDOORCreator">
|
||||
|
||||
<UserControl.Resources>
|
||||
<local:SplitConverter x:Key="SplitConverter"/>
|
||||
<local:DoorVisibilityConverter x:Key="DoorVisibilityConverter"/>
|
||||
<EgtDOORCreator:TrueToFalse x:Key="TrueToFalse"/>
|
||||
</UserControl.Resources>
|
||||
|
||||
<Grid Margin="0,0,0,2">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="5*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="1*"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<Grid Margin="0,0,0,2" Grid.Column="1" IsEnabled="{Binding IsReadOnly}">
|
||||
<Grid.InputBindings>
|
||||
<KeyBinding Key="Enter" Command="{Binding DataContext.RefreshCmd,RelativeSource={RelativeSource AncestorType={x:Type UserControl}}}"/>
|
||||
<KeyBinding Key="F1" Command="{Binding DataContext.GuideCmd,RelativeSource={RelativeSource AncestorType={x:Type UserControl}}}"/>
|
||||
@@ -20,10 +30,10 @@
|
||||
<RowDefinition Height="1*"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<GroupBox Header="{Binding GeneralMsg}" Margin="0,0,0,0"
|
||||
<GroupBox Header="{Binding GeneralMsg}" Margin="0,0,0,0"
|
||||
Visibility="{Binding CurrProject.DoorList,
|
||||
Converter={StaticResource DoorVisibilityConverter}}">
|
||||
<Grid>
|
||||
Converter={StaticResource DoorVisibilityConverter}}">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
@@ -52,41 +62,48 @@
|
||||
Style="{StaticResource DoorParamsTxBl}"
|
||||
Margin="2,2,0,2"
|
||||
Grid.Row="0"/>
|
||||
<TextBox Grid.Column="1" Grid.Row="0" Style="{StaticResource DoorParamsTxBx}"
|
||||
Text="{Binding CurrDoor.Width, UpdateSourceTrigger=PropertyChanged}"
|
||||
Margin="0.4,2,39.6,3.2" VerticalAlignment="Stretch" Height="Auto" />
|
||||
<TextBox Grid.Column="1" Grid.Row="0"
|
||||
Style="{StaticResource DoorParamsTxBx}"
|
||||
Text="{Binding CurrPart.Width, UpdateSourceTrigger=PropertyChanged}"
|
||||
Margin="0.4,2,39.6,3.2"
|
||||
VerticalAlignment="Stretch"
|
||||
Height="Auto" IsReadOnly="{Binding IsRaedOnly}"/>
|
||||
|
||||
<TextBlock Grid.Row="1" Text="{Binding HeightMsg}"
|
||||
<TextBlock Grid.Row="1" Text="{Binding HeightMsg}"
|
||||
Style="{StaticResource DoorParamsTxBl}"
|
||||
Margin="2,0,0,2"/>
|
||||
<TextBox Grid.Column="1" Grid.Row="1" Style="{StaticResource DoorParamsTxBx}"
|
||||
Text="{Binding CurrDoor.Height, UpdateSourceTrigger=PropertyChanged}"
|
||||
Margin="0.4,2,39.6,3.2" VerticalAlignment="Stretch" Height="Auto"/>
|
||||
Text="{Binding CurrPart.Height, UpdateSourceTrigger=PropertyChanged}"
|
||||
Margin="0.4,2,39.6,3.2" VerticalAlignment="Stretch" Height="Auto"
|
||||
IsReadOnly="{Binding IsRaedOnly}"/>
|
||||
|
||||
<TextBlock Grid.Row="2" Text="{Binding ThicknessMsg}"
|
||||
Style="{StaticResource DoorParamsTxBl}"
|
||||
Margin="2,0,0,2"/>
|
||||
<TextBox Grid.Column="1" Grid.Row="2" Style="{StaticResource DoorParamsTxBx}"
|
||||
Text="{Binding CurrDoor.Thickness, UpdateSourceTrigger=PropertyChanged}"
|
||||
Margin="0.4,2,39.6,3.2" VerticalAlignment="Stretch" Height="Auto"/>
|
||||
Text="{Binding CurrPart.Thickness, UpdateSourceTrigger=PropertyChanged}"
|
||||
Margin="0.4,2,39.6,3.2" VerticalAlignment="Stretch" Height="Auto"
|
||||
IsReadOnly="{Binding IsRaedOnly}"/>
|
||||
|
||||
<TextBlock Grid.Row="3" Text="{Binding SwingMsg}"
|
||||
Style="{StaticResource DoorParamsTxBl}"
|
||||
Margin="2,0,0,2"/>
|
||||
<ComboBox Grid.Column="1" Grid.Row="3" Margin="0.4,2,39.6,3.2"
|
||||
ItemsSource="{Binding CurrDoor.SwingTypeList}"
|
||||
SelectedItem="{Binding CurrDoor.Swing}"
|
||||
Style="{StaticResource DoorParamsCmBx}" Height="Auto"/>
|
||||
ItemsSource="{Binding CurrPart.SwingTypeList}"
|
||||
SelectedItem="{Binding CurrPart.Swing}"
|
||||
Style="{StaticResource DoorParamsCmBx}" Height="Auto"
|
||||
IsEnabled="{Binding IsRaedOnly, Converter={StaticResource TrueToFalse}}"/>
|
||||
|
||||
<TextBlock Grid.Row="4" Text="{Binding WeightMsg}"
|
||||
Style="{StaticResource DoorParamsTxBl}"
|
||||
Margin="2,0,0,2" Visibility="{Binding CurrDoor.VisibilityWeight}"/>
|
||||
Margin="2,0,0,2" Visibility="{Binding CurrPart.VisibilityWeight}"/>
|
||||
|
||||
<TextBox Grid.Row="4" Grid.Column="1"
|
||||
Style="{StaticResource DoorParamsTxBx}"
|
||||
Text="{Binding CurrDoor.Weight, UpdateSourceTrigger=PropertyChanged}"
|
||||
Text="{Binding CurrPart.Weight, UpdateSourceTrigger=PropertyChanged}"
|
||||
Margin="0.4,2,39.6,3.2" VerticalAlignment="Stretch" Height="Auto"
|
||||
Visibility="{Binding CurrDoor.VisibilityWeight}"/>
|
||||
Visibility="{Binding CurrPart.VisibilityWeight}"
|
||||
IsReadOnly="{Binding IsRaedOnly}"/>
|
||||
|
||||
|
||||
|
||||
@@ -96,20 +113,22 @@
|
||||
Style="{StaticResource DoorParamsTxBl}"
|
||||
Margin="20,2,0,2"/>
|
||||
<ComboBox Grid.Column="3" Grid.Row="1"
|
||||
ItemsSource="{Binding CurrDoor.EdgeTypeList}"
|
||||
SelectedItem="{Binding CurrDoor.LockEdgeType}"
|
||||
ItemsSource="{Binding CurrPart.EdgeTypeList}"
|
||||
SelectedItem="{Binding CurrPart.LockEdgeType}"
|
||||
Style="{StaticResource DoorEdgeParamsCmBx}"
|
||||
Margin="0.4,2,70,4"/>
|
||||
Margin="0.4,2,70,4"
|
||||
IsEnabled="{Binding IsRaedOnly, Converter={StaticResource TrueToFalse}}"/>
|
||||
|
||||
<TextBlock Grid.Column="2" Grid.Row="2"
|
||||
Text="{Binding HingeedgeMsg}"
|
||||
Style="{StaticResource DoorParamsTxBl}"
|
||||
Margin="20,2,0,2"/>
|
||||
<ComboBox Grid.Column="3" Grid.Row="2"
|
||||
ItemsSource="{Binding CurrDoor.EdgeTypeList}"
|
||||
SelectedItem="{Binding CurrDoor.HingeEdgeType}"
|
||||
ItemsSource="{Binding CurrPart.EdgeTypeList}"
|
||||
SelectedItem="{Binding CurrPart.HingeEdgeType}"
|
||||
Style="{StaticResource DoorParamsCmBx}"
|
||||
Margin="0.4,2,70,4">
|
||||
Margin="0.4,2,70,4"
|
||||
IsEnabled="{Binding IsRaedOnly, Converter={StaticResource TrueToFalse}}">
|
||||
<ComboBox.ItemContainerStyle>
|
||||
<Style TargetType="ComboBoxItem">
|
||||
<Setter Property="IsEnabled" Value="{Binding IsActive}" />
|
||||
@@ -127,89 +146,93 @@
|
||||
Style="{StaticResource DoorParamsTxBl}"
|
||||
Margin="20,2,0,2"/>
|
||||
<ComboBox Grid.Column="3" Grid.Row="3"
|
||||
ItemsSource="{Binding CurrDoor.EdgeTypeList}"
|
||||
SelectedItem="{Binding CurrDoor.TopType}"
|
||||
ItemsSource="{Binding CurrPart.EdgeTypeList}"
|
||||
SelectedItem="{Binding CurrPart.TopType}"
|
||||
Style="{StaticResource DoorEdgeParamsCmBx}"
|
||||
Margin="0.4,2,70,4"/>
|
||||
Margin="0.4,2,70,4"
|
||||
IsEnabled="{Binding IsRaedOnly, Converter={StaticResource TrueToFalse}}"/>
|
||||
|
||||
<TextBlock Grid.Row="4" Grid.Column="2"
|
||||
Text="{Binding BottomMsg}"
|
||||
Style="{StaticResource DoorParamsTxBl}"
|
||||
Margin="20,2,0,2"/>
|
||||
<ComboBox Grid.Column="3" Grid.Row="4"
|
||||
ItemsSource="{Binding CurrDoor.EdgeTypeList}"
|
||||
SelectedItem="{Binding CurrDoor.BottomType}"
|
||||
ItemsSource="{Binding CurrPart.EdgeTypeList}"
|
||||
SelectedItem="{Binding CurrPart.BottomType}"
|
||||
Style="{StaticResource DoorEdgeParamsCmBx}"
|
||||
Margin="0.4,2,70,4"/>
|
||||
Margin="0.4,2,70,4"
|
||||
IsEnabled="{Binding IsRaedOnly, Converter={StaticResource TrueToFalse}}"/>
|
||||
|
||||
<!--Machining-->
|
||||
<CheckBox Grid.Column="4" Grid.Row="1"
|
||||
Name="LockEdge" Style="{StaticResource DoorParamsChBx}"
|
||||
IsChecked="{Binding CurrDoor.LockEdgeMachining}"
|
||||
/>
|
||||
IsChecked="{Binding CurrPart.LockEdgeMachining}"
|
||||
IsEnabled="{Binding IsRaedOnly, Converter={StaticResource TrueToFalse}}"/>
|
||||
<CheckBox Grid.Column="4" Grid.Row="2"
|
||||
Name="HingeEdge" Style="{StaticResource DoorParamsChBx}"
|
||||
IsChecked="{Binding CurrDoor.HingeEdgeMachining}"
|
||||
/>
|
||||
IsChecked="{Binding CurrPart.HingeEdgeMachining}"
|
||||
IsEnabled="{Binding IsRaedOnly, Converter={StaticResource TrueToFalse}}"/>
|
||||
<CheckBox Grid.Column="4" Grid.Row="3"
|
||||
Name="Top" Style="{StaticResource DoorParamsChBx}"
|
||||
IsChecked="{Binding CurrDoor.TopMachining}"
|
||||
/>
|
||||
IsChecked="{Binding CurrPart.TopMachining}"
|
||||
IsEnabled="{Binding IsRaedOnly, Converter={StaticResource TrueToFalse}}"/>
|
||||
<CheckBox Grid.Column="4" Grid.Row="4"
|
||||
Name="Bottom" Style="{StaticResource DoorParamsChBx}"
|
||||
IsChecked="{Binding CurrDoor.BottomMachining}"
|
||||
/>
|
||||
IsChecked="{Binding CurrPart.BottomMachining}"
|
||||
IsEnabled="{Binding IsRaedOnly, Converter={StaticResource TrueToFalse}}"/>
|
||||
|
||||
<TextBox Grid.Column="5" Grid.Row="1" Style="{StaticResource DoorParamsTxBx}"
|
||||
Text="{Binding CurrDoor.LockEdgeOverMaterial, UpdateSourceTrigger=PropertyChanged}"
|
||||
Text="{Binding CurrPart.LockEdgeOverMaterial, UpdateSourceTrigger=PropertyChanged}"
|
||||
IsEnabled="{Binding IsChecked, ElementName=LockEdge}"
|
||||
Margin="10,2.6,40,2"/>
|
||||
Margin="10,2.6,40,2" IsReadOnly="{Binding IsRaedOnly}"/>
|
||||
<TextBox Grid.Column="5" Grid.Row="2" Style="{StaticResource DoorParamsTxBx}"
|
||||
Text="{Binding CurrDoor.HingeEdgeOverMaterial, UpdateSourceTrigger=PropertyChanged}"
|
||||
Text="{Binding CurrPart.HingeEdgeOverMaterial, UpdateSourceTrigger=PropertyChanged}"
|
||||
IsEnabled="{Binding IsChecked, ElementName=HingeEdge}"
|
||||
Margin="10,2,40,2"/>
|
||||
Margin="10,2,40,2" IsReadOnly="{Binding IsRaedOnly}"/>
|
||||
<TextBox Grid.Column="5" Grid.Row="3" Style="{StaticResource DoorParamsTxBx}"
|
||||
Text="{Binding CurrDoor.TopOverMaterial, UpdateSourceTrigger=PropertyChanged}"
|
||||
Text="{Binding CurrPart.TopOverMaterial, UpdateSourceTrigger=PropertyChanged}"
|
||||
IsEnabled="{Binding IsChecked, ElementName=Top}"
|
||||
Margin="10,2,40,2"/>
|
||||
Margin="10,2,40,2" IsReadOnly="{Binding IsReadOnly}"/>
|
||||
<TextBox Grid.Column="5" Grid.Row="4" Style="{StaticResource DoorParamsTxBx}"
|
||||
Text="{Binding CurrDoor.BottomOverMaterial, UpdateSourceTrigger=PropertyChanged}"
|
||||
Text="{Binding CurrPart.BottomOverMaterial, UpdateSourceTrigger=PropertyChanged}"
|
||||
IsEnabled="{Binding IsChecked, ElementName=Bottom}"
|
||||
Margin="10,2,40,4"/>
|
||||
Margin="10,2,40,4" IsReadOnly="{Binding IsRaedOnly}"/>
|
||||
|
||||
</Grid>
|
||||
|
||||
</GroupBox>
|
||||
|
||||
<ItemsControl Name="DoorParamsItemsControl" Grid.Row="1" ItemsSource="{Binding CurrDoor.CompoList}" Style="{StaticResource DoorParamsItemsControlStyle}">
|
||||
<ItemsControl Name="DoorParamsItemsControl" Grid.Row="1" ItemsSource="{Binding CurrPart.CompoList}" Style="{StaticResource DoorParamsItemsControlStyle}">
|
||||
<ItemsControl.InputBindings>
|
||||
<KeyBinding Key="Enter" Command="{Binding RefreshCmd}"/>
|
||||
</ItemsControl.InputBindings>
|
||||
<ItemsControl.ItemTemplate>
|
||||
<DataTemplate >
|
||||
<DataTemplate>
|
||||
<GroupBox
|
||||
Width="{Binding ActualWidth,ElementName=DoorParamsItemsControl,
|
||||
Converter={StaticResource SplitConverter},ConverterParameter=2}">
|
||||
<GroupBox.Header>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<TextBlock Text="{Binding CompoType.Name}" Width="Auto"/>
|
||||
<Button
|
||||
<Button
|
||||
ToolTip="{Binding DataContext.DeleteCompoToolTip,RelativeSource={RelativeSource AncestorType={x:Type UserControl}}}"
|
||||
Command="{Binding DeleteCommand}" Margin="10,2,0,2"
|
||||
Width="{Binding ActualHeight, RelativeSource={RelativeSource Self}}"
|
||||
Focusable="False">
|
||||
<Image Source="/Resources/TopCommandBar/X.png" Height="12" Stretch="Uniform"/>
|
||||
<Image Source="/Resources/TopCommandBar/X.png" Height="12" Stretch="Uniform"/>
|
||||
</Button>
|
||||
</StackPanel>
|
||||
</GroupBox.Header>
|
||||
<StackPanel>
|
||||
<StackPanel >
|
||||
<UniformGrid Columns="2" Visibility="{Binding TemplateVisibility}">
|
||||
<TextBlock Text="{Binding TemplateName}"
|
||||
Style="{StaticResource DoorParamsTxBl}"/>
|
||||
<ComboBox ItemsSource="{Binding TemplateItemList}" Margin="0,0,0,2"
|
||||
SelectedItem="{Binding TemplateSelItem}"
|
||||
Style="{StaticResource DoorParamsCmBx}"/>
|
||||
Style="{StaticResource DoorParamsCmBx}"
|
||||
IsEnabled="{Binding IsReadOnly}"/>
|
||||
</UniformGrid>
|
||||
<!--Lista dei parametri-->
|
||||
<ItemsControl ItemsSource="{Binding CompoParamList}">
|
||||
<ItemsControl.Resources>
|
||||
<DataTemplate DataType="{x:Type local:ComboBoxParam}">
|
||||
@@ -218,17 +241,15 @@
|
||||
Style="{StaticResource DoorParamsTxBl}"/>
|
||||
<ComboBox ItemsSource="{Binding ItemList}" Margin="0,0,0,2"
|
||||
SelectedItem="{Binding SelItem}"
|
||||
Style="{StaticResource DoorParamsCmBx}"/>
|
||||
Style="{StaticResource DoorParamsCmBx}"
|
||||
IsEnabled="{Binding IsRaedOnly}"/>
|
||||
</UniformGrid>
|
||||
</DataTemplate>
|
||||
<DataTemplate DataType="{x:Type local:TextBoxParam}">
|
||||
<UniformGrid Columns="2">
|
||||
|
||||
<UniformGrid.InputBindings>
|
||||
|
||||
<KeyBinding Key="Enter" Command="{Binding DataContext.RefreshCmd,RelativeSource={RelativeSource AncestorType={x:Type UserControl}}}"
|
||||
FocusManager.FocusedElement="{Binding ElementName=Stk}"/>
|
||||
|
||||
FocusManager.FocusedElement="{Binding ElementName=Stk}"/>
|
||||
</UniformGrid.InputBindings>
|
||||
|
||||
<TextBlock Text="{Binding Name}"
|
||||
@@ -237,7 +258,8 @@
|
||||
Name="TxTData"
|
||||
Style="{StaticResource DoorParamsTxBx}"
|
||||
Margin="0,0,0,2"
|
||||
ToolTip="{Binding ToolTipValue}"/>
|
||||
ToolTip="{Binding ToolTipValue}"
|
||||
IsEnabled="{Binding IsReadOnly}"/>
|
||||
</UniformGrid>
|
||||
</DataTemplate>
|
||||
<DataTemplate DataType="{x:Type local:TextBoxOnOffParam}">
|
||||
@@ -254,19 +276,20 @@
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<CheckBox Name="ChBx" IsChecked="{Binding IsActive}"
|
||||
Style="{StaticResource DoorParamsChBx}"/>
|
||||
Style="{StaticResource DoorParamsChBx}"
|
||||
IsEnabled="{Binding IsRaedOnly, Converter={StaticResource TrueToFalse}}"/>
|
||||
<TextBlock Text="{Binding Name}" Grid.Column="1"
|
||||
Style="{StaticResource DoorParamsTxBl}"
|
||||
Margin="0,0,0,2"/>
|
||||
|
||||
</Grid>
|
||||
<TextBox Text="{Binding Value,UpdateSourceTrigger=PropertyChanged}" Grid.Column="2"
|
||||
<TextBox Text="{Binding Value,UpdateSourceTrigger=PropertyChanged}" Grid.Column="2"
|
||||
Style="{StaticResource DoorParamsTxBx}"
|
||||
IsEnabled="{Binding IsChecked, ElementName=ChBx}"
|
||||
Margin="0,0,0,2"
|
||||
ToolTip="{Binding ToolTipValue,UpdateSourceTrigger=PropertyChanged}"/>
|
||||
|
||||
</Grid>
|
||||
ToolTip="{Binding ToolTipValue,UpdateSourceTrigger=PropertyChanged}"
|
||||
IsReadOnly="{Binding IsReadOnly}"/>
|
||||
</Grid>
|
||||
</DataTemplate>
|
||||
</ItemsControl.Resources>
|
||||
|
||||
@@ -276,7 +299,8 @@
|
||||
</DataTemplate>
|
||||
</ItemsControl.ItemTemplate>
|
||||
</ItemsControl>
|
||||
|
||||
|
||||
</Grid>
|
||||
<EgtDOORCreator:CompoPanelV Grid.Column="0" DataContext="{StaticResource CompoPanelVM}"/>
|
||||
</Grid>
|
||||
|
||||
</UserControl>
|
||||
@@ -0,0 +1,3 @@
|
||||
Public Class DoorParametersV
|
||||
|
||||
End Class
|
||||
@@ -3,42 +3,27 @@ Imports System.Collections.ObjectModel
|
||||
Imports EgtUILib
|
||||
'Imports System.Text.RegularExpressions
|
||||
|
||||
Public Class DoorParametersViewModel
|
||||
Public Class PartPageVM
|
||||
Implements INotifyPropertyChanged
|
||||
|
||||
Private m_rfMainWindowViewModel As MainWindowViewModel
|
||||
Friend bSetChange As Boolean = False
|
||||
Private m_CurrDoor As Door
|
||||
Public Property CurrDoor As Door
|
||||
Private m_CurrPart As Part
|
||||
Public Property CurrPart As Part
|
||||
Get
|
||||
Return m_CurrDoor
|
||||
Return m_CurrPart
|
||||
End Get
|
||||
Set(value As Door)
|
||||
m_CurrDoor = value
|
||||
If Not IsNothing(m_CurrDoor) Then
|
||||
m_CurrDoor.SetVarSize()
|
||||
Set(value As Part)
|
||||
m_CurrPart = value
|
||||
If Not IsNothing(m_CurrPart) Then
|
||||
m_CurrPart.SetVarSize()
|
||||
End If
|
||||
NotifyPropertyChanged("CurrDoor")
|
||||
NotifyPropertyChanged("CurrPart")
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_CurrProject As Project
|
||||
Public Property CurrProject As Project
|
||||
Get
|
||||
Return m_CurrProject
|
||||
End Get
|
||||
Set(value As Project)
|
||||
m_CurrProject = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Sub New(ByRef MainWindowViewModel As MainWindowViewModel)
|
||||
m_rfMainWindowViewModel = MainWindowViewModel
|
||||
Dim DoorManagerViewModel As DoorManagerViewModel = DirectCast(m_rfMainWindowViewModel.DoorManager.DataContext, DoorManagerViewModel)
|
||||
Dim CurrProject As Project = DoorManagerViewModel.CurrProject
|
||||
' salvo il riferimento al progetto corrente
|
||||
m_CurrProject = CurrProject
|
||||
Door.m_rfModifyTitle = AddressOf m_rfMainWindowViewModel.ModifyTitle
|
||||
Sub New()
|
||||
Map.SetRefDoorParametersVM(Me)
|
||||
Part.m_rfModifyTitle = AddressOf Map.refMainWindowVM.ModifyTitle
|
||||
End Sub
|
||||
|
||||
#Region "Messages"
|
||||
@@ -122,6 +107,17 @@ Public Class DoorParametersViewModel
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_IsReadOnly As Boolean
|
||||
Public Property IsRaedOnly As Boolean
|
||||
Get
|
||||
Return m_IsReadOnly
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
m_IsReadOnly = value
|
||||
NotifyPropertyChanged("IsRaedOnly")
|
||||
End Set
|
||||
End Property
|
||||
|
||||
' definizione comando
|
||||
Private m_EnterRefreshCmd As ICommand
|
||||
Private m_F1GuideCmd As ICommand
|
||||
@@ -141,7 +137,7 @@ Public Class DoorParametersViewModel
|
||||
End Property
|
||||
|
||||
Public Sub EnterRefresh()
|
||||
DirectCast(m_rfMainWindowViewModel.SceneManager.DataContext, SceneManagerViewModel).RefreshBtn()
|
||||
Map.refSceneManagerVM.RefreshBtn()
|
||||
End Sub
|
||||
|
||||
' Comando Guida
|
||||
@@ -155,11 +151,11 @@ Public Class DoorParametersViewModel
|
||||
End Property
|
||||
|
||||
Public Sub F1Guide()
|
||||
Dim rfGuideViewModel As New GuideViewModel
|
||||
If String.IsNullOrEmpty(GuideViewModel.m_AddressGuide) Then
|
||||
GuideViewModel.m_AddressGuide = "Test.html"
|
||||
Dim rfGuideVM As New GuideVM
|
||||
If String.IsNullOrEmpty(GuideVM.m_AddressGuide) Then
|
||||
GuideVM.m_AddressGuide = "Test.html"
|
||||
End If
|
||||
m_rfMainWindowViewModel.ProjectManagerViewModel.Guide()
|
||||
Map.refProjectManagerVM.Guide()
|
||||
End Sub
|
||||
|
||||
#End Region ' Command
|
||||
@@ -12,6 +12,7 @@
|
||||
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
|
||||
<MyType>Custom</MyType>
|
||||
<TargetFrameworkProfile>Client</TargetFrameworkProfile>
|
||||
<IsWebBootstrapper>false</IsWebBootstrapper>
|
||||
<PublishUrl>publish\</PublishUrl>
|
||||
<Install>true</Install>
|
||||
<InstallFrom>Disk</InstallFrom>
|
||||
@@ -24,7 +25,6 @@
|
||||
<MapFileExtensions>true</MapFileExtensions>
|
||||
<ApplicationRevision>0</ApplicationRevision>
|
||||
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
|
||||
<IsWebBootstrapper>false</IsWebBootstrapper>
|
||||
<UseApplicationTrust>false</UseApplicationTrust>
|
||||
<BootstrapperEnabled>true</BootstrapperEnabled>
|
||||
</PropertyGroup>
|
||||
@@ -106,87 +106,97 @@
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</ApplicationDefinition>
|
||||
<Compile Include="AboutBoxWindow\AboutBoxView.xaml.vb">
|
||||
<DependentUpon>AboutBoxView.xaml</DependentUpon>
|
||||
<Compile Include="AboutBoxWindow\AboutBoxV.xaml.vb">
|
||||
<DependentUpon>AboutBoxV.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="AboutBoxWindow\AboutBoxViewModel.vb" />
|
||||
<Compile Include="AboutBoxWindow\AboutBoxVM.vb" />
|
||||
<Compile Include="Assembly\PartDoor.vb" />
|
||||
<Compile Include="Command\Command.vb" />
|
||||
<Compile Include="CompoPanel\CompoType.vb" />
|
||||
<Compile Include="Constants\ConstCompo.vb" />
|
||||
<Compile Include="Constants\ConstGen.vb" />
|
||||
<Compile Include="Constants\ConstIni.vb" />
|
||||
<Compile Include="Constants\ConstMsg.vb" />
|
||||
<Compile Include="Converter\BooleanToVisibility.vb" />
|
||||
<Compile Include="Converter\Path.vb" />
|
||||
<Compile Include="Converter\ProjectVisibility.vb" />
|
||||
<Compile Include="Converter\TrueToFalse.vb" />
|
||||
<Compile Include="DdfFile.vb" />
|
||||
<Compile Include="DoorManager\DoorManagerView.xaml.vb">
|
||||
<DependentUpon>DoorManagerView.xaml</DependentUpon>
|
||||
<Compile Include="DoorManager\AssemblyManagerV.xaml.vb">
|
||||
<DependentUpon>AssemblyManagerV.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="DoorManager\DoorManagerViewModel.vb" />
|
||||
<Compile Include="DoorParameters\DoorParametersViewModel.vb" />
|
||||
<Compile Include="DoorManager\AssemblyManagerVM.vb" />
|
||||
<Compile Include="DoorParameters\PartPageVM.vb" />
|
||||
<Compile Include="DoorParameters\Compo.vb" />
|
||||
<Compile Include="CompoPanel\CompoPanelView.xaml.vb">
|
||||
<DependentUpon>CompoPanelView.xaml</DependentUpon>
|
||||
<Compile Include="CompoPanel\CompoPanelV.xaml.vb">
|
||||
<DependentUpon>CompoPanelV.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="CompoPanel\CompoPanelViewModel.vb" />
|
||||
<Compile Include="DoorParameters\Jamb.vb" />
|
||||
<Compile Include="CompoPanel\CompoPanelVM.vb" />
|
||||
<Compile Include="Assembly\Assembly.vb" />
|
||||
<Compile Include="Doors.vb" />
|
||||
<Compile Include="Guide\GuideViewModel.vb" />
|
||||
<Compile Include="Guide\GuideView.xaml.vb">
|
||||
<DependentUpon>GuideView.xaml</DependentUpon>
|
||||
<Compile Include="Guide\GuideV.xaml.vb">
|
||||
<DependentUpon>GuideV.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Assembly\AssemblyPageV.xaml.vb">
|
||||
<DependentUpon>AssemblyPageV.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Assembly\AssemblyPageVM.vb" />
|
||||
<Compile Include="Launcher\LauncherModule.vb" />
|
||||
<Compile Include="Launcher\LauncherView.xaml.vb">
|
||||
<DependentUpon>LauncherView.xaml</DependentUpon>
|
||||
<Compile Include="Launcher\LauncherV.xaml.vb">
|
||||
<DependentUpon>LauncherV.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Launcher\LauncherViewModel.vb" />
|
||||
<Compile Include="Launcher\LauncherVM.vb" />
|
||||
<Compile Include="Map.vb" />
|
||||
<Compile Include="OptionsWindow\OptionModule.vb" />
|
||||
<Compile Include="OptionsWindow\OptionsView.xaml.vb">
|
||||
<DependentUpon>OptionsView.xaml</DependentUpon>
|
||||
<Compile Include="OptionsWindow\OptionsV.xaml.vb">
|
||||
<DependentUpon>OptionsV.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="OptionsWindow\OptionsViewModel.vb" />
|
||||
<Compile Include="ProjectManager\Project.vb" />
|
||||
<Compile Include="ProjectManager\ProjectManagerView.xaml.vb">
|
||||
<DependentUpon>ProjectManagerView.xaml</DependentUpon>
|
||||
<Compile Include="ProjectManager\ProjectManagerV.xaml.vb">
|
||||
<DependentUpon>ProjectManagerV.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="ProjectManager\ProjectManagerViewModel.vb" />
|
||||
<Compile Include="ProjectManager\ProjectManagerVM.vb" />
|
||||
<Compile Include="RegexFunction.vb" />
|
||||
<Compile Include="SceneManager\InstrumentPanel\InstrumentPanelView.xaml.vb">
|
||||
<DependentUpon>InstrumentPanelView.xaml</DependentUpon>
|
||||
<Compile Include="SceneManager\InstrumentPanel\InstrumentPanelV.xaml.vb">
|
||||
<DependentUpon>InstrumentPanelV.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="SceneManager\InstrumentPanel\InstrumentPanelViewModel.vb" />
|
||||
<Compile Include="SceneManager\PopUpViewPanel\PopUpViewPanelView.xaml.vb">
|
||||
<DependentUpon>PopUpViewPanelView.xaml</DependentUpon>
|
||||
<Compile Include="SceneManager\InstrumentPanel\InstrumentPanelVM.vb" />
|
||||
<Compile Include="SceneManager\PopUpViewPanel\PopUpViewPanelV.xaml.vb">
|
||||
<DependentUpon>PopUpViewPanelV.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="SceneManager\PopUpViewPanel\PopUpViewPanelViewModel.vb" />
|
||||
<Compile Include="SceneManager\Refresh\RefreshPanelView.xaml.vb">
|
||||
<DependentUpon>RefreshPanelView.xaml</DependentUpon>
|
||||
<Compile Include="SceneManager\PopUpViewPanel\PopUpViewPanelVM.vb" />
|
||||
<Compile Include="SceneManager\Refresh\RefreshPanelV.xaml.vb">
|
||||
<DependentUpon>RefreshPanelV.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="SceneManager\Refresh\RefreshPanelViewModel.vb" />
|
||||
<Compile Include="SceneManager\SceneManagerView.xaml.vb">
|
||||
<DependentUpon>SceneManagerView.xaml</DependentUpon>
|
||||
<Compile Include="SceneManager\Refresh\RefreshPanelVM.vb" />
|
||||
<Compile Include="SceneManager\SceneManagerV.xaml.vb">
|
||||
<DependentUpon>SceneManagerV.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="SceneManager\SceneManagerViewModel.vb" />
|
||||
<Compile Include="SceneManager\ShowPanel\ShowPanelView.xaml.vb">
|
||||
<DependentUpon>ShowPanelView.xaml</DependentUpon>
|
||||
<Compile Include="SceneManager\SceneManagerVM.vb" />
|
||||
<Compile Include="SceneManager\ShowPanel\ShowPanelV.xaml.vb">
|
||||
<DependentUpon>ShowPanelV.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="SceneManager\ShowPanel\ShowPanelViewModel.vb" />
|
||||
<Compile Include="SceneManager\ViewPanel\ViewPanelView.xaml.vb">
|
||||
<DependentUpon>ViewPanelView.xaml</DependentUpon>
|
||||
<Compile Include="SceneManager\ShowPanel\ShowPanelVM.vb" />
|
||||
<Compile Include="SceneManager\ViewPanel\ViewPanelV.xaml.vb">
|
||||
<DependentUpon>ViewPanelV.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="SceneManager\ViewPanel\ViewPanelViewModel.vb" />
|
||||
<Compile Include="StatusBar\StatusBarView.xaml.vb">
|
||||
<DependentUpon>StatusBarView.xaml</DependentUpon>
|
||||
<Compile Include="SceneManager\ViewPanel\ViewPanelVM.vb" />
|
||||
<Compile Include="StatusBar\StatusBarV.xaml.vb">
|
||||
<DependentUpon>StatusBarV.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="StatusBar\StatusBarViewModel.vb" />
|
||||
<Compile Include="StatusBar\StatusBarVM.vb" />
|
||||
<Compile Include="Utility.vb" />
|
||||
<Page Include="AboutBoxWindow\AboutBoxView.xaml">
|
||||
<Page Include="AboutBoxWindow\AboutBoxV.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Include="DoorManager\DoorManagerView.xaml">
|
||||
<Page Include="DoorManager\AssemblyManagerV.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="DoorParameters\DoorParametersView.xaml">
|
||||
<Page Include="DoorParameters\PartPageV.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
@@ -194,15 +204,19 @@
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="Guide\GuideView.xaml">
|
||||
<Page Include="Guide\GuideV.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="Launcher\LauncherView.xaml">
|
||||
<Page Include="Assembly\AssemblyPageV.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="MainWindow\MainWindow.xaml">
|
||||
<Page Include="Launcher\LauncherV.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="MainWindow\MainWindowV.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
@@ -210,52 +224,52 @@
|
||||
<DependentUpon>Application.xaml</DependentUpon>
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="DoorParameters\Door.vb" />
|
||||
<Compile Include="DoorParameters\DoorParametersView.xaml.vb">
|
||||
<DependentUpon>DoorParametersView.xaml</DependentUpon>
|
||||
<Compile Include="DoorParameters\Part.vb" />
|
||||
<Compile Include="DoorParameters\PartPageV.xaml.vb">
|
||||
<DependentUpon>PartPageV.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="IniFile.vb" />
|
||||
<Compile Include="MainWindow\MainWindow.xaml.vb">
|
||||
<DependentUpon>MainWindow.xaml</DependentUpon>
|
||||
<Compile Include="MainWindow\MainWindowV.xaml.vb">
|
||||
<DependentUpon>MainWindowV.xaml</DependentUpon>
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Page Include="CompoPanel\CompoPanelView.xaml">
|
||||
<Page Include="CompoPanel\CompoPanelV.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="OptionsWindow\OptionsView.xaml">
|
||||
<Page Include="OptionsWindow\OptionsV.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Include="ProjectManager\ProjectManagerView.xaml">
|
||||
<Page Include="ProjectManager\ProjectManagerV.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Include="SceneManager\InstrumentPanel\InstrumentPanelView.xaml">
|
||||
<Page Include="SceneManager\InstrumentPanel\InstrumentPanelV.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Include="SceneManager\PopUpViewPanel\PopUpViewPanelView.xaml">
|
||||
<Page Include="SceneManager\PopUpViewPanel\PopUpViewPanelV.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Include="SceneManager\Refresh\RefreshPanelView.xaml">
|
||||
<Page Include="SceneManager\Refresh\RefreshPanelV.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="SceneManager\SceneManagerView.xaml">
|
||||
<Page Include="SceneManager\SceneManagerV.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="SceneManager\ShowPanel\ShowPanelView.xaml">
|
||||
<Page Include="SceneManager\ShowPanel\ShowPanelV.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Include="SceneManager\ViewPanel\ViewPanelView.xaml">
|
||||
<Page Include="SceneManager\ViewPanel\ViewPanelV.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Include="StatusBar\StatusBarView.xaml">
|
||||
<Page Include="StatusBar\StatusBarV.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
@@ -281,7 +295,7 @@
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="MainWindow\MainWindowModel.vb" />
|
||||
<Compile Include="MainWindow\MainWindowViewModel.vb" />
|
||||
<Compile Include="MainWindow\MainWindowVM.vb" />
|
||||
<Compile Include="My Project\AssemblyInfo.vb">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
@@ -390,6 +404,21 @@
|
||||
<Install>true</Install>
|
||||
</BootstrapperPackage>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Resource Include="Resources\JambPage\Jamb_L.png" />
|
||||
<Resource Include="Resources\JambPage\Jamb_R.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Resource Include="Resources\JambPage\Jamb_TL.png" />
|
||||
<Resource Include="Resources\JambPage\Jamb_TM.png" />
|
||||
<Resource Include="Resources\JambPage\Jamb_TR.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Resource Include="Resources\JambPage\Door.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Resource Include="Resources\Refresh\BackArrow.png" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />
|
||||
<PropertyGroup>
|
||||
<PostBuildEvent>IF "$(PlatformName)"=="x86" IF "$(ConfigurationName)" == "Release" copy $(TargetPath) c:\EgtProg\EgtDOORCreator\EgtDOORCreatorR32.exe
|
||||
|
||||
@@ -4,6 +4,16 @@
|
||||
xmlns:EgtWPFLib5="clr-namespace:EgtWPFLib5;assembly=EgtWPFLib5"
|
||||
xmlns:EgtDOORCreator="clr-namespace:EgtDOORCreator">
|
||||
|
||||
<EgtDOORCreator:MainWindowVM x:Key="MainWindowVM"/>
|
||||
<EgtDOORCreator:ProjectManagerVM x:Key="ProjectManagerVM"/>
|
||||
<EgtDOORCreator:AssemblyManagerVM x:Key="AssemblyManagerVM"/>
|
||||
<EgtDOORCreator:PartPageVM x:Key="PartPageVM"/>
|
||||
<EgtDOORCreator:CompoPanelVM x:Key="CompoPanelVM"/>
|
||||
<EgtDOORCreator:SceneManagerVM x:Key="SceneManagerVM"/>
|
||||
<EgtDOORCreator:StatusBarVM x:Key="StatusBarVM"/>
|
||||
<EgtDOORCreator:AssemblyPageVM x:Key="AssemblyPageVM"/>
|
||||
|
||||
|
||||
<!--Colori predefiniti-->
|
||||
<SolidColorBrush x:Key="EgaltechBlue1" Color="#FF4D84C4" />
|
||||
<SolidColorBrush x:Key="EgaltechBlue2" Color="#FF7096CE" />
|
||||
@@ -197,6 +207,40 @@
|
||||
|
||||
<!-- ______________________________________________________________________________________________________________________________________________ -->
|
||||
|
||||
<!-- DoorButton Style -->
|
||||
|
||||
<SolidColorBrush x:Key="DoorButton.Static.Background" Color="#FFD07606"/>
|
||||
<SolidColorBrush x:Key="DoorButton.Static.Border" Color="#000000"/>
|
||||
<SolidColorBrush x:Key="DoorButton.MouseOver.Border" Color="#FF3C7FB1"/>
|
||||
|
||||
<Style x:Key="DoorButton" TargetType="{x:Type Button}">
|
||||
<Setter Property="Background" Value="{StaticResource DoorButton.Static.Background}"/>
|
||||
<Setter Property="BorderBrush" Value="{StaticResource DoorButton.Static.Border}"/>
|
||||
<Setter Property="BorderThickness" Value="1"/>
|
||||
<Setter Property="HorizontalContentAlignment" Value="Center"/>
|
||||
<Setter Property="VerticalContentAlignment" Value="Center"/>
|
||||
<Setter Property="Padding" Value="0"/>
|
||||
<Setter Property="Margin" Value="0"/>
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="{x:Type Button}">
|
||||
<Border x:Name="border" CornerRadius="0" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" SnapsToDevicePixels="true">
|
||||
<ContentPresenter x:Name="contentPresenter" Focusable="False" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
|
||||
</Border>
|
||||
<ControlTemplate.Triggers>
|
||||
<Trigger Property="IsMouseOver" Value="true">
|
||||
<Setter Property="Background" TargetName="border" Value="{StaticResource DoorButton.Static.Background}"/>
|
||||
<Setter Property="BorderBrush" TargetName="border" Value="{StaticResource Button.MouseOver.Border}"/>
|
||||
</Trigger>
|
||||
</ControlTemplate.Triggers>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
<!-- ______________________________________________________________________________________________________________________________________________ -->
|
||||
|
||||
|
||||
<!-- ToggleButton Style -->
|
||||
|
||||
<Style TargetType="{x:Type ToggleButton}">
|
||||
@@ -308,7 +352,10 @@
|
||||
<!-- CheckBox Style -->
|
||||
|
||||
<Style x:Key="DoorParamsChBx" TargetType="{x:Type CheckBox}">
|
||||
<Setter Property="Height" Value="15"/>
|
||||
<Setter Property="Width" Value="15"/>
|
||||
<Setter Property="VerticalAlignment" Value="Center"/>
|
||||
<Setter Property="HorizontalAlignment" Value="Center"/>
|
||||
</Style>
|
||||
|
||||
<!-- ______________________________________________________________________________________________________________________________________________ -->
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<EgtWPFLib5:EgtCustomWindow x:Class="GuideView"
|
||||
<EgtWPFLib5:EgtCustomWindow x:Class="GuideV"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:EgtWPFLib5="clr-namespace:EgtWPFLib5;assembly=EgtWPFLib5"
|
||||
@@ -7,7 +7,8 @@
|
||||
BorderBrush="{StaticResource EgaltechBlue1}"
|
||||
WindowStyle="None" ResizeMode="NoResize" TitleBarHeight="30" IsResizable="True"
|
||||
IsMinimizable="True" WindowStartupLocation="CenterScreen" ShowInTaskbar="False"
|
||||
CloseCommand="{Binding CloseOptionsCommand,Mode=OneWay,UpdateSourceTrigger=PropertyChanged}">
|
||||
CloseCommand="{Binding CloseOptionsCommand,Mode=OneWay,UpdateSourceTrigger=PropertyChanged}"
|
||||
Height="800" Width="1500">
|
||||
|
||||
|
||||
<DockPanel Margin="5">
|
||||
@@ -0,0 +1,16 @@
|
||||
Public Class GuideV
|
||||
|
||||
Private m_GuideVM As GuideVM
|
||||
Public Shared m_Language As String
|
||||
|
||||
Sub New(Owner As Window, GuideVM As GuideVM)
|
||||
MyBase.New(Owner)
|
||||
' This call is required by the designer.
|
||||
InitializeComponent()
|
||||
' Add any initialization after the InitializeComponent() call.
|
||||
Me.DataContext = GuideVM
|
||||
m_GuideVM = GuideVM
|
||||
DoorBrowser.Navigate(New Uri(IniFile.m_sHelpDir & "\EnglishTsetJava\" & m_Language & "\" & GuideVM.m_AddressGuide & ".html"))
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
@@ -1,16 +0,0 @@
|
||||
Public Class GuideView
|
||||
|
||||
Private m_GuideViewModel As GuideViewModel
|
||||
Public Shared m_Language As String
|
||||
|
||||
Sub New(Owner As Window, GuideViewModel As GuideViewModel)
|
||||
MyBase.New(Owner)
|
||||
' This call is required by the designer.
|
||||
InitializeComponent()
|
||||
' Add any initialization after the InitializeComponent() call.
|
||||
Me.DataContext = GuideViewModel
|
||||
m_GuideViewModel = GuideViewModel
|
||||
DoorBrowser.Navigate(New Uri(IniFile.m_sHelpDir & "\EnglishTsetJava\" & m_Language & "\" & GuideViewModel.m_AddressGuide & ".html"))
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
@@ -3,7 +3,7 @@ Imports System.ComponentModel
|
||||
Imports System.Windows.Forms
|
||||
Imports EgtUILib
|
||||
|
||||
Public Class GuideViewModel
|
||||
Public Class GuideVM
|
||||
' se non è stata selezionato ancora nulla allora faccio partire il menu principale
|
||||
Public Shared m_AddressGuide As String = "Test"
|
||||
|
||||
|
||||
@@ -203,4 +203,13 @@ Friend Module IniFile
|
||||
Return False
|
||||
End Function
|
||||
|
||||
Public Function GetPrivateProfileJambSide(IpAppName As String, IpKeyName As String, ByRef Side As String, CompoIniPath As String) As Boolean
|
||||
Dim sVal As String = String.Empty
|
||||
' Carico il valore della stringa nel parametro sVal
|
||||
EgtUILib.GetPrivateProfileString(IpAppName, IpKeyName, "", sVal, CompoIniPath)
|
||||
Dim sItems() As String = sVal.Split("/"c)
|
||||
Side = sVal
|
||||
Return True
|
||||
End Function
|
||||
|
||||
End Module
|
||||
|
||||
@@ -3,7 +3,7 @@ Imports EgtUILib
|
||||
|
||||
Module LauncherModule
|
||||
' riferimento
|
||||
Private m_rfMainWindowViewModel As MainWindowViewModel
|
||||
Private m_rfMainWindowVM As MainWindowVM
|
||||
Friend m_LstProject As String
|
||||
|
||||
Friend Sub InitLauncherModule()
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<EgtWPFLib5:EgtCustomWindow x:Class="LauncherView"
|
||||
<EgtWPFLib5:EgtCustomWindow x:Class="LauncherV"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:EgtWPFLib5="clr-namespace:EgtWPFLib5;assembly=EgtWPFLib5"
|
||||
@@ -1,9 +1,9 @@
|
||||
Imports EgtUILib
|
||||
Imports System.IO
|
||||
|
||||
Public Class LauncherViewModel
|
||||
' Riferimento al MainWindowViewModel
|
||||
Private m_rfMainWindowViewModel As MainWindowViewModel
|
||||
Public Class LauncherVM
|
||||
' Riferimento al MainWindowVM
|
||||
Private m_rfMainWindowVM As MainWindowVM
|
||||
|
||||
#Region "MESSAGES"
|
||||
|
||||
@@ -39,8 +39,8 @@ Public Class LauncherViewModel
|
||||
Private m_CmdLastProject As ICommand
|
||||
Private m_CmdCloseLauncher As ICommand
|
||||
|
||||
Sub New(MainWindowViewModel As MainWindowViewModel)
|
||||
m_rfMainWindowViewModel = MainWindowViewModel
|
||||
Sub New(MainWindowVM As MainWindowVM)
|
||||
m_rfMainWindowVM = MainWindowVM
|
||||
End Sub
|
||||
|
||||
#Region "COMMANDS"
|
||||
@@ -58,7 +58,7 @@ Public Class LauncherViewModel
|
||||
|
||||
Public Sub OpenNew()
|
||||
' rimando alla funzione che già esiste all'interno del projectmanager per la creazione di un nuovo progetto
|
||||
m_rfMainWindowViewModel.ProjectManagerViewModel.NewCmd()
|
||||
Map.refProjectManagerVM.NewCmd()
|
||||
CloseLauncher()
|
||||
End Sub
|
||||
|
||||
@@ -77,7 +77,7 @@ Public Class LauncherViewModel
|
||||
|
||||
Public Sub Open()
|
||||
' rimando alla funzione che già esiste all'interno del projectmanager per l'apertura di un progetto
|
||||
m_rfMainWindowViewModel.ProjectManagerViewModel.Open()
|
||||
Map.refProjectManagerVM.Open()
|
||||
CloseLauncher()
|
||||
End Sub
|
||||
|
||||
@@ -96,7 +96,7 @@ Public Class LauncherViewModel
|
||||
|
||||
Public Sub OpenLastProject()
|
||||
' Apro l'ultimo progetto
|
||||
m_rfMainWindowViewModel.ProjectManagerViewModel.OpenLastProject()
|
||||
Map.refProjectManagerVM.OpenLastProject()
|
||||
CloseLauncher()
|
||||
End Sub
|
||||
|
||||
@@ -122,8 +122,8 @@ Public Class LauncherViewModel
|
||||
Public Sub CloseLauncher()
|
||||
' Chiusura finestra
|
||||
For Each Window In Application.Current.Windows
|
||||
If TypeOf Window Is LauncherView Then
|
||||
Dim LauncherWindow As LauncherView = DirectCast(Window, LauncherView)
|
||||
If TypeOf Window Is LauncherV Then
|
||||
Dim LauncherWindow As LauncherV = DirectCast(Window, LauncherV)
|
||||
LauncherWindow.Close()
|
||||
End If
|
||||
Next
|
||||
@@ -1,22 +0,0 @@
|
||||
Imports EgtWPFLib5
|
||||
Class MainWindow
|
||||
|
||||
Public Sub Me_ContentRendered() Handles Me.ContentRendered
|
||||
Dim rfMainWindowViewModel As MainWindowViewModel = DirectCast(Me.DataContext, MainWindowViewModel)
|
||||
' richiamo la sub che è stata costruita nel MainWindowViewModel
|
||||
Dim SceneManagerViewModel As SceneManagerViewModel = DirectCast(rfMainWindowViewModel.SceneManager.DataContext, SceneManagerViewModel)
|
||||
' se è assente la chiave di protezione non mostro la finestra Launcher
|
||||
If SceneManagerViewModel.bProtectKey Then
|
||||
rfMainWindowViewModel.SetLauncher()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub EgtCustomWindow_Loaded(sender As Object, e As RoutedEventArgs) Handles Me.Loaded
|
||||
Dim rfMainWindowViewModel As MainWindowViewModel = DirectCast(Me.DataContext, MainWindowViewModel)
|
||||
' Posizione e dimensioni del Form
|
||||
Dim WinPos As New WinPos
|
||||
GetPrivateProfileWinPos(S_GENERAL, K_WINPLACE, WinPos.nFlag, WinPos.nLeft, WinPos.nTop, WinPos.nWidth, WinPos.nHeight)
|
||||
rfMainWindowViewModel.WinPosToWindow(Me, WinPos)
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
@@ -1,8 +1,9 @@
|
||||
<EgtWPFLib5:EgtCustomWindow x:Class="MainWindow"
|
||||
<EgtWPFLib5:EgtCustomWindow x:Class="MainWindowV"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:EgtDOORCreator="clr-namespace:EgtDOORCreator"
|
||||
xmlns:EgtWPFLib5="clr-namespace:EgtWPFLib5;assembly=EgtWPFLib5"
|
||||
DataContext="{StaticResource MainWindowVM}"
|
||||
Title="{Binding ProjectNameMsg}" Icon="/Resources/EgtDOOR.ico"
|
||||
TitleBarBrush="{StaticResource EgaltechBlue1}"
|
||||
BorderBrush="{StaticResource EgaltechBlue1}" BorderThickness="2"
|
||||
@@ -14,25 +15,23 @@
|
||||
<KeyBinding Key="F1" Command="{Binding OptionGuideCmd}"/>
|
||||
</EgtWPFLib5:EgtCustomWindow.InputBindings>
|
||||
<EgtWPFLib5:EgtCustomWindow.TitleUserControl >
|
||||
<EgtDOORCreator:ProjectManagerView DataContext="{Binding ProjectManagerViewModel}"/>
|
||||
<EgtDOORCreator:ProjectManagerV DataContext="{StaticResource ProjectManagerVM}"/>
|
||||
</EgtWPFLib5:EgtCustomWindow.TitleUserControl>
|
||||
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="5*"/>
|
||||
<!--<ColumnDefinition Width="1*"/>-->
|
||||
<ColumnDefinition Width="6*"/>
|
||||
<ColumnDefinition Width="5*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<!--ContentPresenter that contains the DoorParameters-->
|
||||
<ContentPresenter Grid.Column="0" Grid.RowSpan="2" Content="{Binding CompoPanel}"/>
|
||||
<ContentPresenter Grid.Column="1" Content="{Binding DoorManager}"/>
|
||||
<ContentPresenter Grid.Column="1" Grid.Row="1" Content="{Binding DoorParameters}"/>
|
||||
<ContentPresenter Grid.Column="2" Grid.RowSpan="2" Content="{Binding SceneManager}"/>
|
||||
|
||||
<EgtDOORCreator:AssemblyManagerV Grid.Column="0" DataContext="{StaticResource AssemblyManagerVM}"/>
|
||||
<ContentControl Grid.Column="0" Grid.Row="1" Content="{Binding PageControl}"/>
|
||||
<EgtDOORCreator:SceneManagerV Grid.Column="1" Grid.RowSpan="2" DataContext="{StaticResource SceneManagerVM}"/>
|
||||
|
||||
</Grid>
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
Imports EgtWPFLib5
|
||||
|
||||
Class MainWindowV
|
||||
|
||||
Public Sub Me_ContentRendered() Handles Me.ContentRendered
|
||||
' se è assente la chiave di protezione non mostro la finestra Launcher
|
||||
If Map.refSceneManagerVM.bProtectKey Then
|
||||
Map.refMainWindowVM.SetLauncher()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub EgtCustomWindow_Loaded(sender As Object, e As RoutedEventArgs) Handles Me.Loaded
|
||||
Dim rfMainWindowVM As MainWindowVM = DirectCast(Me.DataContext, MainWindowVM)
|
||||
' Posizione e dimensioni del Form
|
||||
Dim WinPos As New WinPos
|
||||
GetPrivateProfileWinPos(S_GENERAL, K_WINPLACE, WinPos.nFlag, WinPos.nLeft, WinPos.nTop, WinPos.nWidth, WinPos.nHeight)
|
||||
rfMainWindowVM.WinPosToWindow(Me, WinPos)
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
@@ -3,11 +3,10 @@ Imports System.ComponentModel
|
||||
Imports System.IO
|
||||
Imports EgtWPFLib5
|
||||
|
||||
Public Class MainWindowViewModel
|
||||
Public Class MainWindowVM
|
||||
Implements INotifyPropertyChanged
|
||||
' Modello del MainWindow (classe vera e propria)
|
||||
Private m_MainWindowModel As New MainWindowModel
|
||||
Friend m_rfSceneManagerViewModel As SceneManagerViewModel
|
||||
|
||||
Private m_ProjectNameMsg As String
|
||||
Public Property ProjectNameMsg As String
|
||||
@@ -20,82 +19,67 @@ Public Class MainWindowViewModel
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_CompoPanel As CompoPanelView
|
||||
Public ReadOnly Property CompoPanel As CompoPanelView
|
||||
Get
|
||||
If IsNothing(m_CompoPanel) Then
|
||||
m_CompoPanel = New CompoPanelView
|
||||
m_CompoPanel.DataContext = New CompoPanelViewModel(Me)
|
||||
End If
|
||||
Return m_CompoPanel
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_Launcher As LauncherView
|
||||
Public ReadOnly Property Launcher As LauncherView
|
||||
Private m_Launcher As LauncherV
|
||||
Public ReadOnly Property Launcher As LauncherV
|
||||
Get
|
||||
If IsNothing(m_Launcher) Then
|
||||
m_Launcher = New LauncherView
|
||||
m_Launcher.DataContext = New LauncherViewModel(Me)
|
||||
m_Launcher = New LauncherV
|
||||
m_Launcher.DataContext = New LauncherVM(Me)
|
||||
End If
|
||||
Return m_Launcher
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_ProjectManagerViewModel As ProjectManagerViewModel
|
||||
Public ReadOnly Property ProjectManagerViewModel As ProjectManagerViewModel
|
||||
Enum ListPageEnum As Integer
|
||||
nNothingSelected
|
||||
nAssemblyPage
|
||||
nDDFPage
|
||||
End Enum
|
||||
|
||||
Private m_SelectedPage As ListPageEnum
|
||||
Public Property SelectedPage As ListPageEnum
|
||||
Get
|
||||
If IsNothing(m_ProjectManagerViewModel) Then
|
||||
m_ProjectManagerViewModel = New ProjectManagerViewModel(Me)
|
||||
End If
|
||||
Return m_ProjectManagerViewModel
|
||||
Return m_SelectedPage
|
||||
End Get
|
||||
Set(value As ListPageEnum)
|
||||
m_SelectedPage = value
|
||||
NotifyPropertyChanged("PageControl")
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_DoorManager As DoorManagerView
|
||||
Public ReadOnly Property DoorManager As DoorManagerView
|
||||
Private m_PartPage As PartPageV
|
||||
Private m_AssemblyPage As AssemblyPageV
|
||||
Public ReadOnly Property PageControl As ContentControl
|
||||
Get
|
||||
If IsNothing(m_DoorManager) Then
|
||||
m_DoorManager = New DoorManagerView(New DoorManagerViewModel(Me))
|
||||
End If
|
||||
Return m_DoorManager
|
||||
If m_SelectedPage = ListPageEnum.nDDFPage Then
|
||||
Return m_PartPage
|
||||
ElseIf m_SelectedPage = ListPageEnum.nAssemblyPage Then
|
||||
Return m_AssemblyPage
|
||||
Else
|
||||
Return Nothing
|
||||
End If
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_DoorParameters As DoorParametersView
|
||||
Public ReadOnly Property DoorParameters As DoorParametersView
|
||||
Get
|
||||
If IsNothing(m_DoorParameters) Then
|
||||
m_DoorParameters = New DoorParametersView
|
||||
m_DoorParameters.DataContext = New DoorParametersViewModel(Me)
|
||||
End If
|
||||
Return m_DoorParameters
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_SceneManager As SceneManagerView
|
||||
Public ReadOnly Property SceneManager As SceneManagerView
|
||||
Get
|
||||
If IsNothing(m_SceneManager) Then
|
||||
m_SceneManager = New SceneManagerView
|
||||
m_SceneManager.DataContext = New SceneManagerViewModel(Me)
|
||||
End If
|
||||
Return m_SceneManager
|
||||
End Get
|
||||
|
||||
End Property
|
||||
|
||||
Private m_AboutBox As Window
|
||||
Private bFirstAboutBox As Boolean = True
|
||||
Public ReadOnly Property AboutBox As Window
|
||||
Get
|
||||
If bFirstAboutBox Then
|
||||
m_AboutBox = New AboutBoxView()
|
||||
m_AboutBox = New AboutBoxV()
|
||||
End If
|
||||
Return New AboutBoxView
|
||||
Return New AboutBoxV
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Sub New()
|
||||
Map.SetRefMainWindowVM(Me)
|
||||
m_AssemblyPage = New AssemblyPageV
|
||||
m_AssemblyPage.DataContext = New AssemblyPageVM
|
||||
m_PartPage = New PartPageV
|
||||
m_PartPage.DataContext = New PartPageVM
|
||||
End Sub
|
||||
|
||||
' MainWindow Closing Event
|
||||
Private m_cmdClose As ICommand
|
||||
|
||||
@@ -103,11 +87,11 @@ Public Class MainWindowViewModel
|
||||
Select Case OptionModule.m_OptionLauncherList.IndexOf(OptionModule.m_SelectedOptionLauncher)
|
||||
Case 0
|
||||
' apre la finestra
|
||||
Dim Launcher As New LauncherView
|
||||
Dim Launcher As New LauncherV
|
||||
Launcher.Height = 200
|
||||
Launcher.Width = 250
|
||||
LauncherModule.InitLauncherModule()
|
||||
Launcher.DataContext = New LauncherViewModel(Me)
|
||||
Launcher.DataContext = New LauncherVM(Me)
|
||||
Launcher.Owner = Application.Current.MainWindow
|
||||
Launcher.ShowDialog()
|
||||
Case 1
|
||||
@@ -116,7 +100,7 @@ Public Class MainWindowViewModel
|
||||
Exit Select
|
||||
Else
|
||||
' apro l'ultimo progetto
|
||||
Me.ProjectManagerViewModel.OpenLastProject()
|
||||
Map.refProjectManagerVM.OpenLastProject()
|
||||
End If
|
||||
' non fa assolutamente nulla
|
||||
End Select
|
||||
@@ -208,27 +192,28 @@ Public Class MainWindowViewModel
|
||||
' Application.Msn.NotifyColleagues(Application.SAVECURRENTMACHINE)
|
||||
|
||||
' aggiorno file DDF grafico (CurrDoor.ddf)
|
||||
If Not IsNothing(DirectCast(Me.DoorParameters.DataContext, DoorParametersViewModel).CurrDoor) Then
|
||||
DdfFile.WriteDDF(DirectCast(Me.DoorParameters.DataContext, DoorParametersViewModel).CurrDoor, IniFile.m_sTempDir & "\" & TEMP_FILE, True)
|
||||
Dim SelDoor As String = DirectCast(Me.DoorManager.DataContext, DoorManagerViewModel).SelectedDoor
|
||||
''If Not DdfFile.ComparisonFileDDF(IniFile.m_sTempDir & "\CurrDoor.ddf", SelDoor) Then
|
||||
If Not DdfFile.SetModify(Me) Then
|
||||
' se la risposta è di non salavre non faccio nulla
|
||||
Dim QuestionSave As String = String.Format(EgtMsg(50152), Path.GetFileNameWithoutExtension(SelDoor))
|
||||
Dim Result As MessageBoxResult
|
||||
Result = MessageBox.Show(QuestionSave, EgtMsg(50110), MessageBoxButton.YesNoCancel, MessageBoxImage.Warning)
|
||||
If Result = MessageBoxResult.Cancel Then
|
||||
Return
|
||||
ElseIf (Result = MessageBoxResult.Yes) Then
|
||||
' altrimenti sovrascrivo il DDF
|
||||
DdfFile.WriteDDF(DirectCast(Me.DoorParameters.DataContext, DoorParametersViewModel).CurrDoor, SelDoor, True)
|
||||
ElseIf (Result = MessageBoxResult.No AndAlso DirectCast(Me.DoorParameters.DataContext, DoorParametersViewModel).CurrDoor.NewDoor = True) Then
|
||||
DirectCast(Me.DoorManager.DataContext, DoorManagerViewModel).RemoveDoor()
|
||||
End If
|
||||
End If
|
||||
If Not IsNothing(Map.refAssemblyPageVM.CurrAssembly) Then
|
||||
'DdfFile.WriteDDF(Map.refPartPageVM.CurrPart, IniFile.m_sTempDir & "\" & TEMP_FILE, True)
|
||||
'Dim SelDoor As String = Map.refAssemblyManagerVM.SelectedAssembly.Name
|
||||
' ''If Not DdfFile.ComparisonFileDDF(IniFile.m_sTempDir & "\CurrDoor.ddf", SelDoor) Then
|
||||
'If Not DdfFile.SetModify(Me) Then
|
||||
'' se la risposta è di non salavre non faccio nulla
|
||||
'Dim QuestionSave As String = String.Format(EgtMsg(50152), Path.GetFileNameWithoutExtension(SelDoor))
|
||||
'Dim Result As MessageBoxResult
|
||||
'Result = MessageBox.Show(QuestionSave, EgtMsg(50110), MessageBoxButton.YesNoCancel, MessageBoxImage.Warning)
|
||||
'If Result = MessageBoxResult.Cancel Then
|
||||
' Return
|
||||
'ElseIf (Result = MessageBoxResult.Yes) Then
|
||||
' ' altrimenti sovrascrivo il DDF
|
||||
' DdfFile.WriteDDF(Map.refPartPageVM.CurrPart, SelDoor, True)
|
||||
'ElseIf (Result = MessageBoxResult.No AndAlso Map.refPartPageVM.CurrPart.NewPart = True) Then
|
||||
' Map.refAssemblyManagerVM.RemoveAssembly()
|
||||
'End If
|
||||
'End If
|
||||
' scrivo il nome dell'ultimo file aperto
|
||||
If Not IsNothing(Me.ProjectManagerViewModel.m_CurrProject) Then
|
||||
IniFile.WritePrivateProfileString(S_LAUNCHERWINDOW, K_LASTPROJECT, Me.ProjectManagerViewModel.m_CurrProject.Name)
|
||||
If Not Map.refAssemblyManagerVM.SaveCurrentAssembly() Then Return
|
||||
If Not IsNothing(Map.refProjectManagerVM.m_CurrProject) Then
|
||||
IniFile.WritePrivateProfileString(S_LAUNCHERWINDOW, K_LASTPROJECT, Map.refProjectManagerVM.m_CurrProject.Name)
|
||||
End If
|
||||
End If
|
||||
|
||||
@@ -0,0 +1,174 @@
|
||||
Module Map
|
||||
|
||||
Private m_refMainWindowVM As MainWindowVM
|
||||
Private m_refStatusBarVM As StatusBarVM
|
||||
Private m_refProjectManagerVM As ProjectManagerVM
|
||||
Private m_refCompoPanelVM As CompoPanelVM
|
||||
Private m_refAssemblyManagerVM As AssemblyManagerVM
|
||||
Private m_refPartPageVM As PartPageVM
|
||||
Private m_refSceneManagerVM As SceneManagerVM
|
||||
|
||||
Private m_refInstrumentPanelVM As InstrumentPanelVM
|
||||
Private m_refPopUpViewPanelVM As PopUpViewPanelVM
|
||||
Private m_refRefreshPanelVM As RefreshPanelVM
|
||||
Private m_refShowPanelVM As ShowPanelVM
|
||||
|
||||
Private m_refAssemblyPageVM As AssemblyPageVM
|
||||
|
||||
#Region "Get"
|
||||
|
||||
Public ReadOnly Property refMainWindowVM As MainWindowVM
|
||||
Get
|
||||
Return m_refMainWindowVM
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property refStatusBarVM As StatusBarVM
|
||||
Get
|
||||
Return m_refStatusBarVM
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property refProjectManagerVM As ProjectManagerVM
|
||||
Get
|
||||
Return m_refProjectManagerVM
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property refCompoPanelVM As CompoPanelVM
|
||||
Get
|
||||
Return m_refCompoPanelVM
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property refAssemblyManagerVM As AssemblyManagerVM
|
||||
Get
|
||||
Return m_refAssemblyManagerVM
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property refPartPageVM As PartPageVM
|
||||
Get
|
||||
Return m_refPartPageVM
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property refSceneManagerVM As SceneManagerVM
|
||||
Get
|
||||
Return m_refSceneManagerVM
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property refInstrumentPanelVM As InstrumentPanelVM
|
||||
Get
|
||||
Return m_refInstrumentPanelVM
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property refPopUpViewPanelVM As PopUpViewPanelVM
|
||||
Get
|
||||
Return m_refPopUpViewPanelVM
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property refRefreshPanelVM As RefreshPanelVM
|
||||
Get
|
||||
Return m_refRefreshPanelVM
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property refShowPanelVM As ShowPanelVM
|
||||
Get
|
||||
Return m_refShowPanelVM
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property refAssemblyPageVM As AssemblyPageVM
|
||||
Get
|
||||
Return m_refAssemblyPageVM
|
||||
End Get
|
||||
End Property
|
||||
|
||||
#End Region ' Get
|
||||
|
||||
#Region "Set"
|
||||
|
||||
Friend Function SetRefMainWindowVM(MainWindowVM As MainWindowVM) As Boolean
|
||||
m_refMainWindowVM = MainWindowVM
|
||||
Return Not IsNothing(m_refMainWindowVM)
|
||||
End Function
|
||||
|
||||
Friend Function SetRefStatusBarVM(StatusBarVM As StatusBarVM) As Boolean
|
||||
m_refStatusBarVM = StatusBarVM
|
||||
Return Not IsNothing(m_refStatusBarVM)
|
||||
End Function
|
||||
|
||||
Friend Function SetRefProjectManagerVM(ProjectManagerVM As ProjectManagerVM) As Boolean
|
||||
m_refProjectManagerVM = ProjectManagerVM
|
||||
Return Not IsNothing(m_refProjectManagerVM)
|
||||
End Function
|
||||
|
||||
Friend Function SetRefCompoPanelVM(CompoPanelVM As CompoPanelVM) As Boolean
|
||||
m_refCompoPanelVM = CompoPanelVM
|
||||
Return Not IsNothing(m_refCompoPanelVM)
|
||||
End Function
|
||||
|
||||
Friend Function SetRefDoorManagerVM(DoorManagerVM As AssemblyManagerVM) As Boolean
|
||||
m_refAssemblyManagerVM = DoorManagerVM
|
||||
Return Not IsNothing(m_refAssemblyManagerVM)
|
||||
End Function
|
||||
|
||||
Friend Function SetRefDoorParametersVM(DoorParametersVM As PartPageVM) As Boolean
|
||||
m_refPartPageVM = DoorParametersVM
|
||||
Return Not IsNothing(m_refPartPageVM)
|
||||
End Function
|
||||
|
||||
Friend Function SetRefSceneManagerVM(SceneManagerVM As SceneManagerVM) As Boolean
|
||||
m_refSceneManagerVM = SceneManagerVM
|
||||
Return Not IsNothing(m_refSceneManagerVM)
|
||||
End Function
|
||||
|
||||
Friend Function SetRefInstrumentPanelVM(InstrumentPanelVM As InstrumentPanelVM) As Boolean
|
||||
m_refInstrumentPanelVM = InstrumentPanelVM
|
||||
Return Not IsNothing(m_refInstrumentPanelVM)
|
||||
End Function
|
||||
|
||||
Friend Function SetRefPopUpViewPanelVM(PopUpViewPanelVM As PopUpViewPanelVM) As Boolean
|
||||
m_refPopUpViewPanelVM = PopUpViewPanelVM
|
||||
Return Not IsNothing(m_refPopUpViewPanelVM)
|
||||
End Function
|
||||
|
||||
Friend Function SetRefRefreshPanelVM(RefreshPanelVM As RefreshPanelVM) As Boolean
|
||||
m_refRefreshPanelVM = RefreshPanelVM
|
||||
Return Not IsNothing(m_refRefreshPanelVM)
|
||||
End Function
|
||||
|
||||
Friend Function SetRefShowPanelVM(ShowPanelVM As ShowPanelVM) As Boolean
|
||||
m_refShowPanelVM = ShowPanelVM
|
||||
Return Not IsNothing(m_refShowPanelVM)
|
||||
End Function
|
||||
|
||||
Friend Function SetRefJambPageVM(JambPageVM As AssemblyPageVM) As Boolean
|
||||
m_refAssemblyPageVM = JambPageVM
|
||||
Return Not IsNothing(m_refAssemblyPageVM)
|
||||
End Function
|
||||
|
||||
#End Region ' Set
|
||||
|
||||
#Region "Init"
|
||||
|
||||
Friend Function BeginInit(MainWindowVM As MainWindowVM) As Boolean
|
||||
m_refMainWindowVM = MainWindowVM
|
||||
Return Not IsNothing(m_refMainWindowVM)
|
||||
End Function
|
||||
Friend Function EndInit() As Boolean
|
||||
' Verifico se tutti i pezzi necessari sono stati caricati
|
||||
Return Not IsNothing(m_refMainWindowVM) AndAlso Not IsNothing(m_refStatusBarVM) AndAlso
|
||||
Not IsNothing(m_refProjectManagerVM) AndAlso Not IsNothing(m_refCompoPanelVM) AndAlso
|
||||
Not IsNothing(m_refAssemblyManagerVM) AndAlso Not IsNothing(m_refPartPageVM) AndAlso
|
||||
Not IsNothing(m_refSceneManagerVM)
|
||||
|
||||
End Function
|
||||
|
||||
#End Region ' Init
|
||||
End Module
|
||||
@@ -72,5 +72,5 @@ Imports System.Windows
|
||||
' by using the '*' as shown below:
|
||||
' <Assembly: AssemblyVersion("1.0.*")>
|
||||
|
||||
<Assembly: AssemblyVersion("1.8.9.1")>
|
||||
<Assembly: AssemblyFileVersion("1.8.9.1")>
|
||||
<Assembly: AssemblyVersion("1.8.11.1")>
|
||||
<Assembly: AssemblyFileVersion("1.8.11.1")>
|
||||
|
||||
@@ -47,6 +47,44 @@ Friend Module OptionModule
|
||||
Friend m_TopOverMaterial As String
|
||||
Friend m_BottomOverMaterial As String
|
||||
|
||||
Friend m_SwingTypeListSinlgeDoor As New List(Of String)
|
||||
Friend m_SwingTypeListLeftDoor As New List(Of String)
|
||||
Friend m_SwingTypeListRightDoor As New List(Of String)
|
||||
|
||||
Friend m_ThicknessJamb As String
|
||||
Friend m_WidthJamb As String
|
||||
Friend m_LightUp As String
|
||||
Friend m_LightLock As String
|
||||
Friend m_LightHinge As String
|
||||
Friend m_LightBottom As String
|
||||
Friend m_ThicknessHead As String
|
||||
Friend m_OverlapLock As String
|
||||
Friend m_OverlapHinge As String
|
||||
Friend m_Exterior As Boolean
|
||||
Friend m_OverlapTop As String
|
||||
Friend m_DeltaThickness As String
|
||||
Friend m_DoorsListNumber As New List(Of String)
|
||||
Friend m_DoorsNumber As String
|
||||
|
||||
Friend m_TopJambChk As Boolean
|
||||
Friend m_LeftJambChk As Boolean
|
||||
Friend m_BottomJambChk As Boolean
|
||||
Friend m_RightJambChk As Boolean
|
||||
|
||||
Friend m_LockEdgeTypeAssembly As New EdgeType("", Visibility.Visible)
|
||||
Friend m_HingeEdgeTypeAssembly As New EdgeType("", Visibility.Visible)
|
||||
Friend m_TopTypeAssembly As New EdgeType("", Visibility.Visible)
|
||||
Friend m_BottomTypeAssembly As New EdgeType("", Visibility.Visible)
|
||||
|
||||
Friend m_LockEdgeMachiningAssembly As Boolean
|
||||
Friend m_HingeEdgeMachiningAssembly As Boolean
|
||||
Friend m_TopMachiningAssembly As Boolean
|
||||
Friend m_BottomMachiningAssembly As Boolean
|
||||
Friend m_LockEdgeOverMaterialAssembly As String
|
||||
Friend m_HingeEdgeOverMaterialAssembly As String
|
||||
Friend m_TopOverMaterialAssembly As String
|
||||
Friend m_BottomOverMaterialAssembly As String
|
||||
|
||||
Friend m_CompoPaneOrder As List(Of String) = New List(Of String)
|
||||
|
||||
' inizializzazione lettura variabili ad inizio programma
|
||||
@@ -71,7 +109,7 @@ Friend Module OptionModule
|
||||
Dim sMsgFilePath As String = sMsgDir & "\EgalTechEng.txt"
|
||||
For Each Language In OptionModule.m_LanguageList
|
||||
If Language.Name = sMsgName Then
|
||||
GuideView.m_Language = sMsgName
|
||||
GuideV.m_Language = sMsgName
|
||||
OptionModule.m_SelectedLanguage = Language
|
||||
sMsgFilePath = sMsgDir & "\" & Language.FilePath
|
||||
End If
|
||||
@@ -152,49 +190,47 @@ Friend Module OptionModule
|
||||
Dim Swing As String = String.Empty
|
||||
DefaultGetPrivateProfileString(S_SIZE, K_SWING_INI, "RH", Swing)
|
||||
m_Swing = Swing
|
||||
LoadSwingList()
|
||||
Dim Weight As String = String.Empty
|
||||
DefaultGetPrivateProfileString(S_SIZE, K_WEIGHT_INI, "25", Weight)
|
||||
m_Weight = Weight
|
||||
Dim WeightVisibility As Visibility = Visibility.Collapsed
|
||||
DefaultGetPrivateProfilesVisibility(S_SIZE, K_WEIGHTISCHECKED_INI, WeightVisibility)
|
||||
Door.IsCheckedWeight = WeightVisibility
|
||||
Part.IsCheckedWeight = WeightVisibility
|
||||
|
||||
' carico il valori associati al tipo di spigolo
|
||||
Dim EdgeTypeList As New ObservableCollection(Of String)
|
||||
DefaultGetPrivateProfileObservableCollection(S_EDGE, K_EDGETYPE_LIST_INI, EdgeTypeList)
|
||||
'For Index = 0 To EdgeTypeList.Count - 1
|
||||
' Door.m_EdgeTypeList.Add(New EdgeType(EdgeTypeList(Index), True))
|
||||
'Next
|
||||
m_StaticEdgeTypeList = EdgeTypeList
|
||||
OptionsViewModel.CreateEdgeTypeList()
|
||||
OptionsVM.CreateEdgeTypeList()
|
||||
|
||||
' carico i valori associati agli spigoli
|
||||
Dim LockEdgeType As String = String.Empty
|
||||
DefaultGetPrivateProfileString(S_EDGE, K_LOCKEDGE, "", LockEdgeType)
|
||||
For Index = 0 To OptionsViewModel.EdgeTypeList.Count - 1
|
||||
If OptionsViewModel.EdgeTypeList(Index).Name = LockEdgeType Then
|
||||
m_LockEdgeType = OptionsViewModel.EdgeTypeList(Index)
|
||||
For Index = 0 To OptionsVM.EdgeTypeList.Count - 1
|
||||
If OptionsVM.EdgeTypeList(Index).Name = LockEdgeType Then
|
||||
m_LockEdgeType = OptionsVM.EdgeTypeList(Index)
|
||||
End If
|
||||
Next
|
||||
Dim HingeEdgeType As String = String.Empty
|
||||
DefaultGetPrivateProfileString(S_EDGE, K_HINGEDGE_INI, "SQ", HingeEdgeType)
|
||||
For Index = 0 To OptionsViewModel.EdgeTypeList.Count - 1
|
||||
If OptionsViewModel.EdgeTypeList(Index).Name = HingeEdgeType Then
|
||||
m_HingeEdgeType = OptionsViewModel.EdgeTypeList(Index)
|
||||
For Index = 0 To OptionsVM.EdgeTypeList.Count - 1
|
||||
If OptionsVM.EdgeTypeList(Index).Name = HingeEdgeType Then
|
||||
m_HingeEdgeType = OptionsVM.EdgeTypeList(Index)
|
||||
End If
|
||||
Next
|
||||
Dim TopType As String = String.Empty
|
||||
DefaultGetPrivateProfileString(S_EDGE, K_TOPEDGE_INI, "SQ", TopType)
|
||||
For Index = 0 To OptionsViewModel.EdgeTypeList.Count - 1
|
||||
If OptionsViewModel.EdgeTypeList(Index).Name = TopType Then
|
||||
m_TopType = OptionsViewModel.EdgeTypeList(Index)
|
||||
For Index = 0 To OptionsVM.EdgeTypeList.Count - 1
|
||||
If OptionsVM.EdgeTypeList(Index).Name = TopType Then
|
||||
m_TopType = OptionsVM.EdgeTypeList(Index)
|
||||
End If
|
||||
Next
|
||||
Dim BottomType As String = String.Empty
|
||||
DefaultGetPrivateProfileString(S_EDGE, K_BOTTOMEDGE_INI, "SQ", BottomType)
|
||||
For Index = 0 To OptionsViewModel.EdgeTypeList.Count - 1
|
||||
If OptionsViewModel.EdgeTypeList(Index).Name = BottomType Then
|
||||
m_BottomType = OptionsViewModel.EdgeTypeList(Index)
|
||||
For Index = 0 To OptionsVM.EdgeTypeList.Count - 1
|
||||
If OptionsVM.EdgeTypeList(Index).Name = BottomType Then
|
||||
m_BottomType = OptionsVM.EdgeTypeList(Index)
|
||||
End If
|
||||
Next
|
||||
|
||||
@@ -228,6 +264,118 @@ Friend Module OptionModule
|
||||
DefaultGetPrivateProfileList(S_COMPOORDER, K_COMPOORDER_INI, DdfFile.CompoListOrder)
|
||||
' carico l'ordinamento dei bottoni
|
||||
DefaultGetPrivateProfileList(S_COMPOORDER, K_COMPOORDER_INI, m_CompoPaneOrder)
|
||||
'-----------------------------------------------------------------------------------------------------------------
|
||||
'i valori della pagina dell'assemblato
|
||||
Dim ThicknessJamb As String = String.Empty
|
||||
DefaultGetPrivateProfileString(S_SIZEJAMB, K_THICKNESS, "25", ThicknessJamb)
|
||||
m_ThicknessJamb = ThicknessJamb
|
||||
Dim WidthJamb As String = String.Empty
|
||||
DefaultGetPrivateProfileString(S_SIZEJAMB, K_WIDTH, "25", WidthJamb)
|
||||
m_WidthJamb = WidthJamb
|
||||
|
||||
Dim LightUp As String = String.Empty
|
||||
DefaultGetPrivateProfileString(S_LIGHT, K_LIGHTUP, "25", LightUp)
|
||||
m_LightUp = LightUp
|
||||
Dim LightLock As String = String.Empty
|
||||
DefaultGetPrivateProfileString(S_LIGHT, K_LIGHTLOCK, "25", LightLock)
|
||||
m_LightLock = LightLock
|
||||
Dim LightHinge As String = String.Empty
|
||||
DefaultGetPrivateProfileString(S_LIGHT, K_LIGHTHINGE, "25", LightHinge)
|
||||
m_LightHinge = LightHinge
|
||||
Dim LightBottom As String = String.Empty
|
||||
DefaultGetPrivateProfileString(S_LIGHT, K_LIGHTBOTTOM, "25", LightBottom)
|
||||
m_LightBottom = LightBottom
|
||||
DefaultGetPrivateProfileList(S_DOORSNUMBER, K_DOORSLISTNUMBER, m_DoorsListNumber)
|
||||
Dim DoorsNumber As String = String.Empty
|
||||
DefaultGetPrivateProfileString(S_DOORSNUMBER, K_DOORSELECTEDTNUMBER, "0", DoorsNumber)
|
||||
m_DoorsNumber = DoorsNumber
|
||||
Dim ThicknessHead As String = String.Empty
|
||||
DefaultGetPrivateProfileString(S_OVERLAP, K_THICKNESSHEAD, "0", ThicknessHead)
|
||||
m_ThicknessHead = ThicknessHead
|
||||
Dim OverlapHinge As String = String.Empty
|
||||
DefaultGetPrivateProfileString(S_OVERLAP, K_OVERLAPHINGE, "0", OverlapHinge)
|
||||
m_OverlapHinge = OverlapHinge
|
||||
Dim OverlapLock As String = String.Empty
|
||||
DefaultGetPrivateProfileString(S_OVERLAP, K_OVERLAPLOCK, "0", OverlapLock)
|
||||
m_OverlapLock = OverlapLock
|
||||
Dim Exterior As Boolean = False
|
||||
DefaultGetPrivateProfilesMachining(S_OVERLAP, K_EXTERIOR, Exterior)
|
||||
m_Exterior = Exterior
|
||||
Dim OverlapTop As String = String.Empty
|
||||
DefaultGetPrivateProfileString(S_OVERLAP, K_OVERLAPTOP, "0", OverlapTop)
|
||||
m_OverlapTop = OverlapTop
|
||||
Dim DeltaT As String = String.Empty
|
||||
DefaultGetPrivateProfileString(S_OVERLAP, K_DELTAT, "0", DeltaT)
|
||||
m_DeltaThickness = DeltaT
|
||||
|
||||
Dim TopChk As Boolean = False
|
||||
DefaultGetPrivateProfilesMachining(S_PART, K_TOPJAMB, TopChk)
|
||||
m_TopJambChk = TopChk
|
||||
Dim LeftChk As Boolean = False
|
||||
DefaultGetPrivateProfilesMachining(S_PART, K_LEFTJAMB, LeftChk)
|
||||
m_LeftJambChk = LeftChk
|
||||
Dim BottomChk As Boolean = False
|
||||
DefaultGetPrivateProfilesMachining(S_PART, K_BOTTOMJAMB, BottomChk)
|
||||
m_BottomJambChk = BottomChk
|
||||
Dim RightChk As Boolean = False
|
||||
DefaultGetPrivateProfilesMachining(S_PART, K_RIGHTJAMB, RightChk)
|
||||
m_RightJambChk = RightChk
|
||||
|
||||
Dim LockEdgeTypeAss As String = String.Empty
|
||||
DefaultGetPrivateProfileString(S_EDGEASSEMBLY, K_LOCKEDGE, "", LockEdgeTypeAss)
|
||||
For Index = 0 To OptionsVM.EdgeTypeList.Count - 1
|
||||
If OptionsVM.EdgeTypeList(Index).Name = LockEdgeTypeAss Then
|
||||
m_LockEdgeTypeAssembly = OptionsVM.EdgeTypeList(Index)
|
||||
End If
|
||||
Next
|
||||
Dim HingeEdgeTypeAss As String = String.Empty
|
||||
DefaultGetPrivateProfileString(S_EDGEASSEMBLY, K_HINGEDGE_INI, "SQ", HingeEdgeTypeAss)
|
||||
For Index = 0 To OptionsVM.EdgeTypeList.Count - 1
|
||||
If OptionsVM.EdgeTypeList(Index).Name = HingeEdgeTypeAss Then
|
||||
m_HingeEdgeTypeAssembly = OptionsVM.EdgeTypeList(Index)
|
||||
End If
|
||||
Next
|
||||
Dim TopTypeAss As String = String.Empty
|
||||
DefaultGetPrivateProfileString(S_EDGEASSEMBLY, K_TOPEDGE_INI, "SQ", TopTypeAss)
|
||||
For Index = 0 To OptionsVM.EdgeTypeList.Count - 1
|
||||
If OptionsVM.EdgeTypeList(Index).Name = TopTypeAss Then
|
||||
m_TopTypeAssembly = OptionsVM.EdgeTypeList(Index)
|
||||
End If
|
||||
Next
|
||||
Dim BottomTypeAss As String = String.Empty
|
||||
DefaultGetPrivateProfileString(S_EDGEASSEMBLY, K_BOTTOMEDGE_INI, "SQ", BottomTypeAss)
|
||||
For Index = 0 To OptionsVM.EdgeTypeList.Count - 1
|
||||
If OptionsVM.EdgeTypeList(Index).Name = BottomTypeAss Then
|
||||
m_BottomTypeAssembly = OptionsVM.EdgeTypeList(Index)
|
||||
End If
|
||||
Next
|
||||
|
||||
' Carico i valori booleani associati alla lavorazione
|
||||
Dim LockEdgeMachiningAss As Boolean = False
|
||||
DefaultGetPrivateProfilesMachining(S_MACHININGASSEMBLY, K_LOCKEDGEISCHECKED_INI, LockEdgeMachiningAss)
|
||||
m_LockEdgeMachiningAssembly = LockEdgeMachiningAss
|
||||
Dim HingeEdgeMachiningAss As Boolean = False
|
||||
DefaultGetPrivateProfilesMachining(S_MACHININGASSEMBLY, K_HINGEDGEEISCHECKED_INI, HingeEdgeMachiningAss)
|
||||
m_HingeEdgeMachiningAssembly = HingeEdgeMachiningAss
|
||||
Dim TopMachiningAss As Boolean = False
|
||||
DefaultGetPrivateProfilesMachining(S_MACHININGASSEMBLY, K_TOPISCHECKED_INI, TopMachiningAss)
|
||||
m_TopMachiningAssembly = TopMachiningAss
|
||||
Dim BottomMachiningAss As Boolean = False
|
||||
DefaultGetPrivateProfilesMachining(S_MACHININGASSEMBLY, K_BOTTOMISCHECKED_INI, BottomMachiningAss)
|
||||
m_BottomMachiningAssembly = BottomMachiningAss
|
||||
' carico i valori di overmaterial
|
||||
Dim LockEdgeOverMaterialAss As String = String.Empty
|
||||
DefaultGetPrivateProfileString(S_OVERMATERIALASSEMBLY, K_LOCKEDGEOVERMATERIAL_INI, "", LockEdgeOverMaterialAss)
|
||||
m_LockEdgeOverMaterialAssembly = LockEdgeOverMaterialAss
|
||||
Dim HingeEdgeOverMaterialAss As String = String.Empty
|
||||
DefaultGetPrivateProfileString(S_OVERMATERIALASSEMBLY, K_HINGEDGEOVERMATERIAL_INI, "", HingeEdgeOverMaterialAss)
|
||||
m_HingeEdgeOverMaterialAssembly = HingeEdgeOverMaterialAss
|
||||
Dim TopOverMaterialAss As String = String.Empty
|
||||
DefaultGetPrivateProfileString(S_OVERMATERIALASSEMBLY, K_TOPOVERMATERIAL_INI, "", TopOverMaterialAss)
|
||||
m_TopOverMaterialAssembly = TopOverMaterialAss
|
||||
Dim BottomOverMaterialAss As String = String.Empty
|
||||
DefaultGetPrivateProfileString(S_OVERMATERIALASSEMBLY, K_BOTTOMOVERMATERIAL_INI, "", BottomOverMaterialAss)
|
||||
m_BottomOverMaterialAssembly = BottomOverMaterialAss
|
||||
|
||||
m_OptionLauncherList.Add(EgtMsg(50206))
|
||||
m_OptionLauncherList.Add(EgtMsg(50207))
|
||||
@@ -246,6 +394,18 @@ Friend Module OptionModule
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub LoadSwingList()
|
||||
For Index As Integer = 0 To 3
|
||||
m_SwingTypeListSinlgeDoor.Add(m_SwingTypeList(Index))
|
||||
Next
|
||||
For Index As Integer = 4 To 7
|
||||
m_SwingTypeListLeftDoor.Add(m_SwingTypeList(Index))
|
||||
Next
|
||||
For Index As Integer = 8 To 11
|
||||
m_SwingTypeListRightDoor.Add(m_SwingTypeList(Index))
|
||||
Next
|
||||
End Sub
|
||||
|
||||
End Module
|
||||
|
||||
' Classe che identifica una lingua del programma con nome e path del file dei messaggi
|
||||
|
||||
@@ -0,0 +1,661 @@
|
||||
<EgtWPFLib5:EgtCustomWindow x:Class="OptionsV"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:EgtWPFLib5="clr-namespace:EgtWPFLib5;assembly=EgtWPFLib5"
|
||||
Title="{Binding Title}" Icon="/Resources/EgtDOOR.ico"
|
||||
TitleBarBrush="{StaticResource EgaltechBlue1}"
|
||||
BorderBrush="{StaticResource EgaltechBlue1}"
|
||||
WindowStyle="None" ResizeMode="NoResize" TitleBarHeight="30" IsResizable="False"
|
||||
IsMinimizable="False" WindowStartupLocation="CenterScreen" ShowInTaskbar="False"
|
||||
CloseCommand="{Binding CloseOptionsCommand,Mode=OneWay,UpdateSourceTrigger=PropertyChanged}">
|
||||
|
||||
<EgtWPFLib5:EgtCustomWindow.InputBindings>
|
||||
<KeyBinding Key="F1" Command="{Binding OptionGuideCmd}"/>
|
||||
</EgtWPFLib5:EgtCustomWindow.InputBindings>
|
||||
|
||||
|
||||
<Grid Margin="3,3,3,3">
|
||||
|
||||
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="4*"/>
|
||||
<RowDefinition Height="5.5*"/>
|
||||
<RowDefinition Height="1.5*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<!--Seclta della lingua-->
|
||||
<GroupBox Header="{Binding CurrentLanguageMsg}">
|
||||
<UniformGrid Rows="2">
|
||||
<ComboBox ItemsSource="{Binding LanguageList, Mode=OneWay}"
|
||||
DisplayMemberPath="Name" SelectedItem="{Binding SelectedLanguage}"
|
||||
Style="{StaticResource DoorParamsCmBx}"
|
||||
Margin="5,0,5,0"/>
|
||||
<TextBlock Text="{Binding LanguageAdvertMsg}" TextWrapping="Wrap"
|
||||
TextAlignment="Center" Margin="5,0,5,0"/>
|
||||
</UniformGrid>
|
||||
</GroupBox>
|
||||
<!--Impostazioni generali della porta-->
|
||||
<TabControl Grid.Row="1" Grid.ColumnSpan="4">
|
||||
<TabItem Header="{Binding DoorMsg}">
|
||||
<GroupBox Header="{Binding General}" Grid.Row="1" Grid.ColumnSpan="4">
|
||||
<Grid >
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
</Grid.RowDefinitions>
|
||||
<Border BorderBrush="Gainsboro" BorderThickness="1" Grid.Column="2" Grid.ColumnSpan="4"
|
||||
Grid.RowSpan="5" Margin="5,0,5,0" CornerRadius="3"/>
|
||||
|
||||
|
||||
<TextBlock Grid.Column="3" Grid.Row="0" Text="{Binding EdgeMsg}" VerticalAlignment="Center"
|
||||
Style="{StaticResource DoorParamsTxBl}" Margin="5,0,5,0"/>
|
||||
<TextBlock Grid.Column="4" Grid.Row="0" Grid.ColumnSpan="2" Text="{Binding OverMaterialMsg}" VerticalAlignment="Center"
|
||||
Style="{StaticResource DoorParamsTxBl}" Margin="5,0,5,0"/>
|
||||
|
||||
<TextBlock Grid.Column="0" Grid.Row="0" Text="{Binding WidthMsg}" VerticalAlignment="Center"
|
||||
Style="{StaticResource DoorParamsTxBl}"/>
|
||||
<TextBox Grid.Column="1" Grid.Row="0" Text="{Binding WidthValue}"
|
||||
Style="{StaticResource DoorParamsTxBx}"
|
||||
Margin="5,0,30,5"/>
|
||||
<TextBlock Grid.Column="0" Grid.Row="1" Text="{Binding HeightMsg}" VerticalAlignment="Center"
|
||||
Style="{StaticResource DoorParamsTxBl}"/>
|
||||
<TextBox Grid.Column="1" Grid.Row="1" Text="{Binding HeightValue}"
|
||||
Style="{StaticResource DoorParamsTxBx}"
|
||||
Margin="5,0,30,5"/>
|
||||
<TextBlock Grid.Column="0" Grid.Row="2" Text="{Binding ThicknessMsg}" VerticalAlignment="Center"
|
||||
Style="{StaticResource DoorParamsTxBl}"/>
|
||||
<TextBox Grid.Column="1" Grid.Row="2" Text="{Binding ThicknessValue}"
|
||||
Style="{StaticResource DoorParamsTxBx}"
|
||||
Margin="5,0,30,5"/>
|
||||
<TextBlock Grid.Column="0" Grid.Row="3" Text="{Binding SwingMsg}" VerticalAlignment="Center"
|
||||
Style="{StaticResource DoorParamsTxBl}"/>
|
||||
<ComboBox Grid.Column="1" Grid.Row="3"
|
||||
ItemsSource="{Binding SwingTypeList}"
|
||||
SelectedItem="{Binding SwingValue}"
|
||||
Style="{StaticResource DoorParamsCmBx}"
|
||||
Margin="5,0,30,5"/>
|
||||
|
||||
<TextBlock Grid.Row="4" Text="{Binding WeightMsg}"
|
||||
Style="{StaticResource DoorParamsTxBl}"
|
||||
VerticalAlignment="Center"/>
|
||||
<Grid Grid.Row="4" Grid.Column="1" >
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height=" 1*"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<CheckBox Grid.Column="1"
|
||||
IsChecked="{Binding IsCheckedWeight}"
|
||||
Name="Weight"
|
||||
Margin="0,0,5,5"
|
||||
Style="{StaticResource DoorParamsChBx}" />
|
||||
<TextBox Style="{StaticResource DoorParamsTxBx}"
|
||||
Text="{Binding WeightValue, UpdateSourceTrigger=PropertyChanged}"
|
||||
Margin="5,0,10,5"
|
||||
IsEnabled="{Binding IsChecked, ElementName=Weight}"/>
|
||||
</Grid>
|
||||
|
||||
<TextBlock Grid.Column="2" Grid.Row="1" Text="{Binding LockEdgeMsg}" VerticalAlignment="Center"
|
||||
Style="{StaticResource DoorParamsTxBl}" Margin="20,0,5,0"/>
|
||||
<ComboBox Grid.Column="3" Grid.Row="1"
|
||||
ItemsSource="{Binding EdgeTypeList}"
|
||||
SelectedItem="{Binding Path=LockEdgeType}"
|
||||
Style="{StaticResource DoorEdgeParamsCmBx}"
|
||||
Margin="5,0,40,5"/>
|
||||
<TextBlock Grid.Column="2" Grid.Row="2" Text="{Binding HingeEdgeMsg}" VerticalAlignment="Center"
|
||||
Style="{StaticResource DoorParamsTxBl}" Margin="20,0,5,0"/>
|
||||
<ComboBox Grid.Column="3" Grid.Row="2"
|
||||
ItemsSource="{Binding EdgeTypeList}"
|
||||
SelectedItem="{Binding Path=HingeEdgeType}"
|
||||
Style="{StaticResource DoorEdgeParamsCmBx}"
|
||||
Margin="5,0,40,5"/>
|
||||
<TextBlock Grid.Column="2" Grid.Row="3" Text="{Binding TopMsg}" VerticalAlignment="Center"
|
||||
Style="{StaticResource DoorParamsTxBl}" Margin="20,0,5,0"/>
|
||||
<ComboBox Grid.Column="3" Grid.Row="3"
|
||||
ItemsSource="{Binding EdgeTypeList}"
|
||||
SelectedItem="{Binding Path=TopType}"
|
||||
Style="{StaticResource DoorEdgeParamsCmBx}"
|
||||
Margin="5,0,40,5"/>
|
||||
<TextBlock Grid.Column="2" Grid.Row="4" Text="{Binding BottomMsg}" VerticalAlignment="Center"
|
||||
Style="{StaticResource DoorParamsTxBl}" Margin="20,0,5,0"/>
|
||||
<ComboBox Grid.Column="3" Grid.Row="4"
|
||||
ItemsSource="{Binding EdgeTypeList}"
|
||||
SelectedItem="{Binding Path=BottomType}"
|
||||
Style="{StaticResource DoorEdgeParamsCmBx}"
|
||||
Margin="5,0,40,5"/>
|
||||
<CheckBox Grid.Column="4" Grid.Row="1" Name="LockEdge"
|
||||
HorizontalAlignment="Center" VerticalAlignment="Center"
|
||||
IsChecked="{Binding LockEdgeIsChecked}"
|
||||
Style="{StaticResource DoorParamsChBx}"
|
||||
Margin="5,0,5,5"/>
|
||||
<CheckBox Grid.Column="4" Grid.Row="2" Name="HingeEdge"
|
||||
HorizontalAlignment="Center" VerticalAlignment="Center"
|
||||
IsChecked="{Binding HingeEdgeIsChecked}"
|
||||
Style="{StaticResource DoorParamsChBx}"
|
||||
Margin="5,0,5,5"/>
|
||||
<CheckBox Grid.Column="4" Grid.Row="3" Name="TopEdge"
|
||||
HorizontalAlignment="Center" VerticalAlignment="Center"
|
||||
IsChecked="{Binding TopIsChecked}"
|
||||
Style="{StaticResource DoorParamsChBx}"
|
||||
Margin="5,0,5,5"/>
|
||||
<CheckBox Grid.Column="4" Grid.Row="4" Name="BottomEdge"
|
||||
HorizontalAlignment="Center" VerticalAlignment="Center"
|
||||
IsChecked="{Binding BottomIsChecked}"
|
||||
Style="{StaticResource DoorParamsChBx}"
|
||||
Margin="5,0,5,5"/>
|
||||
|
||||
<TextBox Grid.Column="5" Grid.Row="1" Text="{Binding LockEdgeOverMaterialValue}"
|
||||
IsEnabled ="{Binding IsChecked, ElementName=LockEdge}"
|
||||
Style="{StaticResource DoorParamsTxBx}"
|
||||
Margin="5,0,30,5"/>
|
||||
<TextBox Grid.Column="5" Grid.Row="2" Text="{Binding HingeEdgeOverMaterialValue}"
|
||||
IsEnabled ="{Binding IsChecked, ElementName=HingeEdge}"
|
||||
Style="{StaticResource DoorParamsTxBx}"
|
||||
Margin="5,0,30,5"/>
|
||||
<TextBox Grid.Column="5" Grid.Row="3" Text="{Binding TopOverMaterialValue}"
|
||||
IsEnabled ="{Binding IsChecked, ElementName=TopEdge}"
|
||||
Style="{StaticResource DoorParamsTxBx}"
|
||||
Margin="5,0,30,5"/>
|
||||
<TextBox Grid.Column="5" Grid.Row="4" Text="{Binding BottomOverMaterialValue}"
|
||||
IsEnabled ="{Binding IsChecked, ElementName=BottomEdge}"
|
||||
Style="{StaticResource DoorParamsTxBx}"
|
||||
Margin="5,0,30,5"/>
|
||||
</Grid>
|
||||
</GroupBox>
|
||||
</TabItem>
|
||||
<TabItem Header="{Binding AssemblyMsg}">
|
||||
<GroupBox Header="Frame" Margin="2,0,2,0" >
|
||||
<Grid Margin="0,0,0,2">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<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*"/>
|
||||
</Grid.RowDefinitions>
|
||||
<!--UP-->
|
||||
<TextBlock Grid.Row="0" Text="{Binding LightUpMsg}"
|
||||
Style="{StaticResource DoorParamsTxBl}"
|
||||
Margin="2,2,0,2"
|
||||
Grid.Column="0"/>
|
||||
<TextBox Grid.Column="1" Grid.Row="0" Style="{StaticResource DoorParamsTxBx}"
|
||||
Text="{Binding LightUp, UpdateSourceTrigger=PropertyChanged}"
|
||||
Padding="1"
|
||||
Margin="5,2.5,10,2.5" VerticalAlignment="Stretch"/>
|
||||
<!--Lock-->
|
||||
<TextBlock Grid.Row="1" Text="{Binding LightLockMsg}"
|
||||
Style="{StaticResource DoorParamsTxBl}"
|
||||
Margin="2,0,0,2"
|
||||
Grid.Column="0"/>
|
||||
<TextBox Grid.Column="1" Grid.Row="1" Style="{StaticResource DoorParamsTxBx}"
|
||||
Text="{Binding LightLock, UpdateSourceTrigger=PropertyChanged}"
|
||||
Margin="5,0,10,2.5" VerticalAlignment="Stretch"
|
||||
Padding="1"/>
|
||||
<!--Hinge-->
|
||||
<TextBlock Grid.Row="2" Text="{Binding LightHingeMsg}"
|
||||
Style="{StaticResource DoorParamsTxBl}"
|
||||
Margin="2,0,0,2"
|
||||
Grid.Column="0"/>
|
||||
<TextBox Grid.Column="1" Grid.Row="2" Style="{StaticResource DoorParamsTxBx}"
|
||||
Text="{Binding LightHinge, UpdateSourceTrigger=PropertyChanged}"
|
||||
Padding="1"
|
||||
Margin="5,0,10,2.5" VerticalAlignment="Stretch"/>
|
||||
<!--Bottom-->
|
||||
<TextBlock Grid.Row="3" Text="{Binding LightBottomMsg}"
|
||||
Style="{StaticResource DoorParamsTxBl}"
|
||||
Margin="2,0,0,2"
|
||||
Grid.Column="0"/>
|
||||
<TextBox Grid.Column="1" Grid.Row="3" Style="{StaticResource DoorParamsTxBx}"
|
||||
Text="{Binding LightBottom, UpdateSourceTrigger=PropertyChanged}"
|
||||
Padding="1"
|
||||
Margin="5,0,10,2.5" VerticalAlignment="Stretch"/>
|
||||
<!--ThhicknessHead-->
|
||||
<TextBlock Grid.Row="0" Text="{Binding ThicknessHeadMsg}"
|
||||
Style="{StaticResource DoorParamsTxBl}"
|
||||
Margin="2,2,0,2"
|
||||
Grid.Column="2"/>
|
||||
<TextBox Grid.Row="0" Grid.Column="3"
|
||||
Style="{StaticResource DoorParamsTxBx}"
|
||||
Padding="1"
|
||||
Text="{Binding ThicknessHead, UpdateSourceTrigger=PropertyChanged}"
|
||||
Margin="5,2.5,10,2.5" VerticalAlignment="Stretch"/>
|
||||
<!--OverlapHinge-->
|
||||
<TextBlock Grid.Row="1" Text="{Binding OverlapHingeMsg}"
|
||||
Style="{StaticResource DoorParamsTxBl}"
|
||||
Margin="2,0,0,2"
|
||||
Grid.Column="2"/>
|
||||
<TextBox Grid.Row="1" Grid.Column="3"
|
||||
Style="{StaticResource DoorParamsTxBx}"
|
||||
Padding="1"
|
||||
Text="{Binding OverlapHinge, UpdateSourceTrigger=PropertyChanged}"
|
||||
Margin="5,2.5,10,2.5" VerticalAlignment="Stretch"/>
|
||||
<!--OverlapLock-->
|
||||
<TextBlock Grid.Row="2" Text="{Binding OverlapLockMsg}"
|
||||
Style="{StaticResource DoorParamsTxBl}"
|
||||
Margin="2,0,0,2"
|
||||
Grid.Column="2"/>
|
||||
<TextBox Grid.Row="2" Grid.Column="3"
|
||||
Style="{StaticResource DoorParamsTxBx}"
|
||||
Padding="1"
|
||||
Text="{Binding OverlapLock, UpdateSourceTrigger=PropertyChanged}"
|
||||
Margin="5,2.5,10,2.5" VerticalAlignment="Stretch"/>
|
||||
<!--DoorsNumber-->
|
||||
<TextBlock Grid.Row="4" Grid.Column="0" Text="{Binding DoorNumberMsg}"
|
||||
Style="{StaticResource DoorParamsTxBl}"
|
||||
Margin="2,0,0,2"/>
|
||||
<ComboBox Grid.Row="4" Grid.Column="1" Margin="5,2.5,10,2.5"
|
||||
ItemsSource="{Binding DoorListNumber}"
|
||||
SelectedItem="{Binding DoorNumber}"
|
||||
Style="{StaticResource DoorParamsCmBx}"/>
|
||||
<!--Height-->
|
||||
<TextBlock Grid.Row="3" Text="{Binding ThicknessMsg}"
|
||||
Style="{StaticResource DoorParamsTxBl}"
|
||||
Margin="2,0,0,2"
|
||||
Grid.Column="2"/>
|
||||
<TextBox Grid.Row="3" Grid.Column="3"
|
||||
Style="{StaticResource DoorParamsTxBx}"
|
||||
Padding="1"
|
||||
Text="{Binding ThicknessJamb, UpdateSourceTrigger=PropertyChanged}"
|
||||
Margin="5,2.5,10,2.5" VerticalAlignment="Stretch"/>
|
||||
<!--Width-->
|
||||
<TextBlock Grid.Row="4" Text="{Binding WidthMsg}"
|
||||
Style="{StaticResource DoorParamsTxBl}"
|
||||
Margin="2,0,0,2"
|
||||
Grid.Column="2"/>
|
||||
<TextBox Grid.Row="4" Grid.Column="3"
|
||||
Style="{StaticResource DoorParamsTxBx}"
|
||||
Padding="1"
|
||||
Text="{Binding WidthJamb, UpdateSourceTrigger=PropertyChanged}"
|
||||
Margin="5,2.5,10,2.5" VerticalAlignment="Stretch"/>
|
||||
<!--titolo-->
|
||||
<TextBlock Grid.Column="5" Grid.Row="0"
|
||||
Text="{Binding EdgeMsg}"
|
||||
VerticalAlignment="Center"
|
||||
Style="{StaticResource DoorParamsTxBl}"
|
||||
Margin="2,0,5,0"/>
|
||||
<TextBlock Grid.Column="6" Grid.Row="0"
|
||||
Grid.ColumnSpan="3"
|
||||
Text="{Binding OverMaterialMsg}"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
Style="{StaticResource DoorParamsTxBl}"
|
||||
Margin="2,0,5,0"/>
|
||||
|
||||
<TextBlock Grid.Column="4" Grid.Row="1" Text="{Binding LockEdgeMsg}"
|
||||
Style="{StaticResource DoorParamsTxBl}"
|
||||
Margin="2,0,0,2" />
|
||||
<ComboBox Grid.Column="5" Grid.Row="1"
|
||||
ItemsSource="{Binding EdgeTypeList}"
|
||||
SelectedItem="{Binding LockEdgeTypeAssembly}"
|
||||
Style="{StaticResource DoorEdgeParamsCmBx}"
|
||||
Margin="5,2.5,10,2.5"/>
|
||||
|
||||
<TextBlock Grid.Column="4" Grid.Row="2"
|
||||
Text="{Binding HingeEdgeMsg}"
|
||||
Style="{StaticResource DoorParamsTxBl}"
|
||||
Margin="2,0,0,2" />
|
||||
<ComboBox Grid.Column="5" Grid.Row="2"
|
||||
ItemsSource="{Binding EdgeTypeList}"
|
||||
SelectedItem="{Binding HingeEdgeTypeAssembly}"
|
||||
Style="{StaticResource DoorEdgeParamsCmBx}"
|
||||
Margin="5,2.5,10,2.5">
|
||||
</ComboBox>
|
||||
|
||||
<TextBlock Grid.Column="4" Grid.Row="3"
|
||||
Text="{Binding TopMsg}"
|
||||
Style="{StaticResource DoorParamsTxBl}"
|
||||
Margin="2,0,0,2" />
|
||||
<ComboBox Grid.Column="5" Grid.Row="3"
|
||||
ItemsSource="{Binding EdgeTypeList}"
|
||||
SelectedItem="{Binding TopTypeAssembly}"
|
||||
Style="{StaticResource DoorEdgeParamsCmBx}"
|
||||
Margin="5,2.5,10,2.5"/>
|
||||
|
||||
<TextBlock Grid.Column="4" Grid.Row="4"
|
||||
Text="{Binding BottomMsg}"
|
||||
Style="{StaticResource DoorParamsTxBl}"
|
||||
Margin="2,0,0,2" />
|
||||
<ComboBox Grid.Column="5" Grid.Row="4"
|
||||
ItemsSource="{Binding EdgeTypeList}"
|
||||
SelectedItem="{Binding BottomTypeAssembly}"
|
||||
Style="{StaticResource DoorEdgeParamsCmBx}"
|
||||
Margin="5,2.5,10,2.5"/>
|
||||
|
||||
<!--Machining-->
|
||||
<CheckBox Grid.Column="6" Grid.Row="1"
|
||||
Name="LockEdgeAssembly" Style="{StaticResource DoorParamsChBx}"
|
||||
IsChecked="{Binding LockEdgeMachiningAssembly}"
|
||||
/>
|
||||
<CheckBox Grid.Column="6" Grid.Row="2"
|
||||
Name="HingeEdgeAssembly" Style="{StaticResource DoorParamsChBx}"
|
||||
IsChecked="{Binding HingeEdgeMachiningAssembly}"
|
||||
/>
|
||||
<CheckBox Grid.Column="6" Grid.Row="3"
|
||||
Name="TopAssembly" Style="{StaticResource DoorParamsChBx}"
|
||||
IsChecked="{Binding TopMachiningAssembly}"
|
||||
/>
|
||||
<CheckBox Grid.Column="6" Grid.Row="4"
|
||||
Name="BottomAssembly" Style="{StaticResource DoorParamsChBx}"
|
||||
IsChecked="{Binding BottomMachiningAssembly}"
|
||||
/>
|
||||
|
||||
<TextBox Grid.Column="7" Grid.Row="1" Style="{StaticResource DoorParamsTxBx}"
|
||||
Text="{Binding LockEdgeOverMaterialAssembly, UpdateSourceTrigger=PropertyChanged}"
|
||||
IsEnabled="{Binding IsChecked, ElementName=LockEdgeAssembly}"
|
||||
Padding="1"
|
||||
Margin="5,2.5,10,2.5"/>
|
||||
<TextBox Grid.Column="7" Grid.Row="2" Style="{StaticResource DoorParamsTxBx}"
|
||||
Text="{Binding HingeEdgeOverMaterialAssembly, UpdateSourceTrigger=PropertyChanged}"
|
||||
IsEnabled="{Binding IsChecked, ElementName=HingeEdgeAssembly}"
|
||||
Padding="1"
|
||||
Margin="5,2.5,10,2.5"/>
|
||||
<TextBox Grid.Column="7" Grid.Row="3" Style="{StaticResource DoorParamsTxBx}"
|
||||
Text="{Binding TopOverMaterialAssembly, UpdateSourceTrigger=PropertyChanged}"
|
||||
IsEnabled="{Binding IsChecked, ElementName=TopAssembly}"
|
||||
Padding="1"
|
||||
Margin="5,2.5,10,2.5"/>
|
||||
<TextBox Grid.Column="7" Grid.Row="4" Style="{StaticResource DoorParamsTxBx}"
|
||||
Text="{Binding BottomOverMaterialAssembly, UpdateSourceTrigger=PropertyChanged}"
|
||||
IsEnabled="{Binding IsChecked, ElementName=BottomAssembly}"
|
||||
Padding="1"
|
||||
Margin="5,2.5,10,2.5"/>
|
||||
|
||||
<GroupBox Grid.Row="5" Grid.ColumnSpan="8" Margin="2,-4,2,-4">
|
||||
<GroupBox.Header>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<CheckBox Name="Exterior"
|
||||
Style="{StaticResource DoorParamsChBx}"
|
||||
IsChecked="{Binding Exterior}"
|
||||
Margin="0,0,2,0" VerticalAlignment="Stretch" Height="Auto"/>
|
||||
<TextBlock Text="{Binding ExteriorMsg}" Width="Auto"/>
|
||||
</StackPanel>
|
||||
</GroupBox.Header>
|
||||
|
||||
</GroupBox>
|
||||
<TextBlock Text="{Binding OverlapTopMsg}"
|
||||
Style="{StaticResource DoorParamsTxBl}"
|
||||
Margin="2,0,0,0"
|
||||
Grid.Row="5"
|
||||
Grid.Column="1"/>
|
||||
<TextBox Grid.Column="2" Grid.Row="5"
|
||||
Style="{StaticResource DoorParamsTxBx}"
|
||||
IsEnabled="{Binding IsChecked,ElementName=Exterior}"
|
||||
Text="{Binding OverlapTop, UpdateSourceTrigger=PropertyChanged}"
|
||||
Margin="5,2.5,10,0.5" VerticalAlignment="Stretch" />
|
||||
<TextBlock Text="{Binding DeltaTMsg}"
|
||||
Style="{StaticResource DoorParamsTxBl}"
|
||||
Margin="2,0,0,0"
|
||||
Grid.Row="5"
|
||||
Grid.Column="3"/>
|
||||
<TextBox Grid.Column="4" Grid.Row="5"
|
||||
Style="{StaticResource DoorParamsTxBx}"
|
||||
IsEnabled="{Binding IsChecked,ElementName=Exterior}"
|
||||
Text="{Binding DeltaThickness, UpdateSourceTrigger=PropertyChanged}"
|
||||
Margin="5,2.5,10,0.5" VerticalAlignment="Stretch"/>
|
||||
</Grid>
|
||||
</GroupBox>
|
||||
</TabItem>
|
||||
</TabControl>
|
||||
|
||||
<!--Seclta del'unità dei misura-->
|
||||
<GroupBox Header="{Binding CurrentUnitMeasure}" Grid.Column="1" Margin="5,0,5,0">
|
||||
<UniformGrid Rows="2">
|
||||
<ComboBox ItemsSource="{Binding MeasureUnitList}" SelectedItem="{Binding SelectedMeasureUnit}"
|
||||
Grid.Column="1" VerticalAlignment="Center"
|
||||
Style="{StaticResource DoorParamsCmBx}"
|
||||
Margin="5,0,5,0"/>
|
||||
<TextBlock Text="{Binding MeasureUnit}" TextWrapping="Wrap"
|
||||
TextAlignment="Center" Margin="5,0,5,0"/>
|
||||
</UniformGrid>
|
||||
</GroupBox>
|
||||
<!--Seclta della modalità di avvio del programma-->
|
||||
<GroupBox Header="{Binding OptionStart}" Grid.Column="2">
|
||||
<UniformGrid Rows="2">
|
||||
|
||||
<ComboBox ItemsSource="{Binding OptionLauncher}" SelectedItem="{Binding SelectedOptionLauncher}"
|
||||
VerticalAlignment="Center"
|
||||
Style="{StaticResource DoorParamsCmBx}"
|
||||
Margin="5,0,5,0"/>
|
||||
<TextBlock Text="{Binding StartUpMsg}" TextWrapping="Wrap"
|
||||
TextAlignment="Center" Margin="5,0,5,0"/>
|
||||
</UniformGrid>
|
||||
</GroupBox>
|
||||
|
||||
<!--Scelta posizionamento macchina-->
|
||||
<GroupBox Header="{Binding BevelMsg}" Grid.Column="3" >
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="5*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="2*"/>
|
||||
<RowDefinition Height="2*"/>
|
||||
<RowDefinition Height="4*"/>
|
||||
</Grid.RowDefinitions>
|
||||
<CheckBox HorizontalAlignment="Center" VerticalAlignment="Center"
|
||||
Name="BevelUp"
|
||||
Style="{StaticResource DoorParamsChBx}"
|
||||
IsChecked="{Binding BevelUpIsChecked}"/>
|
||||
<TextBlock Text="{Binding BevelUpMsg}" Grid.Column="1"
|
||||
VerticalAlignment="Center"/>
|
||||
<CheckBox Grid.Row="1" HorizontalAlignment="Center" VerticalAlignment="Center"
|
||||
Name="BevelDown"
|
||||
Style="{StaticResource DoorParamsChBx}"
|
||||
IsChecked="{Binding BevelDownIsChecked}"/>
|
||||
<TextBlock Text="{Binding BevelDownMsg}" Grid.Column="1" Grid.Row="1"
|
||||
VerticalAlignment="Center"/>
|
||||
<TextBlock Text="{Binding MachinePositionMsg}" Grid.Column="0" Grid.ColumnSpan="2" Grid.Row="2"
|
||||
TextWrapping="Wrap" TextAlignment="Center" Margin="5,0,5,0"/>
|
||||
</Grid>
|
||||
</GroupBox>
|
||||
|
||||
<!--Seclta della cartella in cui salvare i progetti-->
|
||||
<GroupBox Header="{Binding CurrentDirectiry}" Grid.Row="2" Grid.ColumnSpan="4" Margin="5,0,5,0">
|
||||
<Grid >
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="3*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="1*"/>
|
||||
</Grid.RowDefinitions>
|
||||
<TextBlock Text="{Binding DirectoryMsg}" Grid.Column="0" Margin="2,5,5,0"
|
||||
Style="{StaticResource DoorParamsTxBl}"/>
|
||||
<TextBlock Text="{Binding MyProjectDir}" Grid.Column="1" Margin="2,5,5,0"
|
||||
Style="{StaticResource DoorParamsTxBl}"/>
|
||||
<Button Content="{Binding MsgBrowse}" Grid.Column="2"
|
||||
Command="{Binding BrowseCommand}" Margin="5"/>
|
||||
</Grid>
|
||||
</GroupBox>
|
||||
<!--Bottone di chiusura della pagina-->
|
||||
<Button Content="{Binding MsgClose}" Grid.Row="3" Grid.Column="3" Margin="5"
|
||||
Command="{Binding CloseOptionsCommand}"/>
|
||||
|
||||
<!--<GroupBox Header="{Binding CurrentLanguageMsg}" Margin="0,0,0.4,423.6" Grid.RowSpan="3" >
|
||||
|
||||
<UniformGrid Rows="2">
|
||||
<ComboBox ItemsSource="{Binding LanguageList, Mode=OneWay}"
|
||||
DisplayMemberPath="Name" SelectedItem="{Binding SelectedLanguage}"
|
||||
Style="{StaticResource DoorParamsCmBx}"
|
||||
Margin="5,0,5,0"/>
|
||||
<TextBlock Text="{Binding LanguageAdvertMsg}" TextWrapping="Wrap"
|
||||
TextAlignment="Center" Margin="5,0,5,0"/>
|
||||
</UniformGrid>
|
||||
</GroupBox>
|
||||
|
||||
<GroupBox Grid.Column="1" Header="{Binding General}" Margin="0.6,0,-0.4,423.6" Grid.RowSpan="3">
|
||||
<Grid >
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<TextBlock Grid.Column="0" Grid.Row="0" Text="{Binding WidthMsg}" VerticalAlignment="Center"
|
||||
Style="{StaticResource DoorParamsTxBl}"/>
|
||||
<TextBox Grid.Column="1" Grid.Row="0" Text="{Binding WidthValue}"
|
||||
Style="{StaticResource DoorParamsTxBx}"
|
||||
Margin="5,0,5,0"/>
|
||||
<TextBlock Grid.Column="0" Grid.Row="1" Text="{Binding HeightMsg}" VerticalAlignment="Center"
|
||||
Style="{StaticResource DoorParamsTxBl}"/>
|
||||
<TextBox Grid.Column="1" Grid.Row="1" Text="{Binding HeightValue}"
|
||||
Style="{StaticResource DoorParamsTxBx}"
|
||||
Margin="5,0,5,0"/>
|
||||
<TextBlock Grid.Column="0" Grid.Row="2" Text="{Binding ThicknessMsg}" VerticalAlignment="Center"
|
||||
Style="{StaticResource DoorParamsTxBl}"/>
|
||||
<TextBox Grid.Column="1" Grid.Row="2" Text="{Binding ThicknessValue}"
|
||||
Style="{StaticResource DoorParamsTxBx}"
|
||||
Margin="5,0,5,0"/>
|
||||
<TextBlock Grid.Column="0" Grid.Row="3" Text="{Binding SwingMsg}" VerticalAlignment="Center"
|
||||
Style="{StaticResource DoorParamsTxBl}"/>
|
||||
<ComboBox Grid.Column="1" Grid.Row="3"
|
||||
ItemsSource="{Binding SwingTypeList}"
|
||||
SelectedItem="{Binding SwingValue}"
|
||||
Style="{StaticResource DoorParamsCmBx}"
|
||||
Margin="5,0,5,0"/>
|
||||
|
||||
<TextBlock Grid.Column="2" Grid.Row="0" Text="{Binding LockEdgeMsg}" VerticalAlignment="Center"
|
||||
Style="{StaticResource DoorParamsTxBl}"/>
|
||||
<ComboBox Grid.Column="3" Grid.Row="0"
|
||||
ItemsSource="{Binding EdgeTypeList}"
|
||||
SelectedItem="{Binding LockEdgeType}"
|
||||
Style="{StaticResource DoorParamsCmBx}"
|
||||
Margin="5,0,5,0"/>
|
||||
|
||||
<TextBlock Grid.Column="2" Grid.Row="1" Text="{Binding HingeEdgeMsg}" VerticalAlignment="Center"
|
||||
Style="{StaticResource DoorParamsTxBl}"/>
|
||||
<ComboBox Grid.Column="3" Grid.Row="1"
|
||||
ItemsSource="{Binding EdgeTypeList}"
|
||||
SelectedItem="{Binding HingeEdgeType}"
|
||||
Style="{StaticResource DoorParamsCmBx}"
|
||||
Margin="5,0,5,0"/>
|
||||
<TextBlock Grid.Column="2" Grid.Row="2" Text="{Binding TopMsg}" VerticalAlignment="Center"
|
||||
Style="{StaticResource DoorParamsTxBl}"/>
|
||||
<ComboBox Grid.Column="3" Grid.Row="2"
|
||||
ItemsSource="{Binding EdgeTypeList}"
|
||||
SelectedItem="{Binding TopType}"
|
||||
Style="{StaticResource DoorParamsCmBx}"
|
||||
Margin="5,0,5,0"/>
|
||||
<TextBlock Grid.Column="2" Grid.Row="3" Text="{Binding BottomMsg}" VerticalAlignment="Center"
|
||||
Style="{StaticResource DoorParamsTxBl}"/>
|
||||
<ComboBox Grid.Column="3" Grid.Row="3"
|
||||
ItemsSource="{Binding EdgeTypeList}"
|
||||
SelectedItem="{Binding BottomType}"
|
||||
Style="{StaticResource DoorParamsCmBx}"
|
||||
Margin="5,0,5,0"/>
|
||||
|
||||
<CheckBox Grid.Column="4" Grid.Row="0" Name="LockEdge"
|
||||
HorizontalAlignment="Center" VerticalAlignment="Center"
|
||||
IsChecked="{Binding LockEdgeIsChecked}"
|
||||
Style="{StaticResource DoorParamsChBx}"
|
||||
Margin="5,0,5,0"/>
|
||||
<CheckBox Grid.Column="4" Grid.Row="1" Name="HingeEdge"
|
||||
HorizontalAlignment="Center" VerticalAlignment="Center"
|
||||
IsChecked="{Binding HingeEdgeIsChecked}"
|
||||
Style="{StaticResource DoorParamsChBx}"
|
||||
Margin="5,0,5,0"/>
|
||||
<CheckBox Grid.Column="4" Grid.Row="2" Name="TopEdge"
|
||||
HorizontalAlignment="Center" VerticalAlignment="Center"
|
||||
IsChecked="{Binding TopIsChecked}"
|
||||
Style="{StaticResource DoorParamsChBx}"
|
||||
Margin="5,0,5,0"/>
|
||||
<CheckBox Grid.Column="4" Grid.Row="3" Name="BottomEdge"
|
||||
HorizontalAlignment="Center" VerticalAlignment="Center"
|
||||
IsChecked="{Binding BottomIsChecked}"
|
||||
Style="{StaticResource DoorParamsChBx}"
|
||||
Margin="5,0,5,0"/>
|
||||
|
||||
<TextBox Grid.Column="5" Grid.Row="0" Text="{Binding LockEdgeOverMaterialValue}"
|
||||
IsEnabled ="{Binding IsChecked, ElementName=LockEdge}"
|
||||
Style="{StaticResource DoorParamsTxBx}"
|
||||
Margin="5,0,5,0"/>
|
||||
<TextBox Grid.Column="5" Grid.Row="1" Text="{Binding HingeEdgeOverMaterialValue}"
|
||||
IsEnabled ="{Binding IsChecked, ElementName=HingeEdge}"
|
||||
Style="{StaticResource DoorParamsTxBx}"
|
||||
Margin="5,0,5,0"/>
|
||||
<TextBox Grid.Column="5" Grid.Row="2" Text="{Binding TopOverMaterialValue}"
|
||||
IsEnabled ="{Binding IsChecked, ElementName=TopEdge}"
|
||||
Style="{StaticResource DoorParamsTxBx}"
|
||||
Margin="5,0,5,0"/>
|
||||
<TextBox Grid.Column="5" Grid.Row="3" Text="{Binding BottomOverMaterialValue}"
|
||||
IsEnabled ="{Binding IsChecked, ElementName=BottomEdge}"
|
||||
Style="{StaticResource DoorParamsTxBx}"
|
||||
Margin="5,0,5,0"/>
|
||||
</Grid>
|
||||
</GroupBox>
|
||||
|
||||
<GroupBox Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="2" Margin="0,0.4,0.4,-0.4" >
|
||||
<Grid >
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="1*"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<TextBlock Text="{Binding MeasureUnit}" VerticalAlignment="Center"
|
||||
Style="{StaticResource DoorParamsTxBl}"
|
||||
Margin="4,0,0,0"/>
|
||||
<ComboBox ItemsSource="{Binding MeasureUnitList}" SelectedItem="{Binding SelectedMeasureUnit}"
|
||||
Grid.Column="1" VerticalAlignment="Center"
|
||||
Style="{StaticResource DoorParamsCmBx}"
|
||||
Margin="5,0,5,0"/>
|
||||
|
||||
<TextBlock Text="{Binding StartUpMsg}" VerticalAlignment="Center"
|
||||
Style="{StaticResource DoorParamsTxBl}"
|
||||
Grid.Column="2" Margin="4,0,0,0"/>
|
||||
<ComboBox ItemsSource="{Binding OptionLauncher}" SelectedItem="{Binding SelectedOptionLauncher}"
|
||||
VerticalAlignment="Center"
|
||||
Style="{StaticResource DoorParamsCmBx}"
|
||||
Grid.Column="3" Margin="5,0,5,0"/>
|
||||
</Grid>
|
||||
</GroupBox>-->
|
||||
</Grid>
|
||||
|
||||
</EgtWPFLib5:EgtCustomWindow>
|
||||
@@ -1,413 +0,0 @@
|
||||
<EgtWPFLib5:EgtCustomWindow x:Class="OptionsView"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:EgtWPFLib5="clr-namespace:EgtWPFLib5;assembly=EgtWPFLib5"
|
||||
Title="{Binding Title}" Icon="/Resources/EgtDOOR.ico"
|
||||
TitleBarBrush="{StaticResource EgaltechBlue1}"
|
||||
BorderBrush="{StaticResource EgaltechBlue1}"
|
||||
WindowStyle="None" ResizeMode="NoResize" TitleBarHeight="30" IsResizable="False"
|
||||
IsMinimizable="False" WindowStartupLocation="CenterScreen" ShowInTaskbar="False"
|
||||
CloseCommand="{Binding CloseOptionsCommand,Mode=OneWay,UpdateSourceTrigger=PropertyChanged}">
|
||||
|
||||
<EgtWPFLib5:EgtCustomWindow.InputBindings>
|
||||
<KeyBinding Key="F1" Command="{Binding OptionGuideCmd}"/>
|
||||
</EgtWPFLib5:EgtCustomWindow.InputBindings>
|
||||
|
||||
|
||||
<Grid Margin="3,3,3,3">
|
||||
|
||||
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="4*"/>
|
||||
<RowDefinition Height="5*"/>
|
||||
<RowDefinition Height="1.5*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<!--Seclta della lingua-->
|
||||
<GroupBox Header="{Binding CurrentLanguageMsg}">
|
||||
<UniformGrid Rows="2">
|
||||
<ComboBox ItemsSource="{Binding LanguageList, Mode=OneWay}"
|
||||
DisplayMemberPath="Name" SelectedItem="{Binding SelectedLanguage}"
|
||||
Style="{StaticResource DoorParamsCmBx}"
|
||||
Margin="5,0,5,0"/>
|
||||
<TextBlock Text="{Binding LanguageAdvertMsg}" TextWrapping="Wrap"
|
||||
TextAlignment="Center" Margin="5,0,5,0"/>
|
||||
</UniformGrid>
|
||||
</GroupBox>
|
||||
<!--Impostazioni generali della porta-->
|
||||
<GroupBox Header="{Binding General}" Grid.Row="1" Grid.ColumnSpan="4">
|
||||
<Grid >
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
</Grid.RowDefinitions>
|
||||
<Border BorderBrush="Gainsboro" BorderThickness="1" Grid.Column="2" Grid.ColumnSpan="4"
|
||||
Grid.RowSpan="5" Margin="5,0,5,0" CornerRadius="3"/>
|
||||
|
||||
|
||||
<TextBlock Grid.Column="3" Grid.Row="0" Text="{Binding EdgeMsg}" VerticalAlignment="Center"
|
||||
Style="{StaticResource DoorParamsTxBl}" Margin="5,0,5,0"/>
|
||||
<TextBlock Grid.Column="4" Grid.Row="0" Grid.ColumnSpan="2" Text="{Binding OverMaterialMsg}" VerticalAlignment="Center"
|
||||
Style="{StaticResource DoorParamsTxBl}" Margin="5,0,5,0"/>
|
||||
|
||||
<TextBlock Grid.Column="0" Grid.Row="0" Text="{Binding WidthMsg}" VerticalAlignment="Center"
|
||||
Style="{StaticResource DoorParamsTxBl}"/>
|
||||
<TextBox Grid.Column="1" Grid.Row="0" Text="{Binding WidthValue}"
|
||||
Style="{StaticResource DoorParamsTxBx}"
|
||||
Margin="5,0,30,5"/>
|
||||
<TextBlock Grid.Column="0" Grid.Row="1" Text="{Binding HeightMsg}" VerticalAlignment="Center"
|
||||
Style="{StaticResource DoorParamsTxBl}"/>
|
||||
<TextBox Grid.Column="1" Grid.Row="1" Text="{Binding HeightValue}"
|
||||
Style="{StaticResource DoorParamsTxBx}"
|
||||
Margin="5,0,30,5"/>
|
||||
<TextBlock Grid.Column="0" Grid.Row="2" Text="{Binding ThicknessMsg}" VerticalAlignment="Center"
|
||||
Style="{StaticResource DoorParamsTxBl}"/>
|
||||
<TextBox Grid.Column="1" Grid.Row="2" Text="{Binding ThicknessValue}"
|
||||
Style="{StaticResource DoorParamsTxBx}"
|
||||
Margin="5,0,30,5"/>
|
||||
<TextBlock Grid.Column="0" Grid.Row="3" Text="{Binding SwingMsg}" VerticalAlignment="Center"
|
||||
Style="{StaticResource DoorParamsTxBl}"/>
|
||||
<ComboBox Grid.Column="1" Grid.Row="3"
|
||||
ItemsSource="{Binding SwingTypeList}"
|
||||
SelectedItem="{Binding SwingValue}"
|
||||
Style="{StaticResource DoorParamsCmBx}"
|
||||
Margin="5,0,30,5"/>
|
||||
|
||||
<TextBlock Grid.Row="4" Text="{Binding WeightMsg}"
|
||||
Style="{StaticResource DoorParamsTxBl}"
|
||||
VerticalAlignment="Center"/>
|
||||
<Grid Grid.Row="4" Grid.Column="1" >
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height=" 1*"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<CheckBox Grid.Column="1"
|
||||
IsChecked="{Binding IsCheckedWeight}"
|
||||
Name="Weight"
|
||||
Margin="0,0,5,5"
|
||||
Style="{StaticResource DoorParamsChBx}" />
|
||||
<TextBox Style="{StaticResource DoorParamsTxBx}"
|
||||
Text="{Binding WeightValue, UpdateSourceTrigger=PropertyChanged}"
|
||||
Margin="5,0,10,5"
|
||||
IsEnabled="{Binding IsChecked, ElementName=Weight}"/>
|
||||
</Grid>
|
||||
|
||||
<TextBlock Grid.Column="2" Grid.Row="1" Text="{Binding LockEdgeMsg}" VerticalAlignment="Center"
|
||||
Style="{StaticResource DoorParamsTxBl}" Margin="20,0,5,0"/>
|
||||
<ComboBox Grid.Column="3" Grid.Row="1"
|
||||
ItemsSource="{Binding EdgeTypeList}"
|
||||
SelectedItem="{Binding Path=LockEdgeType}"
|
||||
Style="{StaticResource DoorEdgeParamsCmBx}"
|
||||
Margin="5,0,40,5"/>
|
||||
<TextBlock Grid.Column="2" Grid.Row="2" Text="{Binding HingeEdgeMsg}" VerticalAlignment="Center"
|
||||
Style="{StaticResource DoorParamsTxBl}" Margin="20,0,5,0"/>
|
||||
<ComboBox Grid.Column="3" Grid.Row="2"
|
||||
ItemsSource="{Binding EdgeTypeList}"
|
||||
SelectedItem="{Binding Path=HingeEdgeType}"
|
||||
Style="{StaticResource DoorEdgeParamsCmBx}"
|
||||
Margin="5,0,40,5"/>
|
||||
<TextBlock Grid.Column="2" Grid.Row="3" Text="{Binding TopMsg}" VerticalAlignment="Center"
|
||||
Style="{StaticResource DoorParamsTxBl}" Margin="20,0,5,0"/>
|
||||
<ComboBox Grid.Column="3" Grid.Row="3"
|
||||
ItemsSource="{Binding EdgeTypeList}"
|
||||
SelectedItem="{Binding Path=TopType}"
|
||||
Style="{StaticResource DoorEdgeParamsCmBx}"
|
||||
Margin="5,0,40,5"/>
|
||||
<TextBlock Grid.Column="2" Grid.Row="4" Text="{Binding BottomMsg}" VerticalAlignment="Center"
|
||||
Style="{StaticResource DoorParamsTxBl}" Margin="20,0,5,0"/>
|
||||
<ComboBox Grid.Column="3" Grid.Row="4"
|
||||
ItemsSource="{Binding EdgeTypeList}"
|
||||
SelectedItem="{Binding Path=BottomType}"
|
||||
Style="{StaticResource DoorEdgeParamsCmBx}"
|
||||
Margin="5,0,40,5"/>
|
||||
<CheckBox Grid.Column="4" Grid.Row="1" Name="LockEdge"
|
||||
HorizontalAlignment="Center" VerticalAlignment="Center"
|
||||
IsChecked="{Binding LockEdgeIsChecked}"
|
||||
Style="{StaticResource DoorParamsChBx}"
|
||||
Margin="5,0,5,5"/>
|
||||
<CheckBox Grid.Column="4" Grid.Row="2" Name="HingeEdge"
|
||||
HorizontalAlignment="Center" VerticalAlignment="Center"
|
||||
IsChecked="{Binding HingeEdgeIsChecked}"
|
||||
Style="{StaticResource DoorParamsChBx}"
|
||||
Margin="5,0,5,5"/>
|
||||
<CheckBox Grid.Column="4" Grid.Row="3" Name="TopEdge"
|
||||
HorizontalAlignment="Center" VerticalAlignment="Center"
|
||||
IsChecked="{Binding TopIsChecked}"
|
||||
Style="{StaticResource DoorParamsChBx}"
|
||||
Margin="5,0,5,5"/>
|
||||
<CheckBox Grid.Column="4" Grid.Row="4" Name="BottomEdge"
|
||||
HorizontalAlignment="Center" VerticalAlignment="Center"
|
||||
IsChecked="{Binding BottomIsChecked}"
|
||||
Style="{StaticResource DoorParamsChBx}"
|
||||
Margin="5,0,5,5"/>
|
||||
|
||||
<TextBox Grid.Column="5" Grid.Row="1" Text="{Binding LockEdgeOverMaterialValue}"
|
||||
IsEnabled ="{Binding IsChecked, ElementName=LockEdge}"
|
||||
Style="{StaticResource DoorParamsTxBx}"
|
||||
Margin="5,0,30,5"/>
|
||||
<TextBox Grid.Column="5" Grid.Row="2" Text="{Binding HingeEdgeOverMaterialValue}"
|
||||
IsEnabled ="{Binding IsChecked, ElementName=HingeEdge}"
|
||||
Style="{StaticResource DoorParamsTxBx}"
|
||||
Margin="5,0,30,5"/>
|
||||
<TextBox Grid.Column="5" Grid.Row="3" Text="{Binding TopOverMaterialValue}"
|
||||
IsEnabled ="{Binding IsChecked, ElementName=TopEdge}"
|
||||
Style="{StaticResource DoorParamsTxBx}"
|
||||
Margin="5,0,30,5"/>
|
||||
<TextBox Grid.Column="5" Grid.Row="4" Text="{Binding BottomOverMaterialValue}"
|
||||
IsEnabled ="{Binding IsChecked, ElementName=BottomEdge}"
|
||||
Style="{StaticResource DoorParamsTxBx}"
|
||||
Margin="5,0,30,5"/>
|
||||
</Grid>
|
||||
</GroupBox>
|
||||
<!--Seclta del'unità dei misura-->
|
||||
<GroupBox Header="{Binding CurrentUnitMeasure}" Grid.Column="1" Margin="5,0,5,0">
|
||||
<UniformGrid Rows="2">
|
||||
<ComboBox ItemsSource="{Binding MeasureUnitList}" SelectedItem="{Binding SelectedMeasureUnit}"
|
||||
Grid.Column="1" VerticalAlignment="Center"
|
||||
Style="{StaticResource DoorParamsCmBx}"
|
||||
Margin="5,0,5,0"/>
|
||||
<TextBlock Text="{Binding MeasureUnit}" TextWrapping="Wrap"
|
||||
TextAlignment="Center" Margin="5,0,5,0"/>
|
||||
</UniformGrid>
|
||||
</GroupBox>
|
||||
<!--Seclta della modalità di avvio del programma-->
|
||||
<GroupBox Header="{Binding OptionStart}" Grid.Column="2">
|
||||
<UniformGrid Rows="2">
|
||||
|
||||
<ComboBox ItemsSource="{Binding OptionLauncher}" SelectedItem="{Binding SelectedOptionLauncher}"
|
||||
VerticalAlignment="Center"
|
||||
Style="{StaticResource DoorParamsCmBx}"
|
||||
Margin="5,0,5,0"/>
|
||||
<TextBlock Text="{Binding StartUpMsg}" TextWrapping="Wrap"
|
||||
TextAlignment="Center" Margin="5,0,5,0"/>
|
||||
</UniformGrid>
|
||||
</GroupBox>
|
||||
|
||||
<!--Scelta posizionamento macchina-->
|
||||
<GroupBox Header="{Binding BevelMsg}" Grid.Column="3" >
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="5*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="2*"/>
|
||||
<RowDefinition Height="2*"/>
|
||||
<RowDefinition Height="4*"/>
|
||||
</Grid.RowDefinitions>
|
||||
<CheckBox HorizontalAlignment="Center" VerticalAlignment="Center"
|
||||
Name="BevelUp"
|
||||
Style="{StaticResource DoorParamsChBx}"
|
||||
IsChecked="{Binding BevelUpIsChecked}"/>
|
||||
<TextBlock Text="{Binding BevelUpMsg}" Grid.Column="1"
|
||||
VerticalAlignment="Center"/>
|
||||
<CheckBox Grid.Row="1" HorizontalAlignment="Center" VerticalAlignment="Center"
|
||||
Name="BevelDown"
|
||||
Style="{StaticResource DoorParamsChBx}"
|
||||
IsChecked="{Binding BevelDownIsChecked}"/>
|
||||
<TextBlock Text="{Binding BevelDownMsg}" Grid.Column="1" Grid.Row="1"
|
||||
VerticalAlignment="Center"/>
|
||||
<TextBlock Text="{Binding MachinePositionMsg}" Grid.Column="0" Grid.ColumnSpan="2" Grid.Row="2"
|
||||
TextWrapping="Wrap" TextAlignment="Center" Margin="5,0,5,0"/>
|
||||
</Grid>
|
||||
</GroupBox>
|
||||
|
||||
<!--Seclta della cartella in cui salvare i progetti-->
|
||||
<GroupBox Header="{Binding CurrentDirectiry}" Grid.Row="2" Grid.ColumnSpan="4" Margin="5,0,5,0">
|
||||
<Grid >
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="3*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="1*"/>
|
||||
</Grid.RowDefinitions>
|
||||
<TextBlock Text="{Binding DirectoryMsg}" Grid.Column="0" Margin="2,5,5,0"
|
||||
Style="{StaticResource DoorParamsTxBl}"/>
|
||||
<TextBlock Text="{Binding MyProjectDir}" Grid.Column="1" Margin="2,5,5,0"
|
||||
Style="{StaticResource DoorParamsTxBl}"/>
|
||||
<Button Content="{Binding MsgBrowse}" Grid.Column="2"
|
||||
Command="{Binding BrowseCommand}" Margin="5"/>
|
||||
</Grid>
|
||||
</GroupBox>
|
||||
<!--Bottone di chiusura della pagina-->
|
||||
<Button Content="{Binding MsgClose}" Grid.Row="3" Grid.Column="3" Margin="5"
|
||||
Command="{Binding CloseOptionsCommand}"/>
|
||||
|
||||
<!--<GroupBox Header="{Binding CurrentLanguageMsg}" Margin="0,0,0.4,423.6" Grid.RowSpan="3" >
|
||||
|
||||
<UniformGrid Rows="2">
|
||||
<ComboBox ItemsSource="{Binding LanguageList, Mode=OneWay}"
|
||||
DisplayMemberPath="Name" SelectedItem="{Binding SelectedLanguage}"
|
||||
Style="{StaticResource DoorParamsCmBx}"
|
||||
Margin="5,0,5,0"/>
|
||||
<TextBlock Text="{Binding LanguageAdvertMsg}" TextWrapping="Wrap"
|
||||
TextAlignment="Center" Margin="5,0,5,0"/>
|
||||
</UniformGrid>
|
||||
</GroupBox>
|
||||
|
||||
<GroupBox Grid.Column="1" Header="{Binding General}" Margin="0.6,0,-0.4,423.6" Grid.RowSpan="3">
|
||||
<Grid >
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<TextBlock Grid.Column="0" Grid.Row="0" Text="{Binding WidthMsg}" VerticalAlignment="Center"
|
||||
Style="{StaticResource DoorParamsTxBl}"/>
|
||||
<TextBox Grid.Column="1" Grid.Row="0" Text="{Binding WidthValue}"
|
||||
Style="{StaticResource DoorParamsTxBx}"
|
||||
Margin="5,0,5,0"/>
|
||||
<TextBlock Grid.Column="0" Grid.Row="1" Text="{Binding HeightMsg}" VerticalAlignment="Center"
|
||||
Style="{StaticResource DoorParamsTxBl}"/>
|
||||
<TextBox Grid.Column="1" Grid.Row="1" Text="{Binding HeightValue}"
|
||||
Style="{StaticResource DoorParamsTxBx}"
|
||||
Margin="5,0,5,0"/>
|
||||
<TextBlock Grid.Column="0" Grid.Row="2" Text="{Binding ThicknessMsg}" VerticalAlignment="Center"
|
||||
Style="{StaticResource DoorParamsTxBl}"/>
|
||||
<TextBox Grid.Column="1" Grid.Row="2" Text="{Binding ThicknessValue}"
|
||||
Style="{StaticResource DoorParamsTxBx}"
|
||||
Margin="5,0,5,0"/>
|
||||
<TextBlock Grid.Column="0" Grid.Row="3" Text="{Binding SwingMsg}" VerticalAlignment="Center"
|
||||
Style="{StaticResource DoorParamsTxBl}"/>
|
||||
<ComboBox Grid.Column="1" Grid.Row="3"
|
||||
ItemsSource="{Binding SwingTypeList}"
|
||||
SelectedItem="{Binding SwingValue}"
|
||||
Style="{StaticResource DoorParamsCmBx}"
|
||||
Margin="5,0,5,0"/>
|
||||
|
||||
<TextBlock Grid.Column="2" Grid.Row="0" Text="{Binding LockEdgeMsg}" VerticalAlignment="Center"
|
||||
Style="{StaticResource DoorParamsTxBl}"/>
|
||||
<ComboBox Grid.Column="3" Grid.Row="0"
|
||||
ItemsSource="{Binding EdgeTypeList}"
|
||||
SelectedItem="{Binding LockEdgeType}"
|
||||
Style="{StaticResource DoorParamsCmBx}"
|
||||
Margin="5,0,5,0"/>
|
||||
|
||||
<TextBlock Grid.Column="2" Grid.Row="1" Text="{Binding HingeEdgeMsg}" VerticalAlignment="Center"
|
||||
Style="{StaticResource DoorParamsTxBl}"/>
|
||||
<ComboBox Grid.Column="3" Grid.Row="1"
|
||||
ItemsSource="{Binding EdgeTypeList}"
|
||||
SelectedItem="{Binding HingeEdgeType}"
|
||||
Style="{StaticResource DoorParamsCmBx}"
|
||||
Margin="5,0,5,0"/>
|
||||
<TextBlock Grid.Column="2" Grid.Row="2" Text="{Binding TopMsg}" VerticalAlignment="Center"
|
||||
Style="{StaticResource DoorParamsTxBl}"/>
|
||||
<ComboBox Grid.Column="3" Grid.Row="2"
|
||||
ItemsSource="{Binding EdgeTypeList}"
|
||||
SelectedItem="{Binding TopType}"
|
||||
Style="{StaticResource DoorParamsCmBx}"
|
||||
Margin="5,0,5,0"/>
|
||||
<TextBlock Grid.Column="2" Grid.Row="3" Text="{Binding BottomMsg}" VerticalAlignment="Center"
|
||||
Style="{StaticResource DoorParamsTxBl}"/>
|
||||
<ComboBox Grid.Column="3" Grid.Row="3"
|
||||
ItemsSource="{Binding EdgeTypeList}"
|
||||
SelectedItem="{Binding BottomType}"
|
||||
Style="{StaticResource DoorParamsCmBx}"
|
||||
Margin="5,0,5,0"/>
|
||||
|
||||
<CheckBox Grid.Column="4" Grid.Row="0" Name="LockEdge"
|
||||
HorizontalAlignment="Center" VerticalAlignment="Center"
|
||||
IsChecked="{Binding LockEdgeIsChecked}"
|
||||
Style="{StaticResource DoorParamsChBx}"
|
||||
Margin="5,0,5,0"/>
|
||||
<CheckBox Grid.Column="4" Grid.Row="1" Name="HingeEdge"
|
||||
HorizontalAlignment="Center" VerticalAlignment="Center"
|
||||
IsChecked="{Binding HingeEdgeIsChecked}"
|
||||
Style="{StaticResource DoorParamsChBx}"
|
||||
Margin="5,0,5,0"/>
|
||||
<CheckBox Grid.Column="4" Grid.Row="2" Name="TopEdge"
|
||||
HorizontalAlignment="Center" VerticalAlignment="Center"
|
||||
IsChecked="{Binding TopIsChecked}"
|
||||
Style="{StaticResource DoorParamsChBx}"
|
||||
Margin="5,0,5,0"/>
|
||||
<CheckBox Grid.Column="4" Grid.Row="3" Name="BottomEdge"
|
||||
HorizontalAlignment="Center" VerticalAlignment="Center"
|
||||
IsChecked="{Binding BottomIsChecked}"
|
||||
Style="{StaticResource DoorParamsChBx}"
|
||||
Margin="5,0,5,0"/>
|
||||
|
||||
<TextBox Grid.Column="5" Grid.Row="0" Text="{Binding LockEdgeOverMaterialValue}"
|
||||
IsEnabled ="{Binding IsChecked, ElementName=LockEdge}"
|
||||
Style="{StaticResource DoorParamsTxBx}"
|
||||
Margin="5,0,5,0"/>
|
||||
<TextBox Grid.Column="5" Grid.Row="1" Text="{Binding HingeEdgeOverMaterialValue}"
|
||||
IsEnabled ="{Binding IsChecked, ElementName=HingeEdge}"
|
||||
Style="{StaticResource DoorParamsTxBx}"
|
||||
Margin="5,0,5,0"/>
|
||||
<TextBox Grid.Column="5" Grid.Row="2" Text="{Binding TopOverMaterialValue}"
|
||||
IsEnabled ="{Binding IsChecked, ElementName=TopEdge}"
|
||||
Style="{StaticResource DoorParamsTxBx}"
|
||||
Margin="5,0,5,0"/>
|
||||
<TextBox Grid.Column="5" Grid.Row="3" Text="{Binding BottomOverMaterialValue}"
|
||||
IsEnabled ="{Binding IsChecked, ElementName=BottomEdge}"
|
||||
Style="{StaticResource DoorParamsTxBx}"
|
||||
Margin="5,0,5,0"/>
|
||||
</Grid>
|
||||
</GroupBox>
|
||||
|
||||
<GroupBox Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="2" Margin="0,0.4,0.4,-0.4" >
|
||||
<Grid >
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="1*"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<TextBlock Text="{Binding MeasureUnit}" VerticalAlignment="Center"
|
||||
Style="{StaticResource DoorParamsTxBl}"
|
||||
Margin="4,0,0,0"/>
|
||||
<ComboBox ItemsSource="{Binding MeasureUnitList}" SelectedItem="{Binding SelectedMeasureUnit}"
|
||||
Grid.Column="1" VerticalAlignment="Center"
|
||||
Style="{StaticResource DoorParamsCmBx}"
|
||||
Margin="5,0,5,0"/>
|
||||
|
||||
<TextBlock Text="{Binding StartUpMsg}" VerticalAlignment="Center"
|
||||
Style="{StaticResource DoorParamsTxBl}"
|
||||
Grid.Column="2" Margin="4,0,0,0"/>
|
||||
<ComboBox ItemsSource="{Binding OptionLauncher}" SelectedItem="{Binding SelectedOptionLauncher}"
|
||||
VerticalAlignment="Center"
|
||||
Style="{StaticResource DoorParamsCmBx}"
|
||||
Grid.Column="3" Margin="5,0,5,0"/>
|
||||
</Grid>
|
||||
</GroupBox>-->
|
||||
</Grid>
|
||||
|
||||
</EgtWPFLib5:EgtCustomWindow>
|
||||
@@ -2,11 +2,11 @@
|
||||
Imports System.ComponentModel
|
||||
Imports EgtUILib
|
||||
|
||||
Public Class OptionsViewModel
|
||||
Public Class OptionsVM
|
||||
Implements INotifyPropertyChanged
|
||||
|
||||
Dim m_rfMainWindowViewModel As MainWindowViewModel
|
||||
Dim m_rfCurrDoor As Door
|
||||
Dim m_rfMainWindowVM As MainWindowVM
|
||||
|
||||
' serve per definire l'indirizzo per la guida (senza aggiungere l'estenzione!)
|
||||
Dim m_Chapter As String
|
||||
|
||||
@@ -44,7 +44,7 @@ Public Class OptionsViewModel
|
||||
OptionModule.m_SelectedMeasureUnit = value
|
||||
' iniziliazzo il valore dell'unità di misura
|
||||
DdfFile.UnitMeasure = value
|
||||
If value = OptionModule.m_MeasureUnitList(0) Then
|
||||
If value = OptionModule.m_MeasureUnitList(0) Then
|
||||
OptionModule.m_bIsMmUnit = True
|
||||
ElseIf value = OptionModule.m_MeasureUnitList(1) Then
|
||||
OptionModule.m_bIsMmUnit = False
|
||||
@@ -90,7 +90,6 @@ Public Class OptionsViewModel
|
||||
Else
|
||||
Return False
|
||||
End If
|
||||
'Return OptionModule.m_bBevelUp
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
' se sto accendendo o spegmemdo un bevel
|
||||
@@ -107,11 +106,9 @@ Public Class OptionsViewModel
|
||||
DefaultWritePrivateProfileString(S_EDGE, K_BEVELU_INI, "0")
|
||||
End If
|
||||
RefreshEdgeTypeList()
|
||||
NotifyPropertyChanged("EdgeTypeList")
|
||||
Else
|
||||
Return
|
||||
End If
|
||||
m_Chapter = "bevel_up"
|
||||
End Set
|
||||
End Property
|
||||
|
||||
@@ -152,7 +149,6 @@ Public Class OptionsViewModel
|
||||
Set(value As String)
|
||||
OptionModule.m_Width = value
|
||||
DefaultWritePrivateProfileString(S_SIZE, K_WIDTH_INI, OptionModule.m_Width)
|
||||
m_Chapter = "general"
|
||||
End Set
|
||||
End Property
|
||||
|
||||
@@ -188,7 +184,7 @@ Public Class OptionsViewModel
|
||||
|
||||
Public Shared Property IsCheckedWeight As Boolean
|
||||
Get
|
||||
If Door.IsCheckedWeight = Visibility.Visible Then
|
||||
If Part.IsCheckedWeight = Visibility.Visible Then
|
||||
Return True
|
||||
Else
|
||||
Return False
|
||||
@@ -196,18 +192,18 @@ Public Class OptionsViewModel
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
If value Then
|
||||
Door.IsCheckedWeight = Visibility.Visible
|
||||
Part.IsCheckedWeight = Visibility.Visible
|
||||
DefaultWritePrivateProfileString(S_SIZE, K_WEIGHTISCHECKED_INI, "1")
|
||||
Else
|
||||
If Door.IsCheckedWeight = Visibility.Visible Then
|
||||
If Part.IsCheckedWeight = Visibility.Visible Then
|
||||
If MessageBox.Show(EgtMsg(50153), EgtMsg(50110), MessageBoxButton.YesNo, MessageBoxImage.Question, MessageBoxResult.No) = MessageBoxResult.Yes Then
|
||||
Door.IsCheckedWeight = Visibility.Collapsed
|
||||
Part.IsCheckedWeight = Visibility.Collapsed
|
||||
DefaultWritePrivateProfileString(S_SIZE, K_WEIGHTISCHECKED_INI, "0")
|
||||
Else
|
||||
Return
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
End Set
|
||||
End Property
|
||||
|
||||
@@ -229,30 +225,10 @@ Public Class OptionsViewModel
|
||||
|
||||
Public Shared ReadOnly Property EdgeTypeList As ObservableCollection(Of EdgeType)
|
||||
Get
|
||||
Return Door.m_EdgeTypeList
|
||||
Return Part.m_EdgeTypeList
|
||||
End Get
|
||||
End Property
|
||||
|
||||
' ''Public Property EdgeTypeList As ObservableCollection(Of String)
|
||||
' '' Get
|
||||
' '' Return Door.m_EdgeTypeList
|
||||
' '' End Get
|
||||
' '' Set(value As ObservableCollection(Of String))
|
||||
' '' ' carico la lista degli EdgeType appena aggiornata
|
||||
' '' Door.m_EdgeTypeList = value
|
||||
' '' ' aggiorno le lista pressenti nella pagina delle impostazioni
|
||||
' '' NotifyPropertyChanged("EdgeTypeList")
|
||||
' '' ' verifico che esista una porta
|
||||
' '' If Not IsNothing(m_rfCurrDoor) Then
|
||||
' '' ' Aggiorno le liste degli elementi
|
||||
' '' m_rfCurrDoor.NotifyPropertyChanged("EdgeTypeList")
|
||||
' '' 'EdgeDoorControl(m_rfCurrDoor.LockEdgeType)
|
||||
' '' m_rfCurrDoor.NotifyPropertyChanged("LockEdgeType")
|
||||
' '' m_rfCurrDoor.NotifyPropertyChanged("HingeEdgeType")
|
||||
' '' End If
|
||||
' '' End Set
|
||||
' ''End Property
|
||||
|
||||
Public Property LockEdgeType As EdgeType
|
||||
Get
|
||||
If m_LockEdgeType.IsActive = Visibility.Collapsed Then
|
||||
@@ -417,6 +393,300 @@ Public Class OptionsViewModel
|
||||
End Set
|
||||
End Property
|
||||
|
||||
'----------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
Public Property LightUp As String
|
||||
Get
|
||||
Return OptionModule.m_LightUp
|
||||
End Get
|
||||
Set(value As String)
|
||||
OptionModule.m_LightUp = value
|
||||
DefaultWritePrivateProfileString(S_LIGHT, K_LIGHTUP, OptionModule.m_LightUp)
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property LightBottom As String
|
||||
Get
|
||||
Return OptionModule.m_LightBottom
|
||||
End Get
|
||||
Set(value As String)
|
||||
OptionModule.m_LightBottom = value
|
||||
' modifico le dimensioni dei Jambs
|
||||
DefaultWritePrivateProfileString(S_LIGHT, K_LIGHTBOTTOM, OptionModule.m_LightBottom)
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property LightHinge As String
|
||||
Get
|
||||
Return OptionModule.m_LightHinge
|
||||
End Get
|
||||
Set(value As String)
|
||||
OptionModule.m_LightHinge = value
|
||||
DefaultWritePrivateProfileString(S_LIGHT, K_LIGHTHINGE, OptionModule.m_LightHinge)
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property LightLock As String
|
||||
Get
|
||||
Return OptionModule.m_LightLock
|
||||
End Get
|
||||
Set(value As String)
|
||||
OptionModule.m_LightLock = value
|
||||
DefaultWritePrivateProfileString(S_LIGHT, K_LIGHTLOCK, OptionModule.m_LightLock)
|
||||
End Set
|
||||
End Property
|
||||
|
||||
' spessore del jamb della testa
|
||||
Public Property ThicknessHead As String
|
||||
Get
|
||||
Return OptionModule.m_ThicknessHead
|
||||
End Get
|
||||
Set(value As String)
|
||||
OptionModule.m_ThicknessHead = value
|
||||
DefaultWritePrivateProfileString(S_OVERLAP, K_THICKNESSHEAD, OptionModule.m_ThicknessHead)
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property OverlapHinge As String
|
||||
Get
|
||||
Return OptionModule.m_OverlapHinge
|
||||
End Get
|
||||
Set(value As String)
|
||||
OptionModule.m_OverlapHinge = value
|
||||
DefaultWritePrivateProfileString(S_OVERLAP, K_OVERLAPHINGE, OptionModule.m_OverlapHinge)
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property OverlapLock As String
|
||||
Get
|
||||
Return OptionModule.m_OverlapLock
|
||||
End Get
|
||||
Set(value As String)
|
||||
OptionModule.m_OverlapLock = value
|
||||
DefaultWritePrivateProfileString(S_OVERLAP, K_OVERLAPLOCK, OptionModule.m_OverlapLock)
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property OverlapTop As String
|
||||
Get
|
||||
Return OptionModule.m_OverlapTop
|
||||
End Get
|
||||
Set(value As String)
|
||||
OptionModule.m_OverlapTop = value
|
||||
DefaultWritePrivateProfileString(S_OVERLAP, K_OVERLAPTOP, OptionModule.m_OverlapTop)
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property DeltaThickness As String
|
||||
Get
|
||||
Return OptionModule.m_DeltaThickness
|
||||
End Get
|
||||
Set(value As String)
|
||||
OptionModule.m_DeltaThickness = value
|
||||
DefaultWritePrivateProfileString(S_OVERLAP, K_DELTAT, OptionModule.m_DeltaThickness)
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property Exterior As Boolean
|
||||
Get
|
||||
Return OptionModule.m_Exterior
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
OptionModule.m_Exterior = value
|
||||
If OptionModule.m_Exterior Then
|
||||
DefaultWritePrivateProfileString(S_OVERLAP, K_EXTERIOR, "1")
|
||||
Else
|
||||
DefaultWritePrivateProfileString(S_OVERLAP, K_EXTERIOR, "0")
|
||||
End If
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property ThicknessJamb As String
|
||||
Get
|
||||
Return OptionModule.m_ThicknessJamb
|
||||
End Get
|
||||
Set(value As String)
|
||||
OptionModule.m_ThicknessJamb = value
|
||||
DefaultWritePrivateProfileString(S_SIZEJAMB, K_THICKNESS, OptionModule.m_ThicknessJamb)
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property WidthJamb As String
|
||||
Get
|
||||
Return OptionModule.m_WidthJamb
|
||||
End Get
|
||||
Set(value As String)
|
||||
OptionModule.m_WidthJamb = value
|
||||
DefaultWritePrivateProfileString(S_SIZEJAMB, K_WIDTH, OptionModule.m_WidthJamb)
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property DoorListNumber As List(Of String)
|
||||
Get
|
||||
Return OptionModule.m_DoorsListNumber
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Property DoorNumber As String
|
||||
Get
|
||||
Return OptionModule.m_DoorsNumber
|
||||
End Get
|
||||
Set(value As String)
|
||||
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property LockEdgeTypeAssembly As EdgeType
|
||||
Get
|
||||
If m_LockEdgeTypeAssembly.IsActive = Visibility.Collapsed Then
|
||||
OptionModule.m_LockEdgeTypeAssembly = EdgeTypeList(0)
|
||||
End If
|
||||
Return OptionModule.m_LockEdgeTypeAssembly
|
||||
End Get
|
||||
Set(value As EdgeType)
|
||||
OptionModule.m_LockEdgeTypeAssembly = value
|
||||
DefaultWritePrivateProfileString(S_EDGEASSEMBLY, K_LOCKEDGE, OptionModule.m_LockEdgeTypeAssembly.Name)
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property HingeEdgeTypeAssembly As EdgeType
|
||||
Get
|
||||
If m_HingeEdgeTypeAssembly.IsActive = Visibility.Collapsed Then
|
||||
OptionModule.m_HingeEdgeTypeAssembly = EdgeTypeList(0)
|
||||
End If
|
||||
Return OptionModule.m_HingeEdgeTypeAssembly
|
||||
End Get
|
||||
Set(value As EdgeType)
|
||||
OptionModule.m_HingeEdgeTypeAssembly = value
|
||||
DefaultWritePrivateProfileString(S_EDGEASSEMBLY, K_HINGEDGE_INI, OptionModule.m_HingeEdgeTypeAssembly.Name)
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property TopTypeAssembly As EdgeType
|
||||
Get
|
||||
If m_TopTypeAssembly.IsActive = Visibility.Collapsed Then
|
||||
OptionModule.m_TopTypeAssembly = EdgeTypeList(0)
|
||||
End If
|
||||
Return OptionModule.m_TopTypeAssembly
|
||||
End Get
|
||||
Set(value As EdgeType)
|
||||
OptionModule.m_TopTypeAssembly = value
|
||||
DefaultWritePrivateProfileString(S_EDGEASSEMBLY, K_TOPEDGE_INI, OptionModule.m_TopTypeAssembly.Name)
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property BottomTypeAssembly As EdgeType
|
||||
Get
|
||||
If m_BottomTypeAssembly.IsActive = Visibility.Collapsed Then
|
||||
OptionModule.m_BottomTypeAssembly = EdgeTypeList(0)
|
||||
End If
|
||||
Return OptionModule.m_BottomTypeAssembly
|
||||
End Get
|
||||
Set(value As EdgeType)
|
||||
OptionModule.m_BottomTypeAssembly = value
|
||||
DefaultWritePrivateProfileString(S_EDGEASSEMBLY, K_BOTTOMEDGE_INI, OptionModule.m_BottomTypeAssembly.Name)
|
||||
End Set
|
||||
End Property
|
||||
|
||||
#Region "Machining Assembly"
|
||||
Public Property LockEdgeMachiningAssembly As Boolean
|
||||
Get
|
||||
Return OptionModule.m_LockEdgeMachiningAssembly
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
OptionModule.m_LockEdgeMachiningAssembly = value
|
||||
If value Then
|
||||
DefaultWritePrivateProfileString(S_MACHININGASSEMBLY, K_LOCKEDGEISCHECKED_INI, "1")
|
||||
Else
|
||||
DefaultWritePrivateProfileString(S_MACHININGASSEMBLY, K_LOCKEDGEISCHECKED_INI, "0")
|
||||
End If
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property LockEdgeOverMaterialAssembly As String
|
||||
Get
|
||||
Return OptionModule.m_LockEdgeOverMaterialAssembly
|
||||
End Get
|
||||
Set(value As String)
|
||||
OptionModule.m_LockEdgeOverMaterialAssembly = value
|
||||
DefaultWritePrivateProfileString(S_OVERMATERIALASSEMBLY, K_LOCKEDGEOVERMATERIAL_INI, OptionModule.m_LockEdgeOverMaterialAssembly)
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property HingeEdgeMachiningAssembly As Boolean
|
||||
Get
|
||||
Return OptionModule.m_HingeEdgeMachiningAssembly
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
OptionModule.m_HingeEdgeMachiningAssembly = value
|
||||
If value Then
|
||||
DefaultWritePrivateProfileString(S_MACHININGASSEMBLY, K_HINGEDGEEISCHECKED_INI, "1")
|
||||
Else
|
||||
DefaultWritePrivateProfileString(S_MACHININGASSEMBLY, K_HINGEDGEEISCHECKED_INI, "0")
|
||||
End If
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property HingeEdgeOverMaterialAssembly As String
|
||||
Get
|
||||
Return OptionModule.m_HingeEdgeOverMaterialAssembly
|
||||
End Get
|
||||
Set(value As String)
|
||||
OptionModule.m_HingeEdgeOverMaterialAssembly = value
|
||||
DefaultWritePrivateProfileString(S_OVERMATERIALASSEMBLY, K_HINGEDGEOVERMATERIAL_INI, OptionModule.m_HingeEdgeOverMaterialAssembly)
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property TopMachiningAssembly As Boolean
|
||||
Get
|
||||
Return OptionModule.m_TopMachiningAssembly
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
OptionModule.m_TopMachiningAssembly = value
|
||||
If value Then
|
||||
DefaultWritePrivateProfileString(S_MACHININGASSEMBLY, K_TOPISCHECKED_INI, "1")
|
||||
Else
|
||||
DefaultWritePrivateProfileString(S_MACHININGASSEMBLY, K_TOPISCHECKED_INI, "0")
|
||||
End If
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property TopOverMaterialAssembly As String
|
||||
Get
|
||||
Return OptionModule.m_TopOverMaterialAssembly
|
||||
End Get
|
||||
Set(value As String)
|
||||
OptionModule.m_TopOverMaterialAssembly = value
|
||||
DefaultWritePrivateProfileString(S_OVERMATERIALASSEMBLY, K_TOPOVERMATERIAL_INI, OptionModule.m_TopOverMaterialAssembly)
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property BottomMachiningAssembly As Boolean
|
||||
Get
|
||||
Return OptionModule.m_BottomMachiningAssembly
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
OptionModule.m_BottomMachiningAssembly = value
|
||||
If value Then
|
||||
DefaultWritePrivateProfileString(S_MACHININGASSEMBLY, K_BOTTOMISCHECKED_INI, "1")
|
||||
Else
|
||||
DefaultWritePrivateProfileString(S_MACHININGASSEMBLY, K_BOTTOMISCHECKED_INI, "0")
|
||||
End If
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property BottomOverMaterialAssembly As String
|
||||
Get
|
||||
Return OptionModule.m_BottomOverMaterialAssembly
|
||||
End Get
|
||||
Set(value As String)
|
||||
OptionModule.m_BottomOverMaterialAssembly = value
|
||||
DefaultWritePrivateProfileString(S_OVERMATERIALASSEMBLY, K_BOTTOMOVERMATERIAL_INI, OptionModule.m_BottomOverMaterialAssembly)
|
||||
End Set
|
||||
End Property
|
||||
#End Region ' Machining Assembly
|
||||
|
||||
'-------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
' Definizione comandi
|
||||
Private m_cmdCloseOptions As ICommand
|
||||
Private m_cmdBrowse As ICommand
|
||||
@@ -484,6 +754,12 @@ Public Class OptionsViewModel
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property DoorMsg As String
|
||||
Get
|
||||
Return "Door"
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property WidthMsg As String
|
||||
Get
|
||||
Return EgtMsg(MSG_MAINWINDOW + 1)
|
||||
@@ -613,6 +889,87 @@ Public Class OptionsViewModel
|
||||
End Get
|
||||
End Property
|
||||
|
||||
'---------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
'tab2
|
||||
Public ReadOnly Property AssemblyMsg As String
|
||||
Get
|
||||
Return "Assembly"
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property LightUpMsg As String
|
||||
Get
|
||||
Return "Light Up"
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property LightLockMsg As String
|
||||
Get
|
||||
Return "Light Lock"
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property LightBottomMsg As String
|
||||
Get
|
||||
Return "Light Bottom"
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property LightHingeMsg As String
|
||||
Get
|
||||
Return "Light Hinge"
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property ThicknessHeadMsg As String
|
||||
Get
|
||||
Return "Thickness Head"
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property OverlapHingeMsg As String
|
||||
Get
|
||||
Return "Overlap Hinge"
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property OverlapLockMsg As String
|
||||
Get
|
||||
Return "Overlap Lock"
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property OverlapTopMsg As String
|
||||
Get
|
||||
Return "Overlap Top"
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property DeltaTMsg As String
|
||||
Get
|
||||
Return "Delta T"
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property ExteriorMsg As String
|
||||
Get
|
||||
Return "Exterior"
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property DoorNumberMsg As String
|
||||
Get
|
||||
Return "Number Doors"
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property JambsAndDoorsMsg As String
|
||||
Get
|
||||
Return "Jambs and Doors"
|
||||
End Get
|
||||
End Property
|
||||
|
||||
|
||||
#End Region
|
||||
|
||||
' Controllo di eliminare un bevel dalla lista: 1 se accendo un bevel, 2 se spengo un bevel, -1 tutti i casi che non sono questi
|
||||
@@ -639,12 +996,13 @@ Public Class OptionsViewModel
|
||||
|
||||
' chiedo se vuole continuare: vero se cambia li lista
|
||||
Private Function QuestionSetBevel(bCheckBevel As Integer) As Boolean
|
||||
|
||||
If Not IsNothing(m_rfCurrDoor) Then
|
||||
If Not IsNothing(Map.refPartPageVM.CurrPart) Or IsNothing(Map.refAssemblyPageVM.CurrAssembly) Then
|
||||
' se la porta esiste
|
||||
If bCheckBevel = 1 Then
|
||||
' controllo se sto eliminando da uno degli elementi della lista: se si chiedo di continuare
|
||||
If m_rfCurrDoor.LockEdgeType.Name = "BU" Or m_rfCurrDoor.LockEdgeType.Name = "BD" Or m_rfCurrDoor.HingeEdgeType.Name = "BU" Or m_rfCurrDoor.HingeEdgeType.Name = "BD" Then
|
||||
If Map.refPartPageVM.CurrPart.LockEdgeType.Name = "BU" Or Map.refPartPageVM.CurrPart.LockEdgeType.Name = "BD" Or Map.refPartPageVM.CurrPart.HingeEdgeType.Name = "BU" Or Map.refPartPageVM.CurrPart.HingeEdgeType.Name = "BD" Or
|
||||
Map.refAssemblyPageVM.CurrAssembly.LockEdgeType.Name = "BU" Or Map.refAssemblyPageVM.CurrAssembly.LockEdgeType.Name = "BD" Or Map.refAssemblyPageVM.CurrAssembly.HingeEdgeType.Name = "BU" Or Map.refAssemblyPageVM.CurrAssembly.HingeEdgeType.Name = "BD" Then
|
||||
|
||||
' Se blocco tutto non accade nulla
|
||||
If MessageBox.Show(EgtMsg(50154), EgtMsg(50115), MessageBoxButton.YesNo, MessageBoxImage.Asterisk, MessageBoxResult.No) = MessageBoxResult.No Then
|
||||
Return False
|
||||
@@ -667,70 +1025,69 @@ Public Class OptionsViewModel
|
||||
Else
|
||||
Return True
|
||||
End If
|
||||
''If bCheckBevel = 1 Then
|
||||
'' ' controllo se to oliminando da uno degli elementi della lista: se si chiedo di continuare
|
||||
'' If m_rfCurrDoor.LockEdgeType.Name = "BU" Or m_rfCurrDoor.LockEdgeType.Name = "BD" Or m_rfCurrDoor.HingeEdgeType.Name = "BU" Or m_rfCurrDoor.HingeEdgeType.Name = "BD" Then
|
||||
'' ' Se blocco tutto non accade nulla
|
||||
'' If MessageBox.Show(EgtMsg(50154), EgtMsg(50115), MessageBoxButton.YesNo, MessageBoxImage.Asterisk, MessageBoxResult.No) = MessageBoxResult.No Then
|
||||
'' Return False
|
||||
'' Else
|
||||
'' ' se decido di continuare
|
||||
'' Return True
|
||||
'' End If
|
||||
'' Else
|
||||
'' ' se non sono presenti elementi nella lista
|
||||
'' Return True
|
||||
'' End If
|
||||
'' ' se sto attivando un bevel nella lista
|
||||
''ElseIf bCheckBevel = 2 Then
|
||||
'' Return True
|
||||
''Else
|
||||
'' ' per tutti gli altri casi (-1) non accade nulla
|
||||
'' Return False
|
||||
''End If
|
||||
End Function
|
||||
|
||||
' creo la lista di oggetti aggiornando la visibilità dei bevel Up e Down
|
||||
Public Sub RefreshEdgeTypeList()
|
||||
For Index = 0 To Door.m_EdgeTypeList.Count - 1
|
||||
NotifyPropertyChanged("EdgeTypeList")
|
||||
For Index = 0 To Part.m_EdgeTypeList.Count - 1
|
||||
If m_StaticEdgeTypeList(Index) = "BU" Then
|
||||
Door.m_EdgeTypeList(Index).Name = m_StaticEdgeTypeList(Index)
|
||||
Door.m_EdgeTypeList(Index).IsActive = OptionModule.m_bBevelUp
|
||||
Part.m_EdgeTypeList(Index).Name = m_StaticEdgeTypeList(Index)
|
||||
Part.m_EdgeTypeList(Index).IsActive = OptionModule.m_bBevelUp
|
||||
ElseIf m_StaticEdgeTypeList(Index) = "BD" Then
|
||||
Door.m_EdgeTypeList(Index).Name = m_StaticEdgeTypeList(Index)
|
||||
Door.m_EdgeTypeList(Index).IsActive = OptionModule.m_bBevelDown
|
||||
Part.m_EdgeTypeList(Index).Name = m_StaticEdgeTypeList(Index)
|
||||
Part.m_EdgeTypeList(Index).IsActive = OptionModule.m_bBevelDown
|
||||
Else
|
||||
Door.m_EdgeTypeList(Index).Name = m_StaticEdgeTypeList(Index)
|
||||
Door.m_EdgeTypeList(Index).IsActive = Visibility.Visible
|
||||
Part.m_EdgeTypeList(Index).Name = m_StaticEdgeTypeList(Index)
|
||||
Part.m_EdgeTypeList(Index).IsActive = Visibility.Visible
|
||||
End If
|
||||
Next
|
||||
If Not IsNothing(m_rfCurrDoor) Then
|
||||
If Not IsNothing(Map.refPartPageVM.CurrPart) Then
|
||||
NotifyPropertyChanged("LockEdgeType")
|
||||
m_rfCurrDoor.NotifyPropertyChanged("LockEdgeType")
|
||||
NotifyPropertyChanged("LockEdgeTypeAssembly")
|
||||
Map.refPartPageVM.CurrPart.NotifyPropertyChanged("LockEdgeType")
|
||||
NotifyPropertyChanged("HingeEdgeType")
|
||||
m_rfCurrDoor.NotifyPropertyChanged("HingeEdgeType")
|
||||
NotifyPropertyChanged("HingeEdgeTypeAssembly")
|
||||
Map.refPartPageVM.CurrPart.NotifyPropertyChanged("HingeEdgeType")
|
||||
NotifyPropertyChanged("TopType")
|
||||
m_rfCurrDoor.NotifyPropertyChanged("TopType")
|
||||
NotifyPropertyChanged("TopTypeAssembly")
|
||||
Map.refPartPageVM.CurrPart.NotifyPropertyChanged("TopType")
|
||||
NotifyPropertyChanged("BottomType")
|
||||
m_rfCurrDoor.NotifyPropertyChanged("BottomType")
|
||||
NotifyPropertyChanged("BottomTypeAssembly")
|
||||
Map.refPartPageVM.CurrPart.NotifyPropertyChanged("BottomType")
|
||||
End If
|
||||
If Not IsNothing(Map.refAssemblyPageVM.CurrAssembly) Then
|
||||
Map.refAssemblyPageVM.CurrAssembly.NotifyPropertyChanged("EdgeTypeList")
|
||||
NotifyPropertyChanged("LockEdgeType")
|
||||
NotifyPropertyChanged("LockEdgeTypeAssembly")
|
||||
Map.refAssemblyPageVM.CurrAssembly.NotifyPropertyChanged("LockEdgeType")
|
||||
NotifyPropertyChanged("HingeEdgeType")
|
||||
NotifyPropertyChanged("HingeEdgeTypeAssembly")
|
||||
Map.refAssemblyPageVM.CurrAssembly.NotifyPropertyChanged("HingeEdgeType")
|
||||
NotifyPropertyChanged("TopType")
|
||||
NotifyPropertyChanged("TopTypeAssembly")
|
||||
Map.refAssemblyPageVM.CurrAssembly.NotifyPropertyChanged("TopType")
|
||||
NotifyPropertyChanged("BottomType")
|
||||
NotifyPropertyChanged("BottomTypeAssembly")
|
||||
Map.refAssemblyPageVM.CurrAssembly.NotifyPropertyChanged("BottomType")
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Public Shared Sub CreateEdgeTypeList()
|
||||
For Index = 0 To m_StaticEdgeTypeList.Count - 1
|
||||
If m_StaticEdgeTypeList(Index) = "BU" Then
|
||||
Door.m_EdgeTypeList.Add(New EdgeType(m_StaticEdgeTypeList(Index), OptionModule.m_bBevelUp))
|
||||
Part.m_EdgeTypeList.Add(New EdgeType(m_StaticEdgeTypeList(Index), OptionModule.m_bBevelUp))
|
||||
ElseIf m_StaticEdgeTypeList(Index) = "BD" Then
|
||||
Door.m_EdgeTypeList.Add(New EdgeType(m_StaticEdgeTypeList(Index), OptionModule.m_bBevelDown))
|
||||
Part.m_EdgeTypeList.Add(New EdgeType(m_StaticEdgeTypeList(Index), OptionModule.m_bBevelDown))
|
||||
Else
|
||||
Door.m_EdgeTypeList.Add(New EdgeType(m_StaticEdgeTypeList(Index), Visibility.Visible))
|
||||
Part.m_EdgeTypeList.Add(New EdgeType(m_StaticEdgeTypeList(Index), Visibility.Visible))
|
||||
End If
|
||||
Next
|
||||
End Sub
|
||||
|
||||
Sub New(rfMainWindowViewModel As MainWindowViewModel)
|
||||
m_rfCurrDoor = DirectCast(rfMainWindowViewModel.DoorParameters.DataContext, DoorParametersViewModel).CurrDoor
|
||||
m_rfMainWindowViewModel = rfMainWindowViewModel
|
||||
Sub New(rfMainWindowVM As MainWindowVM)
|
||||
m_rfCurrDoor = Map.refPartPageVM.CurrPart
|
||||
m_rfMainWindowVM = rfMainWindowVM
|
||||
End Sub
|
||||
|
||||
#Region "COMMANDS"
|
||||
@@ -755,14 +1112,14 @@ Public Class OptionsViewModel
|
||||
Public Sub CloseOptions()
|
||||
' Chiusura finestra
|
||||
For Each Window In Application.Current.Windows
|
||||
If TypeOf Window Is OptionsView Then
|
||||
Dim OptionsWindow As OptionsView = DirectCast(Window, OptionsView)
|
||||
If TypeOf Window Is OptionsV Then
|
||||
Dim OptionsWindow As OptionsV = DirectCast(Window, OptionsV)
|
||||
' se eseguo una modifica prima di avere una porta...controllo bene!!
|
||||
If Not IsNothing(m_rfCurrDoor) Then
|
||||
m_rfCurrDoor.VisibilityWeight = Door.IsCheckedWeight
|
||||
m_rfCurrDoor.NotifyPropertyChanged("Weight")
|
||||
m_rfCurrDoor.NotifyPropertyChanged("VisibilityWeight")
|
||||
End If
|
||||
If Not IsNothing(Map.refPartPageVM.CurrPart) Then
|
||||
Map.refPartPageVM.CurrPart.VisibilityWeight = Part.IsCheckedWeight
|
||||
Map.refPartPageVM.CurrPart.NotifyPropertyChanged("Weight")
|
||||
Map.refPartPageVM.CurrPart.NotifyPropertyChanged("VisibilityWeight")
|
||||
End If
|
||||
OptionsWindow.Close()
|
||||
End If
|
||||
Next
|
||||
@@ -800,13 +1157,13 @@ Public Class OptionsViewModel
|
||||
End Property
|
||||
|
||||
Public Sub F1Guide()
|
||||
Dim rfGuideViewModel As New GuideViewModel
|
||||
Dim rfGuideVM As New GuideVM
|
||||
'If String.IsNullOrEmpty(m_Chapter) Then
|
||||
' GuideViewModel.m_AddressGuide = "option_page"
|
||||
' GuideVM.m_AddressGuide = "option_page"
|
||||
'Else
|
||||
' GuideViewModel.m_AddressGuide = "OptionPage\" & m_Chapter
|
||||
' GuideVM.m_AddressGuide = "OptionPage\" & m_Chapter
|
||||
'End If
|
||||
'm_rfMainWindowViewModel.ProjectManagerViewModel.Guide()
|
||||
'm_rfMainWindowVM.ProjectManagerVM.Guide()
|
||||
End Sub
|
||||
|
||||
#End Region ' COMMANDS
|
||||
|
||||
@@ -0,0 +1,287 @@
|
||||
Module ParamFunction
|
||||
' parametri condivisi dalle funzioni
|
||||
Public CompoName As String
|
||||
Public DoorNumber As Integer
|
||||
Public ParamName As String
|
||||
Public CompoPath As String
|
||||
|
||||
#Region "Associazione File"
|
||||
' parametri propri della funzione
|
||||
Public InSide As String
|
||||
' questo parametro viene caricato durante la lettura del file Config.ini presente in ogni crtella delle componenti
|
||||
Public OutCompoTemplateName As String
|
||||
Public InCompoTypeName As String
|
||||
' il nome della componente scelta in ingresso
|
||||
Public Template As String
|
||||
'Public OutDirectoryCompo As String
|
||||
|
||||
Public Function Match() As Boolean
|
||||
' leggo la posizione della componete rispetto alla porta
|
||||
Select Case InSide
|
||||
Case "Hinge"
|
||||
Return MatchDoorJamb()
|
||||
Case "Lock"
|
||||
Select Case DoorNumber
|
||||
Case 1
|
||||
Return MatchDoorJamb()
|
||||
Case 2
|
||||
Return MatchDoorDoor()
|
||||
Case Else
|
||||
Return False
|
||||
End Select
|
||||
Case "Top"
|
||||
Return True
|
||||
Case "Bottom"
|
||||
Return True
|
||||
Case Else
|
||||
Return False
|
||||
End Select
|
||||
End Function
|
||||
|
||||
Public Function MatchDoorJamb() As Boolean
|
||||
Select Case CompoName
|
||||
Case "hinges"
|
||||
If Template = "StdMrtHinge" Then
|
||||
OutCompoTemplateName = "Hinges\Frame_4_5S"
|
||||
'OutDirectoryCompo = "C:\EgtData\Doors\EgalTech\Compo\Hinges"
|
||||
ElseIf Template = "SOSS\212" Then
|
||||
OutCompoTemplateName = "Hinges\SOSS\Frame_212"
|
||||
'OutDirectoryCompo = "C:\EgtData\Doors\EgalTech\Compo\Hinges"
|
||||
End If
|
||||
Return True
|
||||
Case "locks"
|
||||
OutCompoTemplateName = "StrikesStdFaceStrikes"
|
||||
'OutDirectoryCompo = "C:\EgtData\Doors\EgalTech\Compo\Strikes"
|
||||
'OutCompoTemplateName = "TESTF_F"
|
||||
Return True
|
||||
Case Else
|
||||
Return False
|
||||
End Select
|
||||
End Function
|
||||
|
||||
Public Function MatchDoorDoor() As Boolean
|
||||
Select Case CompoName
|
||||
Case "locks"
|
||||
OutCompoTemplateName = Template
|
||||
Return True
|
||||
Case Else
|
||||
Return False
|
||||
End Select
|
||||
End Function
|
||||
|
||||
#End Region ' Associazione File
|
||||
|
||||
#Region "Lettura del file Assembly"
|
||||
' unico problema che può generare è solo legato alla grafica
|
||||
Public Function IsEnableParam() As Boolean
|
||||
Select Case CompoName
|
||||
Case "hinges"
|
||||
If Template = "Frame_4_5S" Then
|
||||
Return HingeMortIsEnable()
|
||||
ElseIf Template = "SOSS\Frame_212" Then
|
||||
Return HingeConCyIsEnable()
|
||||
Else
|
||||
Return False
|
||||
End If
|
||||
Case "locks"
|
||||
If Template = "TESTF_F" Then
|
||||
Return False
|
||||
Else
|
||||
Return LockIsEnable()
|
||||
End If
|
||||
Case Else
|
||||
Return False
|
||||
End Select
|
||||
End Function
|
||||
|
||||
Public Function HingeMortIsEnable() As Boolean
|
||||
Select Case ParamName
|
||||
Case "ToptoTop"
|
||||
Return HingePositionIsEnable()
|
||||
Case "back_set"
|
||||
Return HingeBackSetMortIsEnable()
|
||||
Case "thickness"
|
||||
Return HingeThicknessIsEnable()
|
||||
Case Else
|
||||
Return False
|
||||
End Select
|
||||
End Function
|
||||
|
||||
Public Function HingeConCyIsEnable() As Boolean
|
||||
Select Case ParamName
|
||||
Case "ToptoCL"
|
||||
Return HingePositionIsEnable()
|
||||
Case "back_set"
|
||||
Return HingeBackSetConcyIsEnable()
|
||||
Case Else
|
||||
Return False
|
||||
End Select
|
||||
End Function
|
||||
|
||||
Public Function LockIsEnable() As Boolean
|
||||
Select Case ParamName
|
||||
Case "position"
|
||||
Return LockPositionIsEnable()
|
||||
Case Else
|
||||
Return True
|
||||
End Select
|
||||
End Function
|
||||
|
||||
#End Region ' Lettura del file Assembly
|
||||
|
||||
#Region "Calcolo Parametri"
|
||||
' parametri propri della funzione
|
||||
Public InParamValue As String
|
||||
Public OutParamValue As String
|
||||
Public LightUp As String
|
||||
Public LightBottom As String
|
||||
Public LightHinge As String
|
||||
Public LightLock As String
|
||||
Public OverlapHinge As String
|
||||
Public OverlapLock As String
|
||||
Public OverlapTop As String
|
||||
Public ThicknessHead As String
|
||||
Public ThicknessJamb As String
|
||||
Public ThicknessDoor As String
|
||||
Public DeltaThickness As String
|
||||
' serve per abilitare i parametri sui Jamb
|
||||
Public IsEnable As Boolean = False
|
||||
Public Function CalcParamInJamb() As Boolean
|
||||
' per ora esistonon solo due casi da trattare: cerniere e serrature, questa funzione gestisce la chiamata
|
||||
Select Case CompoName
|
||||
Case "hinges"
|
||||
If Template = "Frame_4_5S" Then
|
||||
Return CalcHingeMort()
|
||||
ElseIf Template = "SOSS\Frame_212" Then
|
||||
Return CalcHingeConCy()
|
||||
Else
|
||||
Return False
|
||||
End If
|
||||
Case "locks"
|
||||
If Template = "TESTF_F" Then
|
||||
Return CalcLock()
|
||||
Else
|
||||
Return CalcLock()
|
||||
End If
|
||||
Case Else
|
||||
Return False
|
||||
End Select
|
||||
End Function
|
||||
|
||||
Public Function CalcHingeMort() As Boolean
|
||||
Select Case ParamName
|
||||
Case "ToptoTop"
|
||||
Return CalcHingePosition()
|
||||
Case "back_set"
|
||||
Return CalcHingeBackSetMort()
|
||||
Case "thickness"
|
||||
Return CalcHingeThickness()
|
||||
Case Else
|
||||
Return False
|
||||
End Select
|
||||
End Function
|
||||
|
||||
Public Function CalcHingeConCy() As Boolean
|
||||
Select Case ParamName
|
||||
Case "ToptoCL"
|
||||
Return CalcHingePosition()
|
||||
Case "back_set"
|
||||
Return CalcHingeBackSetConcy()
|
||||
Case Else
|
||||
Return False
|
||||
End Select
|
||||
End Function
|
||||
|
||||
Public Function CalcLock() As Boolean
|
||||
Select Case ParamName
|
||||
Case "position"
|
||||
' devo ricalcolare la posizione solo se sto caricando il parametro sul Jamb
|
||||
If DoorNumber = 1 Then
|
||||
Return CalcLockPosition()
|
||||
Else
|
||||
OutParamValue = InParamValue
|
||||
Return True
|
||||
End If
|
||||
Case Else
|
||||
Return False
|
||||
End Select
|
||||
End Function
|
||||
|
||||
Public Function CalcHingePosition() As Boolean
|
||||
' in questo caso calcolo la posizione delle cerniere partendo dal top del Jamb
|
||||
Dim dThicknessHead As Double
|
||||
Dim dLightUp As Double
|
||||
Dim dLightBottom As Double
|
||||
Dim dPositionOnDoor As Double
|
||||
StringToDouble(ThicknessHead, dThicknessHead)
|
||||
StringToDouble(LightUp, dLightUp)
|
||||
StringToDouble(LightBottom, dLightBottom)
|
||||
StringToDouble(InParamValue, dPositionOnDoor)
|
||||
OutParamValue = DoubleToString(dThicknessHead + dLightBottom + dLightUp + dPositionOnDoor, 4)
|
||||
IsEnable = False
|
||||
Return True
|
||||
End Function
|
||||
Public Function HingePositionIsEnable() As Boolean
|
||||
Return False
|
||||
End Function
|
||||
|
||||
Public Function CalcHingeBackSetMort() As Boolean
|
||||
Dim dThicknessDoor As Double
|
||||
Dim dThicknessJamb As Double
|
||||
Dim dBackset As Double
|
||||
Dim dDeltaT As Double
|
||||
StringToDouble(ThicknessDoor, dThicknessDoor)
|
||||
StringToDouble(ThicknessJamb, dThicknessJamb)
|
||||
StringToDouble(InParamValue, dBackset)
|
||||
StringToDouble(DeltaThickness, dDeltaT)
|
||||
OutParamValue = DoubleToString(dThicknessJamb - dDeltaT - dThicknessDoor + dBackset, 4)
|
||||
IsEnable = False
|
||||
Return True
|
||||
End Function
|
||||
Public Function HingeBackSetMortIsEnable() As Boolean
|
||||
Return False
|
||||
End Function
|
||||
|
||||
Public Function CalcHingeBackSetConcy() As Boolean
|
||||
Dim dBackset As Double
|
||||
Dim dDeltaT As Double
|
||||
StringToDouble(InParamValue, dBackset)
|
||||
StringToDouble(DeltaThickness, dDeltaT)
|
||||
OutParamValue = DoubleToString(dDeltaT + dBackset, 4)
|
||||
IsEnable = False
|
||||
Return True
|
||||
End Function
|
||||
Public Function HingeBackSetConcyIsEnable() As Boolean
|
||||
Return False
|
||||
End Function
|
||||
|
||||
Public Function CalcHingeThickness() As Boolean
|
||||
OutParamValue = InParamValue
|
||||
IsEnable = True
|
||||
Return True
|
||||
End Function
|
||||
Public Function HingeThicknessIsEnable() As Boolean
|
||||
Return True
|
||||
End Function
|
||||
|
||||
Public Function CalcLockPosition() As Boolean
|
||||
' in questo caso calcolo la posizione delle cerniere partendo dal top del Jamb
|
||||
Dim dThicknessHead As Double
|
||||
Dim dLightUp As Double
|
||||
Dim dLightBottom As Double
|
||||
Dim dPositionOnDoor As Double
|
||||
StringToDouble(ThicknessHead, dThicknessHead)
|
||||
StringToDouble(LightUp, dLightUp)
|
||||
StringToDouble(LightBottom, dLightBottom)
|
||||
StringToDouble(InParamValue, dPositionOnDoor)
|
||||
OutParamValue = DoubleToString(dThicknessHead + dLightBottom + dLightBottom + dPositionOnDoor, 4)
|
||||
IsEnable = False
|
||||
Return True
|
||||
End Function
|
||||
Public Function LockPositionIsEnable() As Boolean
|
||||
Return False
|
||||
End Function
|
||||
|
||||
#End Region ' Calcolo Parametri
|
||||
|
||||
End Module
|
||||
@@ -1,5 +1,6 @@
|
||||
Imports System.Collections.ObjectModel
|
||||
Imports System.ComponentModel
|
||||
Imports System.IO
|
||||
|
||||
Public Class Project
|
||||
Implements INotifyPropertyChanged
|
||||
@@ -15,13 +16,13 @@ Public Class Project
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_DoorList As New ObservableCollection(Of String)
|
||||
Public Property DoorList As ObservableCollection(Of String)
|
||||
Private m_AssemblyList As New ObservableCollection(Of AssemblyName)
|
||||
Public Property AssemblyList As ObservableCollection(Of AssemblyName)
|
||||
Get
|
||||
Return m_DoorList
|
||||
Return m_AssemblyList
|
||||
End Get
|
||||
Set(value As ObservableCollection(Of String))
|
||||
m_DoorList = value
|
||||
Set(value As ObservableCollection(Of AssemblyName))
|
||||
m_AssemblyList = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
@@ -32,3 +33,50 @@ Public Class Project
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
|
||||
Public Class AssemblyName
|
||||
Implements INotifyPropertyChanged
|
||||
|
||||
Private m_Name As String
|
||||
Public Property Name As String
|
||||
Get
|
||||
Return m_Name
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_Name = value
|
||||
m_GraphicName = Path.GetFileNameWithoutExtension(m_Name)
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_IsModify As Boolean
|
||||
Public Property IsModify As Boolean
|
||||
Get
|
||||
Return m_IsModify
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
m_IsModify = value
|
||||
If m_IsModify Then
|
||||
If Not m_GraphicName.Contains("*") Then m_GraphicName &= "*"
|
||||
Else
|
||||
m_GraphicName = Path.GetFileNameWithoutExtension(m_Name)
|
||||
End If
|
||||
NotifyPropertyChanged("GraphicName")
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_GraphicName As String
|
||||
Public Property GraphicName As String
|
||||
Get
|
||||
Return m_GraphicName
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_GraphicName = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Event PropertyChanged As PropertyChangedEventHandler Implements INotifyPropertyChanged.PropertyChanged
|
||||
|
||||
Public Sub NotifyPropertyChanged(propName As String)
|
||||
RaiseEvent PropertyChanged(Me, New PropertyChangedEventArgs(propName))
|
||||
End Sub
|
||||
End Class
|
||||
@@ -1,4 +1,4 @@
|
||||
<UserControl x:Class="ProjectManagerView"
|
||||
<UserControl x:Class="ProjectManagerV"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
Public Class ProjectManagerV
|
||||
|
||||
End Class
|
||||
@@ -4,14 +4,11 @@ Imports System.IO
|
||||
Imports EgtUILib
|
||||
Imports Ionic.zip
|
||||
|
||||
Public Class ProjectManagerViewModel
|
||||
Public Class ProjectManagerVM
|
||||
Implements INotifyPropertyChanged
|
||||
|
||||
#Region "FIELDS & PROPERTIES"
|
||||
|
||||
' Riferimento al MainWindowViewModel
|
||||
Private m_rfMainWindowViewModel As MainWindowViewModel
|
||||
|
||||
Friend m_CurrProject As Project
|
||||
|
||||
'Public ReadOnly Property MruFileNames As ObservableCollection(Of String)
|
||||
@@ -102,38 +99,8 @@ Public Class ProjectManagerViewModel
|
||||
|
||||
#Region "CONSTRUCTOR"
|
||||
|
||||
Sub New(ByRef MainWindowViewModel As MainWindowViewModel)
|
||||
m_rfMainWindowViewModel = MainWindowViewModel
|
||||
' controllo che la selezione di avvio sia settata sull'apertura dell'ultimo progetto
|
||||
'If OptionModule.m_SelectedOptionLauncher = "Last Project" Then
|
||||
' ' richiamo la funzione che già esiste per l'apertura dell'ultimo proegetto
|
||||
' Dim LauncherViewModel As LauncherViewModel = DirectCast(m_rfMainWindowViewModel.Launcher.DataContext, LauncherViewModel)
|
||||
' ' LauncherViewModel.OpenLastProject()
|
||||
'End If
|
||||
''Dim DoorManagerViewModel As DoorManagerViewModel = DirectCast(m_rfMainWindowViewModel.DoorManager.DataContext, DoorManagerViewModel)
|
||||
''Dim CurrProject As Project = DoorManagerViewModel.CurrProject
|
||||
' '' salvo il riferimento al progetto corrente
|
||||
''m_CurrProject = CurrProject
|
||||
' '' '' salvo path progetto
|
||||
'' ''CurrProject.Name = LastProject
|
||||
' '' '' Ripulisco lista porte
|
||||
'' ''CurrProject.DoorList.Clear()
|
||||
' '' '' Aggiungo porte trovate nella cartella ad un vettore
|
||||
'' ''Dim DDFFileArray() As String = Directory.GetFiles(LastProject)
|
||||
' '' '' ripulisco il nome della porta (cancello tutto il percorso del file lasciando solo il nome del file)
|
||||
'' ''For DDFIndex = 0 To DDFFileArray.Count - 1
|
||||
'' '' If Path.GetExtension(DDFFileArray(DDFIndex)).ToLower = ".ddf" Then
|
||||
'' '' ' lo aggiungo alla lista delle porte
|
||||
'' '' CurrProject.DoorList.Add(DDFFileArray(DDFIndex))
|
||||
'' '' End If
|
||||
'' ''Next
|
||||
' '' Notifico aggiornamento DoorList e Name per aggiornare la grafica
|
||||
''CurrProject.NotifyPropertyChanged("Name")
|
||||
''CurrProject.NotifyPropertyChanged("DoorList")
|
||||
' '' Se c'è almeno una porta la visualizzo
|
||||
''If CurrProject.DoorList.Count > 0 Then
|
||||
'' DoorManagerViewModel.SelectedDoor = CurrProject.DoorList(0)
|
||||
''End If
|
||||
Sub New()
|
||||
Map.SetRefProjectManagerVM(Me)
|
||||
End Sub
|
||||
|
||||
#End Region ' Constructor
|
||||
@@ -158,6 +125,9 @@ Public Class ProjectManagerViewModel
|
||||
''' Execute the New. This method is invoked by the NewCommand.
|
||||
''' </summary>
|
||||
Public Sub NewCmd()
|
||||
If Not Map.refAssemblyManagerVM.SaveCurrentAssembly() Then Return
|
||||
Map.refMainWindowVM.SelectedPage = MainWindowVM.ListPageEnum.nNothingSelected
|
||||
' visualizzo la text per inserire il nome del progetto (cioè la directory da creare)
|
||||
Dim SaveFileDialog As New EgtWPFLib5.EgtSaveFileDialog
|
||||
SaveFileDialog.Title = EgtMsg(50304)
|
||||
SaveFileDialog.Directory = IniFile.m_MyProjectDir & "\"
|
||||
@@ -166,28 +136,28 @@ Public Class ProjectManagerViewModel
|
||||
Return
|
||||
End If
|
||||
Directory.CreateDirectory(SaveFileDialog.FileName)
|
||||
Dim DoorManagerViewModel As DoorManagerViewModel = DirectCast(m_rfMainWindowViewModel.DoorManager.DataContext, DoorManagerViewModel)
|
||||
Dim CurrProject As Project = DoorManagerViewModel.CurrProject
|
||||
Dim CurrProject As Project = Map.refAssemblyManagerVM.CurrProject
|
||||
' salvo il riferimento al progetto corrente
|
||||
m_CurrProject = CurrProject
|
||||
' salvo path progetto
|
||||
CurrProject.Name = SaveFileDialog.FileName
|
||||
' Ripulisco lista porte
|
||||
CurrProject.DoorList.Clear()
|
||||
' se una porta è già aperta
|
||||
'If String.IsNullOrWhiteSpace(DirectCast(m_rfMainWindowViewModel.DoorManager.DataContext, DoorManagerViewModel).SelectedDoor) Then
|
||||
DirectCast(m_rfMainWindowViewModel.DoorParameters.DataContext, DoorParametersViewModel).CurrDoor = Nothing
|
||||
'' assegno all'inidirizzo della porta uno spazio vuoto
|
||||
'DirectCast(m_rfMainWindowViewModel.DoorManager.DataContext, DoorManagerViewModel).SelectedDoor = Nothing
|
||||
'End If
|
||||
CurrProject.AssemblyList.Clear()
|
||||
|
||||
'' se una porta è già aperta
|
||||
'Map.refDoorParametersVM.CurrPart = Nothing
|
||||
|
||||
Map.refAssemblyPageVM.CurrAssembly = Nothing
|
||||
Map.refPartPageVM.CurrPart = Nothing
|
||||
|
||||
EgtNewFile()
|
||||
EgtZoom(ZM.ALL)
|
||||
' Notifico aggiornamento DoorList e Name per aggiornare la grafica
|
||||
CurrProject.NotifyPropertyChanged("Name")
|
||||
CurrProject.NotifyPropertyChanged("DoorList")
|
||||
m_rfMainWindowViewModel.ProjectNameMsg = m_rfMainWindowViewModel.SetTitle(m_CurrProject.Name)
|
||||
m_rfMainWindowViewModel.ModifyTitle(True)
|
||||
'm_rfMainWindowViewModel.ProjectNameMsg = m_CurrProject.Name
|
||||
CurrProject.NotifyPropertyChanged("PartList")
|
||||
Map.refMainWindowVM.ProjectNameMsg = Map.refMainWindowVM.SetTitle(m_CurrProject.Name)
|
||||
Map.refMainWindowVM.ModifyTitle(True)
|
||||
'm_rfMainWindowVM.ProjectNameMsg = m_CurrProject.Name
|
||||
End Sub
|
||||
|
||||
#End Region ' NewCommand
|
||||
@@ -210,6 +180,7 @@ Public Class ProjectManagerViewModel
|
||||
''' Execute the Open. This method is invoked by the OpenCommand.
|
||||
''' </summary>
|
||||
Public Sub Open()
|
||||
If Not Map.refAssemblyManagerVM.SaveCurrentAssembly() Then Return
|
||||
Dim FolderBrowserDialog As New System.Windows.Forms.FolderBrowserDialog
|
||||
FolderBrowserDialog.SelectedPath = IniFile.m_MyProjectDir
|
||||
' mostriamo la finestra di dialogo aperta fino alla directory MyProjects
|
||||
@@ -217,36 +188,38 @@ Public Class ProjectManagerViewModel
|
||||
' se la risposta è diversa da OK esce
|
||||
Return
|
||||
End If
|
||||
Dim DoorManagerViewModel As DoorManagerViewModel = DirectCast(m_rfMainWindowViewModel.DoorManager.DataContext, DoorManagerViewModel)
|
||||
Dim CurrProject As Project = DoorManagerViewModel.CurrProject
|
||||
Dim CurrProject As Project = Map.refAssemblyManagerVM.CurrProject
|
||||
' salvo il riferimento al progetto corrente
|
||||
m_CurrProject = CurrProject
|
||||
' salvo path progetto
|
||||
CurrProject.Name = FolderBrowserDialog.SelectedPath
|
||||
' Ripulisco lista porte
|
||||
CurrProject.DoorList.Clear()
|
||||
CurrProject.AssemblyList.Clear()
|
||||
' Aggiungo porte trovate nella cartella ad un vettore
|
||||
Dim DDFFileArray() As String = Directory.GetFiles(FolderBrowserDialog.SelectedPath)
|
||||
' ripulisco il nome della porta (cancello tutto il percorso del file lasciando solo il nome del file)
|
||||
For DDFIndex = 0 To DDFFileArray.Count - 1
|
||||
If Path.GetExtension(DDFFileArray(DDFIndex)).ToLower = ".ddf" Then
|
||||
' lo aggiungo alla lista delle porte
|
||||
CurrProject.DoorList.Add(DDFFileArray(DDFIndex))
|
||||
Dim Local_Assembly As New AssemblyName
|
||||
Local_Assembly.Name = DDFFileArray(DDFIndex)
|
||||
Local_Assembly.IsModify = False
|
||||
CurrProject.AssemblyList.Add(Local_Assembly)
|
||||
End If
|
||||
Next
|
||||
' Notifico aggiornamento DoorList e Name per aggiornare la grafica
|
||||
CurrProject.NotifyPropertyChanged("Name")
|
||||
CurrProject.NotifyPropertyChanged("DoorList")
|
||||
CurrProject.NotifyPropertyChanged("AssemblyList")
|
||||
' Se c'è almeno una porta la visualizzo
|
||||
If CurrProject.DoorList.Count > 0 Then
|
||||
DoorManagerViewModel.ChooseSelectedDoor(CurrProject.DoorList(0))
|
||||
'DoorManagerViewModel.SelectedDoor = CurrProject.DoorList(0)
|
||||
If CurrProject.AssemblyList.Count > 0 Then
|
||||
Map.refAssemblyManagerVM.OpenSelectedAssembly(CurrProject.AssemblyList(0))
|
||||
'DoorManagerVM.SelectedDoor = CurrProject.DoorList(0)
|
||||
Else
|
||||
DirectCast(m_rfMainWindowViewModel.DoorParameters.DataContext, DoorParametersViewModel).CurrDoor = Nothing
|
||||
Map.refPartPageVM.CurrPart = Nothing
|
||||
EgtNewFile()
|
||||
EgtZoom(ZM.ALL)
|
||||
End If
|
||||
m_rfMainWindowViewModel.ProjectNameMsg = CurrProject.Name
|
||||
Map.refMainWindowVM.ProjectNameMsg = CurrProject.Name
|
||||
|
||||
End Sub
|
||||
|
||||
@@ -294,16 +267,26 @@ Public Class ProjectManagerViewModel
|
||||
''' </summary>
|
||||
Public Sub Save()
|
||||
Dim SetTitle As String
|
||||
Dim CurrDoor As Door = DirectCast(m_rfMainWindowViewModel.DoorParameters.DataContext, DoorParametersViewModel).CurrDoor
|
||||
Dim DoorManagerViewModel As DoorManagerViewModel = DirectCast(m_rfMainWindowViewModel.DoorManager.DataContext, DoorManagerViewModel)
|
||||
If Not String.IsNullOrWhiteSpace(DoorManagerViewModel.SelectedDoor) Then
|
||||
DoorManagerViewModel.DeleteNewDoor = 1
|
||||
If Not IsNothing(CurrDoor) Then
|
||||
SetTitle = DoorManagerViewModel.CurrProject.Name
|
||||
DdfFile.WriteDDF(CurrDoor, DoorManagerViewModel.SelectedDoor, True)
|
||||
CurrDoor.m_IsModifyDoor = False
|
||||
DirectCast(m_rfMainWindowViewModel.DoorParameters.DataContext, DoorParametersViewModel).bSetChange = False
|
||||
m_rfMainWindowViewModel.ProjectNameMsg = SetTitle
|
||||
Dim CurrAssembly As Assembly = Map.refAssemblyPageVM.CurrAssembly
|
||||
If Not String.IsNullOrWhiteSpace(Map.refAssemblyManagerVM.SelectedAssembly.Name) Then
|
||||
'Map.refDoorManagerVM.DeleteNewPart = 1
|
||||
If Not IsNothing(CurrAssembly) Then
|
||||
SetTitle = Map.refAssemblyManagerVM.CurrProject.Name
|
||||
'DdfFile.WriteDDFAssembly(CurrAssembly, Map.refDoorManagerVM.SelectedAssembly, True)
|
||||
Map.refAssemblyManagerVM.SelectedAssembly.IsModify = False
|
||||
Part.FirstReadingEdge = False
|
||||
Map.refAssemblyManagerVM.SelectedAssembly.NotifyPropertyChanged("IsModify")
|
||||
If Map.refAssemblyPageVM.CurrAssembly.GetArrayPartDoor(0).Door.IsNotAssembly Then
|
||||
DdfFile.WriteDDFPart(Map.refAssemblyPageVM.CurrAssembly.GetArrayPartDoor(0).Door, Map.refAssemblyManagerVM.SelectedAssembly.Name, True, False)
|
||||
DdfFile.WriteDDFAssembly(Map.refAssemblyPageVM.CurrAssembly, IniFile.m_sTempDir & "\" & TEMP_FILE, True)
|
||||
ExecDoors(Map.refSceneManagerVM.ProjectScene, IniFile.m_sTempDir & "\" & TEMP_FILE)
|
||||
Else
|
||||
DdfFile.WriteDDFAssembly(Map.refAssemblyPageVM.CurrAssembly, Map.refAssemblyManagerVM.SelectedAssembly.Name, True)
|
||||
DdfFile.WriteDDFAssembly(Map.refAssemblyPageVM.CurrAssembly, IniFile.m_sTempDir & "\" & TEMP_ASSEMBLY, True)
|
||||
ExecDoors(Map.refSceneManagerVM.ProjectScene, IniFile.m_sTempDir & "\" & TEMP_ASSEMBLY)
|
||||
Map.refAssemblyManagerVM.CurrProject.NotifyPropertyChanged("AssemblyList")
|
||||
End If
|
||||
|
||||
Else
|
||||
MessageBox.Show(EgtMsg(50128), EgtMsg(50101), MessageBoxButton.OK, MessageBoxImage.Exclamation)
|
||||
End If
|
||||
@@ -356,10 +339,10 @@ Public Class ProjectManagerViewModel
|
||||
''' Execute the Export. This method is invoked by the ExportCommand.
|
||||
''' </summary>
|
||||
Public Sub Options(ByVal param As Object)
|
||||
Dim OptionsWindow As New OptionsView
|
||||
Dim OptionsWindow As New OptionsV
|
||||
OptionsWindow.Height = 550
|
||||
OptionsWindow.Width = 550
|
||||
OptionsWindow.DataContext = New OptionsViewModel(m_rfMainWindowViewModel)
|
||||
OptionsWindow.Width = 650
|
||||
OptionsWindow.DataContext = New OptionsVM(Map.refMainWindowVM)
|
||||
OptionsWindow.Owner = Application.Current.MainWindow
|
||||
OptionsWindow.ShowDialog()
|
||||
End Sub
|
||||
@@ -379,12 +362,11 @@ Public Class ProjectManagerViewModel
|
||||
|
||||
Public Sub OpenLastProject()
|
||||
' Apro l'ultimo progetto
|
||||
Dim DoorManagerViewModel As DoorManagerViewModel = DirectCast(m_rfMainWindowViewModel.DoorManager.DataContext, DoorManagerViewModel)
|
||||
Dim CurrProject As Project = DoorManagerViewModel.CurrProject
|
||||
Dim CurrProject As Project = Map.refAssemblyManagerVM.CurrProject
|
||||
' carico il percorso dell'ultimo progetto salvato (sul file Config.ini)
|
||||
CurrProject.Name = OptionModule.m_sLastProject
|
||||
' ripulisco la lista di porte
|
||||
CurrProject.DoorList.Clear()
|
||||
CurrProject.AssemblyList.Clear()
|
||||
' verifico che esista la cartella
|
||||
If Directory.Exists(CurrProject.Name) Then
|
||||
' Aggiungo porte trovate nella cartella ad un vettore
|
||||
@@ -393,17 +375,22 @@ Public Class ProjectManagerViewModel
|
||||
For DDFIndex = 0 To DDFFileArray.Count - 1
|
||||
If Path.GetExtension(DDFFileArray(DDFIndex)).ToLower = ".ddf" Then
|
||||
' lo aggiungo alla lista delle porte
|
||||
CurrProject.DoorList.Add(DDFFileArray(DDFIndex))
|
||||
Dim Local_Assembly As New AssemblyName
|
||||
Local_Assembly.Name = DDFFileArray(DDFIndex)
|
||||
Local_Assembly.IsModify = False
|
||||
CurrProject.AssemblyList.Add(Local_Assembly)
|
||||
End If
|
||||
Next
|
||||
' Notifico aggiornamento DoorList e Name per aggiornare la grafica
|
||||
CurrProject.NotifyPropertyChanged("Name")
|
||||
CurrProject.NotifyPropertyChanged("DoorList")
|
||||
CurrProject.NotifyPropertyChanged("AssemblyList")
|
||||
Map.refMainWindowVM.ProjectNameMsg = CurrProject.Name
|
||||
Map.refMainWindowVM.ModifyTitle(False)
|
||||
' Se c'è almeno una porta la visualizzo
|
||||
If CurrProject.DoorList.Count > 0 Then
|
||||
DoorManagerViewModel.ChooseSelectedDoor(CurrProject.DoorList(0))
|
||||
If CurrProject.AssemblyList.Count > 0 Then
|
||||
'Map.refAssemblyManagerVM.SelectedAssembly = CurrProject.AssemblyList(0)
|
||||
Map.refAssemblyManagerVM.OpenSelectedAssembly(CurrProject.AssemblyList(0))
|
||||
End If
|
||||
m_rfMainWindowViewModel.ProjectNameMsg = CurrProject.Name
|
||||
End If
|
||||
End Sub
|
||||
|
||||
@@ -506,15 +493,11 @@ Public Class ProjectManagerViewModel
|
||||
End Try
|
||||
If bEx OrElse EgtWPFLib5.MapiMailMessage.m_ErrorCode <> 0 Then
|
||||
MessageBox.Show(String.Format(EgtMsg(MSG_TOPCOMMANDBAR + 12), sSupportAddress, sZipToCreate), EgtMsg(MSG_EGTDOORCREATOR + 118), MessageBoxButton.OK, MessageBoxImage.Information)
|
||||
Dim rfStatusBarView As StatusBarView = DirectCast(m_rfMainWindowViewModel.SceneManager.DataContext, SceneManagerViewModel).StatusBar
|
||||
Dim rfStatusBarViewModel As StatusBarViewModel = DirectCast(rfStatusBarView.DataContext, StatusBarViewModel)
|
||||
' stampo il messaggio nella StatusBar
|
||||
rfStatusBarViewModel.StatusOutput = EgtMsg(MSG_TOPCOMMANDBAR + 14)
|
||||
Map.refStatusBarVM.StatusOutput = EgtMsg(MSG_TOPCOMMANDBAR + 14)
|
||||
Else
|
||||
Dim rfStatusBarView As StatusBarView = DirectCast(m_rfMainWindowViewModel.SceneManager.DataContext, SceneManagerViewModel).StatusBar
|
||||
Dim rfStatusBarViewModel As StatusBarViewModel = DirectCast(rfStatusBarView.DataContext, StatusBarViewModel)
|
||||
' stampo il messaggio nella StatusBar
|
||||
rfStatusBarViewModel.StatusOutput = EgtMsg(MSG_TOPCOMMANDBAR + 14)
|
||||
Map.refStatusBarVM.StatusOutput = EgtMsg(MSG_TOPCOMMANDBAR + 14)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
@@ -532,8 +515,8 @@ Public Class ProjectManagerViewModel
|
||||
|
||||
Public Sub CreateTemplate()
|
||||
' se esite una porta, allora rendo possibile la creazione di un template della porta corrente
|
||||
If Not IsNothing(DirectCast(m_rfMainWindowViewModel.DoorParameters.DataContext, DoorParametersViewModel).CurrDoor) Then
|
||||
Dim rfCurrDoor As Door = DirectCast(m_rfMainWindowViewModel.DoorParameters.DataContext, DoorParametersViewModel).CurrDoor
|
||||
If Not IsNothing(Map.refPartPageVM.CurrPart) Then
|
||||
Dim rfCurrDoor As Part = Map.refPartPageVM.CurrPart
|
||||
' Stampo il file correte nella cartella Template
|
||||
|
||||
Dim SaveFileDialog As New EgtWPFLib5.EgtSaveFileDialog
|
||||
@@ -555,7 +538,7 @@ Public Class ProjectManagerViewModel
|
||||
Else
|
||||
SaveFileDialog.FileName &= K_DDTEXTENSION
|
||||
End If
|
||||
DdfFile.WriteDDF(rfCurrDoor, SaveFileDialog.FileName, False)
|
||||
DdfFile.WriteDDFPart(rfCurrDoor, SaveFileDialog.FileName, False, True)
|
||||
Else
|
||||
MessageBox.Show(EgtMsg(50155), EgtMsg(50101), MessageBoxButton.OK, MessageBoxImage.Exclamation)
|
||||
End If
|
||||
@@ -575,10 +558,7 @@ Public Class ProjectManagerViewModel
|
||||
End Property
|
||||
|
||||
Public Sub Guide()
|
||||
Dim rfGuideViewModel As New GuideViewModel
|
||||
Dim GuideWindow As New GuideView(Application.Current.MainWindow, rfGuideViewModel)
|
||||
GuideWindow.Height = 800
|
||||
GuideWindow.Width = 1500
|
||||
Dim GuideWindow As New GuideV(Application.Current.MainWindow, New GuideVM)
|
||||
GuideWindow.Show()
|
||||
End Sub
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
Public Class ProjectManagerView
|
||||
|
||||
End Class
|
||||
@@ -24,8 +24,12 @@ Module RegexFunction
|
||||
End Function
|
||||
|
||||
' restituisca la stringa di commento
|
||||
Friend Function SearchComments(sLine As String) As String
|
||||
Return Regex.Match(sLine, "\s*#\s*(.*?\b)\s*$").Groups(1).Value
|
||||
Friend Function SearchComments(sLine As String) As Boolean
|
||||
If String.IsNullOrEmpty(Regex.Match(sLine, "\s*#\s*(.*?\b)\s*$").Groups(1).Value) Then
|
||||
Return False
|
||||
Else
|
||||
Return True
|
||||
End If
|
||||
End Function
|
||||
|
||||
' restituisce la stringa che precede i commenti
|
||||
@@ -50,4 +54,28 @@ Module RegexFunction
|
||||
Return Regex.Match(sLine, " \s*\(*\s*(.*?\b)\s*\).*$").Groups(1).Value
|
||||
End Function
|
||||
|
||||
' Cerca la stringa con 3 trattini
|
||||
Friend Function Search3Score(sLine As String) As Boolean
|
||||
If Regex.Match(FindComments(sLine), "\s*(---).*$").Groups(1).Value = "---" Then Return True
|
||||
Return False
|
||||
End Function
|
||||
|
||||
' Cerca la stringa con 3 puntini
|
||||
Friend Function Search3Dots(sLine As String) As Boolean
|
||||
If Regex.Match(FindComments(sLine), "\s*(...).*$").Groups(1).Value = "..." Then Return True
|
||||
Return False
|
||||
End Function
|
||||
' restituisce il valore dopo i due punti
|
||||
Friend Function SearchKeyValue(sLine As String, sKey As String) As String
|
||||
Dim x = Regex.Match(FindComments(sLine), "\s*-*\s*" & sKey & "\s*:\s*(.*?\b)\s*$").Groups(1).Value
|
||||
Return Regex.Match(FindComments(sLine), "\s*-*\s*" & sKey & "\s*:\s*(.*?\b)\s*$").Groups(1).Value
|
||||
End Function
|
||||
|
||||
' cerca il nome che precede i due punti
|
||||
Friend Function SearchKey(sLine As String, sKey As String) As Boolean
|
||||
Dim x = FindComments(sLine)
|
||||
If Not Regex.Match(FindComments(sLine), "\s*(" & sKey & ")\s*:.*$").Groups(1).Value = sKey Then Return False
|
||||
Return True
|
||||
End Function
|
||||
|
||||
End Module
|
||||
|
||||
|
After Width: | Height: | Size: 2.0 KiB |
|
After Width: | Height: | Size: 2.2 KiB |
|
After Width: | Height: | Size: 2.0 KiB |
|
After Width: | Height: | Size: 409 B |
|
After Width: | Height: | Size: 407 B |
|
After Width: | Height: | Size: 412 B |
|
After Width: | Height: | Size: 624 B |
@@ -1,4 +1,4 @@
|
||||
<UserControl x:Class="InstrumentPanelView"
|
||||
<UserControl x:Class="InstrumentPanelV"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
Imports System.ComponentModel
|
||||
Imports EgtUILib
|
||||
|
||||
Public Class InstrumentPanelViewModel
|
||||
Public Class InstrumentPanelVM
|
||||
Implements INotifyPropertyChanged
|
||||
'riferimento alla scena
|
||||
Private m_rfSceneManagerViewModel As SceneManagerViewModel
|
||||
|
||||
#Region "FIELDS & PROPERTIES"
|
||||
|
||||
@@ -36,17 +35,17 @@ Public Class InstrumentPanelViewModel
|
||||
' se il bottone è selezionato (true) allora misura, altrimenti no (false)
|
||||
Public Sub GetDistance(bGetDistanceIsChecked As Boolean)
|
||||
If bGetDistanceIsChecked Then
|
||||
m_rfSceneManagerViewModel.ProjectScene.SetStatusGetDistance()
|
||||
'If DirectCast(m_rfSceneManagerViewModel.StatusBar.DataContext, StatusBarViewModel).ButtonVisibility = Visibility.Visible Then
|
||||
' DirectCast(m_rfSceneManagerViewModel.StatusBar.DataContext, StatusBarViewModel).ButtonVisibility = Visibility.Collapsed
|
||||
Map.refSceneManagerVM.ProjectScene.SetStatusGetDistance()
|
||||
'If DirectCast(m_rfSceneManagerVM.StatusBar.DataContext, StatusBarVM).ButtonVisibility = Visibility.Visible Then
|
||||
' DirectCast(m_rfSceneManagerVM.StatusBar.DataContext, StatusBarVM).ButtonVisibility = Visibility.Collapsed
|
||||
'End If
|
||||
Else
|
||||
m_rfSceneManagerViewModel.ProjectScene.ResetStatusGetDistance()
|
||||
m_rfSceneManagerViewModel.ProjectScene.SetStatusNull()
|
||||
Dim rfStatusBarViewModel As StatusBarViewModel = DirectCast(m_rfSceneManagerViewModel.StatusBar.DataContext, StatusBarViewModel)
|
||||
rfStatusBarViewModel.StatusOutput = String.Empty
|
||||
Map.refSceneManagerVM.ProjectScene.ResetStatusGetDistance()
|
||||
Map.refSceneManagerVM.ProjectScene.SetStatusNull()
|
||||
Dim rfStatusBarVM As StatusBarVM = Map.refStatusBarVM
|
||||
rfStatusBarVM.StatusOutput = String.Empty
|
||||
'' controllo che non ci siano errori nel disegno
|
||||
'm_rfSceneManagerViewModel.ShowGraphicError()
|
||||
'm_rfSceneManagerVM.ShowGraphicError()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
@@ -54,8 +53,8 @@ Public Class InstrumentPanelViewModel
|
||||
|
||||
#Region "CONSTRUCTOR"
|
||||
|
||||
Sub New(ByRef SceneManagerViewModel As SceneManagerViewModel)
|
||||
m_rfSceneManagerViewModel = SceneManagerViewModel
|
||||
Sub New()
|
||||
Map.SetRefInstrumentPanelVM(me)
|
||||
End Sub
|
||||
|
||||
#End Region ' CONSTRUCTOR
|
||||
@@ -1,4 +1,4 @@
|
||||
<UserControl x:Class="PopUpViewPanelView"
|
||||
<UserControl x:Class="PopUpViewPanelV"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
Public Class PopUpViewPanelV
|
||||
|
||||
End Class
|
||||
@@ -1,10 +1,8 @@
|
||||
Imports EgtUILib
|
||||
|
||||
Public Class PopUpViewPanelViewModel
|
||||
Public Class PopUpViewPanelVM
|
||||
|
||||
#Region "FIELDS & PROPERTIES"
|
||||
'riferimento alla secna
|
||||
Private m_rfSceneManagerViewModel As SceneManagerViewModel
|
||||
|
||||
' Definizione comandi
|
||||
Private m_cmdZoomIn As ICommand
|
||||
@@ -76,7 +74,7 @@ Public Class PopUpViewPanelViewModel
|
||||
''' Execute the ZoomIn. This method is invoked by the ZoomInCommand.
|
||||
''' </summary>
|
||||
Public Sub ZoomIn(ByVal param As Object)
|
||||
m_rfSceneManagerViewModel.ProjectScene.ZoomIn()
|
||||
Map.refSceneManagerVM.ProjectScene.ZoomIn()
|
||||
End Sub
|
||||
|
||||
#End Region ' ZoomInCommand
|
||||
@@ -99,7 +97,7 @@ Public Class PopUpViewPanelViewModel
|
||||
''' Execute the ZoomOut. This method is invoked by the ZoomOutCommand.
|
||||
''' </summary>
|
||||
Public Sub ZoomOut(ByVal param As Object)
|
||||
m_rfSceneManagerViewModel.ProjectScene.ZoomOut()
|
||||
Map.refSceneManagerVM.ProjectScene.ZoomOut()
|
||||
End Sub
|
||||
|
||||
#End Region ' ZoomOutCommand
|
||||
@@ -122,7 +120,7 @@ Public Class PopUpViewPanelViewModel
|
||||
''' Execute the IsoViewSE. This method is invoked by the IsoViewSECommand.
|
||||
''' </summary>
|
||||
Public Sub IsoViewSE(ByVal param As Object)
|
||||
m_rfSceneManagerViewModel.ProjectScene.IsoViewSE()
|
||||
Map.refSceneManagerVM.ProjectScene.IsoViewSE()
|
||||
End Sub
|
||||
|
||||
#End Region ' IsoViewSECommand
|
||||
@@ -145,7 +143,7 @@ Public Class PopUpViewPanelViewModel
|
||||
''' Execute the IsoViewNE. This method is invoked by the IsoViewNECommand.
|
||||
''' </summary>
|
||||
Public Sub IsoViewNE(ByVal param As Object)
|
||||
m_rfSceneManagerViewModel.ProjectScene.IsoViewNE()
|
||||
Map.refSceneManagerVM.ProjectScene.IsoViewNE()
|
||||
End Sub
|
||||
|
||||
#End Region ' IsoViewNECommand
|
||||
@@ -168,7 +166,7 @@ Public Class PopUpViewPanelViewModel
|
||||
''' Execute the IsoViewNW. This method is invoked by the IsoViewNWCommand.
|
||||
''' </summary>
|
||||
Public Sub IsoViewNW(ByVal param As Object)
|
||||
m_rfSceneManagerViewModel.ProjectScene.IsoViewNW()
|
||||
Map.refSceneManagerVM.ProjectScene.IsoViewNW()
|
||||
End Sub
|
||||
|
||||
#End Region ' IsoViewNWCommand
|
||||
@@ -191,15 +189,15 @@ Public Class PopUpViewPanelViewModel
|
||||
''' Execute the GetDist. This method is invoked by the GetDistCommand.
|
||||
''' </summary>
|
||||
Public Sub ViewToCPlane(ByVal param As Object)
|
||||
m_rfSceneManagerViewModel.ProjectScene.CPlaneView()
|
||||
Map.refSceneManagerVM.ProjectScene.CPlaneView()
|
||||
End Sub
|
||||
|
||||
#End Region ' ViewToCPlaneCommand
|
||||
|
||||
#End Region ' COMMANDS
|
||||
|
||||
Sub New(ByRef SceneManagerViewModel As SceneManagerViewModel)
|
||||
m_rfSceneManagerViewModel = SceneManagerViewModel
|
||||
Sub New()
|
||||
Map.SetRefPopUpViewPanelVM(Me)
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
@@ -1,3 +0,0 @@
|
||||
Public Class PopUpViewPanelView
|
||||
|
||||
End Class
|
||||
@@ -1,4 +1,4 @@
|
||||
<UserControl x:Class="RefreshPanelView"
|
||||
<UserControl x:Class="RefreshPanelV"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
|
||||
@@ -9,7 +9,13 @@
|
||||
</Button>
|
||||
<Button Content="{Binding MsgError}" Visibility="{Binding ButtonVisibility}"
|
||||
Command="{Binding ShowErrorBtnCommand}"/>
|
||||
<!--Command="{Binding DataContext.RefreshBtnCommand,RelativeSource={RelativeSource AncestorType={x:Type UserControl}}}"-->
|
||||
<!--Command="{Binding DataContext.RefreshBtnCommand,RelativeSource={RelativeSource AncestorType={x:Type UserControl}}}"-->
|
||||
<ToggleButton ToolTip="Assembly" Width="Auto" Content="Assembly"
|
||||
IsChecked="{Binding AssemblyIsChecked}"
|
||||
Command="{Binding AssemblyBtnCommand}"/>
|
||||
<ToggleButton ToolTip="Assembly" Width="Auto" Content="AssemblyExplose"
|
||||
IsChecked="{Binding AssemblyExploseIsChecked}"
|
||||
Command="{Binding AssemblyExploseBtnCommand}"/>
|
||||
</StackPanel>
|
||||
|
||||
</UserControl>
|
||||
@@ -2,9 +2,8 @@
|
||||
Imports EgtUILib
|
||||
|
||||
|
||||
Public Class RefreshPanelViewModel
|
||||
Public Class RefreshPanelVM
|
||||
Implements INotifyPropertyChanged
|
||||
Private m_rfSceneManagerViewModel As SceneManagerViewModel
|
||||
|
||||
Private m_MsgError As String
|
||||
Public Property MsgError As String
|
||||
@@ -28,6 +27,30 @@ Public Class RefreshPanelViewModel
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_AssemblyIsChecked As Boolean
|
||||
Public Property AssemblyIsChecked As Boolean
|
||||
Get
|
||||
Return m_AssemblyIsChecked
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
m_AssemblyIsChecked = value
|
||||
m_AssemblyExploseIsChecked = False
|
||||
NotifyPropertyChanged("AssemblyExploseIsChecked")
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_AssemblyExploseIsChecked As Boolean
|
||||
Public Property AssemblyExploseIsChecked As Boolean
|
||||
Get
|
||||
Return m_AssemblyExploseIsChecked
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
m_AssemblyExploseIsChecked = value
|
||||
m_AssemblyIsChecked = False
|
||||
NotifyPropertyChanged("AssemblyIsChecked")
|
||||
End Set
|
||||
End Property
|
||||
|
||||
#Region "Messages"
|
||||
Public ReadOnly Property RefreshMsg As String
|
||||
Get
|
||||
@@ -45,14 +68,14 @@ Public Class RefreshPanelViewModel
|
||||
End Property
|
||||
|
||||
#End Region
|
||||
|
||||
|
||||
|
||||
Private m_CmdRefreshBtn As ICommand
|
||||
Private m_CmdAssemblyBtn As ICommand
|
||||
Private m_CmdAssemblyExploseBtn As ICommand
|
||||
Private m_CmdNotAssemblyBtn As ICommand
|
||||
Private m_CmdShowErrorBtn As ICommand
|
||||
|
||||
Sub New(ByRef rSceneManagerViewModel As SceneManagerViewModel)
|
||||
m_rfSceneManagerViewModel = rSceneManagerViewModel
|
||||
Sub New()
|
||||
Map.SetRefRefreshPanelVM(Me)
|
||||
End Sub
|
||||
|
||||
#Region "COMMAND"
|
||||
@@ -66,7 +89,7 @@ Public Class RefreshPanelViewModel
|
||||
Get
|
||||
If m_CmdRefreshBtn Is Nothing Then
|
||||
' Richiamo il comando che già esiste
|
||||
m_CmdRefreshBtn = New Command(AddressOf m_rfSceneManagerViewModel.RefreshBtn)
|
||||
m_CmdRefreshBtn = New Command(AddressOf Map.refSceneManagerVM.RefreshBtn)
|
||||
End If
|
||||
Return m_CmdRefreshBtn
|
||||
End Get
|
||||
@@ -74,6 +97,34 @@ Public Class RefreshPanelViewModel
|
||||
|
||||
|
||||
#End Region ' RefreshBtnCommand
|
||||
|
||||
#Region "AssemblyBtnCommand"
|
||||
|
||||
''' <summary>
|
||||
''' Returns a command that do Exec.
|
||||
''' </summary>
|
||||
Public ReadOnly Property AssemblyBtnCommand As ICommand
|
||||
Get
|
||||
If m_CmdAssemblyBtn Is Nothing Then
|
||||
' Richiamo il comando che già esiste
|
||||
m_CmdAssemblyBtn = New Command(AddressOf Map.refSceneManagerVM.AssemblyBtn)
|
||||
End If
|
||||
Return m_CmdAssemblyBtn
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property AssemblyExploseBtnCommand As ICommand
|
||||
Get
|
||||
If m_CmdAssemblyExploseBtn Is Nothing Then
|
||||
' Richiamo il comando che già esiste
|
||||
m_CmdAssemblyExploseBtn = New Command(AddressOf Map.refSceneManagerVM.AssemblyExlposeBtn)
|
||||
End If
|
||||
Return m_CmdAssemblyExploseBtn
|
||||
End Get
|
||||
End Property
|
||||
|
||||
#End Region ' AssemblyBtnCommand
|
||||
|
||||
Friend m_MsgGraphic As String
|
||||
|
||||
Public ReadOnly Property ShowErrorBtnCommand As ICommand
|
||||
@@ -1,4 +1,4 @@
|
||||
<UserControl x:Class="SceneManagerView"
|
||||
<UserControl x:Class="SceneManagerV"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:EgtWPFLib5="clr-namespace:EgtWPFLib5;assembly=EgtWPFLib5"
|
||||
@@ -15,15 +15,15 @@
|
||||
IsTopDockable="True" IsBottomDockable="True" IsLeftDockable="False" IsRightDockable="False">
|
||||
<ContentPresenter Content="{Binding ShowPanel}"/>
|
||||
</EgtFloating:EgtFloatingPanel>
|
||||
<EgtFloating:EgtFloatingPanel Name="ViewPanel" IsFloating="False"
|
||||
<EgtFloating:EgtFloatingPanel Name="VPanel" IsFloating="False"
|
||||
IsTopDockable="True" IsBottomDockable="True" IsLeftDockable="False" IsRightDockable="False">
|
||||
<ContentPresenter Content="{Binding ViewPanel}"/>
|
||||
<ContentPresenter Content="{Binding PopUpViewPanel}" EgtFloating:EgtFloatingPanel.IsInPopUp="True"/>
|
||||
<ContentPresenter Content="{Binding VPanel}"/>
|
||||
<ContentPresenter Content="{Binding PopUpVPanel}" EgtFloating:EgtFloatingPanel.IsInPopUp="True"/>
|
||||
</EgtFloating:EgtFloatingPanel>
|
||||
<EgtFloating:EgtFloatingPanel Name="InstrumentPanel" IsFloating="False"
|
||||
IsTopDockable="True" IsBottomDockable="True" IsLeftDockable="False" IsRightDockable="False">
|
||||
<ContentPresenter Content="{Binding InstrumentPanel}"/>
|
||||
<!--<Button Content="{Binding RefreshMsg}" Style="{StaticResource GridViewPanelButton}"
|
||||
<!--<Button Content="{Binding RefreshMsg}" Style="{StaticResource GridVPanelButton}"
|
||||
ToolTip="{Binding RefreshToolTip}" Width="Auto"
|
||||
Command="{Binding DataContext.RefreshBtnCommand,RelativeSource={RelativeSource AncestorType={x:Type UserControl}}}"/>-->
|
||||
</EgtFloating:EgtFloatingPanel>
|
||||
@@ -35,8 +35,8 @@
|
||||
|
||||
<!--<EgtFloating:EgtFloatingPanel Name="GridPanel"
|
||||
IsTopDockable="True" IsBottomDockable="True" IsLeftDockable="False" IsRightDockable="False">
|
||||
<ContentPresenter Content="{Binding GridPanelViewModel}"/>
|
||||
<ContentPresenter Content="{Binding PopUpGridPanelViewModel}" EgtFloating:EgtFloatingPanel.IsInPopUp="True"/>
|
||||
<ContentPresenter Content="{Binding GridPanelVModel}"/>
|
||||
<ContentPresenter Content="{Binding PopUpGridPanelVModel}" EgtFloating:EgtFloatingPanel.IsInPopUp="True"/>
|
||||
</EgtFloating:EgtFloatingPanel>-->
|
||||
|
||||
<!--<EgtFloating:EgtFloatingPanel Name="StatuBar">
|
||||
@@ -0,0 +1,3 @@
|
||||
Public Class SceneManagerV
|
||||
|
||||
End Class
|
||||
@@ -4,73 +4,71 @@ Imports System.Windows.Forms.Integration
|
||||
Imports EgtUILib
|
||||
'Imports System.Text.RegularExpressions
|
||||
|
||||
Public Class SceneManagerViewModel
|
||||
Public Class SceneManagerVM
|
||||
Implements INotifyPropertyChanged
|
||||
' riferimento alla finestra principale
|
||||
Private m_rfMainWindowViewModel As MainWindowViewModel
|
||||
Friend bProtectKey As Boolean = True
|
||||
|
||||
Private m_ShowPanel As ShowPanelView
|
||||
Public ReadOnly Property ShowPanel As ShowPanelView
|
||||
Private m_ShowPanel As ShowPanelV
|
||||
Public ReadOnly Property ShowPanel As ShowPanelV
|
||||
Get
|
||||
If IsNothing(m_ShowPanel) Then
|
||||
m_ShowPanel = New ShowPanelView
|
||||
m_ShowPanel.DataContext = New ShowPanelViewModel(Me)
|
||||
m_ShowPanel = New ShowPanelV
|
||||
m_ShowPanel.DataContext = New ShowPanelVM()
|
||||
End If
|
||||
Return m_ShowPanel
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_ViewPanel As ViewPanelView
|
||||
Public ReadOnly Property ViewPanel As ViewPanelView
|
||||
Private m_ViewPanel As ViewPanelV
|
||||
Public ReadOnly Property ViewPanel As ViewPanelV
|
||||
Get
|
||||
If IsNothing(m_ViewPanel) Then
|
||||
m_ViewPanel = New ViewPanelView
|
||||
m_ViewPanel.DataContext = New ViewPanelViewModel(Me)
|
||||
m_ViewPanel = New ViewPanelV
|
||||
m_ViewPanel.DataContext = New ViewPanelVM(Me)
|
||||
End If
|
||||
Return m_ViewPanel
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_PopUpViewPanel As PopUpViewPanelView
|
||||
Public ReadOnly Property PopUpViewPanel As PopUpViewPanelView
|
||||
Private m_PopUpViewPanel As PopUpViewPanelV
|
||||
Public ReadOnly Property PopUpViewPanel As PopUpViewPanelV
|
||||
Get
|
||||
If IsNothing(m_PopUpViewPanel) Then
|
||||
m_PopUpViewPanel = New PopUpViewPanelView
|
||||
m_PopUpViewPanel.DataContext = New PopUpViewPanelViewModel(Me)
|
||||
m_PopUpViewPanel = New PopUpViewPanelV
|
||||
m_PopUpViewPanel.DataContext = New PopUpViewPanelVM()
|
||||
End If
|
||||
Return m_PopUpViewPanel
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_InstrumentPanel As InstrumentPanelView
|
||||
Public ReadOnly Property InstrumentPanel As InstrumentPanelView
|
||||
Private m_InstrumentPanel As InstrumentPanelV
|
||||
Public ReadOnly Property InstrumentPanel As InstrumentPanelV
|
||||
Get
|
||||
If IsNothing(m_InstrumentPanel) Then
|
||||
m_InstrumentPanel = New InstrumentPanelView
|
||||
m_InstrumentPanel.DataContext = New InstrumentPanelViewModel(Me)
|
||||
m_InstrumentPanel = New InstrumentPanelV
|
||||
m_InstrumentPanel.DataContext = New InstrumentPanelVM()
|
||||
End If
|
||||
Return m_InstrumentPanel
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_RefreshPanel As RefreshPanelView
|
||||
Public ReadOnly Property RefreshPanel As RefreshPanelView
|
||||
Private m_RefreshPanel As RefreshPanelV
|
||||
Public ReadOnly Property RefreshPanel As RefreshPanelV
|
||||
Get
|
||||
If IsNothing(m_RefreshPanel) Then
|
||||
m_RefreshPanel = New RefreshPanelView
|
||||
m_RefreshPanel.DataContext = New RefreshPanelViewModel(Me)
|
||||
m_RefreshPanel = New RefreshPanelV
|
||||
m_RefreshPanel.DataContext = New RefreshPanelVM()
|
||||
End If
|
||||
Return m_RefreshPanel
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_StatusBar As StatusBarView
|
||||
Public ReadOnly Property StatusBar As StatusBarView
|
||||
Private m_StatusBar As StatusBarV
|
||||
Public ReadOnly Property StatusBar As StatusBarV
|
||||
Get
|
||||
If IsNothing(m_StatusBar) Then
|
||||
m_StatusBar = New StatusBarView
|
||||
m_StatusBar.DataContext = New StatusBarViewModel(Me)
|
||||
m_StatusBar = New StatusBarV
|
||||
m_StatusBar.DataContext = New StatusBarVM()
|
||||
End If
|
||||
Return m_StatusBar
|
||||
End Get
|
||||
@@ -101,12 +99,12 @@ Public Class SceneManagerViewModel
|
||||
MessageBox.Show(EgtMsg(MSG_MISSINGKEYWD + 2) & vbCrLf & EgtMsg(MSG_MISSINGKEYWD + 3), EgtMsg(MSG_MISSINGKEYWD + 1), MessageBoxButton.OK, MessageBoxImage.Error)
|
||||
' Chiudo il programma
|
||||
Application.Current.Shutdown()
|
||||
' Verifico abilitazione prodotto
|
||||
' Verifico abilitazione prodotto
|
||||
ElseIf (IniFile.m_nKeyOptions And KEY_OPT.DOORCREATOR) = 0 Then
|
||||
MsgBox(EgtMsg(MSG_MISSINGKEYWD + 5), MsgBoxStyle.OkOnly, EgtMsg(MSG_MISSINGKEYWD + 1))
|
||||
' Chiudo il programma
|
||||
Application.Current.Shutdown()
|
||||
' Tutto bene
|
||||
' Tutto bene
|
||||
Else
|
||||
EgtSetCurrentContext(m_ProjectScene.GetCtx)
|
||||
PostInitializeScene()
|
||||
@@ -122,9 +120,10 @@ Public Class SceneManagerViewModel
|
||||
|
||||
' definizione comando
|
||||
Private m_CmdRefreshBtn As ICommand
|
||||
'Private m_CmdAssemblyBtn As ICommand
|
||||
|
||||
Sub New(ByRef MainWindowViewModel As MainWindowViewModel)
|
||||
m_rfMainWindowViewModel = MainWindowViewModel
|
||||
Sub New()
|
||||
Map.SetRefSceneManagerVM(Me)
|
||||
End Sub
|
||||
|
||||
Private Sub PreInitializeScene()
|
||||
@@ -192,30 +191,31 @@ Public Class SceneManagerViewModel
|
||||
While String.IsNullOrEmpty(FileContent(IndexLine)) AndAlso IndexLine < FileContent.Count
|
||||
IndexLine += 1
|
||||
End While
|
||||
DirectCast(Me.RefreshPanel.DataContext, RefreshPanelViewModel).m_MsgGraphic = FileContent(IndexLine)
|
||||
DirectCast(Me.RefreshPanel.DataContext, RefreshPanelVM).m_MsgGraphic = FileContent(IndexLine)
|
||||
'MessageBox.Show(FileContent(IndexLine), "Error", MessageBoxButton.OK, MessageBoxImage.Error)
|
||||
' se compare u errore disattivo il righello
|
||||
DirectCast(Me.InstrumentPanel.DataContext, InstrumentPanelViewModel).GetDistIsChecked = False
|
||||
DirectCast(Me.InstrumentPanel.DataContext, InstrumentPanelVM).GetDistIsChecked = False
|
||||
' rendo visibile il bottone dell'errore
|
||||
DirectCast(Me.RefreshPanel.DataContext, RefreshPanelViewModel).ButtonVisibility = Visibility.Visible
|
||||
DirectCast(Me.RefreshPanel.DataContext, RefreshPanelViewModel).MsgError = EgtMsg(50101) & nMsgErr
|
||||
DirectCast(Me.RefreshPanel.DataContext, RefreshPanelVM).ButtonVisibility = Visibility.Visible
|
||||
DirectCast(Me.RefreshPanel.DataContext, RefreshPanelVM).MsgError = EgtMsg(50101) & nMsgErr
|
||||
' altrimenti un avvertimento
|
||||
ElseIf nMsgErr < 0 Then
|
||||
While String.IsNullOrEmpty(FileContent(IndexLine)) AndAlso IndexLine < FileContent.Count
|
||||
IndexLine += 1
|
||||
End While
|
||||
DirectCast(Me.RefreshPanel.DataContext, RefreshPanelViewModel).m_MsgGraphic = FileContent(IndexLine)
|
||||
DirectCast(Me.RefreshPanel.DataContext, RefreshPanelVM).m_MsgGraphic = FileContent(IndexLine)
|
||||
'MessageBox.Show(FileContent(IndexLine), "Warning", MessageBoxButton.OK, MessageBoxImage.Warning)
|
||||
DirectCast(Me.RefreshPanel.DataContext, RefreshPanelViewModel).ButtonVisibility = Visibility.Visible
|
||||
DirectCast(Me.RefreshPanel.DataContext, RefreshPanelViewModel).MsgError = EgtMsg(50144) & nMsgErr
|
||||
DirectCast(Me.RefreshPanel.DataContext, RefreshPanelVM).ButtonVisibility = Visibility.Visible
|
||||
DirectCast(Me.RefreshPanel.DataContext, RefreshPanelVM).MsgError = EgtMsg(50144) & nMsgErr
|
||||
End If
|
||||
|
||||
If nMsgErr = 0 Then
|
||||
'DirectCast(Me.StatusBar.DataContext, StatusBarViewModel).StatusOutput = String.Empty
|
||||
DirectCast(Me.RefreshPanel.DataContext, RefreshPanelViewModel).ButtonVisibility = Visibility.Collapsed
|
||||
'DirectCast(Me.StatusBar.DataContext, StatusBarVM).StatusOutput = String.Empty
|
||||
DirectCast(Me.RefreshPanel.DataContext, RefreshPanelVM).ButtonVisibility = Visibility.Collapsed
|
||||
End If
|
||||
End Sub
|
||||
|
||||
|
||||
#Region "COMMAND"
|
||||
|
||||
#Region "RefreshBtnCommand"
|
||||
@@ -235,38 +235,83 @@ Public Class SceneManagerViewModel
|
||||
''' <summary>
|
||||
''' Execute the Exec. This method is invoked by the ExecCommand.
|
||||
''' </summary>
|
||||
'''
|
||||
Friend Shared nComposeAssembly As Integer
|
||||
Public Sub RefreshBtn()
|
||||
Dim rfDoorParametersViewModel As DoorParametersViewModel = DirectCast(m_rfMainWindowViewModel.DoorParameters.DataContext, DoorParametersViewModel)
|
||||
Dim rfDoorParametersVM As PartPageVM = Map.refPartPageVM
|
||||
Dim CurrDoorPath As String = IniFile.m_sTempDir & "\" & TEMP_FILE
|
||||
If Not IsNothing(rfDoorParametersViewModel.CurrDoor) AndAlso Not String.IsNullOrWhiteSpace(DirectCast(m_rfMainWindowViewModel.DoorManager.DataContext, DoorManagerViewModel).SelectedDoor) Then
|
||||
DdfFile.WriteDDF(rfDoorParametersViewModel.CurrDoor, CurrDoorPath, True)
|
||||
If Map.refMainWindowVM.SelectedPage = MainWindowVM.ListPageEnum.nDDFPage Then
|
||||
DdfFile.WriteDDFPart(Map.refPartPageVM.CurrPart, CurrDoorPath, True, False)
|
||||
DdfFile.WriteDDFAssembly(Map.refAssemblyPageVM.CurrAssembly, IniFile.m_sTempDir & "\" & TEMP_ASSEMBLY, True)
|
||||
ExecDoors(m_ProjectScene, CurrDoorPath)
|
||||
ComposeAssembly(nComposeAssembly)
|
||||
Else
|
||||
DdfFile.WriteDDFAssembly(Map.refAssemblyPageVM.CurrAssembly, IniFile.m_sTempDir & "\" & TEMP_ASSEMBLY, True)
|
||||
ExecDoors(m_ProjectScene, IniFile.m_sTempDir & "\" & TEMP_ASSEMBLY)
|
||||
ComposeAssembly(nComposeAssembly)
|
||||
End If
|
||||
ShowGraphicError()
|
||||
End Sub
|
||||
|
||||
#End Region ' RefreshBtnCommand
|
||||
|
||||
#Region "AssemblyBtnCommand"
|
||||
|
||||
Public Sub AssemblyBtn()
|
||||
If nComposeAssembly = 1 Then
|
||||
NotAssemblyBtn()
|
||||
Else
|
||||
nComposeAssembly = 1
|
||||
End If
|
||||
RefreshBtn()
|
||||
End Sub
|
||||
Public Sub AssemblyExlposeBtn()
|
||||
If nComposeAssembly = 2 Then
|
||||
NotAssemblyBtn()
|
||||
Else
|
||||
nComposeAssembly = 2
|
||||
End If
|
||||
RefreshBtn()
|
||||
End Sub
|
||||
Public Sub NotAssemblyBtn()
|
||||
nComposeAssembly = 0
|
||||
End Sub
|
||||
|
||||
#End Region ' AssemblyBtn
|
||||
|
||||
#End Region ' Command
|
||||
|
||||
Public Sub ComposeAssembly(nAssembl As Integer)
|
||||
If Not File.Exists(IniFile.m_sDoorsDirPath & "\" & "Main_Assemb.lua") Then
|
||||
EgtOutLog("SetUp error: SetUp configuration file (" & IniFile.m_sDoorsDirPath & "\" & "Main_Assemb.lua)" & " doesn't exist ")
|
||||
MessageBox.Show("File (" & IniFile.m_sDoorsDirPath & "\" & "Main_Assemb.lua)" & " doesn't exist ", "Warning", MessageBoxButton.OK, MessageBoxImage.Warning)
|
||||
'Return False
|
||||
Else
|
||||
EgtLuaExecFile(IniFile.m_sDoorsDirPath & "\" & "Main_Assemb.lua")
|
||||
EgtLuaSetGlobIntVar("STU.Assembl", nAssembl)
|
||||
Dim x = EgtLuaCallFunction("STU.Assembled")
|
||||
EgtLuaResetGlobVar("STU")
|
||||
End If
|
||||
End Sub
|
||||
|
||||
#Region "EVENTS"
|
||||
|
||||
Sub m_ProjectScene_OnChangedSnapPointType(sender As Object, nSpType As EgtUILib.EgtInterface.SP, bForced As Boolean) Handles m_ProjectScene.OnChangedSnapPointType
|
||||
Dim rfStatusBarViewModel As StatusBarViewModel = DirectCast(m_StatusBar.DataContext, StatusBarViewModel)
|
||||
For SnapIndex = 0 To rfStatusBarViewModel.SnapPointTypeList.Count - 1
|
||||
Dim TempSnapPoint As SPItem = rfStatusBarViewModel.SnapPointTypeList(SnapIndex)
|
||||
Dim rfStatusBarVM As StatusBarVM = DirectCast(m_StatusBar.DataContext, StatusBarVM)
|
||||
For SnapIndex = 0 To rfStatusBarVM.SnapPointTypeList.Count - 1
|
||||
Dim TempSnapPoint As SPItem = rfStatusBarVM.SnapPointTypeList(SnapIndex)
|
||||
If TempSnapPoint.SPValue = nSpType Then
|
||||
rfStatusBarViewModel.SnapPointSelect = TempSnapPoint
|
||||
rfStatusBarVM.SnapPointSelect = TempSnapPoint
|
||||
End If
|
||||
Next
|
||||
End Sub
|
||||
|
||||
Sub m_ProjectScene_OnShowDistance(sender As Object, sDistance As String) Handles m_ProjectScene.OnShowDistance
|
||||
' se deseleziono il righello
|
||||
Dim rfStatusBarViewModel As StatusBarViewModel = DirectCast(m_StatusBar.DataContext, StatusBarViewModel)
|
||||
Dim rfInstrumentPanel As InstrumentPanelViewModel = DirectCast(m_InstrumentPanel.DataContext, InstrumentPanelViewModel)
|
||||
Dim rfStatusBarVM As StatusBarVM = DirectCast(m_StatusBar.DataContext, StatusBarVM)
|
||||
Dim rfInstrumentPanel As InstrumentPanelVM = DirectCast(m_InstrumentPanel.DataContext, InstrumentPanelVM)
|
||||
' restituisco una stringa vuota alla textblock che contiene la distanza
|
||||
rfStatusBarViewModel.StatusOutput = sDistance
|
||||
rfStatusBarVM.StatusOutput = sDistance
|
||||
End Sub
|
||||
|
||||
#End Region
|
||||
@@ -1,3 +0,0 @@
|
||||
Public Class SceneManagerView
|
||||
|
||||
End Class
|
||||
@@ -1,4 +1,4 @@
|
||||
<UserControl x:Class="ShowPanelView"
|
||||
<UserControl x:Class="ShowPanelV"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
|
||||
@@ -1,15 +1,11 @@
|
||||
Imports System.ComponentModel
|
||||
Imports EgtUILib
|
||||
|
||||
Public Class ShowPanelViewModel
|
||||
Public Class ShowPanelVM
|
||||
Implements INotifyPropertyChanged
|
||||
|
||||
#Region "FIELDS & PROPERTIES"
|
||||
|
||||
' riferimento alla scena
|
||||
Private m_rfSceneManagerViewmodel As SceneManagerViewModel
|
||||
|
||||
|
||||
' Definizione comandi
|
||||
Private m_cmdWireframe As ICommand
|
||||
Private m_cmdHiddenLine As ICommand
|
||||
@@ -52,7 +48,7 @@ Public Class ShowPanelViewModel
|
||||
If value <> m_WireframeIsChecked Then
|
||||
m_WireframeIsChecked = value
|
||||
If value Then
|
||||
m_rfSceneManagerViewmodel.ProjectScene.WireFrame()
|
||||
Map.refSceneManagerVM.ProjectScene.WireFrame()
|
||||
NotifyPropertyChanged("WireframeIsChecked")
|
||||
End If
|
||||
End If
|
||||
@@ -68,7 +64,7 @@ Public Class ShowPanelViewModel
|
||||
If value <> m_HiddenLineIsChecked Then
|
||||
m_HiddenLineIsChecked = value
|
||||
If value Then
|
||||
m_rfSceneManagerViewmodel.ProjectScene.HiddenLine()
|
||||
Map.refSceneManagerVM.ProjectScene.HiddenLine()
|
||||
NotifyPropertyChanged("HiddenLineIsChecked")
|
||||
End If
|
||||
End If
|
||||
@@ -84,7 +80,7 @@ Public Class ShowPanelViewModel
|
||||
If value <> m_ShadingIsChecked Then
|
||||
m_ShadingIsChecked = value
|
||||
If value Then
|
||||
m_rfSceneManagerViewmodel.ProjectScene.Shading()
|
||||
Map.refSceneManagerVM.ProjectScene.Shading()
|
||||
NotifyPropertyChanged("ShadingIsChecked")
|
||||
End If
|
||||
End If
|
||||
@@ -109,9 +105,8 @@ Public Class ShowPanelViewModel
|
||||
|
||||
#Region "CONSTRUCTOR"
|
||||
|
||||
Sub New(ByRef SceneManagerViewmodel As SceneManagerViewModel)
|
||||
m_rfSceneManagerViewmodel = SceneManagerViewmodel
|
||||
|
||||
Sub New()
|
||||
Map.SetRefShowPanelVM(Me)
|
||||
''Application.Msn.Register(Application.SHOWMODESTATE, Sub(nShowModeState As Integer)
|
||||
' If nShowModeState = SM.WIREFRAME Then
|
||||
' WireframeIsChecked = True
|
||||
@@ -1,4 +1,4 @@
|
||||
<UserControl x:Class="ViewPanelView"
|
||||
<UserControl x:Class="ViewPanelV"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
Imports EgtUILib
|
||||
|
||||
Public Class ViewPanelViewModel
|
||||
Public Class ViewPanelVM
|
||||
|
||||
#Region "FIELDS & PROPERTIES"
|
||||
' riferimento alla finestra principale
|
||||
Private m_rfScenemanagerViewModel As SceneManagerViewModel
|
||||
Private m_rfScenemanagerVM As SceneManagerVM
|
||||
|
||||
' Definizione comandi
|
||||
Private m_cmdZoomAll As ICommand
|
||||
@@ -83,7 +83,7 @@ Public Class ViewPanelViewModel
|
||||
''' Execute the ZoomAll. This method is invoked by the ZoomAllCommand.
|
||||
''' </summary>
|
||||
Public Sub ZoomAll(ByVal param As Object)
|
||||
m_rfScenemanagerViewModel.ProjectScene.ZoomAll()
|
||||
m_rfScenemanagerVM.ProjectScene.ZoomAll()
|
||||
End Sub
|
||||
|
||||
#End Region ' ZoomAllCommand
|
||||
@@ -106,7 +106,7 @@ Public Class ViewPanelViewModel
|
||||
''' Execute the TopView. This method is invoked by the TopViewCommand.
|
||||
''' </summary>
|
||||
Public Sub TopView(ByVal param As Object)
|
||||
m_rfScenemanagerViewModel.ProjectScene.TopView()
|
||||
m_rfScenemanagerVM.ProjectScene.TopView()
|
||||
End Sub
|
||||
|
||||
#End Region ' TopViewCommand
|
||||
@@ -129,7 +129,7 @@ Public Class ViewPanelViewModel
|
||||
''' Execute the FrontView. This method is invoked by the FrontViewCommand.
|
||||
''' </summary>
|
||||
Public Sub FrontView(ByVal param As Object)
|
||||
m_rfScenemanagerViewModel.ProjectScene.FrontView()
|
||||
m_rfScenemanagerVM.ProjectScene.FrontView()
|
||||
End Sub
|
||||
|
||||
#End Region ' FrontViewCommand
|
||||
@@ -152,7 +152,7 @@ Public Class ViewPanelViewModel
|
||||
''' Execute the LeftView. This method is invoked by the LeftViewCommand.
|
||||
''' </summary>
|
||||
Public Sub LeftView(ByVal param As Object)
|
||||
m_rfScenemanagerViewModel.ProjectScene.LeftView()
|
||||
m_rfScenemanagerVM.ProjectScene.LeftView()
|
||||
End Sub
|
||||
|
||||
#End Region ' LeftViewCommand
|
||||
@@ -175,7 +175,7 @@ Public Class ViewPanelViewModel
|
||||
''' Execute the BackView. This method is invoked by the BackViewCommand.
|
||||
''' </summary>
|
||||
Public Sub BackView(ByVal param As Object)
|
||||
m_rfScenemanagerViewModel.ProjectScene.BackView()
|
||||
m_rfScenemanagerVM.ProjectScene.BackView()
|
||||
End Sub
|
||||
|
||||
#End Region ' BackViewCommand
|
||||
@@ -198,7 +198,7 @@ Public Class ViewPanelViewModel
|
||||
''' Execute the RightView. This method is invoked by the RightViewCommand.
|
||||
''' </summary>
|
||||
Public Sub RightView(ByVal param As Object)
|
||||
m_rfScenemanagerViewModel.ProjectScene.RightView()
|
||||
m_rfScenemanagerVM.ProjectScene.RightView()
|
||||
End Sub
|
||||
#End Region ' RightViewCommand
|
||||
|
||||
@@ -220,15 +220,15 @@ Public Class ViewPanelViewModel
|
||||
''' Execute the IsoViewSW. This method is invoked by the IsoViewSWCommand.
|
||||
''' </summary>
|
||||
Public Sub IsoViewSW(ByVal param As Object)
|
||||
m_rfScenemanagerViewModel.ProjectScene.IsoViewSW()
|
||||
m_rfScenemanagerVM.ProjectScene.IsoViewSW()
|
||||
End Sub
|
||||
|
||||
#End Region ' IsoViewSWCommand
|
||||
|
||||
#End Region ' COMMANDS
|
||||
|
||||
Sub New(ByRef SceneManagerViewModel As SceneManagerViewModel)
|
||||
m_rfScenemanagerViewModel = SceneManagerViewModel
|
||||
Sub New(ByRef SceneManagerVM As SceneManagerVM)
|
||||
m_rfScenemanagerVM = SceneManagerVM
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
@@ -1,4 +1,4 @@
|
||||
<UserControl x:Class="StatusBarView"
|
||||
<UserControl x:Class="StatusBarV"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:EgtWPFLib5="clr-namespace:EgtWPFLib5;assembly=EgtWPFLib5"
|
||||
@@ -5,9 +5,8 @@ Imports EgtUILib
|
||||
Imports System.Threading
|
||||
Imports System.ComponentModel
|
||||
|
||||
Public Class StatusBarViewModel
|
||||
Public Class StatusBarVM
|
||||
Implements INotifyPropertyChanged
|
||||
Private m_rfSceneManagerViewModel As SceneManagerViewModel
|
||||
|
||||
#Region "FIELDS & PROPERTIES"
|
||||
|
||||
@@ -63,13 +62,13 @@ Public Class StatusBarViewModel
|
||||
|
||||
' applica la selezione del punto notevole
|
||||
Public Sub ActivateSnapPointSelected(SnapPoint As SPItem)
|
||||
m_rfSceneManagerViewModel.ProjectScene.SetSnapPointType(SnapPoint.SPValue)
|
||||
Map.refSceneManagerVM.ProjectScene.SetSnapPointType(SnapPoint.SPValue)
|
||||
End Sub
|
||||
|
||||
#Region "CONSTRUCTOR"
|
||||
|
||||
Sub New(ByRef SceneManagerViewModel As SceneManagerViewModel)
|
||||
m_rfSceneManagerViewModel = SceneManagerViewModel
|
||||
Sub New()
|
||||
Map.SetRefStatusBarVM(Me)
|
||||
End Sub
|
||||
|
||||
#End Region ' Constructor
|
||||
@@ -1,8 +1,73 @@
|
||||
Imports System.Collections.ObjectModel
|
||||
Imports System.Globalization
|
||||
Imports EgtUILib
|
||||
Imports System.Text.RegularExpressions
|
||||
Imports System.IO
|
||||
|
||||
Public Module Utility
|
||||
Public Function SearchFileConfig(ByRef FrameCompoFile As String, ByRef FrameCompoFileConfig As String) As Boolean
|
||||
Dim bFileConfig As Boolean = False
|
||||
FrameCompoFile = IniFile.m_CompoDir & "\" & FrameCompoFile
|
||||
FrameCompoFileConfig = FrameCompoFile
|
||||
If Not File.Exists(FrameCompoFileConfig) Then
|
||||
FrameCompoFileConfig = FrameCompoFileConfig & ".lua"
|
||||
End If
|
||||
If File.Exists(FrameCompoFileConfig) Then
|
||||
FrameCompoFileConfig = FrameCompoFileConfig.Remove(FrameCompoFileConfig.LastIndexOf("\"))
|
||||
While Not bFileConfig And Not FrameCompoFileConfig.Count < 2
|
||||
Dim CurrDirectory() As String = Directory.GetFiles(FrameCompoFileConfig)
|
||||
Dim Index As Integer = 0
|
||||
FrameCompoFileConfig &= "\" & ConstCompo.CONFIGINI_FILE_NAME
|
||||
For Index = 0 To CurrDirectory.Count - 1
|
||||
If CurrDirectory(Index) = FrameCompoFileConfig Then
|
||||
bFileConfig = True
|
||||
Exit While
|
||||
End If
|
||||
Next
|
||||
FrameCompoFileConfig = FrameCompoFileConfig.Remove(FrameCompoFileConfig.LastIndexOf("\"))
|
||||
FrameCompoFileConfig = FrameCompoFileConfig.Remove(FrameCompoFileConfig.LastIndexOf("\"))
|
||||
End While
|
||||
End If
|
||||
Return bFileConfig
|
||||
End Function
|
||||
|
||||
' aggiuge un asterisco al nome dell'assemblato da stampare nel bottone
|
||||
Public Function SetNameCurrAssemblyAsNew(ByVal value As String) As String
|
||||
If Not IsNothing(value) Then
|
||||
If Not value.Contains("*") Then
|
||||
If value.EndsWith(".ddf") Then
|
||||
value = value.Insert(value.Count - 4, "*")
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
Return value
|
||||
End Function
|
||||
' elimina l'asterisco dal nome dell'assemblato
|
||||
Public Function SetNameCurrAssemblyAsSaved(ByVal value As String) As String
|
||||
If Not IsNothing(value) Then
|
||||
If value.Contains("*") Then
|
||||
value = value.Remove(value.IndexOf("*"))
|
||||
value &= K_DDFEXTENSION
|
||||
End If
|
||||
End If
|
||||
Return value
|
||||
End Function
|
||||
|
||||
Friend Function StringToChar(ByVal sValue As String) As Char()
|
||||
Dim cValue(sValue.Count) As Char
|
||||
For Index As Integer = 0 To sValue.Count - 1
|
||||
cValue(Index) = sValue(Index)
|
||||
Next
|
||||
Return cValue
|
||||
End Function
|
||||
|
||||
Friend Function CharToString(ByVal cValue() As Char, ByVal sValue As String) As String
|
||||
sValue = String.Empty
|
||||
For Index As Integer = 0 To cValue.Count - 1
|
||||
sValue &= cValue(Index)
|
||||
Next
|
||||
Return sValue
|
||||
End Function
|
||||
|
||||
Friend Function DoubleToString(ByVal dVal As Double, ByVal nNumDec As Integer) As String
|
||||
Dim sFormat As String = "F" + Math.Abs(nNumDec).ToString()
|
||||
@@ -31,6 +96,33 @@ Public Module Utility
|
||||
End If
|
||||
End Function
|
||||
|
||||
' restituice la riga scommentata
|
||||
Public Function FindComments(sLine As String) As String
|
||||
' se riapplicando la lettura della riga commentata ottengo che esite almeno un # allora
|
||||
If SearchComments(sLine) Then
|
||||
If Regex.Match(sLine, "\s*##\s*(.*?\b)\s*$").Groups(1).Value.Contains("#") Then
|
||||
' è ancora un commento, quindi restituisco una riga vuota
|
||||
Return SearchStringBeforeComments(sLine)
|
||||
Return String.Empty
|
||||
Else
|
||||
Return Regex.Match(sLine, "\s*##\s*(.*?\b)\s*$").Groups(1).Value
|
||||
End If
|
||||
Else
|
||||
' altrimenti restituisci la stringa che precede il commento
|
||||
Return sLine
|
||||
End If
|
||||
End Function
|
||||
|
||||
' salto gli spazi vuoti finoa alla prima riga piena
|
||||
Public Function SkipWhiteSpace(Array() As String, ByRef Index As Integer) As Integer
|
||||
Array(Index) = FindComments(Array(Index))
|
||||
While String.IsNullOrWhiteSpace(Array(Index)) And Index < Array.Count - 1
|
||||
Index += 1
|
||||
Array(Index) = FindComments(Array(Index))
|
||||
End While
|
||||
Return Index
|
||||
End Function
|
||||
|
||||
'Converte il valore Boolean in una stringa ON/OFF (attributo machining)
|
||||
Public Function ConvertBooleanToOnOff(bValue As Boolean) As String
|
||||
If bValue Then
|
||||
|
||||