説明
AddFixture 関数は、パッチにフィクスチャを追加します。引数はテーブルで、関数が成功するには有効なデータが含まれている必要があります。追加が成功した場合、boolean 値の true を返します。この関数は、正しいパッチ・ディスティネーションでコマンドラインとともに実行する必要があります。
引数
- table:
テーブルには有効なデータが含まれている必要があります。以下は、テーブルに含めることができる要素の一覧です。すべてを追加する必要はありません。
- mode:
This must be a handle to a valid "dmx_mode".
This defines a specific fixture type in a specific mode.
- amount:
追加するフィクスチャ数(integer)を指定ます。
- name (オプション):
(最初の)フィクスチャ名を含む文字列(string)です。
- fid (オプション):
フィクスチャのFIDを表す文字列(string)です。
- cid (オプション):
フィクスチャのCIDを表す文字列(string)です。これは、idtype が Fixture 以外の場合にのみ有効です。
- idtype (オプション):
IDタイプの名前を表す文字列(string)です。タイプが Fixture 以外の場合にのみ必要です。
- patch (オプション):
This is a table with up to eight strings.
The string must indicate a universe and a start address in the universe.
The two must be separated by a dot.
Each table element is used for the up to eight DMX breaks in the patch.
- layer (オプション):
レイヤ名を含む文字列(string)です。
- class (オプション):
クラス名を含む文字列(string)です。
- parent (オプション):
This is a handle of the parent fixture.
It is only needed if the fixture should be a sub-fixture of an existing fixture.
- insert_index (オプション):
挿入インデックス番号(integer)です。
- undo (オプション):
This is a string with an undo text.
戻り値
- boolean または nil:
The returned table contains key value pairs with configuration information. See the example below.
例
This example adds a dimmer fixture with FID and CID 301 and patch address "10.001". It is a requirement that the generic dimmer type is already added to the show and that the ID and patch address are available. The example does not perform any check for availability.
|
return function() Cmd("ChangeDestination Root") Cmd('ChangeDestination 13') Cmd("ChangeDestination 9") Cmd("ChangeDestination 6") Cmd("ChangeDestination 1") Cmd("ChangeDestination 2") local myAddFixtureTable = {} myAddFixtureTable.mode = Patch().FixtureTypes.Dimmer.DMXModes["Mode 0"] myAddFixtureTable.amount = 1 myAddFixtureTable.fid = "301" myAddFixtureTable.idtype = "Channel" myAddFixtureTable.cid = "301" myAddFixtureTable.name = "Dimmer 301" myAddFixtureTable.patch = {"10.001"}
local success = AddFixtures(myAddFixtureTable) if success ~= nil then Printf("Fixture " .. myAddFixtureTable.fid .. " is added with patch address " .. myAddFixtureTable.patch[1]) else Printf("AddFixture failed!") end Cmd("ChangeDestination Root") end |