Added Setting Options

This commit is contained in:
2022-05-09 14:45:35 +02:00
parent cf00d2b619
commit a277a15838
7 changed files with 82 additions and 16 deletions

11
package-lock.json generated
View File

@@ -10,6 +10,7 @@
"license": "MIT",
"dependencies": {
"@electron/remote": "^2.0.8",
"bootstrap-input-spinner": "^3.1.10",
"electron-squirrel-startup": "^1.0.0",
"log4js": "^6.4.6",
"xml-formatter": "^2.6.1"
@@ -1205,6 +1206,11 @@
"integrity": "sha512-d0II/GO9uf9lfUHH2BQsjxzRJZBdsjgsBiW4BvhWk/3qoKwQFjIDVN19PfX8F2D/r9PCMTtLWjYVCFrpeYUzsw==",
"optional": true
},
"node_modules/bootstrap-input-spinner": {
"version": "3.1.10",
"resolved": "https://registry.npmjs.org/bootstrap-input-spinner/-/bootstrap-input-spinner-3.1.10.tgz",
"integrity": "sha512-9RIJbYZcH4O+j+WJSaVV9203rqqWfJIqoOeuM/uvY2CLURFfly2iZw6k0nxYaJY2+1KQLzlwff71VI1l+OLkGQ=="
},
"node_modules/brace-expansion": {
"version": "1.1.11",
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz",
@@ -7877,6 +7883,11 @@
"integrity": "sha512-d0II/GO9uf9lfUHH2BQsjxzRJZBdsjgsBiW4BvhWk/3qoKwQFjIDVN19PfX8F2D/r9PCMTtLWjYVCFrpeYUzsw==",
"optional": true
},
"bootstrap-input-spinner": {
"version": "3.1.10",
"resolved": "https://registry.npmjs.org/bootstrap-input-spinner/-/bootstrap-input-spinner-3.1.10.tgz",
"integrity": "sha512-9RIJbYZcH4O+j+WJSaVV9203rqqWfJIqoOeuM/uvY2CLURFfly2iZw6k0nxYaJY2+1KQLzlwff71VI1l+OLkGQ=="
},
"brace-expansion": {
"version": "1.1.11",
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz",

View File

@@ -46,6 +46,7 @@
},
"dependencies": {
"@electron/remote": "^2.0.8",
"bootstrap-input-spinner": "^3.1.10",
"electron-squirrel-startup": "^1.0.0",
"log4js": "^6.4.6",
"xml-formatter": "^2.6.1"

File diff suppressed because one or more lines are too long

7
src/assets/bootstrap/bootstrap.min.js vendored Normal file

File diff suppressed because one or more lines are too long

5
src/assets/jquery.min.js vendored Normal file

File diff suppressed because one or more lines are too long

View File

@@ -5,17 +5,34 @@
<title>OpenTX StickExporter3D</title>
<!-- <link rel="stylesheet" href="./assets/bootstrap/bootstrap.min.css"/> -->
<link rel="stylesheet" href="./style.css"/>
<!-- <script src="./assets/jquery.min.js"></script>
<script src="./assets/bootstrap/bootstrap.min.js"></script>
<script src="bootstrap-input-spinner.js"></script> -->
</head>
<body>
<button onclick="startRender()">Start Render</button>
<p id="logNumber">Log 0/0</p>
<p id="status">Idle</p>
<hr>
<p id="fps">FPS: </p>
<p id="width">Width: </p>
<p id="stickDistance">Stick Distance: </p>
<p id="stickMode">Stick Mode: </p>
<div class="dataDiv">
<p>FPS: </p>
<input id="fpsInput" type="number" value="25" min="1" step="1" onchange="setFPS();">
</div>
<div class="dataDiv">
<p>Width: </p>
<input id="widthInput" type="number" value="540" min="1" step="1" onchange="setWidth();">
</div>
<div class="dataDiv">
<p>Stick Distance: </p>
<input id="stickDistanceInput" type="number" value="540" min="0" step="1" onchange="setStickDistance();">
</div>
<div class="dataDiv">
<p>Stick Mode: </p>
<input type="checkbox" id="stickMode2" onchange="setStickMode();">
</div>
<div class="dataDiv">
<p id="log">Logs:<br/></p>
<button onclick="openLog();">Open Log</button>

View File

@@ -11,14 +11,16 @@ var log = " "
var output = " "
const statusDisplay = document.getElementById("status");
const fpsDisplay = document.getElementById("fps");
const widthDistplay = document.getElementById("width");
const stickDistanceDisplay = document.getElementById("stickDistance");
const stickModeDisplay = document.getElementById("stickMode");
const fpsDisplay = document.getElementById("fpsInput");
const widthDistplay = document.getElementById("widthInput");
const stickDistanceDisplay = document.getElementById("stickDistanceInput");
const stickModeDisplay = document.getElementById("stickMode2");
const logDisplay = document.getElementById("log");
const outputDisplay = document.getElementById("output");
const logNumberDisplay = document.getElementById("logNumber");
//('input[type="number"]').niceNumber();
const log4js = require("log4js");
const fs = require("fs");
const formatXml = require("xml-formatter");
@@ -96,14 +98,10 @@ function getXMLChild(doc, child) {
}
function updateSettingDisplay() {
fpsDisplay.innerHTML = "FPS: " + String(fps);
widthDistplay.innerHTML = "Width: " + String(width);
stickDistanceDisplay.innerHTML = "Stick Distance: " + String(stickDistance);
if(stickMode2 == true) {
stickModeDisplay.innerHTML = "Stick Mode: 2";
} else {
stickModeDisplay.innerHTML = "Stick Mode: 1";
}
fpsDisplay.value = String(fps);
widthDistplay.value = String(width);
stickDistanceDisplay.value = String(stickDistance);
stickModeDisplay.checked = stickMode2;
logDisplay.innerHTML = "Logs:<br/>" + log.substring(1).slice(0, -1).replaceAll("\"\"", "<br/>");
outputDisplay.innerHTML = "Output Folder: " + output;
logCount = log.split("\"\"").length;
@@ -194,4 +192,24 @@ function openVid() {
statusDisplay.style.color = "red";
logger.error(err);
});
}
function setFPS() {
fps = parseInt(fpsDisplay.value);
updateSettings();
}
function setWidth() {
width = parseInt(widthDistplay.value);
updateSettings();
}
function setStickDistance() {
stickDistance = parseInt(stickDistanceDisplay.value);
updateSettings();
}
function setStickMode() {
stickMode2 = stickModeDisplay.checked;
updateSettings();
}