Import XML files to control the tool
Closed this issue · 1 comments
windows2000bug commented
Need to add the ability to add XML files so the name of the XML file aligns with the process name and the XML is parsed and executed with the Powershell script to set the colors.
windows2000bug commented
Notes on todo list:
$checkZones = "A_LED","A_LED","A_LED","A_LED","A_LED","NA","NA","D_LED_TYPE_2","D_LED_TYPE_2"
[xml]$XmlDocument = Get-Content -Path .\test.xml
$x=0
foreach ($check in $checkZones) {
if ($check -eq "A_LED") {
#Gets Color from XML and converts into HEX
[long]$long = $XmlDocument.LED_info.Area_info[$x].But_Arg[0].startColor
$hex = '{0:X}' -F $long
$rgb = $hex.substring(2)
#Gets Brightness from XML and turns into a percentage
$bright = ([int]$XmlDocument.LED_info.Area_info[$x].Bri + 1) * 10
write-host "Zone" $x " - " $rgb "Brightnes=" $bright
}
$x+=1
}