123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960 |
- # -*- coding: UTF-8 -*-
- from utils.serial_TG39BX1 import *
- class AtvChannelTable():
- """
- VHF/UHF/CATV Channel Table
- """
- def __init__(self, port):
- self.tg39ser = Serial_TG39BX1(port)
- self.tg39ser.open()
- # self.tg39ser.execmd("VCOL 1")
- # self.tg39ser.execmd("VSIGCB 1")
- # self.tg39ser.execmd("SUSA")
- # self.tg39ser.execmd("SCAR 1")
- # self.tg39ser.execmd("SMODE 2")
- # self.tg39ser.execmd("SCH1 1")
- # self.tg39ser.execmd("RSYS 0")
- # 使用TG39BX1预制的各国的频道
- def setCTYandCHN(self, countryID, channelID):
- """
- RFCHA-arg1 For arg1, input the country name ID to set (as a decimal number).
- RFCHB-arg2 For arg2, input the channel ID to set (as a decimal number).
- countryID channelID
- 1 JAPAN 1 to 62
- 2 USA 2 to 83
- 3 EU 1 to 69
- 4 CHINA 1 to 68
- 5 UK 21 to 69
- 6 R 1 to 69
- 7 FRANCE 1 to 69
- 8 AUSTRALIA 1 to 69
- 9 JAPAN-C 1 to 63
- 10 USA-C 2 to 150
- 11 EU-C 2 to 56
- 12 CHINA-C 1 to 51
- 13 ITY 1 to 69
- 14 IRE 1 to 69
- """
- self.tg39ser.execmd("RFCHA" + " " + str(countryID))
- self.tg39ser.execmd("RFCHB" + " " + str(channelID))
- def close(self):
- self.tg39ser.close()
- def __del__(self):
- self.tg39ser.close()
- # - - - - - - - - - - - - - - - - - - - - - - - - -
- if __name__ == "__main__":
- print "ATV USA Channel Table"
- atvChannelTable = AtvChannelTable("COM6")
- atvChannelTable.setCTYandCHN(2, 81)
|