SAuvegarde SeqMaitre
This commit is contained in:
parent
351fed02de
commit
c4aad3552c
4 changed files with 67 additions and 14 deletions
|
|
@ -122,6 +122,15 @@ namespace DMX2
|
|||
}
|
||||
}
|
||||
|
||||
public Sequenceur GetSeqByID (int i)
|
||||
{
|
||||
foreach(Sequenceur seq in sequenceurs)
|
||||
if(seq.ID == i)
|
||||
return seq;
|
||||
return null;
|
||||
|
||||
}
|
||||
|
||||
public List<UniversDMX> Patches {
|
||||
get {
|
||||
return univers;
|
||||
|
|
@ -247,10 +256,20 @@ namespace DMX2
|
|||
}
|
||||
|
||||
foreach (var xs in root["Sequenceurs"].ChildNodes) {
|
||||
Sequenceur s = Sequenceur.Load (this,xs as XmlElement);
|
||||
if(s!=null)sequenceurs.Add (s);
|
||||
Sequenceur s = Sequenceur.Load (this, xs as XmlElement);
|
||||
if (s != null)
|
||||
sequenceurs.Add (s);
|
||||
}
|
||||
|
||||
univers.Clear();
|
||||
|
||||
foreach (var xu in root["ListeUnivers"].ChildNodes) {
|
||||
UniversDMX u = UniversDMX.Load(this,xu as XmlElement);
|
||||
if(u!=null)
|
||||
univers.Add(u);
|
||||
}
|
||||
|
||||
seqmaitre = SequenceurMaitre.Load(this,root["SequenceurMaitre"]);
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -70,8 +70,8 @@ namespace DMX2
|
|||
System.Xml.XmlElement xmlVal;
|
||||
parent.AppendChild (el);
|
||||
el.SetAttribute("nom",_nom);
|
||||
el.SetAttribute ("duree", _duree.TotalMilliseconds.ToString ());
|
||||
el.SetAttribute ("transition", _transition.TotalMilliseconds.ToString ());
|
||||
el.SetAttribute ("duree", _duree.ToString ());
|
||||
el.SetAttribute ("transition", _transition.ToString ());
|
||||
foreach (var valeur in _valeurs) {
|
||||
xmlVal = parent.OwnerDocument.CreateElement("Valeur");
|
||||
el.AppendChild(xmlVal);
|
||||
|
|
@ -90,8 +90,8 @@ namespace DMX2
|
|||
);
|
||||
}
|
||||
return new Effet( el.GetAttribute("nom"),valeurs,
|
||||
TimeSpan.FromMilliseconds(Double.Parse(el.GetAttribute("duree"))),
|
||||
TimeSpan.FromMilliseconds(Double.Parse(el.GetAttribute("transition")))
|
||||
TimeSpan.Parse(el.GetAttribute("duree")),
|
||||
TimeSpan.Parse(el.GetAttribute("transition"))
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ namespace DMX2
|
|||
parent.AppendChild (el);
|
||||
|
||||
el.SetAttribute ("nom", nom);
|
||||
el.SetAttribute ("duree", duree.TotalMilliseconds.ToString ());
|
||||
el.SetAttribute ("duree", duree.ToString ());
|
||||
|
||||
XmlElement xmlSeq;
|
||||
foreach (var val in data) {
|
||||
|
|
@ -61,6 +61,21 @@ namespace DMX2
|
|||
}
|
||||
}
|
||||
|
||||
public static Ligne Load (Conduite c, XmlElement el)
|
||||
{
|
||||
Ligne l = new Ligne();
|
||||
l.nom = el.GetAttribute ("nom");
|
||||
l.duree = TimeSpan.Parse(el.GetAttribute("duree"));
|
||||
|
||||
foreach (var xv in el.GetElementsByTagName("data")) {
|
||||
XmlElement xmlSeq = xv as XmlElement;
|
||||
Sequenceur seq = c.GetSeqByID(int.Parse(xmlSeq.GetAttribute("seq")));
|
||||
l[seq]= xmlSeq.GetAttribute ("val");
|
||||
}
|
||||
return l;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
List<Ligne> lignes = new List<Ligne>();
|
||||
|
|
@ -89,9 +104,15 @@ namespace DMX2
|
|||
}
|
||||
|
||||
|
||||
public static SequenceurMaitre Load (XmlElement doc)
|
||||
public static SequenceurMaitre Load (Conduite c, XmlElement el)
|
||||
{
|
||||
return null;
|
||||
SequenceurMaitre seq = new SequenceurMaitre ();
|
||||
|
||||
foreach (var xl in el.GetElementsByTagName("Ligne")) {
|
||||
seq.Lignes.Add(Ligne.Load(c,xl as XmlElement));
|
||||
}
|
||||
|
||||
return seq;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -106,12 +106,25 @@ namespace DMX2
|
|||
}
|
||||
}
|
||||
|
||||
public static UniversDMX Load (XmlElement doc)
|
||||
public static UniversDMX Load (Conduite c, XmlElement el)
|
||||
{
|
||||
return null;
|
||||
if (el.Name != "UniversDMX")
|
||||
throw new ErreurLectureFichier ("<UniversDMX> attendu.");
|
||||
UniversDMX univ = new UniversDMX ();
|
||||
|
||||
univ.Nom = el.GetAttribute("nom");
|
||||
|
||||
XmlElement xmlDim; Dimmer dim;
|
||||
foreach (var xd in el.GetElementsByTagName("Dimmer")) {
|
||||
xmlDim = xd as XmlElement;
|
||||
dim.circuitAssocié = c.GetCircuitByID(int.Parse(xmlDim.GetAttribute("circuit")));
|
||||
FTransfer.TryParse(xmlDim.GetAttribute("ft"),out dim.fonctionTransfert);
|
||||
dim.param1 = float.Parse(xmlDim.GetAttribute("param1"));
|
||||
dim.param2 = float.Parse(xmlDim.GetAttribute("param2"));
|
||||
univ.Dimmers[int.Parse(xmlDim.GetAttribute("num"))] = dim;
|
||||
}
|
||||
return univ;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
Reference in a new issue