From 51c59649e78ea81d88c52ca7a0f61d53e9ac83fe Mon Sep 17 00:00:00 2001 From: Roy Ben-Shabat Date: Tue, 20 Feb 2018 12:13:55 +0200 Subject: Working on developer module... --- .../Views/JobView.xaml | 28 ++++++++++++++++++---- .../Views/JobView.xaml.cs | 16 ++++++++++++- .../Views/MachineJobSelectionView.xaml | 2 +- 3 files changed, 39 insertions(+), 7 deletions(-) (limited to 'Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views') diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/JobView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/JobView.xaml index 4467b1f28..e9867d202 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/JobView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/JobView.xaml @@ -34,6 +34,13 @@ + + + + @@ -59,6 +66,7 @@ + @@ -474,7 +482,7 @@ - + @@ -617,13 +625,13 @@ - + - + - @@ -1217,7 +1235,7 @@ - + + + + + diff --git a/Software/Visual_Studio/Tango.DAL.Remote/DB/BRUSH_STOPS.cs b/Software/Visual_Studio/Tango.DAL.Remote/DB/BRUSH_STOPS.cs index 16fbc15a7..6a65552db 100644 --- a/Software/Visual_Studio/Tango.DAL.Remote/DB/BRUSH_STOPS.cs +++ b/Software/Visual_Studio/Tango.DAL.Remote/DB/BRUSH_STOPS.cs @@ -39,8 +39,10 @@ namespace Tango.DAL.Remote.DB public double V5 { get; set; } public double V6 { get; set; } public double V7 { get; set; } - public string PANTON_GUID { get; set; } + public string COLOR_CATALOG_GUID { get; set; } + public int COLOR_CATALOG_CODE { get; set; } + public virtual COLOR_CATALOGS COLOR_CATALOGS { get; set; } public virtual COLOR_SPACES COLOR_SPACES { get; set; } public virtual SEGMENT SEGMENT { get; set; } } diff --git a/Software/Visual_Studio/Tango.DAL.Remote/DB/COLOR_CATALOGS.cs b/Software/Visual_Studio/Tango.DAL.Remote/DB/COLOR_CATALOGS.cs new file mode 100644 index 000000000..2d9ab2953 --- /dev/null +++ b/Software/Visual_Studio/Tango.DAL.Remote/DB/COLOR_CATALOGS.cs @@ -0,0 +1,52 @@ +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Tango.DAL.Remote.DB +{ + using System; + using System.Collections.Generic; + + public partial class COLOR_CATALOGS + { + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")] + public COLOR_CATALOGS() + { + this.BRUSH_STOPS = new HashSet(); + } + + public int ID { get; set; } + public string GUID { get; set; } + public System.DateTime LAST_UPDATED { get; set; } + public string COLOR_SPACE_GUID { get; set; } + public int COLOR_CODE { get; set; } + public string NAME { get; set; } + public double CYAN { get; set; } + public double MAGENTA { get; set; } + public double YELLOW { get; set; } + public double BLACK { get; set; } + public int RED { get; set; } + public int GREEN { get; set; } + public int BLUE { get; set; } + public double L { get; set; } + public double A { get; set; } + public double B { get; set; } + public double V0 { get; set; } + public double V1 { get; set; } + public double V2 { get; set; } + public double V3 { get; set; } + public double V4 { get; set; } + public double V5 { get; set; } + public double V6 { get; set; } + public double V7 { get; set; } + + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public virtual ICollection BRUSH_STOPS { get; set; } + public virtual COLOR_SPACES COLOR_SPACES { get; set; } + } +} diff --git a/Software/Visual_Studio/Tango.DAL.Remote/DB/COLOR_SPACES.cs b/Software/Visual_Studio/Tango.DAL.Remote/DB/COLOR_SPACES.cs index 883a18a5d..3d6a749fa 100644 --- a/Software/Visual_Studio/Tango.DAL.Remote/DB/COLOR_SPACES.cs +++ b/Software/Visual_Studio/Tango.DAL.Remote/DB/COLOR_SPACES.cs @@ -18,6 +18,7 @@ namespace Tango.DAL.Remote.DB public COLOR_SPACES() { this.BRUSH_STOPS = new HashSet(); + this.COLOR_CATALOGS = new HashSet(); } public int ID { get; set; } @@ -29,5 +30,7 @@ namespace Tango.DAL.Remote.DB [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] public virtual ICollection BRUSH_STOPS { get; set; } + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public virtual ICollection COLOR_CATALOGS { get; set; } } } diff --git a/Software/Visual_Studio/Tango.DAL.Remote/DB/JOB.cs b/Software/Visual_Studio/Tango.DAL.Remote/DB/JOB.cs index 926671383..d415992a2 100644 --- a/Software/Visual_Studio/Tango.DAL.Remote/DB/JOB.cs +++ b/Software/Visual_Studio/Tango.DAL.Remote/DB/JOB.cs @@ -36,6 +36,7 @@ namespace Tango.DAL.Remote.DB public bool ENABLE_INTER_SEGMENT { get; set; } public bool ENABLE_LUBRICATION { get; set; } public int JOB_INDEX { get; set; } + public int ESTIMATED_DURATION_MILI { get; set; } [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] public virtual ICollection JOB_RUNS { get; set; } diff --git a/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.Context.cs b/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.Context.cs index fbe885fea..ebec02eab 100644 --- a/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.Context.cs +++ b/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.Context.cs @@ -35,6 +35,7 @@ namespace Tango.DAL.Remote.DB public virtual DbSet CARTRIDGE_TYPES { get; set; } public virtual DbSet CATS { get; set; } public virtual DbSet CCTS { get; set; } + public virtual DbSet COLOR_CATALOGS { get; set; } public virtual DbSet COLOR_SPACES { get; set; } public virtual DbSet CONFIGURATIONS { get; set; } public virtual DbSet CONTACTS { get; set; } diff --git a/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.edmx b/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.edmx index 7235f54f2..3f935c70f 100644 --- a/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.edmx +++ b/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.edmx @@ -101,7 +101,8 @@ - + + @@ -141,6 +142,35 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -314,7 +344,7 @@ - + @@ -326,6 +356,7 @@ + @@ -689,6 +720,18 @@ + + + + + + + + + + + + @@ -751,6 +794,18 @@ + + + + + + + + + + + + @@ -948,9 +1003,7 @@ - - - + @@ -1388,6 +1441,7 @@ + @@ -1432,6 +1486,10 @@ + + + + @@ -1452,6 +1510,10 @@ + + + + @@ -1668,6 +1730,7 @@ + @@ -1740,6 +1803,10 @@ + + + + @@ -1764,6 +1831,10 @@ + + + + @@ -2036,7 +2107,9 @@ - + + + @@ -2082,6 +2155,37 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -2093,6 +2197,7 @@ + @@ -2287,7 +2392,7 @@ - + @@ -2299,6 +2404,7 @@ + @@ -2813,6 +2919,18 @@ + + + + + + + + + + + + @@ -2887,6 +3005,18 @@ + + + + + + + + + + + + @@ -3110,9 +3240,7 @@ - - - + @@ -3497,7 +3625,8 @@ - + + @@ -3567,6 +3696,36 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -3750,6 +3909,7 @@ + diff --git a/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.edmx.diagram b/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.edmx.diagram index ed6d1f9a5..b2b732414 100644 --- a/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.edmx.diagram +++ b/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.edmx.diagram @@ -5,60 +5,61 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -66,12 +67,14 @@ + + diff --git a/Software/Visual_Studio/Tango.DAL.Remote/Tango.DAL.Remote.csproj b/Software/Visual_Studio/Tango.DAL.Remote/Tango.DAL.Remote.csproj index 3b6e2d0a6..58ed81525 100644 --- a/Software/Visual_Studio/Tango.DAL.Remote/Tango.DAL.Remote.csproj +++ b/Software/Visual_Studio/Tango.DAL.Remote/Tango.DAL.Remote.csproj @@ -95,6 +95,9 @@ RemoteADO.tt + + RemoteADO.tt + RemoteADO.tt diff --git a/Software/Visual_Studio/Tango.Integration/Observables/Entities/BrushStop.cs b/Software/Visual_Studio/Tango.Integration/Observables/Entities/BrushStop.cs index 8c9a1120f..b98fd3d3a 100644 --- a/Software/Visual_Studio/Tango.Integration/Observables/Entities/BrushStop.cs +++ b/Software/Visual_Studio/Tango.Integration/Observables/Entities/BrushStop.cs @@ -456,22 +456,64 @@ namespace Tango.Integration.Observables } - protected String _pantonguid; + protected String _colorcatalogguid; /// - /// Gets or sets the brushstop panton guid. + /// Gets or sets the brushstop color catalog guid. /// - [Column("PANTON_GUID")] + [Column("COLOR_CATALOG_GUID")] + [ForeignKey("ColorCatalog")] - public String PantonGuid + public String ColorCatalogGuid { get { - return _pantonguid; + return _colorcatalogguid; } set { - _pantonguid = value; RaisePropertyChanged(nameof(PantonGuid)); + _colorcatalogguid = value; RaisePropertyChanged(nameof(ColorCatalogGuid)); + } + + } + + protected Int32 _colorcatalogcode; + /// + /// Gets or sets the brushstop color catalog code. + /// + [Column("COLOR_CATALOG_CODE")] + + public Int32 ColorCatalogCode + { + get + { + return _colorcatalogcode; + } + + set + { + _colorcatalogcode = value; RaisePropertyChanged(nameof(ColorCatalogCode)); + } + + } + + protected ColorCatalog _colorcatalog; + /// + /// Gets or sets the brushstop color catalogs. + /// + + [XmlIgnore] + [JsonIgnore] + public virtual ColorCatalog ColorCatalog + { + get + { + return _colorcatalog; + } + + set + { + _colorcatalog = value; RaisePropertyChanged(nameof(ColorCatalog)); } } diff --git a/Software/Visual_Studio/Tango.Integration/Observables/Entities/ColorCatalog.cs b/Software/Visual_Studio/Tango.Integration/Observables/Entities/ColorCatalog.cs new file mode 100644 index 000000000..cea700f16 --- /dev/null +++ b/Software/Visual_Studio/Tango.Integration/Observables/Entities/ColorCatalog.cs @@ -0,0 +1,488 @@ +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using System.Xml.Serialization; +using Newtonsoft.Json; +using System.Linq; +using Tango.DAL.Remote.DB; + +namespace Tango.Integration.Observables +{ + [Table("COLOR_CATALOGS")] + public partial class ColorCatalog : ObservableEntity + { + + protected String _colorspaceguid; + /// + /// Gets or sets the colorcatalog color space guid. + /// + [Column("COLOR_SPACE_GUID")] + [ForeignKey("ColorSpace")] + + public String ColorSpaceGuid + { + get + { + return _colorspaceguid; + } + + set + { + _colorspaceguid = value; RaisePropertyChanged(nameof(ColorSpaceGuid)); + } + + } + + protected Int32 _colorcode; + /// + /// Gets or sets the colorcatalog color code. + /// + [Column("COLOR_CODE")] + + public Int32 ColorCode + { + get + { + return _colorcode; + } + + set + { + _colorcode = value; RaisePropertyChanged(nameof(ColorCode)); + } + + } + + protected String _name; + /// + /// Gets or sets the colorcatalog name. + /// + [Column("NAME")] + + public String Name + { + get + { + return _name; + } + + set + { + _name = value; RaisePropertyChanged(nameof(Name)); + } + + } + + protected Double _cyan; + /// + /// Gets or sets the colorcatalog cyan. + /// + [Column("CYAN")] + + public Double Cyan + { + get + { + return _cyan; + } + + set + { + _cyan = value; RaisePropertyChanged(nameof(Cyan)); + } + + } + + protected Double _magenta; + /// + /// Gets or sets the colorcatalog magenta. + /// + [Column("MAGENTA")] + + public Double Magenta + { + get + { + return _magenta; + } + + set + { + _magenta = value; RaisePropertyChanged(nameof(Magenta)); + } + + } + + protected Double _yellow; + /// + /// Gets or sets the colorcatalog yellow. + /// + [Column("YELLOW")] + + public Double Yellow + { + get + { + return _yellow; + } + + set + { + _yellow = value; RaisePropertyChanged(nameof(Yellow)); + } + + } + + protected Double _black; + /// + /// Gets or sets the colorcatalog black. + /// + [Column("BLACK")] + + public Double Black + { + get + { + return _black; + } + + set + { + _black = value; RaisePropertyChanged(nameof(Black)); + } + + } + + protected Int32 _red; + /// + /// Gets or sets the colorcatalog red. + /// + [Column("RED")] + + public Int32 Red + { + get + { + return _red; + } + + set + { + _red = value; RaisePropertyChanged(nameof(Red)); + } + + } + + protected Int32 _green; + /// + /// Gets or sets the colorcatalog green. + /// + [Column("GREEN")] + + public Int32 Green + { + get + { + return _green; + } + + set + { + _green = value; RaisePropertyChanged(nameof(Green)); + } + + } + + protected Int32 _blue; + /// + /// Gets or sets the colorcatalog blue. + /// + [Column("BLUE")] + + public Int32 Blue + { + get + { + return _blue; + } + + set + { + _blue = value; RaisePropertyChanged(nameof(Blue)); + } + + } + + protected Double _l; + /// + /// Gets or sets the colorcatalog l. + /// + [Column("L")] + + public Double L + { + get + { + return _l; + } + + set + { + _l = value; RaisePropertyChanged(nameof(L)); + } + + } + + protected Double _a; + /// + /// Gets or sets the colorcatalog a. + /// + [Column("A")] + + public Double A + { + get + { + return _a; + } + + set + { + _a = value; RaisePropertyChanged(nameof(A)); + } + + } + + protected Double _b; + /// + /// Gets or sets the colorcatalog b. + /// + [Column("B")] + + public Double B + { + get + { + return _b; + } + + set + { + _b = value; RaisePropertyChanged(nameof(B)); + } + + } + + protected Double _v0; + /// + /// Gets or sets the colorcatalog v0. + /// + [Column("V0")] + + public Double V0 + { + get + { + return _v0; + } + + set + { + _v0 = value; RaisePropertyChanged(nameof(V0)); + } + + } + + protected Double _v1; + /// + /// Gets or sets the colorcatalog v1. + /// + [Column("V1")] + + public Double V1 + { + get + { + return _v1; + } + + set + { + _v1 = value; RaisePropertyChanged(nameof(V1)); + } + + } + + protected Double _v2; + /// + /// Gets or sets the colorcatalog v2. + /// + [Column("V2")] + + public Double V2 + { + get + { + return _v2; + } + + set + { + _v2 = value; RaisePropertyChanged(nameof(V2)); + } + + } + + protected Double _v3; + /// + /// Gets or sets the colorcatalog v3. + /// + [Column("V3")] + + public Double V3 + { + get + { + return _v3; + } + + set + { + _v3 = value; RaisePropertyChanged(nameof(V3)); + } + + } + + protected Double _v4; + /// + /// Gets or sets the colorcatalog v4. + /// + [Column("V4")] + + public Double V4 + { + get + { + return _v4; + } + + set + { + _v4 = value; RaisePropertyChanged(nameof(V4)); + } + + } + + protected Double _v5; + /// + /// Gets or sets the colorcatalog v5. + /// + [Column("V5")] + + public Double V5 + { + get + { + return _v5; + } + + set + { + _v5 = value; RaisePropertyChanged(nameof(V5)); + } + + } + + protected Double _v6; + /// + /// Gets or sets the colorcatalog v6. + /// + [Column("V6")] + + public Double V6 + { + get + { + return _v6; + } + + set + { + _v6 = value; RaisePropertyChanged(nameof(V6)); + } + + } + + protected Double _v7; + /// + /// Gets or sets the colorcatalog v7. + /// + [Column("V7")] + + public Double V7 + { + get + { + return _v7; + } + + set + { + _v7 = value; RaisePropertyChanged(nameof(V7)); + } + + } + + protected ObservableCollection _brushstops; + /// + /// Gets or sets the colorcatalog brush stops. + /// + + public virtual ObservableCollection BrushStops + { + get + { + return _brushstops; + } + + set + { + _brushstops = value; RaisePropertyChanged(nameof(BrushStops)); + } + + } + + protected ColorSpace _colorspace; + /// + /// Gets or sets the colorcatalog color spaces. + /// + + [XmlIgnore] + [JsonIgnore] + public virtual ColorSpace ColorSpace + { + get + { + return _colorspace; + } + + set + { + _colorspace = value; RaisePropertyChanged(nameof(ColorSpace)); + } + + } + + /// + /// Initializes a new instance of the class. + /// + public ColorCatalog() : base() + { + + BrushStops = new ObservableCollection(); + + } + } +} diff --git a/Software/Visual_Studio/Tango.Integration/Observables/Entities/ColorSpace.cs b/Software/Visual_Studio/Tango.Integration/Observables/Entities/ColorSpace.cs index b473fdecc..83c468b3f 100644 --- a/Software/Visual_Studio/Tango.Integration/Observables/Entities/ColorSpace.cs +++ b/Software/Visual_Studio/Tango.Integration/Observables/Entities/ColorSpace.cs @@ -93,6 +93,25 @@ namespace Tango.Integration.Observables } + protected ObservableCollection _colorcatalogs; + /// + /// Gets or sets the colorspace color catalogs. + /// + + public virtual ObservableCollection ColorCatalogs + { + get + { + return _colorcatalogs; + } + + set + { + _colorcatalogs = value; RaisePropertyChanged(nameof(ColorCatalogs)); + } + + } + /// /// Initializes a new instance of the class. /// @@ -101,6 +120,8 @@ namespace Tango.Integration.Observables BrushStops = new ObservableCollection(); + ColorCatalogs = new ObservableCollection(); + } } } diff --git a/Software/Visual_Studio/Tango.Integration/Observables/Entities/Job.cs b/Software/Visual_Studio/Tango.Integration/Observables/Entities/Job.cs index d95d44c4c..e73e3ace0 100644 --- a/Software/Visual_Studio/Tango.Integration/Observables/Entities/Job.cs +++ b/Software/Visual_Studio/Tango.Integration/Observables/Entities/Job.cs @@ -258,6 +258,26 @@ namespace Tango.Integration.Observables } + protected Int32 _estimateddurationmili; + /// + /// Gets or sets the job estimated duration mili. + /// + [Column("ESTIMATED_DURATION_MILI")] + + public Int32 EstimatedDurationMili + { + get + { + return _estimateddurationmili; + } + + set + { + _estimateddurationmili = value; RaisePropertyChanged(nameof(EstimatedDurationMili)); + } + + } + protected ObservableCollection _jobruns; /// /// Gets or sets the job job runs. diff --git a/Software/Visual_Studio/Tango.Integration/Observables/Enumerations/ColorCatalogs.cs b/Software/Visual_Studio/Tango.Integration/Observables/Enumerations/ColorCatalogs.cs new file mode 100644 index 000000000..e0d39cef1 --- /dev/null +++ b/Software/Visual_Studio/Tango.Integration/Observables/Enumerations/ColorCatalogs.cs @@ -0,0 +1,12 @@ +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.ComponentModel; + +namespace Tango.Integration.Observables +{ + public enum ColorCatalogs + { + } +} diff --git a/Software/Visual_Studio/Tango.Integration/Observables/ObservablesContext.cs b/Software/Visual_Studio/Tango.Integration/Observables/ObservablesContext.cs index a21463c9b..6c5947306 100644 --- a/Software/Visual_Studio/Tango.Integration/Observables/ObservablesContext.cs +++ b/Software/Visual_Studio/Tango.Integration/Observables/ObservablesContext.cs @@ -127,6 +127,14 @@ namespace Tango.Integration.Observables get; set; } + /// + /// Gets or sets the ColorCatalogs. + /// + public DbSet ColorCatalogs + { + get; set; + } + /// /// Gets or sets the ColorSpaces. /// diff --git a/Software/Visual_Studio/Tango.Integration/Observables/ObservablesEntitiesAdapterExtension.cs b/Software/Visual_Studio/Tango.Integration/Observables/ObservablesEntitiesAdapterExtension.cs index 67b2d786e..70aad649d 100644 --- a/Software/Visual_Studio/Tango.Integration/Observables/ObservablesEntitiesAdapterExtension.cs +++ b/Software/Visual_Studio/Tango.Integration/Observables/ObservablesEntitiesAdapterExtension.cs @@ -366,6 +366,42 @@ namespace Tango.Integration.Observables } + private ObservableCollection _colorcatalogs; + /// + /// Gets or sets the ColorCatalogs. + /// + public ObservableCollection ColorCatalogs + { + get + { + return _colorcatalogs; + } + + set + { + _colorcatalogs = value; RaisePropertyChanged(nameof(ColorCatalogs)); + } + + } + + private ICollectionView _colorcatalogsViewSource; + /// + /// Gets or sets the ColorCatalogs View Source. + /// + public ICollectionView ColorCatalogsViewSource + { + get + { + return _colorcatalogsViewSource; + } + + set + { + _colorcatalogsViewSource = value; RaisePropertyChanged(nameof(ColorCatalogsViewSource)); + } + + } + private ObservableCollection _colorspaces; /// /// Gets or sets the ColorSpaces. @@ -1976,6 +2012,8 @@ namespace Tango.Integration.Observables CctsViewSource = CreateCollectionView(Ccts); + ColorCatalogsViewSource = CreateCollectionView(ColorCatalogs); + ColorSpacesViewSource = CreateCollectionView(ColorSpaces); ConfigurationsViewSource = CreateCollectionView(Configurations); diff --git a/Software/Visual_Studio/Tango.Integration/Tango.Integration.csproj b/Software/Visual_Studio/Tango.Integration/Tango.Integration.csproj index 47188ea02..1a053a937 100644 --- a/Software/Visual_Studio/Tango.Integration/Tango.Integration.csproj +++ b/Software/Visual_Studio/Tango.Integration/Tango.Integration.csproj @@ -99,6 +99,7 @@ + diff --git a/Software/Visual_Studio/Tango.SharedUI/Converters/MathOperatorConverter.cs b/Software/Visual_Studio/Tango.SharedUI/Converters/MathOperatorConverter.cs new file mode 100644 index 000000000..f95fd4497 --- /dev/null +++ b/Software/Visual_Studio/Tango.SharedUI/Converters/MathOperatorConverter.cs @@ -0,0 +1,45 @@ +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Data; + +namespace Tango.SharedUI.Converters +{ + public class MathOperatorConverter : IValueConverter + { + public object Convert(object value, Type targetType, object parameter, CultureInfo culture) + { + String arguments = parameter.ToStringSafe(); + + if (arguments != null && value != null) + { + String sign = arguments.First().ToString(); + double a = System.Convert.ToDouble(value); + double b = System.Convert.ToDouble(new String(arguments.Skip(1).ToArray())); + + + switch (sign) + { + case "+": + return a + b; + case "-": + return a - b; + case "*": + return a * b; + case "/": + return a / b; + } + } + + return null; + } + + public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) + { + throw new NotImplementedException(); + } + } +} diff --git a/Software/Visual_Studio/Tango.SharedUI/Tango.SharedUI.csproj b/Software/Visual_Studio/Tango.SharedUI/Tango.SharedUI.csproj index 537e89949..b639a25d8 100644 --- a/Software/Visual_Studio/Tango.SharedUI/Tango.SharedUI.csproj +++ b/Software/Visual_Studio/Tango.SharedUI/Tango.SharedUI.csproj @@ -98,6 +98,7 @@ + -- cgit v1.3.1 From 2fe707abce023813d234b57b097a731174fd4a26 Mon Sep 17 00:00:00 2001 From: Roy Ben-Shabat Date: Tue, 20 Feb 2018 15:08:22 +0200 Subject: Implemented module popping! --- Software/DB/Tango.mdf | Bin 75497472 -> 75497472 bytes Software/DB/Tango_log.ldf | Bin 8388608 -> 8388608 bytes .../Views/JobView.xaml.cs | 7 +- .../Tango.MachineStudio.Common/IStudioModule.cs | 5 ++ .../Tango.MachineStudio.Common/StudioModuleBase.cs | 13 ++- .../Tango.MachineStudio.UI.csproj | 10 ++- .../ViewModels/MainViewVM.cs | 34 ++++++++ .../ViewModels/ModuleWindowVM.cs | 30 +++++++ .../Tango.MachineStudio.UI/Views/MainView.xaml | 7 +- .../Tango.MachineStudio.UI/Views/MainView.xaml.cs | 5 +- .../Windows/ModuleWindow.xaml | 97 +++++++++++++++++++++ .../Windows/ModuleWindow.xaml.cs | 44 ++++++++++ .../Tango.SharedUI/Controls/MultiSelectListBox.cs | 11 ++- 13 files changed, 251 insertions(+), 12 deletions(-) create mode 100644 Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/ModuleWindowVM.cs create mode 100644 Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Windows/ModuleWindow.xaml create mode 100644 Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Windows/ModuleWindow.xaml.cs (limited to 'Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views') diff --git a/Software/DB/Tango.mdf b/Software/DB/Tango.mdf index 0977f418a..68202a1cd 100644 Binary files a/Software/DB/Tango.mdf and b/Software/DB/Tango.mdf differ diff --git a/Software/DB/Tango_log.ldf b/Software/DB/Tango_log.ldf index c544eca4f..bfb8f24d4 100644 Binary files a/Software/DB/Tango_log.ldf and b/Software/DB/Tango_log.ldf differ diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/JobView.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/JobView.xaml.cs index 5e8a72378..470d98912 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/JobView.xaml.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/JobView.xaml.cs @@ -90,7 +90,7 @@ namespace Tango.MachineStudio.Developer.Views private void UpdateGradientBrushDisplay() { - if (_vm.SelectedSegment != null) + if (_vm != null && _vm.SelectedSegment != null) { SegmentToGradientStopsConverter converter = new SegmentToGradientStopsConverter(); GradientStopCollection stops = converter.Convert(_vm.SelectedSegment, null, null, null) as GradientStopCollection; @@ -98,7 +98,10 @@ namespace Tango.MachineStudio.Developer.Views } else { - gradientBrush.GradientStops = new GradientStopCollection(); + if (gradientBrush != null) + { + gradientBrush.GradientStops = new GradientStopCollection(); + } } } diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/IStudioModule.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/IStudioModule.cs index 7718c0a7a..ad454556e 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/IStudioModule.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/IStudioModule.cs @@ -35,6 +35,11 @@ namespace Tango.MachineStudio.Common /// FrameworkElement MainView { get; } + /// + /// Gets or sets a value indicating whether this module is shown under a new window. + /// + bool InNewWindow { get; set; } + /// /// Gets the permission required to see and load this module. /// diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/StudioModuleBase.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/StudioModuleBase.cs index 5c594ab70..158661309 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/StudioModuleBase.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/StudioModuleBase.cs @@ -5,6 +5,7 @@ using System.Text; using System.Threading.Tasks; using System.Windows; using System.Windows.Media.Imaging; +using Tango.Core; using Tango.Integration.Observables; namespace Tango.MachineStudio.Common @@ -13,7 +14,7 @@ namespace Tango.MachineStudio.Common /// Represents a base class for studio modules. /// /// - public abstract class StudioModuleBase : IStudioModule + public abstract class StudioModuleBase : ExtendedObject, IStudioModule { private bool _isInitialized; private bool _isLoaded; @@ -79,6 +80,16 @@ namespace Tango.MachineStudio.Common } } + private bool _inNewWindow; + /// + /// Gets or sets a value indicating whether this module is shown under a new window. + /// + public bool InNewWindow + { + get { return _inNewWindow; } + set { _inNewWindow = value; RaisePropertyChangedAuto(); } + } + /// /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. /// diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Tango.MachineStudio.UI.csproj b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Tango.MachineStudio.UI.csproj index f48561e40..d82de0e9a 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Tango.MachineStudio.UI.csproj +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Tango.MachineStudio.UI.csproj @@ -120,12 +120,12 @@ MSBuild:Compile Designer + TextInputBoxWindow.xaml - @@ -138,6 +138,7 @@ + LoadingView.xaml @@ -164,6 +165,9 @@ ExceptionWindow.xaml + + ModuleWindow.xaml + MSBuild:Compile Designer @@ -223,6 +227,10 @@ Designer MSBuild:Compile + + Designer + MSBuild:Compile + diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/MainViewVM.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/MainViewVM.cs index 679ba5ff3..503532223 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/MainViewVM.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/MainViewVM.cs @@ -7,6 +7,9 @@ using System.Linq; using System.Reflection; using System.Text; using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Media; using Tango.Core.Commands; using Tango.Integration.Services; using Tango.Logging; @@ -18,8 +21,10 @@ using Tango.MachineStudio.Common.Notifications; using Tango.MachineStudio.Common.StudioApplication; using Tango.MachineStudio.UI.SupervisingController; using Tango.MachineStudio.UI.Views; +using Tango.MachineStudio.UI.Windows; using Tango.PMR.Stubs; using Tango.SharedUI; +using Tango.SharedUI.Helpers; using Tango.Transport.Adapters; namespace Tango.MachineStudio.UI.ViewModels @@ -68,6 +73,11 @@ namespace Tango.MachineStudio.UI.ViewModels /// public RelayCommand StartModuleCommand { get; set; } + /// + /// Gets or sets the open module in window command. + /// + public RelayCommand OpenModuleInWindowCommand { get; set; } + /// /// Gets or sets the home command. /// @@ -157,6 +167,7 @@ namespace Tango.MachineStudio.UI.ViewModels ConnectCommand = new RelayCommand(ConnectToMachine); SignoutCommand = new RelayCommand(SignOut); DisconnectCommand = new RelayCommand(DisconnectFromMachine, (x) => ApplicationManager.IsMachineConnected && !_isDisconnecting); + OpenModuleInWindowCommand = new RelayCommand(OpenModuleInWindow); } /// @@ -302,5 +313,28 @@ namespace Tango.MachineStudio.UI.ViewModels { base.OnViewAttached(); } + + private void OpenModuleInWindow(IStudioModule module) + { + module.InNewWindow = true; + + var parent = (MainView.Self as MainView).TransitionControl.Controls.SingleOrDefault(x => x.Tag.ToString() == module.Name).Content as Grid; + + var view = parent.Children[0] as FrameworkElement; + parent.Children.Remove(view); + + ModuleWindowVM vm = new ModuleWindowVM(module, parent); + ModuleWindow window = new ModuleWindow(this, vm, view); + + window.Closing += (x, y) => + { + window.grid.Children.Remove(view); + parent.Children.Add(view); + module.InNewWindow = false; + }; + + window.Owner = MainWindow.Instance; + window.Show(); + } } } diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/ModuleWindowVM.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/ModuleWindowVM.cs new file mode 100644 index 000000000..a5b737b59 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/ModuleWindowVM.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Controls; +using Tango.MachineStudio.Common; +using Tango.SharedUI; + +namespace Tango.MachineStudio.UI.ViewModels +{ + public class ModuleWindowVM : ViewModel + { + private IStudioModule _module; + + public IStudioModule Module + { + get { return _module; } + set { _module = value; RaisePropertyChangedAuto(); } + } + + public Grid Parent { get; set; } + + public ModuleWindowVM(IStudioModule module, Grid parent) + { + Parent = parent; + Module = module; + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/MainView.xaml b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/MainView.xaml index 479052cc5..19a5283c2 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/MainView.xaml +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/MainView.xaml @@ -17,6 +17,7 @@ + @@ -216,7 +217,7 @@ - + @@ -234,8 +235,8 @@ -