• Aucun résultat trouvé

Cours Lua Scripting Brian Lassiter Director of EA – Cours et formation gratuit

N/A
N/A
Protected

Academic year: 2022

Partager "Cours Lua Scripting Brian Lassiter Director of EA – Cours et formation gratuit"

Copied!
17
0
0

Texte intégral

(1)

Lua Scripting

Brian Lassiter Director of EA

(2)

What is Lua?

•  Embedded scripting language in WindMil and WindMilMap

•  Created by a University team in Brazil

•  Used by several software and gaming companies

(3)

What can Lua do?

•  Make modifications to circuit models

•  Create new element fields for custom reports and data boxes

•  Perform tasks on a schedule

(4)

Types of Lua Scripts

•  .lua – make model edits and perform

calculations on model data when script is ran

•  .elua – creates element field in the field list

•  .plum – script that can be ran automatically based on certain actions

(5)

Model Editing with Lua

•  Example scripts for model edits

–  Insert transformer fuses(Arc Flash)

–  Connect consumers to closest transformer –  Rephase elements from file

–  Rename elements

•  Calculations

–  Total length of selected lines

(6)

Element Field Creation

•  Lua scripts can create new element fields

•  Defined as .elua files and must reside in C:

\Milsoft\Programs\Scripts\eLua

•  Perform calculations on existing data

•  Upline and downline tracing/searching

(7)

Example Element Fields

•  Total kW Loss – summation of kW loss on all elements downline from selected

•  Upline Device – search upline to find device and equipment of device

•  Min Downline Voltage – Search downline and return lowest voltage downline

(8)

Running Scripts

•  Utilities, Script manager

–  Select Script –  Hit Run

•  Scripts can be tagged as favorite and run from Utilities, Execute Script

(9)

Script Manager

(10)

Script Manager Features

•  Create new scripts

•  Run selected scripts

•  Create scripts from templates

•  Add eLua fields to Selected Elements tab

(11)

eLua Templates

•  Allows user to easily create a new element field based on pre-defined template

•  Milsoft provides templates

(12)

Assigning to Toolbar

•  Frequently used script can be a toolbar button

•  Right click on custom toolbar, assign Lua script

–  SumLength.lua

(13)

Plum Scripts

•  Can perform task based on WindMil action

–  Rename elements immediately after added to model

–  OnGetGridName

–  OnAfterAddElement

(14)

Creating a Right Click Menu Option

•  Right click menu can now have scripts added as options

•  Use plum Lua scripts and specific header option

–  PopupMenuItem

(15)

Future Plans for Lua

•  Replace Updatable Utilities with scripts

•  Replace Global Editor Editing Utilities with scripts

•  Enable scripting capabilities in other parts of WindMil (possibly Analysis)

•  Provide more templates for easier script creation

(16)

Lua Resources

•  Several web sites for reference

–  http://www.lua.org/

–  http://en.wikipedia.org/wiki/

Lua_(programming_language)

•  Milsoft Tutorial in Progress

(17)

Questions/Comments

Références

Documents relatifs

The Windows directory or dir command can list files from all directories on the machine, but even with its plethora of switches, you can't produce a nice listing like that

En mettant plusieurs définitions de fonction dans un même fichier, et en utilisant la commande ln pour donner plusieurs noms à ce fichier, vous pouvez faire l’autoload une

The script file consists only in a Lua function that call the set methods defined inside monster Java class, setting the values for that specific monster race. To create a new

ʐ Let's just mud with nginx.conf, the Nginx

Diego received a BEng in Computer Engineering and an MSc in Programming Lan- guages from PUC-Rio, under the supervision of Roberto Ierusalimschy.. He later received an MSc and a PhD

Then the global editing tab can be used to assign an overcurrent device definition to the set, such as from a transformer fusing schedule used at the utility.. Continue with the

[The engine] doesn't know anything about adventure games, or talking, or puzzles, or anything else that makes Grim Fandango the game it is.. It just knows how to render a set

Nous passerons donc en paramètres au script le nom du champ dans la base de données, son type, sa valeur et bien sûr l'id de l'enregistrement dont il faut modifier le champ....