aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoy <roy.mail.net@gmail.com>2018-02-11 02:24:33 +0200
committerRoy <roy.mail.net@gmail.com>2018-02-11 02:24:33 +0200
commit6c6dfe112268888b6859da5880d866943d1a4455 (patch)
treedaf4e006d3fefb3d9a6825de3d4ef5575e94714f
parentdbfde8706313c147a28b16bcc7e7fef158d930bb (diff)
downloadTango-6c6dfe112268888b6859da5880d866943d1a4455.tar.gz
Tango-6c6dfe112268888b6859da5880d866943d1a4455.zip
Implemented Save/Load tech project.
Added menu items...
-rw-r--r--Software/DB/Tango.mdfbin75497472 -> 75497472 bytes
-rw-r--r--Software/DB/Tango_log.ldfbin8388608 -> 8388608 bytes
-rw-r--r--Software/Graphics/tft-screen.pngbin0 -> 45731 bytes
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/DispenserElementEditor.xaml2
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/MonitorElementEditor.xaml13
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/MotorElementEditor.xaml2
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Images/tft-screen.pngbin0 -> 45731 bytes
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Project/MachineTechViewProject.cs32
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Tango.MachineStudio.Technician.csproj8
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/DispenserItem.cs2
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/MeterItem.cs2
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/MonitorItem.cs4
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/MotorItem.cs2
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/MultiGraphItem.cs2
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/SingleGraphItem.cs2
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/TechItem.cs23
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/ViewModels/MachineTechViewVM.cs324
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Views/MachineTechView.xaml82
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Views/MachineTechView.xaml.cs2
-rw-r--r--Software/Visual_Studio/Tango.Editors/ElementEditor.cs10
-rw-r--r--Software/Visual_Studio/Tango.Editors/IElementEditor.cs6
-rw-r--r--Software/Visual_Studio/Tango.Settings/MachineStudioSettings/TechnicianModule.cs2
-rw-r--r--Software/Visual_Studio/Tango.Visuals/Images/on.pngbin21260 -> 21414 bytes
23 files changed, 436 insertions, 84 deletions
diff --git a/Software/DB/Tango.mdf b/Software/DB/Tango.mdf
index 6bb71208a..6bbbe45c3 100644
--- a/Software/DB/Tango.mdf
+++ b/Software/DB/Tango.mdf
Binary files differ
diff --git a/Software/DB/Tango_log.ldf b/Software/DB/Tango_log.ldf
index 085c8a4a6..0102215b6 100644
--- a/Software/DB/Tango_log.ldf
+++ b/Software/DB/Tango_log.ldf
Binary files differ
diff --git a/Software/Graphics/tft-screen.png b/Software/Graphics/tft-screen.png
new file mode 100644
index 000000000..d170c7f0f
--- /dev/null
+++ b/Software/Graphics/tft-screen.png
Binary files differ
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/DispenserElementEditor.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/DispenserElementEditor.xaml
index b84da3b42..f1ead0cad 100644
--- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/DispenserElementEditor.xaml
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/DispenserElementEditor.xaml
@@ -69,7 +69,7 @@
</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 RenderTransformOrigin="0.5,0.5" Margin="10" HorizontalAlignment="Left" VerticalAlignment="Bottom" StrokeThickness="1" Stroke="#202020" 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"/>
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 081a853bb..8f66adeeb 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
@@ -31,9 +31,9 @@
<Viewbox Stretch="Fill">
<StackPanel>
<Grid Grid.Column="1" Grid.Row="1" Width="200" Height="120">
- <Border BorderThickness="1" BorderBrush="{StaticResource AccentColorBrush}" CornerRadius="3">
+ <Border BorderThickness="0" BorderBrush="{StaticResource AccentColorBrush}">
<Border.Background>
- <ImageBrush ImageSource="../Images/box.png" Opacity="0.8" />
+ <ImageBrush ImageSource="../Images/tft-screen.png" Opacity="1" />
</Border.Background>
<Grid>
@@ -42,15 +42,6 @@
<SolidColorBrush Color="{Binding Color}"></SolidColorBrush>
</TextBlock.Foreground>
</TextBlock>
-
- <Border CornerRadius="3">
- <Border.Background>
- <LinearGradientBrush Opacity="0.2">
- <GradientStop Color="White"/>
- <GradientStop Color="#FFB8B8B8" Offset="1"/>
- </LinearGradientBrush>
- </Border.Background>
- </Border>
</Grid>
</Border>
</Grid>
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 a69f81538..860072282 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
@@ -65,7 +65,7 @@
</Border.Background>
<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 RenderTransformOrigin="0.5,0.5" StrokeThickness="1" Stroke="#202020" Stretch="Uniform" Margin="15" 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"/>
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Images/tft-screen.png b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Images/tft-screen.png
new file mode 100644
index 000000000..d170c7f0f
--- /dev/null
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Images/tft-screen.png
Binary files differ
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Project/MachineTechViewProject.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Project/MachineTechViewProject.cs
new file mode 100644
index 000000000..700e04f7d
--- /dev/null
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Project/MachineTechViewProject.cs
@@ -0,0 +1,32 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using Tango.MachineStudio.Technician.TechItems;
+using Tango.Serialization;
+
+namespace Tango.MachineStudio.Technician.Project
+{
+ public class MachineTechViewProject
+ {
+ public List<TechItem> Items { get; set; }
+
+ public MachineTechViewProject()
+ {
+ Items = new List<TechItem>();
+ }
+
+ public void Save(String fileName)
+ {
+ XmlDataSerializer serializer = new XmlDataSerializer();
+ serializer.SerializeToFile(this, fileName);
+ }
+
+ public static MachineTechViewProject Load(String fileName)
+ {
+ XmlDataSerializer serializer = new XmlDataSerializer();
+ return serializer.DeserializeFromFile<MachineTechViewProject>(fileName);
+ }
+ }
+}
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 9af2c8ef8..c78eff983 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
@@ -119,6 +119,7 @@
<DependentUpon>MonitorElementEditor.xaml</DependentUpon>
</Compile>
<Compile Include="Helpers\GraphsHelper.cs" />
+ <Compile Include="Project\MachineTechViewProject.cs" />
<Compile Include="PropertiesTemplates\IOTemplate.xaml.cs">
<DependentUpon>IOTemplate.xaml</DependentUpon>
</Compile>
@@ -310,6 +311,10 @@
<Project>{e4927038-348d-4295-aaf4-861c58cb3943}</Project>
<Name>Tango.PMR</Name>
</ProjectReference>
+ <ProjectReference Include="..\..\..\Tango.Serialization\Tango.Serialization.csproj">
+ <Project>{22f87980-e990-4686-be81-be63d562c4d5}</Project>
+ <Name>Tango.Serialization</Name>
+ </ProjectReference>
<ProjectReference Include="..\..\..\Tango.Settings\Tango.Settings.csproj">
<Project>{d8f1ad85-526a-4f50-b6dc-d437af63d8d8}</Project>
<Name>Tango.Settings</Name>
@@ -376,5 +381,8 @@
<ItemGroup>
<Resource Include="Images\binary.png" />
</ItemGroup>
+ <ItemGroup>
+ <Resource Include="Images\tft-screen.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
index 3cea8d127..78440bd5a 100644
--- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/DispenserItem.cs
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/DispenserItem.cs
@@ -21,7 +21,7 @@ namespace Tango.MachineStudio.Technician.TechItems
public TechDispenser TechDispenser
{
get { return _techDispenser; }
- set { _techDispenser = value; RaisePropertyChangedAuto(); RaisePropertyChanged(nameof(Data)); }
+ set { _techDispenser = value; RaisePropertyChangedAuto(); RaisePropertyChanged(nameof(Data)); ItemGuid = value != null ? value.Guid : null; }
}
private bool _isHoming;
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 7cc2913eb..f0e7a8b8b 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
@@ -18,7 +18,7 @@ namespace Tango.MachineStudio.Technician.TechItems
public TechMonitor TechMonitor
{
get { return _techMonitor; }
- set { _techMonitor = value; RaisePropertyChangedAuto(); RaisePropertyChanged(nameof(Data)); }
+ set { _techMonitor = value; RaisePropertyChangedAuto(); RaisePropertyChanged(nameof(Data)); ItemGuid = value != null ? value.Guid : null; }
}
private double _value;
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/MonitorItem.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/MonitorItem.cs
index 50cd2e8eb..59ccb6819 100644
--- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/MonitorItem.cs
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/MonitorItem.cs
@@ -17,7 +17,7 @@ namespace Tango.MachineStudio.Technician.TechItems
public TechMonitor TechMonitor
{
get { return _techMonitor; }
- set { _techMonitor = value; RaisePropertyChangedAuto(); RaisePropertyChanged(nameof(Data)); }
+ set { _techMonitor = value; RaisePropertyChangedAuto(); RaisePropertyChanged(nameof(Data)); ItemGuid = value != null ? value.Guid : null; }
}
private double _value;
@@ -43,7 +43,7 @@ namespace Tango.MachineStudio.Technician.TechItems
public MonitorItem() : base()
{
Name = "Monitor";
- Color = Color.FromRgb(20, 20, 20);
+ Color = Colors.White;
Description = "Simple analogue monitor";
Image = ResourceHelper.GetImageFromResources("Images/analog.png");
LastUpdateTime = DateTime.Now;
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 272aedf44..3cd67c3ec 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
@@ -21,7 +21,7 @@ namespace Tango.MachineStudio.Technician.TechItems
public TechMotor TechMotor
{
get { return _techMotor; }
- set { _techMotor = value; RaisePropertyChangedAuto(); RaisePropertyChanged(nameof(Data)); }
+ set { _techMotor = value; RaisePropertyChangedAuto(); RaisePropertyChanged(nameof(Data)); ItemGuid = value != null ? value.Guid : null; }
}
private bool _isHoming;
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/MultiGraphItem.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/MultiGraphItem.cs
index a642d63e2..67a0f4de7 100644
--- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/MultiGraphItem.cs
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/MultiGraphItem.cs
@@ -30,6 +30,8 @@ namespace Tango.MachineStudio.Technician.TechItems
Editor.InnerGraph.InnerGraph.MaxPoints = Common.Helpers.GraphsHelper.GetMaxPoints(TechMonitor.PointsPerFrame);
Editor.InnerGraph.InvalidateGraph();
}
+
+ ItemGuid = value != null ? value.Guid : null;
}
}
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/SingleGraphItem.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/SingleGraphItem.cs
index ff87aa44d..488ac8d3c 100644
--- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/SingleGraphItem.cs
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/SingleGraphItem.cs
@@ -30,6 +30,8 @@ namespace Tango.MachineStudio.Technician.TechItems
Editor.InnerGraph.InnerGraph.MaxPoints = Common.Helpers.GraphsHelper.GetMaxPoints(TechMonitor.PointsPerFrame);
Editor.InnerGraph.InvalidateGraph();
}
+
+ ItemGuid = value != null ? value.Guid : null;
}
}
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/TechItem.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/TechItem.cs
index 0ae6218cf..fdabc7dd3 100644
--- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/TechItem.cs
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/TechItem.cs
@@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
+using System.Windows;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Xml.Serialization;
@@ -11,6 +12,13 @@ using Tango.Integration.Observables;
namespace Tango.MachineStudio.Technician.TechItems
{
+ [XmlInclude(typeof(DispenserItem))]
+ [XmlInclude(typeof(IOItem))]
+ [XmlInclude(typeof(MeterItem))]
+ [XmlInclude(typeof(MonitorItem))]
+ [XmlInclude(typeof(MotorItem))]
+ [XmlInclude(typeof(MultiGraphItem))]
+ [XmlInclude(typeof(SingleGraphItem))]
public abstract class TechItem : ExtendedObject
{
public TechItem()
@@ -114,6 +122,8 @@ namespace Tango.MachineStudio.Technician.TechItems
[XmlIgnore]
public abstract object Data { get; }
+ public String ItemGuid { get; set; }
+
private Color _color;
[XmlIgnore]
public Color Color
@@ -145,5 +155,18 @@ namespace Tango.MachineStudio.Technician.TechItems
return items;
}
+
+ public void SetBounds(Rect bounds)
+ {
+ Left = bounds.Left;
+ Top = bounds.Top;
+ Width = bounds.Width;
+ Height = bounds.Height;
+ }
+
+ public Rect GetBounds()
+ {
+ return new Rect(Left, Top, Width, Height);
+ }
}
}
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 21d2c50c2..ca318f029 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
@@ -1,4 +1,5 @@
using Google.Protobuf.Collections;
+using Microsoft.Win32;
using RealTimeGraphEx.Controllers;
using System;
using System.Collections.Generic;
@@ -16,6 +17,7 @@ using Tango.Integration.Observables;
using Tango.Integration.Operators;
using Tango.MachineStudio.Common.StudioApplication;
using Tango.MachineStudio.Technician.Editors;
+using Tango.MachineStudio.Technician.Project;
using Tango.MachineStudio.Technician.TechItems;
using Tango.PMR.Diagnostics;
using Tango.SharedUI;
@@ -29,7 +31,12 @@ namespace Tango.MachineStudio.Technician.ViewModels
private Dictionary<MultiGraphItem, GraphMultiController> _multiControllers;
private static object _elementsLock = new object();
+ #region Properties
+
private ObservableCollection<IElementEditor> _elements;
+ /// <summary>
+ /// Gets or sets the visual elements.
+ /// </summary>
public ObservableCollection<IElementEditor> Elements
{
get { return _elements; }
@@ -37,6 +44,9 @@ namespace Tango.MachineStudio.Technician.ViewModels
}
private ObservableCollection<TechItem> _availableTechItems;
+ /// <summary>
+ /// Gets or sets the available tech items.
+ /// </summary>
public ObservableCollection<TechItem> AvailableTechItems
{
get { return _availableTechItems; }
@@ -44,25 +54,49 @@ namespace Tango.MachineStudio.Technician.ViewModels
}
private TechItem _selectedTechItem;
-
+ /// <summary>
+ /// Gets or sets the selected available tech item.
+ /// </summary>
public TechItem SelectedTechItem
{
get { return _selectedTechItem; }
set { _selectedTechItem = value; RaisePropertyChangedAuto(); }
}
+ /// <summary>
+ /// Gets or sets the db adapter.
+ /// </summary>
public ObservablesEntitiesAdapter Adapter { get; set; }
+ /// <summary>
+ /// Gets or sets the application manager.
+ /// </summary>
public IStudioApplicationManager ApplicationManager { get; set; }
private IMachineOperator _machineOperator;
-
+ /// <summary>
+ /// Gets or sets the machine operator.
+ /// </summary>
public IMachineOperator MachineOperator
{
get { return _machineOperator; }
set { _machineOperator = value; RaisePropertyChangedAuto(); }
}
+ #endregion
+
+ #region Commands
+
+ public RelayCommand SaveAsProjectCommand { get; set; }
+
+ public RelayCommand SaveProjectCommand { get; set; }
+
+ public RelayCommand OpenProjectCommand { get; set; }
+
+ #endregion
+
+ #region Constructors
+
public MachineTechViewVM(IStudioApplicationManager applicationManager)
{
_singleControllers = new Dictionary<SingleGraphItem, GraphController>();
@@ -74,10 +108,21 @@ namespace Tango.MachineStudio.Technician.ViewModels
ApplicationManager.ConnectedMachineChanged += ApplicationManager_ConnectedMachineChanged;
Adapter = ObservablesEntitiesAdapter.Instance;
- //Adapter.Initialize(); //TODO: Remove on Machine Studio.
Elements = new ObservableCollection<IElementEditor>();
+
+ OpenProjectCommand = new RelayCommand(OpenProject);
+ SaveAsProjectCommand = new RelayCommand(SaveAsProject);
}
+ #endregion
+
+ #region Event Handlers
+
+ /// <summary>
+ /// Applications the manager connected machine changed.
+ /// </summary>
+ /// <param name="sender">The sender.</param>
+ /// <param name="machine">The machine.</param>
private void ApplicationManager_ConnectedMachineChanged(object sender, Integration.Services.IExternalBridgeClient machine)
{
MachineOperator = machine;
@@ -89,11 +134,20 @@ namespace Tango.MachineStudio.Technician.ViewModels
}
}
+ /// <summary>
+ /// Machines the operator diagnostics data available.
+ /// </summary>
+ /// <param name="sender">The sender.</param>
+ /// <param name="response">The response.</param>
private void MachineOperator_DiagnosticsDataAvailable(object sender, PushDiagnosticsResponse response)
{
PopulateDiagnosticsData(response);
}
+ #endregion
+
+ #region Populate Diagnostics Data
+
private void PopulateDiagnosticsData(PushDiagnosticsResponse data)
{
lock (_elementsLock)
@@ -175,6 +229,10 @@ namespace Tango.MachineStudio.Technician.ViewModels
}
}
+ #endregion
+
+ #region Private Methods
+
private double GetLastMonitorValue(TechMonitor monitor, object value)
{
if (!monitor.MultiChannel)
@@ -200,81 +258,107 @@ namespace Tango.MachineStudio.Technician.ViewModels
return arrayOfDoubles.Select(x => x.Data.ToList()).ToList();
}
- public void AddElement(Rect bounds)
+ #endregion
+
+ #region Add/Remove Element
+
+ public void CreateElement(Rect bounds)
+ {
+ CreateElement(SelectedTechItem, bounds);
+ }
+
+ private void CreateElement(TechItem item, Rect bounds)
{
- if (SelectedTechItem is MonitorItem)
+ if (item is MonitorItem)
{
- var monitorItem = new MonitorItem(Adapter.TechMonitors.Where(x => !x.MultiChannel).FirstOrDefault());
- MonitorElementEditor editor = new MonitorElementEditor(monitorItem, bounds);
- Elements.Add(editor);
+ CreateElement<MonitorElementEditor, MonitorItem, TechMonitor>(bounds, Adapter.TechMonitors.Where(x => !x.MultiChannel).FirstOrDefault());
}
- else if (SelectedTechItem is MeterItem)
+ else if (item is MeterItem)
{
- var meterItem = new MeterItem(Adapter.TechMonitors.Where(x => !x.MultiChannel).FirstOrDefault());
- MeterElementEditor editor = new MeterElementEditor(meterItem, bounds);
- Elements.Add(editor);
+ CreateElement<MeterElementEditor, MeterItem, TechMonitor>(bounds, Adapter.TechMonitors.Where(x => !x.MultiChannel).FirstOrDefault());
}
- else if (SelectedTechItem is SingleGraphItem)
+ else if (item is SingleGraphItem)
{
- var graphItem = new SingleGraphItem(Adapter.TechMonitors.Where(x => !x.MultiChannel).FirstOrDefault());
- SingleGraphElementEditor editor = new SingleGraphElementEditor(graphItem, bounds);
- editor.InnerGraph.InnerGraph.MaxPoints = Common.Helpers.GraphsHelper.GetMaxPoints(graphItem.TechMonitor.PointsPerFrame);
- graphItem.Editor = editor;
-
-
- GraphController controller = new GraphController();
- editor.InnerGraph.Controller = controller;
-
- _singleControllers.Add(graphItem, controller);
-
- Elements.Add(editor);
+ var editor = CreateElement<SingleGraphElementEditor, SingleGraphItem, TechMonitor>(bounds, Adapter.TechMonitors.Where(x => !x.MultiChannel).FirstOrDefault());
+ InitSingleGraphitem(editor.GraphItem, editor);
}
- else if (SelectedTechItem is MultiGraphItem)
+ else if (item is MultiGraphItem)
{
- var graphItem = new MultiGraphItem(Adapter.TechMonitors.Where(x => x.MultiChannel).FirstOrDefault());
- MultiGraphElementEditor editor = new MultiGraphElementEditor(graphItem, bounds);
- editor.InnerGraph.InnerGraph.MaxPoints = Common.Helpers.GraphsHelper.GetMaxPoints(graphItem.TechMonitor.PointsPerFrame);
- graphItem.Editor = editor;
-
-
- GraphMultiController controller = new GraphMultiController();
-
- for (int i = 0; i < graphItem.TechMonitor.ChannelCount; i++)
- {
- controller.AddSeries(new RealTimeGraphEx.DataSeries.DataYSeries()
- {
- UseFillAndStroke = true,
- Name = graphItem.TechMonitor.Name.First() + (i + 1).ToString(),
- Stroke = new SolidColorBrush(ColorHelper.GetRandomColor()),
- });
- }
+ var editor = CreateElement<MultiGraphElementEditor, MultiGraphItem, TechMonitor>(bounds, Adapter.TechMonitors.Where(x => x.MultiChannel).FirstOrDefault());
+ InitMultiGraphItem(editor.GraphItem, editor);
+ }
+ else if (item is MotorItem)
+ {
+ var editor = CreateElement<MotorElementEditor, MotorItem, TechMotor>(bounds, Adapter.TechMotors.FirstOrDefault());
+ InitMotorItem(editor.MotorItem);
+ }
+ else if (item is DispenserItem)
+ {
+ var editor = CreateElement<DispenserElementEditor, DispenserItem, TechDispenser>(bounds, Adapter.TechDispensers.FirstOrDefault());
+ InitDispenserItem(editor.DispenserItem);
+ }
+ else if (item is IOItem)
+ {
+ var editor = CreateElement<IOElementEditor, IOItem, int>(bounds, 0);
+ InitIOItem(editor.IOItem);
+ }
+ }
- editor.InnerGraph.Controller = controller;
+ private Editor CreateElement<Editor, Tech, Value>(Rect bounds, Value value) where Editor : IElementEditor where Tech : TechItem
+ {
+ TechItem item = Activator.CreateInstance(typeof(Tech), new object[] { value }) as TechItem;
+ IElementEditor editor = Activator.CreateInstance(typeof(Editor), new object[] { ((Tech)item), bounds }) as IElementEditor;
+ Elements.Add(editor);
+ return (Editor)editor;
+ }
- _multiControllers.Add(graphItem, controller);
+ private Editor CreateElement<Editor>(TechItem item) where Editor : IElementEditor
+ {
+ IElementEditor editor = Activator.CreateInstance(typeof(Editor), new object[] { item, item.GetBounds() }) as IElementEditor;
+ Elements.Add(editor);
+ return (Editor)editor;
+ }
- Elements.Add(editor);
+ private void AddTechItem(TechItem item)
+ {
+ if (item is MonitorItem)
+ {
+ (item as MonitorItem).TechMonitor = Adapter.TechMonitors.Where(x => !x.MultiChannel).FirstOrDefault(x => x.Guid == item.ItemGuid);
+ CreateElement<MonitorElementEditor>(item);
+ }
+ else if (item is MeterItem)
+ {
+ (item as MeterItem).TechMonitor = Adapter.TechMonitors.Where(x => !x.MultiChannel).FirstOrDefault(x => x.Guid == item.ItemGuid);
+ CreateElement<MeterElementEditor>(item);
}
- else if (SelectedTechItem is MotorItem)
+ else if (item is SingleGraphItem)
{
- var motorItem = new MotorItem(Adapter.TechMotors.FirstOrDefault());
- MotorElementEditor editor = new MotorElementEditor(motorItem, bounds);
- Elements.Add(editor);
- InitMotorItem(motorItem);
+ (item as SingleGraphItem).TechMonitor = Adapter.TechMonitors.Where(x => !x.MultiChannel).FirstOrDefault(x => x.Guid == item.ItemGuid);
+ var editor = CreateElement<SingleGraphElementEditor>(item);
+ InitSingleGraphitem(editor.GraphItem, editor);
}
- else if (SelectedTechItem is DispenserItem)
+ else if (item is MultiGraphItem)
{
- var dispenserItem = new DispenserItem(Adapter.TechDispensers.FirstOrDefault());
- DispenserElementEditor editor = new DispenserElementEditor(dispenserItem, bounds);
- Elements.Add(editor);
- InitDispenserItem(dispenserItem);
+ (item as MultiGraphItem).TechMonitor = Adapter.TechMonitors.Where(x => x.MultiChannel).FirstOrDefault(x => x.Guid == item.ItemGuid);
+ var editor = CreateElement<MultiGraphElementEditor>(item);
+ InitMultiGraphItem(editor.GraphItem, editor);
}
- else if (SelectedTechItem is IOItem)
+ else if (item is MotorItem)
{
- var ioItem = new IOItem(0);
- IOElementEditor editor = new IOElementEditor(ioItem, bounds);
- Elements.Add(editor);
- InitIOItem(ioItem);
+ (item as MotorItem).TechMotor = Adapter.TechMotors.FirstOrDefault(x => x.Guid == item.ItemGuid);
+ var editor = CreateElement<MotorElementEditor>(item);
+ InitMotorItem(editor.MotorItem);
+ }
+ else if (item is DispenserItem)
+ {
+ (item as DispenserItem).TechDispenser = Adapter.TechDispensers.FirstOrDefault(x => x.Guid == item.ItemGuid);
+ var editor = CreateElement<DispenserElementEditor>(item);
+ InitDispenserItem(editor.DispenserItem);
+ }
+ else if (item is IOItem)
+ {
+ var editor = CreateElement<IOElementEditor>(item);
+ InitIOItem(editor.IOItem);
}
}
@@ -335,9 +419,28 @@ namespace Tango.MachineStudio.Technician.ViewModels
_multiControllers.Add(graphItem, controller);
}
+ else if (element is MotorElementEditor)
+ {
+ var motorItem = element.HostedElement as MotorItem;
+ InitMotorItem(motorItem);
+ }
+ else if (element is DispenserElementEditor)
+ {
+ var dispenser = element.HostedElement as DispenserItem;
+ InitDispenserItem(dispenser);
+ }
+ else if (element is IOElementEditor)
+ {
+ var ioItem = element.HostedElement as IOItem;
+ InitIOItem(ioItem);
+ }
}
}
+ #endregion
+
+ #region Init Tech Items
+
private void InitMotorItem(MotorItem item)
{
item.ActionExecuted += async (x, action) =>
@@ -492,5 +595,104 @@ namespace Tango.MachineStudio.Technician.ViewModels
}
};
}
+
+ private void InitSingleGraphitem(SingleGraphItem item, SingleGraphElementEditor editor)
+ {
+ editor.InnerGraph.InnerGraph.MaxPoints = Common.Helpers.GraphsHelper.GetMaxPoints(item.TechMonitor.PointsPerFrame);
+ item.Editor = editor;
+
+ GraphController controller = new GraphController();
+ editor.InnerGraph.Controller = controller;
+
+ _singleControllers.Add(item, controller);
+ }
+
+ private void InitMultiGraphItem(MultiGraphItem item, MultiGraphElementEditor editor)
+ {
+ editor.InnerGraph.InnerGraph.MaxPoints = Common.Helpers.GraphsHelper.GetMaxPoints(item.TechMonitor.PointsPerFrame);
+ item.Editor = editor;
+
+ GraphMultiController controller = new GraphMultiController();
+
+ for (int i = 0; i < item.TechMonitor.ChannelCount; i++)
+ {
+ controller.AddSeries(new RealTimeGraphEx.DataSeries.DataYSeries()
+ {
+ UseFillAndStroke = true,
+ Name = item.TechMonitor.Name.First() + (i + 1).ToString(),
+ Stroke = new SolidColorBrush(ColorHelper.GetRandomColor()),
+ });
+ }
+
+ editor.InnerGraph.Controller = controller;
+
+ _multiControllers.Add(item, controller);
+ }
+
+ #endregion
+
+ #region Public Methods
+
+ public void OpenProject()
+ {
+ OpenFileDialog dlg = new OpenFileDialog();
+ dlg.Title = "Select Technician Project File";
+ dlg.Filter = "Technician Project File|*.tpf";
+
+ if (dlg.ShowDialog().Value)
+ {
+ OpenProjectFile(dlg.FileName);
+ }
+ }
+
+ public void OpenProjectFile(String fileName)
+ {
+ LoadProject(MachineTechViewProject.Load(fileName));
+ }
+
+ public void LoadProject(MachineTechViewProject project)
+ {
+ Elements.Clear();
+ _singleControllers.Clear();
+ _multiControllers.Clear();
+
+ foreach (var item in project.Items)
+ {
+ AddTechItem(item);
+ }
+ }
+
+ private void SaveAsProject()
+ {
+ SaveFileDialog dlg = new SaveFileDialog();
+ dlg.Title = "Select Technician Project Location";
+ dlg.Filter = "Technician Project File|*.tpf";
+
+ if (dlg.ShowDialog().Value)
+ {
+ SaveProject(dlg.FileName);
+ }
+ }
+
+ private void SaveProject(String fileName)
+ {
+ MachineTechViewProject project = CreateProjectFile();
+ project.Save(fileName);
+ }
+
+ private MachineTechViewProject CreateProjectFile()
+ {
+ MachineTechViewProject project = new MachineTechViewProject();
+
+ foreach (var element in Elements)
+ {
+ (element.HostedElement as TechItem).SetBounds(element.GetBounds());
+ project.Items.Add(element.HostedElement as TechItem);
+ }
+
+ return project;
+ }
+
+ #endregion
}
}
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 494f0892f..9ade3f08b 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
@@ -5,6 +5,7 @@
xmlns:vm="clr-namespace:Tango.MachineStudio.Technician.ViewModels"
xmlns:global="clr-namespace:Tango.MachineStudio.Technician"
xmlns:sys="clr-namespace:System;assembly=mscorlib"
+ xmlns:fa="http://schemas.fontawesome.io/icons/"
xmlns:editors="clr-namespace:Tango.Editors;assembly=Tango.Editors"
xmlns:techItems="clr-namespace:Tango.MachineStudio.Technician.TechItems"
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
@@ -34,10 +35,83 @@
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
- <Menu Padding="5" Background="Transparent">
- <MenuItem Header="File"></MenuItem>
- <MenuItem Header="Edit"></MenuItem>
- <MenuItem Header="View"></MenuItem>
+ <Menu Padding="5" Background="#C6ECECEC">
+ <MenuItem Header="File">
+ <MenuItem Command="{Binding OpenProjectCommand}" MinWidth="180" Header="Open" VerticalContentAlignment="Center">
+ <MenuItem.Icon>
+ <fa:ImageAwesome Icon="FolderOpen" Width="16" />
+ </MenuItem.Icon>
+ </MenuItem>
+ <Separator/>
+ <MenuItem Header="Save" Command="{Binding SaveProjectCommand}">
+ <MenuItem.Icon>
+ <fa:ImageAwesome Icon="Save" Width="16" />
+ </MenuItem.Icon>
+ </MenuItem>
+ <MenuItem Header="Save as" Command="{Binding SaveAsProjectCommand}">
+ <MenuItem.Icon>
+ <fa:ImageAwesome Icon="Save" Width="16" />
+ </MenuItem.Icon>
+ </MenuItem>
+ </MenuItem>
+ <MenuItem Header="Edit">
+ <MenuItem Header="Cut (Ctrl+X)" Command="{Binding ElementName=editor,Path=CutCommand}" MinWidth="210">
+ <MenuItem.Icon>
+ <fa:ImageAwesome Icon="Cut" Width="16" />
+ </MenuItem.Icon>
+ </MenuItem>
+ <MenuItem Header="Copy (Ctrl+C)" Command="{Binding ElementName=editor,Path=CopyCommand}">
+ <MenuItem.Icon>
+ <fa:ImageAwesome Icon="Copy" Width="16" />
+ </MenuItem.Icon>
+ </MenuItem>
+ <MenuItem Header="Paste (Ctrl+V)" Command="{Binding ElementName=editor,Path=PasteCommand}">
+ <MenuItem.Icon>
+ <fa:ImageAwesome Icon="Paste" Width="16" />
+ </MenuItem.Icon>
+ </MenuItem>
+ <Separator/>
+ <MenuItem Header="Undo (Ctrl+Z)" Command="{Binding ElementName=editor,Path=UndoCommand}">
+ <MenuItem.Icon>
+ <fa:ImageAwesome Icon="Undo" Width="16" />
+ </MenuItem.Icon>
+ </MenuItem>
+ <MenuItem Header="Redo (Ctrl+Y)" Command="{Binding ElementName=editor,Path=RedoCommand}">
+ <MenuItem.Icon>
+ <fa:ImageAwesome Icon="RotateRight" Width="16"></fa:ImageAwesome>
+ </MenuItem.Icon>
+ </MenuItem>
+ <Separator/>
+ <MenuItem Header="Delete (DELETE)" Command="{Binding ElementName=editor,Path=DeleteCommand}">
+ <MenuItem.Icon>
+ <fa:ImageAwesome Icon="Recycle" Width="16" />
+ </MenuItem.Icon>
+ </MenuItem>
+ <Separator/>
+ <MenuItem Header="Select All (Ctrl+A)" Command="{Binding ElementName=editor,Path=SelectAllCommand}">
+ <MenuItem.Icon>
+ <fa:ImageAwesome Icon="Th" Width="16" />
+ </MenuItem.Icon>
+ </MenuItem>
+ </MenuItem>
+ <MenuItem Header="View">
+ <MenuItem Header="Zoom In" Command="{Binding ElementName=editor,Path=ZoomCommand}" CommandParameter="0.1">
+ <MenuItem.Icon>
+ <fa:ImageAwesome Icon="SearchPlus" Width="16" />
+ </MenuItem.Icon>
+ </MenuItem>
+ <MenuItem Header="Zoom Out" Command="{Binding ElementName=editor,Path=ZoomCommand}" CommandParameter="-0.1">
+ <MenuItem.Icon>
+ <fa:ImageAwesome Icon="SearchMinus" Width="16" />
+ </MenuItem.Icon>
+ </MenuItem>
+ <Separator/>
+ <MenuItem Header="Reset Zoom" Command="{Binding ElementName=editor,Path=ResetZoomCommand}">
+ <MenuItem.Icon>
+ <fa:ImageAwesome Icon="Search" Width="16" />
+ </MenuItem.Icon>
+ </MenuItem>
+ </MenuItem>
</Menu>
<Grid Grid.Row="1">
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Views/MachineTechView.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Views/MachineTechView.xaml.cs
index 6b84fb363..b60f4d725 100644
--- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Views/MachineTechView.xaml.cs
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Views/MachineTechView.xaml.cs
@@ -43,7 +43,7 @@ namespace Tango.MachineStudio.Technician.Views
private void ElementsEditor_ElementCreation(object sender, ElementCreationEventArgs e)
{
- _vm.AddElement(e.Bounds);
+ _vm.CreateElement(e.Bounds);
e.AppendUndoState = true;
}
diff --git a/Software/Visual_Studio/Tango.Editors/ElementEditor.cs b/Software/Visual_Studio/Tango.Editors/ElementEditor.cs
index 99520ba5b..5d90a2b4c 100644
--- a/Software/Visual_Studio/Tango.Editors/ElementEditor.cs
+++ b/Software/Visual_Studio/Tango.Editors/ElementEditor.cs
@@ -235,6 +235,15 @@ namespace Tango.Editors
Height = bounds.Height;
}
+ /// <summary>
+ /// Gets the editor bounds.
+ /// </summary>
+ /// <returns></returns>
+ public virtual Rect GetBounds()
+ {
+ return new Rect(Left, Top, Width, Height);
+ }
+
#endregion
#region Protected Methods
@@ -624,6 +633,7 @@ namespace Tango.Editors
/// <returns></returns>
public abstract IElementEditor Clone();
+
#endregion
#region IConfigurable Members
diff --git a/Software/Visual_Studio/Tango.Editors/IElementEditor.cs b/Software/Visual_Studio/Tango.Editors/IElementEditor.cs
index fc7c93396..dfe539537 100644
--- a/Software/Visual_Studio/Tango.Editors/IElementEditor.cs
+++ b/Software/Visual_Studio/Tango.Editors/IElementEditor.cs
@@ -103,6 +103,12 @@ namespace Tango.Editors
void SetBounds(Rect bounds);
/// <summary>
+ /// Gets the editor bounds.
+ /// </summary>
+ /// <returns></returns>
+ Rect GetBounds();
+
+ /// <summary>
/// Gets or sets an optional attached element for editors mirroring mode.
/// </summary>
IElementEditor AttachedEditor { get; set; }
diff --git a/Software/Visual_Studio/Tango.Settings/MachineStudioSettings/TechnicianModule.cs b/Software/Visual_Studio/Tango.Settings/MachineStudioSettings/TechnicianModule.cs
index 57eb03440..fe5a27848 100644
--- a/Software/Visual_Studio/Tango.Settings/MachineStudioSettings/TechnicianModule.cs
+++ b/Software/Visual_Studio/Tango.Settings/MachineStudioSettings/TechnicianModule.cs
@@ -12,6 +12,8 @@ namespace Tango.Settings.MachineStudioSettings
public int GraphsPullingInterval { get; set; }
+ public object MachineViewProject { get; set; }
+
public TechnicianModule()
{
GraphsDuration = 10;
diff --git a/Software/Visual_Studio/Tango.Visuals/Images/on.png b/Software/Visual_Studio/Tango.Visuals/Images/on.png
index fc057a658..bce56ad5d 100644
--- a/Software/Visual_Studio/Tango.Visuals/Images/on.png
+++ b/Software/Visual_Studio/Tango.Visuals/Images/on.png
Binary files differ