瀏覽代碼

Merge pull request #1467 from thinkyhead/marlin_configurator

Configurator utility
Scott Lahteine 10 年之前
父節點
當前提交
b83e52e50f

+ 10
- 8
Marlin/Configuration.h 查看文件

@@ -351,12 +351,12 @@ const bool Z_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic o
351 351
 #define max_software_endstops true  // If true, axis won't move to coordinates greater than the defined lengths below.
352 352
 
353 353
 // Travel limits after homing (units are in mm)
354
-#define X_MAX_POS 200
355 354
 #define X_MIN_POS 0
356
-#define Y_MAX_POS 200
357 355
 #define Y_MIN_POS 0
358
-#define Z_MAX_POS 200
359 356
 #define Z_MIN_POS 0
357
+#define X_MAX_POS 200
358
+#define Y_MAX_POS 200
359
+#define Z_MAX_POS 200
360 360
 
361 361
 #define X_MAX_LENGTH (X_MAX_POS - X_MIN_POS)
362 362
 #define Y_MAX_LENGTH (Y_MAX_POS - Y_MIN_POS)
@@ -476,12 +476,14 @@ const bool Z_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic o
476 476
 //#define MANUAL_HOME_POSITIONS  // If defined, MANUAL_*_HOME_POS below will be used
477 477
 //#define BED_CENTER_AT_0_0  // If defined, the center of the bed is at (X=0, Y=0)
478 478
 
479
-//Manual homing switch locations:
479
+// Manual homing switch locations:
480 480
 // For deltabots this means top and center of the Cartesian print volume.
481
-#define MANUAL_X_HOME_POS 0
482
-#define MANUAL_Y_HOME_POS 0
483
-#define MANUAL_Z_HOME_POS 0
484
-//#define MANUAL_Z_HOME_POS 402 // For delta: Distance between nozzle and print surface after homing.
481
+#ifdef MANUAL_HOME_POSITIONS
482
+  #define MANUAL_X_HOME_POS 0
483
+  #define MANUAL_Y_HOME_POS 0
484
+  #define MANUAL_Z_HOME_POS 0
485
+  //#define MANUAL_Z_HOME_POS 402 // For delta: Distance between nozzle and print surface after homing.
486
+#endif
485 487
 
486 488
 //// MOVEMENT SETTINGS
487 489
 #define NUM_AXIS 4 // The axis order in all axis related arrays is X, Y, Z, E

+ 2
- 2
Marlin/Configuration_adv.h 查看文件

@@ -286,8 +286,8 @@
286 286
 //===========================================================================
287 287
 
288 288
 #define ENCODER_RATE_MULTIPLIER         // If defined, certain menu edit operations automatically multiply the steps when the encoder is moved quickly
289
-#define ENCODER_10X_STEPS_PER_SEC 75    // If the encoder steps per sec exceed this value, multiple the steps moved by ten to quickly advance the value
290
-#define ENCODER_100X_STEPS_PER_SEC 160  // If the encoder steps per sec exceed this value, multiple the steps moved by 100 to really quickly advance the value
289
+#define ENCODER_10X_STEPS_PER_SEC 75    // If the encoder steps per sec exceeds this value, multiply steps moved x10 to quickly advance the value
290
+#define ENCODER_100X_STEPS_PER_SEC 160  // If the encoder steps per sec exceeds this value, multiply steps moved x100 to really quickly advance the value
291 291
 //#define ENCODER_RATE_MULTIPLIER_DEBUG  // If defined, output the encoder steps per second value
292 292
 
293 293
 //#define CHDK 4        //Pin for triggering CHDK to take a picture see how to use it here http://captain-slow.dk/2014/03/09/3d-printing-timelapses/

+ 898
- 0
Marlin/configurator/config/Configuration.h 查看文件

@@ -0,0 +1,898 @@
1
+#ifndef CONFIGURATION_H
2
+#define CONFIGURATION_H
3
+
4
+#include "boards.h"
5
+
6
+//===========================================================================
7
+//============================= Getting Started =============================
8
+//===========================================================================
9
+/*
10
+Here are some standard links for getting your machine calibrated:
11
+ * http://reprap.org/wiki/Calibration
12
+ * http://youtu.be/wAL9d7FgInk
13
+ * http://calculator.josefprusa.cz
14
+ * http://reprap.org/wiki/Triffid_Hunter%27s_Calibration_Guide
15
+ * http://www.thingiverse.com/thing:5573
16
+ * https://sites.google.com/site/repraplogphase/calibration-of-your-reprap
17
+ * http://www.thingiverse.com/thing:298812
18
+*/
19
+
20
+// This configuration file contains the basic settings.
21
+// Advanced settings can be found in Configuration_adv.h
22
+// BASIC SETTINGS: select your board type, temperature sensor type, axis scaling, and endstop configuration
23
+
24
+//===========================================================================
25
+//============================= DELTA Printer ===============================
26
+//===========================================================================
27
+// For a Delta printer replace the configuration files with the files in the
28
+// example_configurations/delta directory.
29
+//
30
+
31
+//===========================================================================
32
+//============================= SCARA Printer ===============================
33
+//===========================================================================
34
+// For a Delta printer replace the configuration files with the files in the
35
+// example_configurations/SCARA directory.
36
+//
37
+
38
+// @section info
39
+
40
+// User-specified version info of this build to display in [Pronterface, etc] terminal window during
41
+// startup. Implementation of an idea by Prof Braino to inform user that any changes made to this
42
+// build by the user have been successfully uploaded into firmware.
43
+#define STRING_VERSION "1.0.2"
44
+#define STRING_URL "reprap.org"
45
+#define STRING_VERSION_CONFIG_H __DATE__ " " __TIME__ // build date and time
46
+#define STRING_CONFIG_H_AUTHOR "(none, default config)" // Who made the changes.
47
+#define STRING_SPLASH_LINE1 "v" STRING_VERSION // will be shown during bootup in line 1
48
+//#define STRING_SPLASH_LINE2 STRING_VERSION_CONFIG_H // will be shown during bootup in line2
49
+
50
+// @section machine
51
+
52
+// SERIAL_PORT selects which serial port should be used for communication with the host.
53
+// This allows the connection of wireless adapters (for instance) to non-default port pins.
54
+// Serial port 0 is still used by the Arduino bootloader regardless of this setting.
55
+// :[0,1,2,3,4,5,6,7]
56
+#define SERIAL_PORT 0
57
+
58
+// This determines the communication speed of the printer
59
+// :[2400,9600,19200,38400,57600,115200,250000]
60
+#define BAUDRATE 250000
61
+
62
+// This enables the serial port associated to the Bluetooth interface
63
+//#define BTENABLED              // Enable BT interface on AT90USB devices
64
+
65
+// The following define selects which electronics board you have.
66
+// Please choose the name from boards.h that matches your setup
67
+#ifndef MOTHERBOARD
68
+  #define MOTHERBOARD BOARD_ULTIMAKER
69
+#endif
70
+
71
+// Define this to set a custom name for your generic Mendel,
72
+// #define CUSTOM_MENDEL_NAME "This Mendel"
73
+
74
+// Define this to set a unique identifier for this printer, (Used by some programs to differentiate between machines)
75
+// You can use an online service to generate a random UUID. (eg http://www.uuidgenerator.net/version4)
76
+// #define MACHINE_UUID "00000000-0000-0000-0000-000000000000"
77
+
78
+// This defines the number of extruders
79
+// :[1,2,3,4]
80
+#define EXTRUDERS 1
81
+
82
+//// The following define selects which power supply you have. Please choose the one that matches your setup
83
+// 1 = ATX
84
+// 2 = X-Box 360 203Watts (the blue wire connected to PS_ON and the red wire to VCC)
85
+// :{1:'ATX',2:'X-Box 360'}
86
+#define POWER_SUPPLY 1
87
+
88
+// Define this to have the electronics keep the power supply off on startup. If you don't know what this is leave it.
89
+// #define PS_DEFAULT_OFF
90
+
91
+// @section temperature
92
+
93
+//===========================================================================
94
+//============================= Thermal Settings ============================
95
+//===========================================================================
96
+//
97
+//--NORMAL IS 4.7kohm PULLUP!-- 1kohm pullup can be used on hotend sensor, using correct resistor and table
98
+//
99
+//// Temperature sensor settings:
100
+// -2 is thermocouple with MAX6675 (only for sensor 0)
101
+// -1 is thermocouple with AD595
102
+// 0 is not used
103
+// 1 is 100k thermistor - best choice for EPCOS 100k (4.7k pullup)
104
+// 2 is 200k thermistor - ATC Semitec 204GT-2 (4.7k pullup)
105
+// 3 is Mendel-parts thermistor (4.7k pullup)
106
+// 4 is 10k thermistor !! do not use it for a hotend. It gives bad resolution at high temp. !!
107
+// 5 is 100K thermistor - ATC Semitec 104GT-2 (Used in ParCan & J-Head) (4.7k pullup)
108
+// 6 is 100k EPCOS - Not as accurate as table 1 (created using a fluke thermocouple) (4.7k pullup)
109
+// 7 is 100k Honeywell thermistor 135-104LAG-J01 (4.7k pullup)
110
+// 71 is 100k Honeywell thermistor 135-104LAF-J01 (4.7k pullup)
111
+// 8 is 100k 0603 SMD Vishay NTCS0603E3104FXT (4.7k pullup)
112
+// 9 is 100k GE Sensing AL03006-58.2K-97-G1 (4.7k pullup)
113
+// 10 is 100k RS thermistor 198-961 (4.7k pullup)
114
+// 11 is 100k beta 3950 1% thermistor (4.7k pullup)
115
+// 12 is 100k 0603 SMD Vishay NTCS0603E3104FXT (4.7k pullup) (calibrated for Makibox hot bed)
116
+// 13 is 100k Hisens 3950  1% up to 300°C for hotend "Simple ONE " & "Hotend "All In ONE" 
117
+// 20 is the PT100 circuit found in the Ultimainboard V2.x
118
+// 60 is 100k Maker's Tool Works Kapton Bed Thermistor beta=3950
119
+//
120
+//    1k ohm pullup tables - This is not normal, you would have to have changed out your 4.7k for 1k
121
+//                          (but gives greater accuracy and more stable PID)
122
+// 51 is 100k thermistor - EPCOS (1k pullup)
123
+// 52 is 200k thermistor - ATC Semitec 204GT-2 (1k pullup)
124
+// 55 is 100k thermistor - ATC Semitec 104GT-2 (Used in ParCan & J-Head) (1k pullup)
125
+//
126
+// 1047 is Pt1000 with 4k7 pullup
127
+// 1010 is Pt1000 with 1k pullup (non standard)
128
+// 147 is Pt100 with 4k7 pullup
129
+// 110 is Pt100 with 1k pullup (non standard)
130
+// 998 and 999 are Dummy Tables. They will ALWAYS read 25°C or the temperature defined below. 
131
+//     Use it for Testing or Development purposes. NEVER for production machine.
132
+//     #define DUMMY_THERMISTOR_998_VALUE 25
133
+//     #define DUMMY_THERMISTOR_999_VALUE 100
134
+// :{ 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)", 998: "Dummy 1", 999: "Dummy 2" }
135
+#define TEMP_SENSOR_0 -1
136
+#define TEMP_SENSOR_1 -1
137
+#define TEMP_SENSOR_2 0
138
+#define TEMP_SENSOR_3 0
139
+#define TEMP_SENSOR_BED 0
140
+
141
+// This makes temp sensor 1 a redundant sensor for sensor 0. If the temperatures difference between these sensors is to high the print will be aborted.
142
+//#define TEMP_SENSOR_1_AS_REDUNDANT
143
+#define MAX_REDUNDANT_TEMP_SENSOR_DIFF 10
144
+
145
+// Actual temperature must be close to target for this long before M109 returns success
146
+#define TEMP_RESIDENCY_TIME 10  // (seconds)
147
+#define TEMP_HYSTERESIS 3       // (degC) range of +/- temperatures considered "close" to the target one
148
+#define TEMP_WINDOW     1       // (degC) Window around target to start the residency timer x degC early.
149
+
150
+// The minimal temperature defines the temperature below which the heater will not be enabled It is used
151
+// to check that the wiring to the thermistor is not broken.
152
+// Otherwise this would lead to the heater being powered on all the time.
153
+#define HEATER_0_MINTEMP 5
154
+#define HEATER_1_MINTEMP 5
155
+#define HEATER_2_MINTEMP 5
156
+#define HEATER_3_MINTEMP 5
157
+#define BED_MINTEMP 5
158
+
159
+// When temperature exceeds max temp, your heater will be switched off.
160
+// This feature exists to protect your hotend from overheating accidentally, but *NOT* from thermistor short/failure!
161
+// You should use MINTEMP for thermistor short/failure protection.
162
+#define HEATER_0_MAXTEMP 275
163
+#define HEATER_1_MAXTEMP 275
164
+#define HEATER_2_MAXTEMP 275
165
+#define HEATER_3_MAXTEMP 275
166
+#define BED_MAXTEMP 150
167
+
168
+// If your bed has low resistance e.g. .6 ohm and throws the fuse you can duty cycle it to reduce the
169
+// average current. The value should be an integer and the heat bed will be turned on for 1 interval of
170
+// HEATER_BED_DUTY_CYCLE_DIVIDER intervals.
171
+//#define HEATER_BED_DUTY_CYCLE_DIVIDER 4
172
+
173
+// If you want the M105 heater power reported in watts, define the BED_WATTS, and (shared for all extruders) EXTRUDER_WATTS
174
+//#define EXTRUDER_WATTS (12.0*12.0/6.7) //  P=I^2/R
175
+//#define BED_WATTS (12.0*12.0/1.1)      // P=I^2/R
176
+
177
+//===========================================================================
178
+//============================= PID Settings ================================
179
+//===========================================================================
180
+// PID Tuning Guide here: http://reprap.org/wiki/PID_Tuning
181
+
182
+// Comment the following line to disable PID and enable bang-bang.
183
+#define PIDTEMP
184
+#define BANG_MAX 255 // limits current to nozzle while in bang-bang mode; 255=full current
185
+#define PID_MAX BANG_MAX // limits current to nozzle while PID is active (see PID_FUNCTIONAL_RANGE below); 255=full current
186
+#ifdef PIDTEMP
187
+  //#define PID_DEBUG // Sends debug data to the serial port.
188
+  //#define PID_OPENLOOP 1 // Puts PID in open loop. M104/M140 sets the output power from 0 to PID_MAX
189
+  //#define SLOW_PWM_HEATERS // PWM with very low frequency (roughly 0.125Hz=8s) and minimum state time of approximately 1s useful for heaters driven by a relay
190
+  //#define PID_PARAMS_PER_EXTRUDER // Uses separate PID parameters for each extruder (useful for mismatched extruders)
191
+                                    // Set/get with gcode: M301 E[extruder number, 0-2]
192
+  #define PID_FUNCTIONAL_RANGE 10 // If the temperature difference between the target temperature and the actual temperature
193
+                                  // is more then PID_FUNCTIONAL_RANGE then the PID will be shut off and the heater will be set to min/max.
194
+  #define PID_INTEGRAL_DRIVE_MAX PID_MAX  //limit for the integral term
195
+  #define K1 0.95 //smoothing factor within the PID
196
+  #define PID_dT ((OVERSAMPLENR * 10.0)/(F_CPU / 64.0 / 256.0)) //sampling period of the temperature routine
197
+
198
+// If you are using a pre-configured hotend then you can use one of the value sets by uncommenting it
199
+// Ultimaker
200
+    #define  DEFAULT_Kp 22.2
201
+    #define  DEFAULT_Ki 1.08
202
+    #define  DEFAULT_Kd 114
203
+
204
+// MakerGear
205
+//    #define  DEFAULT_Kp 7.0
206
+//    #define  DEFAULT_Ki 0.1
207
+//    #define  DEFAULT_Kd 12
208
+
209
+// Mendel Parts V9 on 12V
210
+//    #define  DEFAULT_Kp 63.0
211
+//    #define  DEFAULT_Ki 2.25
212
+//    #define  DEFAULT_Kd 440
213
+#endif // PIDTEMP
214
+
215
+//===========================================================================
216
+//============================= PID > Bed Temperature Control ===============
217
+//===========================================================================
218
+// Select PID or bang-bang with PIDTEMPBED. If bang-bang, BED_LIMIT_SWITCHING will enable hysteresis
219
+//
220
+// Uncomment this to enable PID on the bed. It uses the same frequency PWM as the extruder.
221
+// If your PID_dT above is the default, and correct for your hardware/configuration, that means 7.689Hz,
222
+// which is fine for driving a square wave into a resistive load and does not significantly impact you FET heating.
223
+// This also works fine on a Fotek SSR-10DA Solid State Relay into a 250W heater.
224
+// If your configuration is significantly different than this and you don't understand the issues involved, you probably
225
+// shouldn't use bed PID until someone else verifies your hardware works.
226
+// If this is enabled, find your own PID constants below.
227
+//#define PIDTEMPBED
228
+//
229
+//#define BED_LIMIT_SWITCHING
230
+
231
+// This sets the max power delivered to the bed, and replaces the HEATER_BED_DUTY_CYCLE_DIVIDER option.
232
+// all forms of bed control obey this (PID, bang-bang, bang-bang with hysteresis)
233
+// setting this to anything other than 255 enables a form of PWM to the bed just like HEATER_BED_DUTY_CYCLE_DIVIDER did,
234
+// so you shouldn't use it unless you are OK with PWM on your bed.  (see the comment on enabling PIDTEMPBED)
235
+#define MAX_BED_POWER 255 // limits duty cycle to bed; 255=full current
236
+
237
+#ifdef PIDTEMPBED
238
+//120v 250W silicone heater into 4mm borosilicate (MendelMax 1.5+)
239
+//from FOPDT model - kp=.39 Tp=405 Tdead=66, Tc set to 79.2, aggressive factor of .15 (vs .1, 1, 10)
240
+    #define  DEFAULT_bedKp 10.00
241
+    #define  DEFAULT_bedKi .023
242
+    #define  DEFAULT_bedKd 305.4
243
+
244
+//120v 250W silicone heater into 4mm borosilicate (MendelMax 1.5+)
245
+//from pidautotune
246
+//    #define  DEFAULT_bedKp 97.1
247
+//    #define  DEFAULT_bedKi 1.41
248
+//    #define  DEFAULT_bedKd 1675.16
249
+
250
+// FIND YOUR OWN: "M303 E-1 C8 S90" to run autotune on the bed at 90 degreesC for 8 cycles.
251
+#endif // PIDTEMPBED
252
+
253
+// @section extruder
254
+
255
+//this prevents dangerous Extruder moves, i.e. if the temperature is under the limit
256
+//can be software-disabled for whatever purposes by
257
+#define PREVENT_DANGEROUS_EXTRUDE
258
+//if PREVENT_DANGEROUS_EXTRUDE is on, you can still disable (uncomment) very long bits of extrusion separately.
259
+#define PREVENT_LENGTHY_EXTRUDE
260
+
261
+#define EXTRUDE_MINTEMP 170
262
+#define EXTRUDE_MAXLENGTH (X_MAX_LENGTH+Y_MAX_LENGTH) //prevent extrusion of very large distances.
263
+
264
+//===========================================================================
265
+//============================= Thermal Runaway Protection ==================
266
+//===========================================================================
267
+/*
268
+This is a feature to protect your printer from burn up in flames if it has
269
+a thermistor coming off place (this happened to a friend of mine recently and
270
+motivated me writing this feature).
271
+
272
+The issue: If a thermistor come off, it will read a lower temperature than actual.
273
+The system will turn the heater on forever, burning up the filament and anything
274
+else around.
275
+
276
+After the temperature reaches the target for the first time, this feature will 
277
+start measuring for how long the current temperature stays below the target 
278
+minus _HYSTERESIS (set_temperature - THERMAL_RUNAWAY_PROTECTION_HYSTERESIS).
279
+
280
+If it stays longer than _PERIOD, it means the thermistor temperature
281
+cannot catch up with the target, so something *may be* wrong. Then, to be on the
282
+safe side, the system will he halt.
283
+
284
+Bear in mind the count down will just start AFTER the first time the 
285
+thermistor temperature is over the target, so you will have no problem if
286
+your extruder heater takes 2 minutes to hit the target on heating.
287
+
288
+*/
289
+// If you want to enable this feature for all your extruder heaters,
290
+// uncomment the 2 defines below:
291
+
292
+// Parameters for all extruder heaters
293
+//#define THERMAL_RUNAWAY_PROTECTION_PERIOD 40 //in seconds
294
+//#define THERMAL_RUNAWAY_PROTECTION_HYSTERESIS 4 // in degree Celsius
295
+
296
+// If you want to enable this feature for your bed heater,
297
+// uncomment the 2 defines below:
298
+
299
+// Parameters for the bed heater
300
+//#define THERMAL_RUNAWAY_PROTECTION_BED_PERIOD 20 //in seconds
301
+//#define THERMAL_RUNAWAY_PROTECTION_BED_HYSTERESIS 2 // in degree Celsius
302
+
303
+
304
+//===========================================================================
305
+//============================= Mechanical Settings =========================
306
+//===========================================================================
307
+
308
+// @section machine
309
+
310
+// Uncomment this option to enable CoreXY kinematics
311
+// #define COREXY
312
+
313
+// Enable this option for Toshiba steppers
314
+// #define CONFIG_STEPPERS_TOSHIBA
315
+
316
+// @section homing
317
+
318
+// coarse Endstop Settings
319
+#define ENDSTOPPULLUPS // Comment this out (using // at the start of the line) to disable the endstop pullup resistors
320
+
321
+#ifndef ENDSTOPPULLUPS
322
+  // fine endstop settings: Individual pullups. will be ignored if ENDSTOPPULLUPS is defined
323
+  // #define ENDSTOPPULLUP_XMAX
324
+  // #define ENDSTOPPULLUP_YMAX
325
+  // #define ENDSTOPPULLUP_ZMAX
326
+  // #define ENDSTOPPULLUP_XMIN
327
+  // #define ENDSTOPPULLUP_YMIN
328
+  // #define ENDSTOPPULLUP_ZMIN
329
+#endif
330
+
331
+#ifdef ENDSTOPPULLUPS
332
+  #define ENDSTOPPULLUP_XMAX
333
+  #define ENDSTOPPULLUP_YMAX
334
+  #define ENDSTOPPULLUP_ZMAX
335
+  #define ENDSTOPPULLUP_XMIN
336
+  #define ENDSTOPPULLUP_YMIN
337
+  #define ENDSTOPPULLUP_ZMIN
338
+#endif
339
+
340
+// The pullups are needed if you directly connect a mechanical endswitch between the signal and ground pins.
341
+const bool X_MIN_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop.
342
+const bool Y_MIN_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop.
343
+const bool Z_MIN_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop.
344
+const bool X_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop.
345
+const bool Y_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop.
346
+const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop.
347
+//#define DISABLE_MAX_ENDSTOPS
348
+//#define DISABLE_MIN_ENDSTOPS
349
+
350
+// @section machine
351
+
352
+// For Inverting Stepper Enable Pins (Active Low) use 0, Non Inverting (Active High) use 1
353
+// :{0:'Low',1:'High'}
354
+#define X_ENABLE_ON 0
355
+#define Y_ENABLE_ON 0
356
+#define Z_ENABLE_ON 0
357
+#define E_ENABLE_ON 0 // For all extruders
358
+
359
+// Disables axis when it's not being used.
360
+#define DISABLE_X false
361
+#define DISABLE_Y false
362
+#define DISABLE_Z false
363
+
364
+// @section extruder
365
+
366
+#define DISABLE_E false // For all extruders
367
+#define DISABLE_INACTIVE_EXTRUDER true //disable only inactive extruders and keep active extruder enabled
368
+
369
+// @section machine
370
+
371
+// Invert the stepper direction. Change (or reverse the motor connector) if an axis goes the wrong way.
372
+#define INVERT_X_DIR true     // for Mendel set to false, for Orca set to true
373
+#define INVERT_Y_DIR false    // for Mendel set to true, for Orca set to false
374
+#define INVERT_Z_DIR true     // for Mendel set to false, for Orca set to true
375
+
376
+// @section extruder
377
+
378
+// For direct drive extruder v9 set to true, for geared extruder set to false.
379
+#define INVERT_E0_DIR false   // Direct drive extruder v9: true. Geared extruder: false
380
+#define INVERT_E1_DIR false   // Direct drive extruder v9: true. Geared extruder: false
381
+#define INVERT_E2_DIR false   // Direct drive extruder v9: true. Geared extruder: false
382
+#define INVERT_E3_DIR false   // Direct drive extruder v9: true. Geared extruder: false
383
+
384
+// @section homing
385
+
386
+// ENDSTOP SETTINGS:
387
+// Sets direction of endstops when homing; 1=MAX, -1=MIN
388
+// :[-1,1]
389
+#define X_HOME_DIR -1
390
+#define Y_HOME_DIR -1
391
+#define Z_HOME_DIR -1
392
+
393
+#define min_software_endstops true // If true, axis won't move to coordinates less than HOME_POS.
394
+#define max_software_endstops true  // If true, axis won't move to coordinates greater than the defined lengths below.
395
+
396
+// @section machine
397
+
398
+// Travel limits after homing (units are in mm)
399
+#define X_MIN_POS 0
400
+#define Y_MIN_POS 0
401
+#define Z_MIN_POS 0
402
+#define X_MAX_POS 205
403
+#define Y_MAX_POS 205
404
+#define Z_MAX_POS 200
405
+
406
+// @section hidden
407
+
408
+#define X_MAX_LENGTH (X_MAX_POS - X_MIN_POS)
409
+#define Y_MAX_LENGTH (Y_MAX_POS - Y_MIN_POS)
410
+#define Z_MAX_LENGTH (Z_MAX_POS - Z_MIN_POS)
411
+
412
+
413
+//===========================================================================
414
+//============================= Bed Auto Leveling ===========================
415
+//===========================================================================
416
+
417
+// @section bedlevel
418
+
419
+//#define ENABLE_AUTO_BED_LEVELING // Delete the comment to enable (remove // at the start of the line)
420
+#define Z_PROBE_REPEATABILITY_TEST  // If not commented out, Z-Probe Repeatability test will be included if Auto Bed Leveling is Enabled.
421
+
422
+#ifdef ENABLE_AUTO_BED_LEVELING
423
+
424
+  // There are 2 different ways to specify probing locations
425
+  //
426
+  // - "grid" mode
427
+  //   Probe several points in a rectangular grid.
428
+  //   You specify the rectangle and the density of sample points.
429
+  //   This mode is preferred because there are more measurements.
430
+  //
431
+  // - "3-point" mode
432
+  //   Probe 3 arbitrary points on the bed (that aren't colinear)
433
+  //   You specify the XY coordinates of all 3 points.
434
+
435
+  // Enable this to sample the bed in a grid (least squares solution)
436
+  // Note: this feature generates 10KB extra code size
437
+  #define AUTO_BED_LEVELING_GRID
438
+
439
+  #ifdef AUTO_BED_LEVELING_GRID
440
+
441
+    // The edges of the rectangle in which to probe
442
+    #define LEFT_PROBE_BED_POSITION 15
443
+    #define RIGHT_PROBE_BED_POSITION 170
444
+    #define FRONT_PROBE_BED_POSITION 20
445
+    #define BACK_PROBE_BED_POSITION 170
446
+
447
+    // Set the number of grid points per dimension
448
+    // You probably don't need more than 3 (squared=9)
449
+    #define AUTO_BED_LEVELING_GRID_POINTS 2
450
+
451
+
452
+  #else  // !AUTO_BED_LEVELING_GRID
453
+
454
+      // Arbitrary points to probe. A simple cross-product
455
+      // is used to estimate the plane of the bed.
456
+      #define ABL_PROBE_PT_1_X 15
457
+      #define ABL_PROBE_PT_1_Y 180
458
+      #define ABL_PROBE_PT_2_X 15
459
+      #define ABL_PROBE_PT_2_Y 20
460
+      #define ABL_PROBE_PT_3_X 170
461
+      #define ABL_PROBE_PT_3_Y 20
462
+
463
+  #endif // AUTO_BED_LEVELING_GRID
464
+
465
+
466
+  // Offsets to the probe relative to the extruder tip (Hotend - Probe)
467
+  // X and Y offsets must be integers
468
+  #define X_PROBE_OFFSET_FROM_EXTRUDER -25     // -left  +right
469
+  #define Y_PROBE_OFFSET_FROM_EXTRUDER -29     // -front +behind
470
+  #define Z_PROBE_OFFSET_FROM_EXTRUDER -12.35  // -below (always!)
471
+
472
+  #define Z_RAISE_BEFORE_HOMING 4       // (in mm) Raise Z before homing (G28) for Probe Clearance.
473
+                                        // Be sure you have this distance over your Z_MAX_POS in case
474
+
475
+  #define XY_TRAVEL_SPEED 8000         // X and Y axis travel speed between probes, in mm/min
476
+
477
+  #define Z_RAISE_BEFORE_PROBING 15    //How much the extruder will be raised before traveling to the first probing point.
478
+  #define Z_RAISE_BETWEEN_PROBINGS 5  //How much the extruder will be raised when traveling from between next probing points
479
+
480
+  //#define Z_PROBE_SLED // turn on if you have a z-probe mounted on a sled like those designed by Charles Bell
481
+  //#define SLED_DOCKING_OFFSET 5 // the extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like.
482
+
483
+  //If defined, the Probe servo will be turned on only during movement and then turned off to avoid jerk
484
+  //The value is the delay to turn the servo off after powered on - depends on the servo speed; 300ms is good value, but you can try lower it.
485
+  // You MUST HAVE the SERVO_ENDSTOPS defined to use here a value higher than zero otherwise your code will not compile.
486
+
487
+//  #define PROBE_SERVO_DEACTIVATION_DELAY 300
488
+
489
+
490
+//If you have enabled the Bed Auto Leveling and are using the same Z Probe for Z Homing,
491
+//it is highly recommended you let this Z_SAFE_HOMING enabled!!!
492
+
493
+  #define Z_SAFE_HOMING   // This feature is meant to avoid Z homing with probe outside the bed area.
494
+                          // When defined, it will:
495
+                          // - Allow Z homing only after X and Y homing AND stepper drivers still enabled
496
+                          // - If stepper drivers timeout, it will need X and Y homing again before Z homing
497
+                          // - Position the probe in a defined XY point before Z Homing when homing all axis (G28)
498
+                          // - Block Z homing only when the probe is outside bed area.
499
+
500
+  #ifdef Z_SAFE_HOMING
501
+
502
+    #define Z_SAFE_HOMING_X_POINT (X_MAX_LENGTH/2)    // X point for Z homing when homing all axis (G28)
503
+    #define Z_SAFE_HOMING_Y_POINT (Y_MAX_LENGTH/2)    // Y point for Z homing when homing all axis (G28)
504
+
505
+  #endif
506
+
507
+#endif // ENABLE_AUTO_BED_LEVELING
508
+
509
+
510
+// @section homing
511
+
512
+// The position of the homing switches
513
+//#define MANUAL_HOME_POSITIONS  // If defined, MANUAL_*_HOME_POS below will be used
514
+//#define BED_CENTER_AT_0_0  // If defined, the center of the bed is at (X=0, Y=0)
515
+
516
+// Manual homing switch locations:
517
+// For deltabots this means top and center of the Cartesian print volume.
518
+#ifdef MANUAL_HOME_POSITIONS
519
+  #define MANUAL_X_HOME_POS 0
520
+  #define MANUAL_Y_HOME_POS 0
521
+  #define MANUAL_Z_HOME_POS 0
522
+  //#define MANUAL_Z_HOME_POS 402 // For delta: Distance between nozzle and print surface after homing.
523
+#endif
524
+
525
+// @section movement
526
+
527
+//// MOVEMENT SETTINGS
528
+#define NUM_AXIS 4 // The axis order in all axis related arrays is X, Y, Z, E
529
+#define HOMING_FEEDRATE {50*60, 50*60, 4*60, 0}  // set the homing speeds (mm/min)
530
+
531
+// default settings
532
+
533
+#define DEFAULT_AXIS_STEPS_PER_UNIT   {78.7402,78.7402,200.0*8/3,760*1.1}  // default steps per unit for Ultimaker
534
+#define DEFAULT_MAX_FEEDRATE          {500, 500, 5, 25}    // (mm/sec)
535
+#define DEFAULT_MAX_ACCELERATION      {9000,9000,100,10000}    // X, Y, Z, E maximum start speed for accelerated moves. E default values are good for Skeinforge 40+, for older versions raise them a lot.
536
+
537
+#define DEFAULT_ACCELERATION          3000    // X, Y, Z and E max acceleration in mm/s^2 for printing moves
538
+#define DEFAULT_RETRACT_ACCELERATION  3000   // X, Y, Z and E max acceleration in mm/s^2 for retracts
539
+
540
+// Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing).
541
+// The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder).
542
+// For the other hotends it is their distance from the extruder 0 hotend.
543
+// #define EXTRUDER_OFFSET_X {0.0, 20.00} // (in mm) for each extruder, offset of the hotend on the X axis
544
+// #define EXTRUDER_OFFSET_Y {0.0, 5.00}  // (in mm) for each extruder, offset of the hotend on the Y axis
545
+
546
+// The speed change that does not require acceleration (i.e. the software might assume it can be done instantaneously)
547
+#define DEFAULT_XYJERK                20.0    // (mm/sec)
548
+#define DEFAULT_ZJERK                 0.4     // (mm/sec)
549
+#define DEFAULT_EJERK                 5.0    // (mm/sec)
550
+
551
+
552
+//=============================================================================
553
+//============================= Additional Features ===========================
554
+//=============================================================================
555
+
556
+// @section more
557
+
558
+// Custom M code points
559
+#define CUSTOM_M_CODES
560
+#ifdef CUSTOM_M_CODES
561
+  #define CUSTOM_M_CODE_SET_Z_PROBE_OFFSET 851
562
+  #define Z_PROBE_OFFSET_RANGE_MIN -15
563
+  #define Z_PROBE_OFFSET_RANGE_MAX -5
564
+#endif
565
+
566
+// @section extras
567
+
568
+// EEPROM
569
+// The microcontroller can store settings in the EEPROM, e.g. max velocity...
570
+// M500 - stores parameters in EEPROM
571
+// M501 - reads parameters from EEPROM (if you need reset them after you changed them temporarily).
572
+// M502 - reverts to the default "factory settings".  You still need to store them in EEPROM afterwards if you want to.
573
+//define this to enable EEPROM support
574
+//#define EEPROM_SETTINGS
575
+//to disable EEPROM Serial responses and decrease program space by ~1700 byte: comment this out:
576
+// please keep turned on if you can.
577
+//#define EEPROM_CHITCHAT
578
+
579
+// @section temperature
580
+
581
+// Preheat Constants
582
+#define PLA_PREHEAT_HOTEND_TEMP 180
583
+#define PLA_PREHEAT_HPB_TEMP 70
584
+#define PLA_PREHEAT_FAN_SPEED 255   // Insert Value between 0 and 255
585
+
586
+#define ABS_PREHEAT_HOTEND_TEMP 240
587
+#define ABS_PREHEAT_HPB_TEMP 100
588
+#define ABS_PREHEAT_FAN_SPEED 255   // Insert Value between 0 and 255
589
+
590
+//==============================LCD and SD support=============================
591
+// @section lcd
592
+
593
+// Define your display language below. Replace (en) with your language code and uncomment.
594
+// en, pl, fr, de, es, ru, it, pt, pt-br, fi, an, nl, ca, eu
595
+// See also language.h
596
+//#define LANGUAGE_INCLUDE GENERATE_LANGUAGE_INCLUDE(en)
597
+
598
+// Character based displays can have different extended charsets.
599
+#define DISPLAY_CHARSET_HD44780_JAPAN     // "ääööüüß23°"
600
+//#define DISPLAY_CHARSET_HD44780_WESTERN // "ÄäÖöÜüß²³°" if you see a '~' instead of a 'arrow_right' at the right of submenuitems - this is the right one.
601
+
602
+//#define ULTRA_LCD  //general LCD support, also 16x2
603
+//#define DOGLCD  // Support for SPI LCD 128x64 (Controller ST7565R graphic Display Family)
604
+//#define SDSUPPORT // Enable SD Card Support in Hardware Console
605
+//#define SDSLOW // Use slower SD transfer mode (not normally needed - uncomment if you're getting volume init error)
606
+//#define SD_CHECK_AND_RETRY // Use CRC checks and retries on the SD communication
607
+//#define ENCODER_PULSES_PER_STEP 1 // Increase if you have a high resolution encoder
608
+//#define ENCODER_STEPS_PER_MENU_ITEM 5 // Set according to ENCODER_PULSES_PER_STEP or your liking
609
+//#define ULTIMAKERCONTROLLER //as available from the Ultimaker online store.
610
+//#define ULTIPANEL  //the UltiPanel as on Thingiverse
611
+//#define LCD_FEEDBACK_FREQUENCY_HZ 1000	// this is the tone frequency the buzzer plays when on UI feedback. ie Screen Click
612
+//#define LCD_FEEDBACK_FREQUENCY_DURATION_MS 100 // the duration the buzzer plays the UI feedback sound. ie Screen Click
613
+
614
+// PanelOne from T3P3 (via RAMPS 1.4 AUX2/AUX3)
615
+// http://reprap.org/wiki/PanelOne
616
+//#define PANEL_ONE
617
+
618
+// The MaKr3d Makr-Panel with graphic controller and SD support
619
+// http://reprap.org/wiki/MaKr3d_MaKrPanel
620
+//#define MAKRPANEL
621
+
622
+// The Panucatt Devices Viki 2.0 and mini Viki with Graphic LCD
623
+// http://panucatt.com
624
+// ==> REMEMBER TO INSTALL U8glib to your ARDUINO library folder: http://code.google.com/p/u8glib/wiki/u8glib
625
+//#define VIKI2
626
+//#define miniVIKI
627
+
628
+// The RepRapDiscount Smart Controller (white PCB)
629
+// http://reprap.org/wiki/RepRapDiscount_Smart_Controller
630
+//#define REPRAP_DISCOUNT_SMART_CONTROLLER
631
+
632
+// The GADGETS3D G3D LCD/SD Controller (blue PCB)
633
+// http://reprap.org/wiki/RAMPS_1.3/1.4_GADGETS3D_Shield_with_Panel
634
+//#define G3D_PANEL
635
+
636
+// The RepRapDiscount FULL GRAPHIC Smart Controller (quadratic white PCB)
637
+// http://reprap.org/wiki/RepRapDiscount_Full_Graphic_Smart_Controller
638
+//
639
+// ==> REMEMBER TO INSTALL U8glib to your ARDUINO library folder: http://code.google.com/p/u8glib/wiki/u8glib
640
+//#define REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER
641
+
642
+// The RepRapWorld REPRAPWORLD_KEYPAD v1.1
643
+// http://reprapworld.com/?products_details&products_id=202&cPath=1591_1626
644
+//#define REPRAPWORLD_KEYPAD
645
+//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // how much should be moved when a key is pressed, eg 10.0 means 10mm per click
646
+
647
+// The Elefu RA Board Control Panel
648
+// http://www.elefu.com/index.php?route=product/product&product_id=53
649
+// REMEMBER TO INSTALL LiquidCrystal_I2C.h in your ARDUINO library folder: https://github.com/kiyoshigawa/LiquidCrystal_I2C
650
+//#define RA_CONTROL_PANEL
651
+
652
+// @section hidden
653
+
654
+//automatic expansion
655
+#if defined (MAKRPANEL)
656
+ #define DOGLCD
657
+ #define SDSUPPORT
658
+ #define ULTIPANEL
659
+ #define NEWPANEL
660
+ #define DEFAULT_LCD_CONTRAST 17
661
+#endif
662
+
663
+#if defined(miniVIKI) || defined(VIKI2)
664
+ #define ULTRA_LCD  //general LCD support, also 16x2
665
+ #define DOGLCD  // Support for SPI LCD 128x64 (Controller ST7565R graphic Display Family)
666
+ #define ULTIMAKERCONTROLLER //as available from the Ultimaker online store.
667
+ 
668
+  #ifdef miniVIKI
669
+   #define DEFAULT_LCD_CONTRAST 95
670
+  #else
671
+   #define DEFAULT_LCD_CONTRAST 40
672
+  #endif
673
+  
674
+ #define ENCODER_PULSES_PER_STEP 4
675
+ #define ENCODER_STEPS_PER_MENU_ITEM 1
676
+#endif
677
+
678
+#if defined (PANEL_ONE)
679
+ #define SDSUPPORT
680
+ #define ULTIMAKERCONTROLLER
681
+#endif
682
+
683
+#if defined (REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER)
684
+ #define DOGLCD
685
+ #define U8GLIB_ST7920
686
+ #define REPRAP_DISCOUNT_SMART_CONTROLLER
687
+#endif
688
+
689
+#if defined(ULTIMAKERCONTROLLER) || defined(REPRAP_DISCOUNT_SMART_CONTROLLER) || defined(G3D_PANEL)
690
+ #define ULTIPANEL
691
+ #define NEWPANEL
692
+#endif
693
+
694
+#if defined(REPRAPWORLD_KEYPAD)
695
+  #define NEWPANEL
696
+  #define ULTIPANEL
697
+#endif
698
+#if defined(RA_CONTROL_PANEL)
699
+ #define ULTIPANEL
700
+ #define NEWPANEL
701
+ #define LCD_I2C_TYPE_PCA8574
702
+ #define LCD_I2C_ADDRESS 0x27   // I2C Address of the port expander
703
+#endif
704
+
705
+//I2C PANELS
706
+
707
+//#define LCD_I2C_SAINSMART_YWROBOT
708
+#ifdef LCD_I2C_SAINSMART_YWROBOT
709
+  // This uses the LiquidCrystal_I2C library ( https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/Home )
710
+  // Make sure it is placed in the Arduino libraries directory.
711
+  #define LCD_I2C_TYPE_PCF8575
712
+  #define LCD_I2C_ADDRESS 0x27   // I2C Address of the port expander
713
+  #define NEWPANEL
714
+  #define ULTIPANEL
715
+#endif
716
+
717
+// PANELOLU2 LCD with status LEDs, separate encoder and click inputs
718
+//#define LCD_I2C_PANELOLU2
719
+#ifdef LCD_I2C_PANELOLU2
720
+  // This uses the LiquidTWI2 library v1.2.3 or later ( https://github.com/lincomatic/LiquidTWI2 )
721
+  // Make sure the LiquidTWI2 directory is placed in the Arduino or Sketchbook libraries subdirectory.
722
+  // (v1.2.3 no longer requires you to define PANELOLU in the LiquidTWI2.h library header file)
723
+  // Note: The PANELOLU2 encoder click input can either be directly connected to a pin
724
+  //       (if BTN_ENC defined to != -1) or read through I2C (when BTN_ENC == -1).
725
+  #define LCD_I2C_TYPE_MCP23017
726
+  #define LCD_I2C_ADDRESS 0x20 // I2C Address of the port expander
727
+  #define LCD_USE_I2C_BUZZER //comment out to disable buzzer on LCD
728
+  #define NEWPANEL
729
+  #define ULTIPANEL
730
+
731
+  #ifndef ENCODER_PULSES_PER_STEP
732
+	#define ENCODER_PULSES_PER_STEP 4
733
+  #endif
734
+
735
+  #ifndef ENCODER_STEPS_PER_MENU_ITEM
736
+	#define ENCODER_STEPS_PER_MENU_ITEM 1
737
+  #endif
738
+
739
+
740
+  #ifdef LCD_USE_I2C_BUZZER
741
+	#define LCD_FEEDBACK_FREQUENCY_HZ 1000
742
+	#define LCD_FEEDBACK_FREQUENCY_DURATION_MS 100
743
+  #endif
744
+
745
+#endif
746
+
747
+// Panucatt VIKI LCD with status LEDs, integrated click & L/R/U/P buttons, separate encoder inputs
748
+//#define LCD_I2C_VIKI
749
+#ifdef LCD_I2C_VIKI
750
+  // This uses the LiquidTWI2 library v1.2.3 or later ( https://github.com/lincomatic/LiquidTWI2 )
751
+  // Make sure the LiquidTWI2 directory is placed in the Arduino or Sketchbook libraries subdirectory.
752
+  // Note: The pause/stop/resume LCD button pin should be connected to the Arduino
753
+  //       BTN_ENC pin (or set BTN_ENC to -1 if not used)
754
+  #define LCD_I2C_TYPE_MCP23017
755
+  #define LCD_I2C_ADDRESS 0x20 // I2C Address of the port expander
756
+  #define LCD_USE_I2C_BUZZER //comment out to disable buzzer on LCD (requires LiquidTWI2 v1.2.3 or later)
757
+  #define NEWPANEL
758
+  #define ULTIPANEL
759
+#endif
760
+
761
+// Shift register panels
762
+// ---------------------
763
+// 2 wire Non-latching LCD SR from:
764
+// https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/schematics#!shiftregister-connection 
765
+
766
+//#define SAV_3DLCD
767
+#ifdef SAV_3DLCD
768
+   #define SR_LCD_2W_NL    // Non latching 2 wire shiftregister
769
+   #define NEWPANEL
770
+   #define ULTIPANEL
771
+#endif
772
+
773
+
774
+#ifdef ULTIPANEL
775
+//  #define NEWPANEL  //enable this if you have a click-encoder panel
776
+  #define SDSUPPORT
777
+  #define ULTRA_LCD
778
+  #ifdef DOGLCD // Change number of lines to match the DOG graphic display
779
+    #define LCD_WIDTH 22
780
+    #define LCD_HEIGHT 5
781
+  #else
782
+    #define LCD_WIDTH 20
783
+    #define LCD_HEIGHT 4
784
+  #endif
785
+#else //no panel but just LCD
786
+  #ifdef ULTRA_LCD
787
+  #ifdef DOGLCD // Change number of lines to match the 128x64 graphics display
788
+    #define LCD_WIDTH 22
789
+    #define LCD_HEIGHT 5
790
+  #else
791
+    #define LCD_WIDTH 16
792
+    #define LCD_HEIGHT 2
793
+  #endif
794
+  #endif
795
+#endif
796
+
797
+// @section lcd
798
+
799
+// default LCD contrast for dogm-like LCD displays
800
+#ifdef DOGLCD
801
+# ifndef DEFAULT_LCD_CONTRAST
802
+#  define DEFAULT_LCD_CONTRAST 32
803
+# endif
804
+#endif
805
+
806
+// @section extras
807
+
808
+// Increase the FAN pwm frequency. Removes the PWM noise but increases heating in the FET/Arduino
809
+//#define FAST_PWM_FAN
810
+
811
+// Temperature status LEDs that display the hotend and bet temperature.
812
+// If all hotends and bed temperature and temperature setpoint are < 54C then the BLUE led is on.
813
+// Otherwise the RED led is on. There is 1C hysteresis.
814
+//#define TEMP_STAT_LEDS
815
+
816
+// Use software PWM to drive the fan, as for the heaters. This uses a very low frequency
817
+// which is not ass annoying as with the hardware PWM. On the other hand, if this frequency
818
+// is too low, you should also increment SOFT_PWM_SCALE.
819
+//#define FAN_SOFT_PWM
820
+
821
+// Incrementing this by 1 will double the software PWM frequency,
822
+// affecting heaters, and the fan if FAN_SOFT_PWM is enabled.
823
+// However, control resolution will be halved for each increment;
824
+// at zero value, there are 128 effective control positions.
825
+#define SOFT_PWM_SCALE 0
826
+
827
+// M240  Triggers a camera by emulating a Canon RC-1 Remote
828
+// Data from: http://www.doc-diy.net/photo/rc-1_hacked/
829
+// #define PHOTOGRAPH_PIN     23
830
+
831
+// SF send wrong arc g-codes when using Arc Point as fillet procedure
832
+//#define SF_ARC_FIX
833
+
834
+// Support for the BariCUDA Paste Extruder.
835
+//#define BARICUDA
836
+
837
+//define BlinkM/CyzRgb Support
838
+//#define BLINKM
839
+
840
+/*********************************************************************\
841
+* R/C SERVO support
842
+* Sponsored by TrinityLabs, Reworked by codexmas
843
+**********************************************************************/
844
+
845
+// Number of servos
846
+//
847
+// If you select a configuration below, this will receive a default value and does not need to be set manually
848
+// set it manually if you have more servos than extruders and wish to manually control some
849
+// leaving it undefined or defining as 0 will disable the servo subsystem
850
+// If unsure, leave commented / disabled
851
+//
852
+//#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command
853
+
854
+// Servo Endstops
855
+//
856
+// This allows for servo actuated endstops, primary usage is for the Z Axis to eliminate calibration or bed height changes.
857
+// Use M206 command to correct for switch height offset to actual nozzle height. Store that setting with M500.
858
+//
859
+//#define SERVO_ENDSTOPS {-1, -1, 0} // Servo index for X, Y, Z. Disable with -1
860
+//#define SERVO_ENDSTOP_ANGLES {0,0, 0,0, 70,0} // X,Y,Z Axis Extend and Retract angles
861
+
862
+/**********************************************************************\
863
+ * Support for a filament diameter sensor
864
+ * Also allows adjustment of diameter at print time (vs  at slicing)
865
+ * Single extruder only at this point (extruder 0)
866
+ * 
867
+ * Motherboards
868
+ * 34 - RAMPS1.4 - uses Analog input 5 on the AUX2 connector 
869
+ * 81 - Printrboard - Uses Analog input 2 on the Exp1 connector (version B,C,D,E)
870
+ * 301 - Rambo  - uses Analog input 3
871
+ * Note may require analog pins to be defined for different motherboards
872
+ **********************************************************************/
873
+// Uncomment below to enable
874
+//#define FILAMENT_SENSOR
875
+
876
+#define FILAMENT_SENSOR_EXTRUDER_NUM	0  //The number of the extruder that has the filament sensor (0,1,2)
877
+#define MEASUREMENT_DELAY_CM			14  //measurement delay in cm.  This is the distance from filament sensor to middle of barrel
878
+
879
+#define DEFAULT_NOMINAL_FILAMENT_DIA  3.0  //Enter the diameter (in mm) of the filament generally used (3.0 mm or 1.75 mm) - this is then used in the slicer software.  Used for sensor reading validation
880
+#define MEASURED_UPPER_LIMIT          3.30  //upper limit factor used for sensor reading validation in mm
881
+#define MEASURED_LOWER_LIMIT          1.90  //lower limit factor for sensor reading validation in mm
882
+#define MAX_MEASUREMENT_DELAY			20  //delay buffer size in bytes (1 byte = 1cm)- limits maximum measurement delay allowable (must be larger than MEASUREMENT_DELAY_CM  and lower number saves RAM)
883
+
884
+//defines used in the code
885
+#define DEFAULT_MEASURED_FILAMENT_DIA  DEFAULT_NOMINAL_FILAMENT_DIA  //set measured to nominal initially 
886
+
887
+//When using an LCD, uncomment the line below to display the Filament sensor data on the last line instead of status.  Status will appear for 5 sec.
888
+//#define FILAMENT_LCD_DISPLAY
889
+
890
+
891
+
892
+
893
+
894
+
895
+#include "Configuration_adv.h"
896
+#include "thermistortables.h"
897
+
898
+#endif //__CONFIGURATION_H

+ 584
- 0
Marlin/configurator/config/Configuration_adv.h 查看文件

@@ -0,0 +1,584 @@
1
+#ifndef CONFIGURATION_ADV_H
2
+#define CONFIGURATION_ADV_H
3
+
4
+// @section temperature
5
+
6
+//===========================================================================
7
+//=============================Thermal Settings  ============================
8
+//===========================================================================
9
+
10
+#ifdef BED_LIMIT_SWITCHING
11
+  #define BED_HYSTERESIS 2 //only disable heating if T>target+BED_HYSTERESIS and enable heating if T>target-BED_HYSTERESIS
12
+#endif
13
+#define BED_CHECK_INTERVAL 5000 //ms between checks in bang-bang control
14
+
15
+//// Heating sanity check:
16
+// This waits for the watch period in milliseconds whenever an M104 or M109 increases the target temperature
17
+// If the temperature has not increased at the end of that period, the target temperature is set to zero.
18
+// It can be reset with another M104/M109. This check is also only triggered if the target temperature and the current temperature
19
+//  differ by at least 2x WATCH_TEMP_INCREASE
20
+//#define WATCH_TEMP_PERIOD 40000 //40 seconds
21
+//#define WATCH_TEMP_INCREASE 10  //Heat up at least 10 degree in 20 seconds
22
+
23
+#ifdef PIDTEMP
24
+  // this adds an experimental additional term to the heating power, proportional to the extrusion speed.
25
+  // if Kc is chosen well, the additional required power due to increased melting should be compensated.
26
+  #define PID_ADD_EXTRUSION_RATE
27
+  #ifdef PID_ADD_EXTRUSION_RATE
28
+    #define  DEFAULT_Kc (1) //heating power=Kc*(e_speed)
29
+  #endif
30
+#endif
31
+
32
+
33
+//automatic temperature: The hot end target temperature is calculated by all the buffered lines of gcode.
34
+//The maximum buffered steps/sec of the extruder motor are called "se".
35
+//You enter the autotemp mode by a M109 S<mintemp> B<maxtemp> F<factor>
36
+// the target temperature is set to mintemp+factor*se[steps/sec] and limited by mintemp and maxtemp
37
+// you exit the value by any M109 without F*
38
+// Also, if the temperature is set to a value <mintemp, it is not changed by autotemp.
39
+// on an Ultimaker, some initial testing worked with M109 S215 B260 F1 in the start.gcode
40
+#define AUTOTEMP
41
+#ifdef AUTOTEMP
42
+  #define AUTOTEMP_OLDWEIGHT 0.98
43
+#endif
44
+
45
+//Show Temperature ADC value
46
+//The M105 command return, besides traditional information, the ADC value read from temperature sensors.
47
+//#define SHOW_TEMP_ADC_VALUES
48
+
49
+// @section extruder
50
+
51
+//  extruder run-out prevention.
52
+//if the machine is idle, and the temperature over MINTEMP, every couple of SECONDS some filament is extruded
53
+//#define EXTRUDER_RUNOUT_PREVENT
54
+#define EXTRUDER_RUNOUT_MINTEMP 190
55
+#define EXTRUDER_RUNOUT_SECONDS 30.
56
+#define EXTRUDER_RUNOUT_ESTEPS 14. //mm filament
57
+#define EXTRUDER_RUNOUT_SPEED 1500.  //extrusion speed
58
+#define EXTRUDER_RUNOUT_EXTRUDE 100
59
+
60
+// @section temperature
61
+
62
+//These defines help to calibrate the AD595 sensor in case you get wrong temperature measurements.
63
+//The measured temperature is defined as "actualTemp = (measuredTemp * TEMP_SENSOR_AD595_GAIN) + TEMP_SENSOR_AD595_OFFSET"
64
+#define TEMP_SENSOR_AD595_OFFSET 0.0
65
+#define TEMP_SENSOR_AD595_GAIN   1.0
66
+
67
+//This is for controlling a fan to cool down the stepper drivers
68
+//it will turn on when any driver is enabled
69
+//and turn off after the set amount of seconds from last driver being disabled again
70
+#define CONTROLLERFAN_PIN -1 //Pin used for the fan to cool controller (-1 to disable)
71
+#define CONTROLLERFAN_SECS 60 //How many seconds, after all motors were disabled, the fan should run
72
+#define CONTROLLERFAN_SPEED 255  // == full speed
73
+
74
+// When first starting the main fan, run it at full speed for the
75
+// given number of milliseconds.  This gets the fan spinning reliably
76
+// before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu)
77
+//#define FAN_KICKSTART_TIME 100
78
+
79
+// @section extruder
80
+
81
+// Extruder cooling fans
82
+// Configure fan pin outputs to automatically turn on/off when the associated
83
+// extruder temperature is above/below EXTRUDER_AUTO_FAN_TEMPERATURE.
84
+// Multiple extruders can be assigned to the same pin in which case
85
+// the fan will turn on when any selected extruder is above the threshold.
86
+#define EXTRUDER_0_AUTO_FAN_PIN -1
87
+#define EXTRUDER_1_AUTO_FAN_PIN -1
88
+#define EXTRUDER_2_AUTO_FAN_PIN -1
89
+#define EXTRUDER_3_AUTO_FAN_PIN -1
90
+#define EXTRUDER_AUTO_FAN_TEMPERATURE 50
91
+#define EXTRUDER_AUTO_FAN_SPEED   255  // == full speed
92
+
93
+
94
+//===========================================================================
95
+//=============================Mechanical Settings===========================
96
+//===========================================================================
97
+
98
+// @section homing
99
+
100
+#define ENDSTOPS_ONLY_FOR_HOMING // If defined the endstops will only be used for homing
101
+
102
+
103
+// @section hidden
104
+
105
+
106
+//// AUTOSET LOCATIONS OF LIMIT SWITCHES
107
+//// Added by ZetaPhoenix 09-15-2012
108
+#ifdef MANUAL_HOME_POSITIONS  // Use manual limit switch locations
109
+  #define X_HOME_POS MANUAL_X_HOME_POS
110
+  #define Y_HOME_POS MANUAL_Y_HOME_POS
111
+  #define Z_HOME_POS MANUAL_Z_HOME_POS
112
+#else //Set min/max homing switch positions based upon homing direction and min/max travel limits
113
+  //X axis
114
+  #if X_HOME_DIR == -1
115
+    #ifdef BED_CENTER_AT_0_0
116
+      #define X_HOME_POS X_MAX_LENGTH * -0.5
117
+    #else
118
+      #define X_HOME_POS X_MIN_POS
119
+    #endif //BED_CENTER_AT_0_0
120
+  #else
121
+    #ifdef BED_CENTER_AT_0_0
122
+      #define X_HOME_POS X_MAX_LENGTH * 0.5
123
+    #else
124
+      #define X_HOME_POS X_MAX_POS
125
+    #endif //BED_CENTER_AT_0_0
126
+  #endif //X_HOME_DIR == -1
127
+
128
+  //Y axis
129
+  #if Y_HOME_DIR == -1
130
+    #ifdef BED_CENTER_AT_0_0
131
+      #define Y_HOME_POS Y_MAX_LENGTH * -0.5
132
+    #else
133
+      #define Y_HOME_POS Y_MIN_POS
134
+    #endif //BED_CENTER_AT_0_0
135
+  #else
136
+    #ifdef BED_CENTER_AT_0_0
137
+      #define Y_HOME_POS Y_MAX_LENGTH * 0.5
138
+    #else
139
+      #define Y_HOME_POS Y_MAX_POS
140
+    #endif //BED_CENTER_AT_0_0
141
+  #endif //Y_HOME_DIR == -1
142
+
143
+  // Z axis
144
+  #if Z_HOME_DIR == -1 //BED_CENTER_AT_0_0 not used
145
+    #define Z_HOME_POS Z_MIN_POS
146
+  #else
147
+    #define Z_HOME_POS Z_MAX_POS
148
+  #endif //Z_HOME_DIR == -1
149
+#endif //End auto min/max positions
150
+//END AUTOSET LOCATIONS OF LIMIT SWITCHES -ZP
151
+
152
+// @section extras
153
+
154
+//#define Z_LATE_ENABLE // Enable Z the last moment. Needed if your Z driver overheats.
155
+
156
+// A single Z stepper driver is usually used to drive 2 stepper motors.
157
+// Uncomment this define to utilize a separate stepper driver for each Z axis motor.
158
+// Only a few motherboards support this, like RAMPS, which have dual extruder support (the 2nd, often unused, extruder driver is used
159
+// to control the 2nd Z axis stepper motor). The pins are currently only defined for a RAMPS motherboards.
160
+// On a RAMPS (or other 5 driver) motherboard, using this feature will limit you to using 1 extruder.
161
+//#define Z_DUAL_STEPPER_DRIVERS
162
+
163
+#ifdef Z_DUAL_STEPPER_DRIVERS
164
+  #undef EXTRUDERS
165
+  #define EXTRUDERS 1
166
+#endif
167
+
168
+// Same again but for Y Axis.
169
+//#define Y_DUAL_STEPPER_DRIVERS
170
+
171
+// Define if the two Y drives need to rotate in opposite directions
172
+#define INVERT_Y2_VS_Y_DIR true
173
+
174
+#ifdef Y_DUAL_STEPPER_DRIVERS
175
+  #undef EXTRUDERS
176
+  #define EXTRUDERS 1
177
+#endif
178
+
179
+#if defined (Z_DUAL_STEPPER_DRIVERS) && defined (Y_DUAL_STEPPER_DRIVERS)
180
+  #error "You cannot have dual drivers for both Y and Z"
181
+#endif
182
+
183
+// Enable this for dual x-carriage printers.
184
+// A dual x-carriage design has the advantage that the inactive extruder can be parked which
185
+// prevents hot-end ooze contaminating the print. It also reduces the weight of each x-carriage
186
+// allowing faster printing speeds.
187
+//#define DUAL_X_CARRIAGE
188
+#ifdef DUAL_X_CARRIAGE
189
+// Configuration for second X-carriage
190
+// Note: the first x-carriage is defined as the x-carriage which homes to the minimum endstop;
191
+// the second x-carriage always homes to the maximum endstop.
192
+#define X2_MIN_POS 80     // set minimum to ensure second x-carriage doesn't hit the parked first X-carriage
193
+#define X2_MAX_POS 353    // set maximum to the distance between toolheads when both heads are homed
194
+#define X2_HOME_DIR 1     // the second X-carriage always homes to the maximum endstop position
195
+#define X2_HOME_POS X2_MAX_POS // default home position is the maximum carriage position
196
+    // However: In this mode the EXTRUDER_OFFSET_X value for the second extruder provides a software
197
+    // override for X2_HOME_POS. This also allow recalibration of the distance between the two endstops
198
+    // without modifying the firmware (through the "M218 T1 X???" command).
199
+    // Remember: you should set the second extruder x-offset to 0 in your slicer.
200
+
201
+// Pins for second x-carriage stepper driver (defined here to avoid further complicating pins.h)
202
+#define X2_ENABLE_PIN 29
203
+#define X2_STEP_PIN 25
204
+#define X2_DIR_PIN 23
205
+
206
+// There are a few selectable movement modes for dual x-carriages using M605 S<mode>
207
+//    Mode 0: Full control. The slicer has full control over both x-carriages and can achieve optimal travel results
208
+//                           as long as it supports dual x-carriages. (M605 S0)
209
+//    Mode 1: Auto-park mode. The firmware will automatically park and unpark the x-carriages on tool changes so
210
+//                           that additional slicer support is not required. (M605 S1)
211
+//    Mode 2: Duplication mode. The firmware will transparently make the second x-carriage and extruder copy all
212
+//                           actions of the first x-carriage. This allows the printer to print 2 arbitrary items at
213
+//                           once. (2nd extruder x offset and temp offset are set using: M605 S2 [Xnnn] [Rmmm])
214
+
215
+// This is the default power-up mode which can be later using M605.
216
+#define DEFAULT_DUAL_X_CARRIAGE_MODE 0
217
+
218
+// Default settings in "Auto-park Mode"
219
+#define TOOLCHANGE_PARK_ZLIFT   0.2      // the distance to raise Z axis when parking an extruder
220
+#define TOOLCHANGE_UNPARK_ZLIFT 1        // the distance to raise Z axis when unparking an extruder
221
+
222
+// Default x offset in duplication mode (typically set to half print bed width)
223
+#define DEFAULT_DUPLICATION_X_OFFSET 100
224
+
225
+#endif //DUAL_X_CARRIAGE
226
+
227
+// @section homing
228
+
229
+//homing hits the endstop, then retracts by this distance, before it tries to slowly bump again:
230
+#define X_HOME_RETRACT_MM 5
231
+#define Y_HOME_RETRACT_MM 5
232
+#define Z_HOME_RETRACT_MM 2
233
+//#define QUICK_HOME  //if this is defined, if both x and y are to be homed, a diagonal move will be performed initially.
234
+
235
+// @section machine
236
+
237
+#define AXIS_RELATIVE_MODES {false, false, false, false}
238
+
239
+// @section hidden
240
+
241
+#ifdef CONFIG_STEPPERS_TOSHIBA
242
+  #define MAX_STEP_FREQUENCY 10000 // Max step frequency for Toshiba Stepper Controllers
243
+#else
244
+  #define MAX_STEP_FREQUENCY 40000 // Max step frequency for Ultimaker (5000 pps / half step)
245
+#endif
246
+
247
+// @section machine
248
+
249
+//By default pololu step drivers require an active high signal. However, some high power drivers require an active low signal as step.
250
+#define INVERT_X_STEP_PIN false
251
+#define INVERT_Y_STEP_PIN false
252
+#define INVERT_Z_STEP_PIN false
253
+#define INVERT_E_STEP_PIN false
254
+
255
+//default stepper release if idle. Set to 0 to deactivate.
256
+#define DEFAULT_STEPPER_DEACTIVE_TIME 60
257
+
258
+#define DEFAULT_MINIMUMFEEDRATE       0.0     // minimum feedrate
259
+#define DEFAULT_MINTRAVELFEEDRATE     0.0
260
+
261
+// @section lcd
262
+
263
+// Feedrates for manual moves along X, Y, Z, E from panel
264
+#ifdef ULTIPANEL
265
+#define MANUAL_FEEDRATE {50*60, 50*60, 4*60, 60}  // set the speeds for manual moves (mm/min)
266
+#endif
267
+
268
+//Comment to disable setting feedrate multiplier via encoder
269
+#ifdef ULTIPANEL
270
+    #define ULTIPANEL_FEEDMULTIPLY
271
+#endif
272
+
273
+// @section extras
274
+
275
+// minimum time in microseconds that a movement needs to take if the buffer is emptied.
276
+#define DEFAULT_MINSEGMENTTIME        20000
277
+
278
+// If defined the movements slow down when the look ahead buffer is only half full
279
+#define SLOWDOWN
280
+
281
+// Frequency limit
282
+// See nophead's blog for more info
283
+// Not working O
284
+//#define XY_FREQUENCY_LIMIT  15
285
+
286
+// Minimum planner junction speed. Sets the default minimum speed the planner plans for at the end
287
+// of the buffer and all stops. This should not be much greater than zero and should only be changed
288
+// if unwanted behavior is observed on a user's machine when running at very slow speeds.
289
+#define MINIMUM_PLANNER_SPEED 0.05// (mm/sec)
290
+
291
+// MS1 MS2 Stepper Driver Microstepping mode table
292
+#define MICROSTEP1 LOW,LOW
293
+#define MICROSTEP2 HIGH,LOW
294
+#define MICROSTEP4 LOW,HIGH
295
+#define MICROSTEP8 HIGH,HIGH
296
+#define MICROSTEP16 HIGH,HIGH
297
+
298
+// Microstep setting (Only functional when stepper driver microstep pins are connected to MCU.
299
+#define MICROSTEP_MODES {16,16,16,16,16} // [1,2,4,8,16]
300
+
301
+// Motor Current setting (Only functional when motor driver current ref pins are connected to a digital trimpot on supported boards)
302
+#define DIGIPOT_MOTOR_CURRENT {135,135,135,135,135} // Values 0-255 (RAMBO 135 = ~0.75A, 185 = ~1A)
303
+
304
+// uncomment to enable an I2C based DIGIPOT like on the Azteeg X3 Pro
305
+//#define DIGIPOT_I2C
306
+// Number of channels available for I2C digipot, For Azteeg X3 Pro we have 8
307
+#define DIGIPOT_I2C_NUM_CHANNELS 8
308
+// actual motor currents in Amps, need as many here as DIGIPOT_I2C_NUM_CHANNELS
309
+#define DIGIPOT_I2C_MOTOR_CURRENTS {1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0}
310
+
311
+//===========================================================================
312
+//=============================Additional Features===========================
313
+//===========================================================================
314
+
315
+#define ENCODER_RATE_MULTIPLIER         // If defined, certain menu edit operations automatically multiply the steps when the encoder is moved quickly
316
+#define ENCODER_10X_STEPS_PER_SEC 75    // If the encoder steps per sec exceed this value, multiple the steps moved by ten to quickly advance the value
317
+#define ENCODER_100X_STEPS_PER_SEC 160  // If the encoder steps per sec exceed this value, multiple the steps moved by 100 to really quickly advance the value
318
+//#define ENCODER_RATE_MULTIPLIER_DEBUG  // If defined, output the encoder steps per second value
319
+
320
+//#define CHDK 4        //Pin for triggering CHDK to take a picture see how to use it here http://captain-slow.dk/2014/03/09/3d-printing-timelapses/
321
+#define CHDK_DELAY 50 //How long in ms the pin should stay HIGH before going LOW again
322
+
323
+// @section lcd
324
+
325
+#define SD_FINISHED_STEPPERRELEASE true  //if sd support and the file is finished: disable steppers?
326
+#define SD_FINISHED_RELEASECOMMAND "M84 X Y Z E" // You might want to keep the z enabled so your bed stays in place.
327
+
328
+#define SDCARD_RATHERRECENTFIRST  //reverse file order of sd card menu display. Its sorted practically after the file system block order.
329
+// if a file is deleted, it frees a block. hence, the order is not purely chronological. To still have auto0.g accessible, there is again the option to do that.
330
+// using:
331
+//#define MENU_ADDAUTOSTART
332
+
333
+// Show a progress bar on HD44780 LCDs for SD printing
334
+//#define LCD_PROGRESS_BAR
335
+
336
+#ifdef LCD_PROGRESS_BAR
337
+  // Amount of time (ms) to show the bar
338
+  #define PROGRESS_BAR_BAR_TIME 2000
339
+  // Amount of time (ms) to show the status message
340
+  #define PROGRESS_BAR_MSG_TIME 3000
341
+  // Amount of time (ms) to retain the status message (0=forever)
342
+  #define PROGRESS_MSG_EXPIRE   0
343
+  // Enable this to show messages for MSG_TIME then hide them
344
+  //#define PROGRESS_MSG_ONCE
345
+  #ifdef DOGLCD
346
+    #warning LCD_PROGRESS_BAR does not apply to graphical displays at this time.
347
+  #endif
348
+  #ifdef FILAMENT_LCD_DISPLAY
349
+    #error LCD_PROGRESS_BAR and FILAMENT_LCD_DISPLAY are not fully compatible. Comment out this line to use both.
350
+  #endif
351
+#endif
352
+
353
+// @section more
354
+
355
+// The hardware watchdog should reset the microcontroller disabling all outputs, in case the firmware gets stuck and doesn't do temperature regulation.
356
+//#define USE_WATCHDOG
357
+
358
+#ifdef USE_WATCHDOG
359
+// If you have a watchdog reboot in an ArduinoMega2560 then the device will hang forever, as a watchdog reset will leave the watchdog on.
360
+// The "WATCHDOG_RESET_MANUAL" goes around this by not using the hardware reset.
361
+//  However, THIS FEATURE IS UNSAFE!, as it will only work if interrupts are disabled. And the code could hang in an interrupt routine with interrupts disabled.
362
+//#define WATCHDOG_RESET_MANUAL
363
+#endif
364
+
365
+// Enable the option to stop SD printing when hitting and endstops, needs to be enabled from the LCD menu when this option is enabled.
366
+//#define ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED
367
+
368
+// Babystepping enables the user to control the axis in tiny amounts, independently from the normal printing process
369
+// it can e.g. be used to change z-positions in the print startup phase in real-time
370
+// does not respect endstops!
371
+//#define BABYSTEPPING
372
+#ifdef BABYSTEPPING
373
+  #define BABYSTEP_XY  //not only z, but also XY in the menu. more clutter, more functions
374
+  #define BABYSTEP_INVERT_Z false  //true for inverse movements in Z
375
+  #define BABYSTEP_Z_MULTIPLICATOR 2 //faster z movements
376
+
377
+  #ifdef COREXY
378
+    #error BABYSTEPPING not implemented for COREXY yet.
379
+  #endif
380
+
381
+  #ifdef DELTA
382
+    #ifdef BABYSTEP_XY
383
+      #error BABYSTEPPING only implemented for Z axis on deltabots.
384
+    #endif
385
+  #endif
386
+#endif
387
+
388
+// extruder advance constant (s2/mm3)
389
+//
390
+// advance (steps) = STEPS_PER_CUBIC_MM_E * EXTRUDER_ADVANCE_K * cubic mm per second ^ 2
391
+//
392
+// Hooke's law says:		force = k * distance
393
+// Bernoulli's principle says:	v ^ 2 / 2 + g . h + pressure / density = constant
394
+// so: v ^ 2 is proportional to number of steps we advance the extruder
395
+//#define ADVANCE
396
+
397
+#ifdef ADVANCE
398
+  #define EXTRUDER_ADVANCE_K .0
399
+
400
+  #define D_FILAMENT 2.85
401
+  #define STEPS_MM_E 836
402
+  #define EXTRUSION_AREA (0.25 * D_FILAMENT * D_FILAMENT * 3.14159)
403
+  #define STEPS_PER_CUBIC_MM_E (axis_steps_per_unit[E_AXIS]/ EXTRUSION_AREA)
404
+
405
+#endif // ADVANCE
406
+
407
+// Arc interpretation settings:
408
+#define MM_PER_ARC_SEGMENT 1
409
+#define N_ARC_CORRECTION 25
410
+
411
+const unsigned int dropsegments=5; //everything with less than this number of steps will be ignored as move and joined with the next movement
412
+
413
+// @section lcd
414
+
415
+// If you are using a RAMPS board or cheap E-bay purchased boards that do not detect when an SD card is inserted
416
+// You can get round this by connecting a push button or single throw switch to the pin defined as SDCARDCARDDETECT
417
+// in the pins.h file.  When using a push button pulling the pin to ground this will need inverted.  This setting should
418
+// be commented out otherwise
419
+#define SDCARDDETECTINVERTED
420
+
421
+// @section hidden
422
+
423
+#ifdef ULTIPANEL
424
+ #undef SDCARDDETECTINVERTED
425
+#endif
426
+
427
+// Power Signal Control Definitions
428
+// By default use ATX definition
429
+#ifndef POWER_SUPPLY
430
+  #define POWER_SUPPLY 1
431
+#endif
432
+// 1 = ATX
433
+#if (POWER_SUPPLY == 1)
434
+  #define PS_ON_AWAKE  LOW
435
+  #define PS_ON_ASLEEP HIGH
436
+#endif
437
+// 2 = X-Box 360 203W
438
+#if (POWER_SUPPLY == 2)
439
+  #define PS_ON_AWAKE  HIGH
440
+  #define PS_ON_ASLEEP LOW
441
+#endif
442
+
443
+// @section temperature
444
+
445
+// Control heater 0 and heater 1 in parallel.
446
+//#define HEATERS_PARALLEL
447
+
448
+//===========================================================================
449
+//=============================Buffers           ============================
450
+//===========================================================================
451
+
452
+// @section hidden
453
+
454
+// The number of linear motions that can be in the plan at any give time.
455
+// THE BLOCK_BUFFER_SIZE NEEDS TO BE A POWER OF 2, i.g. 8,16,32 because shifts and ors are used to do the ring-buffering.
456
+#if defined SDSUPPORT
457
+  #define BLOCK_BUFFER_SIZE 16   // SD,LCD,Buttons take more memory, block buffer needs to be smaller
458
+#else
459
+  #define BLOCK_BUFFER_SIZE 16 // maximize block buffer
460
+#endif
461
+
462
+// @section more
463
+
464
+//The ASCII buffer for receiving from the serial:
465
+#define MAX_CMD_SIZE 96
466
+#define BUFSIZE 4
467
+
468
+// @section extras
469
+
470
+// Firmware based and LCD controlled retract
471
+// M207 and M208 can be used to define parameters for the retraction.
472
+// The retraction can be called by the slicer using G10 and G11
473
+// until then, intended retractions can be detected by moves that only extrude and the direction.
474
+// the moves are than replaced by the firmware controlled ones.
475
+
476
+// #define FWRETRACT  //ONLY PARTIALLY TESTED
477
+#ifdef FWRETRACT
478
+  #define MIN_RETRACT 0.1                //minimum extruded mm to accept a automatic gcode retraction attempt
479
+  #define RETRACT_LENGTH 3               //default retract length (positive mm)
480
+  #define RETRACT_LENGTH_SWAP 13         //default swap retract length (positive mm), for extruder change
481
+  #define RETRACT_FEEDRATE 45            //default feedrate for retracting (mm/s)
482
+  #define RETRACT_ZLIFT 0                //default retract Z-lift
483
+  #define RETRACT_RECOVER_LENGTH 0       //default additional recover length (mm, added to retract length when recovering)
484
+  #define RETRACT_RECOVER_LENGTH_SWAP 0  //default additional swap recover length (mm, added to retract length when recovering from extruder change)
485
+  #define RETRACT_RECOVER_FEEDRATE 8     //default feedrate for recovering from retraction (mm/s)
486
+#endif
487
+
488
+//adds support for experimental filament exchange support M600; requires display
489
+#ifdef ULTIPANEL
490
+  #define FILAMENTCHANGEENABLE
491
+  #ifdef FILAMENTCHANGEENABLE
492
+    #define FILAMENTCHANGE_XPOS 3
493
+    #define FILAMENTCHANGE_YPOS 3
494
+    #define FILAMENTCHANGE_ZADD 10
495
+    #define FILAMENTCHANGE_FIRSTRETRACT -2
496
+    #define FILAMENTCHANGE_FINALRETRACT -100
497
+  #endif
498
+#endif
499
+
500
+#ifdef FILAMENTCHANGEENABLE
501
+  #ifdef EXTRUDER_RUNOUT_PREVENT
502
+    #error EXTRUDER_RUNOUT_PREVENT currently incompatible with FILAMENTCHANGE
503
+  #endif
504
+#endif
505
+
506
+//===========================================================================
507
+//=============================  Define Defines  ============================
508
+//===========================================================================
509
+
510
+// @section hidden
511
+
512
+#if defined (ENABLE_AUTO_BED_LEVELING) && defined (DELTA)
513
+  #error "Bed Auto Leveling is still not compatible with Delta Kinematics."
514
+#endif
515
+
516
+#if EXTRUDERS > 1 && defined TEMP_SENSOR_1_AS_REDUNDANT
517
+  #error "You cannot use TEMP_SENSOR_1_AS_REDUNDANT if EXTRUDERS > 1"
518
+#endif
519
+
520
+#if EXTRUDERS > 1 && defined HEATERS_PARALLEL
521
+  #error "You cannot use HEATERS_PARALLEL if EXTRUDERS > 1"
522
+#endif
523
+
524
+#if TEMP_SENSOR_0 > 0
525
+  #define THERMISTORHEATER_0 TEMP_SENSOR_0
526
+  #define HEATER_0_USES_THERMISTOR
527
+#endif
528
+#if TEMP_SENSOR_1 > 0
529
+  #define THERMISTORHEATER_1 TEMP_SENSOR_1
530
+  #define HEATER_1_USES_THERMISTOR
531
+#endif
532
+#if TEMP_SENSOR_2 > 0
533
+  #define THERMISTORHEATER_2 TEMP_SENSOR_2
534
+  #define HEATER_2_USES_THERMISTOR
535
+#endif
536
+#if TEMP_SENSOR_3 > 0
537
+  #define THERMISTORHEATER_3 TEMP_SENSOR_3
538
+  #define HEATER_3_USES_THERMISTOR
539
+#endif
540
+#if TEMP_SENSOR_BED > 0
541
+  #define THERMISTORBED TEMP_SENSOR_BED
542
+  #define BED_USES_THERMISTOR
543
+#endif
544
+#if TEMP_SENSOR_0 == -1
545
+  #define HEATER_0_USES_AD595
546
+#endif
547
+#if TEMP_SENSOR_1 == -1
548
+  #define HEATER_1_USES_AD595
549
+#endif
550
+#if TEMP_SENSOR_2 == -1
551
+  #define HEATER_2_USES_AD595
552
+#endif
553
+#if TEMP_SENSOR_3 == -1
554
+  #define HEATER_3_USES_AD595
555
+#endif
556
+#if TEMP_SENSOR_BED == -1
557
+  #define BED_USES_AD595
558
+#endif
559
+#if TEMP_SENSOR_0 == -2
560
+  #define HEATER_0_USES_MAX6675
561
+#endif
562
+#if TEMP_SENSOR_0 == 0
563
+  #undef HEATER_0_MINTEMP
564
+  #undef HEATER_0_MAXTEMP
565
+#endif
566
+#if TEMP_SENSOR_1 == 0
567
+  #undef HEATER_1_MINTEMP
568
+  #undef HEATER_1_MAXTEMP
569
+#endif
570
+#if TEMP_SENSOR_2 == 0
571
+  #undef HEATER_2_MINTEMP
572
+  #undef HEATER_2_MAXTEMP
573
+#endif
574
+#if TEMP_SENSOR_3 == 0
575
+  #undef HEATER_3_MINTEMP
576
+  #undef HEATER_3_MAXTEMP
577
+#endif
578
+#if TEMP_SENSOR_BED == 0
579
+  #undef BED_MINTEMP
580
+  #undef BED_MAXTEMP
581
+#endif
582
+
583
+
584
+#endif //__CONFIGURATION_ADV_H

+ 1
- 0
Marlin/configurator/config/_htaccess 查看文件

@@ -0,0 +1 @@
1
+Header set Access-Control-Allow-Origin "*"

+ 59
- 0
Marlin/configurator/config/boards.h 查看文件

@@ -0,0 +1,59 @@
1
+#ifndef BOARDS_H
2
+#define BOARDS_H
3
+
4
+#define BOARD_UNKNOWN -1
5
+
6
+#define BOARD_GEN7_CUSTOM       10   // Gen7 custom (Alfons3 Version) "https://github.com/Alfons3/Generation_7_Electronics"
7
+#define BOARD_GEN7_12           11   // Gen7 v1.1, v1.2
8
+#define BOARD_GEN7_13           12   // Gen7 v1.3
9
+#define BOARD_GEN7_14           13   // Gen7 v1.4
10
+#define BOARD_CHEAPTRONIC       2    // Cheaptronic v1.0
11
+#define BOARD_SETHI             20   // Sethi 3D_1
12
+#define BOARD_RAMPS_OLD         3    // MEGA/RAMPS up to 1.2
13
+#define BOARD_RAMPS_13_EFB      33   // RAMPS 1.3 / 1.4 (Extruder, Fan, Bed)
14
+#define BOARD_RAMPS_13_EEB      34   // RAMPS 1.3 / 1.4 (Extruder0, Extruder1, Bed)
15
+#define BOARD_RAMPS_13_EFF      35   // RAMPS 1.3 / 1.4 (Extruder, Fan, Fan)
16
+#define BOARD_RAMPS_13_EEF      36   // RAMPS 1.3 / 1.4 (Extruder0, Extruder1, Fan)
17
+#define BOARD_DUEMILANOVE_328P  4    // Duemilanove w/ ATMega328P pin assignments
18
+#define BOARD_GEN6              5    // Gen6
19
+#define BOARD_GEN6_DELUXE       51   // Gen6 deluxe
20
+#define BOARD_SANGUINOLOLU_11   6    // Sanguinololu < 1.2
21
+#define BOARD_SANGUINOLOLU_12   62   // Sanguinololu 1.2 and above
22
+#define BOARD_MELZI             63   // Melzi
23
+#define BOARD_STB_11            64   // STB V1.1
24
+#define BOARD_AZTEEG_X1         65   // Azteeg X1
25
+#define BOARD_MELZI_1284        66   // Melzi with ATmega1284 (MaKr3d version)
26
+#define BOARD_AZTEEG_X3         67   // Azteeg X3
27
+#define BOARD_AZTEEG_X3_PRO     68   // Azteeg X3 Pro
28
+#define BOARD_ULTIMAKER         7    // Ultimaker
29
+#define BOARD_ULTIMAKER_OLD     71   // Ultimaker (Older electronics. Pre 1.5.4. This is rare)
30
+#define BOARD_ULTIMAIN_2        72   // Ultimainboard 2.x (Uses TEMP_SENSOR 20)
31
+#define BOARD_3DRAG             77   // 3Drag
32
+#define BOARD_K8200             78   // Vellemann K8200 (derived from 3Drag)
33
+#define BOARD_TEENSYLU          8    // Teensylu
34
+#define BOARD_RUMBA             80   // Rumba
35
+#define BOARD_PRINTRBOARD       81   // Printrboard (AT90USB1286)
36
+#define BOARD_BRAINWAVE         82   // Brainwave (AT90USB646)
37
+#define BOARD_SAV_MKI           83   // SAV Mk-I (AT90USB1286)
38
+#define BOARD_TEENSY2           84   // Teensy++2.0 (AT90USB1286) - CLI compile: DEFINES=AT90USBxx_TEENSYPP_ASSIGNMENTS HARDWARE_MOTHERBOARD=84  make
39
+#define BOARD_GEN3_PLUS         9    // Gen3+
40
+#define BOARD_GEN3_MONOLITHIC   22   // Gen3 Monolithic Electronics
41
+#define BOARD_MEGATRONICS       70   // Megatronics
42
+#define BOARD_MEGATRONICS_2     701  // Megatronics v2.0
43
+#define BOARD_MEGATRONICS_1     702  // Minitronics v1.0
44
+#define BOARD_MEGATRONICS_3     703  // Megatronics v3.0
45
+#define BOARD_OMCA_A            90   // Alpha OMCA board
46
+#define BOARD_OMCA              91   // Final OMCA board
47
+#define BOARD_RAMBO             301  // Rambo
48
+#define BOARD_ELEFU_3           21   // Elefu Ra Board (v3)
49
+#define BOARD_5DPRINT           88   // 5DPrint D8 Driver Board
50
+#define BOARD_LEAPFROG          999  // Leapfrog
51
+#define BOARD_WITBOX            41   // bq WITBOX
52
+#define BOARD_HEPHESTOS         42   // bq Prusa i3 Hephestos
53
+
54
+#define BOARD_99                99   // This is in pins.h but...?
55
+
56
+#define MB(board) (MOTHERBOARD==BOARD_##board)
57
+#define IS_RAMPS (MB(RAMPS_OLD) || MB(RAMPS_13_EFB) || MB(RAMPS_13_EEB) || MB(RAMPS_13_EFF) || MB(RAMPS_13_EEF))
58
+
59
+#endif //__BOARDS_H

+ 228
- 0
Marlin/configurator/config/language.h 查看文件

@@ -0,0 +1,228 @@
1
+#ifndef LANGUAGE_H
2
+#define LANGUAGE_H
3
+
4
+#include "Configuration.h"
5
+
6
+#define LANGUAGE_CONCAT(M)       #M
7
+#define GENERATE_LANGUAGE_INCLUDE(M)  LANGUAGE_CONCAT(language_##M.h)
8
+
9
+
10
+// NOTE: IF YOU CHANGE LANGUAGE FILES OR MERGE A FILE WITH CHANGES
11
+//
12
+//   ==> ALWAYS TRY TO COMPILE MARLIN WITH/WITHOUT "ULTIPANEL" / "ULTRALCD" / "SDSUPPORT" #define IN "Configuration.h"
13
+//   ==> ALSO TRY ALL AVAILABLE LANGUAGE OPTIONS
14
+
15
+// Languages
16
+// en    English
17
+// pl    Polish
18
+// fr    French
19
+// de    German
20
+// es    Spanish
21
+// ru    Russian
22
+// it    Italian
23
+// pt    Portuguese
24
+// pt-br Portuguese (Brazil)
25
+// fi    Finnish
26
+// an    Aragonese
27
+// nl    Dutch
28
+// ca    Catalan
29
+// eu    Basque-Euskera
30
+
31
+#ifndef LANGUAGE_INCLUDE
32
+  // pick your language from the list above
33
+  #define LANGUAGE_INCLUDE GENERATE_LANGUAGE_INCLUDE(en)
34
+#endif
35
+
36
+#define PROTOCOL_VERSION "1.0"
37
+#define FIRMWARE_URL "https://github.com/MarlinFirmware/Marlin"
38
+
39
+#if MB(ULTIMAKER)|| MB(ULTIMAKER_OLD)|| MB(ULTIMAIN_2)
40
+  #define MACHINE_NAME "Ultimaker"
41
+  #define FIRMWARE_URL "http://firmware.ultimaker.com"
42
+#elif MB(RUMBA)
43
+  #define MACHINE_NAME "Rumba"
44
+#elif MB(3DRAG)
45
+  #define MACHINE_NAME "3Drag"
46
+  #define FIRMWARE_URL "http://3dprint.elettronicain.it/"
47
+#elif MB(K8200)
48
+  #define MACHINE_NAME "K8200"
49
+#elif MB(5DPRINT)
50
+  #define MACHINE_NAME "Makibox"
51
+#elif MB(SAV_MKI)
52
+  #define MACHINE_NAME "SAV MkI"
53
+  #define FIRMWARE_URL "https://github.com/fmalpartida/Marlin/tree/SAV-MkI-config"
54
+#elif MB(WITBOX)
55
+  #define MACHINE_NAME "WITBOX"
56
+  #define FIRMWARE_URL "http://www.bq.com/gb/downloads-witbox.html"
57
+#elif MB(HEPHESTOS)
58
+  #define MACHINE_NAME "HEPHESTOS"
59
+  #define FIRMWARE_URL "http://www.bq.com/gb/downloads-prusa-i3-hephestos.html"
60
+#else // Default firmware set to Mendel
61
+  #define MACHINE_NAME "Mendel"
62
+#endif
63
+
64
+#ifdef CUSTOM_MENDEL_NAME
65
+  #define MACHINE_NAME CUSTOM_MENDEL_NAME
66
+#endif
67
+
68
+#ifndef MACHINE_UUID
69
+   #define MACHINE_UUID "00000000-0000-0000-0000-000000000000"
70
+#endif
71
+
72
+
73
+#define STRINGIFY_(n) #n
74
+#define STRINGIFY(n) STRINGIFY_(n)
75
+
76
+
77
+// Common LCD messages
78
+
79
+  /* nothing here yet */
80
+
81
+// Common serial messages
82
+#define MSG_MARLIN "Marlin"
83
+
84
+// Serial Console Messages (do not translate those!)
85
+
86
+#define MSG_Enqueing                        "enqueing \""
87
+#define MSG_POWERUP                         "PowerUp"
88
+#define MSG_EXTERNAL_RESET                  " External Reset"
89
+#define MSG_BROWNOUT_RESET                  " Brown out Reset"
90
+#define MSG_WATCHDOG_RESET                  " Watchdog Reset"
91
+#define MSG_SOFTWARE_RESET                  " Software Reset"
92
+#define MSG_AUTHOR                          " | Author: "
93
+#define MSG_CONFIGURATION_VER               " Last Updated: "
94
+#define MSG_FREE_MEMORY                     " Free Memory: "
95
+#define MSG_PLANNER_BUFFER_BYTES            "  PlannerBufferBytes: "
96
+#define MSG_OK                              "ok"
97
+#define MSG_FILE_SAVED                      "Done saving file."
98
+#define MSG_ERR_LINE_NO                     "Line Number is not Last Line Number+1, Last Line: "
99
+#define MSG_ERR_CHECKSUM_MISMATCH           "checksum mismatch, Last Line: "
100
+#define MSG_ERR_NO_CHECKSUM                 "No Checksum with line number, Last Line: "
101
+#define MSG_ERR_NO_LINENUMBER_WITH_CHECKSUM "No Line Number with checksum, Last Line: "
102
+#define MSG_FILE_PRINTED                    "Done printing file"
103
+#define MSG_BEGIN_FILE_LIST                 "Begin file list"
104
+#define MSG_END_FILE_LIST                   "End file list"
105
+#define MSG_M104_INVALID_EXTRUDER           "M104 Invalid extruder "
106
+#define MSG_M105_INVALID_EXTRUDER           "M105 Invalid extruder "
107
+#define MSG_M200_INVALID_EXTRUDER           "M200 Invalid extruder "
108
+#define MSG_M218_INVALID_EXTRUDER           "M218 Invalid extruder "
109
+#define MSG_M221_INVALID_EXTRUDER           "M221 Invalid extruder "
110
+#define MSG_ERR_NO_THERMISTORS              "No thermistors - no temperature"
111
+#define MSG_M109_INVALID_EXTRUDER           "M109 Invalid extruder "
112
+#define MSG_HEATING                         "Heating..."
113
+#define MSG_HEATING_COMPLETE                "Heating done."
114
+#define MSG_BED_HEATING                     "Bed Heating."
115
+#define MSG_BED_DONE                        "Bed done."
116
+#define MSG_M115_REPORT                     "FIRMWARE_NAME:Marlin V1; Sprinter/grbl mashup for gen6 FIRMWARE_URL:" FIRMWARE_URL " PROTOCOL_VERSION:" PROTOCOL_VERSION " MACHINE_TYPE:" MACHINE_NAME " EXTRUDER_COUNT:" STRINGIFY(EXTRUDERS) " UUID:" MACHINE_UUID "\n"
117
+#define MSG_COUNT_X                         " Count X: "
118
+#define MSG_ERR_KILLED                      "Printer halted. kill() called!"
119
+#define MSG_ERR_STOPPED                     "Printer stopped due to errors. Fix the error and use M999 to restart. (Temperature is reset. Set it after restarting)"
120
+#define MSG_RESEND                          "Resend: "
121
+#define MSG_UNKNOWN_COMMAND                 "Unknown command: \""
122
+#define MSG_ACTIVE_EXTRUDER                 "Active Extruder: "
123
+#define MSG_INVALID_EXTRUDER                "Invalid extruder"
124
+#define MSG_X_MIN                           "x_min: "
125
+#define MSG_X_MAX                           "x_max: "
126
+#define MSG_Y_MIN                           "y_min: "
127
+#define MSG_Y_MAX                           "y_max: "
128
+#define MSG_Z_MIN                           "z_min: "
129
+#define MSG_Z_MAX                           "z_max: "
130
+#define MSG_M119_REPORT                     "Reporting endstop status"
131
+#define MSG_ENDSTOP_HIT                     "TRIGGERED"
132
+#define MSG_ENDSTOP_OPEN                    "open"
133
+#define MSG_HOTEND_OFFSET                   "Hotend offsets:"
134
+
135
+#define MSG_SD_CANT_OPEN_SUBDIR             "Cannot open subdir"
136
+#define MSG_SD_INIT_FAIL                    "SD init fail"
137
+#define MSG_SD_VOL_INIT_FAIL                "volume.init failed"
138
+#define MSG_SD_OPENROOT_FAIL                "openRoot failed"
139
+#define MSG_SD_CARD_OK                      "SD card ok"
140
+#define MSG_SD_WORKDIR_FAIL                 "workDir open failed"
141
+#define MSG_SD_OPEN_FILE_FAIL               "open failed, File: "
142
+#define MSG_SD_FILE_OPENED                  "File opened: "
143
+#define MSG_SD_SIZE                         " Size: "
144
+#define MSG_SD_FILE_SELECTED                "File selected"
145
+#define MSG_SD_WRITE_TO_FILE                "Writing to file: "
146
+#define MSG_SD_PRINTING_BYTE                "SD printing byte "
147
+#define MSG_SD_NOT_PRINTING                 "Not SD printing"
148
+#define MSG_SD_ERR_WRITE_TO_FILE            "error writing to file"
149
+#define MSG_SD_CANT_ENTER_SUBDIR            "Cannot enter subdir: "
150
+
151
+#define MSG_STEPPER_TOO_HIGH                "Steprate too high: "
152
+#define MSG_ENDSTOPS_HIT                    "endstops hit: "
153
+#define MSG_ERR_COLD_EXTRUDE_STOP           " cold extrusion prevented"
154
+#define MSG_ERR_LONG_EXTRUDE_STOP           " too long extrusion prevented"
155
+#define MSG_BABYSTEPPING_X                  "Babystepping X"
156
+#define MSG_BABYSTEPPING_Y                  "Babystepping Y"
157
+#define MSG_BABYSTEPPING_Z                  "Babystepping Z"
158
+#define MSG_SERIAL_ERROR_MENU_STRUCTURE     "Error in menu structure"
159
+
160
+#define MSG_ERR_EEPROM_WRITE                "Error writing to EEPROM!"
161
+
162
+// LCD Menu Messages
163
+
164
+// Add your own character. Reference: https://github.com/MarlinFirmware/Marlin/pull/1434 photos
165
+//                                and https://www.sparkfun.com/datasheets/LCD/HD44780.pdf page 17-18
166
+#ifdef DOGLCD
167
+  #define STR_Ae "\304"               // 'Ä' U8glib
168
+  #define STR_ae "\344"               // 'ä'
169
+  #define STR_Oe "\326"               // 'Ö'
170
+  #define STR_oe STR_Oe               // 'ö'
171
+  #define STR_Ue "\334"               // 'Ü'
172
+  #define STR_ue STR_Ue               // 'ü'
173
+  #define STR_sz "\337"               // 'ß'
174
+  #define STR_h2 "\262"               // '²'
175
+  #define STR_h3 "\263"               // '³'
176
+  #define STR_Deg "\260"              // '°'
177
+  #define STR_THERMOMETER "\377"
178
+#else
179
+  #ifdef DISPLAY_CHARSET_HD44780_JAPAN // HD44780 ROM Code: A00 (Japan)
180
+    #define STR_ae "\xe1"
181
+    #define STR_Ae STR_ae
182
+    #define STR_oe "\357"
183
+    #define STR_Oe STR_oe
184
+    #define STR_ue "\365"
185
+    #define STR_Ue STR_ue
186
+    #define STR_sz "\342"
187
+    #define STR_h2 "2"
188
+    #define STR_h3 "3"
189
+    #define STR_Deg "\271"
190
+    #define STR_THERMOMETER "\002"
191
+  #endif
192
+  #ifdef DISPLAY_CHARSET_HD44780_WESTERN // HD44780 ROM Code: A02 (Western)
193
+    #define STR_Ae "\216"
194
+    #define STR_ae "\204"
195
+    #define STR_Oe "\211"
196
+    #define STR_oe "\204"
197
+    #define STR_Ue "\212"
198
+    #define STR_ue "\201"
199
+    #define STR_sz "\160"
200
+    #define STR_h2 "\262"
201
+    #define STR_h3 "\263"
202
+    #define STR_Deg "\337"
203
+    #define STR_THERMOMETER "\002"
204
+  #endif
205
+#endif
206
+/*
207
+#define TESTSTRING000 "\000\001\002\003\004\005\006\007\010\011\012\013\014\015\016\017"
208
+#define TESTSTRING020 "\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037"
209
+#define TESTSTRING040 "\040\041\042\043\044\045\046\047\050\051\052\053\054\055\056\057"
210
+#define TESTSTRING060 "\060\061\062\063\064\065\066\067\070\071\072\073\074\075\076\077"
211
+#define TESTSTRING100 "\100\101\102\103\104\105\106\107\110\111\112\113\114\115\116\117"
212
+#define TESTSTRING120 "\120\121\122\123\124\125\126\127\130\131\132\133\134\135\136\137"
213
+#define TESTSTRING140 "\140\141\142\143\144\145\146\147\150\151\152\153\154\155\156\157"
214
+#define TESTSTRING160 "\160\161\162\163\164\165\166\167\170\171\172\173\174\175\176\177"
215
+#define TESTSTRING200 "\200\201\202\203\204\205\206\207\210\211\212\213\214\215\216\217"
216
+#define TESTSTRING220 "\220\221\222\223\224\225\226\227\230\231\232\233\234\235\236\237"
217
+#define TESTSTRING240 "\240\241\242\243\244\245\246\247\250\251\252\253\254\255\256\257"
218
+#define TESTSTRING260 "\260\261\262\263\264\265\266\267\270\271\272\273\274\275\276\277"
219
+#define TESTSTRING300 "\300\301\302\303\304\305\306\307\310\311\312\313\314\315\316\317"
220
+#define TESTSTRING320 "\320\321\322\323\324\325\326\327\330\331\332\333\334\335\336\337"
221
+#define TESTSTRING340 "\340\341\342\343\344\345\346\347\350\351\352\353\354\355\356\357"
222
+#define TESTSTRING360 "\360\361\362\363\364\365\366\367\370\371\372\373\374\375\376\377"
223
+*/
224
+
225
+#include LANGUAGE_INCLUDE
226
+#include "language_en.h"
227
+
228
+#endif //__LANGUAGE_H

+ 344
- 0
Marlin/configurator/css/configurator.css 查看文件

@@ -0,0 +1,344 @@
1
+/* configurator.css */
2
+/* Styles for Marlin Configurator */
3
+
4
+.clear { clear: both; }
5
+
6
+/* Prevent selection except PRE tags */
7
+* {
8
+    -webkit-touch-callout: none;
9
+    -webkit-user-select: none;
10
+    -khtml-user-select: none;
11
+    -moz-user-select: none;
12
+    -ms-user-select: none;
13
+    user-select: none;
14
+	}
15
+pre {
16
+    -webkit-touch-callout: text;
17
+    -webkit-user-select: text;
18
+    -khtml-user-select: text;
19
+    -moz-user-select: text;
20
+    -ms-user-select: text;
21
+    user-select: text;
22
+	}
23
+
24
+body { margin: 0; padding: 0; background: #56A; color: #000; font-family: monospace; }
25
+#main {
26
+	max-width: 1100px;
27
+	margin: 0 auto 10px;
28
+ 	padding: 0 2%; width: 96%;
29
+	}
30
+
31
+h1, h2, h3, h4, h5, h6 { clear: both; }
32
+
33
+h1, p.info { font-family: sans-serif; }
34
+h1 {
35
+	height: 38px;
36
+	margin-bottom: -30px;
37
+	color: #FFF;
38
+	background: transparent url(logo.png) right top no-repeat;
39
+	}
40
+p.info { padding: 0; color: #000; }
41
+p.info span { color: #800; }
42
+
43
+#message { text-align: center; }
44
+#message { width: 80%; margin: 0 auto 0.25em; color: #FF0; }
45
+#message p { padding: 2px 0; font-weight: bold; border-radius: 0.8em; }
46
+#message p.message { color: #080; background: #CFC; }
47
+#message p.error { color: #F00; background: #FF4; }
48
+#message p.warning { color: #FF0; background: #BA4; }
49
+#message p.message span,
50
+#message p.error span,
51
+#message p.warning span {
52
+	color: #A00;
53
+	background: rgba(255, 255, 255, 1);
54
+	border: 1px solid rgba(0,0,0,0.5);
55
+	border-radius: 1em;
56
+	float: right;
57
+	margin-right: 0.5em;
58
+	padding: 0 3px;
59
+	font-family: sans-serif;
60
+	font-size: small;
61
+	position: relative;
62
+	top: -1px;
63
+	}
64
+
65
+#help strong { color: #0DD; }
66
+img { display: none; }
67
+
68
+/* Forms */
69
+
70
+#config_form {
71
+	display: block;
72
+	background: #EEE;
73
+	padding: 6px 20px 20px;
74
+	color: #000;
75
+	position: relative;
76
+	border-radius: 1.5em;
77
+	border-top-left-radius: 0;
78
+	}
79
+fieldset {
80
+	height: 16.1em;
81
+	overflow-y: scroll;
82
+	overflow-x: hidden;
83
+	margin-top: 10px;
84
+	}
85
+label, input, select, textarea { display: block; float: left; margin: 1px 0; }
86
+label.newline, textarea, fieldset { clear: both; }
87
+label {
88
+	width: 120px; /* label area */
89
+	height: 1em;
90
+	padding: 10px 460px 10px 1em;
91
+	margin-right: -450px;
92
+	text-align: right;
93
+	}
94
+label.blocked, label.added.blocked, label.added.blocked.sublabel { color: #AAA; }
95
+
96
+label.added.sublabel {
97
+	width: auto;
98
+	margin: 11px -2.5em 0 1em;
99
+	padding: 0 3em 0 0;
100
+	font-style: italic;
101
+	color: #444;
102
+	}
103
+label+label.added.sublabel {
104
+	margin-left: 0;
105
+	}
106
+
107
+input[type="text"], select { margin: 0.75em 0 0; }
108
+input[type="checkbox"], input[type="radio"], input[type="file"] { margin: 1em 0 0; }
109
+input[type="checkbox"].enabler, input[type="radio"].enabler { margin-left: 1em; }
110
+
111
+input:disabled { color: #BBB; }
112
+
113
+#config_form input[type="text"].subitem { width: 4em; }
114
+#config_form input[type="text"].subitem+.subitem { margin-left: 4px; }
115
+
116
+input[type="text"].added { width: 20em; }
117
+label.added {
118
+	width: 265px; /* label area */
119
+	height: 1em;
120
+	padding: 10px 370px 10px 1em;
121
+	margin-right: -360px;
122
+	text-align: right;
123
+	}
124
+
125
+ul.tabs { padding: 0; list-style: none; }
126
+ul.tabs li { display: inline; }
127
+ul.tabs li a,
128
+ul.tabs li a.active:hover,
129
+ul.tabs li a.active:active {
130
+	display: block;
131
+	float: left;
132
+	background: #1E4059;
133
+	color: #CCC;
134
+	font-size: 110%;
135
+	border-radius: 0.25em 0.25em 0 0;
136
+	margin: 0 4px 0 0;
137
+	padding: 2px 8px;
138
+	text-decoration: none;
139
+	font-family: georgia,"times new roman",times;
140
+	}
141
+ul.tabs li a.active:link,
142
+ul.tabs li a.active:visited {
143
+	background: #DDD;
144
+	color: #06F;
145
+	cursor: default;
146
+	margin-top: -4px;
147
+	padding-bottom: 4px;
148
+	padding-top: 4px;
149
+	}
150
+ul.tabs li a:hover,
151
+ul.tabs li a:active {
152
+	background: #000;
153
+	color: #FFF;
154
+	}
155
+
156
+fieldset { display: none; border: 1px solid #AAA; border-radius: 1em; }
157
+fieldset legend { display: none; }
158
+
159
+.hilightable span {
160
+	display: block;
161
+	float: left;
162
+	width: 100%;
163
+	height: 1.3em;
164
+	background: rgba(225,255,0,1);
165
+	margin: 0 -100% -1em 0;
166
+	}
167
+
168
+#serial_stepper { padding-top: 0.75em; display: block; float: left; }
169
+/*#SERIAL_PORT { display: none; }*/
170
+
171
+/* Tooltips */
172
+
173
+#tooltip {
174
+	display: none;
175
+	max-width: 30em;
176
+	padding: 8px;
177
+	border: 2px solid #73d699;
178
+	border-radius: 1em;
179
+	position: absolute;
180
+	z-index: 999;
181
+	font-family: sans-serif;
182
+	font-size: 85%;
183
+	color: #000;
184
+	line-height: 1.1;
185
+	background: #e2ff99; /* Old browsers */
186
+	background: -moz-linear-gradient(top,  #e2ff99 0%, #73d699 100%); /* FF3.6+ */
187
+	background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#e2ff99), color-stop(100%,#73d699)); /* Chrome,Safari4+ */
188
+	background: -webkit-linear-gradient(top,  #e2ff99 0%,#73d699 100%); /* Chrome10+,Safari5.1+ */
189
+	background: -o-linear-gradient(top,  #e2ff99 0%,#73d699 100%); /* Opera 11.10+ */
190
+	background: -ms-linear-gradient(top,  #e2ff99 0%,#73d699 100%); /* IE10+ */
191
+	background: linear-gradient(to bottom,  #e2ff99 0%,#73d699 100%); /* W3C */
192
+	filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#e2ff99', endColorstr='#73d699',GradientType=0 ); /* IE6-9 */
193
+	-webkit-box-shadow: 0px 6px 25px -4px rgba(0,0,0,0.75);
194
+	-moz-box-shadow: 0px 6px 25px -4px rgba(0,0,0,0.75);
195
+	box-shadow: 0px 6px 25px -4px rgba(0,0,0,0.75);
196
+	}
197
+#tooltip>span {
198
+	position: absolute;
199
+	content: "";
200
+	width: 0;
201
+	height: 0;
202
+	border-left: 8px solid transparent;
203
+	border-right: 8px solid transparent;
204
+	border-top: 8px solid #73d699;
205
+	z-index: 999;
206
+	bottom: -10px;
207
+	left: 20px;
208
+	}
209
+#tooltip>strong { color: #00B; }
210
+
211
+/* Tooltips Checkbox */
212
+
213
+#tipson {
214
+	width: auto;
215
+	height: auto;
216
+	padding: 0;
217
+	margin-right: 0;
218
+	float: right;
219
+	font-weight: bold;
220
+	font-size: 100%;
221
+	font-family: helvetica;
222
+	text-align: left;
223
+	cursor: pointer;
224
+	}
225
+#tipson input { float: none; display: inline; cursor: pointer; }
226
+
227
+/* Config Text */
228
+
229
+pre.config {
230
+	height: 25em;
231
+	padding: 10px;
232
+	border: 2px solid #888;
233
+	border-radius: 5px;
234
+	overflow: auto;
235
+	clear: both;
236
+	background-color: #FFF;
237
+	color: #000;
238
+	font-family: "Fira Mono", monospace;
239
+	font-size: small;
240
+	}
241
+
242
+/* Pre Headers */
243
+
244
+h2 {
245
+	width: 100%;
246
+	margin: 12px -300px 4px 0;
247
+	padding: 0;
248
+	float: left;
249
+	}
250
+
251
+/* Disclosure Widget */
252
+
253
+span.disclose, a.download, a.download-all {︎
254
+	display: block;
255
+	float: right;
256
+	margin-top: 12px;
257
+	}
258
+
259
+span.disclose {
260
+	margin-right: -10px; /* total width */
261
+	margin-left: 14px;
262
+	width: 0;
263
+	height: 0;
264
+	position: relative;
265
+	left: 3px;
266
+	top: 3px;
267
+	cursor: pointer;
268
+	border-left: 8px solid transparent;
269
+	border-right: 8px solid transparent;
270
+	border-top: 10px solid #000;
271
+	}
272
+span.disclose.closed {
273
+	margin-right: -8px; /* total width */
274
+	margin-left: 10px;
275
+	left: 0;
276
+	top: 0;
277
+	border-top: 8px solid transparent;
278
+	border-bottom: 8px solid transparent;
279
+	border-right: 10px solid #000;
280
+	}
281
+span.disclose.almost {
282
+    -ms-transform: rotate(45deg); /* IE 9 */
283
+    -webkit-transform: rotate(45deg); /* Chrome, Safari, Opera */
284
+    transform: rotate(45deg);
285
+	}
286
+span.disclose.closed.almost {
287
+	left: 1px;
288
+	top: 3px;
289
+    -ms-transform: rotate(315deg); /* IE 9 */
290
+    -webkit-transform: rotate(315deg); /* Chrome, Safari, Opera */
291
+    transform: rotate(315deg);
292
+	}
293
+
294
+/* Download Button */
295
+
296
+a.download, a.download-all {
297
+	visibility: hidden;
298
+	padding: 2px;
299
+	border: 1px solid #494;
300
+	border-radius: 4px;
301
+	margin: 12px 0 0;
302
+	background: #FFF;
303
+	color: #494;
304
+	font-family: sans-serif;
305
+	font-size: small;
306
+	font-weight: bold;
307
+	text-decoration: none;
308
+	}
309
+a.download-all { margin: 9px 2em 0; color: #449; border-color: #449; }
310
+
311
+input[type="text"].one_of_2 { max-width: 15%; }
312
+input[type="text"].one_of_3 { max-width: 10%; }
313
+input[type="text"].one_of_4 { max-width: 7%; }
314
+
315
+select.one_of_2 { max-width: 15%; }
316
+select.one_of_3 { max-width: 10%; }
317
+select.one_of_4 { max-width: 14%; }
318
+select.one_of_4+span.label+select.one_of_4+span.label { clear: both; margin-left: 265px; padding-left: 1.75em; }
319
+select.one_of_4+span.label+select.one_of_4+span.label+select.one_of_4+span.label { clear: none; margin-left: 1em; padding-left: 0; }
320
+
321
+@media all and (min-width: 1140px) {
322
+
323
+	#main { max-width: 10000px; }
324
+
325
+	fieldset { float: left; width: 50%; height: auto; }
326
+
327
+	#config_text, #config_adv_text { float: right; clear: right; width: 45%; }
328
+
329
+	pre.config { height: 20em; }
330
+
331
+	.disclose { display: none; }
332
+
333
+	input[type="text"].one_of_2 { max-width: 15%; }
334
+	input[type="text"].one_of_3 { max-width: 9%; }
335
+	input[type="text"].one_of_4 { max-width: 8%; }
336
+
337
+	select.one_of_2 { max-width: 15%; }
338
+	select.one_of_3 { max-width: 10%; }
339
+	select.one_of_4 { max-width: 16%; }
340
+
341
+}
342
+
343
+/*label.blocked, .blocked { display: none; }*/
344
+

二進制
Marlin/configurator/css/logo.png 查看文件


+ 117
- 0
Marlin/configurator/index.html 查看文件

@@ -0,0 +1,117 @@
1
+<!DOCTYPE html>
2
+<html>
3
+  <head>
4
+    <meta charset="UTF-8">
5
+    <title>Marlin Firmware Configurator</title>
6
+    <link href='http://fonts.googleapis.com/css?family=Fira+Mono&amp;subset=latin,latin-ext' rel='stylesheet' type='text/css' />
7
+    <script src="js/jquery-2.1.3.min.js"></script>
8
+    <script src="js/binarystring.js"></script>
9
+    <script src="js/binaryfileuploader.js"></script>
10
+    <script src="js/FileSaver.min.js"></script>
11
+    <script src="js/jszip.min.js"></script>
12
+    <script src="js/jcanvas.js"></script>
13
+    <script src="js/jstepper.js"></script>
14
+    <script src="js/configurator.js"></script>
15
+    <link rel="stylesheet" href="css/configurator.css" type="text/css" media="all" />
16
+  </head>
17
+  <body>
18
+    <section id="main">
19
+      <h1>Marlin Configurator</h1>
20
+      <p class="info">Select presets (coming soon), modify, and download.</p>
21
+
22
+      <div id="message"></div>
23
+      <div id="tabs"></div>
24
+
25
+      <form id="config_form">
26
+
27
+        <div id="tooltip"></div>
28
+
29
+        <label>Drop Files:</label><input type="file" id="file-upload" />
30
+        <label id="tipson"><input type="checkbox" checked /> ?</label>
31
+        <a href="" class="download-all">Download Zip</a>
32
+
33
+        <fieldset id="machine">
34
+          <legend>Machine</legend>
35
+
36
+          <label class="newline">Serial Port:</label><select name="SERIAL_PORT"></select><div id="serial_stepper"></div>
37
+
38
+          <label>Baud Rate:</label><select name="BAUDRATE"></select>
39
+
40
+          <label>AT90USB BT IF:</label>
41
+            <input name="BTENABLED" type="checkbox" value="1" checked />
42
+
43
+          <label class="newline">Motherboard:</label><select name="MOTHERBOARD"></select>
44
+
45
+          <label class="newline">Custom Name:</label><input name="CUSTOM_MENDEL_NAME" type="text" size="14" maxlength="12" value="" />
46
+
47
+          <label class="newline">Machine UUID:</label><input name="MACHINE_UUID" type="text" size="38" maxlength="36" value="" />
48
+
49
+          <label class="newline">Extruders:</label><select name="EXTRUDERS"></select>
50
+
51
+          <label class="newline">Power Supply:</label><select name="POWER_SUPPLY"></select>
52
+
53
+          <label>PS Default Off:</label>
54
+            <input name="PS_DEFAULT_OFF" type="checkbox" value="1" checked />
55
+        </fieldset>
56
+
57
+        <fieldset id="homing">
58
+          <legend>Homing</legend>
59
+        </fieldset>
60
+
61
+        <fieldset id="temperature">
62
+          <legend>Temperature</legend>
63
+          <label class="newline">Temp Sensor 0:</label><select name="TEMP_SENSOR_0"></select>
64
+          <label class="newline">Temp Sensor 1:</label><select name="TEMP_SENSOR_1"></select>
65
+          <label class="newline">Temp Sensor 2:</label><select name="TEMP_SENSOR_2"></select>
66
+          <label class="newline">Bed Temp Sensor:</label><select name="TEMP_SENSOR_BED"></select>
67
+
68
+          <label>Max Diff:</label>
69
+            <input name="MAX_REDUNDANT_TEMP_SENSOR_DIFF" type="text" size="3" maxlength="2" />
70
+
71
+          <label>Temp Residency Time (s):</label>
72
+            <input name="TEMP_RESIDENCY_TIME" type="text" size="3" maxlength="2" />
73
+        </fieldset>
74
+
75
+        <fieldset id="extruder">
76
+          <legend>Extruder</legend>
77
+        </fieldset>
78
+
79
+        <fieldset id="lcd">
80
+          <legend>LCD / SD</legend>
81
+        </fieldset>
82
+
83
+        <fieldset id="bedlevel">
84
+          <legend>Bed Leveling</legend>
85
+        </fieldset>
86
+
87
+        <fieldset id="extras">
88
+          <legend>Extras</legend>
89
+        </fieldset>
90
+
91
+        <fieldset id="info">
92
+          <legend>Info</legend>
93
+        </fieldset>
94
+
95
+        <fieldset id="more">
96
+          <legend>More…</legend>
97
+        </fieldset>
98
+
99
+        <section id="config_text">
100
+          <h2>Configuration.h</h2>
101
+          <span class="disclose"></span>
102
+          <a href="" class="download">Download</a>
103
+          <pre class="hilightable config"></pre>
104
+        </section>
105
+
106
+        <section id="config_adv_text">
107
+          <h2>Configuration_adv.h</h2>
108
+          <span class="disclose"></span>
109
+          <a href="" class="download">Download</a>
110
+          <pre class="hilightable config"></pre>
111
+        </section>
112
+
113
+        <br class="clear" />
114
+      </form>
115
+    </section>
116
+  </body>
117
+</html>

+ 2
- 0
Marlin/configurator/js/FileSaver.min.js 查看文件

@@ -0,0 +1,2 @@
1
+/*! @source http://purl.eligrey.com/github/FileSaver.js/blob/master/FileSaver.js */
2
+var saveAs=saveAs||typeof navigator!=="undefined"&&navigator.msSaveOrOpenBlob&&navigator.msSaveOrOpenBlob.bind(navigator)||function(view){"use strict";if(typeof navigator!=="undefined"&&/MSIE [1-9]\./.test(navigator.userAgent)){return}var doc=view.document,get_URL=function(){return view.URL||view.webkitURL||view},save_link=doc.createElementNS("http://www.w3.org/1999/xhtml","a"),can_use_save_link="download"in save_link,click=function(node){var event=doc.createEvent("MouseEvents");event.initMouseEvent("click",true,false,view,0,0,0,0,0,false,false,false,false,0,null);node.dispatchEvent(event)},webkit_req_fs=view.webkitRequestFileSystem,req_fs=view.requestFileSystem||webkit_req_fs||view.mozRequestFileSystem,throw_outside=function(ex){(view.setImmediate||view.setTimeout)(function(){throw ex},0)},force_saveable_type="application/octet-stream",fs_min_size=0,arbitrary_revoke_timeout=500,revoke=function(file){var revoker=function(){if(typeof file==="string"){get_URL().revokeObjectURL(file)}else{file.remove()}};if(view.chrome){revoker()}else{setTimeout(revoker,arbitrary_revoke_timeout)}},dispatch=function(filesaver,event_types,event){event_types=[].concat(event_types);var i=event_types.length;while(i--){var listener=filesaver["on"+event_types[i]];if(typeof listener==="function"){try{listener.call(filesaver,event||filesaver)}catch(ex){throw_outside(ex)}}}},FileSaver=function(blob,name){var filesaver=this,type=blob.type,blob_changed=false,object_url,target_view,dispatch_all=function(){dispatch(filesaver,"writestart progress write writeend".split(" "))},fs_error=function(){if(blob_changed||!object_url){object_url=get_URL().createObjectURL(blob)}if(target_view){target_view.location.href=object_url}else{var new_tab=view.open(object_url,"_blank");if(new_tab==undefined&&typeof safari!=="undefined"){view.location.href=object_url}}filesaver.readyState=filesaver.DONE;dispatch_all();revoke(object_url)},abortable=function(func){return function(){if(filesaver.readyState!==filesaver.DONE){return func.apply(this,arguments)}}},create_if_not_found={create:true,exclusive:false},slice;filesaver.readyState=filesaver.INIT;if(!name){name="download"}if(can_use_save_link){object_url=get_URL().createObjectURL(blob);save_link.href=object_url;save_link.download=name;click(save_link);filesaver.readyState=filesaver.DONE;dispatch_all();revoke(object_url);return}if(view.chrome&&type&&type!==force_saveable_type){slice=blob.slice||blob.webkitSlice;blob=slice.call(blob,0,blob.size,force_saveable_type);blob_changed=true}if(webkit_req_fs&&name!=="download"){name+=".download"}if(type===force_saveable_type||webkit_req_fs){target_view=view}if(!req_fs){fs_error();return}fs_min_size+=blob.size;req_fs(view.TEMPORARY,fs_min_size,abortable(function(fs){fs.root.getDirectory("saved",create_if_not_found,abortable(function(dir){var save=function(){dir.getFile(name,create_if_not_found,abortable(function(file){file.createWriter(abortable(function(writer){writer.onwriteend=function(event){target_view.location.href=file.toURL();filesaver.readyState=filesaver.DONE;dispatch(filesaver,"writeend",event);revoke(file)};writer.onerror=function(){var error=writer.error;if(error.code!==error.ABORT_ERR){fs_error()}};"writestart progress write abort".split(" ").forEach(function(event){writer["on"+event]=filesaver["on"+event]});writer.write(blob);filesaver.abort=function(){writer.abort();filesaver.readyState=filesaver.DONE};filesaver.readyState=filesaver.WRITING}),fs_error)}),fs_error)};dir.getFile(name,{create:false},abortable(function(file){file.remove();save()}),abortable(function(ex){if(ex.code===ex.NOT_FOUND_ERR){save()}else{fs_error()}}))}),fs_error)}),fs_error)},FS_proto=FileSaver.prototype,saveAs=function(blob,name){return new FileSaver(blob,name)};FS_proto.abort=function(){var filesaver=this;filesaver.readyState=filesaver.DONE;dispatch(filesaver,"abort")};FS_proto.readyState=FS_proto.INIT=0;FS_proto.WRITING=1;FS_proto.DONE=2;FS_proto.error=FS_proto.onwritestart=FS_proto.onprogress=FS_proto.onwrite=FS_proto.onabort=FS_proto.onerror=FS_proto.onwriteend=null;return saveAs}(typeof self!=="undefined"&&self||typeof window!=="undefined"&&window||this.content);if(typeof module!=="undefined"&&module.exports){module.exports.saveAs=saveAs}else if(typeof define!=="undefined"&&define!==null&&define.amd!=null){define([],function(){return saveAs})}

+ 79
- 0
Marlin/configurator/js/binaryfileuploader.js 查看文件

@@ -0,0 +1,79 @@
1
+function BinaryFileUploader(o) {
2
+	this.options = null;
3
+
4
+
5
+	this._defaultOptions = {
6
+		element: null, // HTML file element
7
+		onFileLoad: function(file) {
8
+			console.log(file.toString());
9
+		}
10
+	};
11
+
12
+
13
+	this._init = function(o) {
14
+		if (!this.hasFileUploaderSupport()) return;
15
+
16
+		this._verifyDependencies();
17
+
18
+		this.options = this._mergeObjects(this._defaultOptions, o);
19
+		this._verifyOptions();
20
+
21
+		this.addFileChangeListener();
22
+	}
23
+
24
+
25
+	this.hasFileUploaderSupport = function() {
26
+		return !!(window.File && window.FileReader && window.FileList && window.Blob);
27
+	}
28
+
29
+	this.addFileChangeListener = function() {
30
+		this.options.element.addEventListener(
31
+			'change',
32
+			this._bind(this, this.onFileChange)
33
+		);
34
+	}
35
+
36
+	this.onFileChange = function(e) {
37
+		// TODO accept multiple files
38
+		var file = e.target.files[0],
39
+		    reader = new FileReader();
40
+
41
+		reader.onload = this._bind(this, this.onFileLoad);
42
+		reader.readAsBinaryString(file);
43
+	}
44
+
45
+	this.onFileLoad = function(e) {
46
+		var content = e.target.result,
47
+		    string  = new BinaryString(content);
48
+		this.options.onFileLoad(string);
49
+	}
50
+
51
+
52
+	this._mergeObjects = function(starting, override) {
53
+		var merged = starting;
54
+		for (key in override) merged[key] = override[key];
55
+
56
+		return merged;
57
+	}
58
+
59
+	this._verifyOptions = function() {
60
+		if (!(this.options.element && this.options.element.type && this.options.element.type === 'file')) {
61
+			throw 'Invalid element param in options. Must be a file upload DOM element';
62
+		}
63
+
64
+		if (typeof this.options.onFileLoad !== 'function') {
65
+			throw 'Invalid onFileLoad param in options. Must be a function';
66
+		}
67
+	}
68
+
69
+	this._verifyDependencies = function() {
70
+		if (!window.BinaryString) throw 'BinaryString is missing. Check that you\'ve correctly included it';
71
+	}
72
+
73
+	// helper function for binding methods to objects
74
+	this._bind = function(object, method) {
75
+		return function() {return method.apply(object, arguments);};
76
+	}
77
+
78
+	this._init(o);
79
+}

+ 168
- 0
Marlin/configurator/js/binarystring.js 查看文件

@@ -0,0 +1,168 @@
1
+function BinaryString(source) {
2
+	this._source = null;
3
+	this._bytes  = [];
4
+	this._pos    = 0;
5
+	this._length = 0;
6
+
7
+	this._init = function(source) {
8
+		this._source = source;
9
+		this._bytes  = this._stringToBytes(this._source);
10
+		this._length = this._bytes.length;
11
+	}
12
+
13
+	this.current = function() {return this._pos;}
14
+
15
+	this.rewind  = function() {return this.jump(0);}
16
+	this.end     = function() {return this.jump(this.length()  - 1);}
17
+	this.next    = function() {return this.jump(this.current() + 1);}
18
+	this.prev    = function() {return this.jump(this.current() - 1);}
19
+
20
+	this.jump = function(pos) {
21
+		if (pos < 0 || pos >= this.length()) return false;
22
+
23
+		this._pos = pos;
24
+		return true;
25
+	}
26
+
27
+	this.readByte = function(pos) {
28
+		pos = (typeof pos == 'number') ? pos : this.current();
29
+		return this.readBytes(1, pos)[0];
30
+	}
31
+
32
+	this.readBytes = function(length, pos) {
33
+		length = length || 1;
34
+		pos    = (typeof pos == 'number') ? pos : this.current();
35
+
36
+		if (pos          >  this.length() ||
37
+		    pos          <  0             ||
38
+		    length       <= 0             ||
39
+		    pos + length >  this.length() ||
40
+		    pos + length <  0
41
+		) {
42
+			return false;
43
+		}
44
+
45
+		var bytes = [];
46
+		
47
+		for (var i = pos; i < pos + length; i++) {
48
+			bytes.push(this._bytes[i]);
49
+		}
50
+
51
+		return bytes;
52
+	}
53
+
54
+	this.length = function() {return this._length;}
55
+
56
+	this.toString = function() {
57
+		var string = '',
58
+		    length = this.length();
59
+
60
+		for (var i = 0; i < length; i++) {
61
+			string += String.fromCharCode(this.readByte(i));
62
+		}
63
+
64
+		return string;
65
+	}
66
+
67
+	this.toUtf8 = function() {
68
+		var inc    = 0,
69
+		    string = '',
70
+		    length = this.length();
71
+
72
+		// determine if first 3 characters are the BOM
73
+		// then skip them in output if so
74
+		if (length >= 3               &&
75
+		    this.readByte(0) === 0xEF &&
76
+		    this.readByte(1) === 0xBB &&
77
+		    this.readByte(2) === 0xBF
78
+		) {
79
+			inc = 3;
80
+		}
81
+
82
+		for (; inc < length; inc++) {
83
+			var byte1 = this.readByte(inc),
84
+			    byte2 = 0,
85
+			    byte3 = 0,
86
+			    byte4 = 0,
87
+			    code1 = 0,
88
+			    code2 = 0,
89
+			    point = 0;
90
+
91
+			switch (true) {
92
+				// single byte character; same as ascii
93
+				case (byte1 < 0x80):
94
+					code1 = byte1;
95
+					break;
96
+
97
+				// 2 byte character
98
+				case (byte1 >= 0xC2 && byte1 < 0xE0):
99
+					byte2 = this.readByte(++inc);
100
+
101
+					code1 = ((byte1 & 0x1F) << 6) +
102
+					         (byte2 & 0x3F);
103
+					break;
104
+
105
+				// 3 byte character
106
+				case (byte1 >= 0xE0 && byte1 < 0xF0):
107
+					byte2 = this.readByte(++inc);
108
+					byte3 = this.readByte(++inc);
109
+
110
+					code1 = ((byte1 & 0xFF) << 12) +
111
+					        ((byte2 & 0x3F) <<  6) +
112
+					         (byte3 & 0x3F);
113
+					break;
114
+
115
+				// 4 byte character
116
+				case (byte1 >= 0xF0 && byte1 < 0xF5):
117
+					byte2 = this.readByte(++inc);
118
+					byte3 = this.readByte(++inc);
119
+					byte4 = this.readByte(++inc);
120
+
121
+					point = ((byte1 & 0x07) << 18) +
122
+					        ((byte2 & 0x3F) << 12) +
123
+					        ((byte3 & 0x3F) <<  6) +
124
+					         (byte4 & 0x3F)
125
+					point -= 0x10000;
126
+
127
+					code1 = (point >> 10)    + 0xD800;
128
+					code2 = (point &  0x3FF) + 0xDC00;
129
+					break;
130
+
131
+				default:
132
+					throw 'Invalid byte ' + this._byteToString(byte1) + ' whilst converting to UTF-8';
133
+					break;
134
+			}
135
+
136
+			string += (code2) ? String.fromCharCode(code1, code2)
137
+			                  : String.fromCharCode(code1);
138
+		}
139
+
140
+		return string;
141
+	}
142
+
143
+	this.toArray  = function() {return this.readBytes(this.length() - 1, 0);} 
144
+
145
+
146
+	this._stringToBytes = function(str) {
147
+		var bytes = [],
148
+		    chr   = 0;
149
+
150
+		for (var i = 0; i < str.length; i++) {
151
+			chr = str.charCodeAt(i);
152
+			bytes.push(chr & 0xFF);
153
+		}
154
+
155
+		return bytes;
156
+	}
157
+
158
+	this._byteToString = function(byte) {
159
+		var asString = byte.toString(16).toUpperCase();
160
+		while (asString.length < 2) {
161
+			asString = '0' + asString;
162
+		}
163
+
164
+		return '0x' + asString;
165
+	}
166
+
167
+	this._init(source);
168
+}

+ 1414
- 0
Marlin/configurator/js/configurator.js
文件差異過大導致無法顯示
查看文件


+ 524
- 0
Marlin/configurator/js/jcanvas.js 查看文件

@@ -0,0 +1,524 @@
1
+/*!
2
+  jCanvas v2.2.1
3
+  Caleb Evans
4
+  2.2.1 revisions by Thinkyhead
5
+*/
6
+
7
+(function($, document, Math, Number, undefined) {
8
+
9
+// jC global object
10
+var jC = {};
11
+jC.originals = {
12
+	width: 20,
13
+	height: 20,
14
+	cornerRadius: 0,
15
+	fillStyle: 'transparent',
16
+	strokeStyle: 'transparent',
17
+	strokeWidth: 5,
18
+	strokeCap: 'butt',
19
+	strokeJoin: 'miter',
20
+	shadowX: 0,
21
+	shadowY: 0,
22
+	shadowBlur: 10,
23
+	shadowColor: 'transparent',
24
+	x: 0, y: 0,
25
+	x1: 0, y1: 0,
26
+	radius: 10,
27
+	start: 0,
28
+	end: 360,
29
+	ccw: false,
30
+	inDegrees: true,
31
+	fromCenter: true,
32
+	closed: false,
33
+	sides: 3,
34
+	angle: 0,
35
+	text: '',
36
+	font: 'normal 12pt sans-serif',
37
+	align: 'center',
38
+	baseline: 'middle',
39
+	source: '',
40
+	repeat: 'repeat'
41
+};
42
+// Duplicate original defaults
43
+jC.defaults = $.extend({}, jC.originals);
44
+
45
+// Set global properties
46
+function setGlobals(context, map) {
47
+	context.fillStyle = map.fillStyle;
48
+	context.strokeStyle = map.strokeStyle;
49
+	context.lineWidth = map.strokeWidth;
50
+	context.lineCap = map.strokeCap;
51
+	context.lineJoin = map.strokeJoin;
52
+	context.shadowOffsetX = map.shadowX;
53
+	context.shadowOffsetY = map.shadowY;
54
+	context.shadowBlur = map.shadowBlur;
55
+	context.shadowColor = map.shadowColor;
56
+}
57
+
58
+// Close path if chosen
59
+function closePath(context, map) {
60
+	if (map.closed === true) {
61
+		context.closePath();
62
+		context.fill();
63
+		context.stroke();
64
+	} else {
65
+		context.fill();
66
+		context.stroke();
67
+		context.closePath();
68
+	}
69
+}
70
+
71
+// Measure angles in degrees if chosen
72
+function checkUnits(map) {
73
+	if (map.inDegrees === true) {
74
+		return Math.PI / 180;
75
+	} else {
76
+		return 1;
77
+	}
78
+}
79
+
80
+// Set canvas defaults
81
+$.fn.canvas = function(args) {
82
+	// Reset defaults if no value is passed
83
+	if (typeof args === 'undefined') {
84
+		jC.defaults = jC.originals;
85
+	} else {
86
+		jC.defaults = $.extend({}, jC.defaults, args);
87
+	}
88
+	return this;
89
+};
90
+
91
+// Load canvas
92
+$.fn.loadCanvas = function(context) {
93
+	if (typeof context === 'undefined') {context = '2d';}
94
+	return this[0].getContext(context);
95
+};
96
+
97
+// Create gradient
98
+$.fn.gradient = function(args) {
99
+	var ctx = this.loadCanvas(),
100
+		// Specify custom defaults
101
+		gDefaults = {
102
+			x1: 0, y1: 0,
103
+			x2: 0, y2: 0,
104
+			r1: 10, r2: 100
105
+		},
106
+		params = $.extend({}, gDefaults, args),
107
+		gradient, stops = 0, percent, i;
108
+		
109
+	// Create radial gradient if chosen
110
+	if (typeof args.r1 === 'undefined' && typeof args.r2 === 'undefined') {
111
+		gradient = ctx.createLinearGradient(params.x1, params.y1, params.x2, params.y2);
112
+	} else {
113
+		gradient = ctx.createRadialGradient(params.x1, params.y1, params.r1, params.x2, params.y2, params.r2);
114
+	}
115
+	
116
+	// Count number of color stops
117
+	for (i=1; i<=Number.MAX_VALUE; i+=1) {
118
+		if (params['c' + i]) {
119
+			stops += 1;
120
+		} else {
121
+			break;
122
+		}
123
+	}
124
+	
125
+	// Calculate color stop percentages if absent
126
+	for (i=1; i<=stops; i+=1) {
127
+		percent = Math.round((100 / (stops-1)) * (i-1)) / 100;
128
+		if (typeof params['s' + i] === 'undefined') {
129
+			params['s' + i] = percent;
130
+		}
131
+		gradient.addColorStop(params['s' + i], params['c' + i]);
132
+	}
133
+	return gradient;
134
+};
135
+
136
+// Create pattern
137
+$.fn.pattern = function(args) {
138
+	var ctx = this.loadCanvas(),
139
+		params = $.extend({}, jC.defaults, args),
140
+		pattern,
141
+		img = document.createElement('img');
142
+	img.src = params.source;
143
+	
144
+	// Create pattern
145
+	function create() {
146
+		if (img.complete === true) {
147
+			// Create pattern
148
+			pattern = ctx.createPattern(img, params.repeat);
149
+		} else {
150
+			throw "The pattern has not loaded yet";
151
+		}
152
+	}
153
+	try {
154
+		create();
155
+	} catch(error) {
156
+		img.onload = create;
157
+	}
158
+	return pattern;
159
+};
160
+
161
+// Clear canvas
162
+$.fn.clearCanvas = function(args) {
163
+	var ctx = this.loadCanvas(),
164
+		params = $.extend({}, jC.defaults, args);
165
+
166
+	// Draw from center if chosen
167
+	if (params.fromCenter === true) {
168
+		params.x -= params.width / 2;
169
+		params.y -= params.height / 2;
170
+	}
171
+
172
+	// Clear entire canvas if chosen
173
+	ctx.beginPath();
174
+	if (typeof args === 'undefined') {
175
+		ctx.clearRect(0, 0, this.width(), this.height());
176
+	} else {
177
+		ctx.clearRect(params.x, params.y, params.width, params.height);
178
+	} 
179
+	ctx.closePath();
180
+	return this;
181
+};
182
+
183
+// Save canvas
184
+$.fn.saveCanvas = function() {
185
+	var ctx = this.loadCanvas();
186
+	ctx.save();
187
+	return this;
188
+};
189
+
190
+// Restore canvas
191
+$.fn.restoreCanvas = function() {
192
+	var ctx = this.loadCanvas();
193
+	ctx.restore();
194
+	return this;
195
+};
196
+
197
+// Scale canvas
198
+$.fn.scaleCanvas = function(args) {
199
+	var ctx = this.loadCanvas(),
200
+		params = $.extend({}, jC.defaults, args);
201
+	ctx.save();
202
+	ctx.translate(params.x, params.y);
203
+	ctx.scale(params.width, params.height);
204
+	ctx.translate(-params.x, -params.y)
205
+	return this;
206
+};
207
+
208
+// Translate canvas
209
+$.fn.translateCanvas = function(args) {
210
+	var ctx = this.loadCanvas(),
211
+		params = $.extend({}, jC.defaults, args);
212
+	ctx.save();
213
+	ctx.translate(params.x, params.y);		
214
+	return this;
215
+};
216
+
217
+// Rotate canvas
218
+$.fn.rotateCanvas = function(args) {
219
+	var ctx = this.loadCanvas(),
220
+		params = $.extend({}, jC.defaults, args),
221
+		toRad = checkUnits(params);
222
+	
223
+	ctx.save();
224
+	ctx.translate(params.x, params.y);
225
+	ctx.rotate(params.angle * toRad);
226
+	ctx.translate(-params.x, -params.y);
227
+	return this;
228
+};
229
+
230
+// Draw rectangle
231
+$.fn.drawRect = function(args) {
232
+	var ctx = this.loadCanvas(),
233
+		params = $.extend({}, jC.defaults, args),
234
+		toRad = checkUnits(params),
235
+		x1, y1, x2, y2, r;
236
+	setGlobals(ctx, params);
237
+	
238
+	// Draw from center if chosen
239
+	if (params.fromCenter === true) {
240
+		params.x -= params.width / 2;
241
+		params.y -= params.height / 2;
242
+	}
243
+		
244
+	// Draw rounded rectangle if chosen
245
+	if (params.cornerRadius > 0) {
246
+		x1 = params.x;
247
+		y1 = params.y;
248
+		x2 = params.x + params.width;
249
+		y2 = params.y + params.height;
250
+		r = params.cornerRadius;
251
+		if ((x2 - x1) - (2 * r) < 0) {
252
+			r = (x2 - x1) / 2;
253
+		}
254
+		if ((y2 - y1) - (2 * r) < 0) {
255
+			r = (y2 - y1) / 2;
256
+		}
257
+		ctx.beginPath();
258
+		ctx.moveTo(x1+r,y1);
259
+		ctx.lineTo(x2-r,y1);
260
+		ctx.arc(x2-r, y1+r, r, 270*toRad, 360*toRad, false);
261
+		ctx.lineTo(x2,y2-r);
262
+		ctx.arc(x2-r, y2-r, r, 0, 90*toRad, false);
263
+		ctx.lineTo(x1+r,y2);
264
+		ctx.arc(x1+r, y2-r, r, 90*toRad, 180*toRad, false);
265
+		ctx.lineTo(x1,y1+r);
266
+		ctx.arc(x1+r, y1+r, r, 180*toRad, 270*toRad, false);
267
+		ctx.fill();
268
+		ctx.stroke();
269
+		ctx.closePath();
270
+	} else {
271
+		ctx.fillRect(params.x, params.y, params.width, params.height);
272
+		ctx.strokeRect(params.x, params.y, params.width, params.height);
273
+	}
274
+	return this;
275
+};
276
+
277
+// Draw arc
278
+$.fn.drawArc = function(args) {
279
+	var ctx = this.loadCanvas(),
280
+		params = $.extend({}, jC.defaults, args),
281
+		toRad = checkUnits(params);
282
+		setGlobals(ctx, params);
283
+	
284
+	// Draw from center if chosen
285
+	if (params.fromCenter === false) {
286
+		params.x += params.radius;
287
+		params.y += params.radius;
288
+	}
289
+	
290
+	ctx.beginPath();
291
+	ctx.arc(params.x, params.y, params.radius, (params.start*toRad)-(Math.PI/2), (params.end*toRad)-(Math.PI/2), params.ccw);
292
+	// Close path if chosen
293
+	closePath(ctx, params);
294
+	return this;
295
+};
296
+
297
+// Draw ellipse
298
+$.fn.drawEllipse = function(args) {
299
+	var ctx = this.loadCanvas(),
300
+		params = $.extend({}, jC.defaults, args),
301
+		controlW = params.width * (4/3);
302
+		setGlobals(ctx, params);
303
+	
304
+	// Draw from center if chosen
305
+	if (params.fromCenter === false) {
306
+		params.x += params.width / 2;
307
+		params.y += params.height / 2;
308
+	}
309
+	
310
+	// Increment coordinates to prevent negative values
311
+	params.x += 1e-10;
312
+	params.y += 1e-10;
313
+	
314
+	// Create ellipse
315
+	ctx.beginPath();
316
+	ctx.moveTo(params.x, params.y-params.height/2);
317
+	ctx.bezierCurveTo(params.x-controlW/2,params.y-params.height/2,
318
+		params.x-controlW/2,params.y+params.height/2,
319
+		params.x,params.y+params.height/2);
320
+	ctx.bezierCurveTo(params.x+controlW/2,params.y+params.height/2,
321
+		params.x+controlW/2,params.y-params.height/2,
322
+		params.x,params.y-params.height/2);
323
+	ctx.closePath();
324
+	ctx.fill();
325
+	ctx.stroke();
326
+	return this;
327
+};
328
+
329
+// Draw line
330
+$.fn.drawLine = function(args) {
331
+	var ctx = this.loadCanvas(),
332
+		params = $.extend({}, jC.defaults, args),
333
+		max = Number.MAX_VALUE, l,
334
+		lx, ly;
335
+	setGlobals(ctx, params);
336
+	
337
+	// Draw each point
338
+	ctx.beginPath();
339
+	ctx.moveTo(params.x1, params.y1);
340
+	for (l=2; l<max; l+=1) {
341
+		lx = params['x' + l];
342
+		ly = params['y' + l];
343
+		// Stop loop when all points are drawn
344
+		if (typeof lx === 'undefined' || typeof ly === 'undefined') {
345
+			break;
346
+		}
347
+		ctx.lineTo(lx, ly);
348
+	}
349
+	// Close path if chosen
350
+	closePath(ctx, params);
351
+	return this;
352
+};
353
+
354
+// Draw quadratic curve
355
+$.fn.drawQuad = function(args) {
356
+	var ctx = this.loadCanvas(),
357
+		params = $.extend({}, jC.defaults, args),
358
+		max = Number.MAX_VALUE, l,
359
+		lx, ly, lcx, lcy;
360
+	setGlobals(ctx, params);
361
+	
362
+	// Draw each point
363
+	ctx.beginPath();
364
+	ctx.moveTo(params.x1, params.y1);
365
+	for (l=2; l<max; l+=1) {
366
+		lx = params['x' + l];
367
+    if (typeof lx === 'undefined') break;
368
+		ly = params['y' + l];
369
+    if (typeof ly === 'undefined') break;
370
+		lcx = params['cx' + (l-1)];
371
+    if (typeof lcx === 'undefined') break;
372
+		lcy = params['cy' + (l-1)];
373
+    if (typeof lcy === 'undefined') break;
374
+		ctx.quadraticCurveTo(lcx, lcy, lx, ly);
375
+	}
376
+	// Close path if chosen
377
+	closePath(ctx, params);
378
+	return this;
379
+};
380
+
381
+// Draw Bezier curve
382
+$.fn.drawBezier = function(args) {
383
+	var ctx = this.loadCanvas(),
384
+		params = $.extend({}, jC.defaults, args),
385
+		max = Number.MAX_VALUE,
386
+		l=2, lc=1, lx, ly, lcx1, lcy1, lcx2, lcy2, i;
387
+	setGlobals(ctx, params);
388
+
389
+	// Draw each point
390
+	ctx.beginPath();
391
+	ctx.moveTo(params.x1, params.y1);
392
+	for (i=2; i<max; i+=1) {
393
+		lx = params['x' + l];
394
+    if (typeof lx === 'undefined') break;
395
+		ly = params['y' + l];
396
+    if (typeof ly === 'undefined') break;
397
+		lcx1 = params['cx' + lc];
398
+    if (typeof lcx1 === 'undefined') break;
399
+		lcy1 = params['cy' + lc];
400
+    if (typeof lcy1 === 'undefined') break;
401
+		lcx2 = params['cx' + (lc+1)];
402
+    if (typeof lcx2 === 'undefined') break;
403
+		lcy2 = params['cy' + (lc+1)];
404
+    if (typeof lcy2 === 'undefined') break;
405
+		ctx.bezierCurveTo(lcx1, lcy1, lcx2, lcy2, lx, ly);
406
+		l += 1;
407
+		lc += 2;
408
+	}
409
+	// Close path if chosen
410
+	closePath(ctx, params);
411
+	return this;
412
+};
413
+
414
+// Draw text
415
+$.fn.drawText = function(args) {
416
+	var ctx = this.loadCanvas(),
417
+		params = $.extend({}, jC.defaults, args);
418
+	setGlobals(ctx, params);
419
+	
420
+	// Set text-specific properties
421
+	ctx.textBaseline = params.baseline;
422
+	ctx.textAlign = params.align;
423
+	ctx.font = params.font;
424
+	
425
+	ctx.strokeText(params.text, params.x, params.y);
426
+	ctx.fillText(params.text, params.x, params.y);
427
+	return this;
428
+};
429
+
430
+// Draw image
431
+$.fn.drawImage = function(args) {
432
+	var ctx = this.loadCanvas(),
433
+		params = $.extend({}, jC.defaults, args),
434
+		// Define image source
435
+		img = document.createElement('img');
436
+  	img.src = params.source;
437
+	  setGlobals(ctx, params);
438
+
439
+	// Draw image function
440
+	function draw() {
441
+		if (img.complete) {
442
+
443
+  		var scaleFac = img.width / img.height;
444
+
445
+			// If width/height are specified
446
+			if (typeof args.width !== 'undefined' && typeof args.height !== 'undefined') {
447
+				img.width = args.width;
448
+				img.height = args.height;
449
+			// If width is specified
450
+			} else if (typeof args.width !== 'undefined' && typeof args.height === 'undefined') {
451
+				img.width = args.width;
452
+				img.height = img.width / scaleFac;
453
+			// If height is specified
454
+			} else if (typeof args.width === 'undefined' && typeof args.height !== 'undefined') {
455
+				img.height = args.height;
456
+				img.width = img.height * scaleFac;
457
+			}
458
+		
459
+			// Draw from center if chosen
460
+			if (params.fromCenter === true) {
461
+				params.x -= img.width / 2;
462
+				params.y -= img.height / 2;
463
+			}
464
+
465
+			// Draw image
466
+			ctx.drawImage(img, params.x, params.y, img.width, img.height);
467
+		} else {
468
+			throw "The image has not loaded yet.";
469
+		}
470
+	}
471
+
472
+  function dodraw() {
473
+    // console.log("dodraw...");
474
+    try {
475
+  	  // console.log("dodraw...try...");
476
+      draw();
477
+    }
478
+    catch(error) {
479
+      // console.log("dodraw...catch: " + error);
480
+    }
481
+  }
482
+
483
+	// Draw image if already loaded
484
+  // console.log("--------------------");
485
+  // console.log("drawImage " + img.src);
486
+	try {
487
+    // console.log("try...");
488
+		draw();
489
+	} catch(error) {
490
+    // console.log("catch: " + error);
491
+		img.onload = dodraw;
492
+	}
493
+	return this;
494
+};
495
+
496
+// Draw polygon
497
+$.fn.drawPolygon = function(args) {
498
+	var ctx = this.loadCanvas(),
499
+		params = $.extend({}, jC.defaults, args),
500
+		theta, dtheta, x, y,
501
+		toRad = checkUnits(params), i;
502
+	setGlobals(ctx, params);
503
+	
504
+	if (params.sides >= 3) {		
505
+		// Calculate points and draw
506
+		theta = (Math.PI/2) + (Math.PI/params.sides) + (params.angle*toRad);
507
+		dtheta = (Math.PI*2) / params.sides;
508
+		for (i=0; i<params.sides; i+=1) {
509
+			x = params.x + (params.radius * Math.cos(theta)) + 1e-10;
510
+			y = params.y + (params.radius * Math.sin(theta)) + 1e-10;
511
+			if (params.fromCenter === false) {
512
+				x += params.radius;
513
+				y += params.radius;
514
+			}
515
+			ctx.lineTo(x, y);
516
+			theta += dtheta;
517
+		}
518
+		closePath(ctx, params);
519
+	}
520
+	return this;
521
+};
522
+
523
+return window.jCanvas = jC;
524
+}(jQuery, document, Math, Number));

+ 4
- 0
Marlin/configurator/js/jquery-2.1.3.min.js
文件差異過大導致無法顯示
查看文件


+ 220
- 0
Marlin/configurator/js/jstepper.js 查看文件

@@ -0,0 +1,220 @@
1
+/*!
2
+ * jQuery "stepper" Plugin
3
+ * version 0.0.1
4
+ * @requires jQuery v1.3.2 or later
5
+ * @requires jCanvas
6
+ *
7
+ * Authored 2011-06-11 Scott Lahteine (thinkyhead.com)
8
+ *
9
+ *  A very simple numerical stepper.
10
+ *  TODO: place arrows based on div size, make 50/50 width
11
+ *
12
+ *  Usage example:
13
+ *
14
+ *  $('#mydiv').jstepper({
15
+ *    min: 1,
16
+ *    max: 4,
17
+ *    val: 1,
18
+ *    arrowWidth: 15,
19
+ *    arrowHeight: '22px',
20
+ *    color: '#FFF',
21
+ *    acolor: '#F70',
22
+ *    hcolor: '#FF0',
23
+ *    id: 'select-me',
24
+ *    stepperClass: 'inner',
25
+ *    textStyle: {width:'1.5em',fontSize:'20px',textAlign:'center'},
26
+ *    onChange: function(v) { },
27
+ *  });
28
+ *
29
+ */
30
+;(function($) {
31
+  var un = 'undefined';
32
+
33
+  $.jstepperArrows = [
34
+    { name:'prev', poly:[[1.0,0],[0,0.5],[1.0,1.0]] },
35
+    { name:'next', poly:[[0,0],[1.0,0.5],[0,1.0]] }
36
+  ];
37
+
38
+ 	$.fn.jstepper = function(args) {
39
+
40
+		return this.each(function() {
41
+
42
+      var defaults = {
43
+        min: 1,
44
+        max: null,
45
+        val: null,
46
+        active: true,
47
+        placeholder: null,
48
+        arrowWidth: 0,
49
+        arrowHeight: 0,
50
+        color: '#FFF',
51
+        hcolor: '#FF0',
52
+        acolor: '#F80',
53
+        id: '',
54
+        stepperClass: '',
55
+        textStyle: '',
56
+        onChange: (function(v){ if (typeof console.log !== 'undefined') console.log("val="+v); })
57
+      };
58
+
59
+      args = $.extend(defaults, args || {});
60
+
61
+		  var min = args.min * 1,
62
+          max = (args.max !== null) ? args.max * 1 : min,
63
+          span = max - min + 1,
64
+          val = (args.val !== null) ? args.val * 1 : min,
65
+          active = !args.disabled,
66
+          placeholder = args.placeholder,
67
+          arrowWidth = 1 * args.arrowWidth.toString().replace(/px/,''),
68
+          arrowHeight = 1 * args.arrowHeight.toString().replace(/px/,''),
69
+          color = args.color,
70
+          hcolor = args.hcolor,
71
+          acolor = args.acolor,
72
+			    $prev = $('<a href="#prev" style="cursor:w-resize;"><canvas/></a>'),
73
+			    $marq = $('<div class="number"/>').css({float:'left',textAlign:'center'}),
74
+			    $next = $('<a href="#next" style="cursor:e-resize;"><canvas/></a>'),
75
+			    arrow = [ $prev.find('canvas')[0], $next.find('canvas')[0] ],
76
+			    $stepper = $('<span class="jstepper"/>').append($prev).append($marq).append($next).append('<div style="clear:both;"/>'),
77
+			    onChange = args.onChange;
78
+
79
+      if (args.id) $stepper[0].id = args.id;
80
+      if (args.stepperClass) $stepper.addClass(args.stepperClass);
81
+      if (args.textStyle) $marq.css(args.textStyle);
82
+
83
+      // replace a span, but embed elsewhere
84
+      if (this.tagName == 'SPAN') {
85
+        var previd = this.id;
86
+        $(this).replaceWith($stepper);
87
+        if (previd) $stepper.attr('id',previd);
88
+      }
89
+      else {
90
+        $(this).append($stepper);
91
+      }
92
+
93
+      // hook to call functions on this object
94
+      $stepper[0].ui = {
95
+
96
+        refresh: function() {
97
+          this.updateNumber();
98
+          this._drawArrow(0, 1);
99
+          this._drawArrow(1, 1);
100
+          return this;
101
+        },
102
+
103
+        _drawArrow: function(i,state) {
104
+          var $elm = $(arrow[i]),
105
+              desc = $.jstepperArrows[i],
106
+              fillStyle = (state == 2) ? hcolor : (state == 3) ? acolor : color,
107
+              draw = { fillStyle: fillStyle },
108
+              w = $elm.width(), h = $elm.height();
109
+
110
+          if (w <= 0) w = $elm.attr('width');
111
+          if (h <= 0) h = $elm.attr('height');
112
+
113
+          $.each(desc.poly,function(i,v){
114
+            ++i;
115
+            draw['x'+i] = v[0] * w;
116
+            draw['y'+i] = v[1] * h;
117
+          });
118
+          $elm.restoreCanvas().clearCanvas().drawLine(draw);
119
+        },
120
+
121
+        updateNumber: function() {
122
+          $marq.html((active || placeholder === null) ? val.toString() : placeholder);
123
+          return this;
124
+        },
125
+
126
+        _doclick: function(i) {
127
+          this.add(i ? 1 : -1);
128
+          this._drawArrow(i, 3);
129
+          var self = this;
130
+          setTimeout(function(){ self._drawArrow(i, 2); }, 50);
131
+        },
132
+
133
+        add: function(x) {
134
+          val = (((val - min) + x + span) % span) + min;
135
+          this.updateNumber();
136
+          this.didChange(val);
137
+          return this;
138
+        },
139
+
140
+        min: function(v) {
141
+          if (typeof v === un) return min;
142
+          this.setRange(v,max);
143
+          return this;
144
+        },
145
+
146
+        max: function(v) {
147
+          if (typeof v === un) return max;
148
+          this.setRange(min,v);
149
+          return this;
150
+        },
151
+
152
+        val: function(v) {
153
+          if (typeof v === un) return val;
154
+          val = (((v - min) + span) % span) + min;
155
+          this.updateNumber();
156
+          return this;
157
+        },
158
+
159
+        setRange: function(lo, hi, ini) {
160
+          if (lo > hi) hi = (lo += hi -= lo) - hi;
161
+          min = lo; max = hi; span = hi - lo + 1;
162
+          if (typeof ini !== un) val = ini;
163
+          if (val < min) val = min;
164
+          if (val > max) val = max;
165
+          this.updateNumber();
166
+          return this;
167
+        },
168
+
169
+        active: function(a) {
170
+          if (typeof a === un) return active;
171
+          (active = a) ? $marq.removeClass('inactive') : $marq.addClass('inactive');
172
+          this.updateNumber();
173
+          return this;
174
+        },
175
+
176
+        disable: function() { this.active(false); return this; },
177
+        enable: function() { this.active(true); return this; },
178
+
179
+        clearPlaceholder: function() {
180
+          this.setPlaceholder(null);
181
+          return this;
182
+        },
183
+        setPlaceholder: function(p) {
184
+          placeholder = p;
185
+          if (!active) this.updateNumber();
186
+          return this;
187
+        },
188
+
189
+        didChange: onChange
190
+
191
+      };
192
+
193
+      // set hover and click for each arrow
194
+      $.each($.jstepperArrows, function(i,desc) {
195
+        var $elm = $(arrow[i]),
196
+            w = arrowWidth ? arrowWidth : $elm.width() ? $elm.width() : 15,
197
+            h = arrowHeight ? arrowHeight : $elm.height() ? $elm.height() : 24;
198
+        $elm[0]._index = i;
199
+        $elm
200
+          .css({float:'left'})
201
+          .attr({width:w,height:h,'class':desc.name})
202
+          .hover(
203
+            function(e) { $stepper[0].ui._drawArrow(e.target._index, 2); },
204
+            function(e) { $stepper[0].ui._drawArrow(e.target._index, 1); }
205
+          )
206
+          .click(function(e){
207
+            $stepper[0].ui._doclick(e.target._index);
208
+            return false;
209
+          });
210
+      });
211
+
212
+      // init the visuals first time
213
+  		$stepper[0].ui.refresh();
214
+
215
+		}); // this.each
216
+
217
+  }; // $.fn.jstepper
218
+
219
+})( jQuery );
220
+

+ 14
- 0
Marlin/configurator/js/jszip.min.js
文件差異過大導致無法顯示
查看文件


Loading…
取消
儲存