function set_screen_draw(info_text) digiline_send("touchscreen", { {command = "clear"}, {command = "set", width = 3, height = 2}, {command = "addtextarea", X = 0.3, Y = 0.1,W = 10, H = 2,name = "terminal", label ="Монитор данных", default = info_text}, {command = "addbutton", X = 0.2,Y = 1.3,W = 3,H = 2,name = "btn_cirhe",label = "Часовня"}, {command = "addbutton", X = 0.2,Y = 2,W = 3,H = 2,name = "btn_home",label = "Дом"}, {command = "addbutton_exit", X = 0.2,Y = 4,W = 3,H = 2,name = "btn_jump",label = "ПРЫЖОК"} }) end if event.type == "digiline"and event.channel == "jumpdrive" then if event.msg.powerstorage ~= nil then init_data = "Энергия: " .. tostring(event.msg.powerstorage) .. "\nТекущая позиция: Х=" .. event.msg.position.x .. ", У=" .. event.msg.position.y .. ", Z=" .. event.msg.position.z .. "\nЦель: Х=" .. event.msg.target.x .. ", У=" .. event.msg.target.y .. ", Z=" .. event.msg.target.z .. "\nРадиус поля захвата: " .. tostring(event.msg.radius) .. "\nДистанция прыжка в метрах: " .. tostring(event.msg.distance) .. "\nЭнергии требуется: " .. tostring(event.msg.power_req) elseif event.msg.success ~= nil then init_data = "Результат: " .. tostring(event.msg.success) .. "\nВремя в микросекундах: " .. tostring(event.msg.time) end set_screen_draw(init_data) end if event.type == "program" then --Рисуем кнопки 1 при программировании контроллера set_screen_draw("Старт///") elseif event.msg.btn_cirhe then digiline_send("jumpdrive", { command = "set", x = 320, y = 42, z = 200, r = 1, formupdate = true }) digiline_send("jumpdrive", {command = "get"}) elseif event.msg.btn_home then digiline_send("jumpdrive", { command = "set", x = -769, y = 65, z = 955, r = 1, formupdate = true }) digiline_send("jumpdrive", {command = "get"}) --set_screen_draw(event.msg.clicker) elseif event.msg.btn_jump then digiline_send("jumpdrive", {command = "jump"}) end
https://github.com/mt-mods/jumpdrive/blob/master/doc/digiline.md