9from .facade_interface
import IDeviceNetworkHighLevel
10from .facade_highlevelsystem
import CreateHighLevelInstance
22 output.write(
" On chain {0}, idcodes = [ ".format(chainIndex))
23 for idcode
in idcodes:
24 output.write(
"0x{0:X} ".format(idcode))
26 print(output.getvalue())
48 print(
"Facade Exercise")
50 deviceChainFacade = CreateHighLevelInstance()
51 numChains = deviceChainFacade.GetNumChains()
52 print(
" Showing idcodes of devices after a device reset (expect one device on each chain)...")
53 for chainIndex
in range(0, numChains):
54 deviceChainFacade.DisableDevicesInDeviceChain(chainIndex)
55 idcodes = deviceChainFacade.GetIdcodes(chainIndex)
58 print(
" Showing idcodes of devices after selecting all devices...")
59 for chainIndex
in range(0, numChains):
60 deviceChainFacade.EnableDevicesInDeviceChain(chainIndex, 0xffffffff)
61 idcodes = deviceChainFacade.GetIdcodes(chainIndex)
None _Facade_ShowIdCodes(int chainIndex, list idcodes)
Helper method to present a formatted list of idcodes for a particular device chain.
def Facade_Exercise()
Example of using the Facade Pattern.