Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update graphics.js
Removed unneeded if statements. Added a backup for when we do not recognize the monitor display technology.
  • Loading branch information
shoustech authored Sep 20, 2023
commit 7ec64d38ec679050dd66123a99b18b5757c6cbc6
30 changes: 11 additions & 19 deletions lib/graphics.js
Original file line number Diff line number Diff line change
Expand Up @@ -936,21 +936,21 @@ function graphics(callback) {
vendor: '',
deviceName: '',
model: '',
productionYear: 0,
serial: '',
displayId: tsection.InstanceName,
main: false,
builtin: ['2147483648', '4294967295'].includes(tsection.VideoOutputTechnology), //*
connection: videoTypes[tsection.VideoOutputTechnology], //*
sizeX: '',
sizeY: '',
builtin: ['2147483648', '4294967295'].includes(tsection.VideoOutputTechnology),
connection: videoTypes[tsection.VideoOutputTechnology] ? videoTypes[tsection.VideoOutputTechnology] : 'Unknown',
productionYear: 0,
sizeX: 0,
sizeY: 0,
pixelDepth: 0,
resolutionX: '',
resolutionY: '',
currentResX: '',
currentResY: '',
positionX: '',
positionY: '',
resolutionX: 0,
resolutionY: 0,
currentResX: 0,
currentResY: 0,
positionX: 0,
positionY: 0,
currentRefreshRate: 0,
}
const dsection = dsections.find((dsection) => {
Expand All @@ -970,16 +970,10 @@ function graphics(callback) {
display.resolutionY = util.toInt(dsection.ScreenHeight)
display.model = dsection.Name.split('(', 1)[0].trim()
display.serial = dsection.SerialNumberID
} else {
display.resolutionX = 0;
display.resolutionY = 0;
}
if (msection) {
display.sizeX = util.toInt(msection.MaxHorizontalImageSize);
display.sizeY = util.toInt(msection.MaxVerticalImageSize);
} else {
display.sizeX = 0
display.sizeY = 0
}
if (isection) {
display.productionYear = util.toInt(isection.YearOfManufacture)
Expand All @@ -992,8 +986,6 @@ function graphics(callback) {
display.model = isection.UserFriendlyName
}
}
display.positionX = 0;
display.positionY = 0;
display.currentResX = display.resolutionX;
display.currentResY = display.resolutionY;
displays.push(display)
Expand Down