Ajout et prise en compte des commandes dans le sequenceur maitre
This commit is contained in:
parent
ab06a57225
commit
a7d6aa210f
5 changed files with 94 additions and 29 deletions
|
|
@ -9,7 +9,7 @@ using System.Runtime.CompilerServices;
|
||||||
[assembly: AssemblyConfiguration("")]
|
[assembly: AssemblyConfiguration("")]
|
||||||
[assembly: AssemblyCompany("")]
|
[assembly: AssemblyCompany("")]
|
||||||
[assembly: AssemblyProduct("")]
|
[assembly: AssemblyProduct("")]
|
||||||
[assembly: AssemblyCopyright("arnaud")]
|
[assembly: AssemblyCopyright("Emmanuel Langlois et Arnaud Houdelette")]
|
||||||
[assembly: AssemblyTrademark("")]
|
[assembly: AssemblyTrademark("")]
|
||||||
[assembly: AssemblyCulture("")]
|
[assembly: AssemblyCulture("")]
|
||||||
|
|
||||||
|
|
@ -17,7 +17,7 @@ using System.Runtime.CompilerServices;
|
||||||
// The form "{Major}.{Minor}.*" will automatically update the build and revision,
|
// The form "{Major}.{Minor}.*" will automatically update the build and revision,
|
||||||
// and "{Major}.{Minor}.{Build}.*" will update just the revision.
|
// and "{Major}.{Minor}.{Build}.*" will update just the revision.
|
||||||
|
|
||||||
[assembly: AssemblyVersion("1.0.*")]
|
[assembly: AssemblyVersion("2.0.*")]
|
||||||
|
|
||||||
// The following attributes are used to specify the signing key for the assembly,
|
// The following attributes are used to specify the signing key for the assembly,
|
||||||
// if desired. See the Mono documentation for more information about signing.
|
// if desired. See the Mono documentation for more information about signing.
|
||||||
|
|
|
||||||
|
|
@ -30,6 +30,8 @@ namespace DMX2
|
||||||
|
|
||||||
protected void ConstruitMatrice ()
|
protected void ConstruitMatrice ()
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
var idCol = new Gtk.TreeViewColumn ();
|
var idCol = new Gtk.TreeViewColumn ();
|
||||||
var idCell = new Gtk.CellRendererText ();
|
var idCell = new Gtk.CellRendererText ();
|
||||||
idCol.Title = "Num";
|
idCol.Title = "Num";
|
||||||
|
|
@ -63,12 +65,20 @@ namespace DMX2
|
||||||
FillMatrice();
|
FillMatrice();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void DetruitMatrice ()
|
||||||
|
{
|
||||||
|
this.MatriceUI.Model = null;
|
||||||
|
if (lsMatrice != null) lsMatrice.Dispose();
|
||||||
|
foreach (var col in MatriceUI.Columns)
|
||||||
|
MatriceUI.RemoveColumn (col);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
static object seqkey = new object();
|
static object seqkey = new object();
|
||||||
|
|
||||||
|
|
||||||
void ConstruitMatriceSeqColumns ()
|
void ConstruitMatriceSeqColumns ()
|
||||||
{
|
{
|
||||||
|
|
||||||
foreach(var c in MatriceUI.Columns)
|
foreach(var c in MatriceUI.Columns)
|
||||||
if(c.CellRenderers[0].Data.ContainsKey(seqkey))
|
if(c.CellRenderers[0].Data.ContainsKey(seqkey))
|
||||||
MatriceUI.RemoveColumn(c);
|
MatriceUI.RemoveColumn(c);
|
||||||
|
|
@ -93,7 +103,7 @@ namespace DMX2
|
||||||
|
|
||||||
void RenderMatriceNum (TreeViewColumn tree_column, CellRenderer cell, TreeModel tree_model, TreeIter iter)
|
void RenderMatriceNum (TreeViewColumn tree_column, CellRenderer cell, TreeModel tree_model, TreeIter iter)
|
||||||
{
|
{
|
||||||
|
if (Conduite.Courante==null) return;
|
||||||
string num=string.Empty;
|
string num=string.Empty;
|
||||||
SequenceurMaitre.Ligne l = tree_model.GetValue (iter, 0) as SequenceurMaitre.Ligne;
|
SequenceurMaitre.Ligne l = tree_model.GetValue (iter, 0) as SequenceurMaitre.Ligne;
|
||||||
if( Conduite.Courante.SequenceurMaitre.IndexLigneEnCours == Conduite.Courante.SequenceurMaitre.Lignes.IndexOf(l) )
|
if( Conduite.Courante.SequenceurMaitre.IndexLigneEnCours == Conduite.Courante.SequenceurMaitre.Lignes.IndexOf(l) )
|
||||||
|
|
@ -105,12 +115,14 @@ namespace DMX2
|
||||||
|
|
||||||
void RenderMatriceNom (TreeViewColumn tree_column, CellRenderer cell, TreeModel tree_model, TreeIter iter)
|
void RenderMatriceNom (TreeViewColumn tree_column, CellRenderer cell, TreeModel tree_model, TreeIter iter)
|
||||||
{
|
{
|
||||||
|
if (Conduite.Courante==null) return;
|
||||||
SequenceurMaitre.Ligne l = tree_model.GetValue (iter, 0) as SequenceurMaitre.Ligne;
|
SequenceurMaitre.Ligne l = tree_model.GetValue (iter, 0) as SequenceurMaitre.Ligne;
|
||||||
(cell as Gtk.CellRendererText).Text = l.Nom;
|
(cell as Gtk.CellRendererText).Text = l.Nom;
|
||||||
}
|
}
|
||||||
|
|
||||||
void RenderMatriceDuree (TreeViewColumn tree_column, CellRenderer cell, TreeModel tree_model, TreeIter iter)
|
void RenderMatriceDuree (TreeViewColumn tree_column, CellRenderer cell, TreeModel tree_model, TreeIter iter)
|
||||||
{
|
{
|
||||||
|
if (Conduite.Courante==null) return;
|
||||||
SequenceurMaitre.Ligne l = tree_model.GetValue (iter, 0) as SequenceurMaitre.Ligne;
|
SequenceurMaitre.Ligne l = tree_model.GetValue (iter, 0) as SequenceurMaitre.Ligne;
|
||||||
if (l.Duree== TimeSpan.Zero) (cell as Gtk.CellRendererText).Text = string.Empty;
|
if (l.Duree== TimeSpan.Zero) (cell as Gtk.CellRendererText).Text = string.Empty;
|
||||||
else (cell as Gtk.CellRendererText).Text = (l.Duree.TotalMilliseconds /100).ToString();
|
else (cell as Gtk.CellRendererText).Text = (l.Duree.TotalMilliseconds /100).ToString();
|
||||||
|
|
@ -118,6 +130,7 @@ namespace DMX2
|
||||||
|
|
||||||
void RenderMatriceSeqVal (TreeViewColumn tree_column, CellRenderer cell, TreeModel tree_model, TreeIter iter)
|
void RenderMatriceSeqVal (TreeViewColumn tree_column, CellRenderer cell, TreeModel tree_model, TreeIter iter)
|
||||||
{
|
{
|
||||||
|
if (Conduite.Courante==null) return;
|
||||||
SequenceurMaitre.Ligne l = tree_model.GetValue (iter, 0) as SequenceurMaitre.Ligne;
|
SequenceurMaitre.Ligne l = tree_model.GetValue (iter, 0) as SequenceurMaitre.Ligne;
|
||||||
Sequenceur seq = cell.Data[seqkey] as Sequenceur;
|
Sequenceur seq = cell.Data[seqkey] as Sequenceur;
|
||||||
(cell as Gtk.CellRendererText).Text = l[seq];
|
(cell as Gtk.CellRendererText).Text = l[seq];
|
||||||
|
|
@ -183,16 +196,11 @@ namespace DMX2
|
||||||
FillMatrice();
|
FillMatrice();
|
||||||
SelectionneEffet(pos);
|
SelectionneEffet(pos);
|
||||||
}
|
}
|
||||||
void OnMatriceNumColClicked (object sender, EventArgs e)
|
|
||||||
{
|
|
||||||
throw new NotImplementedException ();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
protected void OnBtnRetireLigneClicked (object sender, EventArgs e)
|
protected void OnBtnRetireLigneClicked (object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
throw new System.NotImplementedException ();
|
Conduite.Courante.SequenceurMaitre.RetireLigne(IndexEffetSelectionne());
|
||||||
|
FillMatrice();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void OnBtnGoBackClicked (object sender, EventArgs e)
|
protected void OnBtnGoBackClicked (object sender, EventArgs e)
|
||||||
|
|
@ -209,6 +217,7 @@ namespace DMX2
|
||||||
|
|
||||||
protected void OnMatriceUICursorChanged (object sender, EventArgs e)
|
protected void OnMatriceUICursorChanged (object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
|
if (Conduite.Courante==null) return;
|
||||||
TreeViewColumn col;
|
TreeViewColumn col;
|
||||||
TreePath path;
|
TreePath path;
|
||||||
MatriceUI.GetCursor (out path, out col);
|
MatriceUI.GetCursor (out path, out col);
|
||||||
|
|
@ -369,12 +378,9 @@ namespace DMX2
|
||||||
} catch (IOException) {
|
} catch (IOException) {
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach (Sequenceur s in Conduite.Courante.Sequenceurs) {
|
foreach (Sequenceur s in Conduite.Courante.Sequenceurs)
|
||||||
VBox newvbox = new VBox();
|
AddSeqUI (s);
|
||||||
newvbox.PackStart(s.GetUI(),false,false,0);
|
|
||||||
onglets.Add (newvbox);
|
|
||||||
onglets.ShowAll();
|
|
||||||
}
|
|
||||||
MajWidgets();
|
MajWidgets();
|
||||||
NextUpdateFull();
|
NextUpdateFull();
|
||||||
}
|
}
|
||||||
|
|
@ -408,7 +414,9 @@ namespace DMX2
|
||||||
{
|
{
|
||||||
VBox newvbox = new VBox();
|
VBox newvbox = new VBox();
|
||||||
newvbox.PackStart(s.GetUI(),false,false,0);
|
newvbox.PackStart(s.GetUI(),false,false,0);
|
||||||
onglets.Add (newvbox);
|
Widget label = new Gtk.Label(s.Name);
|
||||||
|
//onglets.Add (newvbox);
|
||||||
|
onglets.AppendPage(newvbox,label);
|
||||||
onglets.ShowAll();
|
onglets.ShowAll();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -417,12 +425,14 @@ namespace DMX2
|
||||||
foreach (var notebookvbox in onglets.Children)
|
foreach (var notebookvbox in onglets.Children)
|
||||||
notebookvbox.Destroy();
|
notebookvbox.Destroy();
|
||||||
|
|
||||||
foreach (Sequenceur s in Conduite.Courante.Sequenceurs) {
|
foreach (Sequenceur s in Conduite.Courante.Sequenceurs)
|
||||||
|
AddSeqUI(s);
|
||||||
|
/*{
|
||||||
VBox newvbox = new VBox();
|
VBox newvbox = new VBox();
|
||||||
newvbox.PackStart(s.GetUI(),false,false,0);
|
newvbox.PackStart(s.GetUI(),false,false,0);
|
||||||
onglets.Add (newvbox);
|
onglets.Add (newvbox);
|
||||||
onglets.ShowAll();
|
onglets.ShowAll();
|
||||||
}
|
}*/
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -467,14 +477,21 @@ namespace DMX2
|
||||||
{
|
{
|
||||||
if (Conduite.Courante != null) {
|
if (Conduite.Courante != null) {
|
||||||
//Activation / Désactivation des boutons en fonction de l'état de la counduite courante
|
//Activation / Désactivation des boutons en fonction de l'état de la counduite courante
|
||||||
showAllAction.Sensitive = universAction.Sensitive = masterScale.Sensitive = seqLinAction.Sensitive = circAction.Sensitive = saveAction.Sensitive = saveAsAction.Sensitive = closeAction.Sensitive = true;
|
btnAjoutLigne.Sensitive = btnRetireLigne.Sensitive = btnGo.Sensitive = btnGoBack.Sensitive =
|
||||||
|
showAllAction.Sensitive = universAction.Sensitive = masterScale.Sensitive =
|
||||||
|
seqLinAction.Sensitive = circAction.Sensitive = saveAction.Sensitive =
|
||||||
|
saveAsAction.Sensitive = closeAction.Sensitive = true;
|
||||||
openAction.Sensitive = newAction.Sensitive = false;
|
openAction.Sensitive = newAction.Sensitive = false;
|
||||||
this.Title = "DMX 2.0 - " + Conduite.Courante.Name;
|
this.Title = "DMX 2.0 - " + Conduite.Courante.Name;
|
||||||
ConstruitMatrice();
|
ConstruitMatrice();
|
||||||
} else {
|
} else {
|
||||||
showAllAction.Sensitive = universAction.Sensitive = masterScale.Sensitive = seqLinAction.Sensitive = circAction.Sensitive = saveAction.Sensitive = saveAsAction.Sensitive = closeAction.Sensitive = false;
|
btnAjoutLigne.Sensitive = btnRetireLigne.Sensitive = btnGo.Sensitive = btnGoBack.Sensitive =
|
||||||
|
showAllAction.Sensitive = universAction.Sensitive = masterScale.Sensitive =
|
||||||
|
seqLinAction.Sensitive = circAction.Sensitive = saveAction.Sensitive =
|
||||||
|
saveAsAction.Sensitive = closeAction.Sensitive = false;
|
||||||
openAction.Sensitive = newAction.Sensitive = true;
|
openAction.Sensitive = newAction.Sensitive = true;
|
||||||
this.Title = "DMX 2.0";
|
this.Title = "DMX 2.0";
|
||||||
|
DetruitMatrice();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -64,7 +64,7 @@ namespace DMX2
|
||||||
|
|
||||||
public abstract void Save (XmlElement parent);
|
public abstract void Save (XmlElement parent);
|
||||||
|
|
||||||
|
public abstract void Command (string command);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -39,6 +39,11 @@ namespace DMX2
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Dictionary<Circuit, int> Valeurs {
|
||||||
|
get {
|
||||||
|
return _valeurs;
|
||||||
|
}
|
||||||
|
}
|
||||||
public void RetireCircuit (Circuit c)
|
public void RetireCircuit (Circuit c)
|
||||||
{
|
{
|
||||||
_valeurs.Remove (c);
|
_valeurs.Remove (c);
|
||||||
|
|
@ -371,7 +376,7 @@ namespace DMX2
|
||||||
ui = null;
|
ui = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static SequenceurLineaire Load (Conduite conduite, System.Xml.XmlElement el)
|
public static new SequenceurLineaire Load (Conduite conduite, System.Xml.XmlElement el)
|
||||||
{
|
{
|
||||||
SequenceurLineaire seq = new SequenceurLineaire();
|
SequenceurLineaire seq = new SequenceurLineaire();
|
||||||
seq.LoadSeq(conduite,el);
|
seq.LoadSeq(conduite,el);
|
||||||
|
|
@ -394,5 +399,25 @@ namespace DMX2
|
||||||
foreach (var xe in el.GetElementsByTagName("Effet"))
|
foreach (var xe in el.GetElementsByTagName("Effet"))
|
||||||
effets.Add(Effet.Load(conduite,xe as System.Xml.XmlElement));
|
effets.Add(Effet.Load(conduite,xe as System.Xml.XmlElement));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public override void Command (string command)
|
||||||
|
{
|
||||||
|
lock (this) {
|
||||||
|
var cmd = System.Text.RegularExpressions.Regex.Match (command, @"(?<effet>\d+)(t(?<transition>\d+))?");
|
||||||
|
|
||||||
|
if (cmd.Success) {
|
||||||
|
if (cmd.Groups ["effet"].Success) {
|
||||||
|
int effet = int.Parse (cmd.Groups ["effet"].Value) - 1;
|
||||||
|
if (effet < effets.Count)
|
||||||
|
ChangeEffetCourrant (effet);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (cmd.Groups ["transition"].Success) {
|
||||||
|
int transition = int.Parse (cmd.Groups ["transition"].Value);
|
||||||
|
effetcourrant = new Effet ("", effetcourrant.Valeurs, effetcourrant.Duree, TimeSpan.FromMilliseconds (transition * 100));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -75,8 +75,6 @@ namespace DMX2
|
||||||
}
|
}
|
||||||
return l;
|
return l;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
List<Ligne> lignes = new List<Ligne>();
|
List<Ligne> lignes = new List<Ligne>();
|
||||||
|
|
@ -90,8 +88,8 @@ namespace DMX2
|
||||||
public int IndexLigneEnCours
|
public int IndexLigneEnCours
|
||||||
{
|
{
|
||||||
get {
|
get {
|
||||||
if (enCours == null) return -1;
|
if (enCours == null) return -1;
|
||||||
return lignes.IndexOf(enCours);
|
return lignes.IndexOf(enCours);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -123,6 +121,7 @@ namespace DMX2
|
||||||
aSuivre = null;
|
aSuivre = null;
|
||||||
timeStamp = TimeSpan.Zero;
|
timeStamp = TimeSpan.Zero;
|
||||||
change = true;
|
change = true;
|
||||||
|
LanceSequenceurs();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -136,9 +135,19 @@ namespace DMX2
|
||||||
aSuivre = null;
|
aSuivre = null;
|
||||||
timeStamp = TimeSpan.Zero;
|
timeStamp = TimeSpan.Zero;
|
||||||
change = true;
|
change = true;
|
||||||
|
LanceSequenceurs();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void LanceSequenceurs ()
|
||||||
|
{
|
||||||
|
foreach (Sequenceur s in Conduite.Courante.Sequenceurs) {
|
||||||
|
if(enCours[s].Length > 0)
|
||||||
|
s.Command(enCours[s]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public ReadOnlyCollection<Ligne> Lignes {
|
public ReadOnlyCollection<Ligne> Lignes {
|
||||||
get {
|
get {
|
||||||
return lignes.AsReadOnly();
|
return lignes.AsReadOnly();
|
||||||
|
|
@ -158,6 +167,20 @@ namespace DMX2
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void RetireLigne (int pos)
|
||||||
|
{
|
||||||
|
lock (this) {
|
||||||
|
if(lignes[pos]== enCours)
|
||||||
|
{
|
||||||
|
enCours=null;
|
||||||
|
if(pos+1 < lignes.Count)
|
||||||
|
aSuivre = lignes[pos+1];
|
||||||
|
}
|
||||||
|
if(lignes[pos] == aSuivre)
|
||||||
|
aSuivre=null;
|
||||||
|
lignes.RemoveAt(pos);
|
||||||
|
}
|
||||||
|
}
|
||||||
public void Tick (TimeSpan deltaT)
|
public void Tick (TimeSpan deltaT)
|
||||||
{
|
{
|
||||||
timeStamp += deltaT;
|
timeStamp += deltaT;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue