Rudimentary presets for a few models

This commit is contained in:
2022-08-30 16:47:50 -05:00
parent 0c3975b362
commit 55e160ee83
+256 -4
View File
@@ -175,6 +175,57 @@ function GetControls(props)
ButtonType = "Trigger"
},
{
Name = "PRESET1",
ControlType = "Button",
ButtonType = "Trigger"
},
{
Name = "PRESET2",
ControlType = "Button",
ButtonType = "Trigger"
},
{
Name = "PRESET3",
ControlType = "Button",
ButtonType = "Trigger"
},
{
Name = "PRESET4",
ControlType = "Button",
ButtonType = "Trigger"
},
{
Name = "PRESET5",
ControlType = "Button",
ButtonType = "Trigger"
},
{
Name = "PRESET6",
ControlType = "Button",
ButtonType = "Trigger"
},
{
Name = "PRESET7",
ControlType = "Button",
ButtonType = "Trigger"
},
{
Name = "PRESET8",
ControlType = "Button",
ButtonType = "Trigger"
},
{
Name = "PRESET9",
ControlType = "Button",
ButtonType = "Trigger"
},
{
Name = "PRESET10",
ControlType = "Button",
ButtonType = "Trigger"
},
{
Name = "Status",
ControlType = "Indicator",
@@ -200,8 +251,9 @@ function GetControlLayout(props)
local rackSize = {1000, 120}
local inputPosition = {rackSize[1]*3/8,5}
local testPosition = {rackSize[1]*11/16,5}
local inputPosition = {rackSize[1] * 5/16 + 10,5}
local testPosition = {rackSize[1] * 9/16 + 15,5}
local presetPosition = {rackSize[1] * 13/16 + 20,5}
local graphics = {
@@ -241,6 +293,19 @@ function GetControlLayout(props)
Size = {250, rackSize[2] - 10},
Position = testPosition
},
-- Preset box
{
Type = "GroupBox",
Text = "PRESET",
Color = Colors.White,
HTextAlign = "CENTER",
CornerRadius = 3,
Fill = Colors.Black,
StrokeColor = Colors.White,
StrokeWidth = 1,
Size = {160, rackSize[2] - 10},
Position = presetPosition
},
-- NovaStar Text
{
Type = "Label",
@@ -272,11 +337,29 @@ function GetControlLayout(props)
yStart = testPosition[2] + 20,
Padding = 5
}
local PresetButton = {
yStart = presetPosition[2] + 20,
Padding = 3
}
SourceButton.Size = {
(rackSize[2] - 30 - (SourceButton.Padding * 2))/2,
(rackSize[2] - 30 - (SourceButton.Padding * 2))/2
}
TestButton.Size = {
(rackSize[2] - 30 - (TestButton.Padding * 2))/2,
(rackSize[2] - 30 - (TestButton.Padding * 2))/2
}
PresetButton.Size = {
(rackSize[2] - 30 - (PresetButton.Padding * 2))/3,
(rackSize[2] - 30 - (PresetButton.Padding * 2))/3
}
SourceButton.Size = {(rackSize[2] - 30 - (SourceButton.Padding * 2))/2, (rackSize[2] - 30 - (SourceButton.Padding * 2))/2}
TestButton.Size = {(rackSize[2] - 30 - (TestButton.Padding * 2))/2, (rackSize[2] - 30 - (TestButton.Padding * 2))/2}
SourceButton.xStart = inputPosition[1] + ((250 - (((SourceButton.Size[1] * 5) + (SourceButton.Padding * 4))))/2)
TestButton.xStart = testPosition[1] + ((250 - (((TestButton.Size[1] * 5) + (TestButton.Padding * 4))))/2)
PresetButton.xStart = presetPosition[1] + ((160 - (((PresetButton.Size[1] * 5) + (PresetButton.Padding * 4))))/2)
local TestLabels = {
"Red","Green","Blue","White","Horiz","Vert","Diag","Gray","Aging"
@@ -450,9 +533,66 @@ function GetControlLayout(props)
Size = TestButton.Size
}
--First row of preset buttons
controls['PRESET1'] = {
Style = "Button",
ButtonType = "Trigger",
Legend = "1" ,
UnlinkOffColor = true,
OffColor = Colors.White,
Color = Colors.Red,
Position = {PresetButton.xStart, PresetButton.yStart},
Size = PresetButton.Size
}
controls['PRESET2'] = {
Style = "Button",
ButtonType = "Trigger",
Legend = "2" ,
UnlinkOffColor = true,
OffColor = Colors.White,
Color = Colors.Red,
Position = {PresetButton.xStart + ((PresetButton.Size[1]+PresetButton.Padding)*1), PresetButton.yStart},
Size = PresetButton.Size
}
controls['PRESET3'] = {
Style = "Button",
ButtonType = "Trigger",
Legend = "3" ,
UnlinkOffColor = true,
OffColor = Colors.White,
Color = Colors.Red,
Position = {PresetButton.xStart + ((PresetButton.Size[1]+PresetButton.Padding)*2), PresetButton.yStart},
Size = PresetButton.Size
}
controls['PRESET4'] = {
Style = "Button",
ButtonType = "Trigger",
Legend = "4" ,
UnlinkOffColor = true,
OffColor = Colors.White,
Color = Colors.Red,
Position = {PresetButton.xStart + ((PresetButton.Size[1]+PresetButton.Padding)*3), PresetButton.yStart},
Size = PresetButton.Size
}
controls['PRESET5'] = {
Style = "Button",
ButtonType = "Trigger",
Legend = "5" ,
UnlinkOffColor = true,
OffColor = Colors.White,
Color = Colors.Red,
Position = {PresetButton.xStart + ((PresetButton.Size[1]+PresetButton.Padding)*4), PresetButton.yStart},
Size = PresetButton.Size
}
--bump down second row of buttons
SourceButton.yStart = SourceButton.yStart + SourceButton.Size[1] + (SourceButton.Padding/2)
TestButton.yStart = TestButton.yStart + TestButton.Size[1] + (TestButton.Padding/2)
PresetButton.yStart = PresetButton.yStart + PresetButton.Size[1] + (PresetButton.Padding/2)
--Second row of input buttons
controls['IN6'] = {
@@ -558,6 +698,62 @@ function GetControlLayout(props)
Size = TestButton.Size
}
--Second row of preset buttons
controls['PRESET6'] = {
Style = "Button",
ButtonType = "Trigger",
Legend = "6" ,
UnlinkOffColor = true,
OffColor = Colors.White,
Color = Colors.Red,
Position = {PresetButton.xStart, PresetButton.yStart},
Size = PresetButton.Size
}
controls['PRESET7'] = {
Style = "Button",
ButtonType = "Trigger",
Legend = "7" ,
UnlinkOffColor = true,
OffColor = Colors.White,
Color = Colors.Red,
Position = {PresetButton.xStart + ((PresetButton.Size[1]+PresetButton.Padding)*1), PresetButton.yStart},
Size = PresetButton.Size
}
controls['PRESET8'] = {
Style = "Button",
ButtonType = "Trigger",
Legend = "8" ,
UnlinkOffColor = true,
OffColor = Colors.White,
Color = Colors.Red,
Position = {PresetButton.xStart + ((PresetButton.Size[1]+PresetButton.Padding)*2), PresetButton.yStart},
Size = PresetButton.Size
}
controls['PRESET9'] = {
Style = "Button",
ButtonType = "Trigger",
Legend = "9" ,
UnlinkOffColor = true,
OffColor = Colors.White,
Color = Colors.Red,
Position = {PresetButton.xStart + ((PresetButton.Size[1]+PresetButton.Padding)*3), PresetButton.yStart},
Size = PresetButton.Size
}
controls['PRESET10'] = {
Style = "Button",
ButtonType = "Trigger",
Legend = "10" ,
UnlinkOffColor = true,
OffColor = Colors.White,
Color = Colors.Red,
Position = {PresetButton.xStart + ((PresetButton.Size[1]+PresetButton.Padding)*4), PresetButton.yStart},
Size = PresetButton.Size
}
controls['Status'] = {
Style = "Text",
Color = Colors.LCD,
@@ -592,6 +788,46 @@ if (Controls) then
Preamble = {0x55, 0xAA},
Connect = {0x00,0x00,0xFE,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x02,0x00},
Brightness = {0x00,0x00,0xFE,0xFF,0x01,0xFF,0xFF,0xFF,0x01,0x00,0x01,0x00,0x00,0x02,0x01,0x00},
Presets = {
VX4S = {
{0x00,0x2e,0xfe,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x70,0x00,0x20,0x02,0x01,0x00,0x00,0x15,0x57},
{0x00,0x2e,0xfe,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x70,0x00,0x20,0x02,0x01,0x00,0x01,0x16,0x57},
{0x00,0x2e,0xfe,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x70,0x00,0x20,0x02,0x01,0x00,0x02,0x17,0x57},
{0x00,0x2e,0xfe,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x70,0x00,0x20,0x02,0x01,0x00,0x03,0x18,0x57},
{0x00,0x2e,0xfe,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x70,0x00,0x20,0x02,0x01,0x00,0x04,0x19,0x57},
{0x00,0x95,0xfe,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x70,0x00,0x20,0x02,0x01,0x00,0x05,0x81,0x57},
{0x00,0x95,0xfe,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x70,0x00,0x20,0x02,0x01,0x00,0x06,0x82,0x57},
{0x00,0x95,0xfe,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x70,0x00,0x20,0x02,0x01,0x00,0x07,0x83,0x57},
{0x00,0x95,0xfe,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x70,0x00,0x20,0x02,0x01,0x00,0x08,0x84,0x57},
{0x00,0x95,0xfe,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x70,0x00,0x20,0x02,0x01,0x00,0x09,0x85,0x57},
},
VX6S = {
{0x00,0x00,0xFE,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x01,0x51,0x13,0x01,0x00,0x00,0x05,0x16},
{0x00,0x00,0xFE,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x01,0x51,0x13,0x01,0x00,0x01,0x06,0x16},
{0x00,0x00,0xFE,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x01,0x51,0x13,0x01,0x00,0x02,0x07,0x56},
{0x00,0x00,0xFE,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x01,0x51,0x13,0x01,0x00,0x03,0x08,0x16},
{0x00,0x00,0xFE,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x01,0x51,0x13,0x01,0x00,0x04,0x09,0x16},
{0x00,0x00,0xFE,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x01,0x51,0x13,0x01,0x00,0x05,0x0A,0x16},
{0x00,0x00,0xFE,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x01,0x51,0x13,0x01,0x00,0x06,0x0B,0x56},
{0x00,0x00,0xFE,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x01,0x51,0x13,0x01,0x00,0x07,0x0C,0x56},
{0x00,0x00,0xFE,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x01,0x51,0x13,0x01,0x00,0x08,0x0D,0x56},
{0x00,0x00,0xFE,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x01,0x51,0x13,0x01,0x00,0x09,0x0E,0x56},
},
PROUHDJR = {
{0x00,0x00,0xFE,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x01,0x51,0x13,0x01,0x00,0x00,0x05,0x16},
{0x00,0x00,0xFE,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x01,0x51,0x13,0x01,0x00,0x01,0x06,0x16},
{0x00,0x00,0xFE,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x01,0x51,0x13,0x01,0x00,0x02,0x07,0x56},
{0x00,0x00,0xFE,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x01,0x51,0x13,0x01,0x00,0x03,0x08,0x16},
{0x00,0x00,0xFE,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x01,0x51,0x13,0x01,0x00,0x04,0x09,0x16},
{0x00,0x00,0xFE,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x01,0x51,0x13,0x01,0x00,0x05,0x0A,0x16},
{0x00,0x00,0xFE,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x01,0x51,0x13,0x01,0x00,0x06,0x0B,0x56},
{0x00,0x00,0xFE,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x01,0x51,0x13,0x01,0x00,0x07,0x0C,0x56},
{0x00,0x00,0xFE,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x01,0x51,0x13,0x01,0x00,0x08,0x0D,0x56},
{0x00,0x00,0xFE,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x01,0x51,0x13,0x01,0x00,0x09,0x0E,0x56},
}
},
TestPatterns = {
RED = {
{0x00,0xe7,0xfe,0x00,0x01,0x00,0xff,0xff,0x01,0x00,0x01,0x01,0x00,0x02,0x01,0x00,0x02},
@@ -759,6 +995,10 @@ if (Controls) then
return cmd
end
function sendPreset(preset)
sendCommand(preset)
end
function sendTestPattern(pattern)
for k,v in pairs(pattern) do
sendCommand(v)
@@ -887,6 +1127,18 @@ if (Controls) then
sendTestPattern(v)
end
end
presetTable = NovaStar.Commands.Presets[Properties['Model'].Value]
print(presetTable)
if presetTable ~= nil then
for k,v in pairs(presetTable) do
print('PRESET'..k)
Controls['PRESET'..k].EventHandler = function()
sendPreset(v)
end
end
end
end