aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoy Ben-Shabat <Roy@Twine-s.com>2018-02-13 16:35:28 +0200
committerRoy Ben-Shabat <Roy@Twine-s.com>2018-02-13 16:35:28 +0200
commitd5a5fd2813a98d97e0198342bbcc53df454c3e01 (patch)
tree8e3012262ba6417c3236d33a582df2d7ab0cd16a
parent2b1e86aeee219b236ba8cb33c5ebfa8bde89f14f (diff)
downloadTango-d5a5fd2813a98d97e0198342bbcc53df454c3e01.tar.gz
Tango-d5a5fd2813a98d97e0198342bbcc53df454c3e01.zip
Digital out.
-rw-r--r--Software/DB/Tango.mdfbin75497472 -> 75497472 bytes
-rw-r--r--Software/DB/Tango_log.ldfbin8388608 -> 8388608 bytes
-rw-r--r--Software/PMR/Messages/Common/ErrorCode.proto1
-rw-r--r--Software/PMR/Messages/Common/MessageType.proto4
-rw-r--r--Software/PMR/Messages/Diagnostics/DigitalPin.proto (renamed from Software/PMR/Messages/Diagnostics/SetGPIOStateRequest.proto)2
-rw-r--r--Software/PMR/Messages/Diagnostics/PushDiagnosticsResponse.proto3
-rw-r--r--Software/PMR/Messages/Diagnostics/SetDigitalOutRequest.proto10
-rw-r--r--Software/PMR/Messages/Diagnostics/SetDigitalOutResponse.proto (renamed from Software/PMR/Messages/Diagnostics/SetGPIOStateResponse.proto)2
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Converters/TechIosToDigitalOutsConverter.cs35
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/DigitalOutElementEditor.xaml (renamed from Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/IOElementEditor.xaml)9
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/DigitalOutElementEditor.xaml.cs (renamed from Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/IOElementEditor.xaml.cs)40
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/MotorElementEditor.xaml2
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/PropertiesTemplates/DigitalOutTemplate.xaml (renamed from Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/PropertiesTemplates/IOTemplate.xaml)12
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/PropertiesTemplates/DigitalOutTemplate.xaml.cs (renamed from Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/PropertiesTemplates/IOTemplate.xaml.cs)13
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Tango.MachineStudio.Technician.csproj15
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/DigitalOutItem.cs (renamed from Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/IOItem.cs)29
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/TechItem.cs2
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/ViewModels/MachineTechViewVM.cs33
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Views/MachineTechView.xaml4
-rw-r--r--Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/App.xaml.cs13
-rw-r--r--Software/Visual_Studio/Tango.Core/Helpers/ThreadsHelper.cs37
-rw-r--r--Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.Context.cs1
-rw-r--r--Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.edmx51
-rw-r--r--Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.edmx.diagram69
-rw-r--r--Software/Visual_Studio/Tango.DAL.Remote/DB/TECH_IOS.cs28
-rw-r--r--Software/Visual_Studio/Tango.DAL.Remote/DB/TECH_MOTORS.cs1
-rw-r--r--Software/Visual_Studio/Tango.DAL.Remote/Tango.DAL.Remote.csproj3
-rw-r--r--Software/Visual_Studio/Tango.Editors/EnumExtensions.cs5
-rw-r--r--Software/Visual_Studio/Tango.Emulations/Emulators/MachineEmulator.cs37
-rw-r--r--Software/Visual_Studio/Tango.Emulations/Tango.Emulations.csproj4
-rw-r--r--Software/Visual_Studio/Tango.Integration/Observables/Entities/TechIo.cs162
-rw-r--r--Software/Visual_Studio/Tango.Integration/Observables/Entities/TechMotor.cs20
-rw-r--r--Software/Visual_Studio/Tango.Integration/Observables/Enumerations/IOType.cs17
-rw-r--r--Software/Visual_Studio/Tango.Integration/Observables/Enumerations/TechDispensers.cs13
-rw-r--r--Software/Visual_Studio/Tango.Integration/Observables/Enumerations/TechIos.cs25
-rw-r--r--Software/Visual_Studio/Tango.Integration/Observables/Enumerations/TechMonitors.cs48
-rw-r--r--Software/Visual_Studio/Tango.Integration/Observables/Enumerations/TechMotors.cs19
-rw-r--r--Software/Visual_Studio/Tango.Integration/Observables/ObservableEntity.cs2
-rw-r--r--Software/Visual_Studio/Tango.Integration/Observables/ObservablesContext.cs8
-rw-r--r--Software/Visual_Studio/Tango.Integration/Observables/ObservablesEntitiesAdapter.cs2
-rw-r--r--Software/Visual_Studio/Tango.Integration/Observables/ObservablesEntitiesAdapterExtension.cs38
-rw-r--r--Software/Visual_Studio/Tango.Integration/Operators/IMachineOperator.cs4
-rw-r--r--Software/Visual_Studio/Tango.Integration/Operators/MachineOperator.cs6
-rw-r--r--Software/Visual_Studio/Tango.Integration/Tango.Integration.csproj2
-rw-r--r--Software/Visual_Studio/Tango.PMR/Common/ErrorCode.cs11
-rw-r--r--Software/Visual_Studio/Tango.PMR/Common/MessageType.cs20
-rw-r--r--Software/Visual_Studio/Tango.PMR/Diagnostics/DigitalPin.cs (renamed from Software/Visual_Studio/Tango.PMR/Diagnostics/SetGPIOStateRequest.cs)41
-rw-r--r--Software/Visual_Studio/Tango.PMR/Diagnostics/PushDiagnosticsResponse.cs60
-rw-r--r--Software/Visual_Studio/Tango.PMR/Diagnostics/SetDigitalOutRequest.cs188
-rw-r--r--Software/Visual_Studio/Tango.PMR/Diagnostics/SetDigitalOutResponse.cs (renamed from Software/Visual_Studio/Tango.PMR/Diagnostics/SetGPIOStateResponse.cs)40
-rw-r--r--Software/Visual_Studio/Tango.PMR/Tango.PMR.csproj5
-rw-r--r--Software/Visual_Studio/Tango.Transport/ITransporter.cs2
-rw-r--r--Software/Visual_Studio/Tango.Transport/ResponseErrorException.cs4
-rw-r--r--Software/Visual_Studio/Tango.Transport/TransporterBase.cs11
-rw-r--r--Software/Visual_Studio/Utilities/Tango.DBObservablesGenerator.CLI/ObservablesGenerator.cs10
-rw-r--r--Software/Visual_Studio/Utilities/Tango.MachineEM.UI/App.config18
-rw-r--r--Software/Visual_Studio/Utilities/Tango.MachineEM.UI/App.xaml.cs11
-rw-r--r--Software/Visual_Studio/Utilities/Tango.MachineEM.UI/MainWindow.xaml.cs2
-rw-r--r--Software/Visual_Studio/Utilities/Tango.MachineEM.UI/Tango.MachineEM.UI.csproj15
-rw-r--r--Software/Visual_Studio/Utilities/Tango.MachineEM.UI/packages.config1
60 files changed, 1017 insertions, 253 deletions
diff --git a/Software/DB/Tango.mdf b/Software/DB/Tango.mdf
index dee5d4c24..c26134cc3 100644
--- a/Software/DB/Tango.mdf
+++ b/Software/DB/Tango.mdf
Binary files differ
diff --git a/Software/DB/Tango_log.ldf b/Software/DB/Tango_log.ldf
index 8e9fee248..e935a702e 100644
--- a/Software/DB/Tango_log.ldf
+++ b/Software/DB/Tango_log.ldf
Binary files differ
diff --git a/Software/PMR/Messages/Common/ErrorCode.proto b/Software/PMR/Messages/Common/ErrorCode.proto
index e0a9f36a8..5164c61a1 100644
--- a/Software/PMR/Messages/Common/ErrorCode.proto
+++ b/Software/PMR/Messages/Common/ErrorCode.proto
@@ -7,4 +7,5 @@ enum ErrorCode
{
NONE = 0;
BAD_CRC = 1;
+ INVALID_DIGITAL_PIN_NUMBER = 2; //Can be returned by SetDigitalOutResponse.
}
diff --git a/Software/PMR/Messages/Common/MessageType.proto b/Software/PMR/Messages/Common/MessageType.proto
index 4f1593222..7b01bbb13 100644
--- a/Software/PMR/Messages/Common/MessageType.proto
+++ b/Software/PMR/Messages/Common/MessageType.proto
@@ -76,8 +76,8 @@ enum MessageType
DispenserJoggingResponse = 2015;
DispenserAbortJoggingRequest = 2016;
DispenserAbortJoggingResponse = 2017;
- SetGPIOStateRequest = 2018;
- SetGPIOStateResponse = 2019;
+ SetDigitalOutRequest = 2018;
+ SetDigitalOutResponse = 2019;
ThreadJoggingRequest = 2020;
ThreadJoggingResponse = 2021;
ThreadAbortJoggingRequest = 2022;
diff --git a/Software/PMR/Messages/Diagnostics/SetGPIOStateRequest.proto b/Software/PMR/Messages/Diagnostics/DigitalPin.proto
index 86685ac85..c87f9adda 100644
--- a/Software/PMR/Messages/Diagnostics/SetGPIOStateRequest.proto
+++ b/Software/PMR/Messages/Diagnostics/DigitalPin.proto
@@ -3,7 +3,7 @@ syntax = "proto3";
package Tango.PMR.Diagnostics;
option java_package = "com.twine.tango.pmr.diagnostics";
-message SetGPIOStateRequest
+message DigitalPin
{
int32 Port = 1;
bool Value = 2;
diff --git a/Software/PMR/Messages/Diagnostics/PushDiagnosticsResponse.proto b/Software/PMR/Messages/Diagnostics/PushDiagnosticsResponse.proto
index a79d0cba9..08045c2d9 100644
--- a/Software/PMR/Messages/Diagnostics/PushDiagnosticsResponse.proto
+++ b/Software/PMR/Messages/Diagnostics/PushDiagnosticsResponse.proto
@@ -1,6 +1,7 @@
syntax = "proto3";
import "DoubleArray.proto";
+import "DigitalPin.proto";
package Tango.PMR.Diagnostics;
option java_package = "com.twine.tango.pmr.diagnostics";
@@ -25,5 +26,5 @@ message PushDiagnosticsResponse
repeated double Dispenser8MotorFrequency = 12;
//GPIO Ports States
- repeated bool GPIO = 13;
+ repeated DigitalPin DigitalPins = 13;
} \ No newline at end of file
diff --git a/Software/PMR/Messages/Diagnostics/SetDigitalOutRequest.proto b/Software/PMR/Messages/Diagnostics/SetDigitalOutRequest.proto
new file mode 100644
index 000000000..9e5ab22f1
--- /dev/null
+++ b/Software/PMR/Messages/Diagnostics/SetDigitalOutRequest.proto
@@ -0,0 +1,10 @@
+syntax = "proto3";
+
+package Tango.PMR.Diagnostics;
+option java_package = "com.twine.tango.pmr.diagnostics";
+
+message SetDigitalOutRequest
+{
+ int32 Port = 1;
+ bool Value = 2;
+} \ No newline at end of file
diff --git a/Software/PMR/Messages/Diagnostics/SetGPIOStateResponse.proto b/Software/PMR/Messages/Diagnostics/SetDigitalOutResponse.proto
index 51b8b6c97..fa66bb98d 100644
--- a/Software/PMR/Messages/Diagnostics/SetGPIOStateResponse.proto
+++ b/Software/PMR/Messages/Diagnostics/SetDigitalOutResponse.proto
@@ -3,7 +3,7 @@ syntax = "proto3";
package Tango.PMR.Diagnostics;
option java_package = "com.twine.tango.pmr.diagnostics";
-message SetGPIOStateResponse
+message SetDigitalOutResponse
{
} \ No newline at end of file
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Converters/TechIosToDigitalOutsConverter.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Converters/TechIosToDigitalOutsConverter.cs
new file mode 100644
index 000000000..734c4bebf
--- /dev/null
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Converters/TechIosToDigitalOutsConverter.cs
@@ -0,0 +1,35 @@
+using System;
+using System.Collections.Generic;
+using System.Collections.ObjectModel;
+using System.Globalization;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Data;
+using Tango.Integration.Observables;
+using Tango.Integration.Observables.Enumerations;
+
+namespace Tango.MachineStudio.Technician.Converters
+{
+ public class TechIosToDigitalOutsConverter : IValueConverter
+ {
+ public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ ObservableCollection<TechIo> ios = value as ObservableCollection<TechIo>;
+
+ if (ios != null)
+ {
+ return ios.Where(x => x.Type == IOType.DigitalOutput.ToInt32()).ToObservableCollection();
+ }
+ else
+ {
+ return null;
+ }
+ }
+
+ public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ throw new NotImplementedException();
+ }
+ }
+}
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/IOElementEditor.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/DigitalOutElementEditor.xaml
index aa4f8aee6..dcf78ca69 100644
--- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/IOElementEditor.xaml
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/DigitalOutElementEditor.xaml
@@ -1,4 +1,4 @@
-<local:ElementEditor x:Class="Tango.MachineStudio.Technician.Editors.IOElementEditor"
+<local:ElementEditor x:Class="Tango.MachineStudio.Technician.Editors.DigitalOutElementEditor"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
@@ -9,7 +9,7 @@
xmlns:visuals="clr-namespace:Tango.Visuals;assembly=Tango.Visuals"
xmlns:local="clr-namespace:Tango.Editors;assembly=Tango.Editors"
mc:Ignorable="d"
- d:DesignHeight="88.852" d:DesignWidth="142.323" Background="Transparent" ClipToBounds="False" BorderThickness="0" MinWidth="1" MinHeight="1" RenderTransformOrigin="0.5,0.5" d:DataContext="{d:DesignInstance Type=items:IOItem, IsDesignTimeCreatable=False}">
+ d:DesignHeight="88.852" d:DesignWidth="142.323" Background="Transparent" ClipToBounds="False" BorderThickness="0" MinWidth="1" MinHeight="1" RenderTransformOrigin="0.5,0.5" d:DataContext="{d:DesignInstance Type=items:DigitalOutItem, IsDesignTimeCreatable=False}">
<UserControl.Resources>
<converters:BoolToVisibilityConverter x:Key="BoolToVisibilityConverter"></converters:BoolToVisibilityConverter>
@@ -56,10 +56,7 @@
</Border>
<Border VerticalAlignment="Bottom" Grid.Row="1" Margin="0 0 0 0">
- <TextBlock TextWrapping="Wrap" FontSize="14" Foreground="DimGray" HorizontalAlignment="Center">
- <Run>GPIO</Run>
- <Run Text="{Binding Port}"></Run>
- </TextBlock>
+ <TextBlock TextWrapping="Wrap" FontSize="14" Foreground="DimGray" HorizontalAlignment="Center" Text="{Binding TechIo.Description}"></TextBlock>
</Border>
</Grid>
<!--Content-->
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/IOElementEditor.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/DigitalOutElementEditor.xaml.cs
index 95710abd3..6428ccf1d 100644
--- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/IOElementEditor.xaml.cs
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/DigitalOutElementEditor.xaml.cs
@@ -22,35 +22,23 @@ using Tango.MachineStudio.Technician.TechItems;
namespace Tango.MachineStudio.Technician.Editors
{
[ContentProperty("InnerContent")]
- public partial class IOElementEditor : ElementEditor
+ public partial class DigitalOutElementEditor : ElementEditor
{
- /// <summary>
- /// Initializes a new instance of the <see cref="MonitorElementEditor"/> class.
- /// </summary>
- public IOElementEditor()
+ public DigitalOutElementEditor()
: base()
{
InitializeComponent();
}
- /// <summary>
- /// Initializes a new instance of the <see cref="MonitorElementEditor"/> class.
- /// </summary>
- /// <param name="frameworkElement">The framework element.</param>
- public IOElementEditor(IOItem ioItem)
+ public DigitalOutElementEditor(DigitalOutItem digitalOutItem)
: this()
{
- IOItem = ioItem;
- DataContext = IOItem;
+ DigitalOutItem = digitalOutItem;
+ DataContext = DigitalOutItem;
}
- /// <summary>
- /// Initializes a new instance of the <see cref="MonitorElementEditor"/> class.
- /// </summary>
- /// <param name="frameworkElement">The framework element.</param>
- /// <param name="bounds">The bounds.</param>
- public IOElementEditor(IOItem monitorItem, Rect bounds)
- : this(monitorItem)
+ public DigitalOutElementEditor(DigitalOutItem digitalOutItem, Rect bounds)
+ : this(digitalOutItem)
{
Left = bounds.Left;
Top = bounds.Top;
@@ -58,12 +46,12 @@ namespace Tango.MachineStudio.Technician.Editors
Height = bounds.Height;
}
- private IOItem _monitorItem;
+ private DigitalOutItem _digitalOutItem;
- public IOItem IOItem
+ public DigitalOutItem DigitalOutItem
{
- get { return _monitorItem; }
- set { _monitorItem = value; RaisePropertyChanged(nameof(IOItem)); }
+ get { return _digitalOutItem; }
+ set { _digitalOutItem = value; RaisePropertyChanged(nameof(DigitalOutItem)); }
}
@@ -75,8 +63,8 @@ namespace Tango.MachineStudio.Technician.Editors
{
try
{
- var clonedItem = IOItem.Clone() as IOItem;
- IOElementEditor cloned = new IOElementEditor(clonedItem);
+ var clonedItem = DigitalOutItem.Clone() as DigitalOutItem;
+ DigitalOutElementEditor cloned = new DigitalOutElementEditor(clonedItem);
cloned.Top = Top;
cloned.Left = Left;
cloned.Width = Width;
@@ -96,7 +84,7 @@ namespace Tango.MachineStudio.Technician.Editors
[ParameterIgnore]
public override Object HostedElement
{
- get { return IOItem; }
+ get { return DigitalOutItem; }
}
}
}
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/MotorElementEditor.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/MotorElementEditor.xaml
index 860072282..fb0466177 100644
--- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/MotorElementEditor.xaml
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/MotorElementEditor.xaml
@@ -162,7 +162,7 @@
</Border>
</Grid>
- <Grid Grid.Column="1" Grid.Row="1">
+ <Grid Grid.Column="1" Grid.Row="1" Visibility="{Binding TechMotor.SupportsHoming,Converter={StaticResource BoolToVisibilityConverter}}">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="20*"/>
<ColumnDefinition Width="115*"/>
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/PropertiesTemplates/IOTemplate.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/PropertiesTemplates/DigitalOutTemplate.xaml
index c03b72837..9d30e744c 100644
--- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/PropertiesTemplates/IOTemplate.xaml
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/PropertiesTemplates/DigitalOutTemplate.xaml
@@ -1,4 +1,4 @@
-<UserControl x:Class="Tango.MachineStudio.Technician.PropertiesTemplates.IOTemplate"
+<UserControl x:Class="Tango.MachineStudio.Technician.PropertiesTemplates.DigitalOutTemplate"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
@@ -9,10 +9,10 @@
xmlns:colorPicker="clr-namespace:Tango;assembly=Tango.ColorPicker"
xmlns:local="clr-namespace:Tango.MachineStudio.Technician.PropertiesTemplates"
mc:Ignorable="d"
- d:DesignHeight="500" d:DesignWidth="200" d:DataContext="{d:DesignInstance Type=items:IOItem, IsDesignTimeCreatable=False}">
+ d:DesignHeight="500" d:DesignWidth="200" d:DataContext="{d:DesignInstance Type=items:DigitalOutItem, IsDesignTimeCreatable=False}">
<UserControl.Resources>
- <converters:MonitorsToSingleChannleMonitorsConverter x:Key="MonitorsToSingleChannleMonitorsConverter" />
+ <converters:TechIosToDigitalOutsConverter x:Key="TechIosToDigitalOutsConverter" />
<Style TargetType="{x:Type TabItem}" BasedOn="{StaticResource {x:Type TabItem}}">
<Setter Property="mahapps:ControlsHelper.HeaderFontSize" Value="14" />
@@ -22,10 +22,10 @@
<Grid>
<StackPanel>
- <GroupBox Header="GPIO PORT">
+ <GroupBox Header="INPUT">
<StackPanel>
- <TextBlock FontSize="10">Selected Port</TextBlock>
- <ComboBox x:Name="combo" Margin="0 5 0 0" SelectedItem="{Binding Port,Mode=TwoWay}" />
+ <TextBlock FontSize="10">Selected Pin</TextBlock>
+ <ComboBox Margin="0 5 0 0" ItemsSource="{Binding Adapter.TechIos,Converter={StaticResource TechIosToDigitalOutsConverter}}" SelectedItem="{Binding TechIo,Mode=TwoWay}" DisplayMemberPath="Description" />
</StackPanel>
</GroupBox>
</StackPanel>
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/PropertiesTemplates/IOTemplate.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/PropertiesTemplates/DigitalOutTemplate.xaml.cs
index fae3586dc..58a3fcb8f 100644
--- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/PropertiesTemplates/IOTemplate.xaml.cs
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/PropertiesTemplates/DigitalOutTemplate.xaml.cs
@@ -18,20 +18,11 @@ namespace Tango.MachineStudio.Technician.PropertiesTemplates
/// <summary>
/// Interaction logic for MonitorTemplate.xaml
/// </summary>
- public partial class IOTemplate : UserControl
+ public partial class DigitalOutTemplate : UserControl
{
- public IOTemplate()
+ public DigitalOutTemplate()
{
InitializeComponent();
-
- List<int> ports = new List<int>();
-
- for (int i = 0; i < 120; i++)
- {
- ports.Add(i);
- }
-
- combo.ItemsSource = ports;
}
}
}
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Tango.MachineStudio.Technician.csproj b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Tango.MachineStudio.Technician.csproj
index e8b14e277..820a7ee57 100644
--- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Tango.MachineStudio.Technician.csproj
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Tango.MachineStudio.Technician.csproj
@@ -99,12 +99,13 @@
<Compile Include="Converters\MonitorsToMultiChannleMonitorsConverter.cs" />
<Compile Include="Converters\MonitorsToSingleChannleMonitorsConverter.cs" />
<Compile Include="Converters\SecondsToGraphPointsConverter.cs" />
+ <Compile Include="Converters\TechIosToDigitalOutsConverter.cs" />
<Compile Include="Converters\TransitionLinkConverter.cs" />
<Compile Include="Editors\DispenserElementEditor.xaml.cs">
<DependentUpon>DispenserElementEditor.xaml</DependentUpon>
</Compile>
- <Compile Include="Editors\IOElementEditor.xaml.cs">
- <DependentUpon>IOElementEditor.xaml</DependentUpon>
+ <Compile Include="Editors\DigitalOutElementEditor.xaml.cs">
+ <DependentUpon>DigitalOutElementEditor.xaml</DependentUpon>
</Compile>
<Compile Include="Editors\MotorGroupElementEditor.xaml.cs">
<DependentUpon>MotorGroupElementEditor.xaml</DependentUpon>
@@ -129,8 +130,8 @@
</Compile>
<Compile Include="Helpers\GraphsHelper.cs" />
<Compile Include="Project\MachineTechViewProject.cs" />
- <Compile Include="PropertiesTemplates\IOTemplate.xaml.cs">
- <DependentUpon>IOTemplate.xaml</DependentUpon>
+ <Compile Include="PropertiesTemplates\DigitalOutTemplate.xaml.cs">
+ <DependentUpon>DigitalOutTemplate.xaml</DependentUpon>
</Compile>
<Compile Include="PropertiesTemplates\MeterTemplate.xaml.cs">
<DependentUpon>MeterTemplate.xaml</DependentUpon>
@@ -156,7 +157,7 @@
<Compile Include="PropertiesTemplates\SingleGraphTemplate.xaml.cs">
<DependentUpon>SingleGraphTemplate.xaml</DependentUpon>
</Compile>
- <Compile Include="TechItems\IOItem.cs" />
+ <Compile Include="TechItems\DigitalOutItem.cs" />
<Compile Include="TechItems\MeterItem.cs" />
<Compile Include="TechItems\MotorActionType.cs" />
<Compile Include="TechItems\DispenserItem.cs" />
@@ -196,7 +197,7 @@
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
- <Page Include="Editors\IOElementEditor.xaml">
+ <Page Include="Editors\DigitalOutElementEditor.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
@@ -228,7 +229,7 @@
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
- <Page Include="PropertiesTemplates\IOTemplate.xaml">
+ <Page Include="PropertiesTemplates\DigitalOutTemplate.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/IOItem.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/DigitalOutItem.cs
index 60d47b1c0..817cfd9b7 100644
--- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/IOItem.cs
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/DigitalOutItem.cs
@@ -5,21 +5,21 @@ using System.Text;
using System.Threading.Tasks;
using System.Windows.Media;
using System.Xml.Serialization;
-using Tango.Core;
+using Tango.Integration.Observables;
using Tango.SharedUI.Helpers;
namespace Tango.MachineStudio.Technician.TechItems
{
- public class IOItem : TechItem
+ public class DigitalOutItem : TechItem
{
public event EventHandler<bool> ValueChanged;
- private int _port;
-
- public int Port
+ private TechIo _techIo;
+ [XmlIgnore]
+ public TechIo TechIo
{
- get { return _port; }
- set { _port = value; RaisePropertyChangedAuto(); TechName = "GPIO " + Port; }
+ get { return _techIo; }
+ set { _techIo = value; RaisePropertyChangedAuto(); TechName = _techIo != null ? _techIo.Description : null; ItemGuid = value != null ? value.Guid : null; }
}
private bool _value;
@@ -47,24 +47,23 @@ namespace Tango.MachineStudio.Technician.TechItems
}
}
-
- public IOItem() : base()
+ public DigitalOutItem() : base()
{
- Name = "GPIO Controller";
- Description = "GPIO Controller";
+ Name = "Digital Out";
+ Description = "Digital Output Pin Controller";
Image = ResourceHelper.GetImageFromResources("Images/binary.png");
Color = Colors.White;
}
- public IOItem(int port) : this()
+ public DigitalOutItem(TechIo techIo) : this()
{
- Port = port;
+ TechIo = techIo;
}
public override TechItem Clone()
{
- IOItem cloned = base.Clone() as IOItem;
- cloned.Port = Port;
+ DigitalOutItem cloned = base.Clone() as DigitalOutItem;
+ cloned.TechIo = TechIo;
return cloned;
}
}
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/TechItem.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/TechItem.cs
index a7b5ae5b9..92ad1c536 100644
--- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/TechItem.cs
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/TechItem.cs
@@ -14,7 +14,7 @@ using Tango.Integration.Observables;
namespace Tango.MachineStudio.Technician.TechItems
{
[XmlInclude(typeof(DispenserItem))]
- [XmlInclude(typeof(IOItem))]
+ [XmlInclude(typeof(DigitalOutItem))]
[XmlInclude(typeof(MeterItem))]
[XmlInclude(typeof(MonitorItem))]
[XmlInclude(typeof(MotorItem))]
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/ViewModels/MachineTechViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/ViewModels/MachineTechViewVM.cs
index 1b0ee0a56..c886c2345 100644
--- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/ViewModels/MachineTechViewVM.cs
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/ViewModels/MachineTechViewVM.cs
@@ -16,6 +16,7 @@ using System.Windows.Media;
using Tango.Core.Helpers;
using Tango.Editors;
using Tango.Integration.Observables;
+using Tango.Integration.Observables.Enumerations;
using Tango.Integration.Operators;
using Tango.MachineStudio.Common.Notifications;
using Tango.MachineStudio.Common.StudioApplication;
@@ -211,13 +212,15 @@ namespace Tango.MachineStudio.Technician.ViewModels
}
}
}
- else if (item.GetType() == typeof(IOItem))
+ else if (item.GetType() == typeof(DigitalOutItem))
{
- IOItem ioItem = item as IOItem;
+ DigitalOutItem digitalOutItem = item as DigitalOutItem;
- if (ioItem.Port < data.GPIO.Count)
+ var digitalPin = data.DigitalPins.SingleOrDefault(x => x.Port == digitalOutItem.TechIo.Port);
+
+ if (digitalPin != null)
{
- ioItem.EffectiveValue = data.GPIO[ioItem.Port];
+ digitalOutItem.EffectiveValue = digitalPin.Value;
}
}
else if (item.GetType() == typeof(MeterItem))
@@ -355,10 +358,10 @@ namespace Tango.MachineStudio.Technician.ViewModels
var editor = CreateElement<DispenserElementEditor, DispenserItem, TechDispenser>(bounds, Adapter.TechDispensers.FirstOrDefault());
InitDispenserItem(editor.DispenserItem);
}
- else if (item is IOItem)
+ else if (item is DigitalOutItem)
{
- var editor = CreateElement<IOElementEditor, IOItem, int>(bounds, 0);
- InitIOItem(editor.IOItem);
+ var editor = CreateElement<DigitalOutElementEditor, DigitalOutItem, TechIo>(bounds, Adapter.TechIos.Where(x => x.Type == IOType.DigitalOutput.ToInt32()).FirstOrDefault());
+ InitDigitalOutItem(editor.DigitalOutItem);
}
else if (item is ThreadMotionItem)
{
@@ -423,10 +426,10 @@ namespace Tango.MachineStudio.Technician.ViewModels
var editor = CreateElement<DispenserElementEditor>(item);
InitDispenserItem(editor.DispenserItem);
}
- else if (item is IOItem)
+ else if (item is DigitalOutItem)
{
- var editor = CreateElement<IOElementEditor>(item);
- InitIOItem(editor.IOItem);
+ var editor = CreateElement<DigitalOutElementEditor>(item);
+ InitDigitalOutItem(editor.DigitalOutItem);
}
else if (item is ThreadMotionItem)
{
@@ -507,10 +510,10 @@ namespace Tango.MachineStudio.Technician.ViewModels
var dispenser = element.HostedElement as DispenserItem;
InitDispenserItem(dispenser);
}
- else if (element is IOElementEditor)
+ else if (element is DigitalOutItem)
{
- var ioItem = element.HostedElement as IOItem;
- InitIOItem(ioItem);
+ var ioItem = element.HostedElement as DigitalOutItem;
+ InitDigitalOutItem(ioItem);
}
else if (element is ThreadMotionItem)
{
@@ -669,13 +672,13 @@ namespace Tango.MachineStudio.Technician.ViewModels
};
}
- private void InitIOItem(IOItem item)
+ private void InitDigitalOutItem(DigitalOutItem item)
{
item.ValueChanged += async (x, value) =>
{
try
{
- await MachineOperator.SetGPIOState(new SetGPIOStateRequest() { Port = item.Port, Value = value });
+ await MachineOperator.SetDigitalOut(new SetDigitalOutRequest() { Port = item.TechIo.Port, Value = value });
}
catch (Exception ex)
{
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Views/MachineTechView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Views/MachineTechView.xaml
index 1658b97d8..784bd56fb 100644
--- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Views/MachineTechView.xaml
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Views/MachineTechView.xaml
@@ -361,8 +361,8 @@
<DataTemplate DataType="{x:Type items:ThreadMotionItem}">
<templates:ThreadMotionTemplate/>
</DataTemplate>
- <DataTemplate DataType="{x:Type items:IOItem}">
- <templates:IOTemplate/>
+ <DataTemplate DataType="{x:Type items:DigitalOutItem}">
+ <templates:DigitalOutTemplate/>
</DataTemplate>
<DataTemplate DataType="{x:Type items:DispenserItem}">
<templates:DispenserTemplate/>
diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/App.xaml.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/App.xaml.cs
index ffc8068a5..c15a87980 100644
--- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/App.xaml.cs
+++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/App.xaml.cs
@@ -25,16 +25,17 @@ namespace Tango.MachineStudio.UI
base.OnStartup(e);
LogManager.Categories.Clear();
- LogManager.Categories.AddRange(SettingsManager.Default.MachineStudio.LoggingCategories);
- if (LogManager.Categories.Count == 0)
+ if (SettingsManager.Default.MachineStudio.LoggingCategories.Count == 0)
{
- LogManager.Categories.Add(LogCategory.Critical);
- LogManager.Categories.Add(LogCategory.Error);
- LogManager.Categories.Add(LogCategory.General);
- LogManager.Categories.Add(LogCategory.Warning);
+ SettingsManager.Default.MachineStudio.LoggingCategories.Add(LogCategory.Critical);
+ SettingsManager.Default.MachineStudio.LoggingCategories.Add(LogCategory.Error);
+ SettingsManager.Default.MachineStudio.LoggingCategories.Add(LogCategory.General);
+ SettingsManager.Default.MachineStudio.LoggingCategories.Add(LogCategory.Warning);
}
+ LogManager.Categories.AddRange(SettingsManager.Default.MachineStudio.LoggingCategories);
+
LogManager.RegisterLogger(new VSOutputLogger());
LogManager.RegisterLogger(new FileLogger());
diff --git a/Software/Visual_Studio/Tango.Core/Helpers/ThreadsHelper.cs b/Software/Visual_Studio/Tango.Core/Helpers/ThreadsHelper.cs
index c18f2cc26..efed8c818 100644
--- a/Software/Visual_Studio/Tango.Core/Helpers/ThreadsHelper.cs
+++ b/Software/Visual_Studio/Tango.Core/Helpers/ThreadsHelper.cs
@@ -16,6 +16,15 @@ namespace Tango.Core.Helpers
public static class ThreadsHelper
{
private static Dispatcher _dispatcher; //Holds the current dispatcher.
+ public static event Action<Dispatcher> DispatcherSet;
+ private static List<Action> _whenAvailableActions;
+ private static bool _whenAvailableActionsInvoked;
+ private static bool _hasDispatcher;
+
+ static ThreadsHelper()
+ {
+ _whenAvailableActions = new List<Action>();
+ }
/// <summary>
/// Sets the current dispatcher.
@@ -24,6 +33,18 @@ namespace Tango.Core.Helpers
public static void SetDisptacher(Dispatcher dispatcher)
{
_dispatcher = dispatcher;
+ DispatcherSet?.Invoke(dispatcher);
+ _hasDispatcher = true;
+
+ if (!_whenAvailableActionsInvoked)
+ {
+ foreach (var action in _whenAvailableActions)
+ {
+ InvokeUI(action);
+ }
+
+ _whenAvailableActionsInvoked = true;
+ }
}
/// <summary>
@@ -61,6 +82,22 @@ namespace Tango.Core.Helpers
}
/// <summary>
+ /// Invokes UI thread after a dispatcher has been set by <see cref="SetDisptacher(Dispatcher)"/>.
+ /// </summary>
+ /// <param name="action">The action.</param>
+ public static void InvokeWhenAvailable(Action action)
+ {
+ if (_hasDispatcher)
+ {
+ InvokeUI(action);
+ }
+ else
+ {
+ _whenAvailableActions.Add(action);
+ }
+ }
+
+ /// <summary>
/// Starts a new STA thread which will be running the specified action.
/// </summary>
/// <param name="action">The action.</param>
diff --git a/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.Context.cs b/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.Context.cs
index 886695580..fbe885fea 100644
--- a/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.Context.cs
+++ b/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.Context.cs
@@ -72,6 +72,7 @@ namespace Tango.DAL.Remote.DB
public virtual DbSet<SEGMENT> SEGMENTS { get; set; }
public virtual DbSet<SYNC_CONFIGURATIONS> SYNC_CONFIGURATIONS { get; set; }
public virtual DbSet<TECH_DISPENSERS> TECH_DISPENSERS { get; set; }
+ public virtual DbSet<TECH_IOS> TECH_IOS { get; set; }
public virtual DbSet<TECH_MONITORS> TECH_MONITORS { get; set; }
public virtual DbSet<TECH_MOTORS> TECH_MOTORS { get; set; }
public virtual DbSet<TECH_VALVES> TECH_VALVES { get; set; }
diff --git a/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.edmx b/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.edmx
index 069333d1d..7ccc175d8 100644
--- a/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.edmx
+++ b/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.edmx
@@ -596,6 +596,21 @@
<Property Name="NAME" Type="varchar" MaxLength="100" Nullable="false" />
<Property Name="DESCRIPTION" Type="varchar" MaxLength="100" Nullable="false" />
</EntityType>
+ <EntityType Name="TECH_IOS">
+ <Key>
+ <PropertyRef Name="ID" />
+ </Key>
+ <Property Name="ID" Type="int" StoreGeneratedPattern="Identity" Nullable="false" />
+ <Property Name="GUID" Type="varchar" MaxLength="36" Nullable="false" />
+ <Property Name="LAST_UPDATED" Type="datetime2" Precision="3" Nullable="false" />
+ <Property Name="CODE" Type="int" Nullable="false" />
+ <Property Name="NAME" Type="varchar" MaxLength="100" Nullable="false" />
+ <Property Name="DESCRIPTION" Type="varchar" MaxLength="100" Nullable="false" />
+ <Property Name="PORT" Type="int" Nullable="false" />
+ <Property Name="TYPE" Type="int" Nullable="false" />
+ <Property Name="MIN" Type="float" Nullable="false" />
+ <Property Name="MAX" Type="float" Nullable="false" />
+ </EntityType>
<EntityType Name="TECH_MONITORS">
<Key>
<PropertyRef Name="ID" />
@@ -623,6 +638,7 @@
<Property Name="CODE" Type="int" Nullable="false" />
<Property Name="NAME" Type="varchar" MaxLength="100" Nullable="false" />
<Property Name="DESCRIPTION" Type="varchar" MaxLength="100" Nullable="false" />
+ <Property Name="SUPPORTS_HOMING" Type="bit" Nullable="false" />
</EntityType>
<EntityType Name="TECH_VALVES">
<Key>
@@ -1395,6 +1411,7 @@
<EntitySet Name="SEGMENTS" EntityType="Self.SEGMENTS" Schema="dbo" store:Type="Tables" />
<EntitySet Name="SYNC_CONFIGURATIONS" EntityType="Self.SYNC_CONFIGURATIONS" Schema="dbo" store:Type="Tables" />
<EntitySet Name="TECH_DISPENSERS" EntityType="Self.TECH_DISPENSERS" Schema="dbo" store:Type="Tables" />
+ <EntitySet Name="TECH_IOS" EntityType="Self.TECH_IOS" Schema="dbo" store:Type="Tables" />
<EntitySet Name="TECH_MONITORS" EntityType="Self.TECH_MONITORS" Schema="dbo" store:Type="Tables" />
<EntitySet Name="TECH_MOTORS" EntityType="Self.TECH_MOTORS" Schema="dbo" store:Type="Tables" />
<EntitySet Name="TECH_VALVES" EntityType="Self.TECH_VALVES" Schema="dbo" store:Type="Tables" />
@@ -1670,6 +1687,7 @@
<EntitySet Name="SEGMENTS" EntityType="RemoteModel.SEGMENT" />
<EntitySet Name="SYNC_CONFIGURATIONS" EntityType="RemoteModel.SYNC_CONFIGURATIONS" />
<EntitySet Name="TECH_DISPENSERS" EntityType="RemoteModel.TECH_DISPENSERS" />
+ <EntitySet Name="TECH_IOS" EntityType="RemoteModel.TECH_IOS" />
<EntitySet Name="TECH_MONITORS" EntityType="RemoteModel.TECH_MONITORS" />
<EntitySet Name="TECH_MOTORS" EntityType="RemoteModel.TECH_MOTORS" />
<EntitySet Name="TECH_VALVES" EntityType="RemoteModel.TECH_VALVES" />
@@ -2584,6 +2602,21 @@
<Property Name="NAME" Type="String" Nullable="false" MaxLength="100" FixedLength="false" Unicode="false" />
<Property Name="DESCRIPTION" Type="String" Nullable="false" MaxLength="100" FixedLength="false" Unicode="false" />
</EntityType>
+ <EntityType Name="TECH_IOS">
+ <Key>
+ <PropertyRef Name="ID" />
+ </Key>
+ <Property Name="ID" Type="Int32" Nullable="false" annotation:StoreGeneratedPattern="Identity" />
+ <Property Name="GUID" Type="String" Nullable="false" MaxLength="36" FixedLength="false" Unicode="false" />
+ <Property Name="LAST_UPDATED" Type="DateTime" Nullable="false" Precision="3" />
+ <Property Name="CODE" Type="Int32" Nullable="false" />
+ <Property Name="NAME" Type="String" Nullable="false" MaxLength="100" FixedLength="false" Unicode="false" />
+ <Property Name="DESCRIPTION" Type="String" Nullable="false" MaxLength="100" FixedLength="false" Unicode="false" />
+ <Property Name="PORT" Type="Int32" Nullable="false" />
+ <Property Name="TYPE" Type="Int32" Nullable="false" />
+ <Property Name="MIN" Type="Double" Nullable="false" />
+ <Property Name="MAX" Type="Double" Nullable="false" />
+ </EntityType>
<EntityType Name="TECH_MONITORS">
<Key>
<PropertyRef Name="ID" />
@@ -2611,6 +2644,7 @@
<Property Name="CODE" Type="Int32" Nullable="false" />
<Property Name="NAME" Type="String" Nullable="false" MaxLength="100" FixedLength="false" Unicode="false" />
<Property Name="DESCRIPTION" Type="String" Nullable="false" MaxLength="100" FixedLength="false" Unicode="false" />
+ <Property Name="SUPPORTS_HOMING" Type="Boolean" Nullable="false" />
</EntityType>
<EntityType Name="TECH_VALVES">
<Key>
@@ -3987,6 +4021,22 @@
</MappingFragment>
</EntityTypeMapping>
</EntitySetMapping>
+ <EntitySetMapping Name="TECH_IOS">
+ <EntityTypeMapping TypeName="RemoteModel.TECH_IOS">
+ <MappingFragment StoreEntitySet="TECH_IOS">
+ <ScalarProperty Name="MAX" ColumnName="MAX" />
+ <ScalarProperty Name="MIN" ColumnName="MIN" />
+ <ScalarProperty Name="TYPE" ColumnName="TYPE" />
+ <ScalarProperty Name="PORT" ColumnName="PORT" />
+ <ScalarProperty Name="DESCRIPTION" ColumnName="DESCRIPTION" />
+ <ScalarProperty Name="NAME" ColumnName="NAME" />
+ <ScalarProperty Name="CODE" ColumnName="CODE" />
+ <ScalarProperty Name="LAST_UPDATED" ColumnName="LAST_UPDATED" />
+ <ScalarProperty Name="GUID" ColumnName="GUID" />
+ <ScalarProperty Name="ID" ColumnName="ID" />
+ </MappingFragment>
+ </EntityTypeMapping>
+ </EntitySetMapping>
<EntitySetMapping Name="TECH_MONITORS">
<EntityTypeMapping TypeName="RemoteModel.TECH_MONITORS">
<MappingFragment StoreEntitySet="TECH_MONITORS">
@@ -4008,6 +4058,7 @@
<EntitySetMapping Name="TECH_MOTORS">
<EntityTypeMapping TypeName="RemoteModel.TECH_MOTORS">
<MappingFragment StoreEntitySet="TECH_MOTORS">
+ <ScalarProperty Name="SUPPORTS_HOMING" ColumnName="SUPPORTS_HOMING" />
<ScalarProperty Name="DESCRIPTION" ColumnName="DESCRIPTION" />
<ScalarProperty Name="NAME" ColumnName="NAME" />
<ScalarProperty Name="CODE" ColumnName="CODE" />
diff --git a/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.edmx.diagram b/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.edmx.diagram
index 17e6744db..8b8441b70 100644
--- a/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.edmx.diagram
+++ b/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.edmx.diagram
@@ -5,59 +5,60 @@
<!-- Diagram content (shape and connector positions) -->
<edmx:Diagrams>
<Diagram DiagramId="f9ae01d708754bbd997add25a4bacc79" Name="Diagram1">
- <EntityTypeShape EntityType="RemoteModel.ACTION_TYPES" Width="1.5" PointX="3" PointY="36.125" />
+ <EntityTypeShape EntityType="RemoteModel.ACTION_TYPES" Width="1.5" PointX="6" PointY="52.125" />
<EntityTypeShape EntityType="RemoteModel.ADDRESS" Width="1.5" PointX="1.5" PointY="74.5" />
- <EntityTypeShape EntityType="RemoteModel.APPLICATION_DISPLAY_PANEL_VERSIONS" Width="1.5" PointX="1.5" PointY="51.5" />
- <EntityTypeShape EntityType="RemoteModel.APPLICATION_FIRMWARE_VERSIONS" Width="1.5" PointX="1.5" PointY="60.25" />
+ <EntityTypeShape EntityType="RemoteModel.APPLICATION_DISPLAY_PANEL_VERSIONS" Width="1.5" PointX="1.5" PointY="60.25" />
+ <EntityTypeShape EntityType="RemoteModel.APPLICATION_FIRMWARE_VERSIONS" Width="1.5" PointX="1.5" PointY="32.625" />
<EntityTypeShape EntityType="RemoteModel.APPLICATION_OS_VERSIONS" Width="1.5" PointX="1.5" PointY="48.5" />
- <EntityTypeShape EntityType="RemoteModel.APPLICATION_VERSIONS" Width="1.5" PointX="1.5" PointY="29.625" />
- <EntityTypeShape EntityType="RemoteModel.BRUSH_STOPS" Width="1.5" PointX="9.75" PointY="17.625" />
- <EntityTypeShape EntityType="RemoteModel.CARTRIDGE_TYPES" Width="1.5" PointX="8" PointY="25.375" />
- <EntityTypeShape EntityType="RemoteModel.CAT" Width="1.5" PointX="8.25" PointY="10.125" />
- <EntityTypeShape EntityType="RemoteModel.CCT" Width="1.5" PointX="5.25" PointY="24.375" />
- <EntityTypeShape EntityType="RemoteModel.COLOR_SPACES" Width="1.5" PointX="7.5" PointY="5.625" />
+ <EntityTypeShape EntityType="RemoteModel.APPLICATION_VERSIONS" Width="1.5" PointX="1.5" PointY="54.375" />
+ <EntityTypeShape EntityType="RemoteModel.BRUSH_STOPS" Width="1.5" PointX="9.75" PointY="5.625" />
+ <EntityTypeShape EntityType="RemoteModel.CARTRIDGE_TYPES" Width="1.5" PointX="6" PointY="44.375" />
+ <EntityTypeShape EntityType="RemoteModel.CAT" Width="1.5" PointX="5.25" PointY="14.125" />
+ <EntityTypeShape EntityType="RemoteModel.CCT" Width="1.5" PointX="5.25" PointY="30.375" />
+ <EntityTypeShape EntityType="RemoteModel.COLOR_SPACES" Width="1.5" PointX="7.5" PointY="3.625" />
<EntityTypeShape EntityType="RemoteModel.CONFIGURATION" Width="1.5" PointX="0.75" PointY="36.875" />
<EntityTypeShape EntityType="RemoteModel.CONTACT" Width="1.5" PointX="1.5" PointY="70.5" />
- <EntityTypeShape EntityType="RemoteModel.DISPENSER_TYPES" Width="1.5" PointX="8" PointY="41.125" />
- <EntityTypeShape EntityType="RemoteModel.EMBEDDED_FIRMWARE_VERSIONS" Width="1.5" PointX="1.5" PointY="32.625" />
- <EntityTypeShape EntityType="RemoteModel.EMBEDDED_SOFTWARE_VERSIONS" Width="1.5" PointX="1.5" PointY="54.375" />
- <EntityTypeShape EntityType="RemoteModel.EVENT_TYPES" Width="1.5" PointX="3" PointY="40.125" />
- <EntityTypeShape EntityType="RemoteModel.EVENT_TYPES_ACTIONS" Width="1.5" PointX="5.25" PointY="37.125" />
- <EntityTypeShape EntityType="RemoteModel.FIBER_SHAPES" Width="1.5" PointX="0.75" PointY="18" />
- <EntityTypeShape EntityType="RemoteModel.FIBER_SYNTHS" Width="1.5" PointX="0.75" PointY="20.875" />
+ <EntityTypeShape EntityType="RemoteModel.DISPENSER_TYPES" Width="1.5" PointX="6" PointY="41.125" />
+ <EntityTypeShape EntityType="RemoteModel.EMBEDDED_FIRMWARE_VERSIONS" Width="1.5" PointX="1.5" PointY="51.5" />
+ <EntityTypeShape EntityType="RemoteModel.EMBEDDED_SOFTWARE_VERSIONS" Width="1.5" PointX="1.5" PointY="29.625" />
+ <EntityTypeShape EntityType="RemoteModel.EVENT_TYPES" Width="1.5" PointX="6" PointY="48.125" />
+ <EntityTypeShape EntityType="RemoteModel.EVENT_TYPES_ACTIONS" Width="1.5" PointX="8.25" PointY="49.125" />
+ <EntityTypeShape EntityType="RemoteModel.FIBER_SHAPES" Width="1.5" PointX="0.75" PointY="10.125" />
+ <EntityTypeShape EntityType="RemoteModel.FIBER_SYNTHS" Width="1.5" PointX="0.75" PointY="26.625" />
<EntityTypeShape EntityType="RemoteModel.HARDWARE_VERSIONS" Width="1.5" PointX="1.5" PointY="57.25" />
- <EntityTypeShape EntityType="RemoteModel.IDS_PACK_FORMULAS" Width="1.5" PointX="8" PointY="34.625" />
- <EntityTypeShape EntityType="RemoteModel.IDS_PACKS" Width="1.5" PointX="10.25" PointY="25.5" />
- <EntityTypeShape EntityType="RemoteModel.JOB_RUNS" Width="1.5" PointX="7.5" PointY="21.875" />
- <EntityTypeShape EntityType="RemoteModel.JOB" Width="1.5" PointX="5.25" PointY="13.25" />
- <EntityTypeShape EntityType="RemoteModel.LINEAR_MASS_DENSITY_UNITS" Width="1.5" PointX="0.75" PointY="26.625" />
- <EntityTypeShape EntityType="RemoteModel.LIQUID_TYPES" Width="1.5" PointX="6" PointY="9" />
+ <EntityTypeShape EntityType="RemoteModel.IDS_PACK_FORMULAS" Width="1.5" PointX="6" PointY="37.75" />
+ <EntityTypeShape EntityType="RemoteModel.IDS_PACKS" Width="1.5" PointX="8.25" PointY="30.5" />
+ <EntityTypeShape EntityType="RemoteModel.JOB_RUNS" Width="1.5" PointX="7.5" PointY="17.875" />
+ <EntityTypeShape EntityType="RemoteModel.JOB" Width="1.5" PointX="5.25" PointY="8.25" />
+ <EntityTypeShape EntityType="RemoteModel.LINEAR_MASS_DENSITY_UNITS" Width="1.5" PointX="0.75" PointY="20.75" />
+ <EntityTypeShape EntityType="RemoteModel.LIQUID_TYPES" Width="1.5" PointX="3" PointY="21" />
<EntityTypeShape EntityType="RemoteModel.LIQUID_TYPES_RMLS" Width="1.5" PointX="8.25" PointY="14.125" />
<EntityTypeShape EntityType="RemoteModel.MACHINE_VERSIONS" Width="1.5" PointX="0.75" PointY="45.125" />
<EntityTypeShape EntityType="RemoteModel.MACHINE" Width="1.5" PointX="3" PointY="43.375" />
- <EntityTypeShape EntityType="RemoteModel.MACHINES_CONFIGURATIONS" Width="1.5" PointX="5.25" PointY="40.875" />
- <EntityTypeShape EntityType="RemoteModel.MACHINES_EVENTS" Width="1.5" PointX="5.25" PointY="44.75" />
- <EntityTypeShape EntityType="RemoteModel.MEDIA_COLORS" Width="1.5" PointX="0.75" PointY="23.875" />
+ <EntityTypeShape EntityType="RemoteModel.MACHINES_CONFIGURATIONS" Width="1.5" PointX="8.25" PointY="40.875" />
+ <EntityTypeShape EntityType="RemoteModel.MACHINES_EVENTS" Width="1.5" PointX="8.25" PointY="44.75" />
+ <EntityTypeShape EntityType="RemoteModel.MEDIA_COLORS" Width="1.5" PointX="0.75" PointY="18" />
<EntityTypeShape EntityType="RemoteModel.MEDIA_CONDITIONS" Width="1.5" PointX="0.75" PointY="7.125" />
<EntityTypeShape EntityType="RemoteModel.MEDIA_MATERIALS" Width="1.5" PointX="0.75" PointY="14.375" />
- <EntityTypeShape EntityType="RemoteModel.MEDIA_PURPOSES" Width="1.5" PointX="0.75" PointY="10.125" />
- <EntityTypeShape EntityType="RemoteModel.MID_TANK_TYPES" Width="1.5" PointX="8" PointY="38" />
+ <EntityTypeShape EntityType="RemoteModel.MEDIA_PURPOSES" Width="1.5" PointX="0.75" PointY="23.625" />
+ <EntityTypeShape EntityType="RemoteModel.MID_TANK_TYPES" Width="1.5" PointX="6" PointY="34.625" />
<EntityTypeShape EntityType="RemoteModel.ORGANIZATION" Width="1.5" PointX="0.75" PointY="65.75" />
<EntityTypeShape EntityType="RemoteModel.PERMISSION" Width="1.5" PointX="3.75" PointY="62.75" />
- <EntityTypeShape EntityType="RemoteModel.PROCESS_PARAMETERS_TABLES" Width="1.5" PointX="7.5" PointY="28.5" />
- <EntityTypeShape EntityType="RemoteModel.PROCESS_PARAMETERS_TABLES_GROUPS" Width="1.5" PointX="5.25" PointY="29.75" />
+ <EntityTypeShape EntityType="RemoteModel.PROCESS_PARAMETERS_TABLES" Width="1.5" PointX="7.5" PointY="24.375" />
+ <EntityTypeShape EntityType="RemoteModel.PROCESS_PARAMETERS_TABLES_GROUPS" Width="1.5" PointX="5.25" PointY="25.625" />
<EntityTypeShape EntityType="RemoteModel.RML" Width="1.5" PointX="3" PointY="11.625" />
<EntityTypeShape EntityType="RemoteModel.ROLE" Width="1.5" PointX="3.75" PointY="66.625" />
<EntityTypeShape EntityType="RemoteModel.ROLES_PERMISSIONS" Width="1.5" PointX="6" PointY="66.75" />
- <EntityTypeShape EntityType="RemoteModel.SEGMENT" Width="1.5" PointX="7.5" PointY="18.375" />
+ <EntityTypeShape EntityType="RemoteModel.SEGMENT" Width="1.5" PointX="7.5" PointY="7.375" />
<EntityTypeShape EntityType="RemoteModel.SYNC_CONFIGURATIONS" Width="1.5" PointX="0.75" PointY="0.75" />
<EntityTypeShape EntityType="RemoteModel.TECH_DISPENSERS" Width="1.5" PointX="2.75" PointY="0.75" />
- <EntityTypeShape EntityType="RemoteModel.TECH_MONITORS" Width="1.5" PointX="2.75" PointY="3.75" />
- <EntityTypeShape EntityType="RemoteModel.TECH_MOTORS" Width="1.5" PointX="4.75" PointY="0.75" />
- <EntityTypeShape EntityType="RemoteModel.TECH_VALVES" Width="1.5" PointX="4.75" PointY="3.75" />
+ <EntityTypeShape EntityType="RemoteModel.TECH_IOS" Width="1.5" PointX="2.75" PointY="3.75" />
+ <EntityTypeShape EntityType="RemoteModel.TECH_MONITORS" Width="1.5" PointX="4.75" PointY="0.75" />
+ <EntityTypeShape EntityType="RemoteModel.TECH_MOTORS" Width="1.5" PointX="9.75" PointY="0.75" />
+ <EntityTypeShape EntityType="RemoteModel.TECH_VALVES" Width="1.5" PointX="11.75" PointY="0.75" />
<EntityTypeShape EntityType="RemoteModel.USER" Width="1.5" PointX="3.75" PointY="70" />
<EntityTypeShape EntityType="RemoteModel.USERS_ROLES" Width="1.5" PointX="6" PointY="70.625" />
- <EntityTypeShape EntityType="RemoteModel.WINDING_METHODS" Width="1.5" PointX="3" PointY="20.625" />
+ <EntityTypeShape EntityType="RemoteModel.WINDING_METHODS" Width="1.5" PointX="3" PointY="7.625" />
<AssociationConnector Association="RemoteModel.FK_EVENTS_ACTIONS_ACTIONS" />
<AssociationConnector Association="RemoteModel.FK_ORGANIZATIONS_ADDRESSES" />
<AssociationConnector Association="RemoteModel.FK_USERS_ADDRESSES" />
diff --git a/Software/Visual_Studio/Tango.DAL.Remote/DB/TECH_IOS.cs b/Software/Visual_Studio/Tango.DAL.Remote/DB/TECH_IOS.cs
new file mode 100644
index 000000000..7f7fd4045
--- /dev/null
+++ b/Software/Visual_Studio/Tango.DAL.Remote/DB/TECH_IOS.cs
@@ -0,0 +1,28 @@
+//------------------------------------------------------------------------------
+// <auto-generated>
+// This code was generated from a template.
+//
+// Manual changes to this file may cause unexpected behavior in your application.
+// Manual changes to this file will be overwritten if the code is regenerated.
+// </auto-generated>
+//------------------------------------------------------------------------------
+
+namespace Tango.DAL.Remote.DB
+{
+ using System;
+ using System.Collections.Generic;
+
+ public partial class TECH_IOS
+ {
+ public int ID { get; set; }
+ public string GUID { get; set; }
+ public System.DateTime LAST_UPDATED { get; set; }
+ public int CODE { get; set; }
+ public string NAME { get; set; }
+ public string DESCRIPTION { get; set; }
+ public int PORT { get; set; }
+ public int TYPE { get; set; }
+ public double MIN { get; set; }
+ public double MAX { get; set; }
+ }
+}
diff --git a/Software/Visual_Studio/Tango.DAL.Remote/DB/TECH_MOTORS.cs b/Software/Visual_Studio/Tango.DAL.Remote/DB/TECH_MOTORS.cs
index 16495aa16..e4b77478d 100644
--- a/Software/Visual_Studio/Tango.DAL.Remote/DB/TECH_MOTORS.cs
+++ b/Software/Visual_Studio/Tango.DAL.Remote/DB/TECH_MOTORS.cs
@@ -20,5 +20,6 @@ namespace Tango.DAL.Remote.DB
public int CODE { get; set; }
public string NAME { get; set; }
public string DESCRIPTION { get; set; }
+ public bool SUPPORTS_HOMING { get; set; }
}
}
diff --git a/Software/Visual_Studio/Tango.DAL.Remote/Tango.DAL.Remote.csproj b/Software/Visual_Studio/Tango.DAL.Remote/Tango.DAL.Remote.csproj
index 5339cf0c8..3b6e2d0a6 100644
--- a/Software/Visual_Studio/Tango.DAL.Remote/Tango.DAL.Remote.csproj
+++ b/Software/Visual_Studio/Tango.DAL.Remote/Tango.DAL.Remote.csproj
@@ -221,6 +221,9 @@
<Compile Include="DB\TECH_DISPENSERS.cs">
<DependentUpon>RemoteADO.tt</DependentUpon>
</Compile>
+ <Compile Include="DB\TECH_IOS.cs">
+ <DependentUpon>RemoteADO.tt</DependentUpon>
+ </Compile>
<Compile Include="DB\TECH_MONITORS.cs">
<DependentUpon>RemoteADO.tt</DependentUpon>
</Compile>
diff --git a/Software/Visual_Studio/Tango.Editors/EnumExtensions.cs b/Software/Visual_Studio/Tango.Editors/EnumExtensions.cs
index 106dd4f44..95783fef7 100644
--- a/Software/Visual_Studio/Tango.Editors/EnumExtensions.cs
+++ b/Software/Visual_Studio/Tango.Editors/EnumExtensions.cs
@@ -25,9 +25,4 @@ public static class EnumExtensions
else
return value.ToString();
}
-
- public static int ToInt32(this Enum value)
- {
- return (int)((object)value);
- }
}
diff --git a/Software/Visual_Studio/Tango.Emulations/Emulators/MachineEmulator.cs b/Software/Visual_Studio/Tango.Emulations/Emulators/MachineEmulator.cs
index baeb148f0..f998fab2e 100644
--- a/Software/Visual_Studio/Tango.Emulations/Emulators/MachineEmulator.cs
+++ b/Software/Visual_Studio/Tango.Emulations/Emulators/MachineEmulator.cs
@@ -18,6 +18,8 @@ using Tango.PMR.Diagnostics;
using System.Windows.Forms;
using Google.Protobuf.Collections;
using Tango.PMR.Printing;
+using Tango.Integration.Observables;
+using Tango.Integration.Observables.Enumerations;
namespace Tango.Emulations.Emulators
{
@@ -35,7 +37,7 @@ namespace Tango.Emulations.Emulators
private List<int> _dispenserHomingRequestCodes;
private double _graphAmplitude;
private double _graphFrequency;
- private List<bool> _ioStates;
+ private List<DigitalPin> _digitalPinsStates;
#region Constructors
@@ -67,12 +69,15 @@ namespace Tango.Emulations.Emulators
_motorHomingRequestCodes = new List<int>();
_dispenserJoggingRequestCodes = new List<int>();
_dispenserHomingRequestCodes = new List<int>();
- _ioStates = new List<bool>();
+ _digitalPinsStates = new List<DigitalPin>();
- for (int i = 0; i < 120; i++)
+ var adapter = ObservablesEntitiesAdapter.Instance;
+ adapter.Initialize();
+
+ _digitalPinsStates = adapter.TechIos.Where(x => x.Type == IOType.DigitalOutput.ToInt32() || x.Type == IOType.DigitalInput.ToInt32()).Select(x => new DigitalPin()
{
- _ioStates.Add(false);
- }
+ Port = x.Port,
+ }).ToList();
ResetGraphFactors();
}
@@ -135,8 +140,8 @@ namespace Tango.Emulations.Emulators
case MessageType.DispenserAbortHomingRequest:
HandleAbortDispenserHomingRequest(MessageFactory.ParseTangoMessageFromContainer<DispenserAbortHomingRequest>(container));
break;
- case MessageType.SetGpiostateRequest:
- HandleGPIOStateRequest(MessageFactory.ParseTangoMessageFromContainer<SetGPIOStateRequest>(container));
+ case MessageType.SetDigitalOutRequest:
+ HandleSetDigitalOutRequest(MessageFactory.ParseTangoMessageFromContainer<SetDigitalOutRequest>(container));
break;
case MessageType.ThreadJoggingRequest:
HandleThreadJoggingRequest(MessageFactory.ParseTangoMessageFromContainer<ThreadJoggingRequest>(container));
@@ -235,7 +240,7 @@ namespace Tango.Emulations.Emulators
res.Dispenser8MotorFrequency.AddRange(dispenserFrequencies[7].Data);
}
- res.GPIO.AddRange(_ioStates);
+ res.DigitalPins.AddRange(_digitalPinsStates);
Transporter.SendResponse<PushDiagnosticsResponse>(res, request.Container.Token);
Thread.Sleep(10);
@@ -443,11 +448,19 @@ namespace Tango.Emulations.Emulators
Transporter.SendResponse<DispenserAbortHomingResponse>(new DispenserAbortHomingResponse(), request.Container.Token);
}
- private void HandleGPIOStateRequest(TangoMessage<SetGPIOStateRequest> request)
+ private void HandleSetDigitalOutRequest(TangoMessage<SetDigitalOutRequest> request)
{
- LogManager.Log("Abort dispenser homing request received: " + Environment.NewLine + request.Message.ToJsonString());
- _ioStates[request.Message.Port] = request.Message.Value;
- Transporter.SendResponse<SetGPIOStateResponse>(new SetGPIOStateResponse(), request.Container.Token);
+ LogManager.Log("Set digital output pin request received: " + Environment.NewLine + request.Message.ToJsonString());
+ var pinState = _digitalPinsStates.SingleOrDefault(x => x.Port == request.Message.Port);
+ if (pinState != null)
+ {
+ pinState.Value = request.Message.Value;
+ Transporter.SendResponse<SetDigitalOutResponse>(new SetDigitalOutResponse(), request.Container.Token);
+ }
+ else
+ {
+ Transporter.SendResponse<SetDigitalOutResponse>(new SetDigitalOutResponse(), request.Container.Token, null, ErrorCode.InvalidDigitalPinNumber);
+ }
}
private void HandleThreadJoggingRequest(TangoMessage<ThreadJoggingRequest> request)
diff --git a/Software/Visual_Studio/Tango.Emulations/Tango.Emulations.csproj b/Software/Visual_Studio/Tango.Emulations/Tango.Emulations.csproj
index d76a547d0..5a2830b50 100644
--- a/Software/Visual_Studio/Tango.Emulations/Tango.Emulations.csproj
+++ b/Software/Visual_Studio/Tango.Emulations/Tango.Emulations.csproj
@@ -60,6 +60,10 @@
<Project>{a34ee0f0-649d-41c8-8489-b6f1cc6924ee}</Project>
<Name>Tango.Core</Name>
</ProjectReference>
+ <ProjectReference Include="..\Tango.Integration\Tango.Integration.csproj">
+ <Project>{4206ac58-3b57-4699-8835-90bf6db01a61}</Project>
+ <Name>Tango.Integration</Name>
+ </ProjectReference>
<ProjectReference Include="..\Tango.Logging\Tango.Logging.csproj">
<Project>{bc932dbd-7cdb-488c-99e4-f02cf441f55e}</Project>
<Name>Tango.Logging</Name>
diff --git a/Software/Visual_Studio/Tango.Integration/Observables/Entities/TechIo.cs b/Software/Visual_Studio/Tango.Integration/Observables/Entities/TechIo.cs
new file mode 100644
index 000000000..90ac0de7c
--- /dev/null
+++ b/Software/Visual_Studio/Tango.Integration/Observables/Entities/TechIo.cs
@@ -0,0 +1,162 @@
+using System;
+using System.Collections.Generic;
+using System.Collections.ObjectModel;
+using System.ComponentModel.DataAnnotations;
+using System.ComponentModel.DataAnnotations.Schema;
+using System.Linq;
+using Tango.DAL.Remote.DB;
+
+namespace Tango.Integration.Observables
+{
+ [Table("TECH_IOS")]
+ public partial class TechIo : ObservableEntity<TechIo>
+ {
+
+ protected Int32 _code;
+ /// <summary>
+ /// Gets or sets the techio code.
+ /// </summary>
+ [Column("CODE")]
+
+ public Int32 Code
+ {
+ get
+ {
+ return _code;
+ }
+
+ set
+ {
+ _code = value; RaisePropertyChanged(nameof(Code));
+ }
+
+ }
+
+ protected String _name;
+ /// <summary>
+ /// Gets or sets the techio name.
+ /// </summary>
+ [Column("NAME")]
+
+ public String Name
+ {
+ get
+ {
+ return _name;
+ }
+
+ set
+ {
+ _name = value; RaisePropertyChanged(nameof(Name));
+ }
+
+ }
+
+ protected String _description;
+ /// <summary>
+ /// Gets or sets the techio description.
+ /// </summary>
+ [Column("DESCRIPTION")]
+
+ public String Description
+ {
+ get
+ {
+ return _description;
+ }
+
+ set
+ {
+ _description = value; RaisePropertyChanged(nameof(Description));
+ }
+
+ }
+
+ protected Int32 _port;
+ /// <summary>
+ /// Gets or sets the techio port.
+ /// </summary>
+ [Column("PORT")]
+
+ public Int32 Port
+ {
+ get
+ {
+ return _port;
+ }
+
+ set
+ {
+ _port = value; RaisePropertyChanged(nameof(Port));
+ }
+
+ }
+
+ protected Int32 _type;
+ /// <summary>
+ /// Gets or sets the techio type.
+ /// </summary>
+ [Column("TYPE")]
+
+ public Int32 Type
+ {
+ get
+ {
+ return _type;
+ }
+
+ set
+ {
+ _type = value; RaisePropertyChanged(nameof(Type));
+ }
+
+ }
+
+ protected Double _min;
+ /// <summary>
+ /// Gets or sets the techio min.
+ /// </summary>
+ [Column("MIN")]
+
+ public Double Min
+ {
+ get
+ {
+ return _min;
+ }
+
+ set
+ {
+ _min = value; RaisePropertyChanged(nameof(Min));
+ }
+
+ }
+
+ protected Double _max;
+ /// <summary>
+ /// Gets or sets the techio max.
+ /// </summary>
+ [Column("MAX")]
+
+ public Double Max
+ {
+ get
+ {
+ return _max;
+ }
+
+ set
+ {
+ _max = value; RaisePropertyChanged(nameof(Max));
+ }
+
+ }
+
+ /// <summary>
+ /// Initializes a new instance of the <see cref="TechIo" /> class.
+ /// </summary>
+ public TechIo() : base()
+ {
+ }
+ }
+}
diff --git a/Software/Visual_Studio/Tango.Integration/Observables/Entities/TechMotor.cs b/Software/Visual_Studio/Tango.Integration/Observables/Entities/TechMotor.cs
index 8fb082850..fd872f636 100644
--- a/Software/Visual_Studio/Tango.Integration/Observables/Entities/TechMotor.cs
+++ b/Software/Visual_Studio/Tango.Integration/Observables/Entities/TechMotor.cs
@@ -72,6 +72,26 @@ namespace Tango.Integration.Observables
}
+ protected Boolean _supportshoming;
+ /// <summary>
+ /// Gets or sets the techmotor supports homing.
+ /// </summary>
+ [Column("SUPPORTS_HOMING")]
+
+ public Boolean SupportsHoming
+ {
+ get
+ {
+ return _supportshoming;
+ }
+
+ set
+ {
+ _supportshoming = value; RaisePropertyChanged(nameof(SupportsHoming));
+ }
+
+ }
+
/// <summary>
/// Initializes a new instance of the <see cref="TechMotor" /> class.
/// </summary>
diff --git a/Software/Visual_Studio/Tango.Integration/Observables/Enumerations/IOType.cs b/Software/Visual_Studio/Tango.Integration/Observables/Enumerations/IOType.cs
new file mode 100644
index 000000000..c13f4cca8
--- /dev/null
+++ b/Software/Visual_Studio/Tango.Integration/Observables/Enumerations/IOType.cs
@@ -0,0 +1,17 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Tango.Integration.Observables.Enumerations
+{
+ public enum IOType
+ {
+ DigitalOutput,
+ DigitalInput,
+ AnalogOut,
+ AnalogInput,
+ PWM,
+ }
+}
diff --git a/Software/Visual_Studio/Tango.Integration/Observables/Enumerations/TechDispensers.cs b/Software/Visual_Studio/Tango.Integration/Observables/Enumerations/TechDispensers.cs
index 677a546d2..e14fbb397 100644
--- a/Software/Visual_Studio/Tango.Integration/Observables/Enumerations/TechDispensers.cs
+++ b/Software/Visual_Studio/Tango.Integration/Observables/Enumerations/TechDispensers.cs
@@ -8,5 +8,18 @@ namespace Tango.Integration.Observables
{
public enum TechDispensers
{
+
+ /// <summary>
+ /// (Dispenser 1)
+ /// </summary>
+ [Description("Dispenser 1")]
+ Dispenser1 = 0,
+
+ /// <summary>
+ /// (Dispenser 2)
+ /// </summary>
+ [Description("Dispenser 2")]
+ Dispenser2 = 1,
+
}
}
diff --git a/Software/Visual_Studio/Tango.Integration/Observables/Enumerations/TechIos.cs b/Software/Visual_Studio/Tango.Integration/Observables/Enumerations/TechIos.cs
new file mode 100644
index 000000000..301448c28
--- /dev/null
+++ b/Software/Visual_Studio/Tango.Integration/Observables/Enumerations/TechIos.cs
@@ -0,0 +1,25 @@
+using System;
+using System.Collections.Generic;
+using System.Collections.ObjectModel;
+using System.Linq;
+using System.ComponentModel;
+
+namespace Tango.Integration.Observables
+{
+ public enum TechIos
+ {
+
+ /// <summary>
+ /// (Digital Out 1)
+ /// </summary>
+ [Description("Digital Out 1")]
+ PIN0 = 0,
+
+ /// <summary>
+ /// (Digital Out 2)
+ /// </summary>
+ [Description("Digital Out 2")]
+ PIN1 = 1,
+
+ }
+}
diff --git a/Software/Visual_Studio/Tango.Integration/Observables/Enumerations/TechMonitors.cs b/Software/Visual_Studio/Tango.Integration/Observables/Enumerations/TechMonitors.cs
index 1f8817f44..8e3e20f7d 100644
--- a/Software/Visual_Studio/Tango.Integration/Observables/Enumerations/TechMonitors.cs
+++ b/Software/Visual_Studio/Tango.Integration/Observables/Enumerations/TechMonitors.cs
@@ -177,5 +177,53 @@ namespace Tango.Integration.Observables
[Description("Chiller Temperature")]
ChillerTemperature = 27,
+ /// <summary>
+ /// (Dispenser 1 Motor Frequency)
+ /// </summary>
+ [Description("Dispenser 1 Motor Frequency")]
+ Dispenser1MotorFrequency = 28,
+
+ /// <summary>
+ /// (Dispenser 2 Motor Frequency)
+ /// </summary>
+ [Description("Dispenser 2 Motor Frequency")]
+ Dispenser2MotorFrequency = 29,
+
+ /// <summary>
+ /// (Dispenser 3 Motor Frequency)
+ /// </summary>
+ [Description("Dispenser 3 Motor Frequency")]
+ Dispenser3MotorFrequency = 30,
+
+ /// <summary>
+ /// (Dispenser 4 Motor Frequency)
+ /// </summary>
+ [Description("Dispenser 4 Motor Frequency")]
+ Dispenser4MotorFrequency = 31,
+
+ /// <summary>
+ /// (Dispenser 5 Motor Frequency)
+ /// </summary>
+ [Description("Dispenser 5 Motor Frequency")]
+ Dispenser5MotorFrequency = 32,
+
+ /// <summary>
+ /// (Dispenser 6 Motor Frequency)
+ /// </summary>
+ [Description("Dispenser 6 Motor Frequency")]
+ Dispenser6MotorFrequency = 33,
+
+ /// <summary>
+ /// (Dispenser 7 Motor Frequency)
+ /// </summary>
+ [Description("Dispenser 7 Motor Frequency")]
+ Dispenser7MotorFrequency = 34,
+
+ /// <summary>
+ /// (Dispenser 8 Motor Frequency)
+ /// </summary>
+ [Description("Dispenser 8 Motor Frequency")]
+ Dispenser8MotorFrequency = 35,
+
}
}
diff --git a/Software/Visual_Studio/Tango.Integration/Observables/Enumerations/TechMotors.cs b/Software/Visual_Studio/Tango.Integration/Observables/Enumerations/TechMotors.cs
index bef81b052..e99aacc83 100644
--- a/Software/Visual_Studio/Tango.Integration/Observables/Enumerations/TechMotors.cs
+++ b/Software/Visual_Studio/Tango.Integration/Observables/Enumerations/TechMotors.cs
@@ -8,5 +8,24 @@ namespace Tango.Integration.Observables
{
public enum TechMotors
{
+
+ /// <summary>
+ /// (Dispenser 1 Motor)
+ /// </summary>
+ [Description("Dispenser 1 Motor")]
+ Dispenser1Motor = 0,
+
+ /// <summary>
+ /// (Dancer 1 Motor)
+ /// </summary>
+ [Description("Dancer 1 Motor")]
+ Dancer1Motor = 1,
+
+ /// <summary>
+ /// (Dancer 2 Motor)
+ /// </summary>
+ [Description("Dancer 2 Motor")]
+ Dancer2Motor = 2,
+
}
}
diff --git a/Software/Visual_Studio/Tango.Integration/Observables/ObservableEntity.cs b/Software/Visual_Studio/Tango.Integration/Observables/ObservableEntity.cs
index 63f45cd76..1e1874205 100644
--- a/Software/Visual_Studio/Tango.Integration/Observables/ObservableEntity.cs
+++ b/Software/Visual_Studio/Tango.Integration/Observables/ObservableEntity.cs
@@ -95,7 +95,7 @@ namespace Tango.Integration.Observables
if (!DesignMode)
{
- ThreadsHelper.InvokeUI(() =>
+ ThreadsHelper.InvokeWhenAvailable(() =>
{
Parameters = new ReadOnlyObservableCollection<ParameterItem>(this.CreateParametersCollection(ParameterItemMode.Binding));
});
diff --git a/Software/Visual_Studio/Tango.Integration/Observables/ObservablesContext.cs b/Software/Visual_Studio/Tango.Integration/Observables/ObservablesContext.cs
index 39bd02357..a21463c9b 100644
--- a/Software/Visual_Studio/Tango.Integration/Observables/ObservablesContext.cs
+++ b/Software/Visual_Studio/Tango.Integration/Observables/ObservablesContext.cs
@@ -424,6 +424,14 @@ namespace Tango.Integration.Observables
}
/// <summary>
+ /// Gets or sets the TechIos.
+ /// </summary>
+ public DbSet<TechIo> TechIos
+ {
+ get; set;
+ }
+
+ /// <summary>
/// Gets or sets the TechMonitors.
/// </summary>
public DbSet<TechMonitor> TechMonitors
diff --git a/Software/Visual_Studio/Tango.Integration/Observables/ObservablesEntitiesAdapter.cs b/Software/Visual_Studio/Tango.Integration/Observables/ObservablesEntitiesAdapter.cs
index 194ea5669..7151cb188 100644
--- a/Software/Visual_Studio/Tango.Integration/Observables/ObservablesEntitiesAdapter.cs
+++ b/Software/Visual_Studio/Tango.Integration/Observables/ObservablesEntitiesAdapter.cs
@@ -267,6 +267,8 @@ namespace Tango.Integration.Observables
TechValves = Context.TechValves.ToObservableCollection();
+ TechIos = Context.TechIos.ToObservableCollection();
+
IdsPackFormulas = Context.IdsPackFormulas.ToObservableCollection();
ColorSpaces = Context.ColorSpaces.ToObservableCollection();
diff --git a/Software/Visual_Studio/Tango.Integration/Observables/ObservablesEntitiesAdapterExtension.cs b/Software/Visual_Studio/Tango.Integration/Observables/ObservablesEntitiesAdapterExtension.cs
index 65d41e05a..67b2d786e 100644
--- a/Software/Visual_Studio/Tango.Integration/Observables/ObservablesEntitiesAdapterExtension.cs
+++ b/Software/Visual_Studio/Tango.Integration/Observables/ObservablesEntitiesAdapterExtension.cs
@@ -1698,6 +1698,42 @@ namespace Tango.Integration.Observables
}
+ private ObservableCollection<TechIo> _techios;
+ /// <summary>
+ /// Gets or sets the TechIos.
+ /// </summary>
+ public ObservableCollection<TechIo> TechIos
+ {
+ get
+ {
+ return _techios;
+ }
+
+ set
+ {
+ _techios = value; RaisePropertyChanged(nameof(TechIos));
+ }
+
+ }
+
+ private ICollectionView _techiosViewSource;
+ /// <summary>
+ /// Gets or sets the TechIos View Source.
+ ///</summary>
+ public ICollectionView TechIosViewSource
+ {
+ get
+ {
+ return _techiosViewSource;
+ }
+
+ set
+ {
+ _techiosViewSource = value; RaisePropertyChanged(nameof(TechIosViewSource));
+ }
+
+ }
+
private ObservableCollection<TechMonitor> _techmonitors;
/// <summary>
/// Gets or sets the TechMonitors.
@@ -2014,6 +2050,8 @@ namespace Tango.Integration.Observables
TechDispensersViewSource = CreateCollectionView(TechDispensers);
+ TechIosViewSource = CreateCollectionView(TechIos);
+
TechMonitorsViewSource = CreateCollectionView(TechMonitors);
TechMotorsViewSource = CreateCollectionView(TechMotors);
diff --git a/Software/Visual_Studio/Tango.Integration/Operators/IMachineOperator.cs b/Software/Visual_Studio/Tango.Integration/Operators/IMachineOperator.cs
index 078375e4f..e067e7a98 100644
--- a/Software/Visual_Studio/Tango.Integration/Operators/IMachineOperator.cs
+++ b/Software/Visual_Studio/Tango.Integration/Operators/IMachineOperator.cs
@@ -95,11 +95,11 @@ namespace Tango.Integration.Operators
Task<TangoMessage<DispenserAbortHomingResponse>> StopDispenserHoming(DispenserAbortHomingRequest request);
/// <summary>
- /// Turn on/off the specified GPIO port.
+ /// Turn on/off the specified digital output pin.
/// </summary>
/// <param name="request">The request.</param>
/// <returns></returns>
- Task<TangoMessage<SetGPIOStateResponse>> SetGPIOState(SetGPIOStateRequest request);
+ Task<TangoMessage<SetDigitalOutResponse>> SetDigitalOut(SetDigitalOutRequest request);
/// <summary>
/// Starts jogging the thread motion system.
diff --git a/Software/Visual_Studio/Tango.Integration/Operators/MachineOperator.cs b/Software/Visual_Studio/Tango.Integration/Operators/MachineOperator.cs
index b89a8c7ca..4bbd7aa64 100644
--- a/Software/Visual_Studio/Tango.Integration/Operators/MachineOperator.cs
+++ b/Software/Visual_Studio/Tango.Integration/Operators/MachineOperator.cs
@@ -265,13 +265,13 @@ namespace Tango.Integration.Operators
}
/// <summary>
- /// Turn on/off the specified GPIO port.
+ /// Turn on/off the specified digital output pin.
/// </summary>
/// <param name="request">The request.</param>
/// <returns></returns>
- public Task<TangoMessage<SetGPIOStateResponse>> SetGPIOState(SetGPIOStateRequest request)
+ public Task<TangoMessage<SetDigitalOutResponse>> SetDigitalOut(SetDigitalOutRequest request)
{
- return SendRequest<SetGPIOStateRequest, SetGPIOStateResponse>(request);
+ return SendRequest<SetDigitalOutRequest, SetDigitalOutResponse>(request);
}
/// <summary>
diff --git a/Software/Visual_Studio/Tango.Integration/Tango.Integration.csproj b/Software/Visual_Studio/Tango.Integration/Tango.Integration.csproj
index 346d91f12..dd6f8b99e 100644
--- a/Software/Visual_Studio/Tango.Integration/Tango.Integration.csproj
+++ b/Software/Visual_Studio/Tango.Integration/Tango.Integration.csproj
@@ -110,6 +110,7 @@
<Compile Include="Observables\Entities\IdsPack.cs" />
<Compile Include="Observables\Entities\IdsPackFormula.cs" />
<Compile Include="Observables\Entities\TechDispenser.cs" />
+ <Compile Include="Observables\Entities\TechIo.cs" />
<Compile Include="Observables\Entities\TechMonitor.cs" />
<Compile Include="Observables\Entities\Job.cs" />
<Compile Include="Observables\Entities\JobRun.cs" />
@@ -148,6 +149,7 @@
<Compile Include="Observables\Enumerations\FiberShapes.cs" />
<Compile Include="Observables\Enumerations\FiberSynthesises.cs" />
<Compile Include="Observables\Enumerations\IdsPackFormulas.cs" />
+ <Compile Include="Observables\Enumerations\IOType.cs" />
<Compile Include="Observables\Enumerations\LinearMassDensityUnits.cs" />
<Compile Include="Observables\Enumerations\Liquids.cs" />
<Compile Include="Observables\Enumerations\MediaConditions.cs" />
diff --git a/Software/Visual_Studio/Tango.PMR/Common/ErrorCode.cs b/Software/Visual_Studio/Tango.PMR/Common/ErrorCode.cs
index 8c663c246..ec1ed555f 100644
--- a/Software/Visual_Studio/Tango.PMR/Common/ErrorCode.cs
+++ b/Software/Visual_Studio/Tango.PMR/Common/ErrorCode.cs
@@ -22,9 +22,10 @@ namespace Tango.PMR.Common {
static ErrorCodeReflection() {
byte[] descriptorData = global::System.Convert.FromBase64String(
string.Concat(
- "Cg9FcnJvckNvZGUucHJvdG8SEFRhbmdvLlBNUi5Db21tb24qIgoJRXJyb3JD",
- "b2RlEggKBE5PTkUQABILCgdCQURfQ1JDEAFCHAoaY29tLnR3aW5lLnRhbmdv",
- "LnBtci5jb21tb25iBnByb3RvMw=="));
+ "Cg9FcnJvckNvZGUucHJvdG8SEFRhbmdvLlBNUi5Db21tb24qQgoJRXJyb3JD",
+ "b2RlEggKBE5PTkUQABILCgdCQURfQ1JDEAESHgoaSU5WQUxJRF9ESUdJVEFM",
+ "X1BJTl9OVU1CRVIQAkIcChpjb20udHdpbmUudGFuZ28ucG1yLmNvbW1vbmIG",
+ "cHJvdG8z"));
descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
new pbr::FileDescriptor[] { },
new pbr::GeneratedClrTypeInfo(new[] {typeof(global::Tango.PMR.Common.ErrorCode), }, null));
@@ -36,6 +37,10 @@ namespace Tango.PMR.Common {
public enum ErrorCode {
[pbr::OriginalName("NONE")] None = 0,
[pbr::OriginalName("BAD_CRC")] BadCrc = 1,
+ /// <summary>
+ ///Can be returned by SetDigitalOutResponse.
+ /// </summary>
+ [pbr::OriginalName("INVALID_DIGITAL_PIN_NUMBER")] InvalidDigitalPinNumber = 2,
}
#endregion
diff --git a/Software/Visual_Studio/Tango.PMR/Common/MessageType.cs b/Software/Visual_Studio/Tango.PMR/Common/MessageType.cs
index 54b83906e..4811280d1 100644
--- a/Software/Visual_Studio/Tango.PMR/Common/MessageType.cs
+++ b/Software/Visual_Studio/Tango.PMR/Common/MessageType.cs
@@ -22,7 +22,7 @@ namespace Tango.PMR.Common {
static MessageTypeReflection() {
byte[] descriptorData = global::System.Convert.FromBase64String(
string.Concat(
- "ChFNZXNzYWdlVHlwZS5wcm90bxIQVGFuZ28uUE1SLkNvbW1vbiqPEAoLTWVz",
+ "ChFNZXNzYWdlVHlwZS5wcm90bxIQVGFuZ28uUE1SLkNvbW1vbiqREAoLTWVz",
"c2FnZVR5cGUSCAoETm9uZRAAEhQKEENhbGN1bGF0ZVJlcXVlc3QQAxIVChFD",
"YWxjdWxhdGVSZXNwb25zZRAEEhMKD1Byb2dyZXNzUmVxdWVzdBAFEhQKEFBy",
"b2dyZXNzUmVzcG9uc2UQBhIcChhTdHViQ2FydHJpZGdlUmVhZFJlcXVlc3QQ",
@@ -63,13 +63,13 @@ namespace Tango.PMR.Common {
"cG9uc2UQ3Q8SHAoXRGlzcGVuc2VySm9nZ2luZ1JlcXVlc3QQ3g8SHQoYRGlz",
"cGVuc2VySm9nZ2luZ1Jlc3BvbnNlEN8PEiEKHERpc3BlbnNlckFib3J0Sm9n",
"Z2luZ1JlcXVlc3QQ4A8SIgodRGlzcGVuc2VyQWJvcnRKb2dnaW5nUmVzcG9u",
- "c2UQ4Q8SGAoTU2V0R1BJT1N0YXRlUmVxdWVzdBDiDxIZChRTZXRHUElPU3Rh",
- "dGVSZXNwb25zZRDjDxIZChRUaHJlYWRKb2dnaW5nUmVxdWVzdBDkDxIaChVU",
- "aHJlYWRKb2dnaW5nUmVzcG9uc2UQ5Q8SHgoZVGhyZWFkQWJvcnRKb2dnaW5n",
- "UmVxdWVzdBDmDxIfChpUaHJlYWRBYm9ydEpvZ2dpbmdSZXNwb25zZRDnDxIP",
- "CgpKb2JSZXF1ZXN0ELgXEhAKC0pvYlJlc3BvbnNlELkXEhQKD0Fib3J0Sm9i",
- "UmVxdWVzdBC6FxIVChBBYm9ydEpvYlJlc3BvbnNlELsXQhwKGmNvbS50d2lu",
- "ZS50YW5nby5wbXIuY29tbW9uYgZwcm90bzM="));
+ "c2UQ4Q8SGQoUU2V0RGlnaXRhbE91dFJlcXVlc3QQ4g8SGgoVU2V0RGlnaXRh",
+ "bE91dFJlc3BvbnNlEOMPEhkKFFRocmVhZEpvZ2dpbmdSZXF1ZXN0EOQPEhoK",
+ "FVRocmVhZEpvZ2dpbmdSZXNwb25zZRDlDxIeChlUaHJlYWRBYm9ydEpvZ2dp",
+ "bmdSZXF1ZXN0EOYPEh8KGlRocmVhZEFib3J0Sm9nZ2luZ1Jlc3BvbnNlEOcP",
+ "Eg8KCkpvYlJlcXVlc3QQuBcSEAoLSm9iUmVzcG9uc2UQuRcSFAoPQWJvcnRK",
+ "b2JSZXF1ZXN0ELoXEhUKEEFib3J0Sm9iUmVzcG9uc2UQuxdCHAoaY29tLnR3",
+ "aW5lLnRhbmdvLnBtci5jb21tb25iBnByb3RvMw=="));
descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
new pbr::FileDescriptor[] { },
new pbr::GeneratedClrTypeInfo(new[] {typeof(global::Tango.PMR.Common.MessageType), }, null));
@@ -153,8 +153,8 @@ namespace Tango.PMR.Common {
[pbr::OriginalName("DispenserJoggingResponse")] DispenserJoggingResponse = 2015,
[pbr::OriginalName("DispenserAbortJoggingRequest")] DispenserAbortJoggingRequest = 2016,
[pbr::OriginalName("DispenserAbortJoggingResponse")] DispenserAbortJoggingResponse = 2017,
- [pbr::OriginalName("SetGPIOStateRequest")] SetGpiostateRequest = 2018,
- [pbr::OriginalName("SetGPIOStateResponse")] SetGpiostateResponse = 2019,
+ [pbr::OriginalName("SetDigitalOutRequest")] SetDigitalOutRequest = 2018,
+ [pbr::OriginalName("SetDigitalOutResponse")] SetDigitalOutResponse = 2019,
[pbr::OriginalName("ThreadJoggingRequest")] ThreadJoggingRequest = 2020,
[pbr::OriginalName("ThreadJoggingResponse")] ThreadJoggingResponse = 2021,
[pbr::OriginalName("ThreadAbortJoggingRequest")] ThreadAbortJoggingRequest = 2022,
diff --git a/Software/Visual_Studio/Tango.PMR/Diagnostics/SetGPIOStateRequest.cs b/Software/Visual_Studio/Tango.PMR/Diagnostics/DigitalPin.cs
index 9a849a08b..f5bdb949a 100644
--- a/Software/Visual_Studio/Tango.PMR/Diagnostics/SetGPIOStateRequest.cs
+++ b/Software/Visual_Studio/Tango.PMR/Diagnostics/DigitalPin.cs
@@ -1,5 +1,5 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
-// source: SetGPIOStateRequest.proto
+// source: DigitalPin.proto
#pragma warning disable 1591, 0612, 3021
#region Designer generated code
@@ -9,41 +9,40 @@ using pbr = global::Google.Protobuf.Reflection;
using scg = global::System.Collections.Generic;
namespace Tango.PMR.Diagnostics {
- /// <summary>Holder for reflection information generated from SetGPIOStateRequest.proto</summary>
- public static partial class SetGPIOStateRequestReflection {
+ /// <summary>Holder for reflection information generated from DigitalPin.proto</summary>
+ public static partial class DigitalPinReflection {
#region Descriptor
- /// <summary>File descriptor for SetGPIOStateRequest.proto</summary>
+ /// <summary>File descriptor for DigitalPin.proto</summary>
public static pbr::FileDescriptor Descriptor {
get { return descriptor; }
}
private static pbr::FileDescriptor descriptor;
- static SetGPIOStateRequestReflection() {
+ static DigitalPinReflection() {
byte[] descriptorData = global::System.Convert.FromBase64String(
string.Concat(
- "ChlTZXRHUElPU3RhdGVSZXF1ZXN0LnByb3RvEhVUYW5nby5QTVIuRGlhZ25v",
- "c3RpY3MiMgoTU2V0R1BJT1N0YXRlUmVxdWVzdBIMCgRQb3J0GAEgASgFEg0K",
- "BVZhbHVlGAIgASgIQiEKH2NvbS50d2luZS50YW5nby5wbXIuZGlhZ25vc3Rp",
- "Y3NiBnByb3RvMw=="));
+ "ChBEaWdpdGFsUGluLnByb3RvEhVUYW5nby5QTVIuRGlhZ25vc3RpY3MiKQoK",
+ "RGlnaXRhbFBpbhIMCgRQb3J0GAEgASgFEg0KBVZhbHVlGAIgASgIQiEKH2Nv",
+ "bS50d2luZS50YW5nby5wbXIuZGlhZ25vc3RpY3NiBnByb3RvMw=="));
descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
new pbr::FileDescriptor[] { },
new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] {
- new pbr::GeneratedClrTypeInfo(typeof(global::Tango.PMR.Diagnostics.SetGPIOStateRequest), global::Tango.PMR.Diagnostics.SetGPIOStateRequest.Parser, new[]{ "Port", "Value" }, null, null, null)
+ new pbr::GeneratedClrTypeInfo(typeof(global::Tango.PMR.Diagnostics.DigitalPin), global::Tango.PMR.Diagnostics.DigitalPin.Parser, new[]{ "Port", "Value" }, null, null, null)
}));
}
#endregion
}
#region Messages
- public sealed partial class SetGPIOStateRequest : pb::IMessage<SetGPIOStateRequest> {
- private static readonly pb::MessageParser<SetGPIOStateRequest> _parser = new pb::MessageParser<SetGPIOStateRequest>(() => new SetGPIOStateRequest());
+ public sealed partial class DigitalPin : pb::IMessage<DigitalPin> {
+ private static readonly pb::MessageParser<DigitalPin> _parser = new pb::MessageParser<DigitalPin>(() => new DigitalPin());
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
- public static pb::MessageParser<SetGPIOStateRequest> Parser { get { return _parser; } }
+ public static pb::MessageParser<DigitalPin> Parser { get { return _parser; } }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pbr::MessageDescriptor Descriptor {
- get { return global::Tango.PMR.Diagnostics.SetGPIOStateRequestReflection.Descriptor.MessageTypes[0]; }
+ get { return global::Tango.PMR.Diagnostics.DigitalPinReflection.Descriptor.MessageTypes[0]; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -52,21 +51,21 @@ namespace Tango.PMR.Diagnostics {
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
- public SetGPIOStateRequest() {
+ public DigitalPin() {
OnConstruction();
}
partial void OnConstruction();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
- public SetGPIOStateRequest(SetGPIOStateRequest other) : this() {
+ public DigitalPin(DigitalPin other) : this() {
port_ = other.port_;
value_ = other.value_;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
- public SetGPIOStateRequest Clone() {
- return new SetGPIOStateRequest(this);
+ public DigitalPin Clone() {
+ return new DigitalPin(this);
}
/// <summary>Field number for the "Port" field.</summary>
@@ -93,11 +92,11 @@ namespace Tango.PMR.Diagnostics {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override bool Equals(object other) {
- return Equals(other as SetGPIOStateRequest);
+ return Equals(other as DigitalPin);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
- public bool Equals(SetGPIOStateRequest other) {
+ public bool Equals(DigitalPin other) {
if (ReferenceEquals(other, null)) {
return false;
}
@@ -147,7 +146,7 @@ namespace Tango.PMR.Diagnostics {
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
- public void MergeFrom(SetGPIOStateRequest other) {
+ public void MergeFrom(DigitalPin other) {
if (other == null) {
return;
}
diff --git a/Software/Visual_Studio/Tango.PMR/Diagnostics/PushDiagnosticsResponse.cs b/Software/Visual_Studio/Tango.PMR/Diagnostics/PushDiagnosticsResponse.cs
index 864910381..d86dc8882 100644
--- a/Software/Visual_Studio/Tango.PMR/Diagnostics/PushDiagnosticsResponse.cs
+++ b/Software/Visual_Studio/Tango.PMR/Diagnostics/PushDiagnosticsResponse.cs
@@ -23,22 +23,23 @@ namespace Tango.PMR.Diagnostics {
byte[] descriptorData = global::System.Convert.FromBase64String(
string.Concat(
"Ch1QdXNoRGlhZ25vc3RpY3NSZXNwb25zZS5wcm90bxIVVGFuZ28uUE1SLkRp",
- "YWdub3N0aWNzGhFEb3VibGVBcnJheS5wcm90byLAAwoXUHVzaERpYWdub3N0",
- "aWNzUmVzcG9uc2USFAoMRGFuY2VyMUFuZ2xlGAEgAygBEhQKDERhbmNlcjJB",
- "bmdsZRgCIAMoARIUCgxEYW5jZXIzQW5nbGUYAyADKAESRQoZRGlzcGVuc2Vy",
- "c01vdG9yc0ZyZXF1ZW5jeRgEIAMoCzIiLlRhbmdvLlBNUi5EaWFnbm9zdGlj",
- "cy5Eb3VibGVBcnJheRIgChhEaXNwZW5zZXIxTW90b3JGcmVxdWVuY3kYBSAD",
- "KAESIAoYRGlzcGVuc2VyMk1vdG9yRnJlcXVlbmN5GAYgAygBEiAKGERpc3Bl",
- "bnNlcjNNb3RvckZyZXF1ZW5jeRgHIAMoARIgChhEaXNwZW5zZXI0TW90b3JG",
- "cmVxdWVuY3kYCCADKAESIAoYRGlzcGVuc2VyNU1vdG9yRnJlcXVlbmN5GAkg",
- "AygBEiAKGERpc3BlbnNlcjZNb3RvckZyZXF1ZW5jeRgKIAMoARIgChhEaXNw",
- "ZW5zZXI3TW90b3JGcmVxdWVuY3kYCyADKAESIAoYRGlzcGVuc2VyOE1vdG9y",
- "RnJlcXVlbmN5GAwgAygBEgwKBEdQSU8YDSADKAhCIQofY29tLnR3aW5lLnRh",
- "bmdvLnBtci5kaWFnbm9zdGljc2IGcHJvdG8z"));
+ "YWdub3N0aWNzGhFEb3VibGVBcnJheS5wcm90bxoQRGlnaXRhbFBpbi5wcm90",
+ "byLqAwoXUHVzaERpYWdub3N0aWNzUmVzcG9uc2USFAoMRGFuY2VyMUFuZ2xl",
+ "GAEgAygBEhQKDERhbmNlcjJBbmdsZRgCIAMoARIUCgxEYW5jZXIzQW5nbGUY",
+ "AyADKAESRQoZRGlzcGVuc2Vyc01vdG9yc0ZyZXF1ZW5jeRgEIAMoCzIiLlRh",
+ "bmdvLlBNUi5EaWFnbm9zdGljcy5Eb3VibGVBcnJheRIgChhEaXNwZW5zZXIx",
+ "TW90b3JGcmVxdWVuY3kYBSADKAESIAoYRGlzcGVuc2VyMk1vdG9yRnJlcXVl",
+ "bmN5GAYgAygBEiAKGERpc3BlbnNlcjNNb3RvckZyZXF1ZW5jeRgHIAMoARIg",
+ "ChhEaXNwZW5zZXI0TW90b3JGcmVxdWVuY3kYCCADKAESIAoYRGlzcGVuc2Vy",
+ "NU1vdG9yRnJlcXVlbmN5GAkgAygBEiAKGERpc3BlbnNlcjZNb3RvckZyZXF1",
+ "ZW5jeRgKIAMoARIgChhEaXNwZW5zZXI3TW90b3JGcmVxdWVuY3kYCyADKAES",
+ "IAoYRGlzcGVuc2VyOE1vdG9yRnJlcXVlbmN5GAwgAygBEjYKC0RpZ2l0YWxQ",
+ "aW5zGA0gAygLMiEuVGFuZ28uUE1SLkRpYWdub3N0aWNzLkRpZ2l0YWxQaW5C",
+ "IQofY29tLnR3aW5lLnRhbmdvLnBtci5kaWFnbm9zdGljc2IGcHJvdG8z"));
descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
- new pbr::FileDescriptor[] { global::Tango.PMR.Diagnostics.DoubleArrayReflection.Descriptor, },
+ new pbr::FileDescriptor[] { global::Tango.PMR.Diagnostics.DoubleArrayReflection.Descriptor, global::Tango.PMR.Diagnostics.DigitalPinReflection.Descriptor, },
new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] {
- new pbr::GeneratedClrTypeInfo(typeof(global::Tango.PMR.Diagnostics.PushDiagnosticsResponse), global::Tango.PMR.Diagnostics.PushDiagnosticsResponse.Parser, new[]{ "Dancer1Angle", "Dancer2Angle", "Dancer3Angle", "DispensersMotorsFrequency", "Dispenser1MotorFrequency", "Dispenser2MotorFrequency", "Dispenser3MotorFrequency", "Dispenser4MotorFrequency", "Dispenser5MotorFrequency", "Dispenser6MotorFrequency", "Dispenser7MotorFrequency", "Dispenser8MotorFrequency", "GPIO" }, null, null, null)
+ new pbr::GeneratedClrTypeInfo(typeof(global::Tango.PMR.Diagnostics.PushDiagnosticsResponse), global::Tango.PMR.Diagnostics.PushDiagnosticsResponse.Parser, new[]{ "Dancer1Angle", "Dancer2Angle", "Dancer3Angle", "DispensersMotorsFrequency", "Dispenser1MotorFrequency", "Dispenser2MotorFrequency", "Dispenser3MotorFrequency", "Dispenser4MotorFrequency", "Dispenser5MotorFrequency", "Dispenser6MotorFrequency", "Dispenser7MotorFrequency", "Dispenser8MotorFrequency", "DigitalPins" }, null, null, null)
}));
}
#endregion
@@ -81,7 +82,7 @@ namespace Tango.PMR.Diagnostics {
dispenser6MotorFrequency_ = other.dispenser6MotorFrequency_.Clone();
dispenser7MotorFrequency_ = other.dispenser7MotorFrequency_.Clone();
dispenser8MotorFrequency_ = other.dispenser8MotorFrequency_.Clone();
- gPIO_ = other.gPIO_.Clone();
+ digitalPins_ = other.digitalPins_.Clone();
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -215,17 +216,17 @@ namespace Tango.PMR.Diagnostics {
get { return dispenser8MotorFrequency_; }
}
- /// <summary>Field number for the "GPIO" field.</summary>
- public const int GPIOFieldNumber = 13;
- private static readonly pb::FieldCodec<bool> _repeated_gPIO_codec
- = pb::FieldCodec.ForBool(106);
- private readonly pbc::RepeatedField<bool> gPIO_ = new pbc::RepeatedField<bool>();
+ /// <summary>Field number for the "DigitalPins" field.</summary>
+ public const int DigitalPinsFieldNumber = 13;
+ private static readonly pb::FieldCodec<global::Tango.PMR.Diagnostics.DigitalPin> _repeated_digitalPins_codec
+ = pb::FieldCodec.ForMessage(106, global::Tango.PMR.Diagnostics.DigitalPin.Parser);
+ private readonly pbc::RepeatedField<global::Tango.PMR.Diagnostics.DigitalPin> digitalPins_ = new pbc::RepeatedField<global::Tango.PMR.Diagnostics.DigitalPin>();
/// <summary>
///GPIO Ports States
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
- public pbc::RepeatedField<bool> GPIO {
- get { return gPIO_; }
+ public pbc::RepeatedField<global::Tango.PMR.Diagnostics.DigitalPin> DigitalPins {
+ get { return digitalPins_; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -253,7 +254,7 @@ namespace Tango.PMR.Diagnostics {
if(!dispenser6MotorFrequency_.Equals(other.dispenser6MotorFrequency_)) return false;
if(!dispenser7MotorFrequency_.Equals(other.dispenser7MotorFrequency_)) return false;
if(!dispenser8MotorFrequency_.Equals(other.dispenser8MotorFrequency_)) return false;
- if(!gPIO_.Equals(other.gPIO_)) return false;
+ if(!digitalPins_.Equals(other.digitalPins_)) return false;
return true;
}
@@ -272,7 +273,7 @@ namespace Tango.PMR.Diagnostics {
hash ^= dispenser6MotorFrequency_.GetHashCode();
hash ^= dispenser7MotorFrequency_.GetHashCode();
hash ^= dispenser8MotorFrequency_.GetHashCode();
- hash ^= gPIO_.GetHashCode();
+ hash ^= digitalPins_.GetHashCode();
return hash;
}
@@ -295,7 +296,7 @@ namespace Tango.PMR.Diagnostics {
dispenser6MotorFrequency_.WriteTo(output, _repeated_dispenser6MotorFrequency_codec);
dispenser7MotorFrequency_.WriteTo(output, _repeated_dispenser7MotorFrequency_codec);
dispenser8MotorFrequency_.WriteTo(output, _repeated_dispenser8MotorFrequency_codec);
- gPIO_.WriteTo(output, _repeated_gPIO_codec);
+ digitalPins_.WriteTo(output, _repeated_digitalPins_codec);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -313,7 +314,7 @@ namespace Tango.PMR.Diagnostics {
size += dispenser6MotorFrequency_.CalculateSize(_repeated_dispenser6MotorFrequency_codec);
size += dispenser7MotorFrequency_.CalculateSize(_repeated_dispenser7MotorFrequency_codec);
size += dispenser8MotorFrequency_.CalculateSize(_repeated_dispenser8MotorFrequency_codec);
- size += gPIO_.CalculateSize(_repeated_gPIO_codec);
+ size += digitalPins_.CalculateSize(_repeated_digitalPins_codec);
return size;
}
@@ -334,7 +335,7 @@ namespace Tango.PMR.Diagnostics {
dispenser6MotorFrequency_.Add(other.dispenser6MotorFrequency_);
dispenser7MotorFrequency_.Add(other.dispenser7MotorFrequency_);
dispenser8MotorFrequency_.Add(other.dispenser8MotorFrequency_);
- gPIO_.Add(other.gPIO_);
+ digitalPins_.Add(other.digitalPins_);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -404,9 +405,8 @@ namespace Tango.PMR.Diagnostics {
dispenser8MotorFrequency_.AddEntriesFrom(input, _repeated_dispenser8MotorFrequency_codec);
break;
}
- case 106:
- case 104: {
- gPIO_.AddEntriesFrom(input, _repeated_gPIO_codec);
+ case 106: {
+ digitalPins_.AddEntriesFrom(input, _repeated_digitalPins_codec);
break;
}
}
diff --git a/Software/Visual_Studio/Tango.PMR/Diagnostics/SetDigitalOutRequest.cs b/Software/Visual_Studio/Tango.PMR/Diagnostics/SetDigitalOutRequest.cs
new file mode 100644
index 000000000..05e9fd067
--- /dev/null
+++ b/Software/Visual_Studio/Tango.PMR/Diagnostics/SetDigitalOutRequest.cs
@@ -0,0 +1,188 @@
+// Generated by the protocol buffer compiler. DO NOT EDIT!
+// source: SetDigitalOutRequest.proto
+#pragma warning disable 1591, 0612, 3021
+#region Designer generated code
+
+using pb = global::Google.Protobuf;
+using pbc = global::Google.Protobuf.Collections;
+using pbr = global::Google.Protobuf.Reflection;
+using scg = global::System.Collections.Generic;
+namespace Tango.PMR.Diagnostics {
+
+ /// <summary>Holder for reflection information generated from SetDigitalOutRequest.proto</summary>
+ public static partial class SetDigitalOutRequestReflection {
+
+ #region Descriptor
+ /// <summary>File descriptor for SetDigitalOutRequest.proto</summary>
+ public static pbr::FileDescriptor Descriptor {
+ get { return descriptor; }
+ }
+ private static pbr::FileDescriptor descriptor;
+
+ static SetDigitalOutRequestReflection() {
+ byte[] descriptorData = global::System.Convert.FromBase64String(
+ string.Concat(
+ "ChpTZXREaWdpdGFsT3V0UmVxdWVzdC5wcm90bxIVVGFuZ28uUE1SLkRpYWdu",
+ "b3N0aWNzIjMKFFNldERpZ2l0YWxPdXRSZXF1ZXN0EgwKBFBvcnQYASABKAUS",
+ "DQoFVmFsdWUYAiABKAhCIQofY29tLnR3aW5lLnRhbmdvLnBtci5kaWFnbm9z",
+ "dGljc2IGcHJvdG8z"));
+ descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
+ new pbr::FileDescriptor[] { },
+ new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] {
+ new pbr::GeneratedClrTypeInfo(typeof(global::Tango.PMR.Diagnostics.SetDigitalOutRequest), global::Tango.PMR.Diagnostics.SetDigitalOutRequest.Parser, new[]{ "Port", "Value" }, null, null, null)
+ }));
+ }
+ #endregion
+
+ }
+ #region Messages
+ public sealed partial class SetDigitalOutRequest : pb::IMessage<SetDigitalOutRequest> {
+ private static readonly pb::MessageParser<SetDigitalOutRequest> _parser = new pb::MessageParser<SetDigitalOutRequest>(() => new SetDigitalOutRequest());
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public static pb::MessageParser<SetDigitalOutRequest> Parser { get { return _parser; } }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public static pbr::MessageDescriptor Descriptor {
+ get { return global::Tango.PMR.Diagnostics.SetDigitalOutRequestReflection.Descriptor.MessageTypes[0]; }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ pbr::MessageDescriptor pb::IMessage.Descriptor {
+ get { return Descriptor; }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public SetDigitalOutRequest() {
+ OnConstruction();
+ }
+
+ partial void OnConstruction();
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public SetDigitalOutRequest(SetDigitalOutRequest other) : this() {
+ port_ = other.port_;
+ value_ = other.value_;
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public SetDigitalOutRequest Clone() {
+ return new SetDigitalOutRequest(this);
+ }
+
+ /// <summary>Field number for the "Port" field.</summary>
+ public const int PortFieldNumber = 1;
+ private int port_;
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public int Port {
+ get { return port_; }
+ set {
+ port_ = value;
+ }
+ }
+
+ /// <summary>Field number for the "Value" field.</summary>
+ public const int ValueFieldNumber = 2;
+ private bool value_;
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public bool Value {
+ get { return value_; }
+ set {
+ value_ = value;
+ }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public override bool Equals(object other) {
+ return Equals(other as SetDigitalOutRequest);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public bool Equals(SetDigitalOutRequest other) {
+ if (ReferenceEquals(other, null)) {
+ return false;
+ }
+ if (ReferenceEquals(other, this)) {
+ return true;
+ }
+ if (Port != other.Port) return false;
+ if (Value != other.Value) return false;
+ return true;
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public override int GetHashCode() {
+ int hash = 1;
+ if (Port != 0) hash ^= Port.GetHashCode();
+ if (Value != false) hash ^= Value.GetHashCode();
+ return hash;
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public override string ToString() {
+ return pb::JsonFormatter.ToDiagnosticString(this);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public void WriteTo(pb::CodedOutputStream output) {
+ if (Port != 0) {
+ output.WriteRawTag(8);
+ output.WriteInt32(Port);
+ }
+ if (Value != false) {
+ output.WriteRawTag(16);
+ output.WriteBool(Value);
+ }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public int CalculateSize() {
+ int size = 0;
+ if (Port != 0) {
+ size += 1 + pb::CodedOutputStream.ComputeInt32Size(Port);
+ }
+ if (Value != false) {
+ size += 1 + 1;
+ }
+ return size;
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public void MergeFrom(SetDigitalOutRequest other) {
+ if (other == null) {
+ return;
+ }
+ if (other.Port != 0) {
+ Port = other.Port;
+ }
+ if (other.Value != false) {
+ Value = other.Value;
+ }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public void MergeFrom(pb::CodedInputStream input) {
+ uint tag;
+ while ((tag = input.ReadTag()) != 0) {
+ switch(tag) {
+ default:
+ input.SkipLastField();
+ break;
+ case 8: {
+ Port = input.ReadInt32();
+ break;
+ }
+ case 16: {
+ Value = input.ReadBool();
+ break;
+ }
+ }
+ }
+ }
+
+ }
+
+ #endregion
+
+}
+
+#endregion Designer generated code
diff --git a/Software/Visual_Studio/Tango.PMR/Diagnostics/SetGPIOStateResponse.cs b/Software/Visual_Studio/Tango.PMR/Diagnostics/SetDigitalOutResponse.cs
index cf8e4f49a..0d8233b94 100644
--- a/Software/Visual_Studio/Tango.PMR/Diagnostics/SetGPIOStateResponse.cs
+++ b/Software/Visual_Studio/Tango.PMR/Diagnostics/SetDigitalOutResponse.cs
@@ -1,5 +1,5 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
-// source: SetGPIOStateResponse.proto
+// source: SetDigitalOutResponse.proto
#pragma warning disable 1591, 0612, 3021
#region Designer generated code
@@ -9,40 +9,40 @@ using pbr = global::Google.Protobuf.Reflection;
using scg = global::System.Collections.Generic;
namespace Tango.PMR.Diagnostics {
- /// <summary>Holder for reflection information generated from SetGPIOStateResponse.proto</summary>
- public static partial class SetGPIOStateResponseReflection {
+ /// <summary>Holder for reflection information generated from SetDigitalOutResponse.proto</summary>
+ public static partial class SetDigitalOutResponseReflection {
#region Descriptor
- /// <summary>File descriptor for SetGPIOStateResponse.proto</summary>
+ /// <summary>File descriptor for SetDigitalOutResponse.proto</summary>
public static pbr::FileDescriptor Descriptor {
get { return descriptor; }
}
private static pbr::FileDescriptor descriptor;
- static SetGPIOStateResponseReflection() {
+ static SetDigitalOutResponseReflection() {
byte[] descriptorData = global::System.Convert.FromBase64String(
string.Concat(
- "ChpTZXRHUElPU3RhdGVSZXNwb25zZS5wcm90bxIVVGFuZ28uUE1SLkRpYWdu",
- "b3N0aWNzIhYKFFNldEdQSU9TdGF0ZVJlc3BvbnNlQiEKH2NvbS50d2luZS50",
- "YW5nby5wbXIuZGlhZ25vc3RpY3NiBnByb3RvMw=="));
+ "ChtTZXREaWdpdGFsT3V0UmVzcG9uc2UucHJvdG8SFVRhbmdvLlBNUi5EaWFn",
+ "bm9zdGljcyIXChVTZXREaWdpdGFsT3V0UmVzcG9uc2VCIQofY29tLnR3aW5l",
+ "LnRhbmdvLnBtci5kaWFnbm9zdGljc2IGcHJvdG8z"));
descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
new pbr::FileDescriptor[] { },
new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] {
- new pbr::GeneratedClrTypeInfo(typeof(global::Tango.PMR.Diagnostics.SetGPIOStateResponse), global::Tango.PMR.Diagnostics.SetGPIOStateResponse.Parser, null, null, null, null)
+ new pbr::GeneratedClrTypeInfo(typeof(global::Tango.PMR.Diagnostics.SetDigitalOutResponse), global::Tango.PMR.Diagnostics.SetDigitalOutResponse.Parser, null, null, null, null)
}));
}
#endregion
}
#region Messages
- public sealed partial class SetGPIOStateResponse : pb::IMessage<SetGPIOStateResponse> {
- private static readonly pb::MessageParser<SetGPIOStateResponse> _parser = new pb::MessageParser<SetGPIOStateResponse>(() => new SetGPIOStateResponse());
+ public sealed partial class SetDigitalOutResponse : pb::IMessage<SetDigitalOutResponse> {
+ private static readonly pb::MessageParser<SetDigitalOutResponse> _parser = new pb::MessageParser<SetDigitalOutResponse>(() => new SetDigitalOutResponse());
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
- public static pb::MessageParser<SetGPIOStateResponse> Parser { get { return _parser; } }
+ public static pb::MessageParser<SetDigitalOutResponse> Parser { get { return _parser; } }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pbr::MessageDescriptor Descriptor {
- get { return global::Tango.PMR.Diagnostics.SetGPIOStateResponseReflection.Descriptor.MessageTypes[0]; }
+ get { return global::Tango.PMR.Diagnostics.SetDigitalOutResponseReflection.Descriptor.MessageTypes[0]; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -51,28 +51,28 @@ namespace Tango.PMR.Diagnostics {
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
- public SetGPIOStateResponse() {
+ public SetDigitalOutResponse() {
OnConstruction();
}
partial void OnConstruction();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
- public SetGPIOStateResponse(SetGPIOStateResponse other) : this() {
+ public SetDigitalOutResponse(SetDigitalOutResponse other) : this() {
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
- public SetGPIOStateResponse Clone() {
- return new SetGPIOStateResponse(this);
+ public SetDigitalOutResponse Clone() {
+ return new SetDigitalOutResponse(this);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override bool Equals(object other) {
- return Equals(other as SetGPIOStateResponse);
+ return Equals(other as SetDigitalOutResponse);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
- public bool Equals(SetGPIOStateResponse other) {
+ public bool Equals(SetDigitalOutResponse other) {
if (ReferenceEquals(other, null)) {
return false;
}
@@ -104,7 +104,7 @@ namespace Tango.PMR.Diagnostics {
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
- public void MergeFrom(SetGPIOStateResponse other) {
+ public void MergeFrom(SetDigitalOutResponse other) {
if (other == null) {
return;
}
diff --git a/Software/Visual_Studio/Tango.PMR/Tango.PMR.csproj b/Software/Visual_Studio/Tango.PMR/Tango.PMR.csproj
index 04e856594..0d4034767 100644
--- a/Software/Visual_Studio/Tango.PMR/Tango.PMR.csproj
+++ b/Software/Visual_Studio/Tango.PMR/Tango.PMR.csproj
@@ -55,6 +55,7 @@
<Compile Include="ColorLab\InputColor.cs" />
<Compile Include="ColorLab\OutputColor.cs" />
<Compile Include="Diagnostics\DataFileFrame.cs" />
+ <Compile Include="Diagnostics\DigitalPin.cs" />
<Compile Include="Diagnostics\DispenserAbortHomingRequest.cs" />
<Compile Include="Diagnostics\DispenserAbortHomingResponse.cs" />
<Compile Include="Diagnostics\DispenserAbortJoggingRequest.cs" />
@@ -75,8 +76,8 @@
<Compile Include="Diagnostics\MotorJoggingResponse.cs" />
<Compile Include="Diagnostics\PushDiagnosticsRequest.cs" />
<Compile Include="Diagnostics\PushDiagnosticsResponse.cs" />
- <Compile Include="Diagnostics\SetGPIOStateRequest.cs" />
- <Compile Include="Diagnostics\SetGPIOStateResponse.cs" />
+ <Compile Include="Diagnostics\SetDigitalOutRequest.cs" />
+ <Compile Include="Diagnostics\SetDigitalOutResponse.cs" />
<Compile Include="Diagnostics\ThreadAbortJoggingRequest.cs" />
<Compile Include="Diagnostics\ThreadAbortJoggingResponse.cs" />
<Compile Include="Diagnostics\ThreadJoggingRequest.cs" />
diff --git a/Software/Visual_Studio/Tango.Transport/ITransporter.cs b/Software/Visual_Studio/Tango.Transport/ITransporter.cs
index f1dd296e8..1861ae6a3 100644
--- a/Software/Visual_Studio/Tango.Transport/ITransporter.cs
+++ b/Software/Visual_Studio/Tango.Transport/ITransporter.cs
@@ -63,7 +63,7 @@ namespace Tango.Transport
/// <param name="response">The response.</param>
/// <param name="token">The token.</param>
/// <returns></returns>
- Task SendResponse<Response>(TangoMessage<Response> response, String token, bool? completed = null) where Response : IMessage<Response>;
+ Task SendResponse<Response>(TangoMessage<Response> response, String token, bool? completed = null, ErrorCode? errorCode = null) where Response : IMessage<Response>;
/// <summary>
/// Occurs when a new request message has been received.
diff --git a/Software/Visual_Studio/Tango.Transport/ResponseErrorException.cs b/Software/Visual_Studio/Tango.Transport/ResponseErrorException.cs
index 365a5d432..747a07b4f 100644
--- a/Software/Visual_Studio/Tango.Transport/ResponseErrorException.cs
+++ b/Software/Visual_Studio/Tango.Transport/ResponseErrorException.cs
@@ -20,11 +20,13 @@ namespace Tango.Transport
/// </summary>
public ErrorCode Error { get; set; }
+ public MessageType MessageType { get; set; }
+
/// <summary>
/// Initializes a new instance of the <see cref="ResponseErrorException{T}"/> class.
/// </summary>
/// <param name="error">The error.</param>
- public ResponseErrorException(ErrorCode error) : base("Response received with error " + error.ToString())
+ public ResponseErrorException(ErrorCode error, MessageType messageType) : base("Response " + messageType.ToString() + " returned with error " + error.ToString())
{
Error = error;
}
diff --git a/Software/Visual_Studio/Tango.Transport/TransporterBase.cs b/Software/Visual_Studio/Tango.Transport/TransporterBase.cs
index 0f4193aab..236cc3976 100644
--- a/Software/Visual_Studio/Tango.Transport/TransporterBase.cs
+++ b/Software/Visual_Studio/Tango.Transport/TransporterBase.cs
@@ -327,7 +327,7 @@ namespace Tango.Transport
/// <param name="response">The response.</param>
/// <param name="token">The token.</param>
/// <returns></returns>
- public Task SendResponse<Response>(TangoMessage<Response> response, String token, bool? completed = null) where Response : IMessage<Response>
+ public Task SendResponse<Response>(TangoMessage<Response> response, String token, bool? completed = null, ErrorCode? errorCode = null) where Response : IMessage<Response>
{
response.Container.Token = token;
@@ -336,6 +336,11 @@ namespace Tango.Transport
response.Container.Completed = completed.Value;
}
+ if (errorCode.HasValue)
+ {
+ response.Container.Error = errorCode.Value;
+ }
+
LogManager.Log("Queuing response message: " + typeof(Response).Name, LogCategory.Debug);
PendingResponse pendingResponse = null;
@@ -492,7 +497,7 @@ namespace Tango.Transport
else
{
LogManager.Log("Response has returned with error: " + container.Error.ToString(), LogCategory.Warning);
- request.SetException(new ResponseErrorException(container.Error));
+ request.SetException(new ResponseErrorException(container.Error, container.Type));
}
}
catch (Exception ex)
@@ -518,7 +523,7 @@ namespace Tango.Transport
else
{
LogManager.Log("Response has returned with error: " + container.Error.ToString(), LogCategory.Warning);
- request.SetException(new ResponseErrorException(container.Error));
+ request.SetException(new ResponseErrorException(container.Error, container.Type));
}
}
catch (Exception ex)
diff --git a/Software/Visual_Studio/Utilities/Tango.DBObservablesGenerator.CLI/ObservablesGenerator.cs b/Software/Visual_Studio/Utilities/Tango.DBObservablesGenerator.CLI/ObservablesGenerator.cs
index 3973e8ad5..130015d42 100644
--- a/Software/Visual_Studio/Utilities/Tango.DBObservablesGenerator.CLI/ObservablesGenerator.cs
+++ b/Software/Visual_Studio/Utilities/Tango.DBObservablesGenerator.CLI/ObservablesGenerator.cs
@@ -29,6 +29,8 @@ namespace Tango.DBObservablesGenerator.CLI
//Generate Entities...
foreach (var table in typeof(RemoteDB).GetProperties().Where(x => typeof(IEnumerable).IsAssignableFrom(x.PropertyType)))
{
+ Console.WriteLine("Generating table '" + table + "'...");
+
EntityCodeFile codeFile = new EntityCodeFile(DalNameToStandardName(table.Name).SingularizeMVC())
{
EntityName = table.Name.SingularizeMVC(),
@@ -105,6 +107,8 @@ namespace Tango.DBObservablesGenerator.CLI
EnumerationFile enumFile = new EnumerationFile();
enumFile.Name = DalNameToStandardName(tableProp.Name);
+ Console.WriteLine("Generating enumeration '" + enumFile.Name + "'...");
+
foreach (var row in tableProp.GetValue(db) as IEnumerable)
{
EnumerationField field = new EnumerationField();
@@ -134,6 +138,9 @@ namespace Tango.DBObservablesGenerator.CLI
//Generate Enumerations...
//Generate Observables Adapter Extensions...
+
+ Console.WriteLine("Generating Observables Adapter...");
+
ObservablesAdapterFile adapterFile = new ObservablesAdapterFile();
adapterFile.Name = "ObservablesEntitiesAdapter";
@@ -151,6 +158,9 @@ namespace Tango.DBObservablesGenerator.CLI
//Generate Observables Adapter Extensions...
//Generate Observables Context
+
+ Console.WriteLine("Generating Observables DB Context...");
+
ObservablesContextCodeFile contextFile = new ObservablesContextCodeFile();
contextFile.Name = "ObservablesContext";
diff --git a/Software/Visual_Studio/Utilities/Tango.MachineEM.UI/App.config b/Software/Visual_Studio/Utilities/Tango.MachineEM.UI/App.config
index 4f1ff76f3..08560e57b 100644
--- a/Software/Visual_Studio/Utilities/Tango.MachineEM.UI/App.config
+++ b/Software/Visual_Studio/Utilities/Tango.MachineEM.UI/App.config
@@ -1,8 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
- <startup>
- <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6" />
- </startup>
+ <configSections>
+ <!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
+ <section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
+ </configSections>
+ <startup>
+ <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6" />
+ </startup>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
@@ -11,4 +15,10 @@
</dependentAssembly>
</assemblyBinding>
</runtime>
-</configuration>
+ <entityFramework>
+ <defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework" />
+ <providers>
+ <provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
+ </providers>
+ </entityFramework>
+</configuration> \ No newline at end of file
diff --git a/Software/Visual_Studio/Utilities/Tango.MachineEM.UI/App.xaml.cs b/Software/Visual_Studio/Utilities/Tango.MachineEM.UI/App.xaml.cs
index 24222d957..f5a43c972 100644
--- a/Software/Visual_Studio/Utilities/Tango.MachineEM.UI/App.xaml.cs
+++ b/Software/Visual_Studio/Utilities/Tango.MachineEM.UI/App.xaml.cs
@@ -5,6 +5,7 @@ using System.Data;
using System.Linq;
using System.Threading.Tasks;
using System.Windows;
+using Tango.Logging;
namespace Tango.MachineEM.UI
{
@@ -13,5 +14,15 @@ namespace Tango.MachineEM.UI
/// </summary>
public partial class App : Application
{
+ protected override void OnStartup(StartupEventArgs e)
+ {
+ base.OnStartup(e);
+
+ LogManager.Categories.Clear();
+ LogManager.Categories.Add(LogCategory.Critical);
+ LogManager.Categories.Add(LogCategory.Error);
+ LogManager.Categories.Add(LogCategory.General);
+ LogManager.Categories.Add(LogCategory.Warning);
+ }
}
}
diff --git a/Software/Visual_Studio/Utilities/Tango.MachineEM.UI/MainWindow.xaml.cs b/Software/Visual_Studio/Utilities/Tango.MachineEM.UI/MainWindow.xaml.cs
index 7baded308..0f03d74a9 100644
--- a/Software/Visual_Studio/Utilities/Tango.MachineEM.UI/MainWindow.xaml.cs
+++ b/Software/Visual_Studio/Utilities/Tango.MachineEM.UI/MainWindow.xaml.cs
@@ -13,6 +13,7 @@ using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
+using Tango.Core.Helpers;
using Tango.Logging;
namespace Tango.MachineEM.UI
@@ -28,6 +29,7 @@ namespace Tango.MachineEM.UI
public MainWindow()
{
InitializeComponent();
+ ThreadsHelper.SetDisptacher(Dispatcher);
}
}
}
diff --git a/Software/Visual_Studio/Utilities/Tango.MachineEM.UI/Tango.MachineEM.UI.csproj b/Software/Visual_Studio/Utilities/Tango.MachineEM.UI/Tango.MachineEM.UI.csproj
index e15e75bc5..ff4ab4a62 100644
--- a/Software/Visual_Studio/Utilities/Tango.MachineEM.UI/Tango.MachineEM.UI.csproj
+++ b/Software/Visual_Studio/Utilities/Tango.MachineEM.UI/Tango.MachineEM.UI.csproj
@@ -37,6 +37,12 @@
<ApplicationIcon>machine.ico</ApplicationIcon>
</PropertyGroup>
<ItemGroup>
+ <Reference Include="EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
+ <HintPath>..\..\packages\EntityFramework.6.0.0\lib\net45\EntityFramework.dll</HintPath>
+ </Reference>
+ <Reference Include="EntityFramework.SqlServer, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
+ <HintPath>..\..\packages\EntityFramework.6.0.0\lib\net45\EntityFramework.SqlServer.dll</HintPath>
+ </Reference>
<Reference Include="FontAwesome.WPF, Version=4.7.0.37774, Culture=neutral, PublicKeyToken=0758b07a11a4f466, processorArchitecture=MSIL">
<HintPath>..\..\packages\FontAwesome.WPF.4.7.0.9\lib\net40\FontAwesome.WPF.dll</HintPath>
</Reference>
@@ -47,6 +53,7 @@
<HintPath>..\..\packages\MahApps.Metro.1.5.0\lib\net45\MahApps.Metro.dll</HintPath>
</Reference>
<Reference Include="System" />
+ <Reference Include="System.ComponentModel.DataAnnotations" />
<Reference Include="System.Data" />
<Reference Include="System.Windows.Interactivity, Version=4.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\..\packages\MahApps.Metro.1.5.0\lib\net45\System.Windows.Interactivity.dll</HintPath>
@@ -130,10 +137,18 @@
<Project>{a34ee0f0-649d-41c8-8489-b6f1cc6924ee}</Project>
<Name>Tango.Core</Name>
</ProjectReference>
+ <ProjectReference Include="..\..\Tango.DAL.Remote\Tango.DAL.Remote.csproj">
+ <Project>{38197109-8610-4d3f-92b9-16d48df94d7c}</Project>
+ <Name>Tango.DAL.Remote</Name>
+ </ProjectReference>
<ProjectReference Include="..\..\Tango.Emulations\Tango.Emulations.csproj">
<Project>{63561e19-ff5a-414b-a5ef-e30711543e1d}</Project>
<Name>Tango.Emulations</Name>
</ProjectReference>
+ <ProjectReference Include="..\..\Tango.Integration\Tango.Integration.csproj">
+ <Project>{4206ac58-3b57-4699-8835-90bf6db01a61}</Project>
+ <Name>Tango.Integration</Name>
+ </ProjectReference>
<ProjectReference Include="..\..\Tango.Logging\Tango.Logging.csproj">
<Project>{bc932dbd-7cdb-488c-99e4-f02cf441f55e}</Project>
<Name>Tango.Logging</Name>
diff --git a/Software/Visual_Studio/Utilities/Tango.MachineEM.UI/packages.config b/Software/Visual_Studio/Utilities/Tango.MachineEM.UI/packages.config
index 9cbe8b937..e1cb3339d 100644
--- a/Software/Visual_Studio/Utilities/Tango.MachineEM.UI/packages.config
+++ b/Software/Visual_Studio/Utilities/Tango.MachineEM.UI/packages.config
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
+ <package id="EntityFramework" version="6.0.0" targetFramework="net46" />
<package id="FontAwesome.WPF" version="4.7.0.9" targetFramework="net45" />
<package id="Google.Protobuf" version="3.4.1" targetFramework="net45" />
<package id="MahApps.Metro" version="1.5.0" targetFramework="net45" />