We can power off things that have a screen and the screen turns off too.

This commit is contained in:
Tim Young 2018-02-14 17:25:18 +00:00
parent 98f3d1298d
commit 64dce3d907

View File

@ -663,6 +663,11 @@ namespace EduNetworkBuilder
/*This overload copies data of /size/ into /data/ from location specified (/Scan0/)*/ /*This overload copies data of /size/ into /data/ from location specified (/Scan0/)*/
System.Runtime.InteropServices.Marshal.Copy(bData.Scan0, data, 0, size); System.Runtime.InteropServices.Marshal.Copy(bData.Scan0, data, 0, size);
List<NetworkComponentType> HasScreens = new List<NetworkComponentType>() {
NetworkComponentType.cellphone,NetworkComponentType.ip_phone, NetworkComponentType.laptop,
NetworkComponentType.microwave, NetworkComponentType.pc, NetworkComponentType.tablet,
};
for (int i = 0; i < size; i += bitsPerPixel / 8) for (int i = 0; i < size; i += bitsPerPixel / 8)
{ {
//double magnitude = 1 / 3d * (data[i] + data[i + 1] + data[i + 2]); //double magnitude = 1 / 3d * (data[i] + data[i + 1] + data[i + 2]);
@ -677,6 +682,17 @@ namespace EduNetworkBuilder
//Check to see if it is green. If so, we make it mostly not-green. //Check to see if it is green. If so, we make it mostly not-green.
if (rcol == 70 && gcol == 217 && bcol == 31) if (rcol == 70 && gcol == 217 && bcol == 31)
data[i + 1] = 0; //set green to none data[i + 1] = 0; //set green to none
if(HasScreens.Contains(myType))
{
//5c7df9 - blue color
//46d91f - green color
if (rcol == 92 && gcol == 125 && bcol == 249)
{
data[i] = 0; //set blue to none on items that have screens
data[i+1] = 0; //set green to none on items that have screens
data[i+2] = 0; //set red to none on items that have screens
}
}
} }
//data[i] is the first of 3 bytes of color //data[i] is the first of 3 bytes of color
if (MorphColor != Color.Empty) if (MorphColor != Color.Empty)