Пример #1
0
 public void AllUnitsOff(X10HouseCode housecode)
 {
     lock (commandLock)
     {
         string hcunit    = String.Format("{0:X}{1:X}", (int)housecode, 0);
         string hcfuntion = String.Format("{0:x1}{1:x1}", (int)housecode, (int)X10Command.All_Units_Off);
         SendMessage(new byte[] {
             (int)X10CommandType.Address,
             byte.Parse(
                 hcunit,
                 System.Globalization.NumberStyles.HexNumber
                 )
         });
         SendMessage(new byte[] {
             (int)X10CommandType.Function,
             byte.Parse(
                 hcfuntion,
                 System.Globalization.NumberStyles.HexNumber
                 )
         });
         //
         // TODO: pick only lights module
         CommandEvent_AllUnitsOff(housecode.ToString());
     }
 }
Пример #2
0
 public static string HouseUnitCodeFromEnum(X10HouseCode housecode, X10UnitCode unitcodes)
 {
     string unit = unitcodes.ToString();
     unit = unit.Substring(unit.LastIndexOf("_") + 1);
     //
     return housecode.ToString() + unit;
 }
Пример #3
0
        public static string HouseUnitCodeFromEnum(X10HouseCode housecode, X10UnitCode unitcodes)
        {
            string unit = unitcodes.ToString();

            unit = unit.Substring(unit.LastIndexOf("_") + 1);
            //
            return(housecode.ToString() + unit);
        }
Пример #4
0
 private void CommandEvent_AllUnitsOff(X10HouseCode houseCode)
 {
     UnselectModules();
     // TODO: select only light modules
     foreach (KeyValuePair<string, X10Module> modkv in modules)
     {
         if (modkv.Value.Code.StartsWith(houseCode.ToString()))
         {
             modkv.Value.Level = 0.0;
         }
     }
 }
Пример #5
0
 public void AllUnitsOff(X10HouseCode housecode)
 {
     lock (commandLock)
     {
         string hcunit = String.Format("{0:X}{1:X}", (int)housecode, 0);
         string hcfuntion = String.Format("{0:x1}{1:x1}", (int)housecode, (int)X10Command.All_Units_Off);
         SendMessage(new byte[] {
             (int)X10CommandType.Address,
             byte.Parse(
                 hcunit,
                 System.Globalization.NumberStyles.HexNumber
             )
         });
         SendMessage(new byte[] {
             (int)X10CommandType.Function,
             byte.Parse(
                 hcfuntion,
                 System.Globalization.NumberStyles.HexNumber
             )
         });
         //
         // TODO: pick only lights module
         CommandEvent_AllUnitsOff(housecode.ToString());
     }
 }