in sensors/Tools/SensorExplorer/Sensor.cs [207:363]
public static async Task<string[]> GetPLDInformation(string deviceInstanceId, DeviceInformationKind kind = DeviceInformationKind.Device)
{
string[] pld = new string[15];
bool isPldInformationPresent = false;
try
{
DeviceInformation pldPanelId = await DeviceInformation.CreateFromIdAsync(deviceInstanceId, new string[] { Constants.PLD["Device_PanelId"] }, kind);
if(pldPanelId.Properties[Constants.PLD["Device_PanelId"]] != null)
{
pld[0] = pldPanelId.Properties[Constants.PLD["Device_PanelId"]].ToString();
isPldInformationPresent = true;
}
}
catch { }
try
{
DeviceInformation pldPanelGroup = await DeviceInformation.CreateFromIdAsync(deviceInstanceId, new string[] { Constants.PLD["Device_PanelGroup"] }, kind);
if(pldPanelGroup.Properties[Constants.PLD["Device_PanelGroup"]] != null)
{
pld[1] = pldPanelGroup.Properties[Constants.PLD["Device_PanelGroup"]].ToString();
isPldInformationPresent = true;
}
}
catch { }
try
{
DeviceInformation pldPanelSide = await DeviceInformation.CreateFromIdAsync(deviceInstanceId, new string[] { Constants.PLD["Device_PanelSide"] }, kind);
if (pldPanelSide.Properties[Constants.PLD["Device_PanelSide"]] != null)
{
pld[2] = pldPanelSide.Properties[Constants.PLD["Device_PanelSide"]].ToString();
isPldInformationPresent = true;
}
}
catch { }
try
{
DeviceInformation pldPanelWidth = await DeviceInformation.CreateFromIdAsync(deviceInstanceId, new string[] { Constants.PLD["Device_PanelWidth"] }, kind);
if (pldPanelWidth.Properties[Constants.PLD["Device_PanelWidth"]] != null)
{
pld[3] = pldPanelWidth.Properties[Constants.PLD["Device_PanelWidth"]].ToString();
isPldInformationPresent = true;
}
}
catch { }
try
{
DeviceInformation pldPanelHeight = await DeviceInformation.CreateFromIdAsync(deviceInstanceId, new string[] { Constants.PLD["Device_PanelHeight"] }, kind);
if (pldPanelHeight.Properties[Constants.PLD["Device_PanelHeight"]] != null)
{
pld[4] = pldPanelHeight.Properties[Constants.PLD["Device_PanelHeight"]].ToString();
isPldInformationPresent = true;
}
}
catch { }
try
{
DeviceInformation pldPanelLength = await DeviceInformation.CreateFromIdAsync(deviceInstanceId, new string[] { Constants.PLD["Device_PanelLength"] }, kind);
if (pldPanelLength.Properties[Constants.PLD["Device_PanelLength"]] != null)
{
pld[5] = pldPanelLength.Properties[Constants.PLD["Device_PanelLength"]].ToString();
isPldInformationPresent = true;
}
}
catch { }
try
{
DeviceInformation pldPanelPositionX = await DeviceInformation.CreateFromIdAsync(deviceInstanceId, new string[] { Constants.PLD["Device_PanelPositionX"] }, kind);
if (pldPanelPositionX.Properties[Constants.PLD["Device_PanelPositionX"]] != null)
{
pld[6] = pldPanelPositionX.Properties[Constants.PLD["Device_PanelPositionX"]].ToString();
isPldInformationPresent = true;
}
}
catch { }
try
{
DeviceInformation pldPanelPositionY = await DeviceInformation.CreateFromIdAsync(deviceInstanceId, new string[] { Constants.PLD["Device_PanelPositionY"] }, kind);
if (pldPanelPositionY.Properties[Constants.PLD["Device_PanelPositionY"]] != null)
{
pld[7] = pldPanelPositionY.Properties[Constants.PLD["Device_PanelPositionY"]].ToString();
isPldInformationPresent = true;
}
}
catch { }
try
{
DeviceInformation pldPanelPositionZ = await DeviceInformation.CreateFromIdAsync(deviceInstanceId, new string[] { Constants.PLD["Device_PanelPositionZ"] }, kind);
if(pldPanelPositionZ.Properties[Constants.PLD["Device_PanelPositionZ"]] != null)
{
pld[8] = pldPanelPositionZ.Properties[Constants.PLD["Device_PanelPositionZ"]].ToString();
isPldInformationPresent = true;
}
}
catch { }
try
{
DeviceInformation pldPanelRotationX = await DeviceInformation.CreateFromIdAsync(deviceInstanceId, new string[] { Constants.PLD["Device_PanelRotationX"] }, kind);
if(pldPanelRotationX.Properties[Constants.PLD["Device_PanelRotationX"]] != null)
{
pld[9] = pldPanelRotationX.Properties[Constants.PLD["Device_PanelRotationX"]].ToString();
isPldInformationPresent = true;
}
}
catch { }
try
{
DeviceInformation pldPanelRotationY = await DeviceInformation.CreateFromIdAsync(deviceInstanceId, new string[] { Constants.PLD["Device_PanelRotationY"] }, kind);
if (pldPanelRotationY.Properties[Constants.PLD["Device_PanelRotationY"]] != null)
{
pld[10] = pldPanelRotationY.Properties[Constants.PLD["Device_PanelRotationY"]].ToString();
isPldInformationPresent = true;
}
}
catch { }
try
{
DeviceInformation pldPanelRotationZ = await DeviceInformation.CreateFromIdAsync(deviceInstanceId, new string[] { Constants.PLD["Device_PanelRotationZ"] }, kind);
if(pldPanelRotationZ.Properties[Constants.PLD["Device_PanelRotationZ"]] != null)
{
pld[11] = pldPanelRotationZ.Properties[Constants.PLD["Device_PanelRotationZ"]].ToString();
isPldInformationPresent = true;
}
}
catch { }
try
{
DeviceInformation pldPanelColor = await DeviceInformation.CreateFromIdAsync(deviceInstanceId, new string[] { Constants.PLD["Device_PanelColor"] }, kind);
if(pldPanelColor.Properties[Constants.PLD["Device_PanelColor"]] != null)
{
pld[12] = pldPanelColor.Properties[Constants.PLD["Device_PanelColor"]].ToString();
isPldInformationPresent = true;
}
}
catch { }
try
{
DeviceInformation pldPanelShape = await DeviceInformation.CreateFromIdAsync(deviceInstanceId, new string[] { Constants.PLD["Device_PanelShape"] }, kind);
if(pldPanelShape.Properties[Constants.PLD["Device_PanelShape"]] != null)
{
pld[13] = pldPanelShape.Properties[Constants.PLD["Device_PanelShape"]].ToString();
isPldInformationPresent = true;
}
}
catch { }
try
{
DeviceInformation pldPanelVisible = await DeviceInformation.CreateFromIdAsync(deviceInstanceId, new string[] { Constants.PLD["Device_PanelVisible"] }, kind);
if(pldPanelVisible.Properties[Constants.PLD["Device_PanelVisible"]] != null)
{
pld[14] = pldPanelVisible.Properties[Constants.PLD["Device_PanelVisible"]].ToString();
isPldInformationPresent = true;
}
}
catch { }
return isPldInformationPresent ? pld : null;
}