See #9 Added hpet options.

This commit is contained in:
Quentin Decaunes 2019-04-06 00:40:09 +02:00
parent db7233da79
commit eba42175d2
3 changed files with 51 additions and 3 deletions

View File

@ -104,6 +104,17 @@
<label><input class="uk-checkbox" type="checkbox" id="apply_last_settings_on_launch"> When checked, Ryzen Controller will try to apply latest used settings on launch.</label>
<h3>Minimize to tray:</h3>
<label><input class="uk-checkbox" type="checkbox" id="minimize_to_tray"> When checked, Ryzen Controller will minimize to tray instead of taskbar.</label>
<h3 class="windows-only">HPET:</h3>
<p class="uk-margin windows-only">
High Precision Event Timer: Allow application to get time with precision below microseconds, but is slower than most other other timer facilities.<br/>
Try running benchmark with and without to see if you get any difference.<br/>
If it doesn't make any difference, it's recommanded to let it enable.<br/>
<em>You must reboot to apply changes.</em>
</p>
<p class="uk-margin windows-only">
<button class="uk-button uk-button-primary" onClick="toggleHpet('true')">Enable</button>
<button class="uk-button uk-button-secondary" onClick="toggleHpet('false')">Disable</button>
</p>
<h3>Re-apply ryzenadj periodically:</h3>
<p>Ryzen Controller will re-apply ryzenadj every X seconds. Set to 0 to disable.</p>
<div class="uk-grid-small" uk-grid>

View File

@ -10,8 +10,9 @@ ready(function(){
reApplyPeriodically(require('electron-settings').get('settings.reapply_periodically'));
displayOptionDescription();
if (require('os').platform() === 'win32') {
recreateShortcut();
recreateShortcut();
}
handlePlatformSpecificDisplay();
updatePresetList();
checkForNewRelease();
document.isStarting = false;

View File

@ -75,8 +75,8 @@ function checkForAdminRights() {
);
}
} else {
var exec = require('child_process').exec;
exec('NET SESSION', function(err,so,se) {
const child = require('child_process').execFile;
child('NET SESSION', function(err,so,se) {
if (se.length !== 0) {
notification('warning',
`Warning: you should launch this app as administrator, `
@ -482,3 +482,39 @@ function checkForNewRelease() {
request.send();
}
/**
* Will change the BCD entry value for userplatformclock.
*
* @param {string} value BCD entry value for userplatformclock: "true" or "false".
*/
function toggleHpet(value) {
value = value === "true" ? "true" : "false";
const BcdeditExecutablePath = "C:\\Windows\\system32\\bcdedit.exe";
const parameters = [
"/set",
"useplatformclock",
value,
];
const child = require('child_process').execFile;
child(BcdeditExecutablePath, parameters, function(err, data) {
var output = data.toString();
if (err) {
notification('danger', err + '<br/>' + output);
}
else if (output) {
notification('success', 'Bcdedit output:<br/>' + output);
saveLatestUsedSettings();
}
});
}
function handlePlatformSpecificDisplay() {
var windows_only_elements = document.getElementsByClassName('windows-only');
if (require('os').platform() !== 'win32') {
for (const item of windows_only_elements) {
item.setAttribute('hidden', 'true');
}
}
}