disconnected and connecting state info

This commit is contained in:
Rick Companje 2017-07-13 17:52:15 +02:00
parent 994d0e8ebb
commit 882057e300
3 changed files with 31 additions and 6 deletions

View File

@ -15,7 +15,7 @@
var _includeBetasCheckbox;
var _submitButton;
var _settings;
var _updateAPI = new UpdateAPI();
var _configAPI = new ConfigAPI();
var _printerAPI = new PrinterAPI();
@ -46,7 +46,8 @@
$("#btnStop").hide();
$("#btnNewPrint").hide();
$("#infoDisconnected").hide();
$("#infoConnecting").hide();
//$("#btnSend").on("click", function(data) {
// // console.log("test",$("#gcode").val());
@ -141,6 +142,7 @@
d3d.util.showLoader();
_infoAPI.getStatus(function(successData) {
$("#grpStatusAndControl").show();
var state = successData.state;
@ -152,7 +154,19 @@
$("#infoState").show();
$("#infoState").text("Printer " + state + "...");
$("#grpStatusAndControl").hide();
if (state==="connecting") {
$("#infoConnecting").show();
$("#infoDisconnected").hide();
} else if (state==="disconnected") {
$("#infoConnecting").hide();
$("#infoDisconnected").show();
}
} else {
$("#infoDisconnected").hide();
$("#infoConnecting").hide();
$("#infoState").hide();
$("#grpStatusAndControl").show();
$("#infoNozzleTemperature").html(successData.hotend + " / " + successData.hotend_target + " °C");
@ -247,7 +261,7 @@
_infoAPI.getInfo(function(successData) {
$("span#infoWiFiBox").text(successData.wifiboxid);
},function(failData) {
});
// refreshSettings();

View File

@ -69,6 +69,8 @@
}, function(failData) {
console.log("_connectAPI.list failData",failData);
$("#infoWiFiBox").html("<span class='error'>failed to retrieve list with local WiFi-Box'es</span>");
});
$("#lstBoxes").on("change", function(data) {
@ -211,7 +213,6 @@
_printerAPI.fetch(data,function(successData) {
console.log("fetchPrint success",successData);
setTimeout(function() {
var url = d3d.util.replaceURLParameters("#control",_pageData);
$.mobile.changePage(url);

View File

@ -108,8 +108,7 @@
<h2>Material</h2>
<p id="infoMaterial">...</p>
</li>
</ul>
</ul>
Please select your Doodle3D WiFi-Box:
<ul data-role="listview" data-inset="true">
@ -136,6 +135,17 @@
<!-- <p class="intro">...</p> -->
<div id="infoState">loading...</div>
<div id="infoDisconnected">
<p>Please make sure the WiFi-Box is connected to your 3D-printer using a USB cable.</p>
</div>
<div id="infoConnecting">
<p>This can take a while, 20 seconds or so...</p>
<!-- <p>Hmm... this takes longer than usual...</p> -->
<p>If it takes too long please try to restart your WiFi-Box. Also make sure the WiFi-Box is running the latest firmware.</p>
<p>If you think you're really stuck, please <a href="javascript:talkus('open')">chat</a> with us to see if we can help.</p>
</div>
<div id="grpStatusAndControl">
<ul data-role="listview" data-inset="true">
<li id="liPrinterId" data-icon="false">