Permalink
Browse files

General update

Working version uning nwjs in Mac OSX, integrated with The Whitecat Create Agent.
  • Loading branch information...
jolivepetrus committed Mar 23, 2017
1 parent 282e70f commit 6d150d57cbb3c8d1a2cf12a11ee41ca76cd0ed9a
Showing with 8,387 additions and 4,251 deletions.
  1. +2 −0 .gitignore
  2. BIN closure-compiler-v20170124.jar
  3. BIN closure-library/closure/bin/calcdeps.pyc
  4. +0 −130 src/adapters/adapter.js
  5. +0 −15 src/adapters/defs/FTDI.json
  6. +0 −15 src/adapters/defs/silicon-labs.json
  7. +99 −0 src/bin/darwin/boards/lua/board-info.lua
  8. +25 −0 src/bin/darwin/boards/lua/lib/block-adc.lua
  9. +39 −0 src/bin/darwin/boards/lua/lib/block-event.lua
  10. +33 −0 src/bin/darwin/boards/lua/lib/block-gpio.lua
  11. +9 −0 src/bin/darwin/boards/lua/lib/block-led.lua
  12. +63 −0 src/bin/darwin/boards/lua/lib/block-lora.lua
  13. +22 −0 src/bin/darwin/boards/lua/lib/block-pwm.lua
  14. +56 −0 src/bin/darwin/boards/lua/lib/block-sensor.lua
  15. +31 −0 src/bin/darwin/boards/lua/lib/block-servo.lua
  16. +55 −0 src/bin/darwin/boards/lua/lib/block.lua
  17. +19 −0 src/bin/darwin/boards/lua/lib/untitled.txt
  18. +4 −0 src/bin/darwin/boards/lua/untitled.txt
  19. BIN src/bin/darwin/whitecat-create-agent
  20. +29 −29 src/blockly_compressed.js
  21. +4 −7 src/blockly_uncompressed.js
  22. +15 −0 src/blocks/events.js
  23. +8 −8 src/blocks/i2c.js
  24. +183 −246 src/blocks/io.js
  25. +6 −5 src/blocks/logic.js
  26. +299 −214 src/blocks/lora.js
  27. +2 −2 src/blocks/math.js
  28. +9 −6 src/blocks/sensor.js
  29. +97 −0 src/blocks/servo.js
  30. +1 −5 src/blocks/try.js
  31. +44 −44 src/blocks_compressed.js
  32. +188 −0 src/boards/agent.js
  33. +81 −1,170 src/boards/board.js
  34. +72 −0 src/boards/defs/N1ESP32.json
  35. +0 −131 src/boards/defs/whitecat-n1-esp32.json
  36. +13 −0 src/boards/lua/blocks.lua
  37. +1,043 −892 src/code.js
  38. +22 −0 src/compile.py
  39. +0 −25 src/console.html
  40. +0 −4 src/console.js
  41. +5 −1 src/core/flyout.js
  42. +95 −0 src/core/wc/block.js
  43. +345 −0 src/core/wc/lora.js
  44. +24 −24 src/core/wc/sensors.js
  45. +197 −31 src/core/wc/workspace.js
  46. +1 −0 src/css-min.css
  47. +0 −19 src/debug.html
  48. +0 −5 src/debug.js
  49. +0 −6 src/debugd.js
  50. +0 −135 src/editSettings.html
  51. +64 −18 src/generators/lua/events.js
  52. +6 −6 src/generators/lua/i2c.js
  53. +48 −83 src/generators/lua/io.js
  54. +34 −2 src/generators/lua/lora.js
  55. +146 −21 src/generators/lua/lua-generator.js
  56. +37 −6 src/generators/lua/sensors.js
  57. +33 −39 src/{menu.js → generators/lua/servo.js}
  58. BIN src/i18n/common.pyc
  59. +17 −67 src/index.html
  60. +183 −0 src/indexu.html
  61. +315 −0 src/lib/bootstrap/js/bootstrap-checkbox.js
  62. +342 −0 src/lib/jquery.balloon.min.js
  63. +1,887 −0 src/lib/slider/bootstrap-slider.js
  64. +138 −0 src/lib/slider/slider.css
  65. +28 −14 src/lua_compressed.js
  66. +23 −10 src/msg/js/ar.js
  67. +23 −10 src/msg/js/az.js
  68. +23 −10 src/msg/js/ba.js
  69. +23 −10 src/msg/js/bcc.js
  70. +23 −10 src/msg/js/be-tarask.js
  71. +23 −10 src/msg/js/bg.js
  72. +23 −10 src/msg/js/bn.js
  73. +23 −10 src/msg/js/br.js
  74. +50 −37 src/msg/js/ca.js
  75. +23 −10 src/msg/js/cs.js
  76. +23 −10 src/msg/js/da.js
  77. +23 −10 src/msg/js/de.js
  78. +23 −10 src/msg/js/diq.js
  79. +23 −10 src/msg/js/el.js
  80. +23 −10 src/msg/js/en-gb.js
  81. +23 −10 src/msg/js/en.js
  82. +50 −37 src/msg/js/es.js
  83. +23 −10 src/msg/js/et.js
  84. +23 −10 src/msg/js/fa.js
  85. +23 −10 src/msg/js/fi.js
  86. +23 −10 src/msg/js/fr.js
  87. +23 −10 src/msg/js/he.js
  88. +23 −10 src/msg/js/hi.js
  89. +23 −10 src/msg/js/hrx.js
  90. +23 −10 src/msg/js/hu.js
  91. +23 −10 src/msg/js/ia.js
  92. +23 −10 src/msg/js/id.js
  93. +23 −10 src/msg/js/is.js
  94. +23 −10 src/msg/js/it.js
  95. +23 −10 src/msg/js/ja.js
  96. +23 −10 src/msg/js/ko.js
  97. +23 −10 src/msg/js/lb.js
  98. +23 −10 src/msg/js/lki.js
  99. +23 −10 src/msg/js/lrc.js
  100. +23 −10 src/msg/js/lt.js
  101. +23 −10 src/msg/js/lv.js
  102. +23 −10 src/msg/js/mk.js
  103. +23 −10 src/msg/js/ms.js
  104. +23 −10 src/msg/js/nb.js
  105. +23 −10 src/msg/js/nl.js
  106. +23 −10 src/msg/js/oc.js
  107. +23 −10 src/msg/js/pl.js
  108. +23 −10 src/msg/js/pms.js
  109. +23 −10 src/msg/js/pt-br.js
  110. +23 −10 src/msg/js/pt.js
  111. +23 −10 src/msg/js/ro.js
  112. +23 −10 src/msg/js/ru.js
  113. +23 −10 src/msg/js/sc.js
  114. +23 −10 src/msg/js/sd.js
  115. +23 −10 src/msg/js/shn.js
  116. +23 −10 src/msg/js/sk.js
  117. +23 −10 src/msg/js/sl.js
  118. +23 −10 src/msg/js/sq.js
  119. +23 −10 src/msg/js/sr.js
  120. +23 −10 src/msg/js/sv.js
  121. +23 −10 src/msg/js/ta.js
  122. +23 −10 src/msg/js/tcy.js
  123. +23 −10 src/msg/js/th.js
  124. +23 −10 src/msg/js/tl.js
  125. +23 −10 src/msg/js/tlh.js
  126. +23 −10 src/msg/js/tr.js
  127. +23 −10 src/msg/js/uk.js
  128. +23 −10 src/msg/js/vi.js
  129. +23 −10 src/msg/js/zh-hans.js
  130. +23 −10 src/msg/js/zh-hant.js
  131. +56 −14 src/msg/json/ca.json
  132. +24 −11 src/msg/json/en.json
  133. +55 −13 src/msg/json/es.json
  134. +2 −0 src/msg/wc/ca.js
  135. +2 −0 src/msg/wc/en.js
  136. +2 −0 src/msg/wc/es.js
  137. +1 −1 src/package.json
  138. +0 −3 src/run.sh
  139. +0 −57 src/serialPortList.html
  140. +1 −1 src/settings.json
  141. +23 −2 src/style.css
  142. +1 −0 src/wc.js
  143. +32 −20 src/{ → wc}/settings.js
  144. +121 −0 src/wc/watcher.js
  145. BIN yuicompressor-2.4.8.jar
View
@@ -1,2 +1,4 @@
app/
**/.DS_Store
src/compress
src/deploy
Binary file not shown.
Binary file not shown.
View

This file was deleted.

Oops, something went wrong.

This file was deleted.

Oops, something went wrong.

This file was deleted.

Oops, something went wrong.
@@ -0,0 +1,99 @@
do
local first_mod = false
local prev_mod = false;
function __m_ena(n,i)
local ena = (i ~= nil)
if (prev_mod) then
io.write(",")
end
if (ena) then
io.write("\""..n.."\": true")
else
io.write("\""..n.."\": false")
end
prev_mod = true
end
function __cpu()
local curr_os, curr_ver, curr_build = os.version();
io.write("\"cpu\": \""..os.cpu().."\",")
io.write("\"os\": \""..curr_os.."\",")
io.write("\"version\": \""..curr_ver.."\",")
io.write("\"build\": \""..curr_build.."\",")
io.write("\"board\": \""..os.board().."\",")
end
function __mods()
io.write("\"modules\": ")
io.write("{")
__m_ena("thread",thread)
__m_ena("nvs",nvs)
__m_ena("pack",pack)
__m_ena("adc",adc)
__m_ena("i2c",i2c)
__m_ena("pio",pio)
__m_ena("pwm",pwm)
__m_ena("screen",screen)
__m_ena("spi",spi)
__m_ena("tmr",tmr)
__m_ena("uart",uart)
__m_ena("net",net)
__m_ena("lora",lora)
__m_ena("mqtt",mqtt)
__m_ena("sensor",sensor)
__m_ena("servo",servo)
io.write("},")
end
function __sensors()
io.write("\"sensors\": ")
io.write("[")
for sk,sv in pairs(sensor.list(true)) do
io.write("{")
for k,v in pairs(sv) do
if (k == "properties") then
io.write("\"properties\":[")
for ask,asv in pairs(v) do
io.write("{");
for tsk,tsv in pairs(asv) do
io.write("\""..tsk.."\":\""..tsv.."\",")
end
io.write("},");
end
io.write("],")
elseif (k == "provides") then
io.write("\"provides\":[")
for apk,apv in pairs(v) do
io.write("{");
for tpk,tpv in pairs(apv) do
io.write("\""..tpk.."\":\""..tpv.."\",")
end
io.write("},");
end
io.write("],")
else
io.write("\""..k.."\":\""..v.."\",")
end
end
io.write("},")
end
io.write("],")
end
io.write("{");
__mods()
__cpu()
__sensors()
io.write("}")
__m_ena = nil
__mods = nil
__cpu = nil
__sensors = nil
print("")
end
@@ -0,0 +1,25 @@
require("block")
wcBlock.adc = {}
function wcBlock.adc.get(id, channel)
local raw = nil
local mvolts = nil
try(
function()
local instance = "_adc"..channel
if (_G[instance] == nil) then
_G[instance] = adc.setup(adc.ADC1, channel, 12)
end
raw, mvolts = _G[instance]:read()
end,
function(where, line, err, message)
wcBlock.blockError(id, err, message)
end
)
return raw, mvolts
end
@@ -0,0 +1,39 @@
require("block")
wcBlock.event = {}
function wcBlock.event.whenBoardStarts(id, func)
thread.start(function()
wcBlock.blockStart(id)
func()
wcBlock.blockEnd(id)
end)
end
function wcBlock.event.whenIReceive(id, eid, func)
local instance = "_"..eid
if (_G[instance] == nil) then
_G[instance] = event.create()
end
_G[instance]:addlistener(function()
thread.start(function()
wcBlock.blockStart(id)
func()
wcBlock.blockEnd(id)
end)
end)
end
function wcBlock.event.broadcast(id, eid, wait)
local instance = "_"..eid
_G[instance]:broadcast(wait)
end
function wcBlock.event.whenIReceiveLoraFrame(id, func)
lora.whenReceived(function(port, payload)
func(port, payload)
end)
end
@@ -0,0 +1,33 @@
require("block")
wcBlock.gpio = {}
function wcBlock.gpio.set(id, gpio, value)
try(
function()
pio.pin.setdir(pio.OUTPUT, gpio)
pio.pin.setpull(pio.NOPULL, gpio)
pio.pin.setval(value, gpio)
end,
function(where, line, err, message)
wcBlock.blockError(id, err, message)
end
)
end
function wcBlock.gpio.get(id, gpio)
local ret
try(
function()
pio.pin.setdir(pio.INPUT, gpio)
pio.pin.setpull(pio.PULLUP, gpio)
ret = pio.pin.getval(gpio)
end,
function(where, line, err, message)
wcBlock.blockError(id, err, message)
end
)
return ret
end
@@ -0,0 +1,9 @@
require("block")
wcBlock.led = {}
function wcBlock.led.set(id, gpio, value)
pio.pin.setdir(pio.OUTPUT, gpio)
pio.pin.setpull(pio.NOPULL, gpio)
pio.pin.setval(value, gpio)
end
Oops, something went wrong.

0 comments on commit 6d150d5

Please sign in to comment.