Esempio n. 1
0
    def test_from_block_repeating_not_mode_01(self):
        s = SwirlFrame()
        block = Block()
        block.from_list([0, 0x7e, 0, 50, 120, 126, 98, 0, 0xff, 0xff, 0, 0])
        s.from_block(block, 0)

        assert_equal(len(s.rows), 224)
        for row in s.rows[0:0x7e]:
            assert_equal(SwirlFrameRow(x1=0, x2=50, x3=120, x4=126), row)
        for row in s.rows[0x7e:]:
            assert_equal(SwirlFrameRow(x1=0, x2=0xff, x3=0xff, x4=0), row)
Esempio n. 2
0
    def test_from_block_repeating_mode_01(self):
        s = SwirlFrame()
        block = Block()
        block.from_list([1, 0x7f, 1, 2, 97, 3, 4, 0])
        s.from_block(block, 0)

        assert_equal(len(s.rows), 224)
        for row in s.rows[0:0x7f]:
            assert_equal(SwirlFrameRow(x1=1, x2=2, x3=0xff, x4=0), row)
        for row in s.rows[0x7f:]:
            assert_equal(SwirlFrameRow(x1=3, x2=4, x3=0xff, x4=0), row)
Esempio n. 3
0
    def test_from_block_continuous_mode_01(self):
        s = SwirlFrame()
        block = Block()
        block.from_list([1, 0x7f, 1, 2, 0x82, 50, 51, 52, 53, 95, 3, 4, 0])
        s.from_block(block, 0)

        assert_equal(len(s.rows), 224)
        for row in s.rows[0:0x7f]:
            assert_equal(SwirlFrameRow(x1=1, x2=2, x3=0xff, x4=0), row)
        assert_equal(SwirlFrameRow(x1=50, x2=51, x3=0xff, x4=0), s.rows[0x7f])
        assert_equal(SwirlFrameRow(x1=52, x2=53, x3=0xff, x4=0), s.rows[0x80])
        for row in s.rows[0x81:]:
            assert_equal(SwirlFrameRow(x1=3, x2=4, x3=0xff, x4=0), row)
Esempio n. 4
0
    def test_from_block_repeating_not_mode_01(self):
        s = SwirlFrame()
        block = Block()
        block.from_list([0,
                         0x7e, 0, 50, 120, 126,
                         98, 0, 0xff, 0xff, 0,
                         0])
        s.from_block(block, 0)

        assert_equal(len(s.rows), 224)
        for row in s.rows[0:0x7e]:
            assert_equal(SwirlFrameRow(x1=0, x2=50, x3=120, x4=126), row)
        for row in s.rows[0x7e:]:
            assert_equal(SwirlFrameRow(x1=0, x2=0xff, x3=0xff, x4=0), row)
Esempio n. 5
0
    def test_from_block_repeating_mode_01(self):
        s = SwirlFrame()
        block = Block()
        block.from_list([1,
                         0x7f, 1, 2,
                         97, 3, 4,
                         0])
        s.from_block(block, 0)

        assert_equal(len(s.rows), 224)
        for row in s.rows[0:0x7f]:
            assert_equal(SwirlFrameRow(x1=1, x2=2, x3=0xff, x4=0), row)
        for row in s.rows[0x7f:]:
            assert_equal(SwirlFrameRow(x1=3, x2=4, x3=0xff, x4=0), row)
Esempio n. 6
0
    def test_from_block_continuous_not_mode_01(self):
        s = SwirlFrame()
        block = Block()
        block.from_list([
            0, 0x7f, 0, 50, 120, 126, 0x82, 50, 51, 52, 53, 54, 55, 0xff, 0,
            95, 0, 0xff, 0xff, 0, 0
        ])
        s.from_block(block, 0)

        assert_equal(len(s.rows), 224)
        for row in s.rows[0:0x7f]:
            assert_equal(SwirlFrameRow(x1=0, x2=50, x3=120, x4=126), row)
        assert_equal(SwirlFrameRow(x1=50, x2=51, x3=52, x4=53), s.rows[0x7f])
        assert_equal(SwirlFrameRow(x1=54, x2=55, x3=0xff, x4=0), s.rows[0x80])
        for row in s.rows[0x81:]:
            assert_equal(SwirlFrameRow(x1=0, x2=0xff, x3=0xff, x4=0), row)
Esempio n. 7
0
    def test_from_block_continuous_mode_01(self):
        s = SwirlFrame()
        block = Block()
        block.from_list([1,
                         0x7f, 1, 2,
                         0x82, 50, 51, 52, 53,
                         95, 3, 4,
                         0])
        s.from_block(block, 0)

        assert_equal(len(s.rows), 224)
        for row in s.rows[0:0x7f]:
            assert_equal(SwirlFrameRow(x1=1, x2=2, x3=0xff, x4=0), row)
        assert_equal(SwirlFrameRow(x1=50, x2=51, x3=0xff, x4=0), s.rows[0x7f])
        assert_equal(SwirlFrameRow(x1=52, x2=53, x3=0xff, x4=0), s.rows[0x80])
        for row in s.rows[0x81:]:
            assert_equal(SwirlFrameRow(x1=3, x2=4, x3=0xff, x4=0), row)
Esempio n. 8
0
    def test_from_block_continuous_not_mode_01(self):
        s = SwirlFrame()
        block = Block()
        block.from_list([0,
                         0x7f, 0, 50, 120, 126,
                         0x82, 50, 51, 52, 53, 54, 55, 0xff, 0,
                         95, 0, 0xff, 0xff, 0,
                         0])
        s.from_block(block, 0)

        assert_equal(len(s.rows), 224)
        for row in s.rows[0:0x7f]:
            assert_equal(SwirlFrameRow(x1=0, x2=50, x3=120, x4=126), row)
        assert_equal(SwirlFrameRow(x1=50, x2=51, x3=52, x4=53), s.rows[0x7f])
        assert_equal(SwirlFrameRow(x1=54, x2=55, x3=0xff, x4=0), s.rows[0x80])
        for row in s.rows[0x81:]:
            assert_equal(SwirlFrameRow(x1=0, x2=0xff, x3=0xff, x4=0), row)