aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/MachineStudio
diff options
context:
space:
mode:
authorRoy Ben-Shabat <Roy@Twine-s.com>2018-02-08 13:11:43 +0200
committerRoy Ben-Shabat <Roy@Twine-s.com>2018-02-08 13:11:43 +0200
commit4cf9cd72047bbb5a1c83255721870d29bbdb03f7 (patch)
tree62f9088a8342270eb585015a75cd171a04c390bb /Software/Visual_Studio/MachineStudio
parent0907f58b81e29d9c0f415e2c7660ad60787f281b (diff)
downloadTango-4cf9cd72047bbb5a1c83255721870d29bbdb03f7.tar.gz
Tango-4cf9cd72047bbb5a1c83255721870d29bbdb03f7.zip
Added new tech tables..
Diffstat (limited to 'Software/Visual_Studio/MachineStudio')
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels/IOVM.cs6
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels/MainViewVM.cs10
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels/MonitoringViewVM.cs2
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/MainView.xaml2
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/MainView.xaml.cs4
-rw-r--r--Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/MachineTech/MachineTechView.xaml62
-rw-r--r--Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/MachineTech/MachineTechView.xaml.cs28
-rw-r--r--Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Tango.MachineStudio.Common.csproj13
-rw-r--r--Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/ViewModelLocator.cs33
-rw-r--r--Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/ViewModels/MachineTechViewVM.cs13
10 files changed, 161 insertions, 12 deletions
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels/IOVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels/IOVM.cs
index e2a4fae0e..cc4170827 100644
--- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels/IOVM.cs
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels/IOVM.cs
@@ -10,8 +10,8 @@ namespace Tango.MachineStudio.Developer.ViewModels
{
public class IOVM : ExtendedObject
{
- private Graph _io;
- public Graph IO
+ private TechMonitor _io;
+ public TechMonitor IO
{
get { return _io; }
set { _io = value; RaisePropertyChangedAuto(); }
@@ -38,7 +38,7 @@ namespace Tango.MachineStudio.Developer.ViewModels
set { _value = value; RaisePropertyChanged(nameof(Value)); }
}
- public IOVM(Graph io, String name)
+ public IOVM(TechMonitor io, String name)
{
IO = io;
Name = name;
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels/MainViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels/MainViewVM.cs
index e1166a9bc..3c83579ec 100644
--- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels/MainViewVM.cs
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels/MainViewVM.cs
@@ -209,11 +209,11 @@ namespace Tango.MachineStudio.Developer.ViewModels
set { _isSideBarOpened = value; RaisePropertyChangedAuto(); }
}
- private ObservableCollection<Graph> _availableGraphs;
+ private ObservableCollection<TechMonitor> _availableGraphs;
/// <summary>
/// Gets or sets the available sensors.
/// </summary>
- public ObservableCollection<Graph> AvailableGraphs
+ public ObservableCollection<TechMonitor> AvailableGraphs
{
get { return _availableGraphs; }
set { _availableGraphs = value; RaisePropertyChangedAuto(); }
@@ -475,7 +475,7 @@ namespace Tango.MachineStudio.Developer.ViewModels
if (!this.DesignMode)
{
Adapter = ObservablesEntitiesAdapter.Instance;
- AvailableGraphs = Adapter.Graphs.ToObservableCollection();
+ AvailableGraphs = Adapter.TechMonitors.ToObservableCollection();
}
Graphs = new ObservableCollection<IRealTimeGraph>();
@@ -1124,7 +1124,7 @@ namespace Tango.MachineStudio.Developer.ViewModels
/// Add sensor graph from available sensors to displayed graphs.
/// </summary>
/// <param name="sensor">The sensor.</param>
- public void OnDropAvailableGraph(Graph sensor)
+ public void OnDropAvailableGraph(TechMonitor sensor)
{
if (Graphs.Count < 8)
{
@@ -1208,7 +1208,7 @@ namespace Tango.MachineStudio.Developer.ViewModels
/// <param name="graph">The graph.</param>
public void RemoveGraph(IRealTimeGraph graph)
{
- var sensor = graph.Tag as Graph;
+ var sensor = graph.Tag as TechMonitor;
_controllers.Remove(sensor.Name);
graph.InnerGraph.Dispose();
Graphs.Remove(graph);
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels/MonitoringViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels/MonitoringViewVM.cs
index a0cba6b6b..99fbc5114 100644
--- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels/MonitoringViewVM.cs
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels/MonitoringViewVM.cs
@@ -47,7 +47,7 @@ namespace Tango.MachineStudio.Developer.ViewModels
if (!this.DesignMode)
{
Adapter = ObservablesEntitiesAdapter.Instance;
- AvailableControllers = Adapter.Graphs.Select(x => new IOVM(x, x.Name)).ToObservableCollection();
+ AvailableControllers = Adapter.TechMonitors.Select(x => new IOVM(x, x.Name)).ToObservableCollection();
}
Controllers = new ObservableCollection<IOVM>();
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/MainView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/MainView.xaml
index 9f0927c63..4cbae2941 100644
--- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/MainView.xaml
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/MainView.xaml
@@ -1796,7 +1796,7 @@
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate>
- <DataTemplate DataType="{x:Type observables:Graph}">
+ <DataTemplate DataType="{x:Type observables:TechMonitor}">
<Border dragAndDrop:DragAndDropService.Draggable="True" dragAndDrop:DragAndDropService.DraggingSurface="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DraggingSurface}" Margin="5" CornerRadius="3" Height="120" BorderThickness="1" BorderBrush="Silver" ClipToBounds="True">
<Border.Background>
<ImageBrush ImageSource="../Images/line_graph.png" Stretch="Fill"></ImageBrush>
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/MainView.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/MainView.xaml.cs
index 3922d80b2..d47a7ecb1 100644
--- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/MainView.xaml.cs
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/MainView.xaml.cs
@@ -106,9 +106,9 @@ namespace Tango.MachineStudio.Developer.Views
private void OnDropAvailableGraph(object sender, DropEventArgs e)
{
- if (e.Draggable.DataContext is Graph)
+ if (e.Draggable.DataContext is TechMonitor)
{
- _vm.OnDropAvailableGraph(e.Draggable.DataContext as Graph);
+ _vm.OnDropAvailableGraph(e.Draggable.DataContext as TechMonitor);
}
}
diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/MachineTech/MachineTechView.xaml b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/MachineTech/MachineTechView.xaml
new file mode 100644
index 000000000..192122a30
--- /dev/null
+++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/MachineTech/MachineTechView.xaml
@@ -0,0 +1,62 @@
+<UserControl x:Class="Tango.MachineStudio.Common.MachineTech.MachineTechView"
+ 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:vm="clr-namespace:Tango.MachineStudio.Common.ViewModels"
+ xmlns:global="clr-namespace:Tango.MachineStudio.Common"
+ xmlns:editors="clr-namespace:Tango.Editors;assembly=Tango.Editors"
+ xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
+ xmlns:mahapps="http://metro.mahapps.com/winfx/xaml/controls"
+ xmlns:converters="clr-namespace:Tango.SharedUI.Converters;assembly=Tango.SharedUI"
+ xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+ xmlns:local="clr-namespace:Tango.MachineStudio.Common.MachineTech"
+ mc:Ignorable="d"
+ d:DesignHeight="720" d:DesignWidth="1280" Background="White" d:DataContext="{d:DesignInstance Type=vm:MachineTechViewVM, IsDesignTimeCreatable=False}" DataContext="{x:Static global:ViewModelLocator.MachineTechViewVM}">
+
+ <UserControl.Resources>
+ <ResourceDictionary Source="pack://application:,,,/Tango.MachineStudio.Common;component/Resources/MaterialDesign.xaml"></ResourceDictionary>
+ </UserControl.Resources>
+
+ <Grid>
+ <Grid>
+ <Grid.RowDefinitions>
+ <RowDefinition Height="150"/>
+ <RowDefinition Height="199*"/>
+ </Grid.RowDefinitions>
+
+ <Grid>
+ <Grid.RowDefinitions>
+ <RowDefinition Height="Auto"/>
+ <RowDefinition Height="1*"/>
+ </Grid.RowDefinitions>
+
+ <Menu Padding="5">
+ <MenuItem Header="File"></MenuItem>
+ <MenuItem Header="Edit"></MenuItem>
+ <MenuItem Header="View"></MenuItem>
+ </Menu>
+
+ <Grid Grid.Row="1">
+
+ </Grid>
+ </Grid>
+
+ <Grid Grid.Row="1" Margin="5">
+ <Grid.ColumnDefinitions>
+ <ColumnDefinition Width="1*"/>
+ <ColumnDefinition Width="220"/>
+ </Grid.ColumnDefinitions>
+
+ <Grid>
+ <editors:ElementsEditor Margin="0 0 5 0" RulerHeight="32" FontSize="10" Background="White" EditorBackground="White" RulerBackground="White" Foreground="{StaticResource AccentColorBrush}" SelectionFillBrush="#338D8D8D" SelectionStrokeBrush="{StaticResource AccentColorBrush}" BorderBrush="{StaticResource AccentColorBrush}" BorderThickness="1" />
+ </Grid>
+
+ <Grid Grid.Column="1">
+ <GroupBox Header="PROPERTIES">
+
+ </GroupBox>
+ </Grid>
+ </Grid>
+ </Grid>
+ </Grid>
+</UserControl>
diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/MachineTech/MachineTechView.xaml.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/MachineTech/MachineTechView.xaml.cs
new file mode 100644
index 000000000..6546fd09e
--- /dev/null
+++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/MachineTech/MachineTechView.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.Common.MachineTech
+{
+ /// <summary>
+ /// Interaction logic for MachineTechView.xaml
+ /// </summary>
+ public partial class MachineTechView : UserControl
+ {
+ public MachineTechView()
+ {
+ InitializeComponent();
+ }
+ }
+}
diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Tango.MachineStudio.Common.csproj b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Tango.MachineStudio.Common.csproj
index b02c24608..d0ddd7267 100644
--- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Tango.MachineStudio.Common.csproj
+++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Tango.MachineStudio.Common.csproj
@@ -92,6 +92,11 @@
<Compile Include="Messages\IStudioMessage.cs" />
<Compile Include="Notifications\TaskItem.cs" />
<Compile Include="ValidationRules\Required.cs" />
+ <Compile Include="ViewModelLocator.cs" />
+ <Compile Include="ViewModels\MachineTechViewVM.cs" />
+ <Compile Include="MachineTech\MachineTechView.xaml.cs">
+ <DependentUpon>MachineTechView.xaml</DependentUpon>
+ </Compile>
<Page Include="Controls\HiveColorPickerControl.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
@@ -126,6 +131,10 @@
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
+ <Page Include="MachineTech\MachineTechView.xaml">
+ <SubType>Designer</SubType>
+ <Generator>MSBuild:Compile</Generator>
+ </Page>
</ItemGroup>
<ItemGroup>
<Compile Include="Properties\AssemblyInfo.cs">
@@ -174,6 +183,10 @@
<Project>{38197109-8610-4d3f-92b9-16d48df94d7c}</Project>
<Name>Tango.DAL.Remote</Name>
</ProjectReference>
+ <ProjectReference Include="..\..\Tango.Editors\Tango.Editors.csproj">
+ <Project>{de2f2b86-025b-4f26-83a4-38bd48224ed5}</Project>
+ <Name>Tango.Editors</Name>
+ </ProjectReference>
<ProjectReference Include="..\..\Tango.Integration\Tango.Integration.csproj">
<Project>{4206ac58-3b57-4699-8835-90bf6db01a61}</Project>
<Name>Tango.Integration</Name>
diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/ViewModelLocator.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/ViewModelLocator.cs
new file mode 100644
index 000000000..6dcf23289
--- /dev/null
+++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/ViewModelLocator.cs
@@ -0,0 +1,33 @@
+using GalaSoft.MvvmLight;
+using GalaSoft.MvvmLight.Ioc;
+using Microsoft.Practices.ServiceLocation;
+using Tango.MachineStudio.Common.ViewModels;
+using Tango.MachineStudio.Common.MachineTech;
+
+namespace Tango.MachineStudio.Common
+{
+ /// <summary>
+ /// This class contains static references to all the view models in the
+ /// application and provides an entry point for the bindings.
+ /// </summary>
+ public static class ViewModelLocator
+ {
+ /// <summary>
+ /// Initializes a new instance of the ViewModelLocator class.
+ /// </summary>
+ static ViewModelLocator()
+ {
+ ServiceLocator.SetLocatorProvider(() => SimpleIoc.Default);
+
+ SimpleIoc.Default.Register<MachineTechViewVM>();
+ }
+
+ public static MachineTechViewVM MachineTechViewVM
+ {
+ get
+ {
+ return ServiceLocator.Current.GetInstance<MachineTechViewVM>();
+ }
+ }
+ }
+} \ No newline at end of file
diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/ViewModels/MachineTechViewVM.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/ViewModels/MachineTechViewVM.cs
new file mode 100644
index 000000000..eeb490d99
--- /dev/null
+++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/ViewModels/MachineTechViewVM.cs
@@ -0,0 +1,13 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using Tango.SharedUI;
+
+namespace Tango.MachineStudio.Common.ViewModels
+{
+ public class MachineTechViewVM : ViewModel
+ {
+ }
+}