예제 #1
0
 public void Write(EnmxAddress address, int data)
 {
     bool lessThan7Bits = false;
     var bytes = BitConverter.GetBytes(data);
     if (data < 128)
         lessThan7Bits = true;
     _confirmedGroupData.Write(address.Address, EIBA.Interop.Falcon.Priority.PriorityLow, 6, lessThan7Bits, bytes);
 }
 public void TestEnmxAddress()
 {
     string a1 = "1/4/30";
     EnmxAddress e1 = EnmxAddress.Parse(a1);
     Assert.IsTrue(e1 == 3102);
     int i1 = e1.Value;
     EnmxAddress e2 = new EnmxAddress(i1);
     Assert.AreEqual(a1, e2.Address);
     for (int i = 0; i < 32768; i++)
     {
         EnmxAddress a = new EnmxAddress(i);
         string aString = a.Address;
         EnmxAddress b = EnmxAddress.Parse(aString);
         Assert.AreEqual(a, b);
         Assert.IsTrue(a == b);
     }
 }
예제 #3
0
 public void Write(EnmxAddress address, int data)
 {
     if (WriteGroupTelegram != null)
         WriteGroupTelegram(this, new WriteGroupTelegramEventArgs(address, data));
 }
예제 #4
0
 public static IEnumerable<XElement> TranslateGroups(Project project)
 {
     var gas = project.GroupRanges.SelectMany(row => row.Ranges).SelectMany(row => row.Addresses);
     foreach (var ga in gas)
     {
         XElement element = new XElement(ns + "Gruppadress");
         var ea = new EnmxAddress(ga.Value);
         var enmx = ea.Address.Split('/');
         element.Add(Create("Huvudgrupp", enmx[0]));
         element.Add(Create("Huvudgruppnamn", ga.ParentRange.ParentRange.Name));
         element.Add(Create("Huvudgruppbeskrivning", ga.ParentRange.ParentRange.Description));
         element.Add(Create("Mellangrupp", enmx[1]));
         element.Add(Create("Mellangruppnamn", ga.ParentRange.Name));
         element.Add(Create("Mellangruppbeskrivning", ga.ParentRange.Description));
         element.Add(Create("Gruppadress", ea.Address));
         element.Add(Create("Gruppadressnamn", ga.Name));
         element.Add(Create("Gruppadressbeskrivning", ga.Description));
         element.Add(Create("Längd", ga.ComObjectInstances.Select(row => row["ObjectSize"]).FirstOrDefault()));
         element.Add(Create("Antal förbindelser", ga.ComObjectInstances.Count()));
         element.Add(Create("Centralfunktion", "Nej?"));
         element.Add(Create("Passera genom linjekopplare", "Nej?"));
         yield return element;
     }
 }