WinTarif
Lua
Menu

Приветствую Вас, Гость · RSS 26.09.2017, 17:15

FDB Tool


Program designed for Motorola Astro series radio to load, edit and upload Feature Descriptor Block (FDB, see Astro Legasy FDB).

Download: FdbTool.zip



Lua to Windows Framework

LuaWinFW is set of classes to access Delphi objects from Lua scripts. Extended to allow usage of Delphi controls and RTTI.

Accessible classes:

  • Standard palette: TLabel, TEdit, TMemo, TButton, TCheckBox, TRadioButton, TListBox, TComboBox, TGroupBox, TRadioGroup, TPanel;
  • Additional palette: TBitBtn, TSpeedButton, TStringGrid, TControlBar, TScrollBox;
  • Win32 palette: TTabControl, TPageControl, TTabSheet, TRichEdit, TProgressBar, TTreeView, TListView, TStatusBar, TToolBar, TCoolBar, TToolButton;
To create from Lua script "mysomething = TClassname(Name, Parent name)"

Common API:
  • print(comma separated values)
  • sleep(milliseconds)
  • ProcessMessages
Class API:
  • function GetProp(property name: string): returns property value
  • function SetProp(property name: string; property value): sets property
  • function Invoke(method name: string; params separated by comma): executes method, returns result
  • function EnumProperties([class name: string]): return array of strings
  • function EnumMethods([class name: string]): return array of strings
  • function EnumFields([class name: string]): return array of strings
  • function SetEvent(event name: string; lua function)
Built in
  • Asynchronous Serial port as class TComPort
    • to create from Lua script set events and "myport = TComPort()"
    • Open(const PortName: string; BaudRate, Bits, StopBits, ParityIndex: integer): boolean
    • Close
    • Purge
    • SetDtrState(state: boolean)
    • SetRtsState(state: boolean)
    • GetCtsState: boolean
    • SetTimeouts(baud: dword): boolean
    • Write(buf: array): boolean
    • Read: array
    • events: OnRead, OnWrite, OnCts
  • TimerQueue based timers as class TQueuedTimer (see CreateTimerQueueTimer)
    • to create from Lua script "mytimerobj = TQueuedTimer(DueTime, Period, Flags)"
    • StartTimer
    • StopTimer
    • GetEnabled
    • events: OnTimer

Notes:
  • program starts "script.lua" by default
  • requires lua52.dll
  • not all property's access available, mostly integer, string, enums and sets
  • function "print" requires MemoLog object of type TMemo

Download: LuaWinFW.zip
Zip contains simple script as example. More complicated example can be found in FDB Tool above



© 2017 Vladimir Klimov WinTarif@narod.ru
Конструктор сайтов - uCoz