source_input.py 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. # -*- coding:utf-8 -*-
  2. import os, sys, time
  3. # from ssat_sdk.device_manage.c22293_manager import *
  4. from ssat_sdk.device_manage.Chroma22293 import C22293Manager
  5. class SourceGenInput():
  6. def __init__(self):
  7. self.c22293Manager = C22293Manager()
  8. def setPattern(self, pattern, device = 1, timeout = 300):
  9. return self.c22293Manager.setPattern(pattern, device, timeout)
  10. def setTiming(self, timing, device = 1, timeout = 300):
  11. return self.c22293Manager.setTiming(timing, device, timeout)
  12. def setTimingPattern(self, timing, pattern, device = 1, timeout = 300):
  13. if self.setTiming(timing, device, timeout):
  14. if self.setPattern(pattern, device, timeout):
  15. return True
  16. return False
  17. # return self.c22293Manager.setTimingPattern(timing, pattern, device, timeout)
  18. def getDeviceName(self, device = 1, timeout = 300):
  19. return self.c22293Manager.getDeviceName(device, timeout)
  20. def getDeviceSoft(self, device = 1, timeout = 300):
  21. return self.c22293Manager.getDeviceSoft(device, timeout)
  22. def getStatus(self, device = 1, timeout = 300):
  23. return self.c22293Manager.getStatus(device, timeout)
  24. def setBlueOFF(self, device = 1, timeout = 300):
  25. return self.c22293Manager.setBlueOFF(device, timeout)
  26. def setBlueON(self, device = 1, timeout = 300):
  27. return self.c22293Manager.setBlueON(device, timeout)
  28. def setGreenOFF(self, device = 1, timeout = 300):
  29. return self.c22293Manager.setGreenOFF(device, timeout)
  30. def setGreenON(self, device = 1, timeout = 300):
  31. return self.c22293Manager.setGreenON(device, timeout)
  32. def setRedOFF(self, device = 1, timeout = 300):
  33. return self.c22293Manager.setRedOFF(device, timeout)
  34. def setRedON(self, device = 1, timeout = 300):
  35. return self.c22293Manager.setRedON(device, timeout)
  36. def setKeyBoardLock(self, device = 1, timeout = 300):
  37. return self.c22293Manager.setKeyBoardLock(device, timeout)
  38. def setKeyBoardUnLock(self, device = 1, timeout = 300):
  39. return self.c22293Manager.setKeyBoardUnLock(device, timeout)
  40. if __name__ == "__main__":
  41. SG = SourceGenInput()
  42. SG.setPattern(106)
  43. SG.setTiming(74)
  44. SG.setTimingPattern(73,101)
  45. SG.setBlueOFF()
  46. SG.setBlueON()
  47. SG.setRedOFF()
  48. SG.setRedON()
  49. SG.setGreenOFF()
  50. SG.setGreenON()
  51. print SG.getStatus()
  52. print SG.getDeviceSoft()
  53. print SG.getDeviceName()
  54. SG.setKeyBoardLock()
  55. SG.setKeyBoardUnLock()