diff options
| author | Roy <roy.mail.net@gmail.com> | 2018-02-10 17:27:37 +0200 |
|---|---|---|
| committer | Roy <roy.mail.net@gmail.com> | 2018-02-10 17:27:37 +0200 |
| commit | f8e1ff79cc2fa09b52093c6e029392b3456ad8bb (patch) | |
| tree | fc72fecd6564b49a4b7787c0b4161bcb45edc758 | |
| parent | 07e686eb253ffd29f36dbe530b3a17633e02b353 (diff) | |
| download | Tango-f8e1ff79cc2fa09b52093c6e029392b3456ad8bb.tar.gz Tango-f8e1ff79cc2fa09b52093c6e029392b3456ad8bb.zip | |
Added dispensers support on technician module.
75 files changed, 3603 insertions, 101 deletions
diff --git a/Software/DB/Tango.mdf b/Software/DB/Tango.mdf Binary files differindex 576b52c73..2352d6907 100644 --- a/Software/DB/Tango.mdf +++ b/Software/DB/Tango.mdf diff --git a/Software/DB/Tango_log.ldf b/Software/DB/Tango_log.ldf Binary files differindex ebd2921bf..1a3991eae 100644 --- a/Software/DB/Tango_log.ldf +++ b/Software/DB/Tango_log.ldf diff --git a/Software/Graphics/cogwheel.svg b/Software/Graphics/cogwheel.svg new file mode 100644 index 000000000..c6e68a60d --- /dev/null +++ b/Software/Graphics/cogwheel.svg @@ -0,0 +1,52 @@ +<?xml version="1.0" encoding="iso-8859-1"?> +<!-- Generator: Adobe Illustrator 19.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) --> +<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" + viewBox="0 0 512 512" style="enable-background:new 0 0 512 512;" xml:space="preserve"> +<g> + <g> + <path d="M500.633,211.454l-58.729-14.443c-3.53-11.133-8.071-21.929-13.55-32.256c8.818-14.678,27.349-45.571,27.349-45.571 + c3.545-5.903,2.607-13.462-2.256-18.325l-42.422-42.422c-4.863-4.878-12.407-5.815-18.325-2.256L347.055,83.53 + c-10.269-5.435-21.006-9.932-32.065-13.433l-14.443-58.729C298.876,4.688,292.885,0,286,0h-60 + c-6.885,0-12.891,4.688-14.546,11.367c0,0-10.005,40.99-14.429,58.715c-11.792,3.735-23.188,8.584-34.043,14.502l-47.329-28.403 + c-5.918-3.516-13.447-2.607-18.325,2.256l-42.422,42.422c-4.863,4.863-5.801,12.422-2.256,18.325l29.268,48.882 + c-4.717,9.302-8.672,18.984-11.821,28.901l-58.729,14.487C4.688,213.124,0,219.115,0,226v60c0,6.885,4.688,12.891,11.367,14.546 + l58.744,14.443c3.56,11.294,8.188,22.266,13.799,32.798l-26.191,43.652c-3.545,5.903-2.607,13.462,2.256,18.325l42.422,42.422 + c4.849,4.849,12.407,5.771,18.325,2.256c0,0,29.37-17.607,43.755-26.221c10.415,5.552,21.313,10.137,32.549,13.696l14.429,58.715 + C213.109,507.313,219.115,512,226,512h60c6.885,0,12.876-4.688,14.546-11.367l14.429-58.715 + c11.558-3.662,22.69-8.394,33.281-14.136c14.78,8.862,44.443,26.66,44.443,26.66c5.903,3.53,13.462,2.622,18.325-2.256 + l42.422-42.422c4.863-4.863,5.801-12.422,2.256-18.325l-26.968-44.927c5.317-10.093,9.727-20.654,13.169-31.523l58.729-14.443 + C507.313,298.876,512,292.885,512,286v-60C512,219.115,507.313,213.124,500.633,211.454z M256,361c-57.891,0-105-47.109-105-105 + s47.109-105,105-105s105,47.109,105,105S313.891,361,256,361z"/> + </g> +</g> +<g> +</g> +<g> +</g> +<g> +</g> +<g> +</g> +<g> +</g> +<g> +</g> +<g> +</g> +<g> +</g> +<g> +</g> +<g> +</g> +<g> +</g> +<g> +</g> +<g> +</g> +<g> +</g> +<g> +</g> +</svg> diff --git a/Software/Graphics/cogwheel.xaml b/Software/Graphics/cogwheel.xaml new file mode 100644 index 000000000..140885be7 --- /dev/null +++ b/Software/Graphics/cogwheel.xaml @@ -0,0 +1,36 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!--This file is NOT compatible with Silverlight--> +<Viewbox xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" Stretch="Uniform"> + <Canvas Name="Layer_1" Canvas.Left="0" Canvas.Top="0" Width="512" Height="512"> + <Canvas.RenderTransform> + <TranslateTransform X="0" Y="0"/> + </Canvas.RenderTransform> + <Canvas.Resources/> + <!--Unknown tag: metadata--> + <!--Unknown tag: sodipodi:namedview--> + <Canvas Name="g3"> + <Canvas Name="g5"> + <Path xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Name="path7" Fill="#000000"> + <Path.Data> + <PathGeometry Figures="M500.633 211.454l-58.729-14.443c-3.53-11.133-8.071-21.929-13.55-32.256c8.818-14.678 27.349-45.571 27.349-45.571 c3.545-5.903 2.607-13.462-2.256-18.325l-42.422-42.422c-4.863-4.878-12.407-5.815-18.325-2.256L347.055 83.53 c-10.269-5.435-21.006-9.932-32.065-13.433l-14.443-58.729C298.876 4.688 292.885 0 286 0h-60 c-6.885 0-12.891 4.688-14.546 11.367c0 0-10.005 40.99-14.429 58.715c-11.792 3.735-23.188 8.584-34.043 14.502l-47.329-28.403 c-5.918-3.516-13.447-2.607-18.325 2.256l-42.422 42.422c-4.863 4.863-5.801 12.422-2.256 18.325l29.268 48.882 c-4.717 9.302-8.672 18.984-11.821 28.901l-58.729 14.487C4.688 213.124 0 219.115 0 226v60c0 6.885 4.688 12.891 11.367 14.546 l58.744 14.443c3.56 11.294 8.188 22.266 13.799 32.798l-26.191 43.652c-3.545 5.903-2.607 13.462 2.256 18.325l42.422 42.422 c4.849 4.849 12.407 5.771 18.325 2.256c0 0 29.37-17.607 43.755-26.221c10.415 5.552 21.313 10.137 32.549 13.696l14.429 58.715 C213.109 507.313 219.115 512 226 512h60c6.885 0 12.876-4.688 14.546-11.367l14.429-58.715 c11.558-3.662 22.69-8.394 33.281-14.136c14.78 8.862 44.443 26.66 44.443 26.66c5.903 3.53 13.462 2.622 18.325-2.256 l42.422-42.422c4.863-4.863 5.801-12.422 2.256-18.325l-26.968-44.927c5.317-10.093 9.727-20.654 13.169-31.523l58.729-14.443 C507.313 298.876 512 292.885 512 286v-60C512 219.115 507.313 213.124 500.633 211.454z M256 361c-57.891 0-105-47.109-105-105 s47.109-105 105-105s105 47.109 105 105S313.891 361 256 361z" FillRule="NonZero"/> + </Path.Data> + </Path> + </Canvas> + </Canvas> + <Canvas Name="g9"/> + <Canvas Name="g11"/> + <Canvas Name="g13"/> + <Canvas Name="g15"/> + <Canvas Name="g17"/> + <Canvas Name="g19"/> + <Canvas Name="g21"/> + <Canvas Name="g23"/> + <Canvas Name="g25"/> + <Canvas Name="g27"/> + <Canvas Name="g29"/> + <Canvas Name="g31"/> + <Canvas Name="g33"/> + <Canvas Name="g35"/> + <Canvas Name="g37"/> + </Canvas> +</Viewbox> diff --git a/Software/Graphics/dispenser-big.png b/Software/Graphics/dispenser-big.png Binary files differnew file mode 100644 index 000000000..284b1da0e --- /dev/null +++ b/Software/Graphics/dispenser-big.png diff --git a/Software/Graphics/dispenser-line.png b/Software/Graphics/dispenser-line.png Binary files differnew file mode 100644 index 000000000..9e2e344c0 --- /dev/null +++ b/Software/Graphics/dispenser-line.png diff --git a/Software/Graphics/ico-ac.svg b/Software/Graphics/ico-ac.svg new file mode 100644 index 000000000..c72933a0b --- /dev/null +++ b/Software/Graphics/ico-ac.svg @@ -0,0 +1,16 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- Generator: Adobe Illustrator 18.1.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) --> +<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> +<svg version="1.1" id="Capa_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" + viewBox="143.7 -36 598.6 598.3" enable-background="new 143.7 -36 598.6 598.3" xml:space="preserve"> +<path d="M728.4,312.2l-198.1-63.4c-0.5-5.9-1.6-11.6-3.4-17c8.4-2.8,17-5.9,25.7-9.2c78.8-29.7,124.3-63,135-98.8 + c7.2-23.8-0.5-47.5-22.6-70.3c-17.5-18-56.2-44.9-57.8-46c-6.2-4.3-14.7-2.8-19.1,3.3L465.5,180.8c-3.2-0.4-6.4-0.6-9.6-0.6 + c-2.2,0-4.5,0.1-6.7,0.3c-0.5-62.6-8.3-142.4-41.1-178.6c-12.7-14.1-28.3-21.2-46.1-21.2c0,0,0,0,0,0c-12.3,0-25.6,3.5-39.7,10.4 + c-17.4,8.6-43.8,27.5-55.6,36.2c-3.5,2.6-5.7,4.2-6.1,4.5c-3.7,2.8-5.6,7.2-5.4,11.6c0.1,2.6,1,5.3,2.7,7.5l128.9,175.8 + c-1.4,3.5-2.6,7.1-3.4,10.8c-42.1-13.7-94.9-27.4-138.4-27.4c-34.2,0-59.1,8.6-73.8,25.7c-13,15-17.7,35.8-14,61.7 + c3.6,24.8,19.1,69.3,19.7,71.2c2,5.7,7.3,9.3,13,9.3c1.4,0,2.9-0.2,4.3-0.7L404,308.3c2.3,2.3,4.8,4.4,7.4,6.3 + c-7.3,10-14.8,20.7-22.3,32c-46.3,70.4-63.5,124-51.1,159.3c8.2,23.5,28.3,38.2,59.6,43.6c16.2,2.8,41.8,3.4,60.4,3.4 + c8.1,0,13.5-0.1,13.5-0.1c7.5-0.2,13.5-6.3,13.5-13.9L484,323.8c4.1-1.7,8.1-3.7,11.8-6.1c6.1,8.3,12.6,16.9,19.5,25.6 + c52.2,65.4,97.5,98.6,134.8,98.6c17.6,0,42.4-7.5,61.3-43.3c11.7-22.2,25.4-67.3,25.9-69.2C739.5,322.2,735.5,314.5,728.4,312.2z + M455.9,293c-21.1,0-38.3-17.1-38.3-38.3s17.1-38.3,38.3-38.3c21.1,0,38.3,17.1,38.3,38.3C494.2,275.9,477,293,455.9,293z"/> +</svg> diff --git a/Software/Graphics/miscellaneous.svg b/Software/Graphics/miscellaneous.svg new file mode 100644 index 000000000..e04c7ce3c --- /dev/null +++ b/Software/Graphics/miscellaneous.svg @@ -0,0 +1,78 @@ +<?xml version="1.0" encoding="iso-8859-1"?> +<!-- Generator: Adobe Illustrator 19.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) --> +<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" + viewBox="0 0 320 320" style="enable-background:new 0 0 320 320;" xml:space="preserve"> +<g id="XMLID_1105_"> + <g id="XMLID_1106_"> + <g id="XMLID_1107_"> + <path id="XMLID_1108_" style="fill:#9DD7F5;" d="M141.619,141.619c0,0-55.142-45.952-55.142-91.903 + c0-45.952,73.523-64.333,119.475-36.762c24.65,14.791,27.571,45.952,0,64.333c-20.865,13.91-41.022,34.51-36.761,64.332H141.619z + "/> + </g> + <g id="XMLID_1109_"> + <path id="XMLID_75_" style="fill:#9DD7F5;" d="M141.619,178.381c0,0-45.952,55.142-91.903,55.142 + c-45.952,0-64.332-73.522-36.762-119.475c14.791-24.65,45.952-27.57,64.332,0c13.911,20.865,34.511,41.022,64.333,36.762V178.381 + z"/> + </g> + <g id="XMLID_1110_"> + <path id="XMLID_73_" style="fill:#9DD7F5;" d="M178.381,178.381c0,0,55.142,45.951,55.142,91.903S160,334.617,114.048,307.046 + c-24.651-14.791-27.571-45.952,0-64.333c20.865-13.91,41.022-34.51,36.761-64.332L178.381,178.381L178.381,178.381z"/> + </g> + <g id="XMLID_1111_"> + <path id="XMLID_70_" style="fill:#9DD7F5;" d="M178.381,141.619c0,0,45.952-55.142,91.903-55.142 + c45.952,0,64.333,73.523,36.762,119.475c-14.791,24.65-45.952,27.57-64.333,0c-13.911-20.865-34.511-41.022-64.332-36.762 + L178.381,141.619L178.381,141.619z"/> + </g> + </g> + <g id="XMLID_1112_"> + <g id="XMLID_1113_"> + <path id="XMLID_1114_" style="fill:#78B9EB;" d="M205.952,12.954C192.2,4.703,175.981,0.577,160,0.065V141.62h9.19 + c-4.261-29.822,15.896-50.422,36.761-64.332C233.523,58.906,230.602,27.745,205.952,12.954z"/> + </g> + <g id="XMLID_1115_"> + <path id="XMLID_1116_" style="fill:#78B9EB;" d="M178.381,178.381H160V319.94c37.419,1.201,73.523-17.455,73.523-49.655 + C233.523,224.332,178.381,178.381,178.381,178.381z"/> + </g> + <g id="XMLID_1117_"> + <path id="XMLID_63_" style="fill:#78B9EB;" d="M178.381,141.619c0,0,45.952-55.142,91.903-55.142 + c45.952,0,64.333,73.523,36.762,119.475c-14.791,24.65-45.952,27.57-64.333,0c-13.911-20.865-34.511-41.022-64.332-36.762 + L178.381,141.619L178.381,141.619z"/> + </g> + </g> + <circle id="XMLID_1118_" style="fill:#006DF0;" cx="160" cy="160" r="50"/> + <g id="XMLID_1119_"> + <path id="XMLID_1120_" style="fill:#003778;" d="M160,110c27.614,0,50,22.385,50,50s-22.386,50-50,50"/> + </g> + <circle id="XMLID_1121_" style="fill:#FFFFFF;" cx="160" cy="160" r="20"/> +</g> +<g> +</g> +<g> +</g> +<g> +</g> +<g> +</g> +<g> +</g> +<g> +</g> +<g> +</g> +<g> +</g> +<g> +</g> +<g> +</g> +<g> +</g> +<g> +</g> +<g> +</g> +<g> +</g> +<g> +</g> +</svg> diff --git a/Software/Graphics/propeller.svg b/Software/Graphics/propeller.svg new file mode 100644 index 000000000..9299250a9 --- /dev/null +++ b/Software/Graphics/propeller.svg @@ -0,0 +1,47 @@ +<?xml version="1.0" encoding="iso-8859-1"?> +<!-- Generator: Adobe Illustrator 19.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) --> +<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" + viewBox="0 0 456.527 456.527" style="enable-background:new 0 0 456.527 456.527;" xml:space="preserve"> +<g> + <g> + <path d="M455.768,310.971c-5.397-38.312-99.612-46.241-166-43.953c0.251-8.286-0.87-16.753-3.551-25.096 + c-5.628-17.515-17.125-31.5-31.61-40.514c23.898-43.029,41.406-105.359,25.39-131.664c-29.209-47.972-86.606-66.331-128.2-41.005 + c-33.324,20.29-2.528,111.288,26.057,171.344c-21.346,12.279-35.041,34.285-37.108,58.307 + c-49.552,1.636-113.802,19.484-128.081,47.388c-25.585,49.999-11.182,108.514,32.17,130.697 + c34.075,17.436,93.831-53.34,130.271-108.71c18.068,11.468,40.906,15.129,62.873,8.071c4.717-1.516,9.172-3.467,13.351-5.777 + c29.13,40.911,83.713,86.965,116.038,82.411C422.983,404.636,462.562,359.193,455.768,310.971z M224.783,294.765 + c-16.571,5.324-34.321-3.793-39.645-20.364c-5.324-16.571,3.793-34.321,20.364-39.645c16.571-5.325,34.321,3.792,39.645,20.364 + C250.471,271.691,241.354,289.441,224.783,294.765z"/> + </g> +</g> +<g> +</g> +<g> +</g> +<g> +</g> +<g> +</g> +<g> +</g> +<g> +</g> +<g> +</g> +<g> +</g> +<g> +</g> +<g> +</g> +<g> +</g> +<g> +</g> +<g> +</g> +<g> +</g> +<g> +</g> +</svg> diff --git a/Software/Graphics/propeller.xaml b/Software/Graphics/propeller.xaml new file mode 100644 index 000000000..bc688df26 --- /dev/null +++ b/Software/Graphics/propeller.xaml @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!--This file is NOT compatible with Silverlight--> +<Viewbox xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" Stretch="Uniform"> + <Canvas Name="Capa_1" Canvas.Left="0" Canvas.Top="0" Width="598.6" Height="598.3"> + <Canvas.RenderTransform> + <TranslateTransform X="-143.7" Y="36"/> + </Canvas.RenderTransform> + <Canvas.Resources/> + <!--Unknown tag: metadata--> + <!--Unknown tag: sodipodi:namedview--> + <Path xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Name="path3" Fill="#000000"> + <Path.Data> + <PathGeometry Figures="M728.4 312.2l-198.1-63.4c-0.5-5.9-1.6-11.6-3.4-17c8.4-2.8 17-5.9 25.7-9.2c78.8-29.7 124.3-63 135-98.8 c7.2-23.8-0.5-47.5-22.6-70.3c-17.5-18-56.2-44.9-57.8-46c-6.2-4.3-14.7-2.8-19.1 3.3L465.5 180.8c-3.2-0.4-6.4-0.6-9.6-0.6 c-2.2 0-4.5 0.1-6.7 0.3c-0.5-62.6-8.3-142.4-41.1-178.6c-12.7-14.1-28.3-21.2-46.1-21.2c0 0 0 0 0 0c-12.3 0-25.6 3.5-39.7 10.4 c-17.4 8.6-43.8 27.5-55.6 36.2c-3.5 2.6-5.7 4.2-6.1 4.5c-3.7 2.8-5.6 7.2-5.4 11.6c0.1 2.6 1 5.3 2.7 7.5l128.9 175.8 c-1.4 3.5-2.6 7.1-3.4 10.8c-42.1-13.7-94.9-27.4-138.4-27.4c-34.2 0-59.1 8.6-73.8 25.7c-13 15-17.7 35.8-14 61.7 c3.6 24.8 19.1 69.3 19.7 71.2c2 5.7 7.3 9.3 13 9.3c1.4 0 2.9-0.2 4.3-0.7L404 308.3c2.3 2.3 4.8 4.4 7.4 6.3 c-7.3 10-14.8 20.7-22.3 32c-46.3 70.4-63.5 124-51.1 159.3c8.2 23.5 28.3 38.2 59.6 43.6c16.2 2.8 41.8 3.4 60.4 3.4 c8.1 0 13.5-0.1 13.5-0.1c7.5-0.2 13.5-6.3 13.5-13.9L484 323.8c4.1-1.7 8.1-3.7 11.8-6.1c6.1 8.3 12.6 16.9 19.5 25.6 c52.2 65.4 97.5 98.6 134.8 98.6c17.6 0 42.4-7.5 61.3-43.3c11.7-22.2 25.4-67.3 25.9-69.2C739.5 322.2 735.5 314.5 728.4 312.2z M455.9 293c-21.1 0-38.3-17.1-38.3-38.3s17.1-38.3 38.3-38.3c21.1 0 38.3 17.1 38.3 38.3C494.2 275.9 477 293 455.9 293z" FillRule="NonZero"/> + </Path.Data> + </Path> + </Canvas> +</Viewbox> diff --git a/Software/Graphics/propeller2.xaml b/Software/Graphics/propeller2.xaml new file mode 100644 index 000000000..d083f9aef --- /dev/null +++ b/Software/Graphics/propeller2.xaml @@ -0,0 +1,47 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!--This file is NOT compatible with Silverlight--> +<Viewbox xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" Stretch="Uniform"> + <Canvas Name="svg2" Canvas.Left="0" Canvas.Top="0" Width="1000" Height="1000"> + <Canvas.RenderTransform> + <TranslateTransform X="0" Y="0"/> + </Canvas.RenderTransform> + <Canvas.Resources/> + <!--Unknown tag: sodipodi:namedview--> + <!--Unknown tag: metadata--> + <Canvas Name="g6"> + <Canvas Name="g8"> + <Canvas.RenderTransform> + <TransformGroup> + <ScaleTransform ScaleX="0.100000" ScaleY="-0.100000"/> + <TranslateTransform X="0.000000" Y="512.000000"/> + </TransformGroup> + </Canvas.RenderTransform> + <Path xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Name="path10" Fill="#000000"> + <Path.Data> + <PathGeometry Figures="M281.9 4997c-113-53.6-181.9-164.7-181.9-294.9c0-105.3 103.4-388.7 239.4-653c451.9-888.6 1309.8-1849.9 2213.7-2479.9c239.4-166.6 584.1-369.6 856-507.5l218.3-109.2l59.4 76.6c78.5 99.6 308.3 329.4 406 404l76.6 61.3l-91.9 187.7c-377.3 766-986.2 1562.6-1627.7 2127.5c-530.4 467.2-955.6 766-1428.6 999.6C645.8 4997 412.1 5056.3 281.9 4997z" FillRule="NonZero"/> + </Path.Data> + </Path> + <Path xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Name="path12" Fill="#000000"> + <Path.Data> + <PathGeometry Figures="M9483.3 5010.4c-15.3-5.7-84.3-26.8-153.2-49.8c-258.5-82.3-712.4-331.3-1091.5-599.4c-993.9-704.7-1817.3-1664.1-2330.5-2717.3l-72.8-149.4l86.2-68.9c109.2-88.1 316-294.9 396.4-396.4l59.4-76.6l218.3 109.2c1104.9 555.3 2054.8 1405.6 2772.9 2481.8c317.9 474.9 549.6 999.6 530.4 1196.9c-15.3 160.9-124.5 264.3-285.3 273.8C9558 5018 9498.7 5016.1 9483.3 5010.4z" FillRule="NonZero"/> + </Path.Data> + </Path> + <Path xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Name="path14" Fill="#000000"> + <Path.Data> + <PathGeometry Figures="M4740 1517.5c-132.1-26.8-348.5-109.2-461.5-176.2c-139.8-82.3-417.5-358.1-499.8-497.9c-34.5-61.3-90-185.8-122.6-277.7c-57.4-158.9-61.3-183.8-61.3-446.2c0-262.4 3.8-287.2 61.3-446.2c78.5-220.2 158.9-354.3 317.9-522.8c145.5-155.1 310.2-270 490.2-342.8c404.1-164.7 886.6-130.2 1262 88.1c139.8 84.3 415.5 360 499.8 499.8c218.3 375.3 252.8 857.9 88.1 1262c-137.9 342.8-446.2 645.3-794.7 783.2C5304.9 1525.1 4958.3 1559.6 4740 1517.5z" FillRule="NonZero"/> + </Path.Data> + </Path> + <Path xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Name="path16" Fill="#000000"> + <Path.Data> + <PathGeometry Figures="M3345.9-853.2c-1036-541.9-1903.5-1300.3-2585.2-2263.5C498.3-3486.3 257-3924.9 157.5-4208.3c-59.4-166.6-63.2-360-7.7-432.8c113-153.2 241.3-174.3 503.6-86.2c245.1 82.3 620.4 277.7 924.9 480.6C2654.6-3528.4 3501-2584.4 4060.2-1473.7l109.2 216.4l-57.4 47.9c-30.6 26.8-99.6 84.3-151.3 126.4c-49.8 44-143.6 141.7-208.7 220.2c-63.2 76.6-124.5 139.8-136 139.8C3604.4-723 3483.8-782.4 3345.9-853.2z" FillRule="NonZero"/> + </Path.Data> + </Path> + <Path xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Name="path18" Fill="#000000"> + <Path.Data> + <PathGeometry Figures="M6249-866.7c-63.2-78.5-181.9-197.2-260.4-260.4c-78.5-65.1-143.6-128.3-143.6-139.8c1.9-32.6 226-457.7 363.8-687.5c633.8-1053.2 1700.5-2070.1 2723.1-2589c444.3-227.9 702.8-285.3 834.9-187.7c199.2 149.4 174.3 381.1-101.5 921.1C9142.5-2779.7 8135.2-1724.6 7059-1077.3C6842.6-947.1 6417.5-723 6384.9-723C6375.4-723 6314.1-788.1 6249-866.7z" FillRule="NonZero"/> + </Path.Data> + </Path> + </Canvas> + </Canvas> + </Canvas> +</Viewbox> diff --git a/Software/Graphics/propeller3.svg b/Software/Graphics/propeller3.svg new file mode 100644 index 000000000..110115909 --- /dev/null +++ b/Software/Graphics/propeller3.svg @@ -0,0 +1,5 @@ +<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 191.414 215.186"> + <title>ed244817-8d6e-440e-a6f5-07dd506aa9a9</title> + <path d="M184.038,0a42.232,42.232,0,0,1,7.195,12.653,5.063,5.063,0,0,1-.051,2.844c-2.626,9.144-7.791,16.828-14.145,23.724-5.621,6.1-11.2,12.286-17.324,17.864-7.179,6.545-14.84,12.574-22.44,18.64-5.713,4.56-11.759,8.7-17.472,13.262a67.6,67.6,0,0,0-11.525,11.665c-1.521,1.978-2.127,4.087-2.976,6.22a1.977,1.977,0,0,0,.068.9c0.836,5.859-2.3,10.525-8.078,12.067a41.135,41.135,0,0,0-4.593,1.368c-1.308.519-2.507,1.314-3.909,1.773l3-2.307-5.947-2.96-0.315.264,3.079,3.011c-2.08,2.269-4.409,4.6-6.489,7.127-3.236,3.938-6.317,8-9.436,12.038-2.3,2.978-4.506,6.035-6.853,8.978q-10.9,13.673-21.9,27.27a75.1,75.1,0,0,1-7.824,8.256l5-6.182-0.442-.393c-11.07,12.445-23.006,24.069-33.841,37.1-2.112-3.914-3.779-7.414-5.827-10.675-1.885-3-.694-5.568.347-8.351,3.724-9.953,10.088-18.053,17.352-25.635A387.8,387.8,0,0,1,51.106,140.67c4.486-3.726,9.615-6.666,14.286-10.183A125.572,125.572,0,0,0,80.23,117.249a7.18,7.18,0,0,0,2.128-6.464c-0.752-7.52,4.713-13.069,11.714-14.381a13.352,13.352,0,0,0,6.681-3.631c4.4-4.523,8.437-9.416,12.487-14.27,7.955-9.534,15.731-19.217,23.753-28.694,5.874-6.94,11.927-13.735,18.077-20.432,5.32-5.792,10.861-11.382,16.36-17.008,3.777-3.865,7.644-7.64,11.478-11.448C183.205,0.627,183.559.388,184.038,0Zm-92.5,105.352c-2.262,1.244-3.4,4.509-2.257,6.493a5.744,5.744,0,0,0,7.488,1.931c2.549-1.375,3.421-4.019,2.112-6.4A5.289,5.289,0,0,0,91.537,105.352ZM152.2,33.719l0.511,0.474c10.844-9.358,19.442-20.828,29.5-30.927l-0.665-.627ZM96.663,97.295l8.342,8.182a3.534,3.534,0,0,0-.5-1.74,41.048,41.048,0,0,1-2.149-4.189A4.189,4.189,0,0,0,96.663,97.295Z"/> + <path d="M67.355,109.191A24.524,24.524,0,0,1,75.48,90.728a27.4,27.4,0,0,1,19.531-7.689,26.7,26.7,0,0,1,19.18,7.748,24.694,24.694,0,0,1,8.047,18.4,25.668,25.668,0,0,1-7.949,19.068,26.814,26.814,0,0,1-19.512,7.787A26.715,26.715,0,0,1,75.362,128.2,25.627,25.627,0,0,1,67.355,109.191Zm47.656,0.313a18.384,18.384,0,0,0-5.937-13.873,20.412,20.412,0,0,0-14.609-5.639,19.5,19.5,0,0,0-14.121,5.736A18.56,18.56,0,0,0,74.464,109.5,18.155,18.155,0,0,0,80.5,123.3a20.847,20.847,0,0,0,14.785,5.639,19.1,19.1,0,0,0,13.887-5.756A18.554,18.554,0,0,0,115.011,109.5Z"/> +</svg> diff --git a/Software/Graphics/transportation.svg b/Software/Graphics/transportation.svg new file mode 100644 index 000000000..a77a1e017 --- /dev/null +++ b/Software/Graphics/transportation.svg @@ -0,0 +1,143 @@ +<?xml version="1.0" encoding="iso-8859-1"?> +<!-- Generator: Adobe Illustrator 19.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) --> +<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" + viewBox="0 0 504.114 504.114" style="enable-background:new 0 0 504.114 504.114;" xml:space="preserve"> +<path style="fill:#B7C4C4;" d="M271.962,29.899c-65.371,45.403-81.566,135.2-36.187,200.57"/> +<path style="fill:#086CB7;" d="M241.581,238.81c4.616-3.182,5.766-9.531,2.568-14.155C202.023,164.011,217.1,80.382,277.783,38.264 + c4.6-3.19,5.766-9.555,2.552-14.171c-3.198-4.592-9.555-5.734-14.155-2.528c-69.892,48.498-87.261,144.841-38.739,214.717 + C230.64,240.874,236.981,242.024,241.581,238.81z"/> +<path style="fill:#1382CE;" d="M252.916,2.006c2.371-1.646,5.356-2.379,8.444-1.82l42.819,7.743l-7.696,42.835 + c-1.142,6.105-6.987,10.177-13.076,9.043c-6.136-1.079-10.185-6.908-9.09-13.036l3.742-20.708l-20.693-3.757 + c-6.12-1.103-10.185-6.924-9.058-13.068C248.828,6.189,250.553,3.653,252.916,2.006z"/> +<path style="fill:#086CB7;" d="M281.903,59.256l7.412-41.007l-40.999-7.389c-0.181,5.482,3.474,10.445,9.043,11.453l20.693,3.757 + l-3.742,20.708C273.333,52.363,276.72,57.491,281.903,59.256z"/> +<path style="fill:#B7C4C4;" d="M232.137,474.22c65.371-45.395,81.581-135.199,36.202-200.57"/> +<path style="fill:#086CB7;" d="M262.534,265.308c-4.616,3.19-5.782,9.539-2.568,14.163c42.126,60.644,27.034,144.274-33.642,186.392 + c-4.584,3.19-5.75,9.555-2.536,14.163c3.182,4.592,9.555,5.734,14.155,2.544c69.876-48.506,87.261-144.841,38.739-214.717 + C273.475,263.244,267.118,262.094,262.534,265.308z"/> +<path style="fill:#1382CE;" d="M251.199,502.112c-2.371,1.638-5.356,2.371-8.444,1.82l-42.819-7.735l7.696-42.835 + c1.142-6.105,6.987-10.185,13.076-9.043c6.12,1.079,10.169,6.908,9.074,13.036l-3.742,20.708l20.693,3.757 + c6.12,1.095,10.185,6.924,9.074,13.068C255.287,497.937,253.562,500.458,251.199,502.112z"/> +<path style="fill:#086CB7;" d="M222.212,444.863l-7.412,41.015l40.984,7.389c0.181-5.474-3.458-10.437-9.043-11.445l-20.693-3.757 + l3.742-20.708C230.766,451.755,227.395,446.619,222.212,444.863z"/> +<path style="fill:#B7C4C4;" d="M423.223,109.046c-78.32-14.123-153.293,37.927-167.416,116.248"/> +<path style="fill:#086CB7;" d="M254.011,235.289c5.522,1.016,10.831-2.655,11.831-8.2c13.107-72.657,82.889-121.123,155.585-108.008 + c5.506,0.993,10.831-2.678,11.815-8.216c1-5.498-2.694-10.799-8.216-11.8c-83.708-15.124-164.108,40.716-179.216,124.424 + C244.826,229.003,248.505,234.305,254.011,235.289z"/> +<path style="fill:#1382CE;" d="M429.469,75.852c2.844,0.504,5.474,2.119,7.278,4.695l24.781,35.753l-35.722,24.836 + c-5.12,3.513-12.138,2.261-15.644-2.844c-3.568-5.096-2.308-12.075,2.796-15.644l17.29-11.989l-11.981-17.298 + c-3.552-5.096-2.308-12.091,2.828-15.644C423.625,75.923,426.641,75.356,429.469,75.852z"/> +<path style="fill:#086CB7;" d="M409.501,136.843l34.233-23.765l-23.757-34.209c-4.017,3.742-4.939,9.838-1.709,14.486l11.981,17.298 + l-17.29,11.989C408.32,125.91,407.075,131.928,409.501,136.843z"/> +<path style="fill:#B7C4C4;" d="M80.876,395.073c78.336,14.123,153.293-37.919,167.432-116.232"/> +<path style="fill:#086CB7;" d="M250.104,268.845c-5.537-1.024-10.831,2.647-11.831,8.192 + c-13.107,72.657-82.905,121.131-155.601,108.008c-5.49-0.992-10.815,2.694-11.815,8.224c-0.985,5.49,2.71,10.791,8.231,11.8 + c83.692,15.116,164.108-40.716,179.216-124.432C259.288,275.107,255.61,269.822,250.104,268.845z"/> +<path style="fill:#1382CE;" d="M74.63,428.266c-2.828-0.52-5.459-2.119-7.263-4.687l-24.797-35.745l35.738-24.852 + c5.12-3.513,12.138-2.253,15.644,2.859c3.552,5.088,2.292,12.067-2.796,15.628l-17.29,11.997l11.981,17.29 + c3.552,5.096,2.308,12.091-2.828,15.659C80.49,428.203,77.473,428.778,74.63,428.266z"/> +<path style="fill:#086CB7;" d="M94.613,367.283L60.38,391.048l23.757,34.209c4.017-3.742,4.923-9.83,1.709-14.486l-11.981-17.29 + l17.29-11.997C95.795,378.216,97.039,372.198,94.613,367.283z"/> +<path id="SVGCleanerId_0" style="fill:#B7C4C4;" d="M474.226,271.972c-45.418-65.371-135.215-81.566-200.602-36.187"/> +<path id="SVGCleanerId_1" style="fill:#086CB7;" d="M265.306,241.583c3.182,4.624,9.539,5.782,14.155,2.56 + c60.644-42.102,144.258-27.026,186.4,33.658c3.182,4.584,9.539,5.742,14.171,2.536c4.584-3.19,5.727-9.555,2.521-14.163 + c-48.49-69.884-144.833-87.261-214.709-38.731C263.242,230.634,262.085,236.999,265.306,241.583z"/> +<path id="SVGCleanerId_2" style="fill:#1382CE;" d="M502.102,252.918c1.646,2.371,2.387,5.372,1.827,8.46l-7.751,42.827 + l-42.835-7.712c-6.105-1.126-10.169-6.979-9.043-13.068c1.095-6.12,6.908-10.169,13.044-9.09l20.693,3.757l3.773-20.708 + c1.095-6.105,6.924-10.177,13.06-9.058C497.92,248.83,500.456,250.563,502.102,252.918z"/> +<path id="SVGCleanerId_3" style="fill:#086CB7;" d="M444.861,281.913l41.015,7.404l7.389-40.976 + c-5.474-0.205-10.445,3.458-11.445,9.019l-3.773,20.708l-20.693-3.757C451.753,273.351,446.609,276.73,444.861,281.913z"/> +<path id="SVGCleanerId_4" style="fill:#B7C4C4;" d="M29.889,232.154c45.403,65.363,135.215,81.566,200.57,36.194"/> +<path id="SVGCleanerId_5" style="fill:#086CB7;" d="M238.793,262.551c-3.182-4.639-9.523-5.797-14.155-2.576 + c-60.629,42.118-144.274,27.034-186.384-33.65c-3.198-4.592-9.57-5.742-14.171-2.528c-4.584,3.174-5.727,9.539-2.536,14.163 + c48.506,69.876,144.833,87.261,214.709,38.723C240.872,273.469,242.014,267.144,238.793,262.551z"/> +<path id="SVGCleanerId_6" style="fill:#1382CE;" d="M1.996,251.209c-1.631-2.387-2.371-5.356-1.812-8.46l7.719-42.803l42.843,7.696 + c6.105,1.15,10.185,6.995,9.043,13.084c-1.079,6.112-6.908,10.153-13.028,9.074l-20.701-3.734l-3.757,20.693 + c-1.095,6.12-6.924,10.177-13.076,9.074C6.179,255.297,3.659,253.579,1.996,251.209z"/> +<path id="SVGCleanerId_7" style="fill:#086CB7;" d="M59.254,222.206l-41.015-7.389l-7.389,40.984 + c5.474,0.181,10.429-3.458,11.445-9.043l3.765-20.693l20.708,3.742C52.362,230.784,57.489,227.397,59.254,222.206z"/> +<g> + <path id="SVGCleanerId_0_1_" style="fill:#B7C4C4;" d="M474.226,271.972c-45.418-65.371-135.215-81.566-200.602-36.187"/> +</g> +<g> + <path id="SVGCleanerId_1_1_" style="fill:#086CB7;" d="M265.306,241.583c3.182,4.624,9.539,5.782,14.155,2.56 + c60.644-42.102,144.258-27.026,186.4,33.658c3.182,4.584,9.539,5.742,14.171,2.536c4.584-3.19,5.727-9.555,2.521-14.163 + c-48.49-69.884-144.833-87.261-214.709-38.731C263.242,230.634,262.085,236.999,265.306,241.583z"/> +</g> +<g> + <path id="SVGCleanerId_2_1_" style="fill:#1382CE;" d="M502.102,252.918c1.646,2.371,2.387,5.372,1.827,8.46l-7.751,42.827 + l-42.835-7.712c-6.105-1.126-10.169-6.979-9.043-13.068c1.095-6.12,6.908-10.169,13.044-9.09l20.693,3.757l3.773-20.708 + c1.095-6.105,6.924-10.177,13.06-9.058C497.92,248.83,500.456,250.563,502.102,252.918z"/> +</g> +<g> + <path id="SVGCleanerId_3_1_" style="fill:#086CB7;" d="M444.861,281.913l41.015,7.404l7.389-40.976 + c-5.474-0.205-10.445,3.458-11.445,9.019l-3.773,20.708l-20.693-3.757C451.753,273.351,446.609,276.73,444.861,281.913z"/> +</g> +<g> + <path id="SVGCleanerId_4_1_" style="fill:#B7C4C4;" d="M29.889,232.154c45.403,65.363,135.215,81.566,200.57,36.194"/> +</g> +<g> + <path id="SVGCleanerId_5_1_" style="fill:#086CB7;" d="M238.793,262.551c-3.182-4.639-9.523-5.797-14.155-2.576 + c-60.629,42.118-144.274,27.034-186.384-33.65c-3.198-4.592-9.57-5.742-14.171-2.528c-4.584,3.174-5.727,9.539-2.536,14.163 + c48.506,69.876,144.833,87.261,214.709,38.723C240.872,273.469,242.014,267.144,238.793,262.551z"/> +</g> +<g> + <path id="SVGCleanerId_6_1_" style="fill:#1382CE;" d="M1.996,251.209c-1.631-2.387-2.371-5.356-1.812-8.46l7.719-42.803 + l42.843,7.696c6.105,1.15,10.185,6.995,9.043,13.084c-1.079,6.112-6.908,10.153-13.028,9.074l-20.701-3.734l-3.757,20.693 + c-1.095,6.12-6.924,10.177-13.076,9.074C6.179,255.297,3.659,253.579,1.996,251.209z"/> +</g> +<g> + <path id="SVGCleanerId_7_1_" style="fill:#086CB7;" d="M59.254,222.206l-41.015-7.389l-7.389,40.984 + c5.474,0.181,10.429-3.458,11.445-9.043l3.765-20.693l20.708,3.742C52.362,230.784,57.489,227.397,59.254,222.206z"/> +</g> +<path style="fill:#B7C4C4;" d="M395.071,423.233c14.123-78.336-37.935-153.285-116.248-167.416"/> +<path style="fill:#086CB7;" d="M268.827,254.028c-1.016,5.53,2.662,10.831,8.2,11.815c72.665,13.107,121.123,82.897,108.016,155.601 + c-1,5.49,2.678,10.815,8.216,11.815c5.49,0.985,10.799-2.702,11.8-8.216c15.124-83.708-40.724-164.131-124.432-179.224 + C275.121,244.836,269.812,248.515,268.827,254.028z"/> +<path style="fill:#1382CE;" d="M428.256,429.479c-0.504,2.828-2.111,5.474-4.695,7.27l-35.753,24.797l-24.828-35.738 + c-3.521-5.112-2.261-12.13,2.844-15.636c5.088-3.56,12.06-2.308,15.644,2.788l11.981,17.29l17.306-11.981 + c5.088-3.552,12.091-2.308,15.644,2.828C428.193,423.626,428.768,426.651,428.256,429.479z"/> +<path style="fill:#086CB7;" d="M367.273,409.503l23.773,34.241l34.202-23.765c-3.742-4.017-9.83-4.931-14.478-1.709l-17.306,11.981 + l-11.981-17.29C378.214,408.33,372.196,407.085,367.273,409.503z"/> +<path style="fill:#B7C4C4;" d="M109.028,80.886C94.921,159.222,146.963,234.186,225.26,248.31"/> +<path style="fill:#086CB7;" d="M235.272,250.106c1.016-5.537-2.647-10.839-8.2-11.831c-72.649-13.099-121.123-82.897-108-155.585 + c0.985-5.506-2.694-10.831-8.231-11.823c-5.49-0.992-10.784,2.694-11.8,8.224c-15.124,83.716,40.708,164.116,124.432,179.208 + C229.009,259.29,234.287,255.635,235.272,250.106z"/> +<path style="fill:#1382CE;" d="M75.843,74.639c0.52-2.836,2.127-5.451,4.695-7.27l35.738-24.789l24.86,35.73 + c3.505,5.136,2.245,12.146-2.875,15.644c-5.081,3.56-12.06,2.3-15.612-2.796l-12.012-17.282L93.361,85.856 + c-5.104,3.568-12.091,2.308-15.659-2.82C75.906,80.492,75.331,77.491,75.843,74.639z"/> +<path style="fill:#086CB7;" d="M136.826,94.615L113.069,60.39L78.852,84.155c3.742,4.001,9.815,4.915,14.494,1.694l17.274-11.981 + l12.012,17.282C125.9,95.813,131.918,97.049,136.826,94.615z"/> +<circle style="fill:#1382CE;" cx="252.049" cy="252.051" r="36.108"/> +<path style="fill:#086CB7;" d="M226.52,226.522c14.108-14.1,36.966-14.1,51.058,0c14.108,14.1,14.108,36.959,0,51.058"/> +<g> +</g> +<g> +</g> +<g> +</g> +<g> +</g> +<g> +</g> +<g> +</g> +<g> +</g> +<g> +</g> +<g> +</g> +<g> +</g> +<g> +</g> +<g> +</g> +<g> +</g> +<g> +</g> +<g> +</g> +</svg> diff --git a/Software/Graphics/volume.png b/Software/Graphics/volume.png Binary files differnew file mode 100644 index 000000000..4f48f7528 --- /dev/null +++ b/Software/Graphics/volume.png diff --git a/Software/PMR/Messages/Common/MessageType.proto b/Software/PMR/Messages/Common/MessageType.proto index 24a398e01..0c43f2b2d 100644 --- a/Software/PMR/Messages/Common/MessageType.proto +++ b/Software/PMR/Messages/Common/MessageType.proto @@ -69,6 +69,15 @@ enum MessageType MotorAbortJoggingRequest = 2008; MotorAbortJoggingResponse = 2009; + DispenserAbortHomingRequest = 2010; + DispenserAbortHomingResponse = 2011; + DispenserHomingRequest = 2012; + DispenserHomingResponse = 2013; + DispenserJoggingRequest = 2014; + DispenserJoggingResponse = 2015; + DispenserAbortJoggingRequest = 2016; + DispenserAbortJoggingResponse = 2017; + //Printing JobRequest = 3000; diff --git a/Software/PMR/Messages/Diagnostics/DispenserAbortHomingRequest.proto b/Software/PMR/Messages/Diagnostics/DispenserAbortHomingRequest.proto new file mode 100644 index 000000000..a50c64c76 --- /dev/null +++ b/Software/PMR/Messages/Diagnostics/DispenserAbortHomingRequest.proto @@ -0,0 +1,9 @@ +syntax = "proto3"; + +package Tango.PMR.Diagnostics; +option java_package = "com.twine.tango.pmr.diagnostics"; + +message DispenserAbortHomingRequest +{ + int32 Code = 1; +}
\ No newline at end of file diff --git a/Software/PMR/Messages/Diagnostics/DispenserAbortHomingResponse.proto b/Software/PMR/Messages/Diagnostics/DispenserAbortHomingResponse.proto new file mode 100644 index 000000000..04c242ddd --- /dev/null +++ b/Software/PMR/Messages/Diagnostics/DispenserAbortHomingResponse.proto @@ -0,0 +1,9 @@ +syntax = "proto3"; + +package Tango.PMR.Diagnostics; +option java_package = "com.twine.tango.pmr.diagnostics"; + +message DispenserAbortHomingResponse +{ + +}
\ No newline at end of file diff --git a/Software/PMR/Messages/Diagnostics/DispenserAbortJoggingRequest.proto b/Software/PMR/Messages/Diagnostics/DispenserAbortJoggingRequest.proto new file mode 100644 index 000000000..7767ea60f --- /dev/null +++ b/Software/PMR/Messages/Diagnostics/DispenserAbortJoggingRequest.proto @@ -0,0 +1,9 @@ +syntax = "proto3"; + +package Tango.PMR.Diagnostics; +option java_package = "com.twine.tango.pmr.diagnostics"; + +message DispenserAbortJoggingRequest +{ + int32 Code = 2; +}
\ No newline at end of file diff --git a/Software/PMR/Messages/Diagnostics/DispenserAbortJoggingResponse.proto b/Software/PMR/Messages/Diagnostics/DispenserAbortJoggingResponse.proto new file mode 100644 index 000000000..df0fa3fad --- /dev/null +++ b/Software/PMR/Messages/Diagnostics/DispenserAbortJoggingResponse.proto @@ -0,0 +1,9 @@ +syntax = "proto3"; + +package Tango.PMR.Diagnostics; +option java_package = "com.twine.tango.pmr.diagnostics"; + +message DispenserAbortJoggingResponse +{ + int32 Code = 2; +}
\ No newline at end of file diff --git a/Software/PMR/Messages/Diagnostics/DispenserHomingRequest.proto b/Software/PMR/Messages/Diagnostics/DispenserHomingRequest.proto new file mode 100644 index 000000000..6263b228c --- /dev/null +++ b/Software/PMR/Messages/Diagnostics/DispenserHomingRequest.proto @@ -0,0 +1,10 @@ +syntax = "proto3"; + +package Tango.PMR.Diagnostics; +option java_package = "com.twine.tango.pmr.diagnostics"; + +message DispenserHomingRequest +{ + int32 Code = 1; + double Speed = 2; +}
\ No newline at end of file diff --git a/Software/PMR/Messages/Diagnostics/DispenserHomingResponse.proto b/Software/PMR/Messages/Diagnostics/DispenserHomingResponse.proto new file mode 100644 index 000000000..c7e249ad3 --- /dev/null +++ b/Software/PMR/Messages/Diagnostics/DispenserHomingResponse.proto @@ -0,0 +1,10 @@ +syntax = "proto3"; + +package Tango.PMR.Diagnostics; +option java_package = "com.twine.tango.pmr.diagnostics"; + +message DispenserHomingResponse +{ + double Progress = 1; + double MaxProgress = 2; +}
\ No newline at end of file diff --git a/Software/PMR/Messages/Diagnostics/DispenserJoggingRequest.proto b/Software/PMR/Messages/Diagnostics/DispenserJoggingRequest.proto new file mode 100644 index 000000000..2eba7cd1b --- /dev/null +++ b/Software/PMR/Messages/Diagnostics/DispenserJoggingRequest.proto @@ -0,0 +1,13 @@ +syntax = "proto3"; + +import "MotorDirection.proto"; + +package Tango.PMR.Diagnostics; +option java_package = "com.twine.tango.pmr.diagnostics"; + +message DispenserJoggingRequest +{ + MotorDirection Direction = 1; + int32 Code = 2; + double Speed = 3; +}
\ No newline at end of file diff --git a/Software/PMR/Messages/Diagnostics/DispenserJoggingResponse.proto b/Software/PMR/Messages/Diagnostics/DispenserJoggingResponse.proto new file mode 100644 index 000000000..7b6ccea8d --- /dev/null +++ b/Software/PMR/Messages/Diagnostics/DispenserJoggingResponse.proto @@ -0,0 +1,9 @@ +syntax = "proto3"; + +package Tango.PMR.Diagnostics; +option java_package = "com.twine.tango.pmr.diagnostics"; + +message DispenserJoggingResponse +{ + +}
\ No newline at end of file diff --git a/Software/PMR/Messages/Diagnostics/MotorHomingResponse.proto b/Software/PMR/Messages/Diagnostics/MotorHomingResponse.proto index f79b85955..1ee59cd3b 100644 --- a/Software/PMR/Messages/Diagnostics/MotorHomingResponse.proto +++ b/Software/PMR/Messages/Diagnostics/MotorHomingResponse.proto @@ -5,6 +5,6 @@ option java_package = "com.twine.tango.pmr.diagnostics"; message MotorHomingResponse { - int32 Progress = 1; - int32 MaxProgress = 2; + double Progress = 1; + double MaxProgress = 2; }
\ No newline at end of file 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 new file mode 100644 index 000000000..b84da3b42 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/DispenserElementEditor.xaml @@ -0,0 +1,288 @@ +<local:ElementEditor x:Class="Tango.MachineStudio.Technician.Editors.DispenserElementEditor" + 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" + xmlns:d="http://schemas.microsoft.com/expression/blend/2008" + xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" + xmlns:items="clr-namespace:Tango.MachineStudio.Technician.TechItems" + xmlns:converters="clr-namespace:Tango.Editors.Converters;assembly=Tango.Editors" + xmlns:sharedConverters="clr-namespace:Tango.SharedUI.Converters;assembly=Tango.SharedUI" + xmlns:visuals="clr-namespace:Tango.Visuals;assembly=Tango.Visuals" + xmlns:local="clr-namespace:Tango.Editors;assembly=Tango.Editors" + mc:Ignorable="d" + d:DesignHeight="164.393" d:DesignWidth="224.65" Background="Transparent" ClipToBounds="False" BorderThickness="0" MinWidth="1" MinHeight="1" RenderTransformOrigin="0.5,0.5" d:DataContext="{d:DesignInstance Type=items:DispenserItem, IsDesignTimeCreatable=False}"> + + <UserControl.Resources> + <converters:BoolToVisibilityConverter x:Key="BoolToVisibilityConverter"></converters:BoolToVisibilityConverter> + <sharedConverters:BooleanInverseConverter x:Key="BooleanInverseConverter" /> + + <!--Theme--> + <SolidColorBrush x:Key="BorderBrush" Color="Transparent"></SolidColorBrush> + <SolidColorBrush x:Key="CornersBrush" Color="Red"></SolidColorBrush> + + <Grid x:Key="gridHoming"> + <DockPanel> + <Button Click="OnHomingStopped" DockPanel.Dock="Right" Padding="0" Style="{StaticResource MaterialDesignFlatButton}" VerticalAlignment="Center" Margin="0 0 5 0" ToolTip="Stop Homing"> + <materialDesign:PackIcon Kind="Stop" Foreground="#FF5F5F" HorizontalAlignment="Center" VerticalAlignment="Center" Width="32" Height="32" /> + </Button> + <ProgressBar Foreground="DimGray" BorderBrush="DimGray" Maximum="{Binding HomingMaximumProgress}" Value="{Binding HomingProgress}" VerticalAlignment="Center" Height="10" Margin="5 0 5 0" Background="Transparent"></ProgressBar> + </DockPanel> + </Grid> + + <Grid x:Key="gridDefault"> + <Viewbox Stretch="Fill"> + <materialDesign:PackIcon Kind="Home" Margin="25 0" HorizontalAlignment="Center" VerticalAlignment="Center" Width="24" Height="24" Foreground="#202020" /> + </Viewbox> + + <Button Click="OnHomingStarted" Style="{StaticResource emptyButton}" Cursor="Hand" Background="Transparent" BorderThickness="0"></Button> + </Grid> + </UserControl.Resources> + + <UserControl.RenderTransform> + <RotateTransform Angle="{Binding RelativeSource={RelativeSource AncestorType=local:ElementEditor},Path=Angle}"></RotateTransform> + </UserControl.RenderTransform> + + <Grid> + + <Grid Margin="5" IsHitTestVisible="{Binding RelativeSource={RelativeSource AncestorType=local:ElementsEditor},Path=IsEditable,Converter={StaticResource BooleanInverseConverter}}"> + <Grid.ColumnDefinitions> + <ColumnDefinition Width="20*"/> + <ColumnDefinition Width="100*"/> + <ColumnDefinition Width="20*"/> + </Grid.ColumnDefinitions> + + <Grid.RowDefinitions> + <RowDefinition Height="100*" /> + <RowDefinition Height="30*" /> + </Grid.RowDefinitions> + + <Grid Grid.Column="1"> + <Border BorderThickness="1" BorderBrush="Gray" CornerRadius="5"> + <Border.Background> + <ImageBrush ImageSource="../Images/black-screen.jpg" Opacity="0.1" /> + </Border.Background> + + <Grid> + <Grid.ColumnDefinitions> + <ColumnDefinition Width="63*"/> + <ColumnDefinition Width="88*"/> + </Grid.ColumnDefinitions> + <Image Source="../Images/dispenser-line.png" Grid.ColumnSpan="2" Stretch="Fill"></Image> + + <Path RenderTransformOrigin="0.5,0.5" Margin="10" HorizontalAlignment="Left" VerticalAlignment="Bottom" StrokeThickness="1" Stroke="Gray" Stretch="Uniform" Data="M728.4 312.2l-198.1-63.4c-0.5-5.9-1.6-11.6-3.4-17c8.4-2.8 17-5.9 25.7-9.2c78.8-29.7 124.3-63 135-98.8 c7.2-23.8-0.5-47.5-22.6-70.3c-17.5-18-56.2-44.9-57.8-46c-6.2-4.3-14.7-2.8-19.1 3.3L465.5 180.8c-3.2-0.4-6.4-0.6-9.6-0.6 c-2.2 0-4.5 0.1-6.7 0.3c-0.5-62.6-8.3-142.4-41.1-178.6c-12.7-14.1-28.3-21.2-46.1-21.2c0 0 0 0 0 0c-12.3 0-25.6 3.5-39.7 10.4 c-17.4 8.6-43.8 27.5-55.6 36.2c-3.5 2.6-5.7 4.2-6.1 4.5c-3.7 2.8-5.6 7.2-5.4 11.6c0.1 2.6 1 5.3 2.7 7.5l128.9 175.8 c-1.4 3.5-2.6 7.1-3.4 10.8c-42.1-13.7-94.9-27.4-138.4-27.4c-34.2 0-59.1 8.6-73.8 25.7c-13 15-17.7 35.8-14 61.7 c3.6 24.8 19.1 69.3 19.7 71.2c2 5.7 7.3 9.3 13 9.3c1.4 0 2.9-0.2 4.3-0.7L404 308.3c2.3 2.3 4.8 4.4 7.4 6.3 c-7.3 10-14.8 20.7-22.3 32c-46.3 70.4-63.5 124-51.1 159.3c8.2 23.5 28.3 38.2 59.6 43.6c16.2 2.8 41.8 3.4 60.4 3.4 c8.1 0 13.5-0.1 13.5-0.1c7.5-0.2 13.5-6.3 13.5-13.9L484 323.8c4.1-1.7 8.1-3.7 11.8-6.1c6.1 8.3 12.6 16.9 19.5 25.6 c52.2 65.4 97.5 98.6 134.8 98.6c17.6 0 42.4-7.5 61.3-43.3c11.7-22.2 25.4-67.3 25.9-69.2C739.5 322.2 735.5 314.5 728.4 312.2z M455.9 293c-21.1 0-38.3-17.1-38.3-38.3s17.1-38.3 38.3-38.3c21.1 0 38.3 17.1 38.3 38.3C494.2 275.9 477 293 455.9 293z"> + <Path.Fill> + <LinearGradientBrush> + <GradientStop Color="Black"/> + <GradientStop Color="{Binding Color}" Offset="0.8"/> + </LinearGradientBrush> + </Path.Fill> + <Path.RenderTransform> + <RotateTransform x:Name="propRotate" Angle="0" /> + </Path.RenderTransform> + </Path> + <!--<Image RenderTransformOrigin="0.5,0.5" Margin="10" HorizontalAlignment="Left" VerticalAlignment="Bottom" Source="../Images/prop.png" RenderOptions.BitmapScalingMode="Fant"> + <Image.RenderTransform> + <RotateTransform x:Name="propRotate" Angle="0" /> + </Image.RenderTransform> + </Image>--> + </Grid> + </Border> + </Grid> + + <Grid> + <Border BorderBrush="Gray" Cursor="Hand" BorderThickness="1 1 0 1" Margin="0 10" CornerRadius="5 0 0 5" PreviewMouseDown="OnBackwardPressed" PreviewMouseUp="OnBackwardReleased"> + <Border.Style> + <Style TargetType="Border"> + <Setter Property="Background"> + <Setter.Value> + <LinearGradientBrush EndPoint="1,0"> + <GradientStop Color="#AAAAAA" Offset="1" /> + <GradientStop Color="#FFEEEEEE" Offset="0"/> + </LinearGradientBrush> + </Setter.Value> + </Setter> + <Style.Triggers> + <EventTrigger RoutedEvent="PreviewMouseDown"> + <EventTrigger.Actions> + <BeginStoryboard> + <Storyboard> + <ColorAnimation Storyboard.TargetProperty="Background.GradientStops[1].Color" To="#FFCECECE" Duration="00:00:0.1" /> + </Storyboard> + </BeginStoryboard> + </EventTrigger.Actions> + </EventTrigger> + <EventTrigger RoutedEvent="PreviewMouseUp"> + <EventTrigger.Actions> + <BeginStoryboard> + <Storyboard> + <ColorAnimation Storyboard.TargetProperty="Background.GradientStops[1].Color" To="#FFEEEEEE" Duration="00:00:0.1" /> + </Storyboard> + </BeginStoryboard> + </EventTrigger.Actions> + </EventTrigger> + </Style.Triggers> + </Style> + </Border.Style> + + <Viewbox Stretch="Fill" Margin="-10 20"> + <materialDesign:PackIcon Kind="ChevronLeft" HorizontalAlignment="Center" VerticalAlignment="Center" Width="24" Height="24" Foreground="#202020" /> + </Viewbox> + </Border> + </Grid> + + <Grid Grid.Column="2"> + <Border BorderBrush="Gray" Cursor="Hand" BorderThickness="0 1 1 1" Margin="0 10" CornerRadius="0 10 10 0" PreviewMouseDown="OnForwardPressed" PreviewMouseUp="OnForwardReleased"> + <Border.Style> + <Style TargetType="Border"> + <Setter Property="Background"> + <Setter.Value> + <LinearGradientBrush EndPoint="1,0"> + <GradientStop Color="#AAAAAA" Offset="0" /> + <GradientStop Color="#FFEEEEEE" Offset="1"/> + </LinearGradientBrush> + </Setter.Value> + </Setter> + <Style.Triggers> + <EventTrigger RoutedEvent="PreviewMouseDown"> + <EventTrigger.Actions> + <BeginStoryboard> + <Storyboard> + <ColorAnimation Storyboard.TargetProperty="Background.GradientStops[1].Color" To="#FFCECECE" Duration="00:00:0.1" /> + </Storyboard> + </BeginStoryboard> + </EventTrigger.Actions> + </EventTrigger> + <EventTrigger RoutedEvent="PreviewMouseUp"> + <EventTrigger.Actions> + <BeginStoryboard> + <Storyboard> + <ColorAnimation Storyboard.TargetProperty="Background.GradientStops[1].Color" To="#FFEEEEEE" Duration="00:00:0.1" /> + </Storyboard> + </BeginStoryboard> + </EventTrigger.Actions> + </EventTrigger> + </Style.Triggers> + </Style> + </Border.Style> + + <Viewbox Stretch="Fill" Margin="-10 20"> + <materialDesign:PackIcon Kind="ChevronRight" HorizontalAlignment="Center" VerticalAlignment="Center" Width="24" Height="24" Foreground="#202020" /> + </Viewbox> + </Border> + </Grid> + + <Grid Grid.Column="1" Grid.Row="1"> + <Grid.ColumnDefinitions> + <ColumnDefinition Width="20*"/> + <ColumnDefinition Width="115*"/> + <ColumnDefinition Width="20*"/> + </Grid.ColumnDefinitions> + + <Grid Grid.Column="1"> + <Border BorderBrush="Gray" BorderThickness="1 0 1 1" CornerRadius="0 0 20 20"> + <Border.Style> + <Style TargetType="Border"> + <Setter Property="Background"> + <Setter.Value> + <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0"> + <GradientStop Color="#979797" Offset="1" /> + <GradientStop Color="#FFEEEEEE" Offset="0"/> + </LinearGradientBrush> + </Setter.Value> + </Setter> + <Style.Triggers> + <EventTrigger RoutedEvent="PreviewMouseDown"> + <EventTrigger.Actions> + <BeginStoryboard> + <Storyboard> + <ColorAnimation Storyboard.TargetProperty="Background.GradientStops[1].Color" To="#FFCECECE" Duration="00:00:0.1" /> + </Storyboard> + </BeginStoryboard> + </EventTrigger.Actions> + </EventTrigger> + <EventTrigger RoutedEvent="PreviewMouseUp"> + <EventTrigger.Actions> + <BeginStoryboard> + <Storyboard> + <ColorAnimation Storyboard.TargetProperty="Background.GradientStops[1].Color" To="#FFEEEEEE" Duration="00:00:0.1" /> + </Storyboard> + </BeginStoryboard> + </EventTrigger.Actions> + </EventTrigger> + </Style.Triggers> + </Style> + </Border.Style> + + <Grid> + <ContentControl> + <ContentControl.Style> + <Style TargetType="ContentControl"> + <Setter Property="Content" Value="{StaticResource gridDefault}"> + + </Setter> + <Style.Triggers> + <DataTrigger Binding="{Binding IsHoming}" Value="True"> + <Setter Property="Content" Value="{StaticResource gridHoming}"> + </Setter> + </DataTrigger> + </Style.Triggers> + </Style> + </ContentControl.Style> + + </ContentControl> + </Grid> + </Border> + </Grid> + </Grid> + + + </Grid> + + <!--Content--> + <Grid> + <Border Margin="0 0 0 -23" VerticalAlignment="Bottom"> + <TextBlock Text="{Binding TechDispenser.Description}" FontSize="14" Foreground="DimGray" HorizontalAlignment="Center"></TextBlock> + </Border> + </Grid> + <!--Content--> + + + <Border BorderThickness="1" BorderBrush="{Binding RelativeSource={RelativeSource AncestorType=local:ElementEditor},Path=BorderBrush,TargetNullValue={StaticResource BorderBrush},FallbackValue={StaticResource BorderBrush}}" Visibility="{Binding RelativeSource={RelativeSource AncestorType=local:ElementEditor},Path=(local:ElementsEditor.IsSelected),Converter={StaticResource BoolToVisibilityConverter}}"> + <Grid> + <ContentPresenter Content="{Binding RelativeSource={RelativeSource AncestorType=local:ElementEditor},Path=InnerContent}"></ContentPresenter> + + <Thumb Opacity="0" DragDelta="MoveDrag" DragStarted="DragStarted" DragCompleted="OnDragEnded"></Thumb> + <Thumb HorizontalAlignment="Left" Cursor="SizeWE" Opacity="0" DragDelta="DragLeft" DragStarted="DragStarted" DragCompleted="OnDragEnded"></Thumb> + <Thumb HorizontalAlignment="Right" Cursor="SizeWE" Opacity="0" DragDelta="DragRight" DragStarted="DragStarted" DragCompleted="OnDragEnded"></Thumb> + <Thumb VerticalAlignment="Top" Cursor="SizeNS" Opacity="0" DragDelta="DragTop" DragStarted="DragStarted" DragCompleted="OnDragEnded"></Thumb> + <Thumb VerticalAlignment="Bottom" Cursor="SizeNS" Opacity="0" DragDelta="DragBottom" DragStarted="DragStarted" DragCompleted="OnDragEnded"></Thumb> + + <Grid ClipToBounds="False" HorizontalAlignment="Center" VerticalAlignment="Top" Margin="0 -20 0 0" Width="10" Height="10"> + <Ellipse Stroke="{Binding RelativeSource={RelativeSource AncestorType=local:ElementEditor},Path=CornersBrush,TargetNullValue={StaticResource CornersBrush},FallbackValue={StaticResource CornersBrush}}" StrokeThickness="2"></Ellipse> + <Rectangle HorizontalAlignment="Center" VerticalAlignment="Stretch" Margin="0 10 0 -8" StrokeThickness="1" Stroke="Red"></Rectangle> + <Thumb Opacity="0" DragDelta="DragAngle" DragStarted="DragStarted" Cursor="Arrow" DragCompleted="OnDragEnded"></Thumb> + </Grid> + + <Grid Width="10" Height="10" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="-8 -8 0 0"> + <Border BorderBrush="{Binding RelativeSource={RelativeSource AncestorType=local:ElementEditor},Path=CornersBrush,TargetNullValue={StaticResource CornersBrush},FallbackValue={StaticResource CornersBrush}}" BorderThickness="2 2 0 0"></Border> + <Thumb Opacity="0" DragDelta="DragTopLeft" DragStarted="DragStarted" Cursor="SizeNWSE" DragCompleted="OnDragEnded"></Thumb> + </Grid> + + <Grid Width="10" Height="10" HorizontalAlignment="Right" VerticalAlignment="Top" Margin="0 -8 -8 0"> + <Border BorderBrush="{Binding RelativeSource={RelativeSource AncestorType=local:ElementEditor},Path=CornersBrush,TargetNullValue={StaticResource CornersBrush},FallbackValue={StaticResource CornersBrush}}" BorderThickness="0 2 2 0"></Border> + <Thumb Opacity="0" DragDelta="DragTopRight" DragStarted="DragStarted" Cursor="SizeNESW" DragCompleted="OnDragEnded"></Thumb> + </Grid> + + <Grid Width="10" Height="10" HorizontalAlignment="Right" VerticalAlignment="Bottom" Margin="0 0 -8 -8"> + <Border BorderBrush="{Binding RelativeSource={RelativeSource AncestorType=local:ElementEditor},Path=CornersBrush,TargetNullValue={StaticResource CornersBrush},FallbackValue={StaticResource CornersBrush}}" BorderThickness="0 0 2 2"></Border> + <Thumb Opacity="0" DragDelta="DragBottomRight" DragStarted="DragStarted" Cursor="SizeNWSE" DragCompleted="OnDragEnded"></Thumb> + </Grid> + + <Grid Width="10" Height="10" HorizontalAlignment="Left" VerticalAlignment="Bottom" Margin="-8 0 0 -8"> + <Border BorderBrush="{Binding RelativeSource={RelativeSource AncestorType=local:ElementEditor},Path=CornersBrush,TargetNullValue={StaticResource CornersBrush},FallbackValue={StaticResource CornersBrush}}" BorderThickness="2 0 0 2"></Border> + <Thumb Opacity="0" DragDelta="DragBottomLeft" DragStarted="DragStarted" Cursor="SizeNESW" DragCompleted="OnDragEnded"></Thumb> + </Grid> + </Grid> + </Border> + </Grid> +</local:ElementEditor> 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 new file mode 100644 index 000000000..ef6e4c47c --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/DispenserElementEditor.xaml.cs @@ -0,0 +1,181 @@ +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Controls.Primitives; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Markup; +using System.Windows.Media; +using System.Windows.Media.Animation; +using System.Windows.Media.Imaging; +using System.Windows.Navigation; +using System.Windows.Shapes; +using Tango.Editors; +using Tango.Integration.Observables; +using Tango.MachineStudio.Technician.TechItems; + +namespace Tango.MachineStudio.Technician.Editors +{ + [ContentProperty("InnerContent")] + public partial class DispenserElementEditor : ElementEditor + { + /// <summary> + /// Initializes a new instance of the <see cref="MonitorElementEditor"/> class. + /// </summary> + public DispenserElementEditor() + : base() + { + InitializeComponent(); + } + + /// <summary> + /// Initializes a new instance of the <see cref="MonitorElementEditor"/> class. + /// </summary> + /// <param name="frameworkElement">The framework element.</param> + public DispenserElementEditor(DispenserItem dispenserItem) + : this() + { + DispenserItem = dispenserItem; + DataContext = DispenserItem; + } + + /// <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 DispenserElementEditor(DispenserItem monitorItem, Rect bounds) + : this(monitorItem) + { + Left = bounds.Left; + Top = bounds.Top; + Width = bounds.Width; + Height = bounds.Height; + } + + private DispenserItem _monitorItem; + + public DispenserItem DispenserItem + { + get { return _monitorItem; } + set + { + _monitorItem = value; RaisePropertyChanged(nameof(DispenserItem)); + + if (_monitorItem != null) + { + _monitorItem.HomingCompleted -= _monitorItem_HomingCompleted; + _monitorItem.HomingCompleted += _monitorItem_HomingCompleted; + } + } + } + + private void _monitorItem_HomingCompleted(object sender, EventArgs e) + { + StopAnimation(); + } + + + /// <summary> + /// Clones this instance. + /// </summary> + /// <returns></returns> + public override IElementEditor Clone() + { + try + { + var clonedItem = DispenserItem.Clone() as DispenserItem; + DispenserElementEditor cloned = new DispenserElementEditor(clonedItem); + cloned.Top = Top; + cloned.Left = Left; + cloned.Width = Width; + cloned.Height = Height; + cloned.Angle = Angle; + return cloned; + } + catch (Exception ex) + { + throw new InvalidOperationException("Could not clone this editor. You may have to create a custom editor and implement a custom Clone method.", ex); + } + } + + /// <summary> + /// Gets the hosted element. + /// </summary> + [ParameterIgnore] + public override Object HostedElement + { + get { return DispenserItem; } + } + + private void OnForwardPressed(object sender, MouseButtonEventArgs e) + { + DispenserItem.RaiseAction(MotorActionType.ForwardPressed); + AnimateRight(); + } + + private void OnForwardReleased(object sender, MouseButtonEventArgs e) + { + DispenserItem.RaiseAction(MotorActionType.ForwardReleased); + StopAnimation(); + } + + private void OnBackwardPressed(object sender, MouseButtonEventArgs e) + { + DispenserItem.RaiseAction(MotorActionType.BackwardPressed); + AnimateLeft(); + } + + private void OnBackwardReleased(object sender, MouseButtonEventArgs e) + { + DispenserItem.RaiseAction(MotorActionType.BackwardReleased); + StopAnimation(); + } + + private void OnHomingStarted(object sender, RoutedEventArgs e) + { + DispenserItem.RaiseAction(MotorActionType.HomingStarted); + AnimateLeft(); + } + + private void OnHomingStopped(object sender, RoutedEventArgs e) + { + DispenserItem.RaiseAction(MotorActionType.HomingStopped); + StopAnimation(); + } + + private void AnimateRight() + { + DoubleAnimation ani = new DoubleAnimation(); + ani.Duration = TimeSpan.FromSeconds(1); + ani.RepeatBehavior = RepeatBehavior.Forever; + ani.FillBehavior = FillBehavior.HoldEnd; + ani.To = 360; + propRotate.BeginAnimation(RotateTransform.AngleProperty, ani); + } + + private void AnimateLeft() + { + DoubleAnimation ani = new DoubleAnimation(); + ani.Duration = TimeSpan.FromSeconds(1); + ani.RepeatBehavior = RepeatBehavior.Forever; + ani.FillBehavior = FillBehavior.HoldEnd; + ani.To = -360; + propRotate.BeginAnimation(RotateTransform.AngleProperty, ani); + } + + public void StopAnimation() + { + this.Dispatcher.Invoke(() => + { + propRotate.BeginAnimation(RotateTransform.AngleProperty, null); + }); + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/MeterElementEditor.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/MeterElementEditor.xaml index 8a9345fa9..98ace7816 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/MeterElementEditor.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/MeterElementEditor.xaml @@ -3,6 +3,7 @@ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" + xmlns:sharedConverters="clr-namespace:Tango.SharedUI.Converters;assembly=Tango.SharedUI" xmlns:items="clr-namespace:Tango.MachineStudio.Technician.TechItems" xmlns:converters="clr-namespace:Tango.Editors.Converters;assembly=Tango.Editors" xmlns:visuals="clr-namespace:Tango.Visuals;assembly=Tango.Visuals" @@ -12,6 +13,7 @@ <UserControl.Resources> <converters:BoolToVisibilityConverter x:Key="BoolToVisibilityConverter"></converters:BoolToVisibilityConverter> + <sharedConverters:BooleanInverseConverter x:Key="BooleanInverseConverter" /> <!--Theme--> <SolidColorBrush x:Key="BorderBrush" Color="Transparent"></SolidColorBrush> @@ -26,13 +28,13 @@ <!--Content--> - <Grid> + <Grid IsHitTestVisible="{Binding RelativeSource={RelativeSource AncestorType=local:ElementsEditor},Path=IsEditable,Converter={StaticResource BooleanInverseConverter}}"> <Grid.RowDefinitions> <RowDefinition Height="221*"/> <RowDefinition Height="Auto"/> </Grid.RowDefinitions> - <visuals:VUMeter Width="Auto" Height="Auto" LedBackground="Silver" TicksCount="{Binding TicksCount}" TicksPlacement="{Binding TickPlacement}" LedCount="{Binding LedCount}" Orientation="Vertical" Margin="0 0 0 10" ShowTicksLabels="True" ShowTicksLines="True" EmulateOuterLight="True" SunkenLeds="True" Value="{Binding Value}" TicksMinimum="{Binding TechMonitor.Min}" TicksMaximum="{Binding TechMonitor.Max}" Minimum="{Binding TechMonitor.Min}" Maximum="{Binding TechMonitor.Max}"> + <visuals:VUMeter Width="Auto" Height="Auto" LedBackground="#383838" TicksCount="{Binding TicksCount}" TicksPlacement="{Binding TickPlacement}" LedCount="{Binding LedCount}" Orientation="Vertical" Margin="0 0 0 10" ShowTicksLabels="True" ShowTicksLines="True" EmulateOuterLight="True" SunkenLeds="True" Value="{Binding Value}" TicksMinimum="{Binding TechMonitor.Min}" TicksMaximum="{Binding TechMonitor.Max}" Minimum="{Binding TechMonitor.Min}" Maximum="{Binding TechMonitor.Max}"> <visuals:VUMeter.Foreground> <SolidColorBrush Color="{Binding Color}" /> </visuals:VUMeter.Foreground> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/MonitorElementEditor.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/MonitorElementEditor.xaml index 8e4520cc5..081a853bb 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/MonitorElementEditor.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/MonitorElementEditor.xaml @@ -5,12 +5,14 @@ xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:items="clr-namespace:Tango.MachineStudio.Technician.TechItems" xmlns:converters="clr-namespace:Tango.Editors.Converters;assembly=Tango.Editors" + xmlns:sharedConverters="clr-namespace:Tango.SharedUI.Converters;assembly=Tango.SharedUI" xmlns:local="clr-namespace:Tango.Editors;assembly=Tango.Editors" mc:Ignorable="d" d:DesignHeight="250" d:DesignWidth="300" Background="Transparent" ClipToBounds="False" BorderThickness="0" MinWidth="1" MinHeight="1" RenderTransformOrigin="0.5,0.5" d:DataContext="{d:DesignInstance Type=items:MonitorItem, IsDesignTimeCreatable=False}"> <UserControl.Resources> <converters:BoolToVisibilityConverter x:Key="BoolToVisibilityConverter"></converters:BoolToVisibilityConverter> + <sharedConverters:BooleanInverseConverter x:Key="BooleanInverseConverter" /> <!--Theme--> <SolidColorBrush x:Key="BorderBrush" Color="Transparent"></SolidColorBrush> @@ -25,7 +27,7 @@ <!--Content--> - <Grid> + <Grid IsHitTestVisible="{Binding RelativeSource={RelativeSource AncestorType=local:ElementsEditor},Path=IsEditable,Converter={StaticResource BooleanInverseConverter}}"> <Viewbox Stretch="Fill"> <StackPanel> <Grid Grid.Column="1" Grid.Row="1" Width="200" Height="120"> 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 bf7aaeff4..a69f81538 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 @@ -5,6 +5,7 @@ xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" xmlns:items="clr-namespace:Tango.MachineStudio.Technician.TechItems" + xmlns:sharedConverters="clr-namespace:Tango.SharedUI.Converters;assembly=Tango.SharedUI" xmlns:converters="clr-namespace:Tango.Editors.Converters;assembly=Tango.Editors" xmlns:visuals="clr-namespace:Tango.Visuals;assembly=Tango.Visuals" xmlns:local="clr-namespace:Tango.Editors;assembly=Tango.Editors" @@ -13,6 +14,7 @@ <UserControl.Resources> <converters:BoolToVisibilityConverter x:Key="BoolToVisibilityConverter"></converters:BoolToVisibilityConverter> + <sharedConverters:BooleanInverseConverter x:Key="BooleanInverseConverter" /> <!--Theme--> <SolidColorBrush x:Key="BorderBrush" Color="Transparent"></SolidColorBrush> @@ -20,10 +22,12 @@ <Grid x:Key="gridHoming"> <DockPanel> - <Button Click="OnHomingStopped" DockPanel.Dock="Right" Padding="0" Style="{StaticResource emptyButton}" VerticalAlignment="Center" Margin="0 0 5 0"> - <materialDesign:PackIcon Kind="Stop" Foreground="#FF5F5F" HorizontalAlignment="Center" VerticalAlignment="Center" Width="24" Height="24" /> + <Button Click="OnHomingStopped" DockPanel.Dock="Right" Padding="0" Style="{StaticResource MaterialDesignFlatButton}" VerticalAlignment="Center" Margin="0 0 5 0" ToolTip="Stop Homing"> + <materialDesign:PackIcon Kind="Stop" Foreground="#FF5F5F" HorizontalAlignment="Center" VerticalAlignment="Center" Width="32" Height="32" /> </Button> - <ProgressBar Maximum="{Binding HomingMaximumProgress}" Value="{Binding HomingProgress}" VerticalAlignment="Center" Height="10" Margin="5 0 5 0" Background="Transparent"></ProgressBar> + <ProgressBar Foreground="DimGray" BorderBrush="DimGray" Maximum="{Binding HomingMaximumProgress}" BorderThickness="1" Value="{Binding HomingProgress}" VerticalAlignment="Center" Height="10" Margin="5 0 5 0" Background="Transparent"> + + </ProgressBar> </DockPanel> </Grid> @@ -42,7 +46,7 @@ <Grid> - <Grid Margin="5"> + <Grid Margin="5" IsHitTestVisible="{Binding RelativeSource={RelativeSource AncestorType=local:ElementsEditor},Path=IsEditable,Converter={StaticResource BooleanInverseConverter}}"> <Grid.ColumnDefinitions> <ColumnDefinition Width="20*"/> <ColumnDefinition Width="100*"/> @@ -55,27 +59,35 @@ </Grid.RowDefinitions> <Grid Grid.Column="1"> - <Border BorderThickness="1" BorderBrush="Gainsboro" CornerRadius="5"> + <Border BorderThickness="1" BorderBrush="Gray" CornerRadius="5"> <Border.Background> <ImageBrush ImageSource="../Images/black-screen.jpg" Opacity="0.1" /> </Border.Background> - <Image RenderTransformOrigin="0.5,0.5" Margin="5" Source="../Images/prop.png" RenderOptions.BitmapScalingMode="Fant"> - <Image.RenderTransform> - <RotateTransform x:Name="propRotate" Angle="0" /> - </Image.RenderTransform> - </Image> + <Grid> + <Path RenderTransformOrigin="0.5,0.5" StrokeThickness="1" Stroke="Gray" Stretch="Uniform" Margin="5" Data="M500.633 211.454l-58.729-14.443c-3.53-11.133-8.071-21.929-13.55-32.256c8.818-14.678 27.349-45.571 27.349-45.571 c3.545-5.903 2.607-13.462-2.256-18.325l-42.422-42.422c-4.863-4.878-12.407-5.815-18.325-2.256L347.055 83.53 c-10.269-5.435-21.006-9.932-32.065-13.433l-14.443-58.729C298.876 4.688 292.885 0 286 0h-60 c-6.885 0-12.891 4.688-14.546 11.367c0 0-10.005 40.99-14.429 58.715c-11.792 3.735-23.188 8.584-34.043 14.502l-47.329-28.403 c-5.918-3.516-13.447-2.607-18.325 2.256l-42.422 42.422c-4.863 4.863-5.801 12.422-2.256 18.325l29.268 48.882 c-4.717 9.302-8.672 18.984-11.821 28.901l-58.729 14.487C4.688 213.124 0 219.115 0 226v60c0 6.885 4.688 12.891 11.367 14.546 l58.744 14.443c3.56 11.294 8.188 22.266 13.799 32.798l-26.191 43.652c-3.545 5.903-2.607 13.462 2.256 18.325l42.422 42.422 c4.849 4.849 12.407 5.771 18.325 2.256c0 0 29.37-17.607 43.755-26.221c10.415 5.552 21.313 10.137 32.549 13.696l14.429 58.715 C213.109 507.313 219.115 512 226 512h60c6.885 0 12.876-4.688 14.546-11.367l14.429-58.715 c11.558-3.662 22.69-8.394 33.281-14.136c14.78 8.862 44.443 26.66 44.443 26.66c5.903 3.53 13.462 2.622 18.325-2.256 l42.422-42.422c4.863-4.863 5.801-12.422 2.256-18.325l-26.968-44.927c5.317-10.093 9.727-20.654 13.169-31.523l58.729-14.443 C507.313 298.876 512 292.885 512 286v-60C512 219.115 507.313 213.124 500.633 211.454z M256 361c-57.891 0-105-47.109-105-105 s47.109-105 105-105s105 47.109 105 105S313.891 361 256 361z"> + <Path.Fill> + <LinearGradientBrush> + <GradientStop Color="Black"/> + <GradientStop Color="{Binding Color}" Offset="0.8"/> + </LinearGradientBrush> + </Path.Fill> + <Path.RenderTransform> + <RotateTransform x:Name="propRotate" Angle="0" /> + </Path.RenderTransform> + </Path> + </Grid> </Border> </Grid> <Grid> - <Border BorderBrush="Gainsboro" BorderThickness="1 1 0 1" Margin="0 10" CornerRadius="5 0 0 5" PreviewMouseDown="OnBackwardPressed" PreviewMouseUp="OnBackwardReleased"> + <Border BorderBrush="Gray" BorderThickness="1 1 0 1" Margin="0 10" CornerRadius="5 0 0 5" PreviewMouseDown="OnBackwardPressed" PreviewMouseUp="OnBackwardReleased"> <Border.Style> <Style TargetType="Border"> <Setter Property="Background"> <Setter.Value> <LinearGradientBrush EndPoint="1,0"> - <GradientStop Color="#515151" Offset="1" /> + <GradientStop Color="#AAAAAA" Offset="1" /> <GradientStop Color="#FFEEEEEE" Offset="0"/> </LinearGradientBrush> </Setter.Value> @@ -103,20 +115,20 @@ </Style> </Border.Style> - <Viewbox Stretch="Fill" Margin="-10 10"> + <Viewbox Stretch="Fill" Margin="-10 20"> <materialDesign:PackIcon Kind="ChevronLeft" HorizontalAlignment="Center" VerticalAlignment="Center" Width="24" Height="24" Foreground="#202020" /> </Viewbox> </Border> </Grid> <Grid Grid.Column="2"> - <Border BorderBrush="Gainsboro" BorderThickness="0 1 1 1" Margin="0 10" CornerRadius="0 10 10 0" PreviewMouseDown="OnForwardPressed" PreviewMouseUp="OnForwardReleased"> + <Border BorderBrush="Gray" BorderThickness="0 1 1 1" Margin="0 10" CornerRadius="0 10 10 0" PreviewMouseDown="OnForwardPressed" PreviewMouseUp="OnForwardReleased"> <Border.Style> <Style TargetType="Border"> <Setter Property="Background"> <Setter.Value> <LinearGradientBrush EndPoint="1,0"> - <GradientStop Color="#515151" Offset="0" /> + <GradientStop Color="#AAAAAA" Offset="0" /> <GradientStop Color="#FFEEEEEE" Offset="1"/> </LinearGradientBrush> </Setter.Value> @@ -144,7 +156,7 @@ </Style> </Border.Style> - <Viewbox Stretch="Fill" Margin="-10 10"> + <Viewbox Stretch="Fill" Margin="-10 20"> <materialDesign:PackIcon Kind="ChevronRight" HorizontalAlignment="Center" VerticalAlignment="Center" Width="24" Height="24" Foreground="#202020" /> </Viewbox> </Border> @@ -158,13 +170,13 @@ </Grid.ColumnDefinitions> <Grid Grid.Column="1"> - <Border BorderBrush="Gainsboro" BorderThickness="1 0 1 1" CornerRadius="0 0 10 10"> + <Border BorderBrush="Gray" BorderThickness="1 0 1 1" CornerRadius="0 0 20 20"> <Border.Style> <Style TargetType="Border"> <Setter Property="Background"> <Setter.Value> <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0"> - <GradientStop Color="#515151" Offset="1" /> + <GradientStop Color="#979797" Offset="1" /> <GradientStop Color="#FFEEEEEE" Offset="0"/> </LinearGradientBrush> </Setter.Value> @@ -220,7 +232,7 @@ <!--Content--> <Grid> <Border Margin="0 0 0 -23" VerticalAlignment="Bottom"> - <TextBlock Text="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=MonitorItem.TechMonitor.Description}" FontSize="14" Foreground="DimGray" HorizontalAlignment="Center"></TextBlock> + <TextBlock Text="{Binding TechMotor.Description}" FontSize="14" Foreground="DimGray" HorizontalAlignment="Center"></TextBlock> </Border> </Grid> <!--Content--> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/MultiGraphElementEditor.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/MultiGraphElementEditor.xaml index fd2db03e5..51bb3ff9c 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/MultiGraphElementEditor.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/MultiGraphElementEditor.xaml @@ -5,6 +5,7 @@ xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:controls="clr-namespace:Tango.MachineStudio.Common.Controls;assembly=Tango.MachineStudio.Common" xmlns:converters="clr-namespace:Tango.Editors.Converters;assembly=Tango.Editors" + xmlns:sharedConverters="clr-namespace:Tango.SharedUI.Converters;assembly=Tango.SharedUI" xmlns:items="clr-namespace:Tango.MachineStudio.Technician.TechItems" xmlns:local="clr-namespace:Tango.Editors;assembly=Tango.Editors" mc:Ignorable="d" @@ -12,6 +13,7 @@ <UserControl.Resources> <converters:BoolToVisibilityConverter x:Key="BoolToVisibilityConverter"></converters:BoolToVisibilityConverter> + <sharedConverters:BooleanInverseConverter x:Key="BooleanInverseConverter" /> <!--Theme--> <SolidColorBrush x:Key="BorderBrush" Color="Transparent"></SolidColorBrush> @@ -28,7 +30,7 @@ <!--Content--> <Grid> <!--<Viewbox Stretch="Fill">--> - <controls:RealTimeGraphMultiControl x:Name="InnerGraph" x:FieldModifier="public" EnableToolBar="False" SensorName="{Binding TechMonitor.Description}" SensorUnits="{Binding TechMonitor.Units}" Minimum="{Binding TechMonitor.Min}" Maximum="{Binding TechMonitor.Max}" /> + <controls:RealTimeGraphMultiControl x:Name="InnerGraph" IsHitTestVisible="{Binding RelativeSource={RelativeSource AncestorType=local:ElementsEditor},Path=IsEditable,Converter={StaticResource BooleanInverseConverter}}" x:FieldModifier="public" EnableToolBar="False" SensorName="{Binding TechMonitor.Description}" SensorUnits="{Binding TechMonitor.Units}" Minimum="{Binding TechMonitor.Min}" Maximum="{Binding TechMonitor.Max}" /> <!--</Viewbox>--> <Border Margin="0 0 0 -23" VerticalAlignment="Bottom"> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/SingleGraphElementEditor.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/SingleGraphElementEditor.xaml index aa0ec24e8..a0dd0f697 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/SingleGraphElementEditor.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/SingleGraphElementEditor.xaml @@ -5,6 +5,7 @@ xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:controls="clr-namespace:Tango.MachineStudio.Common.Controls;assembly=Tango.MachineStudio.Common" xmlns:converters="clr-namespace:Tango.Editors.Converters;assembly=Tango.Editors" + xmlns:sharedConverters="clr-namespace:Tango.SharedUI.Converters;assembly=Tango.SharedUI" xmlns:items="clr-namespace:Tango.MachineStudio.Technician.TechItems" xmlns:local="clr-namespace:Tango.Editors;assembly=Tango.Editors" mc:Ignorable="d" @@ -12,6 +13,7 @@ <UserControl.Resources> <converters:BoolToVisibilityConverter x:Key="BoolToVisibilityConverter"></converters:BoolToVisibilityConverter> + <sharedConverters:BooleanInverseConverter x:Key="BooleanInverseConverter" /> <!--Theme--> <SolidColorBrush x:Key="BorderBrush" Color="Transparent"></SolidColorBrush> @@ -28,7 +30,7 @@ <!--Content--> <Grid> <!--<Viewbox Stretch="Fill">--> - <controls:RealTimeGraphControl x:Name="InnerGraph" x:FieldModifier="public" EnableToolBar="False" SensorName="{Binding TechMonitor.Description}" Color="{Binding Color,Mode=TwoWay}" SensorUnits="{Binding TechMonitor.Units}" Minimum="{Binding TechMonitor.Min}" Maximum="{Binding TechMonitor.Max}" /> + <controls:RealTimeGraphControl x:Name="InnerGraph" IsHitTestVisible="{Binding RelativeSource={RelativeSource AncestorType=local:ElementsEditor},Path=IsEditable,Converter={StaticResource BooleanInverseConverter}}" x:FieldModifier="public" EnableToolBar="False" SensorName="{Binding TechMonitor.Description}" Color="{Binding Color,Mode=TwoWay}" SensorUnits="{Binding TechMonitor.Units}" Minimum="{Binding TechMonitor.Min}" Maximum="{Binding TechMonitor.Max}" /> <!--</Viewbox>--> <Border Margin="0 0 0 -23" VerticalAlignment="Bottom"> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Images/dispenser-big.png b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Images/dispenser-big.png Binary files differnew file mode 100644 index 000000000..284b1da0e --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Images/dispenser-big.png diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Images/dispenser-line.png b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Images/dispenser-line.png Binary files differnew file mode 100644 index 000000000..9e2e344c0 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Images/dispenser-line.png diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Images/volume.png b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Images/volume.png Binary files differnew file mode 100644 index 000000000..4f48f7528 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Images/volume.png diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/PropertiesTemplates/DispenserTemplate.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/PropertiesTemplates/DispenserTemplate.xaml new file mode 100644 index 000000000..0eca72dcd --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/PropertiesTemplates/DispenserTemplate.xaml @@ -0,0 +1,44 @@ +<UserControl x:Class="Tango.MachineStudio.Technician.PropertiesTemplates.DispenserTemplate" + 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" + xmlns:d="http://schemas.microsoft.com/expression/blend/2008" + xmlns:converters="clr-namespace:Tango.MachineStudio.Technician.Converters" + xmlns:items="clr-namespace:Tango.MachineStudio.Technician.TechItems" + xmlns:mahapps="http://metro.mahapps.com/winfx/xaml/controls" + 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:DispenserItem, IsDesignTimeCreatable=False}"> + + <UserControl.Resources> + <converters:MonitorsToSingleChannleMonitorsConverter x:Key="MonitorsToSingleChannleMonitorsConverter" /> + + <Style TargetType="{x:Type TabItem}" BasedOn="{StaticResource {x:Type TabItem}}"> + <Setter Property="mahapps:ControlsHelper.HeaderFontSize" Value="14" /> + <Setter Property="Margin" Value="2" /> + </Style> + </UserControl.Resources> + + <Grid> + <StackPanel> + <GroupBox Header="MOTOR"> + <StackPanel> + <TextBlock FontSize="10">Selected Motor</TextBlock> + <ComboBox Margin="0 5 0 0" ItemsSource="{Binding Adapter.TechDispensers}" SelectedItem="{Binding TechDispenser,Mode=TwoWay}" DisplayMemberPath="Description" /> + + <TextBlock FontSize="10" Margin="0 20 0 0"><Run>Speed</Run> <Run Text="{Binding Speed,StringFormat={}{0:N0} ms,FallbackValue=0}"></Run></TextBlock> + <Slider Margin="0 5 0 0" Minimum="1" Maximum="1000" Value="{Binding Speed,Mode=TwoWay}"></Slider> + </StackPanel> + </GroupBox> + + <GroupBox Header="COLOR" Margin="0 10 0 0"> + <StackPanel> + <Viewbox Margin="0 5 0 0"> + <colorPicker:ColorCanvas SelectedColor="{Binding Color,Mode=TwoWay}" Background="Transparent" /> + </Viewbox> + </StackPanel> + </GroupBox> + </StackPanel> + </Grid> +</UserControl> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/PropertiesTemplates/DispenserTemplate.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/PropertiesTemplates/DispenserTemplate.xaml.cs new file mode 100644 index 000000000..dd3a21b07 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/PropertiesTemplates/DispenserTemplate.xaml.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Navigation; +using System.Windows.Shapes; + +namespace Tango.MachineStudio.Technician.PropertiesTemplates +{ + /// <summary> + /// Interaction logic for MonitorTemplate.xaml + /// </summary> + public partial class DispenserTemplate : UserControl + { + public DispenserTemplate() + { + InitializeComponent(); + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/PropertiesTemplates/MotorTemplate.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/PropertiesTemplates/MotorTemplate.xaml new file mode 100644 index 000000000..0d92230ad --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/PropertiesTemplates/MotorTemplate.xaml @@ -0,0 +1,44 @@ +<UserControl x:Class="Tango.MachineStudio.Technician.PropertiesTemplates.MotorTemplate" + 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" + xmlns:d="http://schemas.microsoft.com/expression/blend/2008" + xmlns:converters="clr-namespace:Tango.MachineStudio.Technician.Converters" + xmlns:items="clr-namespace:Tango.MachineStudio.Technician.TechItems" + xmlns:mahapps="http://metro.mahapps.com/winfx/xaml/controls" + 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:MotorItem, IsDesignTimeCreatable=False}"> + + <UserControl.Resources> + <converters:MonitorsToSingleChannleMonitorsConverter x:Key="MonitorsToSingleChannleMonitorsConverter" /> + + <Style TargetType="{x:Type TabItem}" BasedOn="{StaticResource {x:Type TabItem}}"> + <Setter Property="mahapps:ControlsHelper.HeaderFontSize" Value="14" /> + <Setter Property="Margin" Value="2" /> + </Style> + </UserControl.Resources> + + <Grid> + <StackPanel> + <GroupBox Header="MOTOR"> + <StackPanel> + <TextBlock FontSize="10">Selected Motor</TextBlock> + <ComboBox Margin="0 5 0 0" ItemsSource="{Binding Adapter.TechMotors}" SelectedItem="{Binding TechMotor,Mode=TwoWay}" DisplayMemberPath="Description" /> + + <TextBlock FontSize="10" Margin="0 20 0 0"><Run>Speed</Run> <Run Text="{Binding Speed,StringFormat={}{0:N0} ms,FallbackValue=0}"></Run></TextBlock> + <Slider Margin="0 5 0 0" Minimum="1" Maximum="1000" Value="{Binding Speed,Mode=TwoWay}"></Slider> + </StackPanel> + </GroupBox> + + <GroupBox Header="COLOR" Margin="0 10 0 0"> + <StackPanel> + <Viewbox Margin="0 5 0 0"> + <colorPicker:ColorCanvas SelectedColor="{Binding Color,Mode=TwoWay}" Background="Transparent" /> + </Viewbox> + </StackPanel> + </GroupBox> + </StackPanel> + </Grid> +</UserControl> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/PropertiesTemplates/MotorTemplate.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/PropertiesTemplates/MotorTemplate.xaml.cs new file mode 100644 index 000000000..3ac58ce5d --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/PropertiesTemplates/MotorTemplate.xaml.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Navigation; +using System.Windows.Shapes; + +namespace Tango.MachineStudio.Technician.PropertiesTemplates +{ + /// <summary> + /// Interaction logic for MonitorTemplate.xaml + /// </summary> + public partial class MotorTemplate : UserControl + { + public MotorTemplate() + { + InitializeComponent(); + } + } +} 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 0f92b6275..34208aded 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 @@ -60,6 +60,22 @@ </Reference> <Reference Include="System" /> <Reference Include="System.Data" /> + <Reference Include="System.Reactive.Core, Version=3.0.3000.0, Culture=neutral, PublicKeyToken=94bc3704cddfc263, processorArchitecture=MSIL"> + <HintPath>..\..\..\packages\System.Reactive.Core.3.1.1\lib\net46\System.Reactive.Core.dll</HintPath> + </Reference> + <Reference Include="System.Reactive.Interfaces, Version=3.0.1000.0, Culture=neutral, PublicKeyToken=94bc3704cddfc263, processorArchitecture=MSIL"> + <HintPath>..\..\..\packages\System.Reactive.Interfaces.3.1.1\lib\net45\System.Reactive.Interfaces.dll</HintPath> + </Reference> + <Reference Include="System.Reactive.Linq, Version=3.0.3000.0, Culture=neutral, PublicKeyToken=94bc3704cddfc263, processorArchitecture=MSIL"> + <HintPath>..\..\..\packages\System.Reactive.Linq.3.1.1\lib\net46\System.Reactive.Linq.dll</HintPath> + </Reference> + <Reference Include="System.Reactive.PlatformServices, Version=3.0.3000.0, Culture=neutral, PublicKeyToken=94bc3704cddfc263, processorArchitecture=MSIL"> + <HintPath>..\..\..\packages\System.Reactive.PlatformServices.3.1.1\lib\net46\System.Reactive.PlatformServices.dll</HintPath> + </Reference> + <Reference Include="System.Reactive.Windows.Threading, Version=3.0.1000.0, Culture=neutral, PublicKeyToken=94bc3704cddfc263, processorArchitecture=MSIL"> + <HintPath>..\..\..\packages\System.Reactive.Windows.Threading.3.1.1\lib\net45\System.Reactive.Windows.Threading.dll</HintPath> + </Reference> + <Reference Include="System.Windows" /> <Reference Include="System.Windows.Interactivity, Version=4.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> <HintPath>..\..\..\packages\MvvmLightLibs.5.3.0.0\lib\net45\System.Windows.Interactivity.dll</HintPath> </Reference> @@ -81,6 +97,9 @@ <Compile Include="Converters\MonitorsToSingleChannleMonitorsConverter.cs" /> <Compile Include="Converters\SecondsToGraphPointsConverter.cs" /> <Compile Include="Converters\TransitionLinkConverter.cs" /> + <Compile Include="Editors\DispenserElementEditor.xaml.cs"> + <DependentUpon>DispenserElementEditor.xaml</DependentUpon> + </Compile> <Compile Include="Editors\MotorElementEditor.xaml.cs"> <DependentUpon>MotorElementEditor.xaml</DependentUpon> </Compile> @@ -100,6 +119,12 @@ <Compile Include="PropertiesTemplates\MeterTemplate.xaml.cs"> <DependentUpon>MeterTemplate.xaml</DependentUpon> </Compile> + <Compile Include="PropertiesTemplates\DispenserTemplate.xaml.cs"> + <DependentUpon>DispenserTemplate.xaml</DependentUpon> + </Compile> + <Compile Include="PropertiesTemplates\MotorTemplate.xaml.cs"> + <DependentUpon>MotorTemplate.xaml</DependentUpon> + </Compile> <Compile Include="PropertiesTemplates\MonitorTemplate.xaml.cs"> <DependentUpon>MonitorTemplate.xaml</DependentUpon> </Compile> @@ -111,6 +136,7 @@ </Compile> <Compile Include="TechItems\MeterItem.cs" /> <Compile Include="TechItems\MotorActionType.cs" /> + <Compile Include="TechItems\DispenserItem.cs" /> <Compile Include="TechItems\MotorItem.cs" /> <Compile Include="TechItems\MultiGraphItem.cs" /> <Compile Include="TechItems\SingleGraphItem.cs" /> @@ -141,6 +167,10 @@ <Compile Include="..\..\..\Versioning\GlobalVersionInfo.cs"> <Link>GlobalVersionInfo.cs</Link> </Compile> + <Page Include="Editors\DispenserElementEditor.xaml"> + <Generator>MSBuild:Compile</Generator> + <SubType>Designer</SubType> + </Page> <Page Include="Editors\MotorElementEditor.xaml"> <Generator>MSBuild:Compile</Generator> <SubType>Designer</SubType> @@ -165,6 +195,14 @@ <Generator>MSBuild:Compile</Generator> <SubType>Designer</SubType> </Page> + <Page Include="PropertiesTemplates\DispenserTemplate.xaml"> + <Generator>MSBuild:Compile</Generator> + <SubType>Designer</SubType> + </Page> + <Page Include="PropertiesTemplates\MotorTemplate.xaml"> + <Generator>MSBuild:Compile</Generator> + <SubType>Designer</SubType> + </Page> <Page Include="PropertiesTemplates\MonitorTemplate.xaml"> <SubType>Designer</SubType> <Generator>MSBuild:Compile</Generator> @@ -311,5 +349,14 @@ <ItemGroup> <Resource Include="Images\engine.png" /> </ItemGroup> + <ItemGroup> + <Resource Include="Images\dispenser-line.png" /> + </ItemGroup> + <ItemGroup> + <Resource Include="Images\dispenser-big.png" /> + </ItemGroup> + <ItemGroup> + <Resource Include="Images\volume.png" /> + </ItemGroup> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> </Project>
\ No newline at end of file diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/DispenserItem.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/DispenserItem.cs new file mode 100644 index 000000000..3cea8d127 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/DispenserItem.cs @@ -0,0 +1,127 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Media; +using System.Xml.Serialization; +using Tango.Core.Commands; +using Tango.Integration.Observables; +using Tango.SharedUI.Helpers; + +namespace Tango.MachineStudio.Technician.TechItems +{ + public class DispenserItem : TechItem + { + public event EventHandler<MotorActionType> ActionExecuted; + public event EventHandler HomingCompleted; + + private TechDispenser _techDispenser; + [XmlIgnore] + public TechDispenser TechDispenser + { + get { return _techDispenser; } + set { _techDispenser = value; RaisePropertyChangedAuto(); RaisePropertyChanged(nameof(Data)); } + } + + private bool _isHoming; + [XmlIgnore] + public bool IsHoming + { + get { return _isHoming; } + set + { + _isHoming = value; + RaisePropertyChangedAuto(); + } + } + + private bool _isHomingCompleted; + + public bool IsHomingCompleted + { + get { return _isHomingCompleted; } + set + { + _isHomingCompleted = value; + RaisePropertyChangedAuto(); + + if (value) + { + HomingCompleted?.Invoke(this, new EventArgs()); + } + } + } + + private double _homingProgress; + [XmlIgnore] + public double HomingProgress + { + get { return _homingProgress; } + set + { + _homingProgress = value; + RaisePropertyChangedAuto(); + } + } + + private double _homingMaximumProgress; + [XmlIgnore] + public double HomingMaximumProgress + { + get { return _homingMaximumProgress; } + set { _homingMaximumProgress = value; RaisePropertyChangedAuto(); } + } + + private bool _isForwardPressed; + [XmlIgnore] + public bool IsForwardPressed + { + get { return _isForwardPressed; } + set { _isForwardPressed = value; RaisePropertyChangedAuto(); } + } + + private bool _isBackwardPressed; + [XmlIgnore] + public bool IsBackwardPressed + { + get { return _isBackwardPressed; } + set { _isBackwardPressed = value; RaisePropertyChangedAuto(); } + } + + private double _speed; + public double Speed + { + get { return _speed; } + set { _speed = value; RaisePropertyChangedAuto(); } + } + + + public override object Data => TechDispenser; + + public DispenserItem() : base() + { + Name = "Dispenser"; + Description = "Dispenser Controller"; + Image = ResourceHelper.GetImageFromResources("Images/dispenser-big.png"); + Color = Colors.White; + } + + public DispenserItem(TechDispenser techDispenser) : this() + { + TechDispenser = techDispenser; + } + + public override TechItem Clone() + { + DispenserItem cloned = base.Clone() as DispenserItem; + cloned.TechDispenser = TechDispenser; + return cloned; + } + + public void RaiseAction(MotorActionType action) + { + ActionExecuted?.Invoke(this, action); + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/MeterItem.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/MeterItem.cs index 9d4fd9d60..7cc2913eb 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/MeterItem.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/MeterItem.cs @@ -67,7 +67,7 @@ namespace Tango.MachineStudio.Technician.TechItems { Name = "VU Monitor"; Description = "VU Meter monitor"; - Image = ResourceHelper.GetImageFromResources("Images/analog.png"); + Image = ResourceHelper.GetImageFromResources("Images/volume.png"); LastUpdateTime = DateTime.Now; UpdateInterval = 10; LedCount = 14; diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/MotorItem.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/MotorItem.cs index a7088ac3f..272aedf44 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/MotorItem.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/MotorItem.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; +using System.Windows.Media; using System.Xml.Serialization; using Tango.Core.Commands; using Tango.Integration.Observables; @@ -88,6 +89,14 @@ namespace Tango.MachineStudio.Technician.TechItems set { _isBackwardPressed = value; RaisePropertyChangedAuto(); } } + private double _speed; + public double Speed + { + get { return _speed; } + set { _speed = value; RaisePropertyChangedAuto(); } + } + + public override object Data => TechMotor; public MotorItem() : base() @@ -95,6 +104,7 @@ namespace Tango.MachineStudio.Technician.TechItems Name = "Motor"; Description = "Motor Controller"; Image = ResourceHelper.GetImageFromResources("Images/engine.png"); + Color = Colors.White; } public MotorItem(TechMotor techMotor) : this() 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 7bed3f441..8ed8a4a80 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 @@ -253,6 +253,13 @@ namespace Tango.MachineStudio.Technician.ViewModels Elements.Add(editor); InitMotorItem(motorItem); } + else if (SelectedTechItem is DispenserItem) + { + var dispenserItem = new DispenserItem(Adapter.TechDispensers.FirstOrDefault()); + DispenserElementEditor editor = new DispenserElementEditor(dispenserItem, bounds); + Elements.Add(editor); + InitDispenserItem(dispenserItem); + } } public void OnElementsRemoved(List<IElementEditor> elements) @@ -319,56 +326,139 @@ namespace Tango.MachineStudio.Technician.ViewModels { item.ActionExecuted += async (x, action) => { - if (action == MotorActionType.HomingStarted) + if (action == MotorActionType.ForwardPressed) + { + await MachineOperator.StartMotorJogging(new MotorJoggingRequest() + { + Code = item.TechMotor.Code, + Direction = MotorDirection.Forward, + }); + } + else if (action == MotorActionType.ForwardReleased) + { + await MachineOperator.StopMotorJogging(new MotorAbortJoggingRequest() + { + Code = item.TechMotor.Code, + }); + } + else if (action == MotorActionType.BackwardPressed) + { + await MachineOperator.StartMotorJogging(new MotorJoggingRequest() + { + Code = item.TechMotor.Code, + Direction = MotorDirection.Backward, + }); + } + else if (action == MotorActionType.BackwardReleased) + { + await MachineOperator.StopMotorJogging(new MotorAbortJoggingRequest() + { + Code = item.TechMotor.Code, + }); + } + else if (action == MotorActionType.HomingStarted) { item.HomingProgress = 0; item.IsHoming = true; item.IsHomingCompleted = false; - await Task.Factory.StartNew(() => + MachineOperator.StartMotorHoming(new MotorHomingRequest() + { + Code = item.TechMotor.Code + }) + .Subscribe((response) => { - for (int i = 0; i < 101; i++) - { - item.HomingMaximumProgress = 100; - item.HomingProgress++; - Thread.Sleep(60); - } + item.HomingMaximumProgress = response.Message.MaxProgress; + item.HomingProgress = response.Message.Progress; + + }, () => + { item.IsHoming = false; item.IsHomingCompleted = true; + }); } - else if (action == MotorActionType.ForwardPressed) + else if (action == MotorActionType.HomingStopped) { - await MachineOperator.StartMotorJogging(new MotorJoggingRequest() + await MachineOperator.StopMotorHoming(new MotorAbortHomingRequest() { Code = item.TechMotor.Code, + }); + + item.IsHoming = false; + } + }; + } + + private void InitDispenserItem(DispenserItem item) + { + item.ActionExecuted += async (x, action) => + { + if (action == MotorActionType.ForwardPressed) + { + await MachineOperator.StartDispenserJogging(new DispenserJoggingRequest() + { + Code = item.TechDispenser.Code, Direction = MotorDirection.Forward, }); } else if (action == MotorActionType.ForwardReleased) { - await MachineOperator.StopMotorJogging(new MotorAbortJoggingRequest() + await MachineOperator.StopDispenserJogging(new DispenserAbortJoggingRequest() { - Code = item.TechMotor.Code, + Code = item.TechDispenser.Code, }); } else if (action == MotorActionType.BackwardPressed) { - await MachineOperator.StartMotorJogging(new MotorJoggingRequest() + await MachineOperator.StartDispenserJogging(new DispenserJoggingRequest() { - Code = item.TechMotor.Code, + Code = item.TechDispenser.Code, Direction = MotorDirection.Backward, }); } else if (action == MotorActionType.BackwardReleased) { - await MachineOperator.StopMotorJogging(new MotorAbortJoggingRequest() + await MachineOperator.StopDispenserJogging(new DispenserAbortJoggingRequest() { - Code = item.TechMotor.Code, + Code = item.TechDispenser.Code, + }); + } + else if (action == MotorActionType.HomingStarted) + { + item.HomingProgress = 0; + item.IsHoming = true; + item.IsHomingCompleted = false; + + MachineOperator.StartDispenserHoming(new DispenserHomingRequest() + { + Code = item.TechDispenser.Code + }) + .Subscribe((response) => + { + + item.HomingMaximumProgress = response.Message.MaxProgress; + item.HomingProgress = response.Message.Progress; + + }, () => + { + + item.IsHoming = false; + item.IsHomingCompleted = true; + }); } + else if (action == MotorActionType.HomingStopped) + { + await MachineOperator.StopDispenserHoming(new DispenserAbortHomingRequest() + { + Code = item.TechDispenser.Code, + }); + + item.IsHoming = false; + } }; } } 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 7cdd92e06..9e3970719 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 @@ -50,15 +50,38 @@ </ListBox.ItemsPanel> <ListBox.ItemTemplate> <DataTemplate DataType="{x:Type techItems:TechItem}"> - <Border Cursor="Hand" ToolTip="{Binding Description}" Width="70" Padding="10" Margin="5" Height="70" BorderThickness="1" CornerRadius="100"> + <Border Cursor="Hand" ToolTip="{Binding Description}" RenderTransformOrigin="0.5,0.5" Width="70" Padding="10" Margin="5" Height="70" BorderThickness="1" CornerRadius="100"> <Border.Style> <Style TargetType="Border"> + <Setter Property="RenderTransform"> + <Setter.Value> + <ScaleTransform ScaleX="1" ScaleY="1"></ScaleTransform> + </Setter.Value> + </Setter> <Setter Property="Background" Value="Transparent"></Setter> <Setter Property="BorderBrush" Value="{StaticResource AccentColorBrush}"></Setter> + <Setter Property="BorderThickness" Value="1"></Setter> <Style.Triggers> <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType=ListBoxItem},Path=IsSelected}" Value="True"> - <Setter Property="Background" Value="#F9F9F9"></Setter> + <Setter Property="Background" Value="White"></Setter> <Setter Property="BorderBrush" Value="#FF7575"></Setter> + <Setter Property="BorderThickness" Value="2"></Setter> + <DataTrigger.EnterActions> + <BeginStoryboard> + <Storyboard> + <DoubleAnimation Storyboard.TargetProperty="RenderTransform.ScaleX" To="1.1" Duration="00:00:0.2"></DoubleAnimation> + <DoubleAnimation Storyboard.TargetProperty="RenderTransform.ScaleY" To="1.1" Duration="00:00:0.2"></DoubleAnimation> + </Storyboard> + </BeginStoryboard> + </DataTrigger.EnterActions> + <DataTrigger.ExitActions> + <BeginStoryboard> + <Storyboard> + <DoubleAnimation Storyboard.TargetProperty="RenderTransform.ScaleX" To="1" Duration="00:00:0.2"></DoubleAnimation> + <DoubleAnimation Storyboard.TargetProperty="RenderTransform.ScaleY" To="1" Duration="00:00:0.2"></DoubleAnimation> + </Storyboard> + </BeginStoryboard> + </DataTrigger.ExitActions> </DataTrigger> </Style.Triggers> </Style> @@ -177,6 +200,12 @@ <DataTemplate DataType="{x:Type items:MonitorItem}"> <templates:MonitorTemplate/> </DataTemplate> + <DataTemplate DataType="{x:Type items:DispenserItem}"> + <templates:DispenserTemplate/> + </DataTemplate> + <DataTemplate DataType="{x:Type items:MotorItem}"> + <templates:MotorTemplate/> + </DataTemplate> <DataTemplate DataType="{x:Type items:MeterItem}"> <templates:MeterTemplate/> </DataTemplate> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/packages.config b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/packages.config index 1d449350a..61695a8c5 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/packages.config +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/packages.config @@ -7,4 +7,10 @@ <package id="MaterialDesignColors" version="1.1.2" targetFramework="net46" /> <package id="MaterialDesignThemes" version="2.3.1.953" targetFramework="net46" /> <package id="MvvmLightLibs" version="5.3.0.0" targetFramework="net46" /> + <package id="System.Reactive" version="3.1.1" targetFramework="net46" /> + <package id="System.Reactive.Core" version="3.1.1" targetFramework="net46" /> + <package id="System.Reactive.Interfaces" version="3.1.1" targetFramework="net46" /> + <package id="System.Reactive.Linq" version="3.1.1" targetFramework="net46" /> + <package id="System.Reactive.PlatformServices" version="3.1.1" targetFramework="net46" /> + <package id="System.Reactive.Windows.Threading" version="3.1.1" targetFramework="net46" /> </packages>
\ No newline at end of file diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Controls/RealTimeGraphControl.xaml b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Controls/RealTimeGraphControl.xaml index 8c364dde9..2f43869d5 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Controls/RealTimeGraphControl.xaml +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Controls/RealTimeGraphControl.xaml @@ -53,7 +53,7 @@ <Grid> <!--Temperature--> - <ContentControl Style="{StaticResource graphContent}" Margin="0 0 5 5" MinHeight="5"> + <ContentControl Style="{StaticResource graphContent}" Margin="0 0 0 0" MinHeight="5"> <Grid> <Grid.ColumnDefinitions> <ColumnDefinition Width="40"/> diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Controls/RealTimeGraphMultiControl.xaml b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Controls/RealTimeGraphMultiControl.xaml index 2055e282c..5548c452e 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Controls/RealTimeGraphMultiControl.xaml +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Controls/RealTimeGraphMultiControl.xaml @@ -53,7 +53,7 @@ <Grid> <!--Temperature--> - <ContentControl Style="{StaticResource graphContent}" Margin="0 0 5 5" MinHeight="5"> + <ContentControl Style="{StaticResource graphContent}" Margin="0 0 0 0" MinHeight="5"> <Grid> <Grid.ColumnDefinitions> <ColumnDefinition Width="40"/> diff --git a/Software/Visual_Studio/Tango.Core/ExtensionMethods/ObjectExtensions.cs b/Software/Visual_Studio/Tango.Core/ExtensionMethods/ObjectExtensions.cs index 88403f8a6..82bcaa9d4 100644 --- a/Software/Visual_Studio/Tango.Core/ExtensionMethods/ObjectExtensions.cs +++ b/Software/Visual_Studio/Tango.Core/ExtensionMethods/ObjectExtensions.cs @@ -1,4 +1,5 @@ -using System; +using Newtonsoft.Json; +using System; using System.Collections.Generic; using System.IO; using System.Linq; @@ -49,4 +50,14 @@ public static class ObjectExtensions } } } + + /// <summary> + /// Serializes the specified object to indented json string. + /// </summary> + /// <param name="obj">The object.</param> + /// <returns></returns> + public static String ToJsonString(this Object obj) + { + return JsonConvert.SerializeObject(obj, Formatting.Indented); + } } diff --git a/Software/Visual_Studio/Tango.Core/Tango.Core.csproj b/Software/Visual_Studio/Tango.Core/Tango.Core.csproj index da33c3f0a..e9d96417b 100644 --- a/Software/Visual_Studio/Tango.Core/Tango.Core.csproj +++ b/Software/Visual_Studio/Tango.Core/Tango.Core.csproj @@ -46,6 +46,9 @@ <Reference Include="Microsoft.Practices.ServiceLocation, Version=1.3.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> <HintPath>..\packages\CommonServiceLocator.1.3\lib\portable-net4+sl5+netcore45+wpa81+wp8\Microsoft.Practices.ServiceLocation.dll</HintPath> </Reference> + <Reference Include="Newtonsoft.Json, Version=10.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL"> + <HintPath>..\packages\Newtonsoft.Json.10.0.3\lib\net45\Newtonsoft.Json.dll</HintPath> + </Reference> <Reference Include="PresentationCore" /> <Reference Include="PresentationFramework" /> <Reference Include="SimpleValidator, Version=0.6.1.0, Culture=neutral, processorArchitecture=MSIL"> diff --git a/Software/Visual_Studio/Tango.Core/packages.config b/Software/Visual_Studio/Tango.Core/packages.config index 114eefdba..bb569f026 100644 --- a/Software/Visual_Studio/Tango.Core/packages.config +++ b/Software/Visual_Studio/Tango.Core/packages.config @@ -3,5 +3,6 @@ <package id="CommonServiceLocator" version="1.3" targetFramework="net46" /> <package id="Google.Protobuf" version="3.4.1" targetFramework="net45" /> <package id="MvvmLightLibs" version="5.3.0.0" targetFramework="net46" /> + <package id="Newtonsoft.Json" version="10.0.3" targetFramework="net46" /> <package id="SimpleValidator" version="0.6.1.0" targetFramework="net46" /> </packages>
\ No newline at end of file diff --git a/Software/Visual_Studio/Tango.Emulations/Emulators/MachineEmulator.cs b/Software/Visual_Studio/Tango.Emulations/Emulators/MachineEmulator.cs index cbda54d56..5e76c2d1b 100644 --- a/Software/Visual_Studio/Tango.Emulations/Emulators/MachineEmulator.cs +++ b/Software/Visual_Studio/Tango.Emulations/Emulators/MachineEmulator.cs @@ -30,6 +30,9 @@ namespace Tango.Emulations.Emulators private PushDiagnosticsRequest _diagnosticsRequest; private bool _cancelJob; private List<int> _motorJoggingRequestCodes; + private List<int> _motorHomingRequestCodes; + private List<int> _dispenserJoggingRequestCodes; + private List<int> _dispenserHomingRequestCodes; private double _graphAmplitude; private double _graphFrequency; @@ -53,9 +56,16 @@ namespace Tango.Emulations.Emulators Init(); } + #endregion + + #region Private Methods + private void Init() { _motorJoggingRequestCodes = new List<int>(); + _motorHomingRequestCodes = new List<int>(); + _dispenserJoggingRequestCodes = new List<int>(); + _dispenserHomingRequestCodes = new List<int>(); ResetGraphFactors(); } @@ -99,6 +109,24 @@ namespace Tango.Emulations.Emulators case MessageType.MotorAbortJoggingRequest: HandleAbortMotorJoggingRequest(MessageFactory.ParseTangoMessageFromContainer<MotorAbortJoggingRequest>(container)); break; + case MessageType.MotorHomingRequest: + HandleMotorHomingRequest(MessageFactory.ParseTangoMessageFromContainer<MotorHomingRequest>(container)); + break; + case MessageType.MotorAbortHomingRequest: + HandleAbortMotorHomingRequest(MessageFactory.ParseTangoMessageFromContainer<MotorAbortHomingRequest>(container)); + break; + case MessageType.DispenserJoggingRequest: + HandleDispenserJoggingRequest(MessageFactory.ParseTangoMessageFromContainer<DispenserJoggingRequest>(container)); + break; + case MessageType.DispenserAbortJoggingRequest: + HandleAbortDispenserJoggingRequest(MessageFactory.ParseTangoMessageFromContainer<DispenserAbortJoggingRequest>(container)); + break; + case MessageType.DispenserHomingRequest: + HandleDispenserHomingRequest(MessageFactory.ParseTangoMessageFromContainer<DispenserHomingRequest>(container)); + break; + case MessageType.DispenserAbortHomingRequest: + HandleAbortDispenserHomingRequest(MessageFactory.ParseTangoMessageFromContainer<DispenserAbortHomingRequest>(container)); + break; } } @@ -135,6 +163,8 @@ namespace Tango.Emulations.Emulators private void HandlePushDiagnosticsRequest(TangoMessage<PushDiagnosticsRequest> request) { + LogManager.Log("Push diagnostics request received " + Environment.NewLine + request.Message.ToJsonString()); + _diagnosticsRequest = request.Message; int value = 0; @@ -199,7 +229,7 @@ namespace Tango.Emulations.Emulators { JobTicket job = request.Message.JobTicket; - LogManager.Log("Job request received: " + Environment.NewLine + job.ToString()); + LogManager.Log("Job request received: " + Environment.NewLine + job.ToJsonString()); double progress = 0; _cancelJob = false; @@ -246,24 +276,25 @@ namespace Tango.Emulations.Emulators _motorJoggingRequestCodes.Add(jogRequest.Code); - LogManager.Log("Motor jogging request received: " + Environment.NewLine + jogRequest.ToString()); + LogManager.Log("Motor jogging request received: " + Environment.NewLine + jogRequest.ToJsonString()); - Task.Factory.StartNew(() => + Task.Factory.StartNew(() => { while (_motorJoggingRequestCodes.Contains(jogRequest.Code)) { - if (jogRequest.Direction == MotorDirection.Forward) { - _graphFrequency += 0.1; + _graphFrequency = 10; } else { - _graphFrequency -= 0.1; + _graphFrequency = 18; } Thread.Sleep(30); } + + ResetGraphFactors(); }); Transporter.SendResponse<MotorJoggingResponse>(new MotorJoggingResponse(), request.Container.Token); @@ -271,12 +302,128 @@ namespace Tango.Emulations.Emulators private void HandleAbortMotorJoggingRequest(TangoMessage<MotorAbortJoggingRequest> request) { - LogManager.Log("Abort motor jogging request received: " + Environment.NewLine + request.Message.ToString()); - _motorJoggingRequestCodes.Remove(request.Message.Code); + LogManager.Log("Abort motor jogging request received: " + Environment.NewLine + request.Message.ToJsonString()); + _motorJoggingRequestCodes.RemoveAll(x => x == request.Message.Code); ResetGraphFactors(); Transporter.SendResponse<MotorAbortJoggingResponse>(new MotorAbortJoggingResponse(), request.Container.Token); } + private void HandleMotorHomingRequest(TangoMessage<MotorHomingRequest> request) + { + var homeRequest = request.Message; + + LogManager.Log("Motor homing request received: " + Environment.NewLine + homeRequest.ToJsonString()); + + _motorHomingRequestCodes.Add(homeRequest.Code); + + Task.Factory.StartNew(() => + { + _graphFrequency = 10; + + for (int i = 0; i < 100; i++) + { + Transporter.SendResponse<MotorHomingResponse>(new MotorHomingResponse() { MaxProgress = 100, Progress = i }, request.Container.Token); + + if (!_motorHomingRequestCodes.Contains(homeRequest.Code)) + { + ResetGraphFactors(); + return; + } + + Thread.Sleep(30); + } + + Transporter.SendResponse<MotorHomingResponse>(new MotorHomingResponse() { MaxProgress = 100, Progress = 100 }, request.Container.Token, true); + _motorHomingRequestCodes.Remove(homeRequest.Code); + ResetGraphFactors(); + }); + } + + private void HandleAbortMotorHomingRequest(TangoMessage<MotorAbortHomingRequest> request) + { + LogManager.Log("Abort motor homing request received: " + Environment.NewLine + request.Message.ToJsonString()); + _motorHomingRequestCodes.RemoveAll(x => x == request.Message.Code); + ResetGraphFactors(); + Transporter.SendResponse<MotorAbortHomingResponse>(new MotorAbortHomingResponse(), request.Container.Token); + } + + private void HandleDispenserJoggingRequest(TangoMessage<DispenserJoggingRequest> request) + { + var jogRequest = request.Message; + + _dispenserJoggingRequestCodes.Add(jogRequest.Code); + + LogManager.Log("Dispenser jogging request received: " + Environment.NewLine + jogRequest.ToJsonString()); + + Task.Factory.StartNew(() => + { + while (_dispenserJoggingRequestCodes.Contains(jogRequest.Code)) + { + if (jogRequest.Direction == MotorDirection.Forward) + { + _graphFrequency = 10; + } + else + { + _graphFrequency = 18; + } + + Thread.Sleep(30); + } + + ResetGraphFactors(); + }); + + Transporter.SendResponse<DispenserJoggingResponse>(new DispenserJoggingResponse(), request.Container.Token); + } + + private void HandleAbortDispenserJoggingRequest(TangoMessage<DispenserAbortJoggingRequest> request) + { + LogManager.Log("Abort dispenser jogging request received: " + Environment.NewLine + request.Message.ToJsonString()); + _dispenserJoggingRequestCodes.RemoveAll(x => x == request.Message.Code); + ResetGraphFactors(); + Transporter.SendResponse<DispenserAbortJoggingResponse>(new DispenserAbortJoggingResponse(), request.Container.Token); + } + + private void HandleDispenserHomingRequest(TangoMessage<DispenserHomingRequest> request) + { + var homeRequest = request.Message; + + LogManager.Log("Dispenser homing request received: " + Environment.NewLine + homeRequest.ToJsonString()); + + _dispenserHomingRequestCodes.Add(homeRequest.Code); + + Task.Factory.StartNew(() => + { + _graphFrequency = 10; + + for (int i = 0; i < 100; i++) + { + Transporter.SendResponse<DispenserHomingResponse>(new DispenserHomingResponse() { MaxProgress = 100, Progress = i }, request.Container.Token); + + if (!_dispenserHomingRequestCodes.Contains(homeRequest.Code)) + { + ResetGraphFactors(); + return; + } + + Thread.Sleep(30); + } + + Transporter.SendResponse<DispenserHomingResponse>(new DispenserHomingResponse() { MaxProgress = 100, Progress = 100 }, request.Container.Token, true); + _dispenserHomingRequestCodes.Remove(homeRequest.Code); + ResetGraphFactors(); + }); + } + + private void HandleAbortDispenserHomingRequest(TangoMessage<DispenserAbortHomingRequest> request) + { + LogManager.Log("Abort dispenser homing request received: " + Environment.NewLine + request.Message.ToJsonString()); + _dispenserHomingRequestCodes.RemoveAll(x => x == request.Message.Code); + ResetGraphFactors(); + Transporter.SendResponse<DispenserAbortHomingResponse>(new DispenserAbortHomingResponse(), request.Container.Token); + } + #endregion } } diff --git a/Software/Visual_Studio/Tango.Integration/Operators/IMachineOperator.cs b/Software/Visual_Studio/Tango.Integration/Operators/IMachineOperator.cs index 6b64575de..14c5114f3 100644 --- a/Software/Visual_Studio/Tango.Integration/Operators/IMachineOperator.cs +++ b/Software/Visual_Studio/Tango.Integration/Operators/IMachineOperator.cs @@ -10,6 +10,7 @@ using Tango.Transport; using System.Reactive; using Tango.Integration.Printing; using Tango.PMR; +using System.Reactive.Linq; namespace Tango.Integration.Operators { @@ -50,5 +51,47 @@ namespace Tango.Integration.Operators /// <param name="request">The request.</param> /// <returns></returns> Task<TangoMessage<MotorAbortJoggingResponse>> StopMotorJogging(MotorAbortJoggingRequest request); + + /// <summary> + /// Starts homing the specified motor. + /// </summary> + /// <param name="request">The request.</param> + /// <returns></returns> + IObservable<TangoMessage<MotorHomingResponse>> StartMotorHoming(MotorHomingRequest request); + + /// <summary> + /// Stops homing the specified motor. + /// </summary> + /// <param name="request">The request.</param> + /// <returns></returns> + Task<TangoMessage<MotorAbortHomingResponse>> StopMotorHoming(MotorAbortHomingRequest request); + + /// <summary> + /// Starts jogging the specified dispenser. + /// </summary> + /// <param name="request">The request.</param> + /// <returns></returns> + Task<TangoMessage<DispenserJoggingResponse>> StartDispenserJogging(DispenserJoggingRequest request); + + /// <summary> + /// Stops jogging the specified dispenser. + /// </summary> + /// <param name="request">The request.</param> + /// <returns></returns> + Task<TangoMessage<DispenserAbortJoggingResponse>> StopDispenserJogging(DispenserAbortJoggingRequest request); + + /// <summary> + /// Starts homing the specified dispenser. + /// </summary> + /// <param name="request">The request.</param> + /// <returns></returns> + IObservable<TangoMessage<DispenserHomingResponse>> StartDispenserHoming(DispenserHomingRequest request); + + /// <summary> + /// Stops homing the specified dispenser. + /// </summary> + /// <param name="request">The request.</param> + /// <returns></returns> + Task<TangoMessage<DispenserAbortHomingResponse>> StopDispenserHoming(DispenserAbortHomingRequest request); } } diff --git a/Software/Visual_Studio/Tango.Integration/Operators/MachineOperator.cs b/Software/Visual_Studio/Tango.Integration/Operators/MachineOperator.cs index 56b7ec971..f0d780191 100644 --- a/Software/Visual_Studio/Tango.Integration/Operators/MachineOperator.cs +++ b/Software/Visual_Studio/Tango.Integration/Operators/MachineOperator.cs @@ -204,6 +204,66 @@ namespace Tango.Integration.Operators return SendRequest<MotorAbortJoggingRequest, MotorAbortJoggingResponse>(request); } + /// <summary> + /// Starts homing the specified motor. + /// </summary> + /// <param name="request">The request.</param> + /// <returns></returns> + public IObservable<TangoMessage<MotorHomingResponse>> StartMotorHoming(MotorHomingRequest request) + { + return SendContinuousRequest<MotorHomingRequest, MotorHomingResponse>(request); + } + + /// <summary> + /// Stops homing the specified motor. + /// </summary> + /// <param name="request">The request.</param> + /// <returns></returns> + public Task<TangoMessage<MotorAbortHomingResponse>> StopMotorHoming(MotorAbortHomingRequest request) + { + return SendRequest<MotorAbortHomingRequest, MotorAbortHomingResponse>(request); + } + + /// <summary> + /// Starts jogging the specified dispenser. + /// </summary> + /// <param name="request">The request.</param> + /// <returns></returns> + public Task<TangoMessage<DispenserJoggingResponse>> StartDispenserJogging(DispenserJoggingRequest request) + { + return SendRequest<DispenserJoggingRequest, DispenserJoggingResponse>(request); + } + + /// <summary> + /// Stops jogging the specified dispenser. + /// </summary> + /// <param name="request">The request.</param> + /// <returns></returns> + public Task<TangoMessage<DispenserAbortJoggingResponse>> StopDispenserJogging(DispenserAbortJoggingRequest request) + { + return SendRequest<DispenserAbortJoggingRequest, DispenserAbortJoggingResponse>(request); + } + + /// <summary> + /// Starts homing the specified dispenser. + /// </summary> + /// <param name="request">The request.</param> + /// <returns></returns> + public IObservable<TangoMessage<DispenserHomingResponse>> StartDispenserHoming(DispenserHomingRequest request) + { + return SendContinuousRequest<DispenserHomingRequest, DispenserHomingResponse>(request); + } + + /// <summary> + /// Stops homing the specified dispenser. + /// </summary> + /// <param name="request">The request.</param> + /// <returns></returns> + public Task<TangoMessage<DispenserAbortHomingResponse>> StopDispenserHoming(DispenserAbortHomingRequest request) + { + return SendRequest<DispenserAbortHomingRequest, DispenserAbortHomingResponse>(request); + } + #endregion } } diff --git a/Software/Visual_Studio/Tango.Logging/LogManager.cs b/Software/Visual_Studio/Tango.Logging/LogManager.cs index 43f40fcbe..b97058bfe 100644 --- a/Software/Visual_Studio/Tango.Logging/LogManager.cs +++ b/Software/Visual_Studio/Tango.Logging/LogManager.cs @@ -184,30 +184,23 @@ namespace Tango.Logging //[DebuggerHidden] private static void LoggingThreadMethod() { - while (_logs.Count > 0) + while (_isStarted) { - LogItemBase log; - - if (_logs.TryDequeue(out log)) + while (_logs.Count > 0) { - if (log != null) + LogItemBase log; + + if (_logs.TryDequeue(out log)) { - _loggers.Where(x => x.Enabled && !x.Immediate).ToList().ForEach(x => x.OnLog(log)); + if (log != null) + { + _loggers.Where(x => x.Enabled && !x.Immediate).ToList().ForEach(x => x.OnLog(log)); + } } } Thread.Sleep(10); } - - Thread.Sleep(400); - - if (_logs.Count > 0) - { - LoggingThreadMethod(); - return; - } - - _isStarted = false; } /// <summary> diff --git a/Software/Visual_Studio/Tango.PMR/Common/MessageType.cs b/Software/Visual_Studio/Tango.PMR/Common/MessageType.cs index ec378556b..86dfe19ad 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( - "ChFNZXNzYWdlVHlwZS5wcm90bxIQVGFuZ28uUE1SLkNvbW1vbireDAoLTWVz", + "ChFNZXNzYWdlVHlwZS5wcm90bxIQVGFuZ28uUE1SLkNvbW1vbiriDgoLTWVz", "c2FnZVR5cGUSCAoETm9uZRAAEhQKEENhbGN1bGF0ZVJlcXVlc3QQAxIVChFD", "YWxjdWxhdGVSZXNwb25zZRAEEhMKD1Byb2dyZXNzUmVxdWVzdBAFEhQKEFBy", "b2dyZXNzUmVzcG9uc2UQBhIcChhTdHViQ2FydHJpZGdlUmVhZFJlcXVlc3QQ", @@ -57,9 +57,15 @@ namespace Tango.PMR.Common { "cXVlc3QQ1A8SGAoTTW90b3JIb21pbmdSZXNwb25zZRDVDxIYChNNb3Rvckpv", "Z2dpbmdSZXF1ZXN0ENYPEhkKFE1vdG9ySm9nZ2luZ1Jlc3BvbnNlENcPEh0K", "GE1vdG9yQWJvcnRKb2dnaW5nUmVxdWVzdBDYDxIeChlNb3RvckFib3J0Sm9n", - "Z2luZ1Jlc3BvbnNlENkPEg8KCkpvYlJlcXVlc3QQuBcSEAoLSm9iUmVzcG9u", - "c2UQuRcSFAoPQWJvcnRKb2JSZXF1ZXN0ELoXEhUKEEFib3J0Sm9iUmVzcG9u", - "c2UQuxdCHAoaY29tLnR3aW5lLnRhbmdvLnBtci5jb21tb25iBnByb3RvMw==")); + "Z2luZ1Jlc3BvbnNlENkPEiAKG0Rpc3BlbnNlckFib3J0SG9taW5nUmVxdWVz", + "dBDaDxIhChxEaXNwZW5zZXJBYm9ydEhvbWluZ1Jlc3BvbnNlENsPEhsKFkRp", + "c3BlbnNlckhvbWluZ1JlcXVlc3QQ3A8SHAoXRGlzcGVuc2VySG9taW5nUmVz", + "cG9uc2UQ3Q8SHAoXRGlzcGVuc2VySm9nZ2luZ1JlcXVlc3QQ3g8SHQoYRGlz", + "cGVuc2VySm9nZ2luZ1Jlc3BvbnNlEN8PEiEKHERpc3BlbnNlckFib3J0Sm9n", + "Z2luZ1JlcXVlc3QQ4A8SIgodRGlzcGVuc2VyQWJvcnRKb2dnaW5nUmVzcG9u", + "c2UQ4Q8SDwoKSm9iUmVxdWVzdBC4FxIQCgtKb2JSZXNwb25zZRC5FxIUCg9B", + "Ym9ydEpvYlJlcXVlc3QQuhcSFQoQQWJvcnRKb2JSZXNwb25zZRC7F0IcChpj", + "b20udHdpbmUudGFuZ28ucG1yLmNvbW1vbmIGcHJvdG8z")); descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, new pbr::FileDescriptor[] { }, new pbr::GeneratedClrTypeInfo(new[] {typeof(global::Tango.PMR.Common.MessageType), }, null)); @@ -135,6 +141,14 @@ namespace Tango.PMR.Common { [pbr::OriginalName("MotorJoggingResponse")] MotorJoggingResponse = 2007, [pbr::OriginalName("MotorAbortJoggingRequest")] MotorAbortJoggingRequest = 2008, [pbr::OriginalName("MotorAbortJoggingResponse")] MotorAbortJoggingResponse = 2009, + [pbr::OriginalName("DispenserAbortHomingRequest")] DispenserAbortHomingRequest = 2010, + [pbr::OriginalName("DispenserAbortHomingResponse")] DispenserAbortHomingResponse = 2011, + [pbr::OriginalName("DispenserHomingRequest")] DispenserHomingRequest = 2012, + [pbr::OriginalName("DispenserHomingResponse")] DispenserHomingResponse = 2013, + [pbr::OriginalName("DispenserJoggingRequest")] DispenserJoggingRequest = 2014, + [pbr::OriginalName("DispenserJoggingResponse")] DispenserJoggingResponse = 2015, + [pbr::OriginalName("DispenserAbortJoggingRequest")] DispenserAbortJoggingRequest = 2016, + [pbr::OriginalName("DispenserAbortJoggingResponse")] DispenserAbortJoggingResponse = 2017, /// <summary> ///Printing /// </summary> diff --git a/Software/Visual_Studio/Tango.PMR/Diagnostics/DispenserAbortHomingRequest.cs b/Software/Visual_Studio/Tango.PMR/Diagnostics/DispenserAbortHomingRequest.cs new file mode 100644 index 000000000..492f9bdaf --- /dev/null +++ b/Software/Visual_Studio/Tango.PMR/Diagnostics/DispenserAbortHomingRequest.cs @@ -0,0 +1,160 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: DispenserAbortHomingRequest.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 DispenserAbortHomingRequest.proto</summary> + public static partial class DispenserAbortHomingRequestReflection { + + #region Descriptor + /// <summary>File descriptor for DispenserAbortHomingRequest.proto</summary> + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static DispenserAbortHomingRequestReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "CiFEaXNwZW5zZXJBYm9ydEhvbWluZ1JlcXVlc3QucHJvdG8SFVRhbmdvLlBN", + "Ui5EaWFnbm9zdGljcyIrChtEaXNwZW5zZXJBYm9ydEhvbWluZ1JlcXVlc3QS", + "DAoEQ29kZRgBIAEoBUIhCh9jb20udHdpbmUudGFuZ28ucG1yLmRpYWdub3N0", + "aWNzYgZwcm90bzM=")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { }, + new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::Tango.PMR.Diagnostics.DispenserAbortHomingRequest), global::Tango.PMR.Diagnostics.DispenserAbortHomingRequest.Parser, new[]{ "Code" }, null, null, null) + })); + } + #endregion + + } + #region Messages + public sealed partial class DispenserAbortHomingRequest : pb::IMessage<DispenserAbortHomingRequest> { + private static readonly pb::MessageParser<DispenserAbortHomingRequest> _parser = new pb::MessageParser<DispenserAbortHomingRequest>(() => new DispenserAbortHomingRequest()); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser<DispenserAbortHomingRequest> Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::Tango.PMR.Diagnostics.DispenserAbortHomingRequestReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public DispenserAbortHomingRequest() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public DispenserAbortHomingRequest(DispenserAbortHomingRequest other) : this() { + code_ = other.code_; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public DispenserAbortHomingRequest Clone() { + return new DispenserAbortHomingRequest(this); + } + + /// <summary>Field number for the "Code" field.</summary> + public const int CodeFieldNumber = 1; + private int code_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int Code { + get { return code_; } + set { + code_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as DispenserAbortHomingRequest); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(DispenserAbortHomingRequest other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (Code != other.Code) return false; + return true; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (Code != 0) hash ^= Code.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 (Code != 0) { + output.WriteRawTag(8); + output.WriteInt32(Code); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (Code != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(Code); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(DispenserAbortHomingRequest other) { + if (other == null) { + return; + } + if (other.Code != 0) { + Code = other.Code; + } + } + + [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: { + Code = input.ReadInt32(); + break; + } + } + } + } + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/Software/Visual_Studio/Tango.PMR/Diagnostics/DispenserAbortHomingResponse.cs b/Software/Visual_Studio/Tango.PMR/Diagnostics/DispenserAbortHomingResponse.cs new file mode 100644 index 000000000..94e32eb29 --- /dev/null +++ b/Software/Visual_Studio/Tango.PMR/Diagnostics/DispenserAbortHomingResponse.cs @@ -0,0 +1,131 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: DispenserAbortHomingResponse.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 DispenserAbortHomingResponse.proto</summary> + public static partial class DispenserAbortHomingResponseReflection { + + #region Descriptor + /// <summary>File descriptor for DispenserAbortHomingResponse.proto</summary> + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static DispenserAbortHomingResponseReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "CiJEaXNwZW5zZXJBYm9ydEhvbWluZ1Jlc3BvbnNlLnByb3RvEhVUYW5nby5Q", + "TVIuRGlhZ25vc3RpY3MiHgocRGlzcGVuc2VyQWJvcnRIb21pbmdSZXNwb25z", + "ZUIhCh9jb20udHdpbmUudGFuZ28ucG1yLmRpYWdub3N0aWNzYgZwcm90bzM=")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { }, + new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::Tango.PMR.Diagnostics.DispenserAbortHomingResponse), global::Tango.PMR.Diagnostics.DispenserAbortHomingResponse.Parser, null, null, null, null) + })); + } + #endregion + + } + #region Messages + public sealed partial class DispenserAbortHomingResponse : pb::IMessage<DispenserAbortHomingResponse> { + private static readonly pb::MessageParser<DispenserAbortHomingResponse> _parser = new pb::MessageParser<DispenserAbortHomingResponse>(() => new DispenserAbortHomingResponse()); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser<DispenserAbortHomingResponse> Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::Tango.PMR.Diagnostics.DispenserAbortHomingResponseReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public DispenserAbortHomingResponse() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public DispenserAbortHomingResponse(DispenserAbortHomingResponse other) : this() { + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public DispenserAbortHomingResponse Clone() { + return new DispenserAbortHomingResponse(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as DispenserAbortHomingResponse); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(DispenserAbortHomingResponse other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + return true; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + 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) { + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(DispenserAbortHomingResponse other) { + if (other == null) { + return; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + input.SkipLastField(); + break; + } + } + } + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/Software/Visual_Studio/Tango.PMR/Diagnostics/DispenserAbortJoggingRequest.cs b/Software/Visual_Studio/Tango.PMR/Diagnostics/DispenserAbortJoggingRequest.cs new file mode 100644 index 000000000..4f879102b --- /dev/null +++ b/Software/Visual_Studio/Tango.PMR/Diagnostics/DispenserAbortJoggingRequest.cs @@ -0,0 +1,160 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: DispenserAbortJoggingRequest.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 DispenserAbortJoggingRequest.proto</summary> + public static partial class DispenserAbortJoggingRequestReflection { + + #region Descriptor + /// <summary>File descriptor for DispenserAbortJoggingRequest.proto</summary> + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static DispenserAbortJoggingRequestReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "CiJEaXNwZW5zZXJBYm9ydEpvZ2dpbmdSZXF1ZXN0LnByb3RvEhVUYW5nby5Q", + "TVIuRGlhZ25vc3RpY3MiLAocRGlzcGVuc2VyQWJvcnRKb2dnaW5nUmVxdWVz", + "dBIMCgRDb2RlGAIgASgFQiEKH2NvbS50d2luZS50YW5nby5wbXIuZGlhZ25v", + "c3RpY3NiBnByb3RvMw==")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { }, + new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::Tango.PMR.Diagnostics.DispenserAbortJoggingRequest), global::Tango.PMR.Diagnostics.DispenserAbortJoggingRequest.Parser, new[]{ "Code" }, null, null, null) + })); + } + #endregion + + } + #region Messages + public sealed partial class DispenserAbortJoggingRequest : pb::IMessage<DispenserAbortJoggingRequest> { + private static readonly pb::MessageParser<DispenserAbortJoggingRequest> _parser = new pb::MessageParser<DispenserAbortJoggingRequest>(() => new DispenserAbortJoggingRequest()); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser<DispenserAbortJoggingRequest> Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::Tango.PMR.Diagnostics.DispenserAbortJoggingRequestReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public DispenserAbortJoggingRequest() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public DispenserAbortJoggingRequest(DispenserAbortJoggingRequest other) : this() { + code_ = other.code_; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public DispenserAbortJoggingRequest Clone() { + return new DispenserAbortJoggingRequest(this); + } + + /// <summary>Field number for the "Code" field.</summary> + public const int CodeFieldNumber = 2; + private int code_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int Code { + get { return code_; } + set { + code_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as DispenserAbortJoggingRequest); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(DispenserAbortJoggingRequest other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (Code != other.Code) return false; + return true; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (Code != 0) hash ^= Code.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 (Code != 0) { + output.WriteRawTag(16); + output.WriteInt32(Code); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (Code != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(Code); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(DispenserAbortJoggingRequest other) { + if (other == null) { + return; + } + if (other.Code != 0) { + Code = other.Code; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + input.SkipLastField(); + break; + case 16: { + Code = input.ReadInt32(); + break; + } + } + } + } + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/Software/Visual_Studio/Tango.PMR/Diagnostics/DispenserAbortJoggingResponse.cs b/Software/Visual_Studio/Tango.PMR/Diagnostics/DispenserAbortJoggingResponse.cs new file mode 100644 index 000000000..e8e2c8efe --- /dev/null +++ b/Software/Visual_Studio/Tango.PMR/Diagnostics/DispenserAbortJoggingResponse.cs @@ -0,0 +1,160 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: DispenserAbortJoggingResponse.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 DispenserAbortJoggingResponse.proto</summary> + public static partial class DispenserAbortJoggingResponseReflection { + + #region Descriptor + /// <summary>File descriptor for DispenserAbortJoggingResponse.proto</summary> + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static DispenserAbortJoggingResponseReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "CiNEaXNwZW5zZXJBYm9ydEpvZ2dpbmdSZXNwb25zZS5wcm90bxIVVGFuZ28u", + "UE1SLkRpYWdub3N0aWNzIi0KHURpc3BlbnNlckFib3J0Sm9nZ2luZ1Jlc3Bv", + "bnNlEgwKBENvZGUYAiABKAVCIQofY29tLnR3aW5lLnRhbmdvLnBtci5kaWFn", + "bm9zdGljc2IGcHJvdG8z")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { }, + new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::Tango.PMR.Diagnostics.DispenserAbortJoggingResponse), global::Tango.PMR.Diagnostics.DispenserAbortJoggingResponse.Parser, new[]{ "Code" }, null, null, null) + })); + } + #endregion + + } + #region Messages + public sealed partial class DispenserAbortJoggingResponse : pb::IMessage<DispenserAbortJoggingResponse> { + private static readonly pb::MessageParser<DispenserAbortJoggingResponse> _parser = new pb::MessageParser<DispenserAbortJoggingResponse>(() => new DispenserAbortJoggingResponse()); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser<DispenserAbortJoggingResponse> Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::Tango.PMR.Diagnostics.DispenserAbortJoggingResponseReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public DispenserAbortJoggingResponse() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public DispenserAbortJoggingResponse(DispenserAbortJoggingResponse other) : this() { + code_ = other.code_; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public DispenserAbortJoggingResponse Clone() { + return new DispenserAbortJoggingResponse(this); + } + + /// <summary>Field number for the "Code" field.</summary> + public const int CodeFieldNumber = 2; + private int code_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int Code { + get { return code_; } + set { + code_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as DispenserAbortJoggingResponse); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(DispenserAbortJoggingResponse other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (Code != other.Code) return false; + return true; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (Code != 0) hash ^= Code.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 (Code != 0) { + output.WriteRawTag(16); + output.WriteInt32(Code); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (Code != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(Code); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(DispenserAbortJoggingResponse other) { + if (other == null) { + return; + } + if (other.Code != 0) { + Code = other.Code; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + input.SkipLastField(); + break; + case 16: { + Code = input.ReadInt32(); + break; + } + } + } + } + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/Software/Visual_Studio/Tango.PMR/Diagnostics/DispenserHomingRequest.cs b/Software/Visual_Studio/Tango.PMR/Diagnostics/DispenserHomingRequest.cs new file mode 100644 index 000000000..f5b45c802 --- /dev/null +++ b/Software/Visual_Studio/Tango.PMR/Diagnostics/DispenserHomingRequest.cs @@ -0,0 +1,188 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: DispenserHomingRequest.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 DispenserHomingRequest.proto</summary> + public static partial class DispenserHomingRequestReflection { + + #region Descriptor + /// <summary>File descriptor for DispenserHomingRequest.proto</summary> + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static DispenserHomingRequestReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "ChxEaXNwZW5zZXJIb21pbmdSZXF1ZXN0LnByb3RvEhVUYW5nby5QTVIuRGlh", + "Z25vc3RpY3MiNQoWRGlzcGVuc2VySG9taW5nUmVxdWVzdBIMCgRDb2RlGAEg", + "ASgFEg0KBVNwZWVkGAIgASgBQiEKH2NvbS50d2luZS50YW5nby5wbXIuZGlh", + "Z25vc3RpY3NiBnByb3RvMw==")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { }, + new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::Tango.PMR.Diagnostics.DispenserHomingRequest), global::Tango.PMR.Diagnostics.DispenserHomingRequest.Parser, new[]{ "Code", "Speed" }, null, null, null) + })); + } + #endregion + + } + #region Messages + public sealed partial class DispenserHomingRequest : pb::IMessage<DispenserHomingRequest> { + private static readonly pb::MessageParser<DispenserHomingRequest> _parser = new pb::MessageParser<DispenserHomingRequest>(() => new DispenserHomingRequest()); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser<DispenserHomingRequest> Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::Tango.PMR.Diagnostics.DispenserHomingRequestReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public DispenserHomingRequest() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public DispenserHomingRequest(DispenserHomingRequest other) : this() { + code_ = other.code_; + speed_ = other.speed_; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public DispenserHomingRequest Clone() { + return new DispenserHomingRequest(this); + } + + /// <summary>Field number for the "Code" field.</summary> + public const int CodeFieldNumber = 1; + private int code_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int Code { + get { return code_; } + set { + code_ = value; + } + } + + /// <summary>Field number for the "Speed" field.</summary> + public const int SpeedFieldNumber = 2; + private double speed_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public double Speed { + get { return speed_; } + set { + speed_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as DispenserHomingRequest); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(DispenserHomingRequest other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (Code != other.Code) return false; + if (Speed != other.Speed) return false; + return true; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (Code != 0) hash ^= Code.GetHashCode(); + if (Speed != 0D) hash ^= Speed.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 (Code != 0) { + output.WriteRawTag(8); + output.WriteInt32(Code); + } + if (Speed != 0D) { + output.WriteRawTag(17); + output.WriteDouble(Speed); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (Code != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(Code); + } + if (Speed != 0D) { + size += 1 + 8; + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(DispenserHomingRequest other) { + if (other == null) { + return; + } + if (other.Code != 0) { + Code = other.Code; + } + if (other.Speed != 0D) { + Speed = other.Speed; + } + } + + [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: { + Code = input.ReadInt32(); + break; + } + case 17: { + Speed = input.ReadDouble(); + break; + } + } + } + } + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/Software/Visual_Studio/Tango.PMR/Diagnostics/DispenserHomingResponse.cs b/Software/Visual_Studio/Tango.PMR/Diagnostics/DispenserHomingResponse.cs new file mode 100644 index 000000000..dce4f5777 --- /dev/null +++ b/Software/Visual_Studio/Tango.PMR/Diagnostics/DispenserHomingResponse.cs @@ -0,0 +1,188 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: DispenserHomingResponse.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 DispenserHomingResponse.proto</summary> + public static partial class DispenserHomingResponseReflection { + + #region Descriptor + /// <summary>File descriptor for DispenserHomingResponse.proto</summary> + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static DispenserHomingResponseReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "Ch1EaXNwZW5zZXJIb21pbmdSZXNwb25zZS5wcm90bxIVVGFuZ28uUE1SLkRp", + "YWdub3N0aWNzIkAKF0Rpc3BlbnNlckhvbWluZ1Jlc3BvbnNlEhAKCFByb2dy", + "ZXNzGAEgASgBEhMKC01heFByb2dyZXNzGAIgASgBQiEKH2NvbS50d2luZS50", + "YW5nby5wbXIuZGlhZ25vc3RpY3NiBnByb3RvMw==")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { }, + new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::Tango.PMR.Diagnostics.DispenserHomingResponse), global::Tango.PMR.Diagnostics.DispenserHomingResponse.Parser, new[]{ "Progress", "MaxProgress" }, null, null, null) + })); + } + #endregion + + } + #region Messages + public sealed partial class DispenserHomingResponse : pb::IMessage<DispenserHomingResponse> { + private static readonly pb::MessageParser<DispenserHomingResponse> _parser = new pb::MessageParser<DispenserHomingResponse>(() => new DispenserHomingResponse()); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser<DispenserHomingResponse> Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::Tango.PMR.Diagnostics.DispenserHomingResponseReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public DispenserHomingResponse() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public DispenserHomingResponse(DispenserHomingResponse other) : this() { + progress_ = other.progress_; + maxProgress_ = other.maxProgress_; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public DispenserHomingResponse Clone() { + return new DispenserHomingResponse(this); + } + + /// <summary>Field number for the "Progress" field.</summary> + public const int ProgressFieldNumber = 1; + private double progress_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public double Progress { + get { return progress_; } + set { + progress_ = value; + } + } + + /// <summary>Field number for the "MaxProgress" field.</summary> + public const int MaxProgressFieldNumber = 2; + private double maxProgress_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public double MaxProgress { + get { return maxProgress_; } + set { + maxProgress_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as DispenserHomingResponse); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(DispenserHomingResponse other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (Progress != other.Progress) return false; + if (MaxProgress != other.MaxProgress) return false; + return true; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (Progress != 0D) hash ^= Progress.GetHashCode(); + if (MaxProgress != 0D) hash ^= MaxProgress.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 (Progress != 0D) { + output.WriteRawTag(9); + output.WriteDouble(Progress); + } + if (MaxProgress != 0D) { + output.WriteRawTag(17); + output.WriteDouble(MaxProgress); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (Progress != 0D) { + size += 1 + 8; + } + if (MaxProgress != 0D) { + size += 1 + 8; + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(DispenserHomingResponse other) { + if (other == null) { + return; + } + if (other.Progress != 0D) { + Progress = other.Progress; + } + if (other.MaxProgress != 0D) { + MaxProgress = other.MaxProgress; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + input.SkipLastField(); + break; + case 9: { + Progress = input.ReadDouble(); + break; + } + case 17: { + MaxProgress = input.ReadDouble(); + break; + } + } + } + } + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/Software/Visual_Studio/Tango.PMR/Diagnostics/DispenserJoggingRequest.cs b/Software/Visual_Studio/Tango.PMR/Diagnostics/DispenserJoggingRequest.cs new file mode 100644 index 000000000..48894af8d --- /dev/null +++ b/Software/Visual_Studio/Tango.PMR/Diagnostics/DispenserJoggingRequest.cs @@ -0,0 +1,218 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: DispenserJoggingRequest.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 DispenserJoggingRequest.proto</summary> + public static partial class DispenserJoggingRequestReflection { + + #region Descriptor + /// <summary>File descriptor for DispenserJoggingRequest.proto</summary> + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static DispenserJoggingRequestReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "Ch1EaXNwZW5zZXJKb2dnaW5nUmVxdWVzdC5wcm90bxIVVGFuZ28uUE1SLkRp", + "YWdub3N0aWNzGhRNb3RvckRpcmVjdGlvbi5wcm90byJwChdEaXNwZW5zZXJK", + "b2dnaW5nUmVxdWVzdBI4CglEaXJlY3Rpb24YASABKA4yJS5UYW5nby5QTVIu", + "RGlhZ25vc3RpY3MuTW90b3JEaXJlY3Rpb24SDAoEQ29kZRgCIAEoBRINCgVT", + "cGVlZBgDIAEoAUIhCh9jb20udHdpbmUudGFuZ28ucG1yLmRpYWdub3N0aWNz", + "YgZwcm90bzM=")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { global::Tango.PMR.Diagnostics.MotorDirectionReflection.Descriptor, }, + new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::Tango.PMR.Diagnostics.DispenserJoggingRequest), global::Tango.PMR.Diagnostics.DispenserJoggingRequest.Parser, new[]{ "Direction", "Code", "Speed" }, null, null, null) + })); + } + #endregion + + } + #region Messages + public sealed partial class DispenserJoggingRequest : pb::IMessage<DispenserJoggingRequest> { + private static readonly pb::MessageParser<DispenserJoggingRequest> _parser = new pb::MessageParser<DispenserJoggingRequest>(() => new DispenserJoggingRequest()); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser<DispenserJoggingRequest> Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::Tango.PMR.Diagnostics.DispenserJoggingRequestReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public DispenserJoggingRequest() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public DispenserJoggingRequest(DispenserJoggingRequest other) : this() { + direction_ = other.direction_; + code_ = other.code_; + speed_ = other.speed_; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public DispenserJoggingRequest Clone() { + return new DispenserJoggingRequest(this); + } + + /// <summary>Field number for the "Direction" field.</summary> + public const int DirectionFieldNumber = 1; + 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; + } + } + + /// <summary>Field number for the "Code" field.</summary> + public const int CodeFieldNumber = 2; + private int code_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int Code { + get { return code_; } + set { + code_ = value; + } + } + + /// <summary>Field number for the "Speed" field.</summary> + public const int SpeedFieldNumber = 3; + private double speed_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public double Speed { + get { return speed_; } + set { + speed_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as DispenserJoggingRequest); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(DispenserJoggingRequest other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (Direction != other.Direction) return false; + if (Code != other.Code) return false; + if (Speed != other.Speed) return false; + return true; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (Direction != 0) hash ^= Direction.GetHashCode(); + if (Code != 0) hash ^= Code.GetHashCode(); + if (Speed != 0D) hash ^= Speed.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 (Direction != 0) { + output.WriteRawTag(8); + output.WriteEnum((int) Direction); + } + if (Code != 0) { + output.WriteRawTag(16); + output.WriteInt32(Code); + } + if (Speed != 0D) { + output.WriteRawTag(25); + output.WriteDouble(Speed); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (Direction != 0) { + size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) Direction); + } + if (Code != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(Code); + } + if (Speed != 0D) { + size += 1 + 8; + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(DispenserJoggingRequest other) { + if (other == null) { + return; + } + if (other.Direction != 0) { + Direction = other.Direction; + } + if (other.Code != 0) { + Code = other.Code; + } + if (other.Speed != 0D) { + Speed = other.Speed; + } + } + + [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: { + direction_ = (global::Tango.PMR.Diagnostics.MotorDirection) input.ReadEnum(); + break; + } + case 16: { + Code = input.ReadInt32(); + break; + } + case 25: { + Speed = input.ReadDouble(); + break; + } + } + } + } + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/Software/Visual_Studio/Tango.PMR/Diagnostics/DispenserJoggingResponse.cs b/Software/Visual_Studio/Tango.PMR/Diagnostics/DispenserJoggingResponse.cs new file mode 100644 index 000000000..ab32d6f98 --- /dev/null +++ b/Software/Visual_Studio/Tango.PMR/Diagnostics/DispenserJoggingResponse.cs @@ -0,0 +1,131 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: DispenserJoggingResponse.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 DispenserJoggingResponse.proto</summary> + public static partial class DispenserJoggingResponseReflection { + + #region Descriptor + /// <summary>File descriptor for DispenserJoggingResponse.proto</summary> + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static DispenserJoggingResponseReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "Ch5EaXNwZW5zZXJKb2dnaW5nUmVzcG9uc2UucHJvdG8SFVRhbmdvLlBNUi5E", + "aWFnbm9zdGljcyIaChhEaXNwZW5zZXJKb2dnaW5nUmVzcG9uc2VCIQofY29t", + "LnR3aW5lLnRhbmdvLnBtci5kaWFnbm9zdGljc2IGcHJvdG8z")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { }, + new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::Tango.PMR.Diagnostics.DispenserJoggingResponse), global::Tango.PMR.Diagnostics.DispenserJoggingResponse.Parser, null, null, null, null) + })); + } + #endregion + + } + #region Messages + public sealed partial class DispenserJoggingResponse : pb::IMessage<DispenserJoggingResponse> { + private static readonly pb::MessageParser<DispenserJoggingResponse> _parser = new pb::MessageParser<DispenserJoggingResponse>(() => new DispenserJoggingResponse()); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser<DispenserJoggingResponse> Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::Tango.PMR.Diagnostics.DispenserJoggingResponseReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public DispenserJoggingResponse() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public DispenserJoggingResponse(DispenserJoggingResponse other) : this() { + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public DispenserJoggingResponse Clone() { + return new DispenserJoggingResponse(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as DispenserJoggingResponse); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(DispenserJoggingResponse other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + return true; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + 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) { + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(DispenserJoggingResponse other) { + if (other == null) { + return; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + input.SkipLastField(); + break; + } + } + } + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/Software/Visual_Studio/Tango.PMR/Diagnostics/MotorHomingResponse.cs b/Software/Visual_Studio/Tango.PMR/Diagnostics/MotorHomingResponse.cs index 7dd9f982b..487eb32a6 100644 --- a/Software/Visual_Studio/Tango.PMR/Diagnostics/MotorHomingResponse.cs +++ b/Software/Visual_Studio/Tango.PMR/Diagnostics/MotorHomingResponse.cs @@ -24,7 +24,7 @@ namespace Tango.PMR.Diagnostics { string.Concat( "ChlNb3RvckhvbWluZ1Jlc3BvbnNlLnByb3RvEhVUYW5nby5QTVIuRGlhZ25v", "c3RpY3MiPAoTTW90b3JIb21pbmdSZXNwb25zZRIQCghQcm9ncmVzcxgBIAEo", - "BRITCgtNYXhQcm9ncmVzcxgCIAEoBUIhCh9jb20udHdpbmUudGFuZ28ucG1y", + "ARITCgtNYXhQcm9ncmVzcxgCIAEoAUIhCh9jb20udHdpbmUudGFuZ28ucG1y", "LmRpYWdub3N0aWNzYgZwcm90bzM=")); descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, new pbr::FileDescriptor[] { }, @@ -71,9 +71,9 @@ namespace Tango.PMR.Diagnostics { /// <summary>Field number for the "Progress" field.</summary> public const int ProgressFieldNumber = 1; - private int progress_; + private double progress_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int Progress { + public double Progress { get { return progress_; } set { progress_ = value; @@ -82,9 +82,9 @@ namespace Tango.PMR.Diagnostics { /// <summary>Field number for the "MaxProgress" field.</summary> public const int MaxProgressFieldNumber = 2; - private int maxProgress_; + private double maxProgress_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int MaxProgress { + public double MaxProgress { get { return maxProgress_; } set { maxProgress_ = value; @@ -112,8 +112,8 @@ namespace Tango.PMR.Diagnostics { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override int GetHashCode() { int hash = 1; - if (Progress != 0) hash ^= Progress.GetHashCode(); - if (MaxProgress != 0) hash ^= MaxProgress.GetHashCode(); + if (Progress != 0D) hash ^= Progress.GetHashCode(); + if (MaxProgress != 0D) hash ^= MaxProgress.GetHashCode(); return hash; } @@ -124,24 +124,24 @@ namespace Tango.PMR.Diagnostics { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void WriteTo(pb::CodedOutputStream output) { - if (Progress != 0) { - output.WriteRawTag(8); - output.WriteInt32(Progress); + if (Progress != 0D) { + output.WriteRawTag(9); + output.WriteDouble(Progress); } - if (MaxProgress != 0) { - output.WriteRawTag(16); - output.WriteInt32(MaxProgress); + if (MaxProgress != 0D) { + output.WriteRawTag(17); + output.WriteDouble(MaxProgress); } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public int CalculateSize() { int size = 0; - if (Progress != 0) { - size += 1 + pb::CodedOutputStream.ComputeInt32Size(Progress); + if (Progress != 0D) { + size += 1 + 8; } - if (MaxProgress != 0) { - size += 1 + pb::CodedOutputStream.ComputeInt32Size(MaxProgress); + if (MaxProgress != 0D) { + size += 1 + 8; } return size; } @@ -151,10 +151,10 @@ namespace Tango.PMR.Diagnostics { if (other == null) { return; } - if (other.Progress != 0) { + if (other.Progress != 0D) { Progress = other.Progress; } - if (other.MaxProgress != 0) { + if (other.MaxProgress != 0D) { MaxProgress = other.MaxProgress; } } @@ -167,12 +167,12 @@ namespace Tango.PMR.Diagnostics { default: input.SkipLastField(); break; - case 8: { - Progress = input.ReadInt32(); + case 9: { + Progress = input.ReadDouble(); break; } - case 16: { - MaxProgress = input.ReadInt32(); + case 17: { + MaxProgress = input.ReadDouble(); break; } } diff --git a/Software/Visual_Studio/Tango.PMR/Tango.PMR.csproj b/Software/Visual_Studio/Tango.PMR/Tango.PMR.csproj index e6f671ca7..c50ce853f 100644 --- a/Software/Visual_Studio/Tango.PMR/Tango.PMR.csproj +++ b/Software/Visual_Studio/Tango.PMR/Tango.PMR.csproj @@ -55,6 +55,14 @@ <Compile Include="ColorLab\InputColor.cs" /> <Compile Include="ColorLab\OutputColor.cs" /> <Compile Include="Diagnostics\DataFileFrame.cs" /> + <Compile Include="Diagnostics\DispenserAbortHomingRequest.cs" /> + <Compile Include="Diagnostics\DispenserAbortHomingResponse.cs" /> + <Compile Include="Diagnostics\DispenserAbortJoggingRequest.cs" /> + <Compile Include="Diagnostics\DispenserAbortJoggingResponse.cs" /> + <Compile Include="Diagnostics\DispenserHomingRequest.cs" /> + <Compile Include="Diagnostics\DispenserHomingResponse.cs" /> + <Compile Include="Diagnostics\DispenserJoggingRequest.cs" /> + <Compile Include="Diagnostics\DispenserJoggingResponse.cs" /> <Compile Include="Diagnostics\DoubleArray.cs" /> <Compile Include="Diagnostics\MotorAbortHomingRequest.cs" /> <Compile Include="Diagnostics\MotorAbortHomingResponse.cs" /> diff --git a/Software/Visual_Studio/Tango.UnitTesting/App.config b/Software/Visual_Studio/Tango.UnitTesting/App.config index 901eeb586..80fd5e3fa 100644 --- a/Software/Visual_Studio/Tango.UnitTesting/App.config +++ b/Software/Visual_Studio/Tango.UnitTesting/App.config @@ -17,4 +17,12 @@ <add name="SQLite Data Provider (Entity Framework 6)" invariant="System.Data.SQLite.EF6" description=".NET Framework Data Provider for SQLite (Entity Framework 6)" type="System.Data.SQLite.EF6.SQLiteProviderFactory, System.Data.SQLite.EF6" /> <remove invariant="System.Data.SQLite" /><add name="SQLite Data Provider" invariant="System.Data.SQLite" description=".NET Framework Data Provider for SQLite" type="System.Data.SQLite.SQLiteFactory, System.Data.SQLite" /></DbProviderFactories> </system.data> + <runtime> + <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> + <dependentAssembly> + <assemblyIdentity name="System.Reactive.Core" publicKeyToken="94bc3704cddfc263" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-3.0.3000.0" newVersion="3.0.3000.0" /> + </dependentAssembly> + </assemblyBinding> + </runtime> </configuration>
\ No newline at end of file diff --git a/Software/Visual_Studio/Tango.Visuals/AnalogSwitch/AnalogSwitch.xaml b/Software/Visual_Studio/Tango.Visuals/AnalogSwitch/AnalogSwitch.xaml new file mode 100644 index 000000000..c7ae4fe57 --- /dev/null +++ b/Software/Visual_Studio/Tango.Visuals/AnalogSwitch/AnalogSwitch.xaml @@ -0,0 +1,12 @@ +<UserControl x:Class="Tango.Visuals.AnalogSwitch" + 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" + xmlns:d="http://schemas.microsoft.com/expression/blend/2008" + mc:Ignorable="d" + d:DesignHeight="120" d:DesignWidth="70"> + <Grid> + <Image x:Name="imgOFF" Source="../Images/off.png" RenderOptions.BitmapScalingMode="Fant"></Image> + <Image x:Name="imgON" Source="../Images/on.png" RenderOptions.BitmapScalingMode="Fant" Visibility="Hidden"></Image> + </Grid> +</UserControl> diff --git a/Software/Visual_Studio/Tango.Visuals/AnalogSwitch/AnalogSwitch.xaml.cs b/Software/Visual_Studio/Tango.Visuals/AnalogSwitch/AnalogSwitch.xaml.cs new file mode 100644 index 000000000..2149409a1 --- /dev/null +++ b/Software/Visual_Studio/Tango.Visuals/AnalogSwitch/AnalogSwitch.xaml.cs @@ -0,0 +1,66 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Effects; +using System.Windows.Media.Imaging; +using System.Windows.Navigation; +using System.Windows.Shapes; + +namespace Tango.Visuals +{ + /// <summary> + /// Interaction logic for AnalogSwitch.xaml + /// </summary> + public partial class AnalogSwitch : UserControl + { + public event Action<AnalogSwitch> CheckedChanged; + + public AnalogSwitch() + { + InitializeComponent(); + this.PreviewMouseUp += AnalogSwitch_PreviewMouseUp; + } + + void AnalogSwitch_PreviewMouseUp(object sender, MouseButtonEventArgs e) + { + IsChecked = !IsChecked; + } + + public bool IsChecked + { + get { return (bool)GetValue(IsCheckedProperty); } + set { SetValue(IsCheckedProperty, value); } + } + + // Using a DependencyProperty as the backing store for IsChecked. This enables animation, styling, binding, etc... + public static readonly DependencyProperty IsCheckedProperty = + DependencyProperty.Register("IsChecked", typeof(bool), typeof(AnalogSwitch), new PropertyMetadata(false,new PropertyChangedCallback(CheckChanged))); + + private static void CheckChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) + { + AnalogSwitch s = d as AnalogSwitch; + if ((bool)e.NewValue) + { + s.imgON.Visibility = Visibility.Visible; + s.imgOFF.Visibility = Visibility.Hidden; + } + else + { + s.imgOFF.Visibility = Visibility.Visible; + s.imgON.Visibility = Visibility.Hidden; + } + + if (s.CheckedChanged != null) s.CheckedChanged(s); + } + + + } +} diff --git a/Software/Visual_Studio/Tango.Visuals/Images/off.png b/Software/Visual_Studio/Tango.Visuals/Images/off.png Binary files differnew file mode 100644 index 000000000..67f2f4a6f --- /dev/null +++ b/Software/Visual_Studio/Tango.Visuals/Images/off.png diff --git a/Software/Visual_Studio/Tango.Visuals/Images/on.png b/Software/Visual_Studio/Tango.Visuals/Images/on.png Binary files differnew file mode 100644 index 000000000..9922b1901 --- /dev/null +++ b/Software/Visual_Studio/Tango.Visuals/Images/on.png diff --git a/Software/Visual_Studio/Tango.Visuals/Led/Led.xaml b/Software/Visual_Studio/Tango.Visuals/Led/Led.xaml new file mode 100644 index 000000000..b59ed5d15 --- /dev/null +++ b/Software/Visual_Studio/Tango.Visuals/Led/Led.xaml @@ -0,0 +1,117 @@ +<UserControl x:Class="Tango.Visuals.Led" + 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" + xmlns:d="http://schemas.microsoft.com/expression/blend/2008" + xmlns:converters="clr-namespace:Tango.Visuals.Converters" + mc:Ignorable="d" + d:DesignHeight="150" d:DesignWidth="150"> + <UserControl.Resources> + <converters:BooleanToVisibilityConverter x:Key="v"></converters:BooleanToVisibilityConverter> + + <RadialGradientBrush x:Key="outer" + Center="0.5,0.5" GradientOrigin="0.5,0.5" RadiusX="0.5" RadiusY="0.5" + SpreadMethod="Pad" ColorInterpolationMode="SRgbLinearInterpolation" > + <GradientStop Color="Transparent" Offset="0" /> + <GradientStop Color="Transparent" Offset="1" /> + </RadialGradientBrush> + + <RadialGradientBrush x:Key="inner" + Center="0.5,0.5" GradientOrigin="0.5,0.5" RadiusX="0.5" RadiusY="0.5" + SpreadMethod="Pad" ColorInterpolationMode="SRgbLinearInterpolation" > + <GradientStop Color="#FF98FF00" Offset="0" /> + <GradientStop Color="#FF01472B" Offset="1" /> + </RadialGradientBrush> + + <RadialGradientBrush x:Key="innerOff" + Center="0.5,0.5" GradientOrigin="0.5,0.5" RadiusX="0.5" RadiusY="0.5" + SpreadMethod="Pad" ColorInterpolationMode="SRgbLinearInterpolation" > + <GradientStop Color="Red" Offset="0" /> + <GradientStop Color="#FF670000" Offset="1" /> + </RadialGradientBrush> + </UserControl.Resources> + + <Grid> + <Grid x:Name="grid"> + <Grid.RowDefinitions> + <RowDefinition Height="3*"/> + <RowDefinition Height="60*"/> + <RowDefinition Height="3*"/> + </Grid.RowDefinitions> + <Grid.ColumnDefinitions> + <ColumnDefinition Width="3*"/> + <ColumnDefinition Width="60*"/> + <ColumnDefinition Width="3*"/> + </Grid.ColumnDefinitions> + + <Ellipse Fill="{StaticResource outer}" Grid.RowSpan="3" Grid.ColumnSpan="3" Stroke="Gray" StrokeThickness="1"></Ellipse> + <!--<Ellipse Fill="#FF3E3E3E" Grid.Row="1" Grid.Column="1"> + <Ellipse.Triggers> + <EventTrigger RoutedEvent="MouseEnter"> + <BeginStoryboard> + <Storyboard> + <ColorAnimation Storyboard.TargetProperty="Fill.Color" To="#404040" Duration="00:00:0.2"></ColorAnimation> + </Storyboard> + </BeginStoryboard> + </EventTrigger> + <EventTrigger RoutedEvent="MouseLeave"> + <BeginStoryboard> + <Storyboard> + <ColorAnimation Storyboard.TargetProperty="Fill.Color" To="#FF464646" Duration="00:00:0.2"></ColorAnimation> + </Storyboard> + </BeginStoryboard> + </EventTrigger> + </Ellipse.Triggers> + </Ellipse>--> + + <Ellipse Margin="2" Grid.Row="1" Grid.Column="1" Stroke="#FF7F7F7F" StrokeThickness="2"> + <Ellipse.Style> + <Style> + <Style.Triggers> + <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=IsChecked}" Value="True"> + <Setter Property="Ellipse.Fill" Value="{DynamicResource inner}"></Setter> + <DataTrigger.EnterActions> + <BeginStoryboard> + <Storyboard> + <DoubleAnimation Storyboard.TargetProperty="Fill.(GradientBrush.GradientStops)[1].(GradientStop.Offset)" From="0.8" To="1" Duration="0:0:0.5" AutoReverse="True" RepeatBehavior="Forever"/> + </Storyboard> + </BeginStoryboard> + </DataTrigger.EnterActions> + </DataTrigger> + <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=IsChecked}" Value="False"> + <Setter Property="Ellipse.Fill" Value="{DynamicResource innerOff}"></Setter> + <DataTrigger.EnterActions> + <BeginStoryboard> + <Storyboard> + <DoubleAnimation Storyboard.TargetProperty="Fill.(GradientBrush.GradientStops)[1].(GradientStop.Offset)" From="0.5" To="1" Duration="0:0:0.2" AutoReverse="False"/> + </Storyboard> + </BeginStoryboard> + </DataTrigger.EnterActions> + </DataTrigger> + </Style.Triggers> + </Style> + </Ellipse.Style> + </Ellipse> + </Grid> + + <Grid x:Name="gridMask" Visibility="Hidden"> + <Grid.RowDefinitions> + <RowDefinition Height="11*"/> + <RowDefinition Height="30*"/> + <RowDefinition Height="11*"/> + </Grid.RowDefinitions> + <Grid.ColumnDefinitions> + <ColumnDefinition Width="11*"/> + <ColumnDefinition Width="30*"/> + <ColumnDefinition Width="11*"/> + </Grid.ColumnDefinitions> + + <Ellipse Fill="{StaticResource outer}" Grid.RowSpan="3" Grid.ColumnSpan="3"></Ellipse> + <Ellipse Fill="#FF464646" Grid.Row="1" Grid.Column="1"> + </Ellipse> + + <Ellipse Fill="#707070" Margin="2" Grid.Row="1" Grid.Column="1"> + </Ellipse> + </Grid> + </Grid> +</UserControl> diff --git a/Software/Visual_Studio/Tango.Visuals/Led/Led.xaml.cs b/Software/Visual_Studio/Tango.Visuals/Led/Led.xaml.cs new file mode 100644 index 000000000..5a1e67913 --- /dev/null +++ b/Software/Visual_Studio/Tango.Visuals/Led/Led.xaml.cs @@ -0,0 +1,179 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Navigation; +using System.Windows.Shapes; +using Tango.Core.Commands; + +namespace Tango.Visuals +{ + /// <summary> + /// Represents an LED like button that acts like a check box. + /// </summary> + public partial class Led : UserControl + { + #region Constructors + + public Led() + { + InitializeComponent(); + this.PreviewMouseUp += LedControl_PreviewMouseUp; + } + + #endregion + + #region Event Handlers + + void LedControl_PreviewMouseUp(object sender, MouseButtonEventArgs e) + { + if (IsPassive) return; + + IsChecked = !IsChecked; + + if (Command != null) + { + Command.Execute(null); + } + } + + #endregion + + #region Properties + + /// <summary> + /// Gets or sets whether the LED is on or off. + /// </summary> + public bool IsChecked + { + get { return (bool)GetValue(IsCheckedProperty); } + set { SetValue(IsCheckedProperty, value); } + } + public static readonly DependencyProperty IsCheckedProperty = + DependencyProperty.Register("IsChecked", typeof(bool), typeof(Led), new PropertyMetadata(false)); + + + /// <summary> + /// Gets or sets whether the control is enabled. + /// </summary> + public bool Enabled + { + get { return (bool)GetValue(EnabledProperty); } + set { SetValue(EnabledProperty, value); } + } + public static readonly DependencyProperty EnabledProperty = + DependencyProperty.Register("Enabled", typeof(bool), typeof(Led), new PropertyMetadata(true, new PropertyChangedCallback(EnabledChanged))); + private static void EnabledChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) + { + Led l = d as Led; + if ((bool)e.NewValue) + { + l.gridMask.Visibility = Visibility.Hidden; + l.grid.Visibility = Visibility.Visible; + } + else + { + l.gridMask.Visibility = Visibility.Visible; + l.grid.Visibility = Visibility.Hidden; + } + } + + + public Brush FillBrush + { + get { return (Brush)GetValue(FillBrushProperty); } + set { SetValue(FillBrushProperty, value); } + } + public static readonly DependencyProperty FillBrushProperty = + DependencyProperty.Register("FillBrush", typeof(Brush), typeof(Led), new PropertyMetadata(null)); + + + public double InnerOpacity + { + get { return (double)GetValue(InnerOpacityProperty); } + set { SetValue(InnerOpacityProperty, value); } + } + public static readonly DependencyProperty InnerOpacityProperty = + DependencyProperty.Register("InnerOpacity", typeof(double), typeof(Led), new PropertyMetadata(1.0)); + + + public bool IsPassive + { + get { return (bool)GetValue(IsPassiveProperty); } + set { SetValue(IsPassiveProperty, value); } + } + public static readonly DependencyProperty IsPassiveProperty = + DependencyProperty.Register("IsPassive", typeof(bool), typeof(Led), new PropertyMetadata(false)); + + + + public Brush CheckedBrush + { + get { return (Brush)GetValue(CheckedBrushProperty); } + set { SetValue(CheckedBrushProperty, value); } + } + public static readonly DependencyProperty CheckedBrushProperty = + DependencyProperty.Register("CheckedBrush", typeof(Brush), typeof(Led), new PropertyMetadata(null,CheckBrushChanged)); + + private static void CheckBrushChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) + { + var control = d as Led; + control.Resources["inner"] = control.CheckedBrush; + } + + + + public Brush UnCheckedBrush + { + get { return (Brush)GetValue(UnCheckedBrushProperty); } + set { SetValue(UnCheckedBrushProperty, value); } + } + public static readonly DependencyProperty UnCheckedBrushProperty = + DependencyProperty.Register("UnCheckedBrush", typeof(Brush), typeof(Led), new PropertyMetadata(null,UnCheckedBrushChanged)); + + private static void UnCheckedBrushChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) + { + var control = d as Led; + control.Resources["innerOff"] = control.UnCheckedBrush; + } + + + + #endregion + + #region Commands + + /// <summary> + /// Represents the command to bind for CanExecute event. + /// </summary> + public RelayCommand Command + { + get { return (RelayCommand)GetValue(CommandProperty); } + set { SetValue(CommandProperty, value); } + } + public static readonly DependencyProperty CommandProperty = + DependencyProperty.Register("Command", typeof(RelayCommand), typeof(Led), new PropertyMetadata(null, new PropertyChangedCallback(CommandChanged))); + private static void CommandChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) + { + Led l = d as Led; + + if (l.Command != null) + { + l.Command.CanExecuteChanged += (x, y) => + { + l.IsEnabled = l.Command.CanExecute(null); + }; + } + } + + #endregion + } +}
\ No newline at end of file diff --git a/Software/Visual_Studio/Tango.Visuals/Tango.Visuals.csproj b/Software/Visual_Studio/Tango.Visuals/Tango.Visuals.csproj index 4eaa3376e..53c87d0f5 100644 --- a/Software/Visual_Studio/Tango.Visuals/Tango.Visuals.csproj +++ b/Software/Visual_Studio/Tango.Visuals/Tango.Visuals.csproj @@ -52,6 +52,9 @@ <Compile Include="..\Versioning\GlobalVersionInfo.cs"> <Link>GlobalVersionInfo.cs</Link> </Compile> + <Compile Include="AnalogSwitch\AnalogSwitch.xaml.cs"> + <DependentUpon>AnalogSwitch.xaml</DependentUpon> + </Compile> <Compile Include="Components\Arc.cs" /> <Compile Include="Components\PieAxisTicks.xaml.cs"> <DependentUpon>PieAxisTicks.xaml</DependentUpon> @@ -73,6 +76,9 @@ <Compile Include="Knob\Knob.xaml.cs"> <DependentUpon>Knob.xaml</DependentUpon> </Compile> + <Compile Include="Led\Led.xaml.cs"> + <DependentUpon>Led.xaml</DependentUpon> + </Compile> <Compile Include="YAxisDoubles\YAxisDoubles.xaml.cs"> <DependentUpon>YAxisDoubles.xaml</DependentUpon> </Compile> @@ -90,6 +96,10 @@ <Compile Include="VUMeter\VUMeter.xaml.cs"> <DependentUpon>VUMeter.xaml</DependentUpon> </Compile> + <Page Include="AnalogSwitch\AnalogSwitch.xaml"> + <Generator>MSBuild:Compile</Generator> + <SubType>Designer</SubType> + </Page> <Page Include="Components\PieAxisTicks.xaml"> <Generator>MSBuild:Compile</Generator> <SubType>Designer</SubType> @@ -110,6 +120,10 @@ <Generator>MSBuild:Compile</Generator> <SubType>Designer</SubType> </Page> + <Page Include="Led\Led.xaml"> + <Generator>MSBuild:Compile</Generator> + <SubType>Designer</SubType> + </Page> <Page Include="YAxisDoubles\YAxisDoubles.xaml"> <Generator>MSBuild:Compile</Generator> <SubType>Designer</SubType> @@ -188,6 +202,17 @@ <Resource Include="Knob\volumeKnobMetroDark.png" /> <Resource Include="Knob\volumeKnobMetroLight.png" /> </ItemGroup> + <ItemGroup> + <ProjectReference Include="..\Tango.Core\Tango.Core.csproj"> + <Project>{a34ee0f0-649d-41c8-8489-b6f1cc6924ee}</Project> + <Name>Tango.Core</Name> + </ProjectReference> + </ItemGroup> + <ItemGroup /> + <ItemGroup> + <Resource Include="Images\off.png" /> + <Resource Include="Images\on.png" /> + </ItemGroup> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <!-- To modify your build process, add your task inside one of the targets below and uncomment it. Other similar extension points exist, see Microsoft.Common.targets. diff --git a/Software/Visual_Studio/Utilities/Tango.UITests/App.config b/Software/Visual_Studio/Utilities/Tango.UITests/App.config index 8324aa6ff..f2af62f53 100644 --- a/Software/Visual_Studio/Utilities/Tango.UITests/App.config +++ b/Software/Visual_Studio/Utilities/Tango.UITests/App.config @@ -1,6 +1,14 @@ -<?xml version="1.0" encoding="utf-8" ?> +<?xml version="1.0" encoding="utf-8"?> <configuration> <startup> <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6" /> </startup> + <runtime> + <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> + <dependentAssembly> + <assemblyIdentity name="System.Reactive.Core" publicKeyToken="94bc3704cddfc263" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-3.0.3000.0" newVersion="3.0.3000.0" /> + </dependentAssembly> + </assemblyBinding> + </runtime> </configuration>
\ No newline at end of file diff --git a/Software/Visual_Studio/Utilities/Tango.UITests/MainWindow.xaml b/Software/Visual_Studio/Utilities/Tango.UITests/MainWindow.xaml index 861cdfec7..403723a92 100644 --- a/Software/Visual_Studio/Utilities/Tango.UITests/MainWindow.xaml +++ b/Software/Visual_Studio/Utilities/Tango.UITests/MainWindow.xaml @@ -18,6 +18,7 @@ </Window.Resources> <Grid> - <visuals:VUMeter Margin="5 0 0 0" Height="300" TicksCount="14" Orientation="Vertical" Width="70" ShowTicksLabels="True" ShowTicksLines="True" TicksPlacement="BottomRight" Value="50" EmulateOuterLight="True" SunkenLeds="True" TicksMinimum="0" TicksMaximum="100" Minimum="0" Maximum="100" /> + <visuals:Led Width="70" Height="70" IsChecked="{Binding ElementName=chk,Path=IsChecked}" /> + <CheckBox HorizontalAlignment="Left" x:Name="chk">IS ON</CheckBox> </Grid> </Window> |
