Merge pull request #6 from jwetzell/feat/blackout-freeze-modes

add normal, black, and freeze display modes
This commit is contained in:
2024-10-25 08:33:44 -05:00
committed by GitHub
+107 -9
View File
@@ -272,7 +272,29 @@ function GetControls(props)
IndicatorType = "Status",
PinStyle = "Output",
UserPin = true
}
},
{
Name = "Normal",
ControlType = "Button",
ButtonType = "Trigger",
PinStyle = "Input",
UserPin = true
},
{
Name = "Freeze",
ControlType = "Button",
ButtonType = "Trigger",
PinStyle = "Input",
UserPin = true
},
{
Name = "Black",
ControlType = "Button",
ButtonType = "Trigger",
PinStyle = "Input",
UserPin = true
},
}
return controls
end
@@ -381,6 +403,10 @@ function GetControlLayout(props)
yStart = presetPosition[2] + 20,
Padding = 3
}
local ModeButton = {
yStart = 2,
Padding = 2
}
SourceButton.Size = {
(rackSize[2] - 30 - (SourceButton.Padding * 2))/2,
@@ -397,9 +423,15 @@ function GetControlLayout(props)
(rackSize[2] - 30 - (PresetButton.Padding * 2))/3
}
ModeButton.Size = {
(rackSize[2]/3)- (ModeButton.Padding*2),
(rackSize[2]/3)- (ModeButton.Padding*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)
ModeButton.xStart = ModeButton.Padding * 6
local TestLabels = {
"Red","Green","Blue","White","Horiz","Vert","Diag","Gray","Aging"
@@ -804,6 +836,39 @@ function GetControlLayout(props)
Size = PresetButton.Size
}
controls['Normal'] = {
Style = "Button",
ButtonType = "Trigger",
Legend = "Normal" ,
UnlinkOffColor = true,
OffColor = Colors.White,
Color = Colors.Red,
Position = {ModeButton.xStart, ModeButton.yStart},
Size = ModeButton.Size
}
controls['Freeze'] = {
Style = "Button",
ButtonType = "Trigger",
Legend = "Freeze" ,
UnlinkOffColor = true,
OffColor = Colors.White,
Color = Colors.Red,
Position = {ModeButton.xStart, ModeButton.yStart + ((ModeButton.Size[1]+ModeButton.Padding+ModeButton.Padding)*1) },
Size = ModeButton.Size
}
controls['Black'] = {
Style = "Button",
ButtonType = "Trigger",
Legend = "Black" ,
UnlinkOffColor = true,
OffColor = Colors.White,
Color = Colors.Red,
Position = {ModeButton.xStart, ModeButton.yStart + ((ModeButton.Size[1]+ModeButton.Padding+ModeButton.Padding)*2) },
Size = ModeButton.Size
}
controls['Status'] = {
Style = "Text",
Color = Colors.LCD,
@@ -946,8 +1011,33 @@ if (Controls) then
{0x00,0xea,0xfe,0x00,0x01,0x03,0xff,0xff,0x01,0x00,0x01,0x01,0x00,0x02,0x01,0x00,0x0A},
}
},
DisplayNormal = { 0x00,0x00,0xFE,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x50,0x00,0x20,0x02,0x01,0x00,0x00 },
DisplayNormalAlt = { 0x00,0x38,0xFE,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x04,0x00,0x00,0x13,0x01,0x00,0x03 },
DisplayNormal = {
VX4S = {0x00,0x00,0xFE,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x50,0x00,0x20,0x02,0x01,0x00,0x00},
VX4S_N = {0x00,0x00,0xFE,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x50,0x00,0x20,0x02,0x01,0x00,0x00},
VX6S = {0x00,0x38,0xFE,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x04,0x00,0x00,0x13,0x01,0x00,0x03},
VX1000 = {0x00,0x00,0xFE,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x04,0x00,0x00,0x13,0x02,0x00,0x03,0x00},
PROHD = {0x00,0x00,0xFE,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x50,0x00,0x20,0x02,0x01,0x00,0x00},
PROUHDJR = {0x00,0x00,0xFE,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x04,0x00,0x00,0x13,0x02,0x00,0x03,0x00},
MCTRL4K = {0x00,0x00,0xFE,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x50,0x00,0x20,0x02,0x01,0x00,0x00},
},
DisplayFreeze = {
VX4S = {0x00,0x00,0xFE,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x50,0x00,0x20,0x02,0x01,0x00,0x01},
VX4S_N = {0x00,0x00,0xFE,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x50,0x00,0x20,0x02,0x01,0x00,0x01},
VX6S = {0x00,0x35,0xFE,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x04,0x00,0x00,0x13,0x01,0x00,0x03},
VX1000 = {0x00,0x00,0xFE,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x04,0x00,0x00,0x13,0x02,0x00,0x04,0x00},
PROHD = {0x00,0x00,0xFE,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x50,0x00,0x20,0x02,0x01,0x00,0x01},
PROUHDJR = {0x00,0x00,0xFE,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x04,0x00,0x00,0x13,0x02,0x00,0x04,0x00},
MCTRL4K = {0x00,0x00,0xFE,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x50,0x00,0x20,0x02,0x01,0x00,0x01},
},
DisplayBlack = {
VX4S = {0x00,0x00,0xFE,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x50,0x00,0x20,0x02,0x01,0x00,0x02},
VX4S_N = {0x00,0x00,0xFE,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x50,0x00,0x20,0x02,0x01,0x00,0x02},
VX6S = {0x00,0x37,0xFE,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x04,0x00,0x00,0x13,0x01,0x00,0x03},
VX1000 = {0x00,0x00,0xFE,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x04,0x00,0x00,0x13,0x02,0x00,0x05,0x00},
PROHD = {0x00,0x00,0xFE,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x50,0x00,0x20,0x02,0x01,0x00,0x02},
PROUHDJR = {0x00,0x00,0xFE,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x04,0x00,0x00,0x13,0x02,0x00,0x05,0x00},
MCTRL4K = {0x00,0x00,0xFE,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x50,0x00,0x20,0x02,0x01,0x00,0x02},
},
Inputs = {
VX4S = {
{0x00,0x00,0xFE,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x2D,0x00,0x20,0x02,0x01,0x00,0x10}, --DVI
@@ -1080,6 +1170,7 @@ if (Controls) then
end
function sendCommand(cmd)
if cmd ~= nil then
if NovaStar.socket.IsConnected then
print("Sending packet to connected NovaStar")
else
@@ -1089,6 +1180,7 @@ if (Controls) then
if NovaStar.socket.IsConnected then
NovaStar.socket:Write(getCmdString(NovaStar.Commands.Preamble) .. getCmdString(cmd) .. getCmdString(computeChecksum(cmd)))
end
end;
end
function sendBrightness(value)
@@ -1178,11 +1270,6 @@ if (Controls) then
if (v ~= nil and #v > 1) then
print("value is not nill and length greater than 1")
Controls['IN'..k].EventHandler = function()
if(Properties['Model'].Value ~= 'VX6S') then
sendCommand(NovaStar.Commands.DisplayNormal)
else
sendCommand(NovaStar.Commands.DisplayNormalAlt)
end;
sendCommand(v)
end
else
@@ -1202,8 +1289,19 @@ if (Controls) then
end
end
Controls['Normal'].EventHandler = function()
sendCommand(NovaStar.Commands.DisplayNormal[Properties['Model'].Value])
end;
Controls['Freeze'].EventHandler = function()
sendCommand(NovaStar.Commands.DisplayFreeze[Properties['Model'].Value])
end;
Controls['Black'].EventHandler = function()
sendCommand(NovaStar.Commands.DisplayBlack[Properties['Model'].Value])
end;
presetTable = NovaStar.Commands.Presets[Properties['Model'].Value]
print(presetTable)
if presetTable ~= nil then
for k,v in pairs(presetTable) do
print('PRESET'..k)