Erik van der Zalm пре 13 година
родитељ
комит
632528aa95
5 измењених фајлова са 116 додато и 31 уклоњено
  1. 16
    2
      Marlin/Marlin.pde
  2. 69
    0
      Marlin/cardreader.cpp
  3. 1
    0
      Marlin/cardreader.h
  4. 28
    27
      Marlin/language.h
  5. 2
    2
      Marlin/ultralcd.pde

+ 16
- 2
Marlin/Marlin.pde Прегледај датотеку

75
 // M27  - Report SD print status
75
 // M27  - Report SD print status
76
 // M28  - Start SD write (M28 filename.g)
76
 // M28  - Start SD write (M28 filename.g)
77
 // M29  - Stop SD write
77
 // M29  - Stop SD write
78
-// M30  - Output time since last M109 or SD card start to serial
78
+// M30  - Delete file from SD (M30 filename.g)
79
+// M31  - Output time since last M109 or SD card start to serial
79
 // M42  - Change pin status via gcode
80
 // M42  - Change pin status via gcode
80
 // M80  - Turn on Power Supply
81
 // M80  - Turn on Power Supply
81
 // M81  - Turn off Power Supply
82
 // M81  - Turn off Power Supply
738
       //processed in write to file routine above
739
       //processed in write to file routine above
739
       //card,saving = false;
740
       //card,saving = false;
740
       break;
741
       break;
742
+    case 30: //M30 <filename> Delete File 
743
+	if (card.cardOK){
744
+		card.closefile();
745
+		starpos = (strchr(strchr_pointer + 4,'*'));
746
+                if(starpos != NULL){
747
+                char* npos = strchr(cmdbuffer[bufindr], 'N');
748
+                strchr_pointer = strchr(npos,' ') + 1;
749
+                *(starpos-1) = '\0';
750
+         }
751
+	 card.removeFile(strchr_pointer + 4);
752
+	}
753
+	break;
754
+	
741
 #endif //SDSUPPORT
755
 #endif //SDSUPPORT
742
 
756
 
743
-    case 30: //M30 take time since the start of the SD print or an M109 command
757
+    case 31: //M31 take time since the start of the SD print or an M109 command
744
       {
758
       {
745
       stoptime=millis();
759
       stoptime=millis();
746
       char time[30];
760
       char time[30];

+ 69
- 0
Marlin/cardreader.cpp Прегледај датотеку

297
   
297
   
298
 }
298
 }
299
 
299
 
300
+void CardReader::removeFile(char* name)
301
+{
302
+  if(!cardOK)
303
+    return;
304
+  file.close();
305
+  sdprinting = false;
306
+  
307
+  
308
+  SdFile myDir;
309
+  curDir=&root;
310
+  char *fname=name;
311
+  
312
+  char *dirname_start,*dirname_end;
313
+  if(name[0]=='/')
314
+  {
315
+    dirname_start=strchr(name,'/')+1;
316
+    while(dirname_start>0)
317
+    {
318
+      dirname_end=strchr(dirname_start,'/');
319
+      //SERIAL_ECHO("start:");SERIAL_ECHOLN((int)(dirname_start-name));
320
+      //SERIAL_ECHO("end  :");SERIAL_ECHOLN((int)(dirname_end-name));
321
+      if(dirname_end>0 && dirname_end>dirname_start)
322
+      {
323
+        char subdirname[13];
324
+        strncpy(subdirname, dirname_start, dirname_end-dirname_start);
325
+        subdirname[dirname_end-dirname_start]=0;
326
+        SERIAL_ECHOLN(subdirname);
327
+        if(!myDir.open(curDir,subdirname,O_READ))
328
+        {
329
+          SERIAL_PROTOCOLPGM("open failed, File: ");
330
+          SERIAL_PROTOCOL(subdirname);
331
+          SERIAL_PROTOCOLLNPGM(".");
332
+          return;
333
+        }
334
+        else
335
+          ;//SERIAL_ECHOLN("dive ok");
336
+          
337
+        curDir=&myDir; 
338
+        dirname_start=dirname_end+1;
339
+      }
340
+      else // the reminder after all /fsa/fdsa/ is the filename
341
+      {
342
+        fname=dirname_start;
343
+        //SERIAL_ECHOLN("remaider");
344
+        //SERIAL_ECHOLN(fname);
345
+        break;
346
+      }
347
+      
348
+    }
349
+  }
350
+  else //relative path
351
+  {
352
+    curDir=&workDir;
353
+  }
354
+    if (file.remove(curDir, fname)) 
355
+    {
356
+      SERIAL_PROTOCOLPGM("File deleted:");
357
+      SERIAL_PROTOCOL(fname);
358
+      sdpos = 0;
359
+    }
360
+    else
361
+    {
362
+      SERIAL_PROTOCOLPGM("Deletion failed, File: ");
363
+      SERIAL_PROTOCOL(fname);
364
+      SERIAL_PROTOCOLLNPGM(".");
365
+    }
366
+  
367
+}
368
+
300
 void CardReader::getStatus()
369
 void CardReader::getStatus()
301
 {
370
 {
302
   if(cardOK){
371
   if(cardOK){

+ 1
- 0
Marlin/cardreader.h Прегледај датотеку

17
 
17
 
18
   void checkautostart(bool x); 
18
   void checkautostart(bool x); 
19
   void openFile(char* name,bool read);
19
   void openFile(char* name,bool read);
20
+  void removeFile(char* name);
20
   void closefile();
21
   void closefile();
21
   void release();
22
   void release();
22
   void startFileprint();
23
   void startFileprint();

+ 28
- 27
Marlin/language.h Прегледај датотеку

23
 	#define MSG_DISABLE_STEPPERS " Disable Steppers"
23
 	#define MSG_DISABLE_STEPPERS " Disable Steppers"
24
 	#define MSG_AUTO_HOME " Auto Home"
24
 	#define MSG_AUTO_HOME " Auto Home"
25
 	#define MSG_SET_ORIGIN " Set Origin"
25
 	#define MSG_SET_ORIGIN " Set Origin"
26
-	#define MSG_PREHEAT " Preheat"
27
 	#define MSG_COOLDOWN " Cooldown"
26
 	#define MSG_COOLDOWN " Cooldown"
28
 	#define MSG_EXTRUDE " Extrude"
27
 	#define MSG_EXTRUDE " Extrude"
28
+	#define MSG_PREHEAT_PLA " Preheat PLA"
29
+	#define MSG_PREHEAT_ABS " Preheat ABS"
29
     #define MSG_MOVE_AXIS " Move Axis      \x7E"
30
     #define MSG_MOVE_AXIS " Move Axis      \x7E"
30
 	#define MSG_SPEED " Speed:"
31
 	#define MSG_SPEED " Speed:"
31
 	#define MSG_NOZZLE " \002Nozzle:"
32
 	#define MSG_NOZZLE " \002Nozzle:"
159
 	#define MSG_SD_REMOVED "Card removed"
160
 	#define MSG_SD_REMOVED "Card removed"
160
 	#define MSG_MAIN " Main \003"
161
 	#define MSG_MAIN " Main \003"
161
 	#define MSG_AUTOSTART " Autostart"
162
 	#define MSG_AUTOSTART " Autostart"
162
-	#define MSG_DISABLE_STEPPERS " Disable Steppers"
163
-	#define MSG_AUTO_HOME " Auto Home"
164
-	#define MSG_SET_ORIGIN " Set Origin"
165
-	#define MSG_PREHEAT " Preheat"
166
-	#define MSG_COOLDOWN " Cooldown"
167
-	#define MSG_EXTRUDE " Extrude"
163
+	#define MSG_DISABLE_STEPPERS " Stepper abschalten"
164
+	#define MSG_AUTO_HOME " Auto Heim"
165
+	#define MSG_SET_ORIGIN " Position setzen"
166
+	#define MSG_PREHEAT_PLA " Aufheizen PLA"
167
+	#define MSG_PREHEAT_ABS " Aufheizen ABS"
168
+	#define MSG_COOLDOWN " Abkuehlen"
168
     #define MSG_MOVE_AXIS " Move Axis      \x7E"
169
     #define MSG_MOVE_AXIS " Move Axis      \x7E"
169
-	#define MSG_SPEED " Speed:"
170
-	#define MSG_NOZZLE " \002Nozzle:"
171
-	#define MSG_BED " \002Bed:"
172
-	#define MSG_FAN_SPEED " Fan speed:"
173
-	#define MSG_FLOW " Flow:"
174
-	#define MSG_CONTROL " Control \003"
170
+        #define MSG_MOVE_AXIS " Achsen verfahren   \x7E"
171
+	#define MSG_SPEED " Geschw:"
172
+	#define MSG_NOZZLE " \002Duese:"
173
+	#define MSG_BED " \002Bett:"
174
+	#define MSG_FAN_SPEED " Luefter geschw.:"
175
+	#define MSG_FLOW " Fluss:"
176
+	#define MSG_CONTROL " Kontrolle \003"
175
 	#define MSG_MIN " \002 Min:"
177
 	#define MSG_MIN " \002 Min:"
176
 	#define MSG_MAX " \002 Max:"
178
 	#define MSG_MAX " \002 Max:"
177
-	#define MSG_FACTOR " \002 Fact:"
178
-	#define MSG_AUTOTEMP " Autotemp:"
179
-	#define MSG_ON "On "
180
-	#define MSG_OFF "Off"
179
+	#define MSG_FACTOR " \002 Faktor:"
180
+	#define MSG_AUTOTEMP " AutoTemp:"
181
+	#define MSG_ON "Ein "
182
+	#define MSG_OFF "Aus "
181
 	#define MSG_PID_P " PID-P: "
183
 	#define MSG_PID_P " PID-P: "
182
 	#define MSG_PID_I " PID-I: "
184
 	#define MSG_PID_I " PID-I: "
183
 	#define MSG_PID_D " PID-D: "
185
 	#define MSG_PID_D " PID-D: "
198
 	#define MSG_ZSTEPS " Zsteps/mm:"
200
 	#define MSG_ZSTEPS " Zsteps/mm:"
199
 	#define MSG_ESTEPS " Esteps/mm:"
201
 	#define MSG_ESTEPS " Esteps/mm:"
200
 	#define MSG_MAIN_WIDE " Main        \003"
202
 	#define MSG_MAIN_WIDE " Main        \003"
201
-	#define MSG_TEMPERATURE_WIDE " Temperature \x7E"
203
+	#define MSG_TEMPERATURE_WIDE " Temperatur \x7E"
202
 	#define MSG_MOTION_WIDE " Motion      \x7E"
204
 	#define MSG_MOTION_WIDE " Motion      \x7E"
203
-	#define MSG_STORE_EPROM " Store EPROM"
204
-	#define MSG_LOAD_EPROM " Load EPROM"
205
-	#define MSG_RESTORE_FAILSAFE " Restore Failsafe"
205
+	#define MSG_STORE_EPROM " EPROM speichern"
206
+	#define MSG_LOAD_EPROM "  EPROM laden"
207
+	#define MSG_RESTORE_FAILSAFE " Standard Konfig."
206
 	#define MSG_REFRESH "\004Refresh"
208
 	#define MSG_REFRESH "\004Refresh"
207
-	#define MSG_WATCH " Watch   \003"
209
+	#define MSG_WATCH " Beobachten   \003"
208
 	#define MSG_PREPARE " Prepare \x7E"
210
 	#define MSG_PREPARE " Prepare \x7E"
209
 	#define MSG_PREPARE_ALT " Prepare \003"
211
 	#define MSG_PREPARE_ALT " Prepare \003"
210
-	#define MSG_CONTROL_ARROW " Control \x7E"
211
 	#define MSG_TUNE " Tune    \x7E"
212
 	#define MSG_TUNE " Tune    \x7E"
212
-	#define MSG_STOP_PRINT " Stop Print   \x7E"
213
-	#define MSG_CARD_MENU " Card Menu    \x7E"
214
-	#define MSG_NO_CARD " No Card"
215
-	#define MSG_SERIAL_ERROR_MENU_STRUCTURE "Something is wrong in the MenuStructure."
213
+	#define MSG_STOP_PRINT " Druck stoppen   \x7E"
214
+	#define MSG_CARD_MENU " SDKarten Menue    \x7E"
215
+	#define MSG_NO_CARD " Keine SDKarte"
216
+	#define MSG_SERIAL_ERROR_MENU_STRUCTURE "Fehler in der  Menuestruktur."
216
 	#define MSG_DWELL "DWELL..."		
217
 	#define MSG_DWELL "DWELL..."		
217
 	#define MSG_NO_MOVE "No move."
218
 	#define MSG_NO_MOVE "No move."
218
 	#define MSG_PART_RELEASE "Partial Release"
219
 	#define MSG_PART_RELEASE "Partial Release"

+ 2
- 2
Marlin/ultralcd.pde Прегледај датотеку

658
                   {
658
                   {
659
                     if (encoderpos >0) 
659
                     if (encoderpos >0) 
660
                    { 
660
                    { 
661
-		    	enquecommand("G1 F170 Z0.1");
661
+		    	enquecommand("G1 F70 Z0.1");
662
 			oldencoderpos=encoderpos;
662
 			oldencoderpos=encoderpos;
663
                         encoderpos=0;
663
                         encoderpos=0;
664
 		    }
664
 		    }
665
 		  
665
 		  
666
 		    else if (encoderpos < 0)
666
 		    else if (encoderpos < 0)
667
                     {
667
                     {
668
-		    	enquecommand("G1 F1700 Z-0.1");
668
+		    	enquecommand("G1 F70 Z-0.1");
669
 			oldencoderpos=encoderpos;
669
 			oldencoderpos=encoderpos;
670
                         encoderpos=0;
670
                         encoderpos=0;
671
 		    }
671
 		    }

Loading…
Откажи
Сачувај