From f363a6e6ffe2338eb2b021f1999e65e05853b853 Mon Sep 17 00:00:00 2001 From: Anthony Headley <1986602+hossimo@users.noreply.github.com> Date: Sat, 23 May 2020 10:31:46 -0400 Subject: [PATCH] Drt-Utilities cleanup * printClass isn't required for plugins * printClass isn't fully baked * Ignoring default plugins again since the upgrade. --- .gitignore | 7 +- .vscode/settings.json | 3 +- .../resource/lib_plugins/Drt-Utilities.lua | 187 +----------------- 3 files changed, 11 insertions(+), 186 deletions(-) diff --git a/.gitignore b/.gitignore index d3b1027..e63e5ba 100644 --- a/.gitignore +++ b/.gitignore @@ -9,4 +9,9 @@ TestBed/ _Template/ grandMA3/shared/resource/lib_plugins/KineticSet/KineticSet.Lua grandMA3/shared/resource/lib_plugins/KineticSet/KineticSet.xml -pvt_* \ No newline at end of file +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 diff --git a/.vscode/settings.json b/.vscode/settings.json index 6da91b8..298d6f1 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -107,6 +107,7 @@ "GetDMXUniverse", "Timer", "GetTokenNameByIndex", - "GetAttributeCount" + "GetAttributeCount", + "CurrentExecPage" ] } diff --git a/grandMA3/shared/resource/lib_plugins/Drt-Utilities.lua b/grandMA3/shared/resource/lib_plugins/Drt-Utilities.lua index 26abcb1..e827700 100644 --- a/grandMA3/shared/resource/lib_plugins/Drt-Utilities.lua +++ b/grandMA3/shared/resource/lib_plugins/Drt-Utilities.lua @@ -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 @@ -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("") - 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 ""), 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