diff options
| author | Roy Ben-Shabat <Roy@Twine-s.com> | 2018-10-18 13:57:15 +0300 |
|---|---|---|
| committer | Roy Ben-Shabat <Roy@Twine-s.com> | 2018-10-18 13:57:15 +0300 |
| commit | d1dc68496c5e2d103db149bbbe40546acf58bb85 (patch) | |
| tree | 047d651a75a0e61566207279bbe2f5044d022d6d /Software/Visual_Studio | |
| parent | a45a5edec5fbbb6c255a6df421aa7a8ae90a8af0 (diff) | |
| download | Tango-d1dc68496c5e2d103db149bbbe40546acf58bb85.tar.gz Tango-d1dc68496c5e2d103db149bbbe40546acf58bb85.zip | |
Implemented directional homing for motors and dispensers.
Diffstat (limited to 'Software/Visual_Studio')
13 files changed, 191 insertions, 33 deletions
diff --git a/Software/Visual_Studio/Build/Shortcuts/Machine Emulator.lnk b/Software/Visual_Studio/Build/Shortcuts/Machine Emulator.lnk Binary files differindex 8ac0b2b47..e25d54541 100644 --- a/Software/Visual_Studio/Build/Shortcuts/Machine Emulator.lnk +++ b/Software/Visual_Studio/Build/Shortcuts/Machine Emulator.lnk diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/DispenserElementEditor.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/DispenserElementEditor.xaml index 630dddec7..78b7d63c0 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/DispenserElementEditor.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/DispenserElementEditor.xaml @@ -35,7 +35,32 @@ <materialDesign:PackIcon Kind="Home" Margin="25 0" HorizontalAlignment="Center" VerticalAlignment="Center" Width="24" Height="24" Foreground="Gainsboro" /> </Viewbox> - <Button Click="OnHomingStarted" Style="{StaticResource emptyButton}" Cursor="Hand" Background="Transparent" BorderThickness="0"></Button> + <UniformGrid Columns="2"> + <Button Click="OnHomingBackwardStarted" HorizontalAlignment="Left" Width="60" Background="Transparent" BorderThickness="0"> + <Button.Style> + <Style TargetType="Button" BasedOn="{StaticResource emptyButton}"> + <Style.Triggers> + <Trigger Property="IsMouseOver" Value="True"> + <Setter Property="Opacity" Value="0.5"></Setter> + </Trigger> + </Style.Triggers> + </Style> + </Button.Style> + <materialDesign:PackIcon Kind="ChevronDoubleLeft" HorizontalAlignment="Center" VerticalAlignment="Center" Width="40" Height="40" Foreground="Gainsboro" /> + </Button> + <Button Click="OnHomingForwardStarted" HorizontalAlignment="Right" Width="60" Background="Transparent" BorderThickness="0"> + <Button.Style> + <Style TargetType="Button" BasedOn="{StaticResource emptyButton}"> + <Style.Triggers> + <Trigger Property="IsMouseOver" Value="True"> + <Setter Property="Opacity" Value="0.5"></Setter> + </Trigger> + </Style.Triggers> + </Style> + </Button.Style> + <materialDesign:PackIcon Kind="ChevronDoubleRight" HorizontalAlignment="Center" VerticalAlignment="Center" Width="40" Height="40" Foreground="Gainsboro" /> + </Button> + </UniformGrid> </Grid> </UserControl.Resources> @@ -112,7 +137,7 @@ </Grid.ColumnDefinitions> <Grid Grid.Column="1"> - <Border BorderBrush="Gray" BorderThickness="1 0 1 1" CornerRadius="0 0 20 20" Style="{StaticResource TechWidgetBorderCenter}"> + <Border BorderBrush="Gray" BorderThickness="1 0 1 1" CornerRadius="0 0 20 20" Style="{StaticResource TechWidgetBorderCenterNoHover}"> <Grid> <ContentControl> <ContentControl.Style> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/DispenserElementEditor.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/DispenserElementEditor.xaml.cs index f29d0a78d..f0056a740 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/DispenserElementEditor.xaml.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/DispenserElementEditor.xaml.cs @@ -146,7 +146,7 @@ namespace Tango.MachineStudio.Technician.Editors private void OnHomingStarted(object sender, RoutedEventArgs e) { AnimateLeft(); - DispenserItem.RaiseAction(MotorActionType.HomingStarted); + DispenserItem.RaiseAction(MotorActionType.HomingForwardStarted); } private void OnHomingStopped(object sender, RoutedEventArgs e) @@ -182,5 +182,17 @@ namespace Tango.MachineStudio.Technician.Editors propRotate.BeginAnimation(RotateTransform.AngleProperty, null); }); } + + private void OnHomingBackwardStarted(object sender, RoutedEventArgs e) + { + AnimateLeft(); + DispenserItem.RaiseAction(MotorActionType.HomingBackwardStarted); + } + + private void OnHomingForwardStarted(object sender, RoutedEventArgs e) + { + AnimateRight(); + DispenserItem.RaiseAction(MotorActionType.HomingForwardStarted); + } } } 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 25907fd8f..7e50b3349 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 @@ -37,7 +37,32 @@ <materialDesign:PackIcon Kind="Home" Margin="25 0" HorizontalAlignment="Center" VerticalAlignment="Center" Width="24" Height="24" Foreground="Gainsboro" /> </Viewbox> - <Button Click="OnHomingStarted" Style="{StaticResource emptyButton}" Background="Transparent" BorderThickness="0"></Button> + <UniformGrid Columns="2"> + <Button Click="OnHomingBackwardStarted" HorizontalAlignment="Left" Width="60" Background="Transparent" BorderThickness="0"> + <Button.Style> + <Style TargetType="Button" BasedOn="{StaticResource emptyButton}"> + <Style.Triggers> + <Trigger Property="IsMouseOver" Value="True"> + <Setter Property="Opacity" Value="0.5"></Setter> + </Trigger> + </Style.Triggers> + </Style> + </Button.Style> + <materialDesign:PackIcon Kind="ChevronDoubleLeft" HorizontalAlignment="Center" VerticalAlignment="Center" Width="40" Height="40" Foreground="Gainsboro" /> + </Button> + <Button Click="OnHomingForwardStarted" HorizontalAlignment="Right" Width="60" Background="Transparent" BorderThickness="0"> + <Button.Style> + <Style TargetType="Button" BasedOn="{StaticResource emptyButton}"> + <Style.Triggers> + <Trigger Property="IsMouseOver" Value="True"> + <Setter Property="Opacity" Value="0.5"></Setter> + </Trigger> + </Style.Triggers> + </Style> + </Button.Style> + <materialDesign:PackIcon Kind="ChevronDoubleRight" HorizontalAlignment="Center" VerticalAlignment="Center" Width="40" Height="40" Foreground="Gainsboro" /> + </Button> + </UniformGrid> </Grid> </UserControl.Resources> @@ -94,7 +119,7 @@ </Border> </Grid> - <Grid Grid.Column="1" Grid.Row="1" Visibility="{Binding HardwareMotorType.SupportsHoming,Converter={StaticResource BoolToVisibilityConverter}}"> + <Grid Grid.Column="1" Grid.Row="1" Visibility="Visible"> <Grid.ColumnDefinitions> <ColumnDefinition Width="20*"/> <ColumnDefinition Width="115*"/> @@ -102,7 +127,7 @@ </Grid.ColumnDefinitions> <Grid Grid.Column="1"> - <Border BorderBrush="Gray" BorderThickness="1 0 1 1" CornerRadius="0 0 20 20" Style="{StaticResource TechWidgetBorderCenter}"> + <Border BorderBrush="Gray" BorderThickness="1 0 1 1" CornerRadius="0 0 20 20" Style="{StaticResource TechWidgetBorderCenterNoHover}"> <Grid> <ContentControl> <ContentControl.Style> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/MotorElementEditor.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/MotorElementEditor.xaml.cs index 9e76667dd..7a8f8309f 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/MotorElementEditor.xaml.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/MotorElementEditor.xaml.cs @@ -143,12 +143,6 @@ namespace Tango.MachineStudio.Technician.Editors MotorItem.RaiseAction(MotorActionType.BackwardReleased); } - private void OnHomingStarted(object sender, RoutedEventArgs e) - { - AnimateLeft(); - MotorItem.RaiseAction(MotorActionType.HomingStarted); - } - private void OnHomingStopped(object sender, RoutedEventArgs e) { StopAnimation(); @@ -187,5 +181,17 @@ namespace Tango.MachineStudio.Technician.Editors { } + + private void OnHomingBackwardStarted(object sender, RoutedEventArgs e) + { + AnimateLeft(); + MotorItem.RaiseAction(MotorActionType.HomingBackwardStarted); + } + + private void OnHomingForwardStarted(object sender, RoutedEventArgs e) + { + AnimateRight(); + MotorItem.RaiseAction(MotorActionType.HomingForwardStarted); + } } } diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/MotorGroupElementEditor.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/MotorGroupElementEditor.xaml.cs index 5d9954605..3ca4c19e0 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/MotorGroupElementEditor.xaml.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/MotorGroupElementEditor.xaml.cs @@ -146,7 +146,7 @@ namespace Tango.MachineStudio.Technician.Editors private void OnHomingStarted(object sender, RoutedEventArgs e) { - MotorGroupItem.RaiseAction(MotorActionType.HomingStarted); + MotorGroupItem.RaiseAction(MotorActionType.HomingForwardStarted); AnimateLeft(); } diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/ThreadMotionElementEditor.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/ThreadMotionElementEditor.xaml.cs index 6de37f3a2..76ff39d9c 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/ThreadMotionElementEditor.xaml.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/ThreadMotionElementEditor.xaml.cs @@ -133,7 +133,7 @@ namespace Tango.MachineStudio.Technician.Editors private void OnHomingStarted(object sender, RoutedEventArgs e) { - ThreadMotionItem.RaiseAction(MotorActionType.HomingStarted); + ThreadMotionItem.RaiseAction(MotorActionType.HomingForwardStarted); AnimateLeft(); } diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/MotorActionType.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/MotorActionType.cs index 57dabbbb2..e42c87627 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/MotorActionType.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/MotorActionType.cs @@ -15,7 +15,8 @@ namespace Tango.MachineStudio.Technician.TechItems ForwardReleased, BackwardPressed, BackwardReleased, - HomingStarted, + HomingForwardStarted, + HomingBackwardStarted, HomingStopped, } } 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 b0dac90f1..a02e09e9a 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 @@ -1262,7 +1262,7 @@ namespace Tango.MachineStudio.Technician.ViewModels MotorType = (PMR.Hardware.HardwareMotorType)item.HardwareMotorType.Code, }); } - else if (action == MotorActionType.HomingStarted) + else if (action == MotorActionType.HomingForwardStarted || action == MotorActionType.HomingBackwardStarted) { item.HomingProgress = 0; item.IsHoming = true; @@ -1272,6 +1272,7 @@ namespace Tango.MachineStudio.Technician.ViewModels { MotorType = (PMR.Hardware.HardwareMotorType)item.HardwareMotorType.Code, Speed = item.Speed, + Direction = action == MotorActionType.HomingBackwardStarted ? MotorDirection.Backward : MotorDirection.Forward }) .Subscribe((response) => { @@ -1353,7 +1354,7 @@ namespace Tango.MachineStudio.Technician.ViewModels Index = item.TechDispenser.Code, }); } - else if (action == MotorActionType.HomingStarted) + else if (action == MotorActionType.HomingForwardStarted || action == MotorActionType.HomingBackwardStarted) { item.HomingProgress = 0; item.IsHoming = true; @@ -1363,6 +1364,7 @@ namespace Tango.MachineStudio.Technician.ViewModels { Index = item.TechDispenser.Code, Speed = item.Speed, + Direction = action == MotorActionType.HomingBackwardStarted ? MotorDirection.Backward : MotorDirection.Forward }) .Subscribe((response) => { diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Resources/MaterialDesign.xaml b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Resources/MaterialDesign.xaml index 62723755e..2f65fe817 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Resources/MaterialDesign.xaml +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Resources/MaterialDesign.xaml @@ -587,6 +587,17 @@ </EventTrigger> </Style.Triggers> </Style> + + <Style x:Key="TechWidgetBorderCenterNoHover" TargetType="Border"> + <Setter Property="Background"> + <Setter.Value> + <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0"> + <GradientStop Color="#232323" Offset="1" /> + <GradientStop Color="#FF646464" Offset="0"/> + </LinearGradientBrush> + </Setter.Value> + </Setter> + </Style> </ResourceDictionary> </ResourceDictionary.MergedDictionaries> diff --git a/Software/Visual_Studio/Tango.PMR/Common/ErrorCode.cs b/Software/Visual_Studio/Tango.PMR/Common/ErrorCode.cs index 92596a89d..a1a225ab2 100644 --- a/Software/Visual_Studio/Tango.PMR/Common/ErrorCode.cs +++ b/Software/Visual_Studio/Tango.PMR/Common/ErrorCode.cs @@ -22,14 +22,19 @@ namespace Tango.PMR.Common { static ErrorCodeReflection() { byte[] descriptorData = global::System.Convert.FromBase64String( string.Concat( - "Cg9FcnJvckNvZGUucHJvdG8SEFRhbmdvLlBNUi5Db21tb24qiAIKCUVycm9y", + "Cg9FcnJvckNvZGUucHJvdG8SEFRhbmdvLlBNUi5Db21tb24q1AMKCUVycm9y", "Q29kZRIICgROT05FEAASEQoNR0VORVJBTF9FUlJPUhABEgsKB0JBRF9DUkMQ", "AhIeChpJTlZBTElEX0RJR0lUQUxfUElOX05VTUJFUhADEhsKF1VOQVVUSE9S", "SVpFRF9DT05ORUNUSU9OEAQSHwobQ09OVElOVU9VU19SRVNQT05TRV9BQk9S", - "VEVEEAUSDgoKSk9CX0ZBSUxFRBAGEhYKEUlOVkFMSURfVVBMT0FEX0lEEOgH", - "EhMKDkZJTEVfTk9UX0ZPVU5EEOkHEhcKEklOVkFMSURfUFJPQ0VTU19JRBDq", - "BxIdChhGSUxFX0xFTkdUSF9PVVRfT0ZfUkFOR0UQ6wdCHAoaY29tLnR3aW5l", - "LnRhbmdvLnBtci5jb21tb25iBnByb3RvMw==")); + "VEVEEAUSDgoKSk9CX0ZBSUxFRBAGEhUKEUlOVkFMSURfUEFSQU1FVEVSEAcS", + "FgoRSU5WQUxJRF9VUExPQURfSUQQ6AcSEwoORklMRV9OT1RfRk9VTkQQ6QcS", + "FwoSSU5WQUxJRF9QUk9DRVNTX0lEEOoHEh0KGEZJTEVfTEVOR1RIX09VVF9P", + "Rl9SQU5HRRDrBxIaChVKT0JfVU5TUEVDSUZJRURfRVJST1IQ0A8SFQoQSk9C", + "X1RIUkVBRF9CUkVBSxDRDxIbChZKT0JfV0lOREVSX0RBTkNFUl9GQUlMENIP", + "EhsKFkpPQl9QT09MRVJfREFOQ0VSX0ZBSUwQ0w8SGwoWSk9CX0ZFRURFUl9E", + "QU5DRVJfRkFJTBDUDxITCg5KT0JfT1VUX09GX0RZRRDVDxIUCg9KT0JfT1RI", + "RVJfQUxBUk0Q1g9CHAoaY29tLnR3aW5lLnRhbmdvLnBtci5jb21tb25iBnBy", + "b3RvMw==")); descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, new pbr::FileDescriptor[] { }, new pbr::GeneratedClrTypeInfo(new[] {typeof(global::Tango.PMR.Common.ErrorCode), }, null)); @@ -58,6 +63,7 @@ namespace Tango.PMR.Common { /// </summary> [pbr::OriginalName("CONTINUOUS_RESPONSE_ABORTED")] ContinuousResponseAborted = 5, [pbr::OriginalName("JOB_FAILED")] JobFailed = 6, + [pbr::OriginalName("INVALID_PARAMETER")] InvalidParameter = 7, /// <summary> ///IO /// </summary> @@ -74,6 +80,16 @@ namespace Tango.PMR.Common { ///Returned by FileChunkUploadResponse when the uploaded file size exceeds the expected Length from FileUploadRequest. /// </summary> [pbr::OriginalName("FILE_LENGTH_OUT_OF_RANGE")] FileLengthOutOfRange = 1003, + /// <summary> + ///Job Failure + /// </summary> + [pbr::OriginalName("JOB_UNSPECIFIED_ERROR")] JobUnspecifiedError = 2000, + [pbr::OriginalName("JOB_THREAD_BREAK")] JobThreadBreak = 2001, + [pbr::OriginalName("JOB_WINDER_DANCER_FAIL")] JobWinderDancerFail = 2002, + [pbr::OriginalName("JOB_POOLER_DANCER_FAIL")] JobPoolerDancerFail = 2003, + [pbr::OriginalName("JOB_FEEDER_DANCER_FAIL")] JobFeederDancerFail = 2004, + [pbr::OriginalName("JOB_OUT_OF_DYE")] JobOutOfDye = 2005, + [pbr::OriginalName("JOB_OTHER_ALARM")] JobOtherAlarm = 2006, } #endregion diff --git a/Software/Visual_Studio/Tango.PMR/Diagnostics/DispenserHomingRequest.cs b/Software/Visual_Studio/Tango.PMR/Diagnostics/DispenserHomingRequest.cs index a760d7ece..1b1082266 100644 --- a/Software/Visual_Studio/Tango.PMR/Diagnostics/DispenserHomingRequest.cs +++ b/Software/Visual_Studio/Tango.PMR/Diagnostics/DispenserHomingRequest.cs @@ -23,13 +23,15 @@ namespace Tango.PMR.Diagnostics { byte[] descriptorData = global::System.Convert.FromBase64String( string.Concat( "ChxEaXNwZW5zZXJIb21pbmdSZXF1ZXN0LnByb3RvEhVUYW5nby5QTVIuRGlh", - "Z25vc3RpY3MiNgoWRGlzcGVuc2VySG9taW5nUmVxdWVzdBINCgVJbmRleBgB", - "IAEoBRINCgVTcGVlZBgCIAEoAUIhCh9jb20udHdpbmUudGFuZ28ucG1yLmRp", - "YWdub3N0aWNzYgZwcm90bzM=")); + "Z25vc3RpY3MaFE1vdG9yRGlyZWN0aW9uLnByb3RvInAKFkRpc3BlbnNlckhv", + "bWluZ1JlcXVlc3QSDQoFSW5kZXgYASABKAUSDQoFU3BlZWQYAiABKAESOAoJ", + "RGlyZWN0aW9uGAMgASgOMiUuVGFuZ28uUE1SLkRpYWdub3N0aWNzLk1vdG9y", + "RGlyZWN0aW9uQiEKH2NvbS50d2luZS50YW5nby5wbXIuZGlhZ25vc3RpY3Ni", + "BnByb3RvMw==")); descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, - new pbr::FileDescriptor[] { }, + new pbr::FileDescriptor[] { global::Tango.PMR.Diagnostics.MotorDirectionReflection.Descriptor, }, new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] { - new pbr::GeneratedClrTypeInfo(typeof(global::Tango.PMR.Diagnostics.DispenserHomingRequest), global::Tango.PMR.Diagnostics.DispenserHomingRequest.Parser, new[]{ "Index", "Speed" }, null, null, null) + new pbr::GeneratedClrTypeInfo(typeof(global::Tango.PMR.Diagnostics.DispenserHomingRequest), global::Tango.PMR.Diagnostics.DispenserHomingRequest.Parser, new[]{ "Index", "Speed", "Direction" }, null, null, null) })); } #endregion @@ -62,6 +64,7 @@ namespace Tango.PMR.Diagnostics { public DispenserHomingRequest(DispenserHomingRequest other) : this() { index_ = other.index_; speed_ = other.speed_; + direction_ = other.direction_; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -91,6 +94,17 @@ namespace Tango.PMR.Diagnostics { } } + /// <summary>Field number for the "Direction" field.</summary> + public const int DirectionFieldNumber = 3; + private global::Tango.PMR.Diagnostics.MotorDirection direction_ = 0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::Tango.PMR.Diagnostics.MotorDirection Direction { + get { return direction_; } + set { + direction_ = value; + } + } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override bool Equals(object other) { return Equals(other as DispenserHomingRequest); @@ -106,6 +120,7 @@ namespace Tango.PMR.Diagnostics { } if (Index != other.Index) return false; if (Speed != other.Speed) return false; + if (Direction != other.Direction) return false; return true; } @@ -114,6 +129,7 @@ namespace Tango.PMR.Diagnostics { int hash = 1; if (Index != 0) hash ^= Index.GetHashCode(); if (Speed != 0D) hash ^= Speed.GetHashCode(); + if (Direction != 0) hash ^= Direction.GetHashCode(); return hash; } @@ -132,6 +148,10 @@ namespace Tango.PMR.Diagnostics { output.WriteRawTag(17); output.WriteDouble(Speed); } + if (Direction != 0) { + output.WriteRawTag(24); + output.WriteEnum((int) Direction); + } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -143,6 +163,9 @@ namespace Tango.PMR.Diagnostics { if (Speed != 0D) { size += 1 + 8; } + if (Direction != 0) { + size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) Direction); + } return size; } @@ -157,6 +180,9 @@ namespace Tango.PMR.Diagnostics { if (other.Speed != 0D) { Speed = other.Speed; } + if (other.Direction != 0) { + Direction = other.Direction; + } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -175,6 +201,10 @@ namespace Tango.PMR.Diagnostics { Speed = input.ReadDouble(); break; } + case 24: { + direction_ = (global::Tango.PMR.Diagnostics.MotorDirection) input.ReadEnum(); + break; + } } } } diff --git a/Software/Visual_Studio/Tango.PMR/Diagnostics/MotorHomingRequest.cs b/Software/Visual_Studio/Tango.PMR/Diagnostics/MotorHomingRequest.cs index b3bd7765a..35e3562ae 100644 --- a/Software/Visual_Studio/Tango.PMR/Diagnostics/MotorHomingRequest.cs +++ b/Software/Visual_Studio/Tango.PMR/Diagnostics/MotorHomingRequest.cs @@ -23,14 +23,16 @@ namespace Tango.PMR.Diagnostics { byte[] descriptorData = global::System.Convert.FromBase64String( string.Concat( "ChhNb3RvckhvbWluZ1JlcXVlc3QucHJvdG8SFVRhbmdvLlBNUi5EaWFnbm9z", - "dGljcxoXSGFyZHdhcmVNb3RvclR5cGUucHJvdG8iXQoSTW90b3JIb21pbmdS", - "ZXF1ZXN0EjgKCU1vdG9yVHlwZRgBIAEoDjIlLlRhbmdvLlBNUi5IYXJkd2Fy", - "ZS5IYXJkd2FyZU1vdG9yVHlwZRINCgVTcGVlZBgCIAEoAUIhCh9jb20udHdp", - "bmUudGFuZ28ucG1yLmRpYWdub3N0aWNzYgZwcm90bzM=")); + "dGljcxoXSGFyZHdhcmVNb3RvclR5cGUucHJvdG8aFE1vdG9yRGlyZWN0aW9u", + "LnByb3RvIpcBChJNb3RvckhvbWluZ1JlcXVlc3QSOAoJTW90b3JUeXBlGAEg", + "ASgOMiUuVGFuZ28uUE1SLkhhcmR3YXJlLkhhcmR3YXJlTW90b3JUeXBlEg0K", + "BVNwZWVkGAIgASgBEjgKCURpcmVjdGlvbhgDIAEoDjIlLlRhbmdvLlBNUi5E", + "aWFnbm9zdGljcy5Nb3RvckRpcmVjdGlvbkIhCh9jb20udHdpbmUudGFuZ28u", + "cG1yLmRpYWdub3N0aWNzYgZwcm90bzM=")); descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, - new pbr::FileDescriptor[] { global::Tango.PMR.Hardware.HardwareMotorTypeReflection.Descriptor, }, + new pbr::FileDescriptor[] { global::Tango.PMR.Hardware.HardwareMotorTypeReflection.Descriptor, global::Tango.PMR.Diagnostics.MotorDirectionReflection.Descriptor, }, new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] { - new pbr::GeneratedClrTypeInfo(typeof(global::Tango.PMR.Diagnostics.MotorHomingRequest), global::Tango.PMR.Diagnostics.MotorHomingRequest.Parser, new[]{ "MotorType", "Speed" }, null, null, null) + new pbr::GeneratedClrTypeInfo(typeof(global::Tango.PMR.Diagnostics.MotorHomingRequest), global::Tango.PMR.Diagnostics.MotorHomingRequest.Parser, new[]{ "MotorType", "Speed", "Direction" }, null, null, null) })); } #endregion @@ -63,6 +65,7 @@ namespace Tango.PMR.Diagnostics { public MotorHomingRequest(MotorHomingRequest other) : this() { motorType_ = other.motorType_; speed_ = other.speed_; + direction_ = other.direction_; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -92,6 +95,17 @@ namespace Tango.PMR.Diagnostics { } } + /// <summary>Field number for the "Direction" field.</summary> + public const int DirectionFieldNumber = 3; + private global::Tango.PMR.Diagnostics.MotorDirection direction_ = 0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::Tango.PMR.Diagnostics.MotorDirection Direction { + get { return direction_; } + set { + direction_ = value; + } + } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override bool Equals(object other) { return Equals(other as MotorHomingRequest); @@ -107,6 +121,7 @@ namespace Tango.PMR.Diagnostics { } if (MotorType != other.MotorType) return false; if (Speed != other.Speed) return false; + if (Direction != other.Direction) return false; return true; } @@ -115,6 +130,7 @@ namespace Tango.PMR.Diagnostics { int hash = 1; if (MotorType != 0) hash ^= MotorType.GetHashCode(); if (Speed != 0D) hash ^= Speed.GetHashCode(); + if (Direction != 0) hash ^= Direction.GetHashCode(); return hash; } @@ -133,6 +149,10 @@ namespace Tango.PMR.Diagnostics { output.WriteRawTag(17); output.WriteDouble(Speed); } + if (Direction != 0) { + output.WriteRawTag(24); + output.WriteEnum((int) Direction); + } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -144,6 +164,9 @@ namespace Tango.PMR.Diagnostics { if (Speed != 0D) { size += 1 + 8; } + if (Direction != 0) { + size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) Direction); + } return size; } @@ -158,6 +181,9 @@ namespace Tango.PMR.Diagnostics { if (other.Speed != 0D) { Speed = other.Speed; } + if (other.Direction != 0) { + Direction = other.Direction; + } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -176,6 +202,10 @@ namespace Tango.PMR.Diagnostics { Speed = input.ReadDouble(); break; } + case 24: { + direction_ = (global::Tango.PMR.Diagnostics.MotorDirection) input.ReadEnum(); + break; + } } } } |
