Exemplo n.º 1
0
 /// <summary>
 /// This command consists of consecutive bytes to set up the horizontal scroll parameters
 /// and determines the scrolling start page, end page and scrolling speed.
 /// </summary>
 /// <param name="scrollType">Horizontal scroll type.</param>
 /// <param name="startPageAddress">Start page address with a range of 0-7.</param>
 /// <param name="frameFrequencyType">Frame frequency type with a range of 0-7.</param>
 /// <param name="endPageAddress">End page address with a range of 0-7.</param>
 public HorizontalScrollSetup(
     HorizontalScrollType scrollType,
     PageAddress startPageAddress,
     FrameFrequencyType frameFrequencyType,
     PageAddress endPageAddress)
 {
     ScrollType         = scrollType;
     StartPageAddress   = startPageAddress;
     FrameFrequencyType = frameFrequencyType;
     EndPageAddress     = endPageAddress;
 }
        /// <summary>
        /// This command consists of 6 consecutive bytes to set up the continuous vertical
        /// scroll parameters and determines the scrolling start page, end page, scrolling
        /// speed and vertical scrolling offset.
        /// </summary>
        /// <param name="scrollType">Vertical/Horizontal scroll type.</param>
        /// <param name="startPageAddress">Start page address with a range of 0-7.</param>
        /// <param name="frameFrequencyType">Frame frequency type with a range of 0-7.</param>
        /// <param name="endPageAddress">End page address with a range of 0-7.</param>
        /// <param name="verticalScrollingOffset">Vertical scrolling offset with a range of 0-63.</param>
        public ContinuousVerticalAndHorizontalScrollSetup(
            VerticalHorizontalScrollType scrollType,
            PageAddress startPageAddress,
            FrameFrequencyType frameFrequencyType,
            PageAddress endPageAddress,
            byte verticalScrollingOffset)
        {
            if (verticalScrollingOffset > 0x3F)
            {
                throw new ArgumentOutOfRangeException(nameof(verticalScrollingOffset));
            }

            ScrollType              = scrollType;
            StartPageAddress        = startPageAddress;
            FrameFrequencyType      = frameFrequencyType;
            EndPageAddress          = endPageAddress;
            VerticalScrollingOffset = verticalScrollingOffset;
        }
        public void Get_Bytes(
            VerticalHorizontalScrollType scrollType,
            PageAddress startPageAddress,
            FrameFrequencyType frameFrequencyType,
            PageAddress endPageAddress,
            byte verticalScrollingOffset,
            byte[] expectedBytes)
        {
            ContinuousVerticalAndHorizontalScrollSetup continuousVerticalAndHorizontalScrollSetup = new ContinuousVerticalAndHorizontalScrollSetup(
                scrollType,
                startPageAddress,
                frameFrequencyType,
                endPageAddress,
                verticalScrollingOffset);

            byte[] actualBytes = continuousVerticalAndHorizontalScrollSetup.GetBytes();
            Assert.Equal(expectedBytes, actualBytes);
        }
Exemplo n.º 4
0
        public void Get_Bytes(HorizontalScrollType scrollType, PageAddress startPageAddress, FrameFrequencyType frameFrequencyType, PageAddress endPageAddress, byte[] expectedBytes)
        {
            HorizontalScrollSetup horizontalScrollSetup = new HorizontalScrollSetup(
                scrollType,
                startPageAddress,
                frameFrequencyType,
                endPageAddress);

            byte[] actualBytes = horizontalScrollSetup.GetBytes();
            Assert.Equal(expectedBytes, actualBytes);
        }