aura-ipx-36nofine.py 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  1. import json
  2. from collections import OrderedDict
  3. f_out = open("patch.sav","w")
  4. nr=0
  5. dmx=1
  6. def add(jdata,att):
  7. global nr,dmx,name,fix,sub
  8. print("======", "{}_{} {:03}".format( name,fix,sub) )
  9. #for i in jdata:
  10. # print(i )
  11. if "ATTRIBUT" in jdata:
  12. for a in att:
  13. if a == "":
  14. print("---",nr+dmx-1,nr,"")
  15. nr+=1
  16. continue
  17. rdata = '{"NR": 1, "MASTER": "0", "MODE": "S", "VALUE": 0, "ACTIVE": 0, "FX": "", "FX2": {}}'
  18. rdata = '{"NR": 1, "MASTER": "0", "MODE": "S", "VALUE": 0, "ACTIVE": 0, "FX": "", "FX2": {}}'
  19. jattr = json.loads(rdata,object_pairs_hook=OrderedDict)
  20. jattr["NR"] = nr
  21. if a in ["DIM","RED","GREEN","BLUE"]: #,"PAN","TILT","ZOOM","IRIS"]:
  22. jattr["MODE"] = "F"
  23. jdata["ATTRIBUT"][a] = jattr
  24. print("add",nr+dmx-1,nr,a)
  25. nr+=1
  26. print()
  27. fix = 99801
  28. sub = 1
  29. name = "Aura-ipx"
  30. dmx = 1
  31. univ = 4
  32. #for i in range(9*13): # fixtures
  33. #for i in range(8+1*12+1): # fixtures
  34. #for i in range((8*2)+1*(12*2)+1): # fixtures
  35. for i in range(6): # fixtures
  36. print("====================================")
  37. rdata='{"DMX": 1, "UNIVERS": 2, "NAME": "xxXXxx", "TYPE": "MOVER", "VENDOR": "MARTIN", "ATTRIBUT":{}}'
  38. jdata = json.loads(rdata,object_pairs_hook=OrderedDict)
  39. jdata["NAME"] = "{}_{}{:02}".format( name,fix,sub)
  40. jdata["NAME"] = "{}_{:03}".format( name,fix)#,sub)
  41. nr=1
  42. jdata["UNIVERS"] = univ
  43. jdata["DMX"] = dmx
  44. att = []
  45. att.append("SHUTTER")
  46. att.append("DIM")
  47. att.append("DIM-FINE")
  48. att.append("RED")
  49. att.append("")#RED-FINE")
  50. att.append("GREEN")
  51. att.append("")#GREEN-FINE")
  52. att.append("BLUE")
  53. att.append("")#BLUE-FINE")
  54. att.append("") # 10 ctc
  55. att.append("") # 11 grün-mag
  56. att.append("") # 12 color
  57. att.append("ZOOM") # 13
  58. att.append("ZOOM-FINE") # 14
  59. att.append("PAN") # 15
  60. att.append("PAN-FINE") # 16
  61. att.append("TILT") # 17
  62. att.append("TILT-FINE") # 18
  63. att.append("CONTROL") # 19
  64. att.append("") # 20 FREQ
  65. att.append("") # 21 P3 BEAM
  66. att.append("GOBO1") # 22
  67. att.append("G1-ROT") # 23
  68. att.append("GOBO2") # 24
  69. att.append("G2-ROT") # 25
  70. att.append("PRISMA") # 26
  71. att.append("A-SHUTTER") # Aura
  72. att.append("A-DIM") # Aura
  73. att.append("A-DIM-FINE") # Aura
  74. att.append("A-RED") # Aura
  75. att.append("A-GREEN") # Aura
  76. att.append("A-BLUE") # Aura
  77. att.append("") # 33 Aura ctc
  78. att.append("") # 34 Aura grün-mag
  79. att.append("") # 35 Auta color
  80. att.append("") # 36 Aura P3 BEAM
  81. add(jdata,att)
  82. fnr="{}{:02}".format(fix,sub)
  83. fnr="{}".format(fix,sub)
  84. fnr="{:04}".format(fix,sub)
  85. f_out.write("{}\t{}\t{}\n".format(fnr,fnr,json.dumps(jdata) ) )
  86. f_out.flush()
  87. rdata='{"DMX": 1, "UNIVERS": 2, "NAME": "SPX7_01", "TYPE": "MOVER", "VENDOR": "JB", "ATTRIBUT":{}}'
  88. jdata = json.loads(rdata,object_pairs_hook=OrderedDict)
  89. if 0:#for i in range(3):
  90. sub+=1
  91. jdata["NAME"] = "{}_{:03}{:03}".format( name,fix,sub)
  92. dmx+=nr-1
  93. univ=2
  94. nr=1
  95. jdata["UNIVERS"] = univ
  96. jdata["DMX"] = dmx
  97. att = []
  98. att.append("RED")
  99. att.append("GREEN")
  100. att.append("BLUE")
  101. att.append("WHITE")
  102. add(jdata,att)
  103. fnr="{}{:02}".format(fix,sub)
  104. fnr="{:04}".format(fix,sub)
  105. f_out.write("{}\t{}\t{}\n".format(fnr,fnr,json.dumps(jdata) ) )
  106. f_out.flush()
  107. fix += 1
  108. sub=1
  109. dmx+=nr-1
  110. if dmx >= 512:
  111. univ +=1
  112. dmx = 1