-diviso pagina ConfigurationPageV in 3 pagine General_ConfigurationPageV, QParameter_ConfigurationPageV e Machine_ConfigurationPageV

-Spostato queste finestre nel Core
This commit is contained in:
Demetrio Cassarino
2023-12-13 16:09:38 +01:00
parent 6e4da2e5ff
commit a8eb4910bc
39 changed files with 2482 additions and 415 deletions
@@ -0,0 +1,155 @@
<EgtWPFLib5:EgtCustomWindow x:Class="BeamMachiningsWindowV"
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"
xmlns:EgtBEAMWALLCORE="clr-namespace:EgtBEAMWALL.Core;assembly=EgtBEAMWALL.Core"
Title="{Binding Title}"
Style="{DynamicResource {x:Type EgtWPFLib5:EgtCustomWindow}}"
WindowStyle="None" ResizeMode="NoResize"
Width="500" Height="450"
IsResizable="False"
IsMinimizable="False" WindowStartupLocation="CenterOwner" ShowInTaskbar="False"
CloseCommand="{Binding Close_Command,Mode=OneWay,UpdateSourceTrigger=PropertyChanged}">
<Grid Margin="5,5,5,0">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<TabControl ItemsSource="{Binding MachiningList}"
SelectedItem="{Binding SelMachining}"
IsSynchronizedWithCurrentItem="True"
Margin="5,0,5,0"
Style="{StaticResource TabControl_OnlyHeaders}"/>
<EgtBEAMWALLCORE:EgtDataGrid Grid.Row="1"
ItemsSource="{Binding TableRowList}"
SelectedIndex="{Binding SelRowIndex}"
AutoGenerateColumns="False"
CanUserResizeRows="False"
SelectionMode="Single"
ScrollViewer.CanContentScroll="True"
ScrollViewer.VerticalScrollBarVisibility="Auto"
ScrollViewer.HorizontalScrollBarVisibility="Auto"
Margin="0,0,0,5"
BindingColumns="{Binding BeamMachiningsColumns}">
<DataGrid.RowStyle>
<Style TargetType="DataGridRow">
<Setter Property="Height" Value="25"/>
<Setter Property="VerticalContentAlignment" Value="Center"/>
</Style>
</DataGrid.RowStyle>
<DataGrid.Resources>
<Style x:Key="DataGridCheckBoxColumn_Style"
TargetType="{x:Type DataGridCell}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type DataGridCell}">
<Grid Background="{TemplateBinding Background}">
<ContentPresenter VerticalAlignment="Center" />
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<!--Colonna On-->
<DataGridCheckBoxColumn x:Key="colON" Binding="{Binding OnPar, UpdateSourceTrigger=PropertyChanged}"
CellStyle="{StaticResource DataGridCheckBoxColumn_Style}">
<DataGridCheckBoxColumn.Header>
<TextBlock Text="{Binding Path=DataContext.OnHdr,RelativeSource={RelativeSource AncestorType={x:Type EgtWPFLib5:EgtCustomWindow}}}"/>
</DataGridCheckBoxColumn.Header>
</DataGridCheckBoxColumn>
<!--Colonna Name-->
<DataGridTemplateColumn x:Key="colNAME">
<DataGridTemplateColumn.Header>
<TextBlock Text="{Binding Path=DataContext.NameHdr,RelativeSource={RelativeSource AncestorType={x:Type EgtWPFLib5:EgtCustomWindow}}}"/>
</DataGridTemplateColumn.Header>
<DataGridTemplateColumn.CellEditingTemplate>
<DataTemplate>
<ComboBox IsEditable="False"
SelectedItem="{Binding Name,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"
ItemsSource="{Binding Path=NamesList, Mode=OneWay, UpdateSourceTrigger=PropertyChanged}"/>
</DataTemplate>
</DataGridTemplateColumn.CellEditingTemplate>
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBlock Text="{Binding Path=Name,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"
VerticalAlignment="Center"
Margin="5,0,0,0"/>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<!--Colonna Style-->
<DataGridTemplateColumn x:Key="colTYPE">
<DataGridTemplateColumn.Header>
<TextBlock Text="{Binding Path=DataContext.TypeHdr,RelativeSource={RelativeSource AncestorType={x:Type EgtWPFLib5:EgtCustomWindow}}}"/>
</DataGridTemplateColumn.Header>
<DataGridTemplateColumn.CellEditingTemplate>
<DataTemplate>
<ComboBox IsEditable="False"
SelectedItem="{Binding Type,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"
ItemsSource="{Binding Path=TypeList, Mode=OneWay, UpdateSourceTrigger=PropertyChanged}"/>
</DataTemplate>
</DataGridTemplateColumn.CellEditingTemplate>
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBlock Text="{Binding Path=Type,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"
VerticalAlignment="Center"
Margin="5,0,0,0"/>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
</DataGrid.Resources>
</EgtBEAMWALLCORE:EgtDataGrid>
<Grid Grid.Row="2"
Margin="0,0,0,5"
HorizontalAlignment="Center">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<Button Content="/\"
Command="{Binding MoveRowUp_Command}"
Grid.Column="0"
Margin="0,0,2.5,0"
Style="{StaticResource EgtWPFLib5_InputButton}"/>
<Button Content="\/"
Command="{Binding MoveRowDown_Command}"
Grid.Column="1"
Margin="2.5,0,2.5,0"
Style="{StaticResource EgtWPFLib5_InputButton}"/>
<Button Content="{Binding AddRowMsg}"
Command="{Binding AddRow_Command}"
Grid.Column="2"
Margin="2.5,0,2.5,0"
Style="{StaticResource EgtWPFLib5_InputButton}"/>
<Button Content="{Binding DeleteRowMsg}"
Command="{Binding DeleteRow_Command}"
Grid.Column="3"
Margin="2.5,0,2.5,0"
Style="{StaticResource EgtWPFLib5_InputButton}"/>
<Button Content="{Binding SaveMsg}"
Command="{Binding Save_Command}"
Grid.Column="4"
Margin="2.5,0,0,0"
Style="{StaticResource EgtWPFLib5_InputButton}"/>
</Grid>
</Grid>
</EgtWPFLib5:EgtCustomWindow>
@@ -0,0 +1,20 @@
Imports System.Windows
Public Class BeamMachiningsWindowV
Private WithEvents m_BeamMachiningsWindowVM As MyBeamMachiningsWindowVM
Sub New(Owner As Window, BeamMachiningsWindowVM As MyBeamMachiningsWindowVM)
MyBase.New(Owner)
' This call is required by the designer.
InitializeComponent()
Me.DataContext = BeamMachiningsWindowVM
' Assegno al riferimento locale al VM il VM preso dal DataContext
m_BeamMachiningsWindowVM = BeamMachiningsWindowVM
End Sub
Private Sub CloseWindow(bDialogResult As Boolean) Handles m_BeamMachiningsWindowVM.m_CloseWindow
Me.DialogResult = bDialogResult
End Sub
End Class
@@ -0,0 +1,36 @@
Imports System.Collections.ObjectModel
Imports EgtBEAMWALL.Core
Imports EgtWPFLib5
Public Class MyBeamMachiningsWindowVM
Inherits BeamMachiningsWindowVM
#Region "FIELDS & PROPERTIES"
Private m_BeamMachiningsColumns As New ObservableCollection(Of EgtDataGridColumn)
Public Property BeamMachiningsColumns As ObservableCollection(Of EgtDataGridColumn)
Get
Return m_BeamMachiningsColumns
End Get
Set(value As ObservableCollection(Of EgtDataGridColumn))
m_BeamMachiningsColumns = value
End Set
End Property
#End Region ' FIELDS & PROPERTIES
#Region "CONSTRUCTOR"
Sub New(sTitle As String, sBaseDir As String, sMachTypePath As String, sTabTemplPath As String, Optional bIsBeam As Boolean = True)
MyBase.New(sTitle, sBaseDir, sMachTypePath, sTabTemplPath, bIsBeam)
' carico le colonne della datagrid
GetPrivateProfileColumns(S_BEAMMACHININGS, BeamMachiningsColumns)
' aggiorno la visibilità delle colonne
For Each col In BeamMachiningsColumns
col.ColumnVisibility = If(col.Visible, Windows.Visibility.Visible, Windows.Visibility.Collapsed)
Next
End Sub
#End Region ' CONSTRUCTOR
End Class
@@ -0,0 +1,80 @@
<DockPanel x:Class="ConfigurationPageV"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:EgtBEAMWALL="clr-namespace:EgtBEAMWALL.Core">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="10*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="1*"/>
<RowDefinition Height="6*"/>
</Grid.RowDefinitions>
<TabControl Grid.Row="0" Grid.Column="0" Grid.RowSpan="2" Grid.ColumnSpan="2"
SelectedIndex="{Binding SelConfigSubPage}">
<TabItem>
<TabItem.Header>
<StackPanel Orientation="Horizontal">
<TextBlock Text="{Binding General_Msg}"
Style="{StaticResource OptionTextBlock}"/>
<Button Command="{Binding SaveCommand}"
ToolTip="{Binding SaveToolTip}"
Visibility="{Binding General_Visibility}"
Style="{StaticResource OptionPanel_Button}">
<Image Source="/Resources/ProjectManager/Save.png" Stretch="Uniform"/>
</Button>
</StackPanel>
</TabItem.Header>
<TabItem.Content>
<EgtBEAMWALL:General_ConfigurationPageV/>
</TabItem.Content>
</TabItem>
<TabItem>
<TabItem.Header>
<StackPanel Orientation="Horizontal">
<TextBlock Text="{Binding ParameterQ_Msg}"
Style="{StaticResource OptionTextBlock}"/>
<Button Command="{Binding SaveCommand}"
ToolTip="{Binding SaveToolTip}"
Visibility="{Binding ParameterQ_Visibility}"
Style="{StaticResource OptionPanel_Button}">
<Image Source="/Resources/ProjectManager/Save.png" Stretch="Uniform"/>
</Button>
</StackPanel>
</TabItem.Header>
<TabItem.Content>
<EgtBEAMWALL:QParameter_ConfigurationPageV/>
</TabItem.Content>
</TabItem>
<TabItem >
<TabItem.Header>
<StackPanel Orientation="Horizontal">
<TextBlock Text="{Binding Machine_Msg}"
Style="{StaticResource OptionTextBlock}"/>
<Button Command="{Binding SaveCommand}"
ToolTip="{Binding SaveToolTip}"
Visibility="{Binding Machine_Visibility}"
Style="{StaticResource OptionPanel_Button}">
<Image Source="/Resources/ProjectManager/Save.png" Stretch="Uniform"/>
</Button>
</StackPanel>
</TabItem.Header>
<TabItem.Content>
<EgtBEAMWALL:Machine_ConfigurationPageV/>
</TabItem.Content>
</TabItem>
</TabControl>
<!--<Button Command="{Binding SaveCommand}"
ToolTip="{Binding SaveToolTip}"
Grid.Row="1"
Grid.Column="1"
Style="{StaticResource OptionPanel_Button}">
<Image Source="/Resources/ProjectManager/Save.png" Stretch="Uniform"/>
</Button>-->
</Grid>
</DockPanel>
@@ -0,0 +1,3 @@
Public Class ConfigurationPageV
End Class
@@ -0,0 +1,118 @@
<Grid x:Class="General_ConfigurationPageV"
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">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="1*"/>
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
<StackPanel Grid.Row="0" Grid.Column="0" Margin="5,5,5,0">
<GroupBox Header="{Binding CurrentLanguage_Msg}"
Margin="0,0,0,5">
<UniformGrid Rows="2" Margin="3,3,3,3">
<ComboBox ItemsSource="{Binding LanguageList, Mode=OneWay}" Height="25"
DisplayMemberPath="Name" SelectedItem="{Binding SelectedLanguage}"
Margin="0,0,0,5"/>
<TextBlock Text="{Binding LanguageAdvert_Msg}" TextWrapping="Wrap"
TextAlignment="Center"/>
</UniformGrid>
</GroupBox>
<UniformGrid Columns="2"
Margin="0,0,0,5">
<TextBlock Text="{Binding MMUnits_Msg}" VerticalAlignment="Center"/>
<ComboBox ItemsSource="{Binding UnitMeasureList, Mode=OneWay}"
SelectedIndex="{Binding SelMeasureUnit}" Height="25"
Margin="0,5,0,0"/>
</UniformGrid>
<GroupBox Header="{Binding Nesting_Msg}"
Margin="0,0,0,5">
<StackPanel>
<UniformGrid Columns="2"
Margin="0,0,0,5">
<TextBlock Text="{Binding SectionTime_Msg}"
Grid.Row="0" Grid.Column="0"/>
<EgtWPFLib5:EgtTextBox Text="{Binding SectionTime, UpdateSourceTrigger=Explicit}"
Grid.Row="0" Grid.Column="1"/>
</UniformGrid>
<UniformGrid Columns="2"
Margin="0,0,0,5">
<TextBlock Text="{Binding PartTime_Msg}"
Grid.Row="1" Grid.Column="0"/>
<EgtWPFLib5:EgtTextBox Text="{Binding PartTime, UpdateSourceTrigger=Explicit}"
Grid.Row="1" Grid.Column="1"/>
</UniformGrid>
</StackPanel>
</GroupBox>
<UniformGrid Columns="2"
Margin="0,0,0,5">
<TextBlock Text="{Binding PrintLabel_Msg}" VerticalAlignment="Center"/>
<CheckBox IsChecked="{Binding bPrintLabel_IsChecked}"
Margin="0,5,0,0"/>
</UniformGrid>
<GroupBox Header="Backup And Restore">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Grid Grid.Row="0"
Margin="0,2,0,5">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<CheckBox x:Name="ExternalBackup_CheckBox"
IsChecked="{Binding bExternalBackupActive}"
VerticalAlignment="Center"/>
<TextBlock Grid.Column="1"
Text="External file path:"
VerticalAlignment="Center"/>
</Grid>
<Grid Grid.Row="1"
Margin="0,2,0,5">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<TextBox Text="{Binding ExternalBackupFolderPath}"
IsEnabled="{Binding IsChecked, ElementName=ExternalBackup_CheckBox}"
Margin="0,0,2.5,0"/>
<Button Grid.Column="1"
Content="..."
Width="18"
Command="{Binding ChooseExternalBackupFolderPath_Command}"
IsEnabled="{Binding IsChecked, ElementName=ExternalBackup_CheckBox}"
Margin="2.5,0,0,0"/>
</Grid>
<Grid Grid.Row="2">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<TextBlock Text="Reminder Frequency"/>
<ComboBox Grid.Column="1"
ItemsSource="{Binding ReminderList}"
SelectedItem="{Binding SelReminder}"/>
</Grid>
<StackPanel Grid.Row="3"
Orientation="Horizontal">
<Button Content="Backup"
Command="{Binding Backup_Command}"
Style="{StaticResource ToolBar_TextButton}"/>
<Button Content="Restore"
Command="{Binding Restore_Command}"
Style="{StaticResource ToolBar_TextButton}"/>
</StackPanel>
</Grid>
</GroupBox>
</StackPanel>
</Grid>
@@ -0,0 +1,3 @@
Public Class General_ConfigurationPageV
End Class
@@ -0,0 +1,70 @@
<Grid x:Class="Machine_ConfigurationPageV"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:EgtBEAMWALL="clr-namespace:EgtBEAMWALL.Core"
xmlns:EgtWPFLib5="clr-namespace:EgtWPFLib5;assembly=EgtWPFLib5">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="10*"/>
</Grid.RowDefinitions>
<StackPanel Grid.Row="0" Grid.Column="0" Orientation="Horizontal">
<GroupBox Style="{StaticResource GroupBoxStyle_NoHeader}" Padding="5,10,5,5">
<EgtBEAMWALL:MachinePanelV DataContext="{Binding MachinePanelVM}" VerticalAlignment="Center"/>
</GroupBox>
</StackPanel>
<StackPanel Grid.Row="1" Grid.Column="0" Orientation="Horizontal">
<ItemsControl ItemsSource="{Binding ConfigMachTableList}">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel x:Name="GroupStackPanel" Orientation="Horizontal"/>
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate>
<DataTemplate>
<GroupBox Header="{Binding sName}" Width="Auto" VerticalAlignment="Top" Height="Auto">
<ItemsControl Name="MachParamsItemsControl" ItemsSource="{Binding MachParamList}" Margin="0,5,0,0">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<WrapPanel Orientation="Vertical"/>
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate>
<DataTemplate>
<Grid Margin="0,0,5,5">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="*" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<TextBlock Text="{Binding sName}"
TextWrapping="WrapWithOverflow"
Width="100"
Style="{StaticResource MachParamTextBlock}"/>
<EgtWPFLib5:EgtTextBox Text="{Binding sValue, UpdateSourceTrigger=Explicit}"
Grid.Column="1"
Width="70"/>
<TextBlock Text="{Binding sDescription}"
TextWrapping="WrapWithOverflow"
Width="200"
Style="{StaticResource MachParamTextBlock}"
Grid.Column="2"/>
</Grid>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</GroupBox>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</StackPanel>
</Grid>
@@ -0,0 +1,3 @@
Public Class Machine_ConfigurationPageV
End Class
@@ -0,0 +1,80 @@
<Grid x:Class="QParameter_ConfigurationPageV"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:EgtBEAMWALL="clr-namespace:EgtBEAMWALL.Core">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="2*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
<EgtBEAMWALL:QParamListV DataContext="{Binding}"
ItemsSource="{Binding QBTLParamVMList}"
SelectedItem="{Binding SelQParam}"
Grid.Column="0"
Margin="5">
<DataGrid.GroupStyle>
<GroupStyle>
<GroupStyle.Panel>
<ItemsPanelTemplate>
<DataGridRowsPresenter/>
</ItemsPanelTemplate>
</GroupStyle.Panel>
<GroupStyle.HeaderTemplate>
<DataTemplate>
<StackPanel>
<TextBlock Text="{Binding Path=Name}"/>
</StackPanel>
</DataTemplate>
</GroupStyle.HeaderTemplate>
<GroupStyle.ContainerStyle>
<Style TargetType="{x:Type GroupItem}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type GroupItem}">
<Expander IsExpanded="True">
<Expander.Background>
<SolidColorBrush Color="#FFBABABA"></SolidColorBrush>
</Expander.Background>
<Expander.Header>
<StackPanel Orientation="Horizontal">
<TextBlock Text="{Binding Path=Name}" />
</StackPanel>
</Expander.Header>
<ItemsPresenter />
</Expander>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</GroupStyle.ContainerStyle>
</GroupStyle>
<GroupStyle>
<GroupStyle.ContainerStyle>
<Style TargetType="{x:Type GroupItem}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type GroupItem}">
<Expander IsExpanded="True">
<Expander.Background>
<SolidColorBrush Color="LightGray"></SolidColorBrush>
</Expander.Background>
<Expander.Header>
<StackPanel Orientation="Horizontal">
<TextBlock Text="{Binding Path=Name}" />
</StackPanel>
</Expander.Header>
<ItemsPresenter />
</Expander>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</GroupStyle.ContainerStyle>
</GroupStyle>
</DataGrid.GroupStyle>
</EgtBEAMWALL:QParamListV>
</Grid>
@@ -0,0 +1,3 @@
Public Class QParameter_ConfigurationPageV
End Class
+38 -1
View File
@@ -77,8 +77,18 @@
<Import Include="System.Xml.Linq" />
</ItemGroup>
<ItemGroup>
<Compile Include="BeamMachiningsWindow\MyBeamMachiningsWindowVM.vb" />
<Compile Include="BTLViewModel\BTLFeatureVM.vb" />
<Compile Include="CALCPanel\CalcEditEndEventArgs.vb" />
<Compile Include="ConfigurationPage\General_ConfigurationPageV.xaml.vb">
<DependentUpon>General_ConfigurationPageV.xaml</DependentUpon>
</Compile>
<Compile Include="ConfigurationPage\Machine_ConfigurationPageV.xaml.vb">
<DependentUpon>Machine_ConfigurationPageV.xaml</DependentUpon>
</Compile>
<Compile Include="ConfigurationPage\QParameter_ConfigurationPageV.xaml.vb">
<DependentUpon>QParameter_ConfigurationPageV.xaml</DependentUpon>
</Compile>
<Compile Include="Constants\ConstColumns.vb" />
<Compile Include="Constants\ConstDataGridColumnsIni.vb" />
<Compile Include="Constants\ConstDims.vb" />
@@ -97,6 +107,9 @@
<Compile Include="CALCPanel\CalcIntegration.vb" />
<Compile Include="DataAccess\PartAddedEventArgs.vb" />
<Compile Include="DataAccess\BTLParamAddedEventArgs.vb" />
<Compile Include="ItemParamList\QParamListV.xaml.vb">
<DependentUpon>QParamListV.xaml</DependentUpon>
</Compile>
<Compile Include="Lib\MachGroupAddedEventArgs.vb" />
<Compile Include="Lib\MachGroupVM.vb" />
<Compile Include="Lib\NewMachGroupPanelVM.vb" />
@@ -112,6 +125,9 @@
<DependentUpon>LoadingWndV.xaml</DependentUpon>
</Compile>
<Compile Include="LoadingWnd\LoadingWndVM.vb" />
<Compile Include="MachinePanel\MachinePanelV.xaml.vb">
<DependentUpon>MachinePanelV.xaml</DependentUpon>
</Compile>
<Compile Include="NewOpenProjectFileDialog\NewOpenProjectFileDialogV.xaml.vb">
<DependentUpon>NewOpenProjectFileDialogV.xaml</DependentUpon>
</Compile>
@@ -187,14 +203,34 @@
</None>
</ItemGroup>
<ItemGroup>
<Page Include="ConfigurationPage\General_ConfigurationPageV.xaml">
<SubType>Designer</SubType>
<Generator>XamlIntelliSenseFileGenerator</Generator>
</Page>
<Page Include="ConfigurationPage\Machine_ConfigurationPageV.xaml">
<SubType>Designer</SubType>
<Generator>XamlIntelliSenseFileGenerator</Generator>
</Page>
<Page Include="ConfigurationPage\QParameter_ConfigurationPageV.xaml">
<SubType>Designer</SubType>
<Generator>XamlIntelliSenseFileGenerator</Generator>
</Page>
<Page Include="EgtDataGrid\EgtDataGrid.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="ItemParamList\QParamListV.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="LoadingWnd\LoadingWndV.xaml">
<SubType>Designer</SubType>
<Generator>XamlIntelliSenseFileGenerator</Generator>
</Page>
<Page Include="MachinePanel\MachinePanelV.xaml">
<SubType>Designer</SubType>
<Generator>XamlIntelliSenseFileGenerator</Generator>
</Page>
<Page Include="NewOpenProjectFileDialog\NewOpenProjectFileDialogV.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
@@ -209,8 +245,9 @@
</Page>
</ItemGroup>
<ItemGroup>
<Folder Include="ConfigurationPage\" />
<Content Include="Resources\ProjectManager\Save.png" />
</ItemGroup>
<ItemGroup />
<Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />
<PropertyGroup>
<PostBuildEvent>copy $(TargetPath) c:\EgtProg\EgtBEAMWALL\EgtBEAMWALL.Core.dll</PostBuildEvent>
@@ -0,0 +1,78 @@
<DataGrid x:Class="QParamListV"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
AutoGenerateColumns="False"
CanUserSortColumns="False"
CanUserResizeColumns="False"
CanUserResizeRows="False"
CanUserReorderColumns="False"
SelectionMode="Single"
ScrollViewer.CanContentScroll="True"
ScrollViewer.VerticalScrollBarVisibility="Auto"
ScrollViewer.HorizontalScrollBarVisibility="Hidden"
Margin="0,0,0,5">
<DataGrid.Columns>
<!--BWType-->
<DataGridTextColumn Binding="{Binding sBWType}"
Width="40"
IsReadOnly="True">
<DataGridTextColumn.HeaderTemplate>
<DataTemplate>
<TextBlock Text="{Binding DataContext.Type_Msg,RelativeSource={RelativeSource AncestorType={x:Type DataGrid}}}"/>
</DataTemplate>
</DataGridTextColumn.HeaderTemplate>
</DataGridTextColumn>
<!--Nome-->
<DataGridTextColumn Binding="{Binding sName}"
Width="50"
IsReadOnly="True">
<DataGridTextColumn.HeaderTemplate>
<DataTemplate>
<TextBlock Text="{Binding DataContext.NAM_Msg,RelativeSource={RelativeSource AncestorType={x:Type DataGrid}}}"/>
</DataTemplate>
</DataGridTextColumn.HeaderTemplate>
</DataGridTextColumn>
<!--Descrizione-->
<DataGridTextColumn Binding="{Binding sDescription}"
Width="1*"
IsReadOnly="True">
<DataGridTextColumn.HeaderTemplate>
<DataTemplate>
<TextBlock Text="{Binding DataContext.Description_Msg,RelativeSource={RelativeSource AncestorType={x:Type DataGrid}}}"/>
</DataTemplate>
</DataGridTextColumn.HeaderTemplate>
</DataGridTextColumn>
<!--Default-->
<DataGridTextColumn Binding="{Binding sDefault}"
Width="65">
<DataGridTextColumn.HeaderTemplate>
<DataTemplate>
<TextBlock Text="{Binding DataContext.Default_Msg,RelativeSource={RelativeSource AncestorType={x:Type DataGrid}}}"/>
</DataTemplate>
</DataGridTextColumn.HeaderTemplate>
</DataGridTextColumn>
<!--Minimo-->
<DataGridTextColumn Binding="{Binding sMin}"
Width="65"
IsReadOnly="True">
<DataGridTextColumn.HeaderTemplate>
<DataTemplate>
<TextBlock Text="{Binding DataContext.Min_Msg,RelativeSource={RelativeSource AncestorType={x:Type DataGrid}}}"/>
</DataTemplate>
</DataGridTextColumn.HeaderTemplate>
</DataGridTextColumn>
<!--Massimo-->
<DataGridTextColumn Binding="{Binding sMax}"
Width="65"
IsReadOnly="True">
<DataGridTextColumn.HeaderTemplate>
<DataTemplate>
<TextBlock Text="{Binding DataContext.Max_Msg,RelativeSource={RelativeSource AncestorType={x:Type DataGrid}}}"/>
</DataTemplate>
</DataGridTextColumn.HeaderTemplate>
</DataGridTextColumn>
</DataGrid.Columns>
</DataGrid>
@@ -0,0 +1,3 @@
Public Class QParamListV
End Class
@@ -0,0 +1,45 @@
<Grid x:Class="MachinePanelV"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
IsEnabled="{Binding MachPanel_IsEnabled}">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<Grid Margin="0,0,5,0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<TextBlock Grid.Row="0" Grid.Column="0" Text="Macchina corrente" VerticalAlignment="Center" Margin="0,0,5,0"/>
<!--Combobox per selezionare la macchina corrente-->
<ComboBox ItemsSource="{Binding Path=MachineList}" DisplayMemberPath="Name"
SelectedItem="{Binding Path=SelectedMachine}" SelectedValuePath="Name"
Height="22" Width="150"
Grid.Row="0" Grid.Column="1"/>
</Grid>
<StackPanel Grid.Column="1" Orientation="Horizontal" HorizontalAlignment="Center">
<Button Command="{Binding ToolDbCommand}" ToolTip="{Binding ToolDBToolTip}"
Style="{StaticResource ToolBar_TextButton}" Content="{Binding ToolDBMsg}"/>
<Button Command="{Binding MachDbCommand}" ToolTip="{Binding MachiningDbToolTip}"
Style="{StaticResource ToolBar_TextButton}" Content="{Binding MachiningDbMsg}"/>
<Button Command="{Binding SetUpCommand}" ToolTip="{Binding SetUpToolTip}"
Style="{StaticResource ToolBar_TextButton}" Content="{Binding SetUpMsg}"
Visibility="{Binding SetUp_Visibility}"/>
<Button ToolTip="{Binding BeamTable_ToolTip}"
Style="{StaticResource ToolBar_Button}"
Command="{Binding BeamTable_Command}"
Visibility="{Binding BeamTable_Visibility}">
<Image Source="/Resources/Configuration/MachiningsTable.png" Stretch="Uniform"/>
</Button>
<Button ToolTip="{Binding WallTable_ToolTip}"
Style="{StaticResource ToolBar_Button}"
Command="{Binding WallTable_Command}"
Visibility="{Binding WallTable_Visibility}">
<Image Source="/Resources/Configuration/MachiningsTable.png" Stretch="Uniform"/>
</Button>
</StackPanel>
</Grid>
@@ -0,0 +1,3 @@
Public Class MachinePanelV
End Class
@@ -0,0 +1,357 @@
Imports System.Collections.ObjectModel
Imports System.IO
Imports EgtBEAMWALL.Core
Imports EgtUILib
Imports EgtWPFLib5
Public Class MachinePanelVM
Inherits EgtWPFLib5.MachinePanelVM
#Region "FIELDS & PROPERTIES"
' Radice del direttorio delle macchine
Private m_sMachinesRoot As String
' Macchina correntemente selezionata e quindi attiva
Private m_SelectedMachine As Machine = Nothing
Public Overrides Property SelectedMachine As Machine
Get
Return m_SelectedMachine
End Get
Set(value As Machine)
If value IsNot m_SelectedMachine Then
' imposto macchina in DbGeometrico
If Not IsNothing(value) AndAlso EgtSetCurrMachine(value.Name) Then
m_SelectedMachine = value
End If
' Salvo impostazione macchina corrente
SaveCurrentMachine()
NotifyPropertyChanged(NameOf(SelectedMachine))
' inizializzo la macchina selezionata come macchina corrente
Dim nMachType As MachineType = DirectCast(m_SelectedMachine, MyMachine).nType
SectionXMaterial.SetType(nMachType)
If Not IsNothing(value) Then
InitCurrentMachine(Map.refMainWindowVM.MainWindowM.sMachinesRoot, value.Name, nMachType)
Else
InitCurrentMachine(Map.refMainWindowVM.MainWindowM.sMachinesRoot, m_SelectedMachine.Name, nMachType)
End If
' mostro bottone tabella beam o wall a seconda del tipo
m_BeamTable_Visibility = If(nMachType = MachineType.BEAM OrElse nMachType = MachineType.BOTH, Visibility.Visible, Visibility.Collapsed)
m_WallTable_Visibility = If(nMachType = MachineType.WALL OrElse nMachType = MachineType.BOTH, Visibility.Visible, Visibility.Collapsed)
NotifyPropertyChanged(NameOf(BeamTable_Visibility))
NotifyPropertyChanged(NameOf(WallTable_Visibility))
' carico i Parametri Q da mostrare (Beam, Wall o entrambi) in base al tipo di macchina selezionata
If Not IsNothing(Map.refConfigurationPageVM) Then
' carico i parametri Q dei Process letti dall'ini
Map.refConfigurationPageVM.GetQParamsList()
' carico la lista di tutti i parametri Q ciclando su ogni Process di PRCList
If Not IsNothing(Map.refConfigurationPageVM.QBTLParamVMList) Then
Map.refConfigurationPageVM.QBTLParamVMList.Clear()
End If
For Each PRCItem In Map.refConfigurationPageVM.PRCList
For Each QBTLParam In PRCItem.QBTLParamVMList
Map.refConfigurationPageVM.QBTLParamVMList.Add(QBTLParam)
Next
Next
NotifyPropertyChanged(NameOf(Map.refConfigurationPageVM.QBTLParamVMList))
End If
' aggiorno nome macchina in statusbar
Map.refMyStatusBarVM.RefreshMachName()
End If
End Set
End Property
Private m_MachPanel_IsEnabled As Boolean = True
Public Property MachPanel_IsEnabled As Boolean
Get
Return m_MachPanel_IsEnabled
End Get
Set(value As Boolean)
m_MachPanel_IsEnabled = value
NotifyPropertyChanged("MachPanel_IsEnabled")
End Set
End Property
Private m_BeamTable_Visibility As Visibility
Public ReadOnly Property BeamTable_Visibility As Visibility
Get
Return m_BeamTable_Visibility
End Get
End Property
Private m_WallTable_Visibility As Visibility
Public ReadOnly Property WallTable_Visibility As Visibility
Get
Return m_WallTable_Visibility
End Get
End Property
Public ReadOnly Property SetUp_Visibility As Visibility
Get
Return If(Map.refMainWindowVM.MainWindowM.bModifySetup, Visibility.Visible, Visibility.Collapsed)
End Get
End Property
#Region "Messages"
Public ReadOnly Property ToolDBMsg As String
Get
Return EgtMsg(MSG_MACHINEPAGEUC + 6)
End Get
End Property
Public ReadOnly Property MachiningDbMsg As String
Get
Return EgtMsg(MSG_MACHINEPAGEUC + 7)
End Get
End Property
Public ReadOnly Property SetUpMsg As String
Get
Return EgtMsg(MSG_ALARMSPAGEUC + 33)
End Get
End Property
#End Region ' Messages
#Region "ToolTip"
Public ReadOnly Property ToolDBToolTip As String
Get
Return EgtMsg(5003)
End Get
End Property
Public ReadOnly Property MachiningDbToolTip As String
Get
Return EgtMsg(5004)
End Get
End Property
Public ReadOnly Property SetUpToolTip As String
Get
Return EgtMsg(31501)
End Get
End Property
#End Region ' ToolTip
' Definizione comandi
Private m_cmdBeamTable As ICommand
Private m_cmdWallTable As ICommand
#End Region 'FIELDS & PROPERTIES
#Region "CONSTRUCTOR"
Sub New()
' Creo riferimento a questa classe in Map
Map.SetRefMachinePanelVM(Me)
' recupero cartella radice delle macchine
m_sMachinesRoot = Map.refMainWindowVM.MainWindowM.sMachinesRoot
' Carica macchine da cartella delle macchine
MyMachine.MachineListInit(m_sMachinesRoot, MachineList)
End Sub
#End Region ' CONSTRUCTOR
#Region "METHODS"
Friend Sub LoadCurrentMachine()
If MachineList.Count = 0 Then Return
Dim CurrMachine As Machine = Nothing
Dim CurrMachineName As String = String.Empty
GetMainPrivateProfileString(S_MACH, K_CURRMACH, String.Empty, CurrMachineName)
Dim bFound As Boolean = False
If Not String.IsNullOrEmpty(CurrMachineName) Then
For Each Mach In MachineList
If Mach.Name = CurrMachineName Then
bFound = True
CurrMachine = Mach
Exit For
End If
Next
End If
If Not bFound And MachineList.Count > 0 Then
CurrMachine = MachineList(0)
End If
If Not IsNothing(CurrMachine) Then
If EgtSetCurrMachine(CurrMachine.Name) Then
SelectedMachine = CurrMachine
End If
End If
End Sub
Friend Sub SaveCurrentMachine()
If IsNothing(m_SelectedMachine) Then Return
WriteMainPrivateProfileString(S_MACH, K_CURRMACH, SelectedMachine.Name)
End Sub
Friend Sub UpdateCurrentMachine()
'EgtSetCurrentContext(IniFile.m_ProjectSceneContext)
Dim sMachName As String = String.Empty
If EgtGetCurrMachineName(sMachName) Then
For Each Mach In MachineList
If Mach.Name = sMachName Then
SelectedMachine = Mach
Exit For
End If
Next
End If
End Sub
Friend Function BeamMachDb() As Boolean
' Assegno le path
Dim sBaseDir As String = m_sMachinesRoot & "\" & m_SelectedMachine.Name & "\" & "Beam"
' verifico se ci sono i file ini
Dim sMachTypePath As String = sBaseDir & "\MachiningTypes.ini"
Dim sTabTemplPath As String = sBaseDir & "\BeamTableTemplate.ini"
If File.Exists(sMachTypePath) AndAlso File.Exists(sTabTemplPath) Then
' apro finestra di gestione lavorazioni travi
Dim sTitle = EgtMsg(9000) 'Tabelle delle lavorazioni delle travi
Dim BeamMchsWinVM As New MyBeamMachiningsWindowVM(sTitle, sBaseDir, sMachTypePath, sTabTemplPath)
Dim BeamMchsWinV As New BeamMachiningsWindowV(Application.Current.MainWindow, BeamMchsWinVM)
BeamMchsWinV.ShowDialog()
Else
' Impossibile aprire l'Editor delle lavorazioni delle travi.<br/>Mancano i file di configurazione. - Errore
MessageBox.Show(EgtMsg(9009), EgtMsg(9008), MessageBoxButton.OK, MessageBoxImage.Stop)
End If
Return True
End Function
Friend Function WallMachDb() As Boolean
' Assegno le path
Dim sBaseDir As String = m_sMachinesRoot & "\" & m_SelectedMachine.Name & "\" & "Wall"
' verifico se ci sono i file ini
Dim sMachTypePath As String = sBaseDir & "\MachiningTypes.ini"
Dim sTabTemplPath As String = sBaseDir & "\WallTableTemplate.ini"
If File.Exists(sMachTypePath) AndAlso File.Exists(sTabTemplPath) Then
' apro finestra di gestione lavorazioni pareti
Dim sTitle = EgtMsg(9010) 'Tabelle delle lavorazioni delle pareti
Dim WallMchsWinVM As New MyBeamMachiningsWindowVM(sTitle, sBaseDir, sMachTypePath, sTabTemplPath, False)
Dim WallMchsWinV As New BeamMachiningsWindowV(Application.Current.MainWindow, WallMchsWinVM)
WallMchsWinV.ShowDialog()
Else
' Impossibile aprire l'Editor delle lavorazioni delle pareti.<br/>Mancano i file di configurazione. - Errore
MessageBox.Show(EgtMsg(9011), EgtMsg(9008), MessageBoxButton.OK, MessageBoxImage.Stop)
End If
Return True
End Function
Public Overrides Sub ToolDb(ByVal param As Object)
If Not VerifyMachinesDir(m_sMachinesRoot) Then Return
' ricarico il database per intercettare eventuali aggiornamenti fatti da altre istanze del programma (se la cartella Machines è condivisa)
If Not EgtTdbReload() Then
EgtOutLog("Impossible reloading tool Db")
MessageBox.Show(EgtMsg(MSG_TOOLDBERRORS + 30), EgtMsg(MSG_MESSAGEBOX + 1), MessageBoxButton.OK, MessageBoxImage.Error)
Return
End If
Dim ToolDbWindowVM As New MyToolDbWindowVM(CurrentMachine.sMachDir, CurrentMachine.sMachIniFile, Map.refSceneHostVM.MainScene.GetCtx(), "Beam")
Dim ToolDbWindowV As New ToolDbWindowV(Application.Current.MainWindow, ToolDbWindowVM)
If ToolDbWindowVM.MatType <> 0 Then
ToolDbWindowV.Height = 640
ToolDbWindowV.Width = 1024
ToolDbWindowV.ShowDialog()
Else
Exit Sub
End If
End Sub
Public Overrides Sub MachDb(ByVal param As Object)
If Not VerifyMachinesDir(m_sMachinesRoot) Then Return
' ricarico il database per intercettare eventuali aggiornamenti fatti da altre istanze del programma (se la cartella Machines è condivisa)
If Not EgtMdbReload() Then
EgtOutLog("Impossible reloading machining Db")
MessageBox.Show(EgtMsg(MSG_MACHININGDBERRORS + 8), EgtMsg(MSG_MESSAGEBOX + 1), MessageBoxButton.OK, MessageBoxImage.Error)
Return
End If
Dim MachDbWindowVM As New EgtWPFLib5.MachiningDbWindowVM(CurrentMachine.sMachIniFile, Map.refSceneHostVM.MainScene.GetCtx(), "Stone")
Dim MachDbWindowV As New EgtWPFLib5.MachiningDbWindowV(Application.Current.MainWindow, MachDbWindowVM)
If EgtWPFLib5.MachiningTreeViewItem.m_MatType <> 0 Then
MachDbWindowV.Height = 768
MachDbWindowV.Width = 1024
MachDbWindowV.ShowDialog()
Else
Exit Sub
End If
End Sub
Public Overrides Sub SetUp(ByVal param As Object)
' verifico che il file di configurazione attrezzaggio (lua) della macchina esista
If Not File.Exists(CurrentMachine.sMachDir & "\Scripts\" & SETUP_LUA) Then
EgtOutLog("SetUp error: SetUp configuration file doesn't exist ")
MessageBox.Show(EgtMsg(MSG_SETUPERRORS + 7), EgtMsg(MSG_SETUPERRORS + 1), MessageBoxButton.OK, MessageBoxImage.Error)
Return
End If
' carico Lua che contiene le funzioni per ottenere le posizioni valide dell'utensile selezionato,
' e testa e uscita dell'utensile attrezzato
EgtLuaExecFile(CurrentMachine.sMachDir & "\Scripts\" & SETUP_LUA)
' verifico che le teste riportate in configurazione esistano
Dim Index As Integer = 1
Dim nErr As Integer = 0
While nErr = 0
Dim sHead As String = String.Empty
nErr = 999
EgtLuaSetGlobIntVar("STU.INDEX", Index)
EgtLuaCallFunction("STU.GetTcPosHeadGroupFromPos")
' Leggo variabili
EgtLuaGetGlobStringVar("STU.HEAD", sHead)
EgtLuaGetGlobIntVar("STU.ERR", nErr)
If nErr = 0 Then
If EgtGetHeadExitCount(sHead) = 0 Then
MessageBox.Show(EgtMsg(MSG_SETUPERRORS + 8), EgtMsg(MSG_SETUPERRORS + 1), MessageBoxButton.OK, MessageBoxImage.Error)
Return
End If
End If
Index += 1
End While
' Reset lua
EgtLuaResetGlobVar("STU")
Dim SetUpWindow As New SetUpWindowV(Application.Current.MainWindow, New SetUpWindowVM(CurrentMachine.sMachDir, CurrentMachine.sMachineName))
SetUpWindow.Height = 614
SetUpWindow.Width = 1024
SetUpWindow.ShowDialog()
End Sub
#End Region
#Region "COMMANDS"
#Region "BeamTable"
''' <summary>
''' Returns a command that do Exec.
''' </summary>
Public ReadOnly Property BeamTable_Command As ICommand
Get
If m_cmdBeamTable Is Nothing Then
m_cmdBeamTable = New Command(AddressOf BeamMachDb)
End If
Return m_cmdBeamTable
End Get
End Property
#End Region ' BeamTable
#Region "WallTable"
''' <summary>
''' Returns a command that do Exec.
''' </summary>
Public ReadOnly Property WallTable_Command As ICommand
Get
If m_cmdWallTable Is Nothing Then
m_cmdWallTable = New Command(AddressOf WallMachDb)
End If
Return m_cmdWallTable
End Get
End Property
#End Region ' WallTable
#End Region ' COMMANDS
End Class
Binary file not shown.

After

Width:  |  Height:  |  Size: 610 B

@@ -0,0 +1,155 @@
<EgtWPFLib5:EgtCustomWindow x:Class="BeamMachiningsWindowV"
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"
xmlns:EgtBEAMWALLCORE="clr-namespace:EgtBEAMWALL.Core;assembly=EgtBEAMWALL.Core"
Title="{Binding Title}"
Style="{DynamicResource {x:Type EgtWPFLib5:EgtCustomWindow}}"
WindowStyle="None" ResizeMode="NoResize"
Width="500" Height="450"
IsResizable="False"
IsMinimizable="False" WindowStartupLocation="CenterOwner" ShowInTaskbar="False"
CloseCommand="{Binding Close_Command,Mode=OneWay,UpdateSourceTrigger=PropertyChanged}">
<Grid Margin="5,5,5,0">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<TabControl ItemsSource="{Binding MachiningList}"
SelectedItem="{Binding SelMachining}"
IsSynchronizedWithCurrentItem="True"
Margin="5,0,5,0"
Style="{StaticResource TabControl_OnlyHeaders}"/>
<EgtBEAMWALLCORE:EgtDataGrid Grid.Row="1"
ItemsSource="{Binding TableRowList}"
SelectedIndex="{Binding SelRowIndex}"
AutoGenerateColumns="False"
CanUserResizeRows="False"
SelectionMode="Single"
ScrollViewer.CanContentScroll="True"
ScrollViewer.VerticalScrollBarVisibility="Auto"
ScrollViewer.HorizontalScrollBarVisibility="Auto"
Margin="0,0,0,5"
BindingColumns="{Binding BeamMachiningsColumns}">
<DataGrid.RowStyle>
<Style TargetType="DataGridRow">
<Setter Property="Height" Value="25"/>
<Setter Property="VerticalContentAlignment" Value="Center"/>
</Style>
</DataGrid.RowStyle>
<DataGrid.Resources>
<Style x:Key="DataGridCheckBoxColumn_Style"
TargetType="{x:Type DataGridCell}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type DataGridCell}">
<Grid Background="{TemplateBinding Background}">
<ContentPresenter VerticalAlignment="Center" />
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<!--Colonna On-->
<DataGridCheckBoxColumn x:Key="colON" Binding="{Binding OnPar, UpdateSourceTrigger=PropertyChanged}"
CellStyle="{StaticResource DataGridCheckBoxColumn_Style}">
<DataGridCheckBoxColumn.Header>
<TextBlock Text="{Binding Path=DataContext.OnHdr,RelativeSource={RelativeSource AncestorType={x:Type EgtWPFLib5:EgtCustomWindow}}}"/>
</DataGridCheckBoxColumn.Header>
</DataGridCheckBoxColumn>
<!--Colonna Name-->
<DataGridTemplateColumn x:Key="colNAME">
<DataGridTemplateColumn.Header>
<TextBlock Text="{Binding Path=DataContext.NameHdr,RelativeSource={RelativeSource AncestorType={x:Type EgtWPFLib5:EgtCustomWindow}}}"/>
</DataGridTemplateColumn.Header>
<DataGridTemplateColumn.CellEditingTemplate>
<DataTemplate>
<ComboBox IsEditable="False"
SelectedItem="{Binding Name,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"
ItemsSource="{Binding Path=NamesList, Mode=OneWay, UpdateSourceTrigger=PropertyChanged}"/>
</DataTemplate>
</DataGridTemplateColumn.CellEditingTemplate>
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBlock Text="{Binding Path=Name,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"
VerticalAlignment="Center"
Margin="5,0,0,0"/>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<!--Colonna Style-->
<DataGridTemplateColumn x:Key="colTYPE">
<DataGridTemplateColumn.Header>
<TextBlock Text="{Binding Path=DataContext.TypeHdr,RelativeSource={RelativeSource AncestorType={x:Type EgtWPFLib5:EgtCustomWindow}}}"/>
</DataGridTemplateColumn.Header>
<DataGridTemplateColumn.CellEditingTemplate>
<DataTemplate>
<ComboBox IsEditable="False"
SelectedItem="{Binding Type,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"
ItemsSource="{Binding Path=TypeList, Mode=OneWay, UpdateSourceTrigger=PropertyChanged}"/>
</DataTemplate>
</DataGridTemplateColumn.CellEditingTemplate>
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBlock Text="{Binding Path=Type,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"
VerticalAlignment="Center"
Margin="5,0,0,0"/>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
</DataGrid.Resources>
</EgtBEAMWALLCORE:EgtDataGrid>
<Grid Grid.Row="2"
Margin="0,0,0,5"
HorizontalAlignment="Center">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<Button Content="/\"
Command="{Binding MoveRowUp_Command}"
Grid.Column="0"
Margin="0,0,2.5,0"
Style="{StaticResource EgtWPFLib5_InputButton}"/>
<Button Content="\/"
Command="{Binding MoveRowDown_Command}"
Grid.Column="1"
Margin="2.5,0,2.5,0"
Style="{StaticResource EgtWPFLib5_InputButton}"/>
<Button Content="{Binding AddRowMsg}"
Command="{Binding AddRow_Command}"
Grid.Column="2"
Margin="2.5,0,2.5,0"
Style="{StaticResource EgtWPFLib5_InputButton}"/>
<Button Content="{Binding DeleteRowMsg}"
Command="{Binding DeleteRow_Command}"
Grid.Column="3"
Margin="2.5,0,2.5,0"
Style="{StaticResource EgtWPFLib5_InputButton}"/>
<Button Content="{Binding SaveMsg}"
Command="{Binding Save_Command}"
Grid.Column="4"
Margin="2.5,0,0,0"
Style="{StaticResource EgtWPFLib5_InputButton}"/>
</Grid>
</Grid>
</EgtWPFLib5:EgtCustomWindow>
@@ -0,0 +1,20 @@
Imports EgtBEAMWALL.Core
Public Class BeamMachiningsWindowV
Private WithEvents m_BeamMachiningsWindowVM As MyBeamMachiningsWindowVM
Sub New(Owner As Window, BeamMachiningsWindowVM As MyBeamMachiningsWindowVM)
MyBase.New(Owner)
' This call is required by the designer.
InitializeComponent()
Me.DataContext = BeamMachiningsWindowVM
' Assegno al riferimento locale al VM il VM preso dal DataContext
m_BeamMachiningsWindowVM = BeamMachiningsWindowVM
End Sub
Private Sub CloseWindow(bDialogResult As Boolean) Handles m_BeamMachiningsWindowVM.m_CloseWindow
Me.DialogResult = bDialogResult
End Sub
End Class
@@ -0,0 +1,36 @@
Imports System.Collections.ObjectModel
Imports EgtBEAMWALL.Core
Imports EgtWPFLib5
Public Class MyBeamMachiningsWindowVM
Inherits BeamMachiningsWindowVM
#Region "FIELDS & PROPERTIES"
Private m_BeamMachiningsColumns As New ObservableCollection(Of EgtDataGridColumn)
Public Property BeamMachiningsColumns As ObservableCollection(Of EgtDataGridColumn)
Get
Return m_BeamMachiningsColumns
End Get
Set(value As ObservableCollection(Of EgtDataGridColumn))
m_BeamMachiningsColumns = value
End Set
End Property
#End Region ' FIELDS & PROPERTIES
#Region "CONSTRUCTOR"
Sub New(sTitle As String, sBaseDir As String, sMachTypePath As String, sTabTemplPath As String, Optional bIsBeam As Boolean = True)
MyBase.New(sTitle, sBaseDir, sMachTypePath, sTabTemplPath, bIsBeam)
' carico le colonne della datagrid
GetPrivateProfileColumns(S_BEAMMACHININGS, BeamMachiningsColumns)
' aggiorno la visibilità delle colonne
For Each col In BeamMachiningsColumns
col.ColumnVisibility = If(col.Visible, Visibility.Visible, Visibility.Collapsed)
Next
End Sub
#End Region ' CONSTRUCTOR
End Class
@@ -1,24 +1,36 @@
<DockPanel x:Class="ConfigurationPageV"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:EgtFloating="clr-namespace:EgtWPFLib5.EgtFloating;assembly=EgtWPFLib5"
xmlns:EgtWPFLib5="clr-namespace:EgtWPFLib5;assembly=EgtWPFLib5"
xmlns:EgtBEAMWALL="clr-namespace:EgtBEAMWALL.Supervisor"
xmlns:EgtBEAMWALLCORE="clr-namespace:EgtBEAMWALL.Core;assembly=EgtBEAMWALL.Core">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="10*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="6*"/>
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
<TabControl Grid.Row="0" Grid.Column="0" Grid.RowSpan="2" Grid.ColumnSpan="2">
<TabItem Header="General">
<TabItem.Content>
<Grid>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="10*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="6*"/>
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
<TabControl Grid.Row="0" Grid.Column="0" Grid.RowSpan="2" Grid.ColumnSpan="2"
SelectedIndex="{Binding SelConfigSubPage}">
<TabItem>
<TabItem.Header>
<StackPanel Orientation="Horizontal">
<TextBlock Text="{Binding General_Msg}"
Style="{StaticResource OptionTextBlock}"/>
<Button Command="{Binding SaveCommand}"
ToolTip="{Binding SaveToolTip}"
Visibility="{Binding General_Visibility}"
Style="{StaticResource OptionPanel_Button}">
<Image Source="/Resources/ProjectManager/Save.png" Stretch="Uniform"/>
</Button>
</StackPanel>
</TabItem.Header>
<TabItem.Content>
<EgtBEAMWALLCORE:General_ConfigurationPageV/>
<!--<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
@@ -47,91 +59,25 @@
Margin="0,5,0,0"/>
</UniformGrid>
</StackPanel>
</Grid>
</TabItem.Content>
</TabItem>
<!--<TabItem Header="Parametri Q">
<TabItem.Content>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="2*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
<EgtBEAMWALL:QParamListV DataContext="{Binding}"
ItemsSource="{Binding QBTLParamVMList}"
SelectedItem="{Binding SelQParam}"
Grid.Column="0"
Margin="5">
<DataGrid.GroupStyle>
<GroupStyle>
<GroupStyle.Panel>
<ItemsPanelTemplate>
<DataGridRowsPresenter/>
</ItemsPanelTemplate>
</GroupStyle.Panel>
<GroupStyle.HeaderTemplate>
<DataTemplate>
<StackPanel>
<TextBlock Text="{Binding Path=Name}"/>
</StackPanel>
</DataTemplate>
</GroupStyle.HeaderTemplate>
<GroupStyle.ContainerStyle>
<Style TargetType="{x:Type GroupItem}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type GroupItem}">
<Expander IsExpanded="True">
<Expander.Background>
<SolidColorBrush Color="#FFBABABA"></SolidColorBrush>
</Expander.Background>
<Expander.Header>
<StackPanel Orientation="Horizontal">
<TextBlock Text="{Binding Path=Name}" />
</StackPanel>
</Expander.Header>
<ItemsPresenter />
</Expander>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</GroupStyle.ContainerStyle>
</GroupStyle>
<GroupStyle>
<GroupStyle.ContainerStyle>
<Style TargetType="{x:Type GroupItem}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type GroupItem}">
<Expander IsExpanded="True">
<Expander.Background>
<SolidColorBrush Color="LightGray"></SolidColorBrush>
</Expander.Background>
<Expander.Header>
<StackPanel Orientation="Horizontal">
<TextBlock Text="{Binding Path=Name}" />
</StackPanel>
</Expander.Header>
<ItemsPresenter />
</Expander>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</GroupStyle.ContainerStyle>
</GroupStyle>
</DataGrid.GroupStyle>
</EgtBEAMWALL:QParamListV>
</Grid>
</TabItem.Content>
</TabItem>-->
<!--<TabItem Header="Macchina">
<TabItem.Content>
<Grid>
</Grid>-->
</TabItem.Content>
</TabItem>
<TabItem>
<TabItem.Header>
<StackPanel Orientation="Horizontal">
<TextBlock Text="{Binding Machine_Msg}"
Style="{StaticResource OptionTextBlock}"/>
<Button Command="{Binding SaveCommand}"
ToolTip="{Binding SaveToolTip}"
Visibility="{Binding Machine_Visibility}"
Style="{StaticResource OptionPanel_Button}">
<Image Source="/Resources/ProjectManager/Save.png" Stretch="Uniform"/>
</Button>
</StackPanel>
</TabItem.Header>
<TabItem.Content>
<EgtBEAMWALLCORE:Machine_ConfigurationPageV/>
<!--<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="1*"/>
@@ -194,47 +140,47 @@
</ItemsControl.ItemTemplate>
</ItemsControl>
</StackPanel>
</Grid>
</TabItem.Content>
</TabItem>-->
<TabItem Header="Variabili">
<TabItem.Content>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
<Grid Grid.Row="0" Margin="5">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<Grid Grid.Column="0" Margin="5">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<Button Content="+"
</Grid>-->
</TabItem.Content>
</TabItem>
<!--<TabItem Header="Variabili">
<TabItem.Content>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
<Grid Grid.Row="0" Margin="5">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<Grid Grid.Column="0" Margin="5">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<Button Content="+"
Grid.Column="2"
Command="{Binding AddVariable_Command}"
Style="{StaticResource ToolBar_SmallButton}"/>
<Button Content="-"
<Button Content="-"
Grid.Column="3"
Command="{Binding RemoveVariable_Command}"
Style="{StaticResource ToolBar_SmallButton}"/>
</Grid>
</Grid>
<Grid Grid.Row="1">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
<EgtBEAMWALLCORE:EgtDataGrid
</Grid>
</Grid>
<Grid Grid.Row="1">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
<EgtBEAMWALLCORE:EgtDataGrid
ItemsSource="{Binding VariablesList}"
SelectedItem="{Binding SelVariable}"
CanUserAddRows="False"
@@ -246,58 +192,58 @@
ScrollViewer.HorizontalScrollBarVisibility="Auto"
Margin="5"
BindingColumns="{Binding VariablesColumns}">
<DataGrid.Resources>
<!-- Name -->
<DataGridTextColumn x:Key="colNAME" Binding="{Binding sName}">
<DataGridTextColumn.HeaderTemplate>
<DataTemplate>
<TextBlock Text="{Binding Path=DataContext.Name_Msg,RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:ConfigurationPageV}}}"/>
</DataTemplate>
</DataGridTextColumn.HeaderTemplate>
</DataGridTextColumn>
<!-- VariablePath -->
<DataGridTextColumn x:Key="colVARPATH" Binding="{Binding sVarPath}">
<DataGridTextColumn.HeaderTemplate>
<DataTemplate>
<TextBlock Text="{Binding Path=DataContext.VarPath_Msg,RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:ConfigurationPageV}}}"/>
</DataTemplate>
</DataGridTextColumn.HeaderTemplate>
</DataGridTextColumn>
<!-- Type -->
<DataGridComboBoxColumn x:Key="colTYPE">
<DataGridComboBoxColumn.HeaderTemplate>
<DataTemplate>
<TextBlock Text="{Binding Path=DataContext.Type_Msg,RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:ConfigurationPageV}}}"/>
</DataTemplate>
</DataGridComboBoxColumn.HeaderTemplate>
<DataGridComboBoxColumn.ElementStyle>
<Style TargetType="ComboBox">
<Setter Property="ItemsSource" Value="{Binding TypeList}"/>
<Setter Property="SelectedItem" Value="{Binding SelType, UpdateSourceTrigger=PropertyChanged}" />
</Style>
</DataGridComboBoxColumn.ElementStyle>
<DataGridComboBoxColumn.EditingElementStyle>
<Style TargetType="ComboBox">
<Setter Property="ItemsSource" Value="{Binding TypeList}"/>
<Setter Property="SelectedItem" Value="{Binding SelType, UpdateSourceTrigger=PropertyChanged}" />
</Style>
</DataGridComboBoxColumn.EditingElementStyle>
</DataGridComboBoxColumn>
</DataGrid.Resources>
</EgtBEAMWALLCORE:EgtDataGrid>
</Grid>
</Grid>
</TabItem.Content>
</TabItem>
</TabControl>
<Button Command="{Binding SaveCommand}"
<DataGrid.Resources>
--><!-- Name --><!--
<DataGridTextColumn x:Key="colNAME" Binding="{Binding sName}">
<DataGridTextColumn.HeaderTemplate>
<DataTemplate>
<TextBlock Text="{Binding Path=DataContext.Name_Msg,RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:ConfigurationPageV}}}"/>
</DataTemplate>
</DataGridTextColumn.HeaderTemplate>
</DataGridTextColumn>
--><!-- VariablePath --><!--
<DataGridTextColumn x:Key="colVARPATH" Binding="{Binding sVarPath}">
<DataGridTextColumn.HeaderTemplate>
<DataTemplate>
<TextBlock Text="{Binding Path=DataContext.VarPath_Msg,RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:ConfigurationPageV}}}"/>
</DataTemplate>
</DataGridTextColumn.HeaderTemplate>
</DataGridTextColumn>
--><!-- Type --><!--
<DataGridComboBoxColumn x:Key="colTYPE">
<DataGridComboBoxColumn.HeaderTemplate>
<DataTemplate>
<TextBlock Text="{Binding Path=DataContext.Type_Msg,RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:ConfigurationPageV}}}"/>
</DataTemplate>
</DataGridComboBoxColumn.HeaderTemplate>
<DataGridComboBoxColumn.ElementStyle>
<Style TargetType="ComboBox">
<Setter Property="ItemsSource" Value="{Binding TypeList}"/>
<Setter Property="SelectedItem" Value="{Binding SelType, UpdateSourceTrigger=PropertyChanged}" />
</Style>
</DataGridComboBoxColumn.ElementStyle>
<DataGridComboBoxColumn.EditingElementStyle>
<Style TargetType="ComboBox">
<Setter Property="ItemsSource" Value="{Binding TypeList}"/>
<Setter Property="SelectedItem" Value="{Binding SelType, UpdateSourceTrigger=PropertyChanged}" />
</Style>
</DataGridComboBoxColumn.EditingElementStyle>
</DataGridComboBoxColumn>
</DataGrid.Resources>
</EgtBEAMWALLCORE:EgtDataGrid>
</Grid>
</Grid>
</TabItem.Content>
</TabItem>-->
</TabControl>
<!--<Button Command="{Binding SaveCommand}"
ToolTip="{Binding SaveToolTip}"
Grid.Row="1"
Grid.Column="1"
Style="{StaticResource OptionPanel_Button}">
<Image Source="/Resources/ProjectManager/Save.png" Stretch="Uniform"/>
</Button>
</Grid>
<Image Source="/Resources/ProjectManager/Save.png" Stretch="Uniform"/>
</Button>-->
</Grid>
</DockPanel>
@@ -1,5 +1,4 @@
Imports System.Collections.ObjectModel
Imports System.IO
Imports EgtUILib
Imports EgtWPFLib5
Imports EgtBEAMWALL.Core
@@ -7,10 +6,37 @@ Imports EgtBEAMWALL.Core
Public Class ConfigurationPageVM
Inherits VMBase
' Definizione comandi
Private m_cmdSave As ICommand
Private m_cmdAddVariable As ICommand
Private m_cmdRemoveVariable As ICommand
Public Enum ConfigSubPages As Integer
GENERAL = 0
MACHINE = 1
VARIABLE = 2
End Enum
Private m_SelConfigSubPage As ConfigSubPages = ConfigSubPages.GENERAL
Public Property SelConfigSubPage As Integer
Get
Return m_SelConfigSubPage
End Get
Set(value As Integer)
m_SelConfigSubPage = value
If m_SelConfigSubPage = ConfigSubPages.GENERAL Then
m_bGeneral_Visibility = Visibility.Visible
m_bMachine_Visibility = Visibility.Collapsed
ElseIf m_SelConfigSubPage = ConfigSubPages.MACHINE Then
m_bMachine_Visibility = Visibility.Visible
m_bGeneral_Visibility = Visibility.Collapsed
End If
NotifyPropertyChanged(NameOf(General_Visibility))
NotifyPropertyChanged(NameOf(Machine_Visibility))
End Set
End Property
Public ReadOnly Property MachinePanelVM As MachinePanelVM
Get
Return Map.refMachinePanelVM
End Get
End Property
' Contatore delle variabili rimosse per successiva rimozione dal file INI
Friend m_RemovedVarsCount As Integer = 0
@@ -85,6 +111,88 @@ Public Class ConfigurationPageVM
End Set
End Property
Private m_bGeneral_Visibility As Visibility = Visibility.Visible
Public Property General_Visibility As Visibility
Get
Return m_bGeneral_Visibility
End Get
Set(value As Visibility)
m_bGeneral_Visibility = value
NotifyPropertyChanged(NameOf(General_Visibility))
End Set
End Property
Private m_bMachine_Visibility As Visibility = Visibility.Collapsed
Public Property Machine_Visibility As Visibility
Get
Return m_bMachine_Visibility
End Get
Set(value As Visibility)
m_bMachine_Visibility = value
NotifyPropertyChanged(NameOf(Machine_Visibility))
End Set
End Property
Private m_SectionTime As Double
Public Property SectionTime As String
Get
Return DoubleToString(m_SectionTime, 5)
End Get
Set(value As String)
Dim dVal As Double = 0
If StringToDoubleAdv(value, dVal, True) AndAlso dVal > 0 Then
m_SectionTime = dVal
End If
End Set
End Property
Private m_PartTime As Double
Public Property PartTime As String
Get
Return DoubleToString(m_PartTime, 5)
End Get
Set(value As String)
Dim dVal As Double = 0
If StringToDoubleAdv(value, dVal, True) AndAlso dVal > 0 Then
m_PartTime = dVal
End If
End Set
End Property
Private m_ReminderList As New List(Of IdNameStruct)({New IdNameStruct(0, EgtMsg(61988)), New IdNameStruct(1, EgtMsg(61989)), New IdNameStruct(2, EgtMsg(61990)), New IdNameStruct(7, EgtMsg(61991)), New IdNameStruct(14, EgtMsg(61992)), New IdNameStruct(30, EgtMsg(61993))})
Public ReadOnly Property ReminderList As List(Of IdNameStruct)
Get
Return m_ReminderList
End Get
End Property
Private m_SelReminder As IdNameStruct
Public Property SelReminder As IdNameStruct
Get
Return m_SelReminder
End Get
Set(value As IdNameStruct)
m_SelReminder = value
WriteMainPrivateProfileString(S_BACKUPANDRESTORE, K_REMINDERFREQUENCY, m_SelReminder.Id)
End Set
End Property
Private m_ConfigMachTableList As New ObservableCollection(Of MachTable)
Public Property ConfigMachTableList As ObservableCollection(Of MachTable)
Get
Return m_ConfigMachTableList
End Get
Set(value As ObservableCollection(Of MachTable))
m_ConfigMachTableList = value
End Set
End Property
' Definizione comandi
Private m_cmdSave As ICommand
Private m_cmdAddVariable As ICommand
Private m_cmdRemoveVariable As ICommand
#Region "Messages"
Public ReadOnly Property L_Msg As String
@@ -209,6 +317,35 @@ Public Class ConfigurationPageVM
End Get
End Property
Public ReadOnly Property General_Msg As String
Get
Return EgtMsg(62535)
End Get
End Property
Public ReadOnly Property Machine_Msg As String
Get
Return EgtMsg(62537)
End Get
End Property
Public ReadOnly Property SectionTime_Msg As String
Get
Return EgtMsg(61806)
End Get
End Property
Public ReadOnly Property PartTime_Msg As String
Get
Return EgtMsg(61807)
End Get
End Property
Public ReadOnly Property Nesting_Msg As String
Get
Return EgtMsg(61829)
End Get
End Property
#End Region ' Messages
#Region "Constructor"
@@ -244,6 +381,13 @@ Public Class ConfigurationPageVM
GetPrivateProfileColumns(S_VARIABLESLIST, VariablesColumns)
' carico le Variables della macchina
LoadVariables()
' leggo SectionTime e PartTime
GetMainPrivateProfileString(S_NEST, K_SECTIONTIME, "", SectionTime)
GetMainPrivateProfileString(S_NEST, K_PARTTIME, "", PartTime)
' assegno le liste dei parametri della macchina corrente alla ConfigMachTableList alla pagina di Configurazione
ConfigMachTableList = CurrentMachine.MachTableList
Dim nDefaultReminderFrequency As Integer = GetMainPrivateProfileInt(S_BACKUPANDRESTORE, K_REMINDERFREQUENCY, 1)
SelReminder = m_ReminderList.FirstOrDefault(Function(x) x.Id = nDefaultReminderFrequency)
End Sub
#End Region ' Constructor
@@ -407,11 +551,196 @@ Public Class ConfigVariable
End Class
'' Tipo parametro nel file di configurazione Macchina
'Public Enum MachParamType As Integer
' DOUBLE_ = 1
' STRING_ = 2
' COMBO = 3
' LENGTH = 4
' CHECKBOX = 5
'End Enum
Public Class MachParam
Inherits VMBase
' table a cui appartiene il parametro
Private m_nParentTable As Integer
Friend ReadOnly Property nParentTable As Integer
Get
Return m_nParentTable
End Get
End Property
' indice del parametro
Private m_nParamIndex As Integer
Friend ReadOnly Property nParamIndex As Integer
Get
Return m_nParamIndex
End Get
End Property
' tipo della variabile
Private m_nType As MachParamType
Friend ReadOnly Property nType As MachParamType
Get
Return m_nType
End Get
End Property
' parametri da struttura
Private m_sName As String
Public Property sName As String
Get
Return m_sName
End Get
Set(value As String)
m_sName = value
End Set
End Property
' parametri da geometria
Private m_IsModifiedValue As Boolean = False
Private m_dValue As Double
Private m_sValue As String
Public Property sValue As String
Get
Select Case nType
Case MachParamType.DOUBLE_
Return DoubleToString(m_dValue, 3)
Case MachParamType.LENGTH
Return LenToString(m_dValue, 3)
Case Else ' stringhe
Return m_sValue
End Select
Return If(nType = MachParamType.LENGTH, LenToString(m_dValue, 3), DoubleToString(m_dValue, 3))
End Get
Set(value As String)
Dim dNewValue As Double
' verifico se valore immesso è diverso dall'originale
If nParentTable > 0 Then
' trasformo valori
Select Case nType
Case MachParamType.DOUBLE_
StringToDoubleAdv(value, dNewValue, True)
m_IsModifiedValue = Math.Abs(dNewValue - m_dValue) > EPS_SMALL
Case MachParamType.LENGTH
StringToLenAdv(value, dNewValue, True)
m_IsModifiedValue = Math.Abs(dNewValue - m_dValue) > EPS_SMALL
Case Else
m_IsModifiedValue = String.Compare(value, m_sValue) <> 0
End Select
End If
' se valore immesso è diverso e password non inserita
'If m_IsModifiedValue AndAlso Not Map.refConfigurationPageVM.bModifyMachParam Then
' Map.refConfigurationPageVM.bModifyMachParam = Map.refConfigurationPageVM.VerifyConfigPagePassword()
' If Not Map.refConfigurationPageVM.bModifyMachParam Then
' NotifyPropertyChanged("sValue")
' m_IsModifiedValue = False
' Return
' End If
'End If
Select Case nType
Case MachParamType.DOUBLE_, MachParamType.LENGTH
UpdateParamValue(dNewValue, "")
Case Else
UpdateParamValue(0, value)
End Select
End Set
End Property
Public Property dValue As Double
Get
Return m_dValue
End Get
Set(value As Double)
m_dValue = value
NotifyPropertyChanged("sValue")
End Set
End Property
' descrizione del parametro
Private m_sDescription As String
Public Property sDescription As String
Get
Return m_sDescription
End Get
Set(value As String)
m_sDescription = value
End Set
End Property
Private Sub StdInit(nParentTable As Integer, nParamIndex As Integer, Type As MachParamType, sName As String, sDescription As String)
m_nParentTable = nParentTable
m_nParamIndex = nParamIndex
m_nType = Type
m_sName = sName
m_sDescription = MsgToString(sDescription)
End Sub
' new per double e length
Sub New(nParentTable As Integer, nParamIndex As Integer, nType As MachParamType, sParamName As String, dValue As Double, sDescription As String)
StdInit(nParentTable, nParamIndex, nType, sParamName, sDescription)
m_dValue = dValue 'sValue = DoubleToString(dValue, 3)
End Sub
' new per stringhe
Sub New(nParentTable As Integer, nParamIndex As Integer, nType As MachParamType, sParamName As String, sDescription As String)
StdInit(nParentTable, nParamIndex, nType, sParamName, sDescription)
End Sub
' new per parametro vuoto
Sub New(nType As MachParamType, nParamIndex As Integer, sParamName As String)
StdInit(Nothing, nParamIndex, nType, sParamName, "")
End Sub
Friend Sub UpdateParamValue(dNewValue As Double, sNewValue As String, Optional bDraw As Boolean = True)
Select Case nType
Case MachParamType.DOUBLE_, MachParamType.LENGTH
m_dValue = dNewValue
Case MachParamType.STRING_
m_sValue = sNewValue
End Select
End Sub
Public ReadOnly Property IsModified() As Boolean
Get
Return m_IsModifiedValue
End Get
End Property
Public Sub IsModifiedReset()
m_IsModifiedValue = False
End Sub
End Class
Public Class MachTable
Inherits VMBase
' nome della table
Private m_sName As String
Public Property sName As String
Get
Return m_sName
End Get
Set(value As String)
m_sName = value
End Set
End Property
Private m_MachParamList As New ObservableCollection(Of MachParam)
Public Property MachParamList As ObservableCollection(Of MachParam)
Get
Return m_MachParamList
End Get
Set(value As ObservableCollection(Of MachParam))
m_MachParamList = value
End Set
End Property
Sub New(Name As String, ParamList As ObservableCollection(Of MachParam))
sName = Name
MachParamList = ParamList
End Sub
End Class
' Tipo parametro nel file di configurazione Macchina
Public Enum MachParamType As Integer
DOUBLE_ = 1
STRING_ = 2
COMBO = 3
LENGTH = 4
CHECKBOX = 5
End Enum
@@ -318,6 +318,9 @@
<DependentUpon>AxesPanelV.xaml</DependentUpon>
</Compile>
<Compile Include="AxesPanel\AxesPanelVM.vb" />
<Compile Include="BeamMachiningsWindow\BeamMachiningsWindowV.xaml.vb">
<DependentUpon>BeamMachiningsWindowV.xaml</DependentUpon>
</Compile>
<Compile Include="BTLViewModel\BTLFeatureVM.vb" />
<Compile Include="CALCPanel\CalcPanelV.xaml.vb">
<DependentUpon>CalcPanelV.xaml</DependentUpon>
@@ -332,6 +335,7 @@
<DependentUpon>MachineLogPageV.xaml</DependentUpon>
</Compile>
<Compile Include="MachineLogPage\MachineLogPageVM.vb" />
<Compile Include="MachinePanel\MachinePanelVM.vb" />
<Compile Include="MDIPage\MDIPageV.xaml.vb">
<DependentUpon>MDIPageV.xaml</DependentUpon>
</Compile>
@@ -373,10 +377,6 @@
<Compile Include="MachGroupPanel\PartVM.vb" />
<Compile Include="MachGroupPanel\SupervisorMachGroupPanelVM.vb" />
<Compile Include="MachGroupPanel\MyMachGroupPanelVM.vb" />
<Compile Include="MachinePanel\MachinePanelV.xaml.vb">
<DependentUpon>MachinePanelV.xaml</DependentUpon>
</Compile>
<Compile Include="MachinePanel\MachinePanelVM.vb" />
<Compile Include="MachManagingThread\MachCommConst.vb" />
<Compile Include="MachManagingThread\MachManaging.vb" />
<Compile Include="MachManagingThread\MachManagingThread.vb" />
@@ -416,6 +416,7 @@
<Compile Include="Utility\DisableModifiedMgr.vb" />
<Compile Include="Utility\LogEvent.vb" />
<Compile Include="Utility\LuaExec.vb" />
<Compile Include="Utility\MachParamIniFile.vb" />
<Compile Include="Utility\ManageBTLParts.vb" />
<Compile Include="Utility\Map.vb" />
<Compile Include="VariablesList\VariablesListV.xaml.vb">
@@ -440,6 +441,10 @@
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="BeamMachiningsWindow\BeamMachiningsWindowV.xaml">
<SubType>Designer</SubType>
<Generator>XamlIntelliSenseFileGenerator</Generator>
</Page>
<Page Include="CALCPanel\CalcPanelV.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
@@ -484,10 +489,6 @@
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="MachinePanel\MachinePanelV.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="MainMenu\MainMenuV.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
@@ -670,6 +671,10 @@
<Install>false</Install>
</BootstrapperPackage>
</ItemGroup>
<ItemGroup />
<ItemGroup>
<Resource Include="Resources\Configuration\MachiningsTable.png" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
@@ -1,58 +1,50 @@
Imports System.Collections.ObjectModel
Imports System.IO
Imports System.IO
Imports EgtBEAMWALL.Core
Imports EgtUILib
Imports EgtWPFLib5
Public Class MachinePanelVM
Inherits VMBase
Inherits EgtWPFLib5.MachinePanelVM
#Region "FIELDS & PROPERTIES"
' Radice del direttorio delle macchine
Private m_sMachinesRoot As String
' Lista delle macchine disponibili
Private m_MachineList As New ObservableCollection(Of Machine)
Public Property MachineList As ObservableCollection(Of Machine)
Get
Return m_MachineList
End Get
Set(value As ObservableCollection(Of Machine))
m_MachineList = value
End Set
End Property
' Macchina correntemente selezionata e quindi attiva
Private m_SelectedMachine As Machine = Nothing
Public Property SelectedMachine As MyMachine
Public Overrides Property SelectedMachine As Machine
Get
Return m_SelectedMachine
End Get
Set(value As MyMachine)
Set(value As Machine)
If value IsNot m_SelectedMachine Then
'EgtSetCurrentContext(Map.refSceneHostVM.MainScene.GetCtx())
'EgtResetCurrMachGroup()
' se sono in modalità disegno
m_SelectedMachine = value
' imposto macchina in DbGeometrico
If Not IsNothing(value) AndAlso EgtSetCurrMachine(value.Name) Then
m_SelectedMachine = value
End If
' Salvo impostazione macchina corrente
SaveCurrentMachine()
NotifyPropertyChanged(NameOf(SelectedMachine))
' inizializzo la macchina selezionata come macchina corrente
Dim nMachType As MachineType = DirectCast(m_SelectedMachine, MyMachine).nType
SectionXMaterial.SetType(nMachType)
InitCurrentMachine(Map.refMainWindowVM.MainWindowM.sMachinesRoot, value.Name, nMachType)
If Not IsNothing(value) Then
InitCurrentMachine(Map.refMainWindowVM.MainWindowM.sMachinesRoot, value.Name, nMachType)
Else
InitCurrentMachine(Map.refMainWindowVM.MainWindowM.sMachinesRoot, m_SelectedMachine.Name, nMachType)
End If
' mostro bottone tabella beam o wall a seconda del tipo
m_BeamTable_Visibility = If(nMachType = MachineType.BEAM OrElse nMachType = MachineType.BOTH, Visibility.Visible, Visibility.Collapsed)
m_WallTable_Visibility = If(nMachType = MachineType.WALL OrElse nMachType = MachineType.BOTH, Visibility.Visible, Visibility.Collapsed)
NotifyPropertyChanged(NameOf(BeamTable_Visibility))
NotifyPropertyChanged(NameOf(WallTable_Visibility))
' aggiorno nome macchina in statusbar
Map.refMyStatusBarVM.RefreshMachName()
End If
End Set
End Property
Private m_SetUp_Background As Brush = New BrushConverter().ConvertFrom("#FFDDDDDD")
Public Property SetUp_Background As Brush
Get
Return m_SetUp_Background
End Get
Set(value As Brush)
m_SetUp_Background = value
NotifyPropertyChanged("SetUp_Background")
End Set
End Property
Private m_MachPanel_IsEnabled As Boolean = True
Public Property MachPanel_IsEnabled As Boolean
Get
@@ -60,10 +52,30 @@ Public Class MachinePanelVM
End Get
Set(value As Boolean)
m_MachPanel_IsEnabled = value
NotifyPropertyChanged("MachPanel_IsEnabled")
NotifyPropertyChanged(NameOf(MachPanel_IsEnabled))
End Set
End Property
Private m_BeamTable_Visibility As Visibility
Public ReadOnly Property BeamTable_Visibility As Visibility
Get
Return m_BeamTable_Visibility
End Get
End Property
Private m_WallTable_Visibility As Visibility
Public ReadOnly Property WallTable_Visibility As Visibility
Get
Return m_WallTable_Visibility
End Get
End Property
Public ReadOnly Property SetUp_Visibility As Visibility
Get
Return If(Map.refMainWindowVM.MainWindowM.bModifySetup, Visibility.Visible, Visibility.Collapsed)
End Get
End Property
#Region "Messages"
Public ReadOnly Property ToolDBMsg As String
@@ -88,27 +100,25 @@ Public Class MachinePanelVM
Public ReadOnly Property ToolDBToolTip As String
Get
Return "Tool DB"
Return EgtMsg(5003)
End Get
End Property
Public ReadOnly Property MachiningDbToolTip As String
Get
Return "Machining DB"
Return EgtMsg(5004)
End Get
End Property
Public ReadOnly Property SetUpToolTip As String
Get
Return "SetUp"
Return EgtMsg(31501)
End Get
End Property
#End Region ' ToolTip
' Definizione comandi
Private m_cmdToolDb As ICommand
Private m_cmdMachDb As ICommand
Private m_cmdSetUp As ICommand
Private m_cmdMachOptions As ICommand
Private m_cmdBeamTable As ICommand
Private m_cmdWallTable As ICommand
#End Region 'FIELDS & PROPERTIES
@@ -131,7 +141,7 @@ Public Class MachinePanelVM
If MachineList.Count = 0 Then Return
Dim CurrMachine As Machine = Nothing
Dim CurrMachineName As String = String.Empty
GetMainPrivateProfileString(S_MACH, K_SUPERVISORMACH, String.Empty, CurrMachineName)
GetMainPrivateProfileString(S_MACH, K_CURRMACH, String.Empty, CurrMachineName)
Dim bFound As Boolean = False
If Not String.IsNullOrEmpty(CurrMachineName) Then
For Each Mach In MachineList
@@ -170,28 +180,45 @@ Public Class MachinePanelVM
End If
End Sub
#End Region
Friend Function BeamMachDb() As Boolean
' Assegno le path
Dim sBaseDir As String = m_sMachinesRoot & "\" & m_SelectedMachine.Name & "\" & "Beam"
' verifico se ci sono i file ini
Dim sMachTypePath As String = sBaseDir & "\MachiningTypes.ini"
Dim sTabTemplPath As String = sBaseDir & "\BeamTableTemplate.ini"
If File.Exists(sMachTypePath) AndAlso File.Exists(sTabTemplPath) Then
' apro finestra di gestione lavorazioni travi
Dim sTitle = EgtMsg(9000) 'Tabelle delle lavorazioni delle travi
Dim BeamMchsWinVM As New MyBeamMachiningsWindowVM(sTitle, sBaseDir, sMachTypePath, sTabTemplPath)
Dim BeamMchsWinV As New BeamMachiningsWindowV(Application.Current.MainWindow, BeamMchsWinVM)
BeamMchsWinV.ShowDialog()
Else
' Impossibile aprire l'Editor delle lavorazioni delle travi.<br/>Mancano i file di configurazione. - Errore
MessageBox.Show(EgtMsg(9009), EgtMsg(9008), MessageBoxButton.OK, MessageBoxImage.Stop)
End If
Return True
End Function
#Region "COMMANDS"
Friend Function WallMachDb() As Boolean
' Assegno le path
Dim sBaseDir As String = m_sMachinesRoot & "\" & m_SelectedMachine.Name & "\" & "Wall"
' verifico se ci sono i file ini
Dim sMachTypePath As String = sBaseDir & "\MachiningTypes.ini"
Dim sTabTemplPath As String = sBaseDir & "\WallTableTemplate.ini"
If File.Exists(sMachTypePath) AndAlso File.Exists(sTabTemplPath) Then
' apro finestra di gestione lavorazioni pareti
Dim sTitle = EgtMsg(9010) 'Tabelle delle lavorazioni delle pareti
Dim WallMchsWinVM As New MyBeamMachiningsWindowVM(sTitle, sBaseDir, sMachTypePath, sTabTemplPath, False)
Dim WallMchsWinV As New BeamMachiningsWindowV(Application.Current.MainWindow, WallMchsWinVM)
WallMchsWinV.ShowDialog()
Else
' Impossibile aprire l'Editor delle lavorazioni delle pareti.<br/>Mancano i file di configurazione. - Errore
MessageBox.Show(EgtMsg(9011), EgtMsg(9008), MessageBoxButton.OK, MessageBoxImage.Stop)
End If
Return True
End Function
#Region "ToolDbCommand"
''' <summary>
''' Returns a command that do Exec.
''' </summary>
Public ReadOnly Property ToolDbCommand As ICommand
Get
If m_cmdToolDb Is Nothing Then
m_cmdToolDb = New Command(AddressOf ToolDb)
End If
Return m_cmdToolDb
End Get
End Property
''' <summary>
''' Execute the Exec. This method is invoked by the ExecCommand.
''' </summary>
Public Sub ToolDb(ByVal param As Object)
Public Overrides Sub ToolDb(ByVal param As Object)
If Not VerifyMachinesDir(m_sMachinesRoot) Then Return
' ricarico il database per intercettare eventuali aggiornamenti fatti da altre istanze del programma (se la cartella Machines è condivisa)
If Not EgtTdbReload() Then
@@ -200,7 +227,7 @@ Public Class MachinePanelVM
Return
End If
Dim ToolDbWindowVM As New ToolDbWindowVM(CurrentMachine.sMachDir, CurrentMachine.sMachIniFile, Map.refSceneHostVM.MainScene.GetCtx(), "Beam")
Dim ToolDbWindowVM As New EgtWPFLib5.ToolDbWindowVM(CurrentMachine.sMachDir, CurrentMachine.sMachIniFile, Map.refSceneHostVM.MainScene.GetCtx(), "Beam")
Dim ToolDbWindowV As New ToolDbWindowV(Application.Current.MainWindow, ToolDbWindowVM)
If ToolDbWindowVM.MatType <> 0 Then
ToolDbWindowV.Height = 640
@@ -217,26 +244,7 @@ Public Class MachinePanelVM
End If
End Sub
#End Region ' ToolDbCommand
#Region "MachDbCommand"
''' <summary>
''' Returns a command that do Exec.
''' </summary>
Public ReadOnly Property MachDbCommand As ICommand
Get
If m_cmdMachDb Is Nothing Then
m_cmdMachDb = New Command(AddressOf MachDb)
End If
Return m_cmdMachDb
End Get
End Property
''' <summary>
''' Execute the Exec. This method is invoked by the ExecCommand.
''' </summary>
Public Sub MachDb(ByVal param As Object)
Public Overrides Sub MachDb(ByVal param As Object)
If Not VerifyMachinesDir(m_sMachinesRoot) Then Return
' ricarico il database per intercettare eventuali aggiornamenti fatti da altre istanze del programma (se la cartella Machines è condivisa)
If Not EgtMdbReload() Then
@@ -257,26 +265,7 @@ Public Class MachinePanelVM
End Sub
#End Region ' MachDbCommand
#Region "SetUpCommand"
''' <summary>
''' Returns a command that do Exec.
''' </summary>
Public ReadOnly Property SetUpCommand As ICommand
Get
If m_cmdSetUp Is Nothing Then
m_cmdSetUp = New Command(AddressOf SetUp)
End If
Return m_cmdSetUp
End Get
End Property
''' <summary>
''' Execute the Exec. This method is invoked by the ExecCommand.
''' </summary>
Public Sub SetUp(ByVal param As Object)
Public Overrides Sub SetUp(ByVal param As Object)
' verifico che il file di configurazione attrezzaggio (lua) della macchina esista
If Not File.Exists(CurrentMachine.sMachDir & "\Scripts\" & SETUP_LUA) Then
EgtOutLog("SetUp error: SetUp configuration file doesn't exist ")
@@ -315,31 +304,389 @@ Public Class MachinePanelVM
End Sub
#End Region ' SetUpCommand
#End Region
#Region "MachOptionsCommand"
#Region "COMMANDS"
#Region "BeamTable"
''' <summary>
''' Returns a command that do Exec.
''' </summary>
Public ReadOnly Property MachOptionsCommand As ICommand
Public ReadOnly Property BeamTable_Command As ICommand
Get
If m_cmdMachOptions Is Nothing Then
m_cmdMachOptions = New Command(AddressOf MachOptions)
If m_cmdBeamTable Is Nothing Then
m_cmdBeamTable = New Command(AddressOf BeamMachDb)
End If
Return m_cmdMachOptions
Return m_cmdBeamTable
End Get
End Property
#End Region ' BeamTable
#Region "WallTable"
''' <summary>
''' Execute the Exec. This method is invoked by the ExecCommand.
''' Returns a command that do Exec.
''' </summary>
Public Sub MachOptions(ByVal param As Object)
Public ReadOnly Property WallTable_Command As ICommand
Get
If m_cmdWallTable Is Nothing Then
m_cmdWallTable = New Command(AddressOf WallMachDb)
End If
Return m_cmdWallTable
End Get
End Property
End Sub
#End Region ' MachOptionsCommand
#End Region ' WallTable
#End Region ' COMMANDS
End Class
'Imports System.Collections.ObjectModel
'Imports System.IO
'Imports EgtBEAMWALL.Core
'Imports EgtUILib
'Imports EgtWPFLib5
'Public Class MachinePanelVM
' Inherits VMBase
'#Region "FIELDS & PROPERTIES"
' ' Radice del direttorio delle macchine
' Private m_sMachinesRoot As String
' ' Lista delle macchine disponibili
' Private m_MachineList As New ObservableCollection(Of Machine)
' Public Property MachineList As ObservableCollection(Of Machine)
' Get
' Return m_MachineList
' End Get
' Set(value As ObservableCollection(Of Machine))
' m_MachineList = value
' End Set
' End Property
' ' Macchina correntemente selezionata e quindi attiva
' Private m_SelectedMachine As Machine = Nothing
' Public Property SelectedMachine As MyMachine
' Get
' Return m_SelectedMachine
' End Get
' Set(value As MyMachine)
' If value IsNot m_SelectedMachine Then
' 'EgtSetCurrentContext(Map.refSceneHostVM.MainScene.GetCtx())
' 'EgtResetCurrMachGroup()
' ' se sono in modalità disegno
' m_SelectedMachine = value
' ' inizializzo la macchina selezionata come macchina corrente
' Dim nMachType As MachineType = DirectCast(m_SelectedMachine, MyMachine).nType
' SectionXMaterial.SetType(nMachType)
' InitCurrentMachine(Map.refMainWindowVM.MainWindowM.sMachinesRoot, value.Name, nMachType)
' End If
' End Set
' End Property
' Private m_SetUp_Background As Brush = New BrushConverter().ConvertFrom("#FFDDDDDD")
' Public Property SetUp_Background As Brush
' Get
' Return m_SetUp_Background
' End Get
' Set(value As Brush)
' m_SetUp_Background = value
' NotifyPropertyChanged("SetUp_Background")
' End Set
' End Property
' Private m_MachPanel_IsEnabled As Boolean = True
' Public Property MachPanel_IsEnabled As Boolean
' Get
' Return m_MachPanel_IsEnabled
' End Get
' Set(value As Boolean)
' m_MachPanel_IsEnabled = value
' NotifyPropertyChanged("MachPanel_IsEnabled")
' End Set
' End Property
'#Region "Messages"
' Public ReadOnly Property ToolDBMsg As String
' Get
' Return EgtMsg(MSG_MACHINEPAGEUC + 6)
' End Get
' End Property
' Public ReadOnly Property MachiningDbMsg As String
' Get
' Return EgtMsg(MSG_MACHINEPAGEUC + 7)
' End Get
' End Property
' Public ReadOnly Property SetUpMsg As String
' Get
' Return EgtMsg(MSG_ALARMSPAGEUC + 33)
' End Get
' End Property
'#End Region ' Messages
'#Region "ToolTip"
' Public ReadOnly Property ToolDBToolTip As String
' Get
' Return "Tool DB"
' End Get
' End Property
' Public ReadOnly Property MachiningDbToolTip As String
' Get
' Return "Machining DB"
' End Get
' End Property
' Public ReadOnly Property SetUpToolTip As String
' Get
' Return "SetUp"
' End Get
' End Property
'#End Region ' ToolTip
' ' Definizione comandi
' Private m_cmdToolDb As ICommand
' Private m_cmdMachDb As ICommand
' Private m_cmdSetUp As ICommand
' Private m_cmdMachOptions As ICommand
'#End Region 'FIELDS & PROPERTIES
'#Region "CONSTRUCTOR"
' Sub New()
' ' Creo riferimento a questa classe in Map
' Map.SetRefMachinePanelVM(Me)
' ' recupero cartella radice delle macchine
' m_sMachinesRoot = Map.refMainWindowVM.MainWindowM.sMachinesRoot
' ' Carica macchine da cartella delle macchine
' MyMachine.MachineListInit(m_sMachinesRoot, MachineList)
' End Sub
'#End Region ' CONSTRUCTOR
'#Region "METHODS"
' Friend Sub LoadCurrentMachine()
' If MachineList.Count = 0 Then Return
' Dim CurrMachine As Machine = Nothing
' Dim CurrMachineName As String = String.Empty
' GetMainPrivateProfileString(S_MACH, K_SUPERVISORMACH, String.Empty, CurrMachineName)
' Dim bFound As Boolean = False
' If Not String.IsNullOrEmpty(CurrMachineName) Then
' For Each Mach In MachineList
' If Mach.Name = CurrMachineName Then
' bFound = True
' CurrMachine = Mach
' Exit For
' End If
' Next
' End If
' If Not bFound And MachineList.Count > 0 Then
' CurrMachine = MachineList(0)
' End If
' If Not IsNothing(CurrMachine) Then
' If EgtSetCurrMachine(CurrMachine.Name) Then
' SelectedMachine = CurrMachine
' End If
' End If
' End Sub
' Friend Sub SaveCurrentMachine()
' If IsNothing(m_SelectedMachine) Then Return
' WriteMainPrivateProfileString(S_MACH, K_CURRMACH, SelectedMachine.Name)
' End Sub
' Friend Sub UpdateCurrentMachine()
' 'EgtSetCurrentContext(IniFile.m_ProjectSceneContext)
' Dim sMachName As String = String.Empty
' If EgtGetCurrMachineName(sMachName) Then
' For Each Mach In MachineList
' If Mach.Name = sMachName Then
' SelectedMachine = Mach
' Exit For
' End If
' Next
' End If
' End Sub
'#End Region
'#Region "COMMANDS"
'#Region "ToolDbCommand"
' ''' <summary>
' ''' Returns a command that do Exec.
' ''' </summary>
' Public ReadOnly Property ToolDbCommand As ICommand
' Get
' If m_cmdToolDb Is Nothing Then
' m_cmdToolDb = New Command(AddressOf ToolDb)
' End If
' Return m_cmdToolDb
' End Get
' End Property
' ''' <summary>
' ''' Execute the Exec. This method is invoked by the ExecCommand.
' ''' </summary>
' Public Sub ToolDb(ByVal param As Object)
' If Not VerifyMachinesDir(m_sMachinesRoot) Then Return
' ' ricarico il database per intercettare eventuali aggiornamenti fatti da altre istanze del programma (se la cartella Machines è condivisa)
' If Not EgtTdbReload() Then
' EgtOutLog("Impossible reloading tool Db")
' MessageBox.Show(EgtMsg(MSG_TOOLDBERRORS + 30), EgtMsg(MSG_MESSAGEBOX + 1), MessageBoxButton.OK, MessageBoxImage.Error)
' Return
' End If
' Dim ToolDbWindowVM As New ToolDbWindowVM(CurrentMachine.sMachDir, CurrentMachine.sMachIniFile, Map.refSceneHostVM.MainScene.GetCtx(), "Beam")
' Dim ToolDbWindowV As New ToolDbWindowV(Application.Current.MainWindow, ToolDbWindowVM)
' If ToolDbWindowVM.MatType <> 0 Then
' ToolDbWindowV.Height = 640
' ToolDbWindowV.Width = 1024
' ToolDbWindowV.ShowDialog()
' Else
' Exit Sub
' End If
' If Not SetUpUtility.IsValidToolHeadExitInSetUp() Then
' SetUp_Background = Brushes.Red
' Else
' SetUp_Background = OmagOFFICEDictionary.Button_Static_Background
' End If
' End Sub
'#End Region ' ToolDbCommand
'#Region "MachDbCommand"
' ''' <summary>
' ''' Returns a command that do Exec.
' ''' </summary>
' Public ReadOnly Property MachDbCommand As ICommand
' Get
' If m_cmdMachDb Is Nothing Then
' m_cmdMachDb = New Command(AddressOf MachDb)
' End If
' Return m_cmdMachDb
' End Get
' End Property
' ''' <summary>
' ''' Execute the Exec. This method is invoked by the ExecCommand.
' ''' </summary>
' Public Sub MachDb(ByVal param As Object)
' If Not VerifyMachinesDir(m_sMachinesRoot) Then Return
' ' ricarico il database per intercettare eventuali aggiornamenti fatti da altre istanze del programma (se la cartella Machines è condivisa)
' If Not EgtMdbReload() Then
' EgtOutLog("Impossible reloading machining Db")
' MessageBox.Show(EgtMsg(MSG_MACHININGDBERRORS + 8), EgtMsg(MSG_MESSAGEBOX + 1), MessageBoxButton.OK, MessageBoxImage.Error)
' Return
' End If
' Dim MachDbWindowVM As New EgtWPFLib5.MachiningDbWindowVM(CurrentMachine.sMachIniFile, Map.refSceneHostVM.MainScene.GetCtx(), "Stone")
' Dim MachDbWindowV As New EgtWPFLib5.MachiningDbWindowV(Application.Current.MainWindow, MachDbWindowVM)
' If EgtWPFLib5.MachiningTreeViewItem.m_MatType <> 0 Then
' MachDbWindowV.Height = 768
' MachDbWindowV.Width = 1024
' MachDbWindowV.ShowDialog()
' Else
' Exit Sub
' End If
' End Sub
'#End Region ' MachDbCommand
'#Region "SetUpCommand"
' ''' <summary>
' ''' Returns a command that do Exec.
' ''' </summary>
' Public ReadOnly Property SetUpCommand As ICommand
' Get
' If m_cmdSetUp Is Nothing Then
' m_cmdSetUp = New Command(AddressOf SetUp)
' End If
' Return m_cmdSetUp
' End Get
' End Property
' ''' <summary>
' ''' Execute the Exec. This method is invoked by the ExecCommand.
' ''' </summary>
' Public Sub SetUp(ByVal param As Object)
' ' verifico che il file di configurazione attrezzaggio (lua) della macchina esista
' If Not File.Exists(CurrentMachine.sMachDir & "\Scripts\" & SETUP_LUA) Then
' EgtOutLog("SetUp error: SetUp configuration file doesn't exist ")
' MessageBox.Show(EgtMsg(MSG_SETUPERRORS + 7), EgtMsg(MSG_SETUPERRORS + 1), MessageBoxButton.OK, MessageBoxImage.Error)
' Return
' End If
' ' carico Lua che contiene le funzioni per ottenere le posizioni valide dell'utensile selezionato,
' ' e testa e uscita dell'utensile attrezzato
' EgtLuaExecFile(CurrentMachine.sMachDir & "\Scripts\" & SETUP_LUA)
' ' verifico che le teste riportate in configurazione esistano
' Dim Index As Integer = 1
' Dim nErr As Integer = 0
' While nErr = 0
' Dim sHead As String = String.Empty
' nErr = 999
' EgtLuaSetGlobIntVar("STU.INDEX", Index)
' EgtLuaCallFunction("STU.GetTcPosHeadGroupFromPos")
' ' Leggo variabili
' EgtLuaGetGlobStringVar("STU.HEAD", sHead)
' EgtLuaGetGlobIntVar("STU.ERR", nErr)
' If nErr = 0 Then
' If EgtGetHeadExitCount(sHead) = 0 Then
' MessageBox.Show(EgtMsg(MSG_SETUPERRORS + 8), EgtMsg(MSG_SETUPERRORS + 1), MessageBoxButton.OK, MessageBoxImage.Error)
' Return
' End If
' End If
' Index += 1
' End While
' ' Reset lua
' EgtLuaResetGlobVar("STU")
' Dim SetUpWindow As New SetUpWindowV(Application.Current.MainWindow, New SetUpWindowVM(CurrentMachine.sMachDir, CurrentMachine.sMachineName))
' SetUpWindow.Height = 614
' SetUpWindow.Width = 1024
' SetUpWindow.ShowDialog()
' End Sub
'#End Region ' SetUpCommand
'#Region "MachOptionsCommand"
' ''' <summary>
' ''' Returns a command that do Exec.
' ''' </summary>
' Public ReadOnly Property MachOptionsCommand As ICommand
' Get
' If m_cmdMachOptions Is Nothing Then
' m_cmdMachOptions = New Command(AddressOf MachOptions)
' End If
' Return m_cmdMachOptions
' End Get
' End Property
' ''' <summary>
' ''' Execute the Exec. This method is invoked by the ExecCommand.
' ''' </summary>
' Public Sub MachOptions(ByVal param As Object)
' End Sub
'#End Region ' MachOptionsCommand
'#End Region ' COMMANDS
'End Class
@@ -322,6 +322,10 @@ Public Class MainWindowM
Dim sLuaBaseLib As String = String.Empty
GetMainPrivateProfileString(S_LUA, K_BASELIB, "EgtBase", sLuaBaseLib)
EgtLuaRequire(sLuaBaseLib)
' Recupero flag ModifySetup
m_bModifySetup = GetMainPrivateProfileInt(S_GENERAL, K_MODIFYSETUP, 0) = 1
' e lo imposto nel core
Core.Configuration.SetOnlyProd(m_bModifySetup)
' verifico se stampante attiva
Dim sPrinterLink As String = ""
Dim nPrinterLink As Integer = 0
+3 -3
View File
@@ -2,13 +2,13 @@
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:EgtFloating="clr-namespace:EgtWPFLib5.EgtFloating;assembly=EgtWPFLib5"
xmlns:EgtWPFLib5="clr-namespace:EgtWPFLib5;assembly=EgtWPFLib5"
xmlns:EgtBEAMWALLCORE="clr-namespace:EgtBEAMWALL.Core;assembly=EgtBEAMWALL.Core"
xmlns:EgtBEAMWALL="clr-namespace:EgtBEAMWALL.Supervisor">
<EgtFloating:EgtFloatingTray x:Name="PROJECTTOPTRAY" DockPanel.Dock="Top">
<EgtBEAMWALL:SupervisorManagerV DataContext="{StaticResource SupervisorManagerVM}"/>
<EgtBEAMWALL:MachinePanelV DataContext="{StaticResource MachinePanelVM}"
Visibility="Collapsed"/>
<EgtBEAMWALLCORE:MachinePanelV DataContext="{StaticResource MachinePanelVM}"
Visibility="Collapsed"/>
</EgtFloating:EgtFloatingTray>
<Grid>
Binary file not shown.

After

Width:  |  Height:  |  Size: 434 B

@@ -28,9 +28,15 @@ Public Module CurrentMachine
Private m_sMachIniFile As String = String.Empty
' File ini dei parametri macchina
Private m_sMachParamIniFile As String = String.Empty
' File lettura Ts3Data
Private m_sGetTs3DataFile As String = String.Empty
' File Ts3Data
Private m_sTs3DataFile As String = String.Empty
' Cartella degli script
Private m_sMachScriptDir As String = String.Empty
' Ffile dei messaggi macchina
' Cartella dei setup
Private m_sMachSetupDir As String = String.Empty
' File dei messaggi macchina
Private m_sMachMessagesFile As String = String.Empty
' Tipo macchina
@@ -45,12 +51,6 @@ Public Module CurrentMachine
End Get
End Property
Friend ReadOnly Property nType As MachineType
Get
Return m_nType
End Get
End Property
' tipo di CN della macchina
Private m_NCType As NCTypes = NCTypes.NULL
Public ReadOnly Property NCType As Integer
@@ -92,17 +92,41 @@ Public Module CurrentMachine
End Get
End Property
Friend ReadOnly Property sTs3DataFile As String
Get
Return m_sTs3DataFile
End Get
End Property
Friend ReadOnly Property sMachScriptDir As String
Get
Return m_sMachScriptDir
End Get
End Property
Friend ReadOnly Property sMachSetupDir As String
Get
Return m_sMachSetupDir
End Get
End Property
#End Region
'Private m_MachTableList As New ObservableCollection(Of MachTable)
'Public Property MachTableList As ObservableCollection(Of MachTable)
' Get
' Return m_MachTableList
' End Get
' Set(value As ObservableCollection(Of MachTable))
' m_MachTableList = value
' End Set
'End Property
Friend ReadOnly Property nType As MachineType
Get
Return m_nType
End Get
End Property
Private m_MachTableList As New ObservableCollection(Of MachTable)
Public Property MachTableList As ObservableCollection(Of MachTable)
Get
Return m_MachTableList
End Get
Set(value As ObservableCollection(Of MachTable))
m_MachTableList = value
End Set
End Property
#Region "Init"
@@ -138,21 +162,30 @@ Public Module CurrentMachine
' Impostazione path MachParamIni file
If nType = MachineType.BEAM Then
m_sMachParamIniFile = sMachinesRootDir & "\" & sMachineName & "\" & K_BEAM & "\" & MACH_INI_FILE_NAME
m_sGetTs3DataFile = sMachinesRootDir & "\" & sMachineName & "\" & K_BEAM & "\" & GETTS3DATA_FILE_NAME
m_sTs3DataFile = sMachinesRootDir & "\" & sMachineName & "\" & K_BEAM & "\" & TS3DATA_FILE
ElseIf nType = MachineType.WALL Then
m_sMachParamIniFile = sMachinesRootDir & "\" & sMachineName & "\" & K_WALL & "\" & MACH_INI_FILE_NAME
m_sGetTs3DataFile = sMachinesRootDir & "\" & sMachineName & "\" & K_WALL & "\" & GETTS3DATA_FILE_NAME
m_sTs3DataFile = sMachinesRootDir & "\" & sMachineName & "\" & K_WALL & "\" & TS3DATA_FILE
Else
' Se macchina di tipo BOTH prendo quello presente in Beam, se esiste, altrimenti prendo quello in Wall
Dim sBeamMachParamIniFile = sMachinesRootDir & "\" & sMachineName & "\" & K_BEAM & "\" & MACH_INI_FILE_NAME
Dim sWallMachParamIniFile = sMachinesRootDir & "\" & sMachineName & "\" & K_WALL & "\" & MACH_INI_FILE_NAME
Dim sBeamGetTs3File = sMachinesRootDir & "\" & sMachineName & "\" & K_BEAM & "\" & GETTS3DATA_FILE_NAME
Dim sWallGetTs3File = sMachinesRootDir & "\" & sMachineName & "\" & K_WALL & "\" & GETTS3DATA_FILE_NAME
Dim sBeamTs3DataFile = sMachinesRootDir & "\" & sMachineName & "\" & K_BEAM & "\" & TS3DATA_FILE
Dim sWallTs3DataFile = sMachinesRootDir & "\" & sMachineName & "\" & K_WALL & "\" & TS3DATA_FILE
If nType = MachineType.BOTH Then
m_sMachParamIniFile = If(File.Exists(sBeamMachParamIniFile), sBeamMachParamIniFile, sWallMachParamIniFile)
m_sGetTs3DataFile = If(File.Exists(sBeamGetTs3File), sBeamGetTs3File, sWallGetTs3File)
m_sTs3DataFile = If(File.Exists(sBeamTs3DataFile), sBeamTs3DataFile, sWallTs3DataFile)
End If
End If
' leggo tipo di avanzamento pezzi
m_Flow = GetPrivateProfileInt(S_GENERAL, K_FLOW, 1, m_sMachIniFile)
' Impostazione path Script dir
m_sMachScriptDir = sMachinesRootDir & "\" & sMachineName & "\" & K_SCRIPT
' Impostazione path Setup dir
m_sMachSetupDir = sMachinesRootDir & "\" & sMachineName & "\" & K_SETUP
' crea l'elenco dei parametri della macchina corrente
CreateMachParams()
@@ -165,8 +198,9 @@ Public Module CurrentMachine
' imposto visibilita' input output
Map.refMainMenuVM.SetInputOutputVisibility()
' leggo parametri macchina da WallData
If nType = MachineType.BEAM Then
' leggo parametri macchina da BeamData
If nType = MachineType.BEAM OrElse nType = MachineType.BOTH Then
' Assegno i dati
EgtLuaCreateGlobTable("GWD")
EgtLuaSetGlobStringVar("GWD.BASEDIR", Map.refMainWindowVM.MainWindowM.sBeamRoot)
@@ -185,7 +219,7 @@ Public Module CurrentMachine
EgtOutLog("Error executing GetBeamData script " & sExecPath)
End If
If bOk Then
Dim nTemp As Integer
Dim nTemp As Integer = 0
EgtLuaGetGlobIntVar("GWD.SIMUL_VIEW_DIR", nTemp)
Select Case nTemp
Case 0
@@ -207,7 +241,7 @@ Public Module CurrentMachine
' aggiorno parametro in gestore viste
Core.ViewPanelVM.UpdateMachParam(m_nViewDir)
End If
If nType = MachineType.WALL Then
If nType = MachineType.WALL OrElse nType = MachineType.BOTH Then
' Assegno i dati
EgtLuaCreateGlobTable("GWD")
EgtLuaSetGlobStringVar("GWD.BASEDIR", Map.refMainWindowVM.MainWindowM.sWallRoot)
@@ -226,9 +260,11 @@ Public Module CurrentMachine
EgtOutLog("Error executing GetWallData script " & sExecPath)
End If
If bOk Then
Dim nTemp As Integer
Dim nTemp As Integer = 0
EgtLuaGetGlobIntVar("GWD.SIMUL_VIEW_DIR", nTemp)
Select Case nTemp
Case 0
m_nViewDir = VT.ISO_SW
Case 1
m_nViewDir = VT.ISO_NW
Case 2
@@ -276,25 +312,41 @@ Public Module CurrentMachine
' funzione che crea l'elenco dei parametri Macchina
Friend Sub CreateMachParams()
'MachTableList.Clear()
'Dim NewMachParam As MachParam = Nothing
'Dim MachParamList As New ObservableCollection(Of MachParam)
'Dim TableIndex = 1
'Dim ParamIndex As Integer = 1
'Dim TableName As String = String.Empty
'' verifico che ci sia una table con l'indice designato e ne leggo il nome
'While GetMachPrivateProfileString(TableIndex, K_NAME, "", TableName)
' ' leggo tutti i parametri della table
' While MachParamIniFile.GetMachPrivateProfileParam(TableIndex, ParamIndex, NewMachParam)
' MachParamList.Add(NewMachParam)
' ParamIndex += 1
' End While
' MachTableList.Add(New MachTable(TableName, MachParamList))
' ' aggiorno indici e resetto lista per lettura dell'eventuale table successiva
' TableIndex += 1
' ParamIndex = 1
' MachParamList = New ObservableCollection(Of MachParam)
'End While
MachTableList.Clear()
If String.IsNullOrWhiteSpace(m_sMachParamIniFile) OrElse Not File.Exists(m_sMachParamIniFile) Then
EgtOutLog("Impossible loading Mach parameters: MachData.ini file not found or not readable")
Return
End If
Dim NewMachParam As MachParam = Nothing
Dim MachParamList As New ObservableCollection(Of MachParam)
Dim TableIndex = 1
Dim ParamIndex As Integer = 1
Dim TableName As String = String.Empty
' carico lua ts3data
Dim bTs3DataLoaded As Boolean = False
EgtLuaCreateGlobTable("GTSD")
EgtLuaSetGlobStringVar("GTSD.TS3PATH", m_sTs3DataFile)
Dim sExecPath As String = m_sGetTs3DataFile
bTs3DataLoaded = File.Exists(m_sTs3DataFile) AndAlso EgtLuaExecFile(sExecPath)
If Not bTs3DataLoaded Then
EgtOutLog("Error executing Ts3Data file " & m_sTs3DataFile)
End If
' verifico che ci sia una table con l'indice designato e ne leggo il nome
While GetMachPrivateProfileString(TableIndex, K_NAME, "", TableName)
' leggo tutti i parametri della table
While MachParamIniFile.GetMachPrivateProfileParam(TableIndex, ParamIndex, NewMachParam, TableName, bTs3DataLoaded)
MachParamList.Add(NewMachParam)
ParamIndex += 1
End While
MachTableList.Add(New MachTable(TableName, MachParamList))
' aggiorno indici e resetto lista per lettura dell'eventuale table successiva
TableIndex += 1
ParamIndex = 1
MachParamList = New ObservableCollection(Of MachParam)
End While
' Cancello tavola globale
EgtLuaResetGlobVar("GTSD")
End Sub
Public Function MachMsg(Paragraph As MsgParagraphs, nId As Integer) As String
+45 -2
View File
@@ -159,8 +159,11 @@
<Setter Property="Width" Value="80"/>
</Style>
<Style x:Key="OptionPanel_Button" TargetType="{x:Type Button}" BasedOn="{StaticResource {x:Type Button}}">
<Setter Property="Height" Value="60"/>
<Setter Property="Width" Value="60"/>
<Setter Property="Height" Value="25"/>
<Setter Property="Width" Value="25"/>
<Setter Property="Margin" Value="5,0,0,0"/>
<Setter Property="VerticalAlignment" Value="Center"/>
<Setter Property="HorizontalAlignment" Value="Center"/>
</Style>
<Style x:Key="OptionPanel_TextButton" TargetType="{x:Type Button}" BasedOn="{StaticResource {x:Type Button}}">
<Setter Property="Height" Value="30"/>
@@ -353,6 +356,12 @@
<Setter Property="Margin" Value="2.5,0,2.5,0"/>
</Style>
<Style x:Key="MachParamTextBlock" TargetType="{x:Type TextBlock}" BasedOn="{StaticResource {x:Type TextBlock}}">
<Setter Property="HorizontalAlignment" Value="Left"/>
<Setter Property="VerticalAlignment" Value="Center"/>
<Setter Property="Margin" Value="5,0,5,0"/>
</Style>
<!-- ______________________________________________________________________________________________________________________________________________ -->
<!-- TextBox -->
@@ -748,4 +757,38 @@
<!-- ______________________________________________________________________________________________________________________________________________ -->
<!-- TabControl that have only Headers and no Pages -->
<Style x:Key="TabControl_OnlyHeaders" TargetType="{x:Type TabControl}">
<Setter Property="OverridesDefaultStyle" Value="True" />
<Setter Property="SnapsToDevicePixels" Value="True" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type TabControl}">
<Grid KeyboardNavigation.TabNavigation="Local">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<TabPanel Name="HeaderPanel"
Grid.Row="0"
Panel.ZIndex="1"
Margin="0,0,4,-1"
IsItemsHost="True"
KeyboardNavigation.TabIndex="1"
Background="Transparent" />
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="IsEnabled" Value="False">
<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<!-- ______________________________________________________________________________________________________________________________________________ -->
</ResourceDictionary>
@@ -0,0 +1,70 @@
Imports System.Collections.ObjectModel
Imports EgtUILib
Imports EgtWPFLib5
Friend Module MachParamIniFile
Public Function GetMachPrivateProfileParam(IpParentTable As Integer, IpMachParamIndex As String, ByRef IpMachParam As MachParam, TableName As String, bTs3dataLoaded As Boolean) As Boolean
Dim sMachParam As String = String.Empty
If EgtUILib.GetPrivateProfileString(IpParentTable, IpMachParamIndex, String.Empty, sMachParam, sMachParamIniFile) > 0 Then
Dim sMachParamParams() As String = sMachParam.Split(","c)
' verifico numero minimo di parametri
If sMachParamParams.Count >= 4 Then
' cancello spazi
For Index = 0 To sMachParamParams.Count - 1
sMachParamParams(Index) = sMachParamParams(Index).Trim()
Next
' creo parametro
If sMachParamParams(0) = "d" OrElse sMachParamParams(0) = "l" Then
Dim dDefault As Double
StringToDoubleAdv(sMachParamParams(2), dDefault)
Dim ParamType As MachParamType
If sMachParamParams(0) = "d" Then
ParamType = MachParamType.DOUBLE_
Else
ParamType = MachParamType.LENGTH
End If
If bTs3dataLoaded Then
Dim dTs3DataValue As Double
If EgtLuaGetGlobNumVar(TableName & "." & sMachParamParams(1), dTs3DataValue) Then
dDefault = dTs3DataValue
End If
End If
IpMachParam = New MachParam(IpParentTable, IpMachParamIndex, ParamType, sMachParamParams(1), dDefault, sMachParamParams(3))
Return Not IsNothing(IpMachParam)
ElseIf sMachParamParams(0) = "s" Then
IpMachParam = New MachParam(IpParentTable, IpMachParamIndex, MachParamType.STRING_, sMachParamParams(1), sMachParamParams(3))
Return Not IsNothing(IpMachParam)
End If
End If
End If
Return False
End Function
Public Function GetMachPrivateProfileString(IpAppName As String, IpKeyName As String, IpDefault As String, ByRef IpString As String) As Integer
Return EgtUILib.GetPrivateProfileString(IpAppName, IpKeyName, IpDefault, IpString, sMachParamIniFile)
End Function
Public Function GetMachPrivateProfileParamValue(IpParentTable As Integer, IpMachParamIndex As String, ByRef IpMachParamValue As String) As Boolean
Dim sMachParam As String = String.Empty
If EgtUILib.GetPrivateProfileString(IpParentTable, IpMachParamIndex, String.Empty, sMachParam, sMachParamIniFile) > 0 Then
Dim sMachParamParams() As String = sMachParam.Split(","c)
' verifico numero minimo di parametri
If sMachParamParams.Count >= 4 Then
' cancello spazi
For Index = 0 To sMachParamParams.Count - 1
sMachParamParams(Index) = sMachParamParams(Index).Trim()
Next
'restituisco il valore del parametro
IpMachParamValue = sMachParamParams(2)
Return Not IsNothing(IpMachParamValue)
End If
End If
Return False
End Function
Public Function WriteMachPrivateProfileString(IpAppName As String, IpKeyName As String, ByRef IpString As String) As Boolean
Return EgtUILib.WritePrivateProfileString(IpAppName, IpKeyName, IpString, sMachParamIniFile)
End Function
End Module
@@ -2,7 +2,6 @@
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"
xmlns:EgtBEAMWALL="clr-namespace:EgtBEAMWALL.ViewerOptimizer"
xmlns:EgtBEAMWALLCORE="clr-namespace:EgtBEAMWALL.Core;assembly=EgtBEAMWALL.Core"
Title="{Binding Title}"
Style="{DynamicResource {x:Type EgtWPFLib5:EgtCustomWindow}}"
@@ -1,4 +1,6 @@
Public Class BeamMachiningsWindowV
Imports EgtBEAMWALL.Core
Public Class BeamMachiningsWindowV
Private WithEvents m_BeamMachiningsWindowVM As MyBeamMachiningsWindowVM
@@ -1,9 +1,7 @@
<DockPanel x:Class="ConfigurationPageV"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:EgtFloating="clr-namespace:EgtWPFLib5.EgtFloating;assembly=EgtWPFLib5"
xmlns:EgtWPFLib5="clr-namespace:EgtWPFLib5;assembly=EgtWPFLib5"
xmlns:EgtBEAMWALL="clr-namespace:EgtBEAMWALL.ViewerOptimizer">
xmlns:EgtBEAMWALLCORE="clr-namespace:EgtBEAMWALL.Core;assembly=EgtBEAMWALL.Core">
<Grid>
<Grid.ColumnDefinitions>
@@ -30,7 +28,7 @@
</StackPanel>
</TabItem.Header>
<TabItem.Content>
<EgtBEAMWALL:General_ConfigurationPageV/>
<EgtBEAMWALLCORE:General_ConfigurationPageV/>
</TabItem.Content>
</TabItem>
<TabItem>
@@ -47,7 +45,7 @@
</StackPanel>
</TabItem.Header>
<TabItem.Content>
<EgtBEAMWALL:QParameter_ConfigurationPageV/>
<EgtBEAMWALLCORE:QParameter_ConfigurationPageV/>
</TabItem.Content>
</TabItem>
<TabItem >
@@ -63,9 +61,8 @@
</Button>
</StackPanel>
</TabItem.Header>
<TabItem.Content>
<EgtBEAMWALL:Machine_ConfigurationPageV/>
<EgtBEAMWALLCORE:Machine_ConfigurationPageV/>
</TabItem.Content>
</TabItem>
</TabControl>
@@ -4,11 +4,7 @@ Imports EgtUILib
Imports EgtWPFLib5
Imports EgtBEAMWALL.Core
Imports MS.Internal
Imports Org.BouncyCastle.X509
Imports Ionic.Zip
Imports Org.BouncyCastle.Bcpg
Imports Microsoft.VisualBasic.ApplicationServices
Imports Renci.SshNet.Security
Public Class ConfigurationPageVM
Inherits VMBase
@@ -64,7 +64,7 @@
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Grid Grid.Row="0"
Margin="0,2,0,5">
Margin="0,2,0,5">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="1*"/>
@@ -114,5 +114,5 @@
</Grid>
</GroupBox>
</StackPanel>
</Grid>
@@ -264,15 +264,6 @@
<DependentUpon>ChangeMaterialWndV.xaml</DependentUpon>
</Compile>
<Compile Include="ChangeMaterialWnd\ChangeMaterialWndVM.vb" />
<Compile Include="ConfigurationPage\General_ConfigurationPageV.xaml.vb">
<DependentUpon>General_ConfigurationPageV.xaml</DependentUpon>
</Compile>
<Compile Include="ConfigurationPage\Machine_ConfigurationPageV.xaml.vb">
<DependentUpon>Machine_ConfigurationPageV.xaml</DependentUpon>
</Compile>
<Compile Include="ConfigurationPage\QParameter_ConfigurationPageV.xaml.vb">
<DependentUpon>QParameter_ConfigurationPageV.xaml</DependentUpon>
</Compile>
<Compile Include="DataGridMultiselectManaging\IListItemConverter.vb" />
<Compile Include="DataGridMultiselectManaging\MultiSelectorBehaviours.vb" />
<Compile Include="DataGridMultiselectManaging\TwoListSynchronizer.vb" />
@@ -280,6 +271,7 @@
<DependentUpon>FeatureListManagerV.xaml</DependentUpon>
</Compile>
<Compile Include="FeatureListManager\FeatureListManagerVM.vb" />
<Compile Include="MachinePanel\MachinePanelVM.vb" />
<Compile Include="PartInRawPartManager\PartInRawPartManagerWndV.xaml.vb">
<DependentUpon>PartInRawPartManagerWndV.xaml</DependentUpon>
</Compile>
@@ -328,7 +320,6 @@
<Compile Include="BeamMachiningsWindow\BeamMachiningsWindowV.xaml.vb">
<DependentUpon>BeamMachiningsWindowV.xaml</DependentUpon>
</Compile>
<Compile Include="BeamMachiningsWindow\MyBeamMachiningsWindowVM.vb" />
<Compile Include="BlockedWnd\BlockedWndV.xaml.vb">
<DependentUpon>BlockedWndV.xaml</DependentUpon>
</Compile>
@@ -484,10 +475,6 @@
<DependentUpon>ConfigurationPageV.xaml</DependentUpon>
</Compile>
<Compile Include="ConfigurationPage\ConfigurationPageVM.vb" />
<Compile Include="MachinePanel\MachinePanelV.xaml.vb">
<DependentUpon>MachinePanelV.xaml</DependentUpon>
</Compile>
<Compile Include="MachinePanel\MachinePanelVM.vb" />
<Compile Include="OpenProjectFileDialog\OpenProjectFileDialogVM.vb" />
<Compile Include="OptimizePanel\OptimizePanelV.xaml.vb">
<DependentUpon>OptimizePanelV.xaml</DependentUpon>
@@ -552,18 +539,6 @@
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="ConfigurationPage\General_ConfigurationPageV.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="ConfigurationPage\Machine_ConfigurationPageV.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="ConfigurationPage\QParameter_ConfigurationPageV.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="FeatureListManager\FeatureListManagerV.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
@@ -784,10 +759,6 @@
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="MachinePanel\MachinePanelV.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="MacroFeatureWnd\MacroFeatureWndV.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
@@ -2,7 +2,8 @@
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:EgtFloating="clr-namespace:EgtWPFLib5.EgtFloating;assembly=EgtWPFLib5"
IsEnabled="{Binding MachPanel_IsEnabled}">
IsEnabled="{Binding MachPanel_IsEnabled}"
Background="Green">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
@@ -242,9 +242,9 @@ Public Module CurrentMachine
EgtLuaResetGlobVar("GWD")
' aggiorno parametro in gestore viste
Core.ViewPanelVM.UpdateMachParam(m_nViewDir)
End If
' leggo parametri macchina da WallData
ElseIf nType = MachineType.WALL Then
If nType = MachineType.WALL OrElse nType = MachineType.BOTH Then
' Assegno i dati
EgtLuaCreateGlobTable("GWD")
EgtLuaSetGlobStringVar("GWD.BASEDIR", Map.refMainWindowVM.MainWindowM.sWallRoot)