Fix 4th step of calibration; add translations; add welcome message
This commit is contained in:
parent
579d47b2f7
commit
e271f336f3
378
core.js
378
core.js
@ -3,6 +3,14 @@ var devname = "";
|
||||
var mode = 0;
|
||||
var disable_btn = false;
|
||||
|
||||
var lang_orig_text = {};
|
||||
var lang_cur = {};
|
||||
var lang_disabled = true;
|
||||
|
||||
var available_langs = {
|
||||
"it_it": "it_it.json",
|
||||
};
|
||||
|
||||
function dec2hex(i) {
|
||||
return (i+0x10000).toString(16).substr(-4).toUpperCase();
|
||||
}
|
||||
@ -29,20 +37,20 @@ async function ds4_info() {
|
||||
var hw_ver_minor= view.getUint16(0x23, true)
|
||||
var sw_ver_major= view.getUint32(0x25, true)
|
||||
var sw_ver_minor= view.getUint16(0x25+4, true)
|
||||
var ooc = "unknown";
|
||||
var ooc = l("unknown");
|
||||
|
||||
try {
|
||||
const view = await device.receiveFeatureReport(0x81);
|
||||
ooc = "original";
|
||||
ooc = l("original");
|
||||
} catch(e) {
|
||||
ooc = "<font color='red'><b>clone</b></font>";
|
||||
ooc = "<font color='red'><b>" + l("clone") + "</b></font>";
|
||||
disable_btn = true;
|
||||
}
|
||||
clear_info();
|
||||
append_info("Firmware Date: ", k1 + " " + k2);
|
||||
append_info("HW Version:", "" + dec2hex(hw_ver_major) + ":" + dec2hex(hw_ver_minor));
|
||||
append_info("SW Version:", dec2hex32(sw_ver_major) + ":" + dec2hex(sw_ver_minor));
|
||||
append_info("Device Type:", ooc);
|
||||
append_info(l("Build Date:"), k1 + " " + k2);
|
||||
append_info(l("HW Version:"), "" + dec2hex(hw_ver_major) + ":" + dec2hex(hw_ver_minor));
|
||||
append_info(l("SW Version:"), dec2hex32(sw_ver_major) + ":" + dec2hex(sw_ver_minor));
|
||||
append_info(l("Device Type:"), ooc);
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -61,12 +69,13 @@ async function ds5_reset() {
|
||||
}
|
||||
|
||||
async function ds4_calibrate_range_begin(perm_ch) {
|
||||
try {
|
||||
var err = l("Range calibration failed: ");
|
||||
try {
|
||||
if(perm_ch) {
|
||||
await ds4_nvunlock();
|
||||
if(await ds4_nvstatus() != 0) {
|
||||
close_calibrate_window();
|
||||
return show_popup("Range calibration failed: cannot unlock NV.");
|
||||
return show_popup(err + l("Cannot unlock NVS"));
|
||||
}
|
||||
}
|
||||
|
||||
@ -78,17 +87,18 @@ try {
|
||||
data2 = await device.receiveFeatureReport(0x92)
|
||||
if(data.getUint32(0, false) != 0x91010201 || data2.getUint32(0, false) != 0x920102ff) {
|
||||
close_calibrate_window();
|
||||
return show_popup("Range calibration failed: error 1.");
|
||||
return show_popup(err + l("Error 1"));
|
||||
}
|
||||
} catch(e) {
|
||||
} catch(e) {
|
||||
await new Promise(r => setTimeout(r, 500));
|
||||
close_calibrate_window();
|
||||
return show_popup("Calibration failed: " + e);
|
||||
}
|
||||
return show_popup(err + e);
|
||||
}
|
||||
}
|
||||
|
||||
async function ds4_calibrate_range_end(perm_ch) {
|
||||
try {
|
||||
var err = l("Range calibration failed: ");
|
||||
try {
|
||||
// Write
|
||||
await device.sendFeatureReport(0x90, alloc_req(0x90, [2,1,2]))
|
||||
|
||||
@ -96,32 +106,33 @@ try {
|
||||
data2 = await device.receiveFeatureReport(0x92)
|
||||
if(data.getUint32(0, false) != 0x91010202 || data2.getUint32(0, false) != 0x92010201) {
|
||||
close_calibrate_window();
|
||||
return show_popup("Range calibration failed: error 3.");
|
||||
return show_popup(err + l("Error 3"));
|
||||
}
|
||||
|
||||
if(perm_ch) {
|
||||
await ds4_nvlock();
|
||||
if(await ds4_nvstatus() != 1) {
|
||||
close_calibrate_window();
|
||||
return show_popup("Range calibration failed: cannot relock NV.");
|
||||
return show_popup(err + l("Cannot relock NVS"));
|
||||
}
|
||||
}
|
||||
|
||||
close_calibrate_window();
|
||||
show_popup("Range calibration completed");
|
||||
} catch(e) {
|
||||
show_popup(l("Range calibration completed"));
|
||||
} catch(e) {
|
||||
await new Promise(r => setTimeout(r, 500));
|
||||
close_calibrate_window();
|
||||
return show_popup("Calibration failed: " + e);
|
||||
}
|
||||
return show_popup(err + e);
|
||||
}
|
||||
}
|
||||
|
||||
async function ds4_calibrate_sticks_begin(has_perm_changes) {
|
||||
var err = l("Stick calibration failed: ");
|
||||
try {
|
||||
if(has_perm_changes) {
|
||||
await ds4_nvunlock();
|
||||
if(await ds4_nvstatus() != 0) {
|
||||
show_popup("Calibration failed: cannot unlock NV.");
|
||||
show_popup(err + l("Cannot unlock NVS"));
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@ -133,19 +144,20 @@ async function ds4_calibrate_sticks_begin(has_perm_changes) {
|
||||
data = await device.receiveFeatureReport(0x91)
|
||||
data2 = await device.receiveFeatureReport(0x92)
|
||||
if(data.getUint32(0, false) != 0x91010101 || data2.getUint32(0, false) != 0x920101ff) {
|
||||
show_popup("Calibration failed: error 1.");
|
||||
show_popup(err + l("Error 1"));
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
} catch(e) {
|
||||
await new Promise(r => setTimeout(r, 500));
|
||||
show_popup("Calibration failed: " + e);
|
||||
show_popup(err + e);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
async function ds4_calibrate_sticks_sample() {
|
||||
var err = l("Stick calibration failed: ");
|
||||
try {
|
||||
// Sample
|
||||
await device.sendFeatureReport(0x90, alloc_req(0x90, [3,1,1]))
|
||||
@ -157,32 +169,33 @@ async function ds4_calibrate_sticks_sample() {
|
||||
close_calibrate_window();
|
||||
d1 = dec2hex32(data.getUint32(0, false));
|
||||
d2 = dec2hex32(data2.getUint32(0, false));
|
||||
show_popup("Calibration failed: error 2 (got " + d1 + ", " + d2 + " at i=" + i + ")");
|
||||
show_popup(err + l("Error 2") + " (" + d1 + ", " + d2 + " at i=" + i + ")");
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
} catch(e) {
|
||||
await new Promise(r => setTimeout(r, 500));
|
||||
show_popup("Calibration failed: " + e);
|
||||
show_popup(err + e);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
async function ds4_calibrate_sticks_end(has_perm_changes) {
|
||||
var err = l("Stick calibration failed: ");
|
||||
try {
|
||||
// Write
|
||||
await device.sendFeatureReport(0x90, alloc_req(0x90, [2,1,1]))
|
||||
if(data.getUint32(0, false) != 0x91010101 || data2.getUint32(0, false) != 0x920101FF) {
|
||||
d1 = dec2hex32(data.getUint32(0, false));
|
||||
d2 = dec2hex32(data2.getUint32(0, false));
|
||||
show_popup("Calibration failed: error 3 (got " + d1 + ", " + d2 + " at i=" + i + ")");
|
||||
show_popup(err + l("Error 3") + " (" + d1 + ", " + d2 + " at i=" + i + ")");
|
||||
return false;
|
||||
}
|
||||
|
||||
if(has_perm_changes) {
|
||||
await ds4_nvlock();
|
||||
if(await ds4_nvstatus() != 1) {
|
||||
show_popup("Calibration failed: cannot relock NV.");
|
||||
show_popup(err + l("Cannot relock NVS"));
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@ -190,13 +203,14 @@ async function ds4_calibrate_sticks_end(has_perm_changes) {
|
||||
return true;
|
||||
} catch(e) {
|
||||
await new Promise(r => setTimeout(r, 500));
|
||||
show_popup("Calibration failed: " + e);
|
||||
show_popup(err + e);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
async function ds4_calibrate_sticks() {
|
||||
try {
|
||||
var err = l("Stick calibration failed: ");
|
||||
try {
|
||||
set_progress(0);
|
||||
|
||||
// Begin
|
||||
@ -207,7 +221,7 @@ try {
|
||||
data2 = await device.receiveFeatureReport(0x92)
|
||||
if(data.getUint32(0, false) != 0x91010101 || data2.getUint32(0, false) != 0x920101ff) {
|
||||
close_calibrate_window();
|
||||
return show_popup("Calibration failed: error 1.");
|
||||
return show_popup(err + l("Error 1"));
|
||||
}
|
||||
|
||||
set_progress(10);
|
||||
@ -224,7 +238,7 @@ try {
|
||||
close_calibrate_window();
|
||||
d1 = dec2hex32(data.getUint32(0, false));
|
||||
d2 = dec2hex32(data2.getUint32(0, false));
|
||||
return show_popup("Calibration failed: error 2 (got " + d1 + ", " + d2 + " at i=" + i + ")");
|
||||
return show_popup(err + l("Error 2") + " (" + d1 + ", " + d2 + " at i=" + i + ")");
|
||||
}
|
||||
|
||||
await new Promise(r => setTimeout(r, 500));
|
||||
@ -237,18 +251,18 @@ try {
|
||||
d1 = dec2hex32(data.getUint32(0, false));
|
||||
d2 = dec2hex32(data2.getUint32(0, false));
|
||||
close_calibrate_window();
|
||||
return show_popup("Calibration failed: error 3 (got " + d1 + ", " + d2 + " at i=" + i + ")");
|
||||
return show_popup(err + l("Error 3") + " (" + d1 + ", " + d2 + " at i=" + i + ")");
|
||||
}
|
||||
|
||||
set_progress(100);
|
||||
await new Promise(r => setTimeout(r, 500));
|
||||
close_calibrate_window()
|
||||
show_popup("Calibration completed successfully");
|
||||
} catch(e) {
|
||||
show_popup(l("Stick calibration completed"));
|
||||
} catch(e) {
|
||||
await new Promise(r => setTimeout(r, 500));
|
||||
close_calibrate_window();
|
||||
return show_popup("Calibration failed: " + e);
|
||||
}
|
||||
return show_popup(err + e);
|
||||
}
|
||||
}
|
||||
|
||||
async function ds4_nvstatus() {
|
||||
@ -257,9 +271,9 @@ async function ds4_nvstatus() {
|
||||
// 1: temporary, 0: permanent
|
||||
ret = data.getUint8(1, false);
|
||||
if(ret == 1) {
|
||||
$("#d-nvstatus").html("<font color='green'>locked</font>");
|
||||
$("#d-nvstatus").html("<font color='green'>" + l("locked") + "</font>");
|
||||
} else if(ret == 0) {
|
||||
$("#d-nvstatus").html("<font color='red'>unlocked</font>");
|
||||
$("#d-nvstatus").html("<font color='red'>" + l("unlocked") + "</font>");
|
||||
} else {
|
||||
$("#d-nvstatus").html("<font color='purple'>unk " + ret + "</font>");
|
||||
}
|
||||
@ -267,24 +281,24 @@ async function ds4_nvstatus() {
|
||||
}
|
||||
|
||||
async function ds5_nvstatus() {
|
||||
try {
|
||||
try {
|
||||
await device.sendFeatureReport(0x80, alloc_req(0x80, [3,3]))
|
||||
data = await device.receiveFeatureReport(0x81)
|
||||
ret = data.getUint32(1, false);
|
||||
if(ret == 0x03030201) {
|
||||
$("#d-nvstatus").html("<font color='green'>locked</font>");
|
||||
$("#d-nvstatus").html("<font color='green'>" + l("locked") + "</font>");
|
||||
return 1; // temporary
|
||||
} else if(ret == 0x03030200) {
|
||||
$("#d-nvstatus").html("<font color='red'>unlocked</font>");
|
||||
$("#d-nvstatus").html("<font color='red'>" + l("unlocked") + "</font>");
|
||||
return 0; // permanent
|
||||
} else {
|
||||
$("#d-nvstatus").html("<font color='purple'>unk " + dec2hex32(ret) + "</font>");
|
||||
return ret; // unknown
|
||||
}
|
||||
} catch(e) {
|
||||
$("#d-nvstatus").html("<font color='red'>error</font>");
|
||||
} catch(e) {
|
||||
$("#d-nvstatus").html("<font color='red'>" + l("error") + "</font>");
|
||||
return 2; // error
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
async function ds4_getbdaddr() {
|
||||
@ -292,7 +306,7 @@ async function ds4_getbdaddr() {
|
||||
}
|
||||
|
||||
async function ds5_getbdaddr() {
|
||||
try {
|
||||
try {
|
||||
await device.sendFeatureReport(0x80, alloc_req(0x80, [9,2]))
|
||||
data = await device.receiveFeatureReport(0x81)
|
||||
out = ""
|
||||
@ -302,10 +316,10 @@ try {
|
||||
}
|
||||
$("#d-bdaddr").text(out);
|
||||
return out;
|
||||
} catch(e) {
|
||||
$("#d-bdaddr").html("<font color='red'>error</font>");
|
||||
} catch(e) {
|
||||
$("#d-bdaddr").html("<font color='red'>" + l("error") + "</font>");
|
||||
return "error";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
async function ds4_nvlock() {
|
||||
@ -341,27 +355,26 @@ async function ds5_info() {
|
||||
|
||||
clear_info();
|
||||
|
||||
append_info("Build Time: ", build_date + " " + build_time);
|
||||
append_info("Firmware Type:", "0x" + dec2hex(fwtype));
|
||||
append_info("SW Series:", "0x" + dec2hex(swseries));
|
||||
append_info("HW Info:", "0x" + dec2hex32(hwinfo));
|
||||
append_info("FW Version:", "0x" + dec2hex32(fwversion));
|
||||
//append_info("deviceinfo:", deviceinfo);
|
||||
append_info("UPD Version:", "0x" + dec2hex(updversion));
|
||||
//append_info("Unknown:", "0x" + dec2hex(unk));
|
||||
append_info("FW Version1:", "0x" + dec2hex32(fwversion1));
|
||||
append_info("FW Version2:", "0x" + dec2hex32(fwversion2));
|
||||
append_info("FW Version3:", "0x" + dec2hex32(fwversion3));
|
||||
append_info(l("Build Date:"), build_date + " " + build_time);
|
||||
append_info(l("Firmware Type:"), "0x" + dec2hex(fwtype));
|
||||
append_info(l("SW Series:"), "0x" + dec2hex(swseries));
|
||||
append_info(l("HW Info:"), "0x" + dec2hex32(hwinfo));
|
||||
append_info(l("SW Version:"), "0x" + dec2hex32(fwversion));
|
||||
append_info(l("UPD Version:"), "0x" + dec2hex(updversion));
|
||||
append_info(l("FW Version1:"), "0x" + dec2hex32(fwversion1));
|
||||
append_info(l("FW Version2:"), "0x" + dec2hex32(fwversion2));
|
||||
append_info(l("FW Version3:"), "0x" + dec2hex32(fwversion3));
|
||||
return true;
|
||||
}
|
||||
|
||||
async function ds5_calibrate_sticks_begin(has_perm_changes) {
|
||||
var err = l("Range calibration failed: ");
|
||||
console.log("::ds5_calibrate_sticks_begin(" + has_perm_changes + ")");
|
||||
try {
|
||||
if(has_perm_changes) {
|
||||
await ds5_nvunlock();
|
||||
if(await ds5_nvstatus() != 0) {
|
||||
show_popup("Range calibration failed: cannot unlock NVS.");
|
||||
show_popup(err + l("Cannot unlock NVS"));
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@ -372,18 +385,19 @@ async function ds5_calibrate_sticks_begin(has_perm_changes) {
|
||||
data = await device.receiveFeatureReport(0x83)
|
||||
if(data.getUint32(0, false) != 0x83010101) {
|
||||
d1 = dec2hex32(data.getUint32(0, false));
|
||||
show_popup("Calibration failed: error 1 (got " + d1 + ").");
|
||||
show_popup(err + l("Error 1") + " (" + d1 + ").");
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
} catch(e) {
|
||||
await new Promise(r => setTimeout(r, 500));
|
||||
show_popup("Calibration failed: " + e);
|
||||
show_popup(err + e);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
async function ds5_calibrate_sticks_sample() {
|
||||
var err = l("Stick calibration failed: ");
|
||||
console.log("::ds5_calibrate_sticks_sample()");
|
||||
try {
|
||||
// Sample
|
||||
@ -393,18 +407,19 @@ async function ds5_calibrate_sticks_sample() {
|
||||
data = await device.receiveFeatureReport(0x83)
|
||||
if(data.getUint32(0, false) != 0x83010101) {
|
||||
d1 = dec2hex32(data.getUint32(0, false));
|
||||
show_popup("Calibration failed: error 2 (got " + d1 + ").");
|
||||
show_popup(err + l("Error 2") + " (" + d1 + ").");
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
} catch(e) {
|
||||
await new Promise(r => setTimeout(r, 500));
|
||||
show_popup("Calibration failed: " + e);
|
||||
show_popup(err + e);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
async function ds5_calibrate_sticks_end(has_perm_changes) {
|
||||
var err = l("Stick calibration failed: ");
|
||||
console.log("::ds5_calibrate_sticks_end(" + has_perm_changes + ")");
|
||||
try {
|
||||
// Write
|
||||
@ -413,27 +428,28 @@ async function ds5_calibrate_sticks_end(has_perm_changes) {
|
||||
data = await device.receiveFeatureReport(0x83)
|
||||
if(data.getUint32(0, false) != 0x83010102) {
|
||||
d1 = dec2hex32(data.getUint32(0, false));
|
||||
show_popup("Calibration failed: error 3 (got " + d1 + ").");
|
||||
show_popup(err + l("Error 3") + " (" + d1 + ").");
|
||||
return false;
|
||||
}
|
||||
|
||||
if(has_perm_changes) {
|
||||
await ds5_nvlock();
|
||||
if(await ds5_nvstatus() != 1) {
|
||||
show_popup("Range calibration failed: cannot relock NVS.");
|
||||
show_popup(err + l("Cannot relock NVS"));
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
} catch(e) {
|
||||
await new Promise(r => setTimeout(r, 500));
|
||||
show_popup("Calibration failed: " + e);
|
||||
show_popup(err + e);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
async function ds5_calibrate_sticks() {
|
||||
try {
|
||||
var err = l("Stick calibration failed: ");
|
||||
try {
|
||||
set_progress(0);
|
||||
|
||||
// Begin
|
||||
@ -444,7 +460,7 @@ try {
|
||||
if(data.getUint32(0, false) != 0x83010101) {
|
||||
d1 = dec2hex32(data.getUint32(0, false));
|
||||
close_calibrate_window();
|
||||
return show_popup("Calibration failed: error 1 (got " + d1 + ").");
|
||||
return show_popup(err + l("Error 1") + " (" + d1 + ").");
|
||||
}
|
||||
|
||||
set_progress(10);
|
||||
@ -460,7 +476,7 @@ try {
|
||||
if(data.getUint32(0, false) != 0x83010101) {
|
||||
d1 = dec2hex32(data.getUint32(0, false));
|
||||
close_calibrate_window();
|
||||
return show_popup("Calibration failed: error 2 (got " + d1 + ").");
|
||||
return show_popup(err + l("Error 2") + " (" + d1 + ").");
|
||||
}
|
||||
|
||||
await new Promise(r => setTimeout(r, 500));
|
||||
@ -477,7 +493,7 @@ try {
|
||||
if(data.getUint32(0, false) != 0x83010102) {
|
||||
d1 = dec2hex32(data.getUint32(0, false));
|
||||
close_calibrate_window();
|
||||
return show_popup("Calibration failed: error 3 (got " + d1 + ").");
|
||||
return show_popup(err + l("Error 3") + " (" + d1 + ").");
|
||||
}
|
||||
|
||||
set_progress(100);
|
||||
@ -485,21 +501,22 @@ try {
|
||||
await new Promise(r => setTimeout(r, 500));
|
||||
close_calibrate_window()
|
||||
|
||||
show_popup("Calibration completed successfully");
|
||||
} catch(e) {
|
||||
show_popup(l("Stick calibration completed"));
|
||||
} catch(e) {
|
||||
await new Promise(r => setTimeout(r, 500));
|
||||
close_calibrate_window();
|
||||
return show_popup("Calibration failed: " + e);
|
||||
}
|
||||
return show_popup(err + e);
|
||||
}
|
||||
}
|
||||
|
||||
async function ds5_calibrate_range_begin(perm_ch) {
|
||||
try {
|
||||
var err = l("Range calibration failed: ");
|
||||
try {
|
||||
if(perm_ch) {
|
||||
await ds5_nvunlock();
|
||||
if(await ds5_nvstatus() != 0) {
|
||||
close_calibrate_window();
|
||||
return show_popup("Range calibration failed: cannot unlock NVS.");
|
||||
return show_popup(err + l("Cannot unlock NVS"));
|
||||
}
|
||||
}
|
||||
|
||||
@ -511,17 +528,18 @@ try {
|
||||
if(data.getUint32(0, false) != 0x83010201) {
|
||||
d1 = dec2hex32(data.getUint32(0, false));
|
||||
close_calibrate_window();
|
||||
return show_popup("Calibration failed: error 1 (got " + d1 + ").");
|
||||
return show_popup(err + l("Error 1") + " (" + d1 + ").");
|
||||
}
|
||||
} catch(e) {
|
||||
} catch(e) {
|
||||
await new Promise(r => setTimeout(r, 500));
|
||||
close_calibrate_window();
|
||||
return show_popup("Calibration failed: " + e);
|
||||
}
|
||||
return show_popup(err + e);
|
||||
}
|
||||
}
|
||||
|
||||
async function ds5_calibrate_range_end(perm_ch) {
|
||||
try {
|
||||
var err = l("Range calibration failed: ");
|
||||
try {
|
||||
// Write
|
||||
await device.sendFeatureReport(0x82, alloc_req(0x82, [2,1,2]))
|
||||
|
||||
@ -530,35 +548,35 @@ try {
|
||||
if(data.getUint32(0, false) != 0x83010202) {
|
||||
d1 = dec2hex32(data.getUint32(0, false));
|
||||
close_calibrate_window();
|
||||
return show_popup("Calibration failed: error 1 (got " + d1 + ").");
|
||||
return show_popup(err + l("Error 1") + " (" + d1 + ").");
|
||||
}
|
||||
|
||||
if(perm_ch) {
|
||||
await ds5_nvlock();
|
||||
if(await ds5_nvstatus() != 1) {
|
||||
close_calibrate_window();
|
||||
return show_popup("Range calibration failed: cannot relock NVS.");
|
||||
return show_popup(err + l("Cannot relock NVS"));
|
||||
}
|
||||
}
|
||||
|
||||
close_calibrate_window();
|
||||
show_popup("Range calibration completed");
|
||||
} catch(e) {
|
||||
show_popup(l("Range calibration completed"));
|
||||
} catch(e) {
|
||||
await new Promise(r => setTimeout(r, 500));
|
||||
close_calibrate_window();
|
||||
return show_popup("Calibration failed: " + e);
|
||||
}
|
||||
return show_popup(err + e);
|
||||
}
|
||||
}
|
||||
|
||||
async function ds5_nvlock() {
|
||||
try {
|
||||
try {
|
||||
await device.sendFeatureReport(0x80, alloc_req(0x80, [3,1]))
|
||||
data = await device.receiveFeatureReport(0x83)
|
||||
} catch(e) {
|
||||
} catch(e) {
|
||||
await new Promise(r => setTimeout(r, 500));
|
||||
close_calibrate_window();
|
||||
return show_popup("NVSLock failed: " + e);
|
||||
}
|
||||
return show_popup(l("NVS Lock failed: ") + e);
|
||||
}
|
||||
}
|
||||
|
||||
async function ds5_nvunlock() {
|
||||
@ -568,7 +586,7 @@ try {
|
||||
} catch(e) {
|
||||
await new Promise(r => setTimeout(r, 500));
|
||||
close_calibrate_window();
|
||||
return show_popup("NVSUnlock failed: " + e);
|
||||
return show_popup(l("NVS Unlock failed: ") + e);
|
||||
}
|
||||
}
|
||||
|
||||
@ -591,7 +609,56 @@ function handleDisconnectedDevice(e) {
|
||||
disconnect();
|
||||
}
|
||||
|
||||
function createCookie(name, value, days) {
|
||||
var expires;
|
||||
|
||||
if (days) {
|
||||
var date = new Date();
|
||||
date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000));
|
||||
expires = "; expires=" + date.toGMTString();
|
||||
} else {
|
||||
expires = "";
|
||||
}
|
||||
document.cookie = encodeURIComponent(name) + "=" + encodeURIComponent(value) + expires + "; path=/";
|
||||
}
|
||||
|
||||
function readCookie(name) {
|
||||
var nameEQ = encodeURIComponent(name) + "=";
|
||||
var ca = document.cookie.split(';');
|
||||
for (var i = 0; i < ca.length; i++) {
|
||||
var c = ca[i];
|
||||
while (c.charAt(0) === ' ')
|
||||
c = c.substring(1, c.length);
|
||||
if (c.indexOf(nameEQ) === 0)
|
||||
return decodeURIComponent(c.substring(nameEQ.length, c.length));
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
function eraseCookie(name) {
|
||||
createCookie(name, "", -1);
|
||||
}
|
||||
|
||||
function welcome_modal() {
|
||||
var already_accepted = readCookie("welcome_accepted");
|
||||
if(already_accepted == "1")
|
||||
return;
|
||||
|
||||
curModal = new bootstrap.Modal(document.getElementById('welcomeModal'), {})
|
||||
curModal.show();
|
||||
}
|
||||
|
||||
function welcome_accepted() {
|
||||
createCookie("welcome_accepted", "1");
|
||||
$("#welcomeModal").modal("hide");
|
||||
}
|
||||
|
||||
function gboot() {
|
||||
window.addEventListener('DOMContentLoaded', function() {
|
||||
lang_init();
|
||||
welcome_modal();
|
||||
});
|
||||
|
||||
if (!("hid" in navigator)) {
|
||||
$("#offlinebar").hide();
|
||||
$("#onlinebar").hide();
|
||||
@ -640,7 +707,7 @@ try {
|
||||
|
||||
if (devices.length > 1) {
|
||||
$("#btnconnect").prop("disabled", false);
|
||||
show_popup("Please connect only one controller at time.");
|
||||
show_popup(l("Please connect only one controller at time."));
|
||||
return;
|
||||
}
|
||||
|
||||
@ -653,30 +720,30 @@ try {
|
||||
if(await ds4_info()) {
|
||||
connected = true
|
||||
mode = 1;
|
||||
devname = "Sony DualShock 4 V1";
|
||||
devname = l("Sony DualShock 4 V1");
|
||||
}
|
||||
} else if(device.productId == 0x09cc) {
|
||||
if(await ds4_info()) {
|
||||
connected = true
|
||||
mode = 1;
|
||||
devname = "Sony DualShock 4 V2";
|
||||
devname = l("Sony DualShock 4 V2");
|
||||
}
|
||||
} else if(device.productId == 0x0ce6) {
|
||||
if(await ds5_info()) {
|
||||
connected = true
|
||||
mode = 2;
|
||||
devname = "Sony DualSense";
|
||||
devname = l("Sony DualSense");
|
||||
}
|
||||
} else if(device.productId == 0x0df2) {
|
||||
if(await ds5_info()) {
|
||||
connected = true
|
||||
mode = 0;
|
||||
devname = "Sony DualSense Edge";
|
||||
devname = l("Sony DualSense Edge");
|
||||
disable_btn = true;
|
||||
}
|
||||
} else {
|
||||
$("#btnconnect").prop("disabled", false);
|
||||
show_popup("Connected invalid device: " + dec2hex(device.vendorId) + ":" + dec2hex(device.productId))
|
||||
show_popup(l("Connected invalid device: ") + dec2hex(device.vendorId) + ":" + dec2hex(device.productId))
|
||||
disconnect();
|
||||
return;
|
||||
}
|
||||
@ -687,15 +754,15 @@ try {
|
||||
$("#onlinebar").show();
|
||||
$("#mainmenu").show();
|
||||
$("#resetBtn").show();
|
||||
$("#d-nvstatus").text = "Unknown";
|
||||
$("#d-bdaddr").text = "Unknown";
|
||||
$("#d-nvstatus").text = l("Unknown");
|
||||
$("#d-bdaddr").text = l("Unknown");
|
||||
}
|
||||
|
||||
if(disable_btn) {
|
||||
if(device.productId == 0x0df2) {
|
||||
show_popup("Calibration of the DualSense Edge is not currently supported.");
|
||||
show_popup(l("Calibration of the DualSense Edge is not currently supported."));
|
||||
} else {
|
||||
show_popup("The device appears to be a DS4 clone. All functionalities are disabled.");
|
||||
show_popup(l("The device appears to be a DS4 clone. All functionalities are disabled."));
|
||||
}
|
||||
}
|
||||
|
||||
@ -704,7 +771,7 @@ try {
|
||||
$("#btnconnect").prop("disabled", false);
|
||||
} catch(error) {
|
||||
$("#btnconnect").prop("disabled", false);
|
||||
show_popup("Error: " + error);
|
||||
show_popup(l("Error: ") + error);
|
||||
return;
|
||||
}
|
||||
}
|
||||
@ -846,7 +913,7 @@ function show_popup(text) {
|
||||
new bootstrap.Modal(document.getElementById('popupModal'), {}).show()
|
||||
}
|
||||
|
||||
function discord_popup() { show_popup("My handle on discord is: the_al"); }
|
||||
function discord_popup() { show_popup(l("My handle on discord is: the_al")); }
|
||||
|
||||
function calib_perm_changes() { return $("#calibPermanentChanges").is(':checked') }
|
||||
|
||||
@ -870,15 +937,19 @@ async function calib_step(i) {
|
||||
}
|
||||
|
||||
if(i == 2) {
|
||||
$("#calibNextText").text("Initializing...");
|
||||
$("#calibNextText").text(l("Initializing..."));
|
||||
await new Promise(r => setTimeout(r, 100));
|
||||
ret = await multi_calib_sticks_begin(pc);
|
||||
} else if(i == 6) {
|
||||
$("#calibNextText").text("Storing calibration...");
|
||||
$("#calibNextText").text(l("Sampling..."));
|
||||
await new Promise(r => setTimeout(r, 100));
|
||||
ret = await multi_calib_sticks_sample();
|
||||
await new Promise(r => setTimeout(r, 100));
|
||||
$("#calibNextText").text(l("Storing calibration..."));
|
||||
await new Promise(r => setTimeout(r, 100));
|
||||
ret = await multi_calib_sticks_end(pc);
|
||||
} else if(i > 2 && i < 6){
|
||||
$("#calibNextText").text("Sampling...");
|
||||
$("#calibNextText").text(l("Sampling..."));
|
||||
await new Promise(r => setTimeout(r, 100));
|
||||
ret = await multi_calib_sticks_sample();
|
||||
}
|
||||
@ -902,16 +973,16 @@ async function calib_step(i) {
|
||||
$("#list-" + i + "-calib").addClass("active");
|
||||
|
||||
if(i == 1) {
|
||||
$("#calibTitle").text("Stick center calibration");
|
||||
$("#calibNextText").text("Start");
|
||||
$("#calibTitle").text(l("Stick center calibration"));
|
||||
$("#calibNextText").text(l("Start"));
|
||||
}
|
||||
else if(i == 6) {
|
||||
$("#calibTitle").text("Stick center calibration");
|
||||
$("#calibNextText").text("Done");
|
||||
$("#calibTitle").text(l("Stick center calibration"));
|
||||
$("#calibNextText").text(l("Done"));
|
||||
}
|
||||
else {
|
||||
$("#calibTitle").html("Calibration in progress");
|
||||
$("#calibNextText").text("Continue");
|
||||
$("#calibTitle").html(l("Calibration in progress"));
|
||||
$("#calibNextText").text(l("Continue"));
|
||||
}
|
||||
if(i == 1 || i == 6)
|
||||
$("#calibCross").show();
|
||||
@ -929,7 +1000,6 @@ async function calib_open() {
|
||||
}
|
||||
|
||||
async function calib_next() {
|
||||
console.log(cur_calib);
|
||||
if(cur_calib == 6) {
|
||||
close_new_calib()
|
||||
return;
|
||||
@ -939,3 +1009,81 @@ async function calib_next() {
|
||||
await calib_step(cur_calib);
|
||||
}
|
||||
}
|
||||
|
||||
function lang_init() {
|
||||
var id_iter = 0;
|
||||
var items = document.getElementsByClassName('ds-i18n');
|
||||
for(i=0; i<items.length; i++) {
|
||||
var item = items[i];
|
||||
if (item.id.length == 0) {
|
||||
var new_id = "ds-g-id-" + (id_iter++);
|
||||
item.id = new_id;
|
||||
}
|
||||
|
||||
lang_orig_text[item.id] = $(item).html();
|
||||
}
|
||||
lang_orig_text[".title"] = document.title;
|
||||
|
||||
var nlang = navigator.language.replace('-', '_').toLowerCase();
|
||||
var ljson = available_langs[nlang];
|
||||
if(ljson !== undefined) {
|
||||
lang_translate(ljson);
|
||||
}
|
||||
}
|
||||
|
||||
function lang_reset_page() {
|
||||
var items = document.getElementsByClassName('ds-i18n');
|
||||
for(i=0; i<items.length; i++) {
|
||||
var item = items[i];
|
||||
$(item).html(lang_orig_text[item.id]);
|
||||
}
|
||||
}
|
||||
|
||||
function l(text) {
|
||||
if(lang_disabled)
|
||||
return text;
|
||||
|
||||
var out = lang_cur[text];
|
||||
if(out !== undefined) {
|
||||
return out;
|
||||
}
|
||||
|
||||
console.log("Missing translation for: '" + text + "'");
|
||||
return text;
|
||||
}
|
||||
|
||||
function lang_translate(target_lang) {
|
||||
lang_cur = {}
|
||||
$.getJSON("lang/" + target_lang, function(data) {
|
||||
$.each( data, function( key, val ) {
|
||||
if(lang_cur[key] !== undefined) {
|
||||
console.log("Warn: already exists " + key);
|
||||
} else {
|
||||
lang_cur[key] = [val];
|
||||
}
|
||||
});
|
||||
|
||||
if(Object.keys(lang_cur).length > 0) {
|
||||
lang_disabled = false;
|
||||
}
|
||||
|
||||
var items = document.getElementsByClassName('ds-i18n');
|
||||
for(i=0; i<items.length; i++) {
|
||||
var item = items[i];
|
||||
var old = lang_orig_text[item.id];
|
||||
|
||||
var tnew = lang_cur[old];
|
||||
if (tnew !== undefined && tnew.length == 1 && tnew[0].length > 0) {
|
||||
$(item).html(tnew[0]);
|
||||
} else {
|
||||
console.log("Cannot find mapping for " + old);
|
||||
}
|
||||
}
|
||||
var old_title = lang_orig_text[".title"];
|
||||
document.title = lang_cur[old_title];
|
||||
if(lang_cur[".authorMsg"] !== undefined) {
|
||||
$("#authorMsg").html(lang_cur[".authorMsg"])
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
170
index.html
170
index.html
@ -5,13 +5,21 @@
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>DualShock Calibration GUI</title>
|
||||
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH" crossorigin="anonymous">
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@6.4.2/css/fontawesome.min.css" integrity="sha384-BY+fdrpOd3gfeRvTSMT+VUZmA728cfF9Z2G42xpaRkUGu2i3DyzpTURDo5A6CaLK" crossorigin="anonymous">
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css"
|
||||
rel="stylesheet"
|
||||
integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH"
|
||||
crossorigin="anonymous">
|
||||
|
||||
<script src="https://code.jquery.com/jquery-3.7.1.slim.min.js"
|
||||
integrity="sha256-kmHvs0B+OpCW5GVHUNjv9rOmY0IvSIRcf7zGUDTDQM8="
|
||||
<link rel="stylesheet"
|
||||
href="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@6.4.2/css/fontawesome.min.css"
|
||||
integrity="sha384-BY+fdrpOd3gfeRvTSMT+VUZmA728cfF9Z2G42xpaRkUGu2i3DyzpTURDo5A6CaLK"
|
||||
crossorigin="anonymous">
|
||||
|
||||
<script src="https://code.jquery.com/jquery-3.7.1.min.js"
|
||||
integrity="sha256-/JqT3SQfawRcv/BIHPThkBvs0OEvtFFmqPF/lYI/Cxo="
|
||||
crossorigin="anonymous"></script>
|
||||
|
||||
|
||||
<script src="core.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
@ -34,27 +42,27 @@
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js" integrity="sha384-YvpcrYf0tY3lHB60NNkmXc5s9fDVZLESaAA55NDzOxhy9GkcIdslK1eN7N6jIeHz" crossorigin="anonymous"></script>
|
||||
|
||||
<div class="container p-2">
|
||||
<h1>DualShock Calibration GUI</h1>
|
||||
<h1 class="ds-i18n">DualShock Calibration GUI</h1>
|
||||
|
||||
<div id="missinghid" style="display: none;">
|
||||
<p>Unsupported browser. Please use a web browser with WebHID support (e.g. Chrome).</p>
|
||||
<p class="ds-i18n">Unsupported browser. Please use a web browser with WebHID support (e.g. Chrome).</p>
|
||||
</div>
|
||||
|
||||
<div id="offlinebar" class="vstack p-2" style="display: none;">
|
||||
<p>Connect a DualShock 4 or a DualSense to your computer and press Connect.</p>
|
||||
<button id="btnconnect" type="button" class="btn btn-outline-primary" onclick="connect()">Connect</button><br>
|
||||
<p class="ds-i18n">Connect a DualShock 4 or a DualSense controller to your computer and press Connect.</p>
|
||||
<button id="btnconnect" type="button" class="btn btn-outline-primary ds-i18n" onclick="connect()">Connect</button><br>
|
||||
</div>
|
||||
|
||||
<div id="onlinebar" class="vstack p-2" style="display: none;">
|
||||
<div class="hstack gap-2"><p><b>Connected to:</b></p><p id="devname"></p></div>
|
||||
<button type="button" class="btn btn-outline-secondary" onclick="disconnect()">Disconnect</button><br>
|
||||
<div class="hstack gap-2"><p><b class="ds-i18n">Connected to:</b></p><p id="devname"></p></div>
|
||||
<button type="button" class="btn btn-outline-secondary ds-i18n" onclick="disconnect()">Disconnect</button><br>
|
||||
</div>
|
||||
|
||||
<div id="mainmenu" class="container" style="display: none;">
|
||||
<div class="row">
|
||||
<div class="col-md-6 col-sm-12">
|
||||
<div class="card text-bg-light" >
|
||||
<div class="card-header">Firmware Info</div>
|
||||
<div class="card-header ds-i18n">Firmware Info</div>
|
||||
|
||||
<div class="vstack p-2" id="fwinfo"> </div>
|
||||
</div>
|
||||
@ -63,26 +71,26 @@
|
||||
|
||||
<div class="col-md-6 col-sm-12">
|
||||
<div class="vstack gap-2 p-2">
|
||||
<button id="btnmcs2" type="button" class="btn btn-primary ds-btn" onclick="calib_open()">Calibrate stick center</button>
|
||||
<button id="btnmcs2" type="button" class="btn btn-primary ds-btn ds-i18n" onclick="calib_open()">Calibrate stick center</button>
|
||||
<div class="hstack gap-2">
|
||||
<button type="button" class="btn btn-primary ds-btn" onclick="multi_calibrate_range(true)">Calibrate stick range (permanent)</button>
|
||||
<button type="button" class="btn btn-primary ds-btn" onclick="multi_calibrate_range(false)">Calibrate stick range (temporary)</button>
|
||||
<button type="button" class="btn btn-primary ds-btn ds-i18n" onclick="multi_calibrate_range(true)">Calibrate stick range (permanent)</button>
|
||||
<button type="button" class="btn btn-primary ds-btn ds-i18n" onclick="multi_calibrate_range(false)">Calibrate stick range (temporary)</button>
|
||||
</div>
|
||||
<button type="button" class="btn btn-danger ds-btn" onclick="multi_reset()" id="resetBtn">Reset controller</button>
|
||||
<button type="button" class="btn btn-danger ds-btn ds-i18n" onclick="multi_reset()" id="resetBtn">Reset controller</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<p> Sections below are not useful, just some debug infos or manual commands</p>
|
||||
<p class="ds-i18n">Sections below are not useful, just some debug infos or manual commands</p>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-6 col-sm-12">
|
||||
<div class="card text-bg-light" >
|
||||
<div class="card-header">Debug info</div>
|
||||
<div class="vstack p-2">
|
||||
<div class="hstack"><p>NVS Status</p><p class="ms-auto" id="d-nvstatus">Unknown</p></div>
|
||||
<div class="hstack"><p>BD Addr</p><p class="ms-auto" id="d-bdaddr">Unknown</p></div>
|
||||
<div class="hstack"><p class="ds-i18n">NVS Status</p><p class="ms-auto ds-i18n" id="d-nvstatus">Unknown</p></div>
|
||||
<div class="hstack"><p class="ds-i18n">BD Addr</p><p class="ms-auto ds-i18n" id="d-bdaddr">Unknown</p></div>
|
||||
</div>
|
||||
</div>
|
||||
<br>
|
||||
@ -90,15 +98,15 @@
|
||||
|
||||
<div class="col-md-6 col-sm-12">
|
||||
<div class="card text-bg-light" >
|
||||
<div class="card-header">Debug buttons</div>
|
||||
<div class="card-header ds-i18n">Debug buttons</div>
|
||||
<div class="vstack gap-2 p-2">
|
||||
<div class="hstack gap-2">
|
||||
<button type="button" class="btn btn-success ds-btn" onclick="multi_nvstatus()">Query NVS status</button>
|
||||
<button type="button" class="btn btn-primary ds-btn" onclick="multi_nvsunlock()">NVS unlock</button>
|
||||
<button type="button" class="btn btn-primary ds-btn" onclick="multi_nvslock()">NVS lock</button>
|
||||
<button type="button" class="btn btn-success ds-btn ds-i18n" onclick="multi_nvstatus()">Query NVS status</button>
|
||||
<button type="button" class="btn btn-primary ds-btn ds-i18n" onclick="multi_nvsunlock()">NVS unlock</button>
|
||||
<button type="button" class="btn btn-primary ds-btn ds-i18n" onclick="multi_nvslock()">NVS lock</button>
|
||||
</div>
|
||||
<button type="button" class="btn btn-primary ds-btn" onclick="multi_getbdaddr()">Get BDAddr</button>
|
||||
<button id="btnmcs" type="button" class="btn btn-primary ds-btn" onclick="multi_calibrate_sticks()">Fast calibrate stick center (OLD)</button>
|
||||
<button type="button" class="btn btn-primary ds-btn ds-i18n" onclick="multi_getbdaddr()">Get BDAddr</button>
|
||||
<button id="btnmcs" type="button" class="btn btn-primary ds-btn ds-i18n" onclick="multi_calibrate_sticks()">Fast calibrate stick center (OLD)</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -106,12 +114,36 @@
|
||||
|
||||
</div>
|
||||
|
||||
<!-- Welcome Modal -->
|
||||
<div class="modal fade" id="welcomeModal" data-bs-backdrop="static" data-bs-keyboard="false" tabindex="-1" aria-labelledby="welcomeModalLabel" aria-hidden="true">
|
||||
<div class="modal-dialog modal-dialog-centered modal-lg">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h1 class="modal-title fs-5 ds-i18n" id="welcomeModalLabel">Welcome to the Calibration GUI</h1>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<p class="ds-i18n">Just few things to know before you can start:</p>
|
||||
<ul>
|
||||
<li class="ds-i18n">This website is not affiliated with Sony, PlayStation & co.</li>
|
||||
<li class="ds-i18n">This service is provided without warranty. Use at your own risk.</li>
|
||||
<li class="ds-i18n">Keep the internal battery of the controller connected and ensure it is well charged. If the battery dies during operations, the controller will be damaged and rendered unusable.</li>
|
||||
<li class="ds-i18n">Before doing the permanent calibration, try the temporary one to ensure that everything is working well.</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-primary ds-i18n" onclick="welcome_accepted();">Understood</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<!-- New calibrate modal -->
|
||||
<div class="modal fade" id="calibCenterModal" data-bs-backdrop="static" data-bs-keyboard="false" tabindex="-1" aria-labelledby="calibTitle" aria-hidden="true">
|
||||
<div class="modal-dialog modal-lg">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h1 class="modal-title fs-5" id="calibTitle">Stick Center calibration</h1>
|
||||
<h1 class="modal-title fs-5 ds-i18n" id="calibTitle">Stick center calibration</h1>
|
||||
<button type="button" id="calibCross" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
@ -119,70 +151,58 @@
|
||||
<div class="row">
|
||||
<div class="col-4">
|
||||
<div class="list-group" id="list-tab">
|
||||
<a class="list-group-item list-group-item-action active" id="list-1-calib">Welcome</a>
|
||||
<a class="list-group-item list-group-item-action" id="list-2-calib">Step 1</a>
|
||||
<a class="list-group-item list-group-item-action" id="list-3-calib">Step 2</a>
|
||||
<a class="list-group-item list-group-item-action" id="list-4-calib">Step 3</a>
|
||||
<a class="list-group-item list-group-item-action" id="list-5-calib">Step 4</a>
|
||||
<a class="list-group-item list-group-item-action" id="list-6-calib">Completed</a>
|
||||
<a class="ds-i18n list-group-item list-group-item-action active" id="list-1-calib">Welcome</a>
|
||||
<a class="ds-i18n list-group-item list-group-item-action" id="list-2-calib">Step 1</a>
|
||||
<a class="ds-i18n list-group-item list-group-item-action" id="list-3-calib">Step 2</a>
|
||||
<a class="ds-i18n list-group-item list-group-item-action" id="list-4-calib">Step 3</a>
|
||||
<a class="ds-i18n list-group-item list-group-item-action" id="list-5-calib">Step 4</a>
|
||||
<a class="ds-i18n list-group-item list-group-item-action" id="list-6-calib">Completed</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-8">
|
||||
<div class="container" id="list-1">
|
||||
<h4>Welcome to the stick center-calibration wizard!</h4>
|
||||
<h4 class="ds-i18n">Welcome to the stick center-calibration wizard!</h4>
|
||||
|
||||
<p>This tool will guide you in re-centering the analog sticks of your controller.
|
||||
It consists in four steps: you will be asked to move both
|
||||
sticks in a direction and release them.</p>
|
||||
<p class="ds-i18n">This tool will guide you in re-centering the analog sticks of your controller. It consists in four steps: you will be asked to move both sticks in a direction and release them.</p>
|
||||
|
||||
<p>Please be aware that, <i>once the calibration is running,
|
||||
it cannot be canceled</i>. Do not close this page or
|
||||
disconnect your controller until is completed.</p>
|
||||
<p class="ds-i18n">Please be aware that, <i>once the calibration is running, it cannot be canceled</i>. Do not close this page or disconnect your controller until is completed.</p>
|
||||
|
||||
<h5>Calibration storage</h5>
|
||||
<h5 class="ds-i18n">Calibration storage</h5>
|
||||
|
||||
<p>By default the calibration is only saved in a volatile
|
||||
storage, so that if you (or this tool) mess something up, a
|
||||
reset of the controller is enough to make it work again. </p>
|
||||
<p class="ds-i18n">By default the calibration is only saved in a volatile storage, so that if you (or this tool) mess something up, a reset of the controller is enough to make it work again.</p>
|
||||
|
||||
<p>If you wish to store the calibration permanently in the controller, tick the checkbox below:</p>
|
||||
<p class="ds-i18n">If you wish to store the calibration permanently in the controller, tick the checkbox below:</p>
|
||||
|
||||
<input class="form-check-input" type="checkbox" value="" id="calibPermanentChanges">
|
||||
<label class="form-check-label" for="calibPermanentChanges">
|
||||
Write changes permanently in the controller
|
||||
</label>
|
||||
<label class="form-check-label ds-i18n" for="calibPermanentChanges">Write changes permanently in the controller</label>
|
||||
|
||||
<br>
|
||||
|
||||
<p><small>Warning: <font color="red">Do not store the calibration permanently if
|
||||
the controller battery is low or disconnected. It will
|
||||
damage your controller.</font></small></p>
|
||||
<p class="ds-i18n"><small>Warning: <font color="red">Do not store the calibration permanently if the controller battery is low or disconnected. It will damage your controller.</font></small></p>
|
||||
|
||||
<p>Press <b>Start</b> to begin calibration.</p>
|
||||
<p class="ds-i18n">Press <b>Start</b> to begin calibration.</p>
|
||||
|
||||
</div>
|
||||
<div class="container" style="display: none;" id="list-2">
|
||||
<p>Please move both sticks to the <b>top-left corner</b> and release them.</p>
|
||||
<p>When the sticks are back in the center, press <b>Continue</b>.</p>
|
||||
<p class="ds-i18n">Please move both sticks to the <b>top-left corner</b> and release them.</p>
|
||||
<p class="ds-i18n">When the sticks are back in the center, press <b>Continue</b>.</p>
|
||||
</div>
|
||||
<div class="container" style="display: none;" id="list-3">
|
||||
<p>Please move both sticks to the <b>top-right corner</b> and release them.</p>
|
||||
<p>When the sticks are back in the center, press <b>Continue</b>.</p>
|
||||
<p class="ds-i18n">Please move both sticks to the <b>top-right corner</b> and release them.</p>
|
||||
<p class="ds-i18n">When the sticks are back in the center, press <b>Continue</b>.</p>
|
||||
</div>
|
||||
<div class="container" style="display: none;" id="list-4">
|
||||
<p>Please move both sticks to the <b>bottom-left corner</b> and release them.</p>
|
||||
<p>When the sticks are back in the center, press <b>Continue</b>.</p>
|
||||
<p class="ds-i18n">Please move both sticks to the <b>bottom-left corner</b> and release them.</p>
|
||||
<p class="ds-i18n">When the sticks are back in the center, press <b>Continue</b>.</p>
|
||||
</div>
|
||||
<div class="container" style="display: none;" id="list-5">
|
||||
<p>Please move both sticks to the <b>bottom-right corner</b> and release them.</p>
|
||||
<p>When the sticks are back in the center, press <b>Continue</b>.</p>
|
||||
<p class="ds-i18n">Please move both sticks to the <b>bottom-right corner</b> and release them.</p>
|
||||
<p class="ds-i18n">When the sticks are back in the center, press <b>Continue</b>.</p>
|
||||
</div>
|
||||
<div class="container" style="display: none;" id="list-6">
|
||||
Calibration completed successfully!<br><br>
|
||||
|
||||
You can check the calibration with the <a href="https://hardwaretester.com/gamepad" target="_blank">gamepad tester</a>.
|
||||
<br><br>
|
||||
Have a nice day :)
|
||||
<p class="ds-i18n">Calibration completed successfully!</p>
|
||||
<p><span class="ds-i18n">You can check the calibration with the</span> <a href="https://hardwaretester.com/gamepad" target="_blank">gamepad tester</a>.</p>
|
||||
<p class="ds-i18n">Have a nice day :)</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -191,7 +211,7 @@
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-primary" id="calibNext" onclick="calib_next()">
|
||||
<span class="spinner-border spinner-border-sm" role="status" aria-hidden="true" id="btnSpinner" style="display: none;"></span>
|
||||
<span id="calibNextText">Next</span>
|
||||
<span id="calibNextText" class="ds-i18n">Next</span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
@ -207,8 +227,8 @@
|
||||
<h1 class="modal-title fs-5" id="staticBackdropLabel">Calibrating center</h1>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
Recentering the controller sticks. <br>
|
||||
Please do not close this window and do not disconnect your controller.<br>
|
||||
<p class="ds-i18n">Recentering the controller sticks. </p>
|
||||
<p class="ds-i18n">Please do not close this window and do not disconnect your controller. </p>
|
||||
<div class="progress" role="progressbar" aria-label="Centering" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100">
|
||||
<div class="progress-bar" style="width: 0%"></div>
|
||||
</div>
|
||||
@ -224,14 +244,14 @@
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h1 class="modal-title fs-5" id="staticBackdropLabel">Range calibration</h1>
|
||||
<h1 class="modal-title fs-5 ds-i18n" id="staticBackdropLabel">Range calibration</h1>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<b>The controller is now sampling data!</b> <br>
|
||||
Rotate the sticks slowly to cover the whole range. Press "Done" when completed.
|
||||
<p class="ds-i18n"><b>The controller is now sampling data!</b></p>
|
||||
<p class="ds-i18n">Rotate the sticks slowly to cover the whole range. Press "Done" when completed.</p>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-primary" onclick="multi_calibrate_range_on_close()">Done</button>
|
||||
<button type="button" class="btn btn-primary ds-i18n" onclick="multi_calibrate_range_on_close()">Done</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -246,10 +266,10 @@
|
||||
</div>
|
||||
|
||||
<div class="modal-body p-4" id="donateBody">
|
||||
Hi, thank you for using this software.<br><br>
|
||||
If you're finding it helpful and you want to support my efforts, feel free to <a href="https://paypal.me/alaincarlucci" target="_blank" class="text-body-secondary">buy me a coffee</a>! :)<br><br>
|
||||
Do you have any suggestion or issue? Drop me a message via email or discord.<br><br>
|
||||
Cheers!
|
||||
<p class="ds-i18n">Hi, thank you for using this software.</p>
|
||||
<p><span class="ds-i18n">If you're finding it helpful and you want to support my efforts, feel free to</span> <a href="https://paypal.me/alaincarlucci" target="_blank" class="text-body-secondary ds-i18n">buy me a coffee</a><span class="ds-i18n">! :)</span></p>
|
||||
<p class="ds-i18n">Do you have any suggestion or issue? Drop me a message via email or discord.</p>
|
||||
<p class="ds-i18n">Cheers!</p>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button onclick="window.open('https://paypal.me/alaincarlucci')" type="button" class="btn btn-success" data-bs-dismiss="modal">
|
||||
@ -275,7 +295,7 @@
|
||||
<div class="container">
|
||||
<footer>
|
||||
<div class="d-flex flex-column flex-sm-row justify-content-between py-4 my-4 border-top" id="footbody">
|
||||
<p>Version 0.3<small class="text-muted">beta</small> (2024-04-06) - <a href="#" data-bs-toggle="modal" data-bs-target="#donateModal">Support this project</a></p>
|
||||
<p><span class="ds-i18n">Version</span> 0.4<small class="text-muted">beta</small> (2024-04-09) - <a href="#" class="ds-i18n" data-bs-toggle="modal" data-bs-target="#donateModal">Support this project</a> <span id="authorMsg"></span></p>
|
||||
|
||||
<ul class="list-unstyled d-flex">
|
||||
<li class="ms-3"><a class="link-body-emphasis" href="mailto:ds4@the.al" target="_blank"><svg class="bi" width="24" height="24"><use xlink:href="#mail"/></svg></a></li>
|
||||
|
119
lang/it_it.json
Normal file
119
lang/it_it.json
Normal file
@ -0,0 +1,119 @@
|
||||
{
|
||||
".authorMsg": "- Traduzione in Italiano a cura di <a href='https://blog.the.al'>the_al</a>",
|
||||
"DualShock Calibration GUI": "GUI di Calibrazione DualShock",
|
||||
"Unsupported browser. Please use a web browser with WebHID support (e.g. Chrome).": "Browser non supportato. Visita questo sito usando un browser con supporto WebHID (es. Google Chrome).",
|
||||
"Connect a DualShock 4 or a DualSense controller to your computer and press Connect.": "Collega un controller DualShock 4 o DualSense al computer e premi Connetti",
|
||||
"Connect": "Connetti",
|
||||
"Connected to:": "Connesso a:",
|
||||
"Disconnect": "Disconnetti",
|
||||
"Firmware Info": "Informazioni sul Firmware",
|
||||
"Calibrate stick center": "Ricentra gli analogici",
|
||||
"Calibrate stick range (permanent)": "Calibra il range degli analogici (permanente)",
|
||||
"Calibrate stick range (temporary)": "Calibra il range degli analogici (temporaneo)",
|
||||
"Reset controller": "Resetta il controller",
|
||||
"Sections below are not useful, just some debug infos or manual commands": "Le sezioni qua sotto non sono utili, sono per debug o comandi manuali",
|
||||
"NVS Status": "Stato NVS",
|
||||
"Unknown": "Sconosciuto",
|
||||
"BD Addr": "Indirizzo BD",
|
||||
"Debug buttons": "Pulsanti di debug",
|
||||
"Query NVS status": "Ottieni stato NVS",
|
||||
"NVS unlock": "Sblocca NVS",
|
||||
"NVS lock": "Blocca NVS",
|
||||
"Get BDAddr": "Ottieni indirizzo BD",
|
||||
"Fast calibrate stick center (OLD)": "Ricentra velocemente gli analogici (vecchio)",
|
||||
"Stick center calibration": "Calibrazione del centro degli analogici",
|
||||
"Welcome": "Benvenuto",
|
||||
"Step 1": "Step 1",
|
||||
"Step 2": "Step 2",
|
||||
"Step 3": "Step 3",
|
||||
"Step 4": "Step 4",
|
||||
"Completed": "Completato",
|
||||
"Welcome to the stick center-calibration wizard!": "Benvenuto nel wizard di calibrazione degli analogici",
|
||||
"This tool will guide you in re-centering the analog sticks of your controller. It consists in four steps: you will be asked to move both sticks in a direction and release them.": "Questo strumento ti guida nel ricentrare le levette analogiche del tuo controller. Consiste in quattro passi: ti verrà chiesto di spostare entrambi gli analogici in una direzione e poi rilasciarli.",
|
||||
"Please be aware that, <i>once the calibration is running, it cannot be canceled</i>. Do not close this page or disconnect your controller until is completed.": "Attenzione: <i>se la calibrazione è in corso, non può essere annullata</i>. Non chiudere questa pagina e non disconnettere il controller finché non è completata.",
|
||||
"Calibration storage": "Salvataggio della calibrazione",
|
||||
"By default the calibration is only saved in a volatile storage, so that if you (or this tool) mess something up, a reset of the controller is enough to make it work again.": "Di base, la calibrazione è salvata solo in memoria temporanea, in modo che se qualcosa va storto, un reset risolve il problema.",
|
||||
"If you wish to store the calibration permanently in the controller, tick the checkbox below:": "Se preferisci salvare la calibrazione permanentemente nel controller, spunta la casella qua sotto:",
|
||||
"Write changes permanently in the controller": "Salva i cambiamenti permanentemente nel controller",
|
||||
"<small>Warning: <font color=\"red\">Do not store the calibration permanently if the controller battery is low or disconnected. It will damage your controller.</font></small>": "<small>Attenzione: <font color='red'>Non salvare permanentemente la calibrazione se la batteria del controller è bassa o disconnessa. Questo potrebbe danneggiare il controller.</font></small>",
|
||||
"Press <b>Start</b> to begin calibration.": "Premi <b>Avvia</b> per avviare la calibrazione",
|
||||
"Please move both sticks to the <b>top-left corner</b> and release them.": "Muovi entrambi gli analogici <b>in alto a sinistra</b> e rilasciali.",
|
||||
"When the sticks are back in the center, press <b>Continue</b>.": "Quando le levette sono nuovamente al centro, premi <b>Continua</b>",
|
||||
"Please move both sticks to the <b>top-right corner</b> and release them.": "Muovi entrambi gli analogici <b>in alto a destra</b> e rilasciali.",
|
||||
"Please move both sticks to the <b>bottom-left corner</b> and release them.": "Muovi entrambi gli analogici <b>in basso a sinistra</b> e rilasciali.",
|
||||
"Please move both sticks to the <b>bottom-right corner</b> and release them.": "Muovi entrambi gli analogici <b>in basso a destra</b> e rilasciali.",
|
||||
"Calibration completed successfully!": "Calibrazione completata con successo!",
|
||||
"Next": "Avanti",
|
||||
"Recentering the controller sticks. ": "Ricentro gli analogici. ",
|
||||
"Please do not close this window and do not disconnect your controller. ": "Non chiudere questa finestra e non disconnettere il controller. ",
|
||||
"Range calibration": "Calibrazione del range",
|
||||
"<b>The controller is now sampling data!</b>": "<b>Il controller sta campionando i dati!</b>",
|
||||
"Rotate the sticks slowly to cover the whole range. Press \"Done\" when completed.": "Ruota gli analogici lentamente in modo da coprire l'intero range. Premi \"Fatto\" quando hai finito.",
|
||||
"Done": "Fatto",
|
||||
"Hi, thank you for using this software.": "Ciao, grazie per aver usato questo software.",
|
||||
"If you're finding it helpful and you want to support my efforts, feel free to": "Se lo hai trovato utile e vuoi supportare i miei sforzi, sentiti libero di",
|
||||
"buy me a coffee": "offrirmi un caffè",
|
||||
"! :)": "! :)",
|
||||
"Do you have any suggestion or issue? Drop me a message via email or discord.": "Hai qualche suggerimento o problema? Lasciami un messaggio via email o discord.",
|
||||
"Cheers!": "A presto!",
|
||||
"Support this project": "Supporta il progetto",
|
||||
|
||||
"unknown": "sconosciuto",
|
||||
"original": "originale",
|
||||
"clone": "clone",
|
||||
"locked": "bloccato",
|
||||
"unlocked": "sbloccato",
|
||||
"error": "errore",
|
||||
"Build Date:": "Data Build:",
|
||||
"HW Version:": "Versione HW:",
|
||||
"SW Version:": "Versione SW:",
|
||||
"Device Type:": "Tipo Device:",
|
||||
"Firmware Type:": "Tipo Firmware:",
|
||||
"SW Series:": "Serie SW:",
|
||||
"HW Info:": "Info HW:",
|
||||
"SW Version:": "Versione SW:",
|
||||
"UPD Version:": "Versione UPD:",
|
||||
"FW Version1:": "Versione FW1:",
|
||||
"FW Version2:": "Versione FW2:",
|
||||
"FW Version3:": "Versione FW3:",
|
||||
|
||||
"Range calibration completed": "Calibrazione range completata",
|
||||
"Range calibration failed: ": "Calibrazione range fallita: ",
|
||||
"Cannot unlock NVS": "Impossibile sbloccare NVS",
|
||||
"Cannot relock NVS": "Impossibile ribloccare NVS",
|
||||
"Error 1": "Errore 1",
|
||||
"Error 2": "Errore 2",
|
||||
"Error 3": "Errore 3",
|
||||
"Stick calibration failed: ": "Calibrazione analogici fallita: ",
|
||||
"Stick calibration completed": "Calibrazione analogici completata",
|
||||
"NVS Lock failed: ": "Blocco NVS fallito: ",
|
||||
"NVS Unlock failed: ": "Sblocco NVS fallito: ",
|
||||
"Please connect only one controller at time.": "Connettere un solo controller alla volta, grazie.",
|
||||
"Sony DualShock 4 V1": "Sony DualShock 4 V1",
|
||||
"Sony DualShock 4 V2": "Sony DualShock 4 V2",
|
||||
"Sony DualSense": "Sony DualSense",
|
||||
"Sony DualSense Edge": "Sony DualSense Edge",
|
||||
"Connected invalid device: ": "Connesso dispositivo non valido: ",
|
||||
"Calibration of the DualSense Edge is not currently supported.": "",
|
||||
"The device appears to be a DS4 clone. All functionalities are disabled.": "",
|
||||
"Error: ": "Errore: ",
|
||||
"My handle on discord is: the_al": "Il mio handle su discord è: the_al",
|
||||
"Initializing...": "Inizializzo...",
|
||||
"Storing calibration...": "Salvo la calibrazione...",
|
||||
"Sampling...": "Campiono...",
|
||||
"Calibration in progress": "Calibrazione in corso",
|
||||
"Start": "Avvia",
|
||||
"Done": "Fatto",
|
||||
"Continue": "Continua",
|
||||
"You can check the calibration with the": "Puoi controllare la calibrazione con il",
|
||||
"Have a nice day :)": "Buona giornata! :)",
|
||||
"Welcome to the Calibration GUI": "Benvenuto alla Calibration GUI",
|
||||
"Just few things to know before you can start:": "Alcune cose da sapere prima di iniziare:",
|
||||
"This website is not affiliated with Sony, PlayStation & co.": "Questo sito web non è affiliato con Sony, PlayStation & co.",
|
||||
"This service is provided without warranty. Use at your own risk.": "Questo servizio è fornito senza garanzia. Usalo a tuo rischio. ",
|
||||
"Keep the internal battery of the controller connected and ensure it is well charged. If the battery dies during operations, the controller will be damaged and rendered unusable.": "Tieni sempre la batteria interna del controller collegata, e assicurati che sia carica. Se il controller si spegne durante le operazioni, diventerà inutilizzabile.",
|
||||
"Before doing the permanent calibration, try the temporary one to ensure that everything is working well.": "Non eseguire fin da subito le calibrazioni permanenti, inizia con quelle temporanee e controlla che sia tutto ok!",
|
||||
"Understood": "Ho capito",
|
||||
"Version": "Versione",
|
||||
"": ""
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user