コード例 #1
0
        public Blink1Preset ToResponseType(byte[] responseData)
        {
            var color    = Color.FromArgb(responseData[2], responseData[3], responseData[4]);
            var duration = new Blink1Duration(responseData[5], responseData[6]);

            return(new Blink1Preset(color, duration));
        }
コード例 #2
0
 public EnableInactivityModeCommand(Blink1Duration waitDuration, bool maintainState, ushort startPosition,
                                    ushort endPosition)
 {
     this.waitDuration  = waitDuration;
     this.maintainState = maintainState;
     this.startPosition = startPosition;
     this.endPosition   = endPosition;
 }
コード例 #3
0
        public void ImplicitConversionToTimeSpan(uint timeInMilliseconds, uint expected)
        {
            var ts = TimeSpan.FromMilliseconds(timeInMilliseconds);

            var sut = new Blink1Duration(ts);

            TimeSpan actual = sut;

            Assert.Equal(expected, actual.TotalMilliseconds);
        }
コード例 #4
0
        public void LowIsSetCorrectlyFromTimeSpanCtorInput(uint timeInMilliseconds, byte expected)
        {
            var ts = TimeSpan.FromMilliseconds(timeInMilliseconds);

            var sut = new Blink1Duration(ts);

            var actual = sut.Low;

            Assert.Equal(expected, actual);
        }
コード例 #5
0
 public EnableInactivityModeCommand(Blink1Duration waitDuration)
 {
     this.waitDuration = waitDuration;
 }
コード例 #6
0
ファイル: Blink1Preset.cs プロジェクト: teetoniwilson/blink1
 public Blink1Preset(Color color, TimeSpan duration)
 {
     Color         = color;
     this.duration = duration;
 }
コード例 #7
0
 public FadeToColorCommand(Color color, Blink1Duration duration, LEDPosition ledPosition)
 {
     this.color       = color;
     this.duration    = duration;
     this.ledPosition = ledPosition;
 }
コード例 #8
0
 public FadeToColorCommand(Color color, Blink1Duration duration) : this(color, duration, LEDPosition.Both)
 {
 }