Browse Source

fixed manual axis movement lcd option

Christian Thalhammer 13 years ago
parent
commit
8a8ea50f33
1 changed files with 61 additions and 29 deletions
  1. 61
    29
      Marlin/ultralcd.pde

+ 61
- 29
Marlin/ultralcd.pde View File

@@ -485,13 +485,13 @@ void MainMenu::showPrepare()
485 485
       MENUITEM(  lcdprintPGM(" Disable Steppers")  ,  BLOCK;enquecommand("M84");beepshort(); ) ;
486 486
       break;
487 487
     case ItemP_home:
488
-      MENUITEM(  lcdprintPGM(" Auto Home")  ,  BLOCK;enquecommand("G28 X-105 Y-105 Z0");beepshort(); ) ;
488
+      MENUITEM(  lcdprintPGM(" Auto Home")  ,  BLOCK;enquecommand("G28 X0 Y0 Z0");beepshort(); ) ;
489 489
       break;
490 490
     case ItemP_origin:
491 491
       MENUITEM(  lcdprintPGM(" Set Origin")  ,  BLOCK;enquecommand("G92 X0 Y0 Z0");beepshort(); ) ;
492 492
       break;
493 493
     case ItemP_preheat:
494
-      MENUITEM(  lcdprintPGM(" Preheat")  ,  BLOCK;setTargetHotend0(170);setTargetBed(70);beepshort(); ) ;
494
+      MENUITEM(  lcdprintPGM(" Preheat")  ,  BLOCK;setTargetHotend0(227);setTargetBed(105);beepshort(); ) ;
495 495
       break;
496 496
     case ItemP_cooldown:
497 497
       MENUITEM(  lcdprintPGM(" Cooldown")  ,  BLOCK;setTargetHotend0(0);setTargetBed(0);beepshort(); ) ;
@@ -518,21 +518,22 @@ enum {
518 518
 void MainMenu::showAxisMove()
519 519
 {
520 520
    uint8_t line=0;
521
+   int oldencoderpos=0;
521 522
    clearIfNecessary();
522 523
    for(int8_t i=lineoffset;i<lineoffset+LCD_HEIGHT;i++)
523 524
    {
524 525
      switch(i)
525 526
       {
526 527
           case ItemAM_exit:
527
-          MENUITEM(  lcdprintPGM(" Main \003")  ,  BLOCK;status=Main_Menu;beepshort(); ) ;
528
+          MENUITEM(  lcdprintPGM(" Prepare \003")  ,  BLOCK;status=Main_Menu;beepshort(); ) ;
528 529
           break;
529 530
           case ItemAM_X:
530
-         // MENUITEM(  lcdprintPGM(" X+")  ,  BLOCK;enquecommand("G92 X0");enquecommand("G1 F700 X10");beepshort(); ) ;
531
-         {
531
+          {
532
+	 	  //oldencoderpos=0;
532 533
                   if(force_lcd_update)
533 534
                   {
534 535
                     lcd.setCursor(0,line);lcdprintPGM(" X:");
535
-                    lcd.setCursor(13,line);lcd.print(ftostr3(current_position[X_AXIS]));
536
+                    lcd.setCursor(13,line);lcd.print(ftostr32(current_position[X_AXIS]));
536 537
                   }
537 538
       
538 539
                   if((activeline!=line) )
@@ -543,11 +544,11 @@ void MainMenu::showAxisMove()
543 544
                     linechanging=!linechanging;
544 545
                     if(linechanging)
545 546
                     {
546
-                        encoderpos=current_position[X_AXIS];
547
+			enquecommand("G91");
547 548
                     }
548 549
                     else
549 550
                     {
550
-                      enquecommand("G1 F700 X"+encoderpos);
551
+		      enquecommand("G90");
551 552
                       encoderpos=activeline*lcdslow;
552 553
                       beepshort();
553 554
                     }
@@ -555,19 +556,29 @@ void MainMenu::showAxisMove()
555 556
                   }
556 557
                   if(linechanging)
557 558
                   {
558
-                    if(encoderpos<1) encoderpos=1;
559
-                    if(encoderpos>200) encoderpos=200;                   
560
-                    lcd.setCursor(13,line);lcd.print(current_position[X_AXIS]);
559
+                    if (encoderpos >0) 
560
+                   { 
561
+		    	enquecommand("G1 F700 X0.1");
562
+			oldencoderpos=encoderpos;
563
+                        encoderpos=0;
564
+		    }
565
+		  
566
+		    else if (encoderpos < 0)
567
+                    {
568
+		    	enquecommand("G1 F700 X-0.1");
569
+			oldencoderpos=encoderpos;
570
+                        encoderpos=0;
571
+		    }
572
+                    lcd.setCursor(13,line);lcd.print(ftostr32(current_position[X_AXIS]));
561 573
                   }
562 574
           }
563 575
           break;
564 576
           case ItemAM_Y:
565
-          //MENUITEM(  lcdprintPGM(" Y+")  ,  BLOCK;enquecommand("G92 Y0");enquecommand("G1 F700 Y10");beepshort(); ) ;
566
-          {
577
+            {
567 578
                   if(force_lcd_update)
568 579
                   {
569 580
                     lcd.setCursor(0,line);lcdprintPGM(" Y:");
570
-                    lcd.setCursor(13,line);lcd.print(ftostr3(current_position[Y_AXIS]));
581
+                    lcd.setCursor(13,line);lcd.print(ftostr32(current_position[Y_AXIS]));
571 582
                   }
572 583
       
573 584
                   if((activeline!=line) )
@@ -578,11 +589,11 @@ void MainMenu::showAxisMove()
578 589
                     linechanging=!linechanging;
579 590
                     if(linechanging)
580 591
                     {
581
-                        encoderpos=current_position[Y_AXIS];
592
+			enquecommand("G91");
582 593
                     }
583 594
                     else
584 595
                     {
585
-                      enquecommand("G1 F700 Y"+encoderpos);
596
+		      enquecommand("G90");
586 597
                       encoderpos=activeline*lcdslow;
587 598
                       beepshort();
588 599
                     }
@@ -590,34 +601,44 @@ void MainMenu::showAxisMove()
590 601
                   }
591 602
                   if(linechanging)
592 603
                   {
593
-                    if(encoderpos<1) encoderpos=1;
594
-                    if(encoderpos>200) encoderpos=200;                   
595
-                    lcd.setCursor(13,line);lcd.print(current_position[Y_AXIS]);
604
+                    if (encoderpos >0) 
605
+                   { 
606
+		    	enquecommand("G1 F700 Y0.1");
607
+			oldencoderpos=encoderpos;
608
+                        encoderpos=0;
609
+		    }
610
+		  
611
+		    else if (encoderpos < 0)
612
+                    {
613
+		    	enquecommand("G1 F700 Y-0.1");
614
+			oldencoderpos=encoderpos;
615
+                        encoderpos=0;
616
+		    }
617
+                    lcd.setCursor(13,line);lcd.print(ftostr32(current_position[Y_AXIS]));
596 618
                   }
597 619
           }
598 620
           break;
599 621
           case ItemAM_Z:
600
-          //MENUITEM(  lcdprintPGM(" Z+")  ,  BLOCK;enquecommand("G92 Z0");enquecommand("G1 F700 Z10");beepshort(); ) ;
601 622
           {
602 623
                   if(force_lcd_update)
603 624
                   {
604 625
                     lcd.setCursor(0,line);lcdprintPGM(" Z:");
605
-                    lcd.setCursor(13,line);lcd.print(ftostr3(current_position[Z_AXIS]));
626
+                    lcd.setCursor(13,line);lcd.print(ftostr32(current_position[Z_AXIS]));
606 627
                   }
607 628
       
608 629
                   if((activeline!=line) )
609 630
                   break;
610 631
                   
611
-                  if(CLICKED) 
632
+                   if(CLICKED) 
612 633
                   {
613 634
                     linechanging=!linechanging;
614 635
                     if(linechanging)
615 636
                     {
616
-                        encoderpos=current_position[Z_AXIS];
637
+			enquecommand("G91");
617 638
                     }
618 639
                     else
619 640
                     {
620
-                      enquecommand("G1 F700 Z"+encoderpos);
641
+		      enquecommand("G90");
621 642
                       encoderpos=activeline*lcdslow;
622 643
                       beepshort();
623 644
                     }
@@ -625,14 +646,25 @@ void MainMenu::showAxisMove()
625 646
                   }
626 647
                   if(linechanging)
627 648
                   {
628
-                    if(encoderpos<1) encoderpos=1;
629
-                    if(encoderpos>170) encoderpos=170;                   
630
-                    lcd.setCursor(13,line);lcd.print(current_position[Z_AXIS]);
649
+                    if (encoderpos >0) 
650
+                   { 
651
+		    	enquecommand("G1 F170 Z0.1");
652
+			oldencoderpos=encoderpos;
653
+                        encoderpos=0;
654
+		    }
655
+		  
656
+		    else if (encoderpos < 0)
657
+                    {
658
+		    	enquecommand("G1 F1700 Z-0.1");
659
+			oldencoderpos=encoderpos;
660
+                        encoderpos=0;
661
+		    }
662
+                    lcd.setCursor(13,line);lcd.print(ftostr32(current_position[Z_AXIS]));
631 663
                   }
632 664
           }
633 665
           break;
634 666
           case ItemAM_E:
635
-          MENUITEM(  lcdprintPGM(" Extrude")  ,  BLOCK;enquecommand("G92 E0");enquecommand("G1 F700 E10");beepshort(); ) ;
667
+          MENUITEM(  lcdprintPGM(" Extrude")  ,  BLOCK;enquecommand("G92 E0");enquecommand("G1 F700 E5");beepshort(); ) ;
636 668
           break;
637 669
           default:
638 670
           break;
@@ -1896,7 +1928,7 @@ void MainMenu::showSD()
1896 1928
             status=Main_Status;
1897 1929
             lcd_status(card.filename);
1898 1930
           }
1899
-        }
1931
+        } 
1900 1932
       }
1901 1933
       
1902 1934
     }

Loading…
Cancel
Save