示例#1
0
        public void shifts_all_x_data_values_by_x_shift()
        {
            var points     = new Point[] { (1, 1), (2, 2) };
            var dataSource = new DataSource(points);

            var node  = new AnalysisNode();
            var shift = new ShiftOperation {
                XShift = 5
            };

            node.AddSource(dataSource);

            node.Set(shift);

            node.Data.PointSets.Single().ShouldBe(new Point[] { (6, 1), (7, 2) });
示例#2
0
文件: Lcd.cs 项目: josemotta/Netduino
        /// <summary>
        /// Moves cursor and shifts display without changing DDRAM contents.
        /// </summary>
        /// <param name="shiftOperation">Shift display or cursor move</param>
        /// <param name="shiftDirection">Shift display or cursor move direction</param>
        private void Shift(ShiftOperation shiftOperation, ShiftDirection shiftDirection)
        {
            //  DB7 DB6 DB5 DB4 DB3 DB2 DB1 DB0
            //  0   0   0   1   SC  RL  -   -

            byte shiftCmd = SHIFT_MOVE;

            // display shift
            if (shiftOperation == ShiftOperation.DisplayShift)
            {
                shiftCmd |= SHIFT_DISPLAY;
            }

            // right direction
            if (shiftDirection == ShiftDirection.Right)
            {
                shiftCmd |= SHIFT_RIGHT;
            }

            this.SendCommand(shiftCmd); // 37 us (datasheet)
        }
示例#3
0
 protected override void GetOperation(object operation)
 {
     _myOperation = (ShiftOperation)operation;
 }
示例#4
0
        /// <summary>
        /// Moves cursor and shifts display without changing DDRAM contents.
        /// </summary>
        /// <param name="shiftOperation">Shift display or cursor move</param>
        /// <param name="shiftDirection">Shift display or cursor move direction</param>
        private void Shift(ShiftOperation shiftOperation, ShiftDirection shiftDirection)
        {
            //  DB7 DB6 DB5 DB4 DB3 DB2 DB1 DB0
            //  0   0   0   1   SC  RL  -   -

            byte shiftCmd = SHIFT_MOVE;

            // display shift
            if (shiftOperation == ShiftOperation.DisplayShift)
                shiftCmd |= SHIFT_DISPLAY;

            // right direction
            if (shiftDirection == ShiftDirection.Right)
                shiftCmd |= SHIFT_RIGHT;

            this.SendCommand(shiftCmd); // 37 us (datasheet)
        }
示例#5
0
		protected override void GetOperation(object operation)
		{
			MyOperation = (ShiftOperation)operation;
		}