Skip to content

Commit

Permalink
Merge branch 'Fade-Master---Rearange-Arguments'
Browse files Browse the repository at this point in the history
  • Loading branch information
hossimo committed May 23, 2020
2 parents e40155d + f363a6e commit 7f4bfd5
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 186 deletions.
7 changes: 6 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,9 @@ TestBed/
_Template/
grandMA3/shared/resource/lib_plugins/KineticSet/KineticSet.Lua
grandMA3/shared/resource/lib_plugins/KineticSet/KineticSet.xml
pvt_*
pvt_*
grandMA3/shared/resource/lib_plugins/hardwaretests
grandMA3/shared/resource/lib_plugins/performance3d
grandMA3/shared/resource/lib_plugins/requirements
grandMA3/shared/resource/lib_plugins/systemtests
grandMA3/shared/resource/lib_plugins/examples
3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@
"GetDMXUniverse",
"Timer",
"GetTokenNameByIndex",
"GetAttributeCount"
"GetAttributeCount",
"CurrentExecPage"
]
}
187 changes: 3 additions & 184 deletions grandMA3/shared/resource/lib_plugins/Drt-Utilities.lua
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
--]]

Drt = {}
if Drt == nil then
Drt = {}
end

-- ****************************************************************
-- Drt.split(string, string) : table
Expand Down Expand Up @@ -321,189 +323,6 @@ function Drt.calculateRange(input)
end
end

-- ****************************************************************
-- Drt.printClass(userdata) : nil
-- ****************************************************************
function Drt.printClass(input, level)
level = math.abs(math.floor(level or 0))
assert(input ~= nil, "input must not be nil")
assert(level == nil or type(level) == "number", "level must be number or nil")

if type(input) ~= "userdata" then
if type(input) == "table" then
Echo(Drt.table2String(input))
elseif type(input) == "string" then
Echo(input)
elseif type(input) == "number" then
Echo(input)
else
Echo ("Not UserData: " .. type(input))
end
return
end

local indent = ""
if level > 0 then
for i = 1, level, 1 do
indent = indent .. " "
end
end

local class = input:GetClass()
Echo(indent .. "Class: " .. class)
Echo(indent .. "Parent: " .. (input:Parent():GetClass())) --TODO: This fails if no parent
local childCount = #input:Children()
Echo(indent .. "ChildCount: " .. childCount)
if childCount > 0 then
for i = 1, childCount, 1 do
Echo(indent .. " " .. i .. " " .. input:Children()[i]:GetClass())
end
end
local properties = {}

--Exec
if class == "Exec" then
properties = {
"Lock",
"No",
"Index",
"Name",
"Key",
"Fader",
"Encoder",
"EncoderLeft",
"EncoderRight",
"KeyCmd",
"EncoderClickCMD",
"EncoderRightCMD",
"EncoderLeftCMD",
"MAKey",
"MAFader",
"MAEncoder",
"MAEncoderLeft",
"MAEncoderRight",
"MAKeyCmd",
"MAEncoderClickCMD",
"MAEncoderRightCMD",
"MAEncoderLeftCMD",
"PrimanyAssignmentChanged",
"SecondaryAssignmentChanged",
"Width",
"Height",
"Object",
"Config",
"TotalPrimanyAssignmentChanged",
"TotalSecondaryAssignmentChanged",
}
end

--Page
if class == "Page" then
properties = {
"Lock",
"No",
"Index",
"Name",
"Scribble",
"Appearance"
}
end
-- Attribute
if class == "Attribute" then
properties = {
"Name",
"Pretty",
"MainAttribute",
"ActivationGroup",
"Feature",
"Special",
"PhysicalUnit",
"GeometryType",
"Color",
"Intensity",
"LogChannels",
"ChannelFunctions"
}
-- Patch
elseif class == "Patch" then
properties = {
"Name",
"Lock"
}
-- AttributeDefinitions
elseif class == "AttributeDefinitions" then
properties = {
"Name",
"Lock",
}
-- Feature
elseif class == "Feature" then
properties = {
"Name",
"Pretty",
"AttribCount",
"LogChannels",
}
-- ActivationGroup
elseif class == "ActivationGroup" then
properties = {
"Name",
"AttribCount"
}
elseif class == "Attributes" then
properties = {
"Name",
"AttribCount"
}
elseif class == "FeatureGroup" then
properties = {
"Name",
"Pretty",
"PresetMode",
"AttribCount",
"LogChannels",
}
elseif class == "UserProfile" then
properties = {
"Name",
"Lock",
"DMXReadout",
"NormalValue",
"ValueReadout",
"SpeedReadout",
"PresetReadout",
"WheelResolution",
"WheelMode",
"PerciseEdit",
"SingleStep",
"Sync",
"Preview",
"ScreenEncoder",
"TimeKeyTarget",
"ProgPart",
"TCSlot",
"OverlayFade",
}
else
Echo("<Class Not Configured>")
end

for key, value in pairs(properties) do
local i = input[value]
if type(i) == "boolean" then
if i == true then
i = "true"
else
i = "false"
end
end
Echo("%s%s: %s (%s)", indent, value, tostring(i or "<NIL>"), type(input[value]))
if type(i) == "userdata" then
Drt.printClass(i, level + 1)
end
end
end

function Drt.table2String(input)
if type(input) == "boolean" then
if input == true then
Expand Down

0 comments on commit 7f4bfd5

Please sign in to comment.