channel information done

channel table modify
This commit is contained in:
YiChin2018
2019-07-19 16:23:44 +08:00
parent 2e011084ed
commit 0d8f2fe522
3 changed files with 14 additions and 2 deletions
+10 -1
View File
@@ -71,6 +71,15 @@ def channel_used_count(channel_mux: List[int]) -> Optional[List[int]]:
return channel_uc
def channel_table_transfer(channel_mux: List[int]) -> Optional[List[int]]:
channel_look_up_table = [1, 2, 3, 4, 9, 8, 7, 6, 5, 10, 0, 11]
true_channel = [0] * 16
for i in range(12):
true_channel[i] = channel_look_up_table[channel_mux[i]]
return true_channel
class UniRearrangeMuxChannelTest(unittest.TestCase):
def test_empty_channel(self):
self.assertIsNone(rearrange_channel_mux_table(to_channel_table()))
@@ -111,7 +120,7 @@ class UniRearrangeMuxChannelTest(unittest.TestCase):
rearrange_channel_mux_table(to_channel_table(3, 4, 5, 6, 7, 8)))
channel_uc = []
channel_mux = []
ch_mux = rearrange_channel_mux_table(to_channel_table(3, 4, 5, 6, 7, 8))
ch_mux = rearrange_channel_mux_table(to_channel_table(3, 4, 5, 6, 7))
ch_used = channel_used_count(ch_mux)
print(ch_used)
print(ch_mux)