From ec53c6309a2b1a4df82f239513c1fd1e08d32500 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Fri, 13 Feb 2015 03:02:56 -0800 Subject: [PATCH] More fields, options in config, fix tooltips --- Marlin/configurator/config/Configuration.h | 6 +- Marlin/configurator/css/configurator.css | 18 +- Marlin/configurator/js/configurator.js | 224 +++++++++++++-------- 3 files changed, 163 insertions(+), 85 deletions(-) diff --git a/Marlin/configurator/config/Configuration.h b/Marlin/configurator/config/Configuration.h index 13d5545e4..e0c9cc301 100644 --- a/Marlin/configurator/config/Configuration.h +++ b/Marlin/configurator/config/Configuration.h @@ -48,6 +48,7 @@ Here are some standard links for getting your machine calibrated: // SERIAL_PORT selects which serial port should be used for communication with the host. // This allows the connection of wireless adapters (for instance) to non-default port pins. // Serial port 0 is still used by the Arduino bootloader regardless of this setting. +// :[0,1,2,3,4,5,6,7] #define SERIAL_PORT 0 // This determines the communication speed of the printer @@ -71,12 +72,13 @@ Here are some standard links for getting your machine calibrated: // #define MACHINE_UUID "00000000-0000-0000-0000-000000000000" // This defines the number of extruders +// :[1,2,3,4] #define EXTRUDERS 1 //// The following define selects which power supply you have. Please choose the one that matches your setup // 1 = ATX // 2 = X-Box 360 203Watts (the blue wire connected to PS_ON and the red wire to VCC) - +// :{1:'ATX',2:'X-Box 360'} #define POWER_SUPPLY 1 // Define this to have the electronics keep the power supply off on startup. If you don't know what this is leave it. @@ -119,7 +121,7 @@ Here are some standard links for getting your machine calibrated: // 1010 is Pt1000 with 1k pullup (non standard) // 147 is Pt100 with 4k7 pullup // 110 is Pt100 with 1k pullup (non standard) - +// :{ 0: "Not used", 4: "10k !! do not use for a hotend. Bad resolution at high temp. !!", 1: "100k / 4.7k - EPCOS", 51: "100k / 1k - EPCOS", 6: "100k / 4.7k EPCOS - Not as accurate as Table 1", 5: "100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", 7: "100k / 4.7k Honeywell 135-104LAG-J01", 71: "100k / 4.7k Honeywell 135-104LAF-J01", 8: "100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT", 9: "100k / 4.7k GE Sensing AL03006-58.2K-97-G1", 10: "100k / 4.7k RS 198-961", 11: "100k / 4.7k beta 3950 1%", 12: "100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)", 13: "100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'", 60: "100k Maker's Tool Works Kapton Bed Thermistor beta=3950", 55: "100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", 2: "200k / 4.7k - ATC Semitec 204GT-2", 52: "200k / 1k - ATC Semitec 204GT-2", '-2': "Thermocouple + MAX6675 (only for sensor 0)", '-1': "Thermocouple + AD595", 3: "Mendel-parts / 4.7k", 1047: "Pt1000 / 4.7k", 1010: "Pt1000 / 1k (non standard)", 20: "PT100 (Ultimainboard V2.x)", 147: "Pt100 / 4.7k", 110: "Pt100 / 1k (non-standard)" } #define TEMP_SENSOR_0 -1 #define TEMP_SENSOR_1 -1 #define TEMP_SENSOR_2 0 diff --git a/Marlin/configurator/css/configurator.css b/Marlin/configurator/css/configurator.css index e9ef345d9..62157078f 100644 --- a/Marlin/configurator/css/configurator.css +++ b/Marlin/configurator/css/configurator.css @@ -41,9 +41,10 @@ p.info span { color: #800; } #message { text-align: center; } #message { width: 80%; margin: 0 auto 0.25em; color: #FF0; } -#message p { padding: 2px 0; } -#message p.error, #message p.message { color: #F00; background: #FF4; font-weight: bold; border-radius: 0.8em; } +#message p { padding: 2px 0; font-weight: bold; border-radius: 0.8em; } #message p.message { color: #080; background: #CFC; } +#message p.error { color: #F00; background: #FF4; } +#message p.warning { color: #FF0; background: #BA4; } #message p.message span { color: #A00; background: rgba(255, 255, 255, 1); @@ -92,6 +93,17 @@ input[type="checkbox"], input[type="radio"].enabler { margin-left: 1em; } input:disabled { color: #BBB; } +#more input[type="text"] { width: 20em; } + +#more label { + width: 240px; /* label area */ + height: 1em; + padding: 10px 360px 10px 1em; + margin-right: -350px; + text-align: right; + } + + ul.tabs { padding: 0; list-style: none; } ul.tabs li { display: inline; } ul.tabs li a, @@ -136,7 +148,7 @@ fieldset legend { display: none; } } #serial_stepper { padding-top: 0.75em; display: block; float: left; } -#SERIAL_PORT { display: none; } +/*#SERIAL_PORT { display: none; }*/ /* Tooltips */ diff --git a/Marlin/configurator/js/configurator.js b/Marlin/configurator/js/configurator.js index 88af7d652..0d7de3608 100644 --- a/Marlin/configurator/js/configurator.js +++ b/Marlin/configurator/js/configurator.js @@ -165,7 +165,7 @@ var configuratorApp = (function(){ this.makeTabsForFieldsets(); // No selection on errors - $msgbox.noSelect(); + // $msgbox.noSelect(); // Make a droppable file uploader, if possible var $uploader = $('#file-upload'); @@ -231,30 +231,39 @@ var configuratorApp = (function(){ }, complete: function() { ajax_count++; - if (ajax_count >= 3) { - $.each(config_files, function(){ if (loaded_items[this]) loaded_items[this](); }); + if (ajax_count >= config_files.length) { + // If not all files loaded set an error if (success_count < ajax_count) self.setMessage('Unable to load configurations. Try the upload field.', 'error'); + + // Is the request near the rate limit? Set an error. var r; if (r = rateLimit) { if (r.quota < 20) { self.setMessage( 'Approaching request limit (' + r.quota + ' remaining.' + - ' Reset in ' + Math.floor(r.timeLeft/60) + ':' + (r.timeLeft%60+'').zeroPad(2) + ')' + ' Reset in ' + Math.floor(r.timeLeft/60) + ':' + (r.timeLeft%60+'').zeroPad(2) + ')', + 'warning' ); } } + // Post-process all the loaded files + $.each(config_files, function(){ if (loaded_items[this]) loaded_items[this](); }); } } }); }); }, - createDownloadLink: function(adv) { + /** + * Make a download link visible and active + */ + activateDownloadLink: function(adv) { var $c = adv ? $config_adv : $config, txt = $c.text(); var filename = (adv ? config_adv_file : config_file); $c.prevAll('.download:first') + .unbind('mouseover click') .mouseover(function() { var d = new Date(), fn = d.fileStamp(filename); $(this).attr({ download:fn, href:'download:'+fn, title:'download:'+fn }); @@ -300,32 +309,41 @@ var configuratorApp = (function(){ * Get all the unique define names */ getDefinesFromText: function(txt) { + var leave_out_defines = ['CONFIGURATION_H', 'CONFIGURATION_ADV_H', 'STRING_VERSION', 'STRING_URL', 'STRING_VERSION_CONFIG_H', 'STRING_CONFIG_H_AUTHOR', 'STRING_SPLASH_LINE1', 'STRING_SPLASH_LINE2']; // Get all the unique #define's and save them in an array var r, define_obj = {}, findDef = new RegExp('#define[ \\t]+(\\w+)', 'gm'); - var cnt = 0; while((r = findDef.exec(txt)) !== null) { - if (cnt++ && !(r[1] in define_obj)) define_obj[r[1]] = null; + if ($.inArray(r[1], leave_out_defines) < 0 && !(r[1] in define_obj)) + define_obj[r[1]] = null; } this.log(Object.keys(define_obj), 2); return Object.keys(define_obj); }, /** - * Create placeholder fields for defines, as needed + * Create fields for any defines that have none */ createFieldsForDefines: function(adv) { var e = adv ? 1 : 0, n = 0; var fail_list = []; $.each(define_list[e], function(i,name) { if (!$('#'+name).length) { - var $ff = $('#more'); - var inf = self.getDefineInfo(name, adv); + var $ff = $('#more'), + inf = self.getDefineInfo(name, adv); if (inf) { var $newlabel = $('