From f698ab599f7954f9e46f2ef6d6d479598a492c03 Mon Sep 17 00:00:00 2001 From: tzim Date: Tue, 21 May 2013 20:43:55 +0000 Subject: [PATCH] --- DMX-2.0/Conduite.cs | 8 ++ DMX-2.0/DMX-2.0.csproj | 1 + DMX-2.0/DriverBoitierV1.cs | 3 +- DMX-2.0/SeqLinUI.cs | 12 ++- DMX-2.0/SequenceurLineaire.cs | 20 +++++ DMX-2.0/SequenceurMaitre.cs | 37 +++++++++ DMX-2.0/gtk-gui/DMX2.MainWindow.cs | 43 +++++----- DMX-2.0/gtk-gui/DMX2.SeqLinUI.cs | 126 +++++++++++++++++++---------- DMX-2.0/gtk-gui/gui.stetic | 106 +++++++++++++++++------- 9 files changed, 259 insertions(+), 97 deletions(-) create mode 100644 DMX-2.0/SequenceurMaitre.cs diff --git a/DMX-2.0/Conduite.cs b/DMX-2.0/Conduite.cs index a3c7bb6..a8af614 100644 --- a/DMX-2.0/Conduite.cs +++ b/DMX-2.0/Conduite.cs @@ -23,6 +23,8 @@ namespace DMX2 List drivers = new List(); + SequenceurMaitre seqmaitre = new SequenceurMaitre(); + public Conduite() { @@ -80,6 +82,12 @@ namespace DMX2 } } + public SequenceurMaitre SequenceurMaitre { + get { + return seqmaitre; + } + } + public List Drivers { get { return drivers; diff --git a/DMX-2.0/DMX-2.0.csproj b/DMX-2.0/DMX-2.0.csproj index 3ab001c..bfb484f 100644 --- a/DMX-2.0/DMX-2.0.csproj +++ b/DMX-2.0/DMX-2.0.csproj @@ -106,6 +106,7 @@ + \ No newline at end of file diff --git a/DMX-2.0/DriverBoitierV1.cs b/DMX-2.0/DriverBoitierV1.cs index aaa3a9c..c558b06 100644 --- a/DMX-2.0/DriverBoitierV1.cs +++ b/DMX-2.0/DriverBoitierV1.cs @@ -28,7 +28,6 @@ namespace DMX2 outputbuffer[4]=255; } - void Start () { OpenPort(); @@ -106,7 +105,7 @@ namespace DMX2 if(!serial.IsOpen) return; serial.Read(inputbuffer,0,inputbuffer.Length); - Console.WriteLine(inputbuffer[0]); + //Console.WriteLine(inputbuffer[0]); } catch (TimeoutException ex) { serial.Close(); diff --git a/DMX-2.0/SeqLinUI.cs b/DMX-2.0/SeqLinUI.cs index 43bfca3..50dc721 100644 --- a/DMX-2.0/SeqLinUI.cs +++ b/DMX-2.0/SeqLinUI.cs @@ -257,6 +257,8 @@ namespace DMX2 } } + seqMasterScale.Value = sequenceur.Master; + fullUpdFlag=false; } @@ -273,7 +275,7 @@ namespace DMX2 { updating = true; foreach (Circuit c in tirettes.Keys) { - tirettes[c].Value = sequenceur.ValeurCircuit(c); + tirettes[c].Value = sequenceur.ValeurBruteCircuit(c); } updating=false; } @@ -363,6 +365,14 @@ namespace DMX2 UpdListeEffets(); effetsListe.SetCursor(new TreePath( new int[1] {pos}) ,null,false); } + + protected void OnSeqMasterScaleValueChanged (object sender, EventArgs e) + { + + if (fullUpdFlag)return; + sequenceur.Master = (int)(seqMasterScale.Value); + } + } } diff --git a/DMX-2.0/SequenceurLineaire.cs b/DMX-2.0/SequenceurLineaire.cs index 1ceecb7..f9bd676 100644 --- a/DMX-2.0/SequenceurLineaire.cs +++ b/DMX-2.0/SequenceurLineaire.cs @@ -75,6 +75,17 @@ namespace DMX2 Dictionary valeurschangees = new Dictionary (); SeqLinUI ui = null; + int master = 100; + + public int Master { + get { + return master; + } + set { + master = value; + } + } + public SequenceurLineaire () { effetcourrant = new Effet ("",valeurscourantes , TimeSpan.Zero, TimeSpan.Zero); @@ -146,6 +157,15 @@ namespace DMX2 } public override int ValeurCircuit (Circuit c) + { + if (!circuitsSeq.Contains (c)) + return 0; + if(master !=100) + return valeurscourantes [c] * master /100; + return valeurscourantes [c]; + } + + public int ValeurBruteCircuit (Circuit c) { if (!circuitsSeq.Contains (c)) return 0; diff --git a/DMX-2.0/SequenceurMaitre.cs b/DMX-2.0/SequenceurMaitre.cs new file mode 100644 index 0000000..267b3a8 --- /dev/null +++ b/DMX-2.0/SequenceurMaitre.cs @@ -0,0 +1,37 @@ +using System; +using System.Collections.Generic; + +namespace DMX2 +{ + public class SequenceurMaitre + { + public class Ligne { + public Ligne(){} + Dictionary data = new Dictionary(); + public int this [Sequenceur index] { + get { + int value; + if(!data.TryGetValue(index, out value)) return -1; + return value; + } + set { + data[index] = value; + } + } + } + + List lignes = new List(); + + public List Lignes { + get { + return lignes; + } + } + + public SequenceurMaitre () + { + + } + } +} + diff --git a/DMX-2.0/gtk-gui/DMX2.MainWindow.cs b/DMX-2.0/gtk-gui/DMX2.MainWindow.cs index 194b8e4..9cb406a 100644 --- a/DMX-2.0/gtk-gui/DMX2.MainWindow.cs +++ b/DMX-2.0/gtk-gui/DMX2.MainWindow.cs @@ -33,10 +33,10 @@ namespace DMX2 private global::Gtk.VSeparator vseparator1; private global::Gtk.HPaned hpaned1; private global::Gtk.HPaned hpaned2; - private global::Gtk.ScrolledWindow GtkScrolledWindow; - private global::Gtk.VBox seqUiVbox; private global::Gtk.ScrolledWindow GtkScrolledWindow2; private global::Gtk.NodeView nodeview1; + private global::Gtk.ScrolledWindow GtkScrolledWindow; + private global::Gtk.VBox seqUiVbox; private global::Gtk.ScrolledWindow scrolledwindow2; private global::Gtk.VBox vboxCircuits; private global::Gtk.HSeparator hseparator1; @@ -268,28 +268,12 @@ namespace DMX2 this.hpaned1 = new global::Gtk.HPaned (); this.hpaned1.CanFocus = true; this.hpaned1.Name = "hpaned1"; - this.hpaned1.Position = 727; + this.hpaned1.Position = 781; // Container child hpaned1.Gtk.Paned+PanedChild this.hpaned2 = new global::Gtk.HPaned (); this.hpaned2.CanFocus = true; this.hpaned2.Name = "hpaned2"; - this.hpaned2.Position = 561; - // Container child hpaned2.Gtk.Paned+PanedChild - this.GtkScrolledWindow = new global::Gtk.ScrolledWindow (); - this.GtkScrolledWindow.Name = "GtkScrolledWindow"; - this.GtkScrolledWindow.ShadowType = ((global::Gtk.ShadowType)(1)); - // Container child GtkScrolledWindow.Gtk.Container+ContainerChild - global::Gtk.Viewport w50 = new global::Gtk.Viewport (); - w50.ShadowType = ((global::Gtk.ShadowType)(0)); - // Container child GtkViewport.Gtk.Container+ContainerChild - this.seqUiVbox = new global::Gtk.VBox (); - this.seqUiVbox.Name = "seqUiVbox"; - this.seqUiVbox.Spacing = 6; - w50.Add (this.seqUiVbox); - this.GtkScrolledWindow.Add (w50); - this.hpaned2.Add (this.GtkScrolledWindow); - global::Gtk.Paned.PanedChild w53 = ((global::Gtk.Paned.PanedChild)(this.hpaned2 [this.GtkScrolledWindow])); - w53.Resize = false; + this.hpaned2.Position = 177; // Container child hpaned2.Gtk.Paned+PanedChild this.GtkScrolledWindow2 = new global::Gtk.ScrolledWindow (); this.GtkScrolledWindow2.Name = "GtkScrolledWindow2"; @@ -300,9 +284,22 @@ namespace DMX2 this.nodeview1.Name = "nodeview1"; this.GtkScrolledWindow2.Add (this.nodeview1); this.hpaned2.Add (this.GtkScrolledWindow2); - global::Gtk.Paned.PanedChild w55 = ((global::Gtk.Paned.PanedChild)(this.hpaned2 [this.GtkScrolledWindow2])); - w55.Resize = false; - w55.Shrink = false; + global::Gtk.Paned.PanedChild w51 = ((global::Gtk.Paned.PanedChild)(this.hpaned2 [this.GtkScrolledWindow2])); + w51.Resize = false; + // Container child hpaned2.Gtk.Paned+PanedChild + this.GtkScrolledWindow = new global::Gtk.ScrolledWindow (); + this.GtkScrolledWindow.Name = "GtkScrolledWindow"; + this.GtkScrolledWindow.ShadowType = ((global::Gtk.ShadowType)(1)); + // Container child GtkScrolledWindow.Gtk.Container+ContainerChild + global::Gtk.Viewport w52 = new global::Gtk.Viewport (); + w52.ShadowType = ((global::Gtk.ShadowType)(0)); + // Container child GtkViewport.Gtk.Container+ContainerChild + this.seqUiVbox = new global::Gtk.VBox (); + this.seqUiVbox.Name = "seqUiVbox"; + this.seqUiVbox.Spacing = 6; + w52.Add (this.seqUiVbox); + this.GtkScrolledWindow.Add (w52); + this.hpaned2.Add (this.GtkScrolledWindow); this.hpaned1.Add (this.hpaned2); global::Gtk.Paned.PanedChild w56 = ((global::Gtk.Paned.PanedChild)(this.hpaned1 [this.hpaned2])); w56.Resize = false; diff --git a/DMX-2.0/gtk-gui/DMX2.SeqLinUI.cs b/DMX-2.0/gtk-gui/DMX2.SeqLinUI.cs index 17f8cb6..2c87051 100644 --- a/DMX-2.0/gtk-gui/DMX2.SeqLinUI.cs +++ b/DMX-2.0/gtk-gui/DMX2.SeqLinUI.cs @@ -22,7 +22,10 @@ namespace DMX2 private global::Gtk.VBox vbox2; private global::Gtk.HBox hbox1; private global::Gtk.VBox vbox4; + private global::Gtk.HBox hbox2; + private global::Gtk.Label posLabel; private global::Gtk.Label timeLabel; + private global::Gtk.HScale seqMasterScale; private global::Gtk.ProgressBar pbTrans; private global::Gtk.ProgressBar pbDuree; private global::Gtk.Toolbar toolbar1; @@ -86,34 +89,74 @@ namespace DMX2 this.vbox4 = new global::Gtk.VBox (); this.vbox4.Name = "vbox4"; // Container child vbox4.Gtk.Box+BoxChild - this.timeLabel = new global::Gtk.Label (); - this.timeLabel.HeightRequest = 33; - this.timeLabel.Name = "timeLabel"; - this.timeLabel.LabelProp = global::Mono.Unix.Catalog.GetString ("0.00"); - this.timeLabel.UseMarkup = true; - this.vbox4.Add (this.timeLabel); - global::Gtk.Box.BoxChild w3 = ((global::Gtk.Box.BoxChild)(this.vbox4 [this.timeLabel])); + this.hbox2 = new global::Gtk.HBox (); + this.hbox2.Name = "hbox2"; + this.hbox2.Spacing = 6; + // Container child hbox2.Gtk.Box+BoxChild + this.posLabel = new global::Gtk.Label (); + this.posLabel.Name = "posLabel"; + this.posLabel.Xpad = 10; + this.posLabel.LabelProp = global::Mono.Unix.Catalog.GetString ("n°0"); + this.posLabel.UseMarkup = true; + this.hbox2.Add (this.posLabel); + global::Gtk.Box.BoxChild w3 = ((global::Gtk.Box.BoxChild)(this.hbox2 [this.posLabel])); w3.Position = 0; w3.Expand = false; w3.Fill = false; + // Container child hbox2.Gtk.Box+BoxChild + this.timeLabel = new global::Gtk.Label (); + this.timeLabel.HeightRequest = 33; + this.timeLabel.Name = "timeLabel"; + this.timeLabel.Xpad = 30; + this.timeLabel.Xalign = 1F; + this.timeLabel.LabelProp = global::Mono.Unix.Catalog.GetString ("0.00"); + this.timeLabel.UseMarkup = true; + this.timeLabel.Justify = ((global::Gtk.Justification)(1)); + this.hbox2.Add (this.timeLabel); + global::Gtk.Box.BoxChild w4 = ((global::Gtk.Box.BoxChild)(this.hbox2 [this.timeLabel])); + w4.PackType = ((global::Gtk.PackType)(1)); + w4.Position = 1; + w4.Expand = false; + w4.Fill = false; + this.vbox4.Add (this.hbox2); + global::Gtk.Box.BoxChild w5 = ((global::Gtk.Box.BoxChild)(this.vbox4 [this.hbox2])); + w5.Position = 0; + w5.Expand = false; + w5.Fill = false; + // Container child vbox4.Gtk.Box+BoxChild + this.seqMasterScale = new global::Gtk.HScale (null); + this.seqMasterScale.CanFocus = true; + this.seqMasterScale.Name = "seqMasterScale"; + this.seqMasterScale.Adjustment.Upper = 100; + this.seqMasterScale.Adjustment.PageIncrement = 10; + this.seqMasterScale.Adjustment.StepIncrement = 1; + this.seqMasterScale.Adjustment.Value = 100; + this.seqMasterScale.DrawValue = true; + this.seqMasterScale.Digits = 0; + this.seqMasterScale.ValuePos = ((global::Gtk.PositionType)(1)); + this.vbox4.Add (this.seqMasterScale); + global::Gtk.Box.BoxChild w6 = ((global::Gtk.Box.BoxChild)(this.vbox4 [this.seqMasterScale])); + w6.Position = 1; + w6.Expand = false; + w6.Fill = false; // Container child vbox4.Gtk.Box+BoxChild this.pbTrans = new global::Gtk.ProgressBar (); this.pbTrans.HeightRequest = 15; this.pbTrans.Name = "pbTrans"; this.vbox4.Add (this.pbTrans); - global::Gtk.Box.BoxChild w4 = ((global::Gtk.Box.BoxChild)(this.vbox4 [this.pbTrans])); - w4.Position = 1; - w4.Expand = false; - w4.Fill = false; + global::Gtk.Box.BoxChild w7 = ((global::Gtk.Box.BoxChild)(this.vbox4 [this.pbTrans])); + w7.Position = 2; + w7.Expand = false; + w7.Fill = false; // Container child vbox4.Gtk.Box+BoxChild this.pbDuree = new global::Gtk.ProgressBar (); this.pbDuree.HeightRequest = 15; this.pbDuree.Name = "pbDuree"; this.vbox4.Add (this.pbDuree); - global::Gtk.Box.BoxChild w5 = ((global::Gtk.Box.BoxChild)(this.vbox4 [this.pbDuree])); - w5.Position = 2; - w5.Expand = false; - w5.Fill = false; + global::Gtk.Box.BoxChild w8 = ((global::Gtk.Box.BoxChild)(this.vbox4 [this.pbDuree])); + w8.Position = 3; + w8.Expand = false; + w8.Fill = false; // Container child vbox4.Gtk.Box+BoxChild this.UIManager.AddUiFromString (""); this.toolbar1 = ((global::Gtk.Toolbar)(this.UIManager.GetWidget ("/toolbar1"))); @@ -122,10 +165,10 @@ namespace DMX2 this.toolbar1.ToolbarStyle = ((global::Gtk.ToolbarStyle)(0)); this.toolbar1.IconSize = ((global::Gtk.IconSize)(2)); this.vbox4.Add (this.toolbar1); - global::Gtk.Box.BoxChild w6 = ((global::Gtk.Box.BoxChild)(this.vbox4 [this.toolbar1])); - w6.Position = 3; - w6.Expand = false; - w6.Fill = false; + global::Gtk.Box.BoxChild w9 = ((global::Gtk.Box.BoxChild)(this.vbox4 [this.toolbar1])); + w9.Position = 4; + w9.Expand = false; + w9.Fill = false; // Container child vbox4.Gtk.Box+BoxChild this.UIManager.AddUiFromString (""); this.toolbar2 = ((global::Gtk.Toolbar)(this.UIManager.GetWidget ("/toolbar2"))); @@ -133,15 +176,15 @@ namespace DMX2 this.toolbar2.ShowArrow = false; this.toolbar2.IconSize = ((global::Gtk.IconSize)(2)); this.vbox4.Add (this.toolbar2); - global::Gtk.Box.BoxChild w7 = ((global::Gtk.Box.BoxChild)(this.vbox4 [this.toolbar2])); - w7.Position = 4; - w7.Expand = false; - w7.Fill = false; + global::Gtk.Box.BoxChild w10 = ((global::Gtk.Box.BoxChild)(this.vbox4 [this.toolbar2])); + w10.Position = 5; + w10.Expand = false; + w10.Fill = false; this.hbox1.Add (this.vbox4); - global::Gtk.Box.BoxChild w8 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.vbox4])); - w8.Position = 0; - w8.Expand = false; - w8.Fill = false; + global::Gtk.Box.BoxChild w11 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.vbox4])); + w11.Position = 0; + w11.Expand = false; + w11.Fill = false; // Container child hbox1.Gtk.Box+BoxChild this.GtkScrolledWindow = new global::Gtk.ScrolledWindow (); this.GtkScrolledWindow.Name = "GtkScrolledWindow"; @@ -153,8 +196,8 @@ namespace DMX2 this.effetsListe.Name = "effetsListe"; this.GtkScrolledWindow.Add (this.effetsListe); this.hbox1.Add (this.GtkScrolledWindow); - global::Gtk.Box.BoxChild w10 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.GtkScrolledWindow])); - w10.Position = 1; + global::Gtk.Box.BoxChild w13 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.GtkScrolledWindow])); + w13.Position = 1; // Container child hbox1.Gtk.Box+BoxChild this.UIManager.AddUiFromString (""); this.toolbar3 = ((global::Gtk.Toolbar)(this.UIManager.GetWidget ("/toolbar3"))); @@ -164,25 +207,25 @@ namespace DMX2 this.toolbar3.ToolbarStyle = ((global::Gtk.ToolbarStyle)(0)); this.toolbar3.IconSize = ((global::Gtk.IconSize)(2)); this.hbox1.Add (this.toolbar3); - global::Gtk.Box.BoxChild w11 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.toolbar3])); - w11.Position = 2; - w11.Expand = false; - w11.Fill = false; + global::Gtk.Box.BoxChild w14 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.toolbar3])); + w14.Position = 2; + w14.Expand = false; + w14.Fill = false; this.vbox2.Add (this.hbox1); - global::Gtk.Box.BoxChild w12 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.hbox1])); - w12.Position = 0; - w12.Expand = false; - w12.Fill = false; + global::Gtk.Box.BoxChild w15 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.hbox1])); + w15.Position = 0; + w15.Expand = false; + w15.Fill = false; // Container child vbox2.Gtk.Box+BoxChild this.zoneWid = new global::Gtk.Fixed (); this.zoneWid.HeightRequest = 0; this.zoneWid.Name = "zoneWid"; this.zoneWid.HasWindow = false; this.vbox2.Add (this.zoneWid); - global::Gtk.Box.BoxChild w13 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.zoneWid])); - w13.Position = 1; - w13.Expand = false; - w13.Fill = false; + global::Gtk.Box.BoxChild w16 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.zoneWid])); + w16.Position = 1; + w16.Expand = false; + w16.Fill = false; this.GtkAlignment.Add (this.vbox2); this.frame1.Add (this.GtkAlignment); this.titreLabel = new global::Gtk.Label (); @@ -208,6 +251,7 @@ namespace DMX2 this.moveDownAction.Activated += new global::System.EventHandler (this.OnMoveDownActionActivated); this.circuitsAction.Activated += new global::System.EventHandler (this.OnCircuitsActionActivated); this.closeAction.Activated += new global::System.EventHandler (this.OnCloseActionActivated); + this.seqMasterScale.ValueChanged += new global::System.EventHandler (this.OnSeqMasterScaleValueChanged); this.zoneWid.SizeAllocated += new global::Gtk.SizeAllocatedHandler (this.OnZoneWidSizeAllocated); } } diff --git a/DMX-2.0/gtk-gui/gui.stetic b/DMX-2.0/gtk-gui/gui.stetic index 6fadc57..71d616c 100644 --- a/DMX-2.0/gtk-gui/gui.stetic +++ b/DMX-2.0/gtk-gui/gui.stetic @@ -306,12 +306,28 @@ True - 727 + 781 True - 561 + 177 + + + + In + + + + True + True + + + + + False + + @@ -339,26 +355,6 @@ - - False - - - - - - In - - - - True - True - - - - - False - False - @@ -687,11 +683,41 @@ - + - 33 - <big>0.00</big> - True + 6 + + + + 10 + <big>n°0</big> + True + + + 0 + True + False + False + + + + + + 33 + 30 + 1 + <big>0.00</big> + True + Right + + + End + 1 + False + False + False + + 0 @@ -700,13 +726,33 @@ False + + + + True + 100 + 10 + 1 + 100 + True + 0 + Right + + + + 1 + True + False + False + + 15 - 1 + 2 True False False @@ -718,7 +764,7 @@ 15 - 2 + 3 True False False @@ -738,7 +784,7 @@ - 3 + 4 True False False @@ -757,7 +803,7 @@ - 4 + 5 True False False