Skip to content
This repository was archived by the owner on Mar 25, 2025. It is now read-only.

Commit a795c16

Browse files
[NEW-FEATURE] Pneumatic cylinder with 2 and 3 end position sensors (#560)
* Create draft PR for #539 * +Tco DoubleCylinder Co-authored-by: peterbarancek <peterbarancek@users.noreply.github.com> Co-authored-by: Peter Barancek <peter.barancek@mts.sk> Co-authored-by: peterbarancek <62284244+peterbarancek@users.noreply.github.com>
1 parent d7e6ae5 commit a795c16

26 files changed

+1478
-18
lines changed
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
<UserControl
2+
x:Class="TcoPneumatics.TcoDoubleCylinderServiceView"
3+
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
4+
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
5+
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
6+
xmlns:local="clr-namespace:TcOpen"
7+
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
8+
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
9+
xmlns:tcoCore="http://vortex.mts/xaml"
10+
xmlns:tcopneumatics="clr-namespace:TcoPneumatics"
11+
xmlns:vortex="http://vortex.mts/xaml"
12+
mc:Ignorable="d">
13+
<d:UserControl.DataContext>
14+
<tcopneumatics:TcoDoubleCylinderServiceViewModel />
15+
</d:UserControl.DataContext>
16+
<UserControl.Resources>
17+
<ItemsPanelTemplate x:Key="HorizontalWraped">
18+
<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}}" />
19+
</ItemsPanelTemplate>
20+
21+
</UserControl.Resources>
22+
<vortex:TcoComponentView>
23+
<vortex:TcoComponentView.ComponentHeader>
24+
25+
<ItemsControl ItemsPanel="{StaticResource HorizontalWraped}" HorizontalAlignment="Right" DataContext="{Binding Model}" >
26+
<ItemsControl.Resources>
27+
<Style TargetType="StackPanel">
28+
<Setter Property="MinWidth" Value="250"></Setter>
29+
</Style>
30+
</ItemsControl.Resources>
31+
<StackPanel>
32+
<Border
33+
Height="5"
34+
Background="{Binding _atHomePos.Cyclic, Converter={local:ActuatorToBrushConverter}}"
35+
CornerRadius="2" />
36+
<vortex:RenderableContentControl DataContext="{Binding _moveHomeDefault}"/>
37+
</StackPanel>
38+
<StackPanel>
39+
<Border
40+
Height="5"
41+
CornerRadius="2" />
42+
<vortex:RenderableContentControl DataContext="{Binding _stopDefault, Mode=OneWay}"/>
43+
</StackPanel>
44+
<StackPanel>
45+
<Border
46+
Height="5"
47+
Background="{Binding _atWorkPos.Cyclic, Converter={local:ActuatorToBrushConverter}}"
48+
CornerRadius="2" />
49+
<vortex:RenderableContentControl DataContext="{Binding _moveWorkDefault}"/>
50+
</StackPanel>
51+
</ItemsControl>
52+
</vortex:TcoComponentView.ComponentHeader>
53+
<vortex:TcoComponentView.ComponentDetails >
54+
<ScrollViewer MaxHeight="200" DataContext="{Binding Model}">
55+
<StackPanel Orientation="Vertical">
56+
<ItemsControl ItemsPanel="{StaticResource HorizontalWraped}" >
57+
<ItemsControl.Resources>
58+
<Style TargetType="StackPanel">
59+
<Setter Property="MinWidth" Value="250"></Setter>
60+
<Setter Property="Margin" Value="10"></Setter>
61+
62+
</Style>
63+
</ItemsControl.Resources>
64+
<StackPanel >
65+
<tcoCore:TcoSignalInfoView DataContext="{Binding _atHomePos1SignalInfo}"></tcoCore:TcoSignalInfoView>
66+
<tcoCore:TcoSignalInfoView DataContext="{Binding _atHomePos2SignalInfo}"></tcoCore:TcoSignalInfoView>
67+
<tcoCore:TcoSignalInfoView DataContext="{Binding _toHomePosSignalInfo}"></tcoCore:TcoSignalInfoView>
68+
</StackPanel>
69+
<StackPanel >
70+
<tcoCore:TcoSignalInfoView DataContext="{Binding _atWorkPos1SignalInfo}"></tcoCore:TcoSignalInfoView>
71+
<tcoCore:TcoSignalInfoView DataContext="{Binding _atWorkPos2SignalInfo}"></tcoCore:TcoSignalInfoView>
72+
<tcoCore:TcoSignalInfoView DataContext="{Binding _toWorkPosSignalInfo}"></tcoCore:TcoSignalInfoView>
73+
</StackPanel>
74+
75+
76+
77+
</ItemsControl>
78+
</StackPanel>
79+
</ScrollViewer>
80+
</vortex:TcoComponentView.ComponentDetails>
81+
</vortex:TcoComponentView>
82+
</UserControl>
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Globalization;
4+
using System.Linq;
5+
using System.Text;
6+
using System.Threading.Tasks;
7+
using System.Windows;
8+
using System.Windows.Controls;
9+
using System.Windows.Data;
10+
using System.Windows.Documents;
11+
using System.Windows.Input;
12+
using System.Windows.Markup;
13+
using System.Windows.Media;
14+
using System.Windows.Media.Imaging;
15+
using System.Windows.Navigation;
16+
using System.Windows.Shapes;
17+
18+
namespace TcoPneumatics
19+
{
20+
public partial class TcoDoubleCylinderServiceView : UserControl
21+
{
22+
public TcoDoubleCylinderServiceView()
23+
{
24+
InitializeComponent();
25+
}
26+
}
27+
}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Text;
5+
using System.Threading.Tasks;
6+
using Vortex.Presentation.Wpf;
7+
8+
namespace TcoPneumatics
9+
{
10+
11+
public class TcoDoubleCylinderViewModel : RenderableViewModel
12+
{
13+
public TcoDoubleCylinderViewModel()
14+
{
15+
16+
}
17+
18+
public TcoDoubleCylinder Component { get; private set; }
19+
20+
public override object Model { get => this.Component; set { this.Component = value as TcoDoubleCylinder; } }
21+
}
22+
23+
public class TcoDoubleCylinderServiceViewModel : TcoDoubleCylinderViewModel
24+
{
25+
26+
}
27+
}

src/TcoPneumatics/src/TcoPneumatics.Wpf/TcOpen.Inxton.TcoPneumatics.Wpf.csproj

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,10 @@
3131
<ProjectReference Include="..\TcoPneumaticsConnector\TcoPneumaticsConnector.csproj" />
3232
</ItemGroup>
3333

34+
<ItemGroup>
35+
<Page Update="Cylinders\TcoDoubleCylinderServiceView.xaml">
36+
<XamlRuntime>$(DefaultXamlRuntime)</XamlRuntime>
37+
</Page>
38+
</ItemGroup>
39+
3440
</Project>

src/TcoPneumatics/src/TcoPneumaticsConnector/Properties/Localizations.Designer.cs

Lines changed: 45 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/TcoPneumatics/src/TcoPneumaticsConnector/Properties/Localizations.resx

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,18 @@
141141
<data name="___Move_to_work_position_signal__" xml:space="preserve">
142142
<value>Move to work position signal</value>
143143
</data>
144+
<data name="___Home_sensor_signal_1__" xml:space="preserve">
145+
<value>Home sensor signal 1</value>
146+
</data>
147+
<data name="___Home_sensor_signal_2__" xml:space="preserve">
148+
<value>Home sensor signal 2</value>
149+
</data>
150+
<data name="___Work_sensor_signal_1__" xml:space="preserve">
151+
<value>Work sensor signal 1</value>
152+
</data>
153+
<data name="___Work_sensor_signal_2__" xml:space="preserve">
154+
<value>Work sensor signal 2</value>
155+
</data>
144156
<data name="___Home_and_work_position_sensors_are_both_active__Check_the_position_of_sensors___" xml:space="preserve">
145157
<value>Home and work position sensors are both active. Check the position of sensors!</value>
146158
</data>
@@ -162,4 +174,7 @@
162174
<data name="___Movement_aborted_due_to__" xml:space="preserve">
163175
<value>Movement aborted due to</value>
164176
</data>
177+
<data name="___Movement_suspended_due_to__" xml:space="preserve">
178+
<value>Movement suspended due to</value>
179+
</data>
165180
</root>

0 commit comments

Comments
 (0)