Skip to content
This repository has been archived by the owner on Feb 10, 2025. It is now read-only.

Commit

Permalink
[NEW-FEATURE] Pneumatic cylinder with 2 and 3 end position sensors (#560
Browse files Browse the repository at this point in the history
)

* Create draft PR for #539

* +Tco DoubleCylinder

Co-authored-by: peterbarancek <[email protected]>
Co-authored-by: Peter Barancek <[email protected]>
Co-authored-by: peterbarancek <[email protected]>
  • Loading branch information
4 people authored Nov 23, 2022
1 parent d7e6ae5 commit a795c16
Show file tree
Hide file tree
Showing 26 changed files with 1,478 additions and 18 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
<UserControl
x:Class="TcoPneumatics.TcoDoubleCylinderServiceView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:TcOpen"
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:tcoCore="http://vortex.mts/xaml"
xmlns:tcopneumatics="clr-namespace:TcoPneumatics"
xmlns:vortex="http://vortex.mts/xaml"
mc:Ignorable="d">
<d:UserControl.DataContext>
<tcopneumatics:TcoDoubleCylinderServiceViewModel />
</d:UserControl.DataContext>
<UserControl.Resources>
<ItemsPanelTemplate x:Key="HorizontalWraped">
<WrapPanel Background="Transparent" Width="{Binding (FrameworkElement.ActualWidth) , RelativeSource={RelativeSource AncestorType=ScrollContentPresenter}}" MinWidth="{Binding ItemWidth , RelativeSource={RelativeSource Self}}" ItemHeight="{Binding (ListView.View).ItemHeight , RelativeSource={RelativeSource AncestorType=ListView}}" ItemWidth="{Binding (ListView.View).ItemWidth , RelativeSource={RelativeSource AncestorType=ListView}}" />
</ItemsPanelTemplate>

</UserControl.Resources>
<vortex:TcoComponentView>
<vortex:TcoComponentView.ComponentHeader>

<ItemsControl ItemsPanel="{StaticResource HorizontalWraped}" HorizontalAlignment="Right" DataContext="{Binding Model}" >
<ItemsControl.Resources>
<Style TargetType="StackPanel">
<Setter Property="MinWidth" Value="250"></Setter>
</Style>
</ItemsControl.Resources>
<StackPanel>
<Border
Height="5"
Background="{Binding _atHomePos.Cyclic, Converter={local:ActuatorToBrushConverter}}"
CornerRadius="2" />
<vortex:RenderableContentControl DataContext="{Binding _moveHomeDefault}"/>
</StackPanel>
<StackPanel>
<Border
Height="5"
CornerRadius="2" />
<vortex:RenderableContentControl DataContext="{Binding _stopDefault, Mode=OneWay}"/>
</StackPanel>
<StackPanel>
<Border
Height="5"
Background="{Binding _atWorkPos.Cyclic, Converter={local:ActuatorToBrushConverter}}"
CornerRadius="2" />
<vortex:RenderableContentControl DataContext="{Binding _moveWorkDefault}"/>
</StackPanel>
</ItemsControl>
</vortex:TcoComponentView.ComponentHeader>
<vortex:TcoComponentView.ComponentDetails >
<ScrollViewer MaxHeight="200" DataContext="{Binding Model}">
<StackPanel Orientation="Vertical">
<ItemsControl ItemsPanel="{StaticResource HorizontalWraped}" >
<ItemsControl.Resources>
<Style TargetType="StackPanel">
<Setter Property="MinWidth" Value="250"></Setter>
<Setter Property="Margin" Value="10"></Setter>

</Style>
</ItemsControl.Resources>
<StackPanel >
<tcoCore:TcoSignalInfoView DataContext="{Binding _atHomePos1SignalInfo}"></tcoCore:TcoSignalInfoView>
<tcoCore:TcoSignalInfoView DataContext="{Binding _atHomePos2SignalInfo}"></tcoCore:TcoSignalInfoView>
<tcoCore:TcoSignalInfoView DataContext="{Binding _toHomePosSignalInfo}"></tcoCore:TcoSignalInfoView>
</StackPanel>
<StackPanel >
<tcoCore:TcoSignalInfoView DataContext="{Binding _atWorkPos1SignalInfo}"></tcoCore:TcoSignalInfoView>
<tcoCore:TcoSignalInfoView DataContext="{Binding _atWorkPos2SignalInfo}"></tcoCore:TcoSignalInfoView>
<tcoCore:TcoSignalInfoView DataContext="{Binding _toWorkPosSignalInfo}"></tcoCore:TcoSignalInfoView>
</StackPanel>



</ItemsControl>
</StackPanel>
</ScrollViewer>
</vortex:TcoComponentView.ComponentDetails>
</vortex:TcoComponentView>
</UserControl>
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Markup;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace TcoPneumatics
{
public partial class TcoDoubleCylinderServiceView : UserControl
{
public TcoDoubleCylinderServiceView()
{
InitializeComponent();
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Vortex.Presentation.Wpf;

namespace TcoPneumatics
{

public class TcoDoubleCylinderViewModel : RenderableViewModel
{
public TcoDoubleCylinderViewModel()
{

}

public TcoDoubleCylinder Component { get; private set; }

public override object Model { get => this.Component; set { this.Component = value as TcoDoubleCylinder; } }
}

public class TcoDoubleCylinderServiceViewModel : TcoDoubleCylinderViewModel
{

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,10 @@
<ProjectReference Include="..\TcoPneumaticsConnector\TcoPneumaticsConnector.csproj" />
</ItemGroup>

<ItemGroup>
<Page Update="Cylinders\TcoDoubleCylinderServiceView.xaml">
<XamlRuntime>$(DefaultXamlRuntime)</XamlRuntime>
</Page>
</ItemGroup>

</Project>

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,18 @@
<data name="___Move_to_work_position_signal__" xml:space="preserve">
<value>Move to work position signal</value>
</data>
<data name="___Home_sensor_signal_1__" xml:space="preserve">
<value>Home sensor signal 1</value>
</data>
<data name="___Home_sensor_signal_2__" xml:space="preserve">
<value>Home sensor signal 2</value>
</data>
<data name="___Work_sensor_signal_1__" xml:space="preserve">
<value>Work sensor signal 1</value>
</data>
<data name="___Work_sensor_signal_2__" xml:space="preserve">
<value>Work sensor signal 2</value>
</data>
<data name="___Home_and_work_position_sensors_are_both_active__Check_the_position_of_sensors___" xml:space="preserve">
<value>Home and work position sensors are both active. Check the position of sensors!</value>
</data>
Expand All @@ -162,4 +174,7 @@
<data name="___Movement_aborted_due_to__" xml:space="preserve">
<value>Movement aborted due to</value>
</data>
<data name="___Movement_suspended_due_to__" xml:space="preserve">
<value>Movement suspended due to</value>
</data>
</root>
Loading

0 comments on commit a795c16

Please sign in to comment.