|
@@ -68,15 +68,23 @@ var configuratorApp = (function(){
|
68
|
68
|
boards_list = {};
|
69
|
69
|
$.get(marlin_config + "/boards.h", function(txt) {
|
70
|
70
|
// Get all the boards and save them into an object
|
71
|
|
- var r, findDef = new RegExp('[ \\t]*#define[ \\t]+(BOARD_[^ \\t]+)[ \\t]+(\\d+)[ \\t]*(//[ \\t]*)?(.+)?', 'mg');
|
|
71
|
+ var r, findDef = new RegExp('[ \\t]*#define[ \\t]+(BOARD_[^ \\t]+)[ \\t]+(\\d+)[ \\t]*(//[ \\t]*)?(.+)?', 'gm');
|
72
|
72
|
while((r = findDef.exec(txt)) !== null) {
|
73
|
|
- boards_list[r[1]] = r[2].prePad(r[2] < 100 ? (r[2] < 10 ? 5 : 4) : 0, ' ') + " — " + r[4].replace(/\).*/, ')');
|
|
73
|
+ boards_list[r[1]] = r[2].prePad(3, ' ') + " — " + r[4].replace(/\).*/, ')');
|
74
|
74
|
}
|
75
|
75
|
});
|
76
|
76
|
|
77
|
77
|
// Read Configuration.h
|
78
|
78
|
$.get(marlin_config+"/Configuration.h", function(txt) {
|
|
79
|
+ // File contents into the textarea
|
79
|
80
|
$config.text(txt);
|
|
81
|
+ // Get all the thermistors and save them into an object
|
|
82
|
+ var r, s, findDef = new RegExp('(//.*\n)+\\s+(#define[ \\t]+TEMP_SENSOR_0)', 'g');
|
|
83
|
+ r = findDef.exec(txt);
|
|
84
|
+ findDef = new RegExp('^//[ \\t]*([-\\d]+)[ \\t]+is[ \\t]+(.*)[ \\t]*$', 'gm');
|
|
85
|
+ while((s = findDef.exec(r[0])) !== null) {
|
|
86
|
+ therms_list[s[1]] = s[1].prePad(4, ' ') + " — " + s[2];
|
|
87
|
+ }
|
80
|
88
|
});
|
81
|
89
|
|
82
|
90
|
// Read Configuration.h
|
|
@@ -152,6 +160,12 @@ var configuratorApp = (function(){
|
152
|
160
|
|
153
|
161
|
this.initField('PS_DEFAULT_OFF');
|
154
|
162
|
|
|
163
|
+ $('#TEMP_SENSOR_0, #TEMP_SENSOR_1, #TEMP_SENSOR_2, #TEMP_SENSOR_BED').addOptions(therms_list);
|
|
164
|
+ this.initField('TEMP_SENSOR_0');
|
|
165
|
+ this.initField('TEMP_SENSOR_1');
|
|
166
|
+ this.initField('TEMP_SENSOR_2');
|
|
167
|
+ this.initField('TEMP_SENSOR_BED');
|
|
168
|
+
|
155
|
169
|
/*
|
156
|
170
|
$('#serial_stepper').jstepper({
|
157
|
171
|
min: 0,
|
|
@@ -224,8 +238,6 @@ var configuratorApp = (function(){
|
224
|
238
|
}
|
225
|
239
|
// Now set the text in the field
|
226
|
240
|
$config.text(txt);
|
227
|
|
-
|
228
|
|
- // $config.scrollTo(500);
|
229
|
241
|
},
|
230
|
242
|
|
231
|
243
|
setFieldFromDefine: function(name, adv) {
|