From 36a0c276c426312097ad4ac2e14a2a85c20577e0 Mon Sep 17 00:00:00 2001 From: tzim Date: Wed, 24 Apr 2013 18:42:18 +0000 Subject: [PATCH] --- DMX-2.0/Conduite.cs | 36 +++++---- DMX-2.0/DMX-2.0.csproj | 3 +- DMX-2.0/EditionUnivers.cs | 54 +++++++++++++ DMX-2.0/MainWindow.cs | 15 +++- DMX-2.0/SelSeqCircuits.cs | 2 +- DMX-2.0/SeqLinUI.cs | 10 +-- DMX-2.0/UniversDMX.cs | 14 ++++ DMX-2.0/gtk-gui/DMX2.EditionUnivers.cs | 93 +++++++++++++++++++++++ DMX-2.0/gtk-gui/gui.stetic | 100 +++++++++++++++++++++++++ 9 files changed, 303 insertions(+), 24 deletions(-) create mode 100644 DMX-2.0/EditionUnivers.cs create mode 100644 DMX-2.0/gtk-gui/DMX2.EditionUnivers.cs diff --git a/DMX-2.0/Conduite.cs b/DMX-2.0/Conduite.cs index f918f7d..2dc7863 100644 --- a/DMX-2.0/Conduite.cs +++ b/DMX-2.0/Conduite.cs @@ -15,14 +15,24 @@ namespace DMX2 Timer timer = null; DateTime dernierTick; DateTime derniereMaj; + string _name; + int master=100; + + List circuits = new List(); + List univers = new List(); + public Conduite() { timer = new Timer(new TimerCallback(TimerTick),this, 1000,10); derniereMaj = dernierTick=DateTime.Now; + + // Crée l'univers par défaut + var u = new UniversDMX(); + Patches.Add(u); + u.Nom = "Univers par Défaut"; } - List circuits = new List(); public ReadOnlyCollection Circuits { get { @@ -49,7 +59,6 @@ namespace DMX2 } } - string _name; public string Name { get { @@ -60,8 +69,6 @@ namespace DMX2 } } - int master=100; - public int Master { get { return master; @@ -92,22 +99,12 @@ namespace DMX2 } } - List univers; - - public List Patch { + public List Patches { get { return univers; } } - public void Dispose() - { - disposed=true; - if(timer!=null) - timer.Dispose(); - timer=null; - } - static public void TimerTick (object state) { Conduite.Courante.Tick(); @@ -148,6 +145,15 @@ namespace DMX2 #region IDisposable implementation bool disposed=false; + + public void Dispose() + { + disposed=true; + if(timer!=null) + timer.Dispose(); + timer=null; + } + void IDisposable.Dispose () { if(!disposed) diff --git a/DMX-2.0/DMX-2.0.csproj b/DMX-2.0/DMX-2.0.csproj index fe8edc6..2ef7277 100644 --- a/DMX-2.0/DMX-2.0.csproj +++ b/DMX-2.0/DMX-2.0.csproj @@ -65,7 +65,6 @@ - @@ -103,6 +102,8 @@ + + \ No newline at end of file diff --git a/DMX-2.0/EditionUnivers.cs b/DMX-2.0/EditionUnivers.cs new file mode 100644 index 0000000..248697f --- /dev/null +++ b/DMX-2.0/EditionUnivers.cs @@ -0,0 +1,54 @@ +using System; +using Gtk; +namespace DMX2 +{ + public partial class EditionUnivers : Gtk.Dialog + { + UniversDMX universEdite; + public EditionUnivers (UniversDMX univers , Window parent) : base ("Edition Univers",parent,Gtk.DialogFlags.Modal) + { + this.Build (); + universEdite = univers; + + ConstruitListe(); + } + + + ListStore lsGrada; + ListStore lsCircuits; + + void ConstruitListe () + { + var cellNum = new CellRendererText(); + var cellCircuit = new CellRendererCombo(); + var cellAllume = new CellRendererToggle(); + + lsGrada = new ListStore(typeof(UniversDMX.Grada)); + lsCircuits = new ListStore(typeof(Circuit)); + + listeGradas.AppendColumn("N°",cellNum); + var colCircuit = listeGradas.AppendColumn("Circuit Associé",cellCircuit); + listeGradas.AppendColumn("Allume",cellAllume); + + listeGradas.Model = lsGrada; + + cellCircuit.Model = lsCircuits; + cellCircuit.Editable = true; + colCircuit.SetCellDataFunc(cellCircuit, new TreeCellDataFunc(SetCellCircuitData)); + cellCircuit.EditingStarted += CellCircuitData; + + } + + void CellCircuitData (object o, EditingStartedArgs args) + { + } + + void SetCellCircuitData (TreeViewColumn tree_column, CellRenderer cell, TreeModel tree_model, TreeIter iter) + { + + } + + + } +} + diff --git a/DMX-2.0/MainWindow.cs b/DMX-2.0/MainWindow.cs index daede1d..c7d6342 100644 --- a/DMX-2.0/MainWindow.cs +++ b/DMX-2.0/MainWindow.cs @@ -144,8 +144,19 @@ namespace DMX2 protected void OnMasterScaleValueChanged (object sender, EventArgs e) { Conduite.Courante.Master = (int)(masterScale.Value); + } + + + bool isfullscreen=false; + protected void OnFullscreenAction1Activated (object sender, EventArgs e) + { + if (!isfullscreen) { + Fullscreen (); + isfullscreen = true; + } else { + Unfullscreen(); + isfullscreen = false; + } } - - } } \ No newline at end of file diff --git a/DMX-2.0/SelSeqCircuits.cs b/DMX-2.0/SelSeqCircuits.cs index 202ab0f..342bde3 100644 --- a/DMX-2.0/SelSeqCircuits.cs +++ b/DMX-2.0/SelSeqCircuits.cs @@ -16,7 +16,7 @@ namespace DMX2 return cursel; } - public SelSeqCircuits (IEnumerable selection ) + public SelSeqCircuits (IEnumerable selection , Gtk.Window parent) : base ("Selection des Circuits",parent,Gtk.DialogFlags.Modal) { this.Build (); diff --git a/DMX-2.0/SeqLinUI.cs b/DMX-2.0/SeqLinUI.cs index c5a5177..de7c725 100644 --- a/DMX-2.0/SeqLinUI.cs +++ b/DMX-2.0/SeqLinUI.cs @@ -168,7 +168,9 @@ namespace DMX2 protected void OnCircuitsActionActivated (object sender, EventArgs e) { - var dlg = new SelSeqCircuits (sequenceur.Circuits); + // récupère la fenètre principale + Window win = this.GetAncestor(Gtk.Window.GType) as Window; + var dlg = new SelSeqCircuits (sequenceur.Circuits,win); if ((ResponseType)dlg.Run () == ResponseType.Ok) { sequenceur.ChangeCircuits(dlg.GetResultList()); } @@ -218,9 +220,7 @@ namespace DMX2 protected void FullUpdate () { fullUpdFlag=true; - // TODO : ici : Remise a plat de l'UI , Ajout/agencement des tirettes et descriptions - - + lastKnownWidth = zoneWid.Allocation.Width; foreach (Widget wid in new List(zoneWid.Children)) @@ -303,11 +303,11 @@ namespace DMX2 protected void OnGoForwardActionActivated (object sender, EventArgs e) { + // Si l'effet courant est selectioné, on passe au suivant, sinon, on passe a celui selectionné. if(sequenceur.IndexEffetCourrant == IndexEffetSelectionne()) sequenceur.IndexEffetCourrant++; else sequenceur.IndexEffetCourrant = IndexEffetSelectionne(); - } protected void OnGoBackActionActivated (object sender, EventArgs e) diff --git a/DMX-2.0/UniversDMX.cs b/DMX-2.0/UniversDMX.cs index 2b8adc5..21dae3e 100644 --- a/DMX-2.0/UniversDMX.cs +++ b/DMX-2.0/UniversDMX.cs @@ -15,6 +15,14 @@ namespace DMX2 } Grada[] _gradas = new Grada[512]; + + bool[] allumageForce = new bool[512]; + + public bool[] AllumageForce { + get { + return allumageForce; + } + } public string Nom; public enum FTransfer { lineaire, @@ -48,7 +56,13 @@ namespace DMX2 Debug.Assert(valeurs.Length == _gradas.Length); for(int i = 0 ; i<512; i++) { + if(allumageForce[i]) { + valeurs[i] = 128; + break; + } + g= _gradas[i]; + switch (g.fonctionTransfert) { case FTransfer.lineaire: valeurs[i] = g.circuitAssocié.ValeurCourante; diff --git a/DMX-2.0/gtk-gui/DMX2.EditionUnivers.cs b/DMX-2.0/gtk-gui/DMX2.EditionUnivers.cs new file mode 100644 index 0000000..9693f2c --- /dev/null +++ b/DMX-2.0/gtk-gui/DMX2.EditionUnivers.cs @@ -0,0 +1,93 @@ + +// This file has been generated by the GUI designer. Do not modify. +namespace DMX2 +{ + public partial class EditionUnivers + { + private global::Gtk.HBox hbox2; + private global::Gtk.Button button162; + private global::Gtk.Button button163; + private global::Gtk.ScrolledWindow GtkScrolledWindow; + private global::Gtk.TreeView listeGradas; + private global::Gtk.Button buttonCancel; + + protected virtual void Build () + { + global::Stetic.Gui.Initialize (this); + // Widget DMX2.EditionUnivers + this.Name = "DMX2.EditionUnivers"; + this.WindowPosition = ((global::Gtk.WindowPosition)(4)); + // Internal child DMX2.EditionUnivers.VBox + global::Gtk.VBox w1 = this.VBox; + w1.Name = "dialog1_VBox"; + w1.BorderWidth = ((uint)(2)); + // Container child dialog1_VBox.Gtk.Box+BoxChild + this.hbox2 = new global::Gtk.HBox (); + this.hbox2.Name = "hbox2"; + this.hbox2.Spacing = 6; + // Container child hbox2.Gtk.Box+BoxChild + this.button162 = new global::Gtk.Button (); + this.button162.CanFocus = true; + this.button162.Name = "button162"; + this.button162.UseUnderline = true; + this.button162.Label = global::Mono.Unix.Catalog.GetString ("1 Circuit = 1 Grada"); + this.hbox2.Add (this.button162); + global::Gtk.Box.BoxChild w2 = ((global::Gtk.Box.BoxChild)(this.hbox2 [this.button162])); + w2.Position = 0; + w2.Expand = false; + w2.Fill = false; + // Container child hbox2.Gtk.Box+BoxChild + this.button163 = new global::Gtk.Button (); + this.button163.CanFocus = true; + this.button163.Name = "button163"; + this.button163.UseUnderline = true; + this.button163.Label = global::Mono.Unix.Catalog.GetString ("Tout Réinitialiser"); + this.hbox2.Add (this.button163); + global::Gtk.Box.BoxChild w3 = ((global::Gtk.Box.BoxChild)(this.hbox2 [this.button163])); + w3.Position = 1; + w3.Expand = false; + w3.Fill = false; + w1.Add (this.hbox2); + global::Gtk.Box.BoxChild w4 = ((global::Gtk.Box.BoxChild)(w1 [this.hbox2])); + w4.Position = 0; + w4.Expand = false; + w4.Fill = false; + // Container child dialog1_VBox.Gtk.Box+BoxChild + this.GtkScrolledWindow = new global::Gtk.ScrolledWindow (); + this.GtkScrolledWindow.Name = "GtkScrolledWindow"; + this.GtkScrolledWindow.ShadowType = ((global::Gtk.ShadowType)(1)); + // Container child GtkScrolledWindow.Gtk.Container+ContainerChild + this.listeGradas = new global::Gtk.TreeView (); + this.listeGradas.CanFocus = true; + this.listeGradas.Name = "treeview2"; + this.GtkScrolledWindow.Add (this.listeGradas); + w1.Add (this.GtkScrolledWindow); + global::Gtk.Box.BoxChild w6 = ((global::Gtk.Box.BoxChild)(w1 [this.GtkScrolledWindow])); + w6.Position = 1; + // Internal child DMX2.EditionUnivers.ActionArea + global::Gtk.HButtonBox w7 = this.ActionArea; + w7.Name = "dialog1_ActionArea"; + w7.Spacing = 10; + w7.BorderWidth = ((uint)(5)); + w7.LayoutStyle = ((global::Gtk.ButtonBoxStyle)(4)); + // Container child dialog1_ActionArea.Gtk.ButtonBox+ButtonBoxChild + this.buttonCancel = new global::Gtk.Button (); + this.buttonCancel.CanDefault = true; + this.buttonCancel.CanFocus = true; + this.buttonCancel.Name = "buttonCancel"; + this.buttonCancel.UseStock = true; + this.buttonCancel.UseUnderline = true; + this.buttonCancel.Label = "gtk-close"; + this.AddActionWidget (this.buttonCancel, -7); + global::Gtk.ButtonBox.ButtonBoxChild w8 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w7 [this.buttonCancel])); + w8.Expand = false; + w8.Fill = false; + if ((this.Child != null)) { + this.Child.ShowAll (); + } + this.DefaultWidth = 704; + this.DefaultHeight = 483; + this.Show (); + } + } +} diff --git a/DMX-2.0/gtk-gui/gui.stetic b/DMX-2.0/gtk-gui/gui.stetic index 59ef354..1b16778 100644 --- a/DMX-2.0/gtk-gui/gui.stetic +++ b/DMX-2.0/gtk-gui/gui.stetic @@ -141,6 +141,7 @@ Action gtk-fullscreen + Action @@ -1041,4 +1042,103 @@ + + + CenterOnParent + 1 + False + + + + 2 + + + + 6 + + + + True + TextOnly + 1 Circuit = 1 Grada + True + + + 0 + True + False + False + + + + + + True + TextOnly + Tout Réinitialiser + True + + + 1 + True + False + False + + + + + + + + 0 + True + False + False + + + + + + In + + + + True + True + + + + + 1 + True + + + + + + + + 10 + 5 + 1 + End + + + + True + True + True + StockItem + gtk-close + -7 + gtk-close + + + False + False + + + + + \ No newline at end of file