Bläddra i källkod

Changed display format for some numbers.

Erik van der Zalm 13 år sedan
förälder
incheckning
df1437bd86
3 ändrade filer med 28 tillägg och 27 borttagningar
  1. 0
    6
      Marlin/Marlin.pde
  2. 1
    8
      Marlin/ultralcd.h
  3. 27
    13
      Marlin/ultralcd.pde

+ 0
- 6
Marlin/Marlin.pde Visa fil

@@ -586,8 +586,6 @@ void process_commands()
586 586
         st_synchronize();
587 587
         endstops_hit_on_purpose();
588 588
       }
589
-      else
590
-      {
591 589
       #endif
592 590
       
593 591
       if((home_all_axis) || (code_seen(axis_codes[X_AXIS]))) 
@@ -599,10 +597,6 @@ void process_commands()
599 597
        HOMEAXIS(Y);
600 598
       }
601 599
       
602
-      #ifdef QUICK_HOME
603
-      }
604
-      #endif
605
-      
606 600
       if((home_all_axis) || (code_seen(axis_codes[Z_AXIS]))) {
607 601
         HOMEAXIS(Z);
608 602
       }

+ 1
- 8
Marlin/ultralcd.h Visa fil

@@ -9,18 +9,11 @@
9 9
   void beep();
10 10
   void buttons_check();
11 11
 
12
-
13 12
   #define LCD_UPDATE_INTERVAL 100
14 13
   #define STATUSTIMEOUT 15000
15
-
16
-
17
-  
18 14
   extern LiquidCrystal lcd;
19
-
20
-
15
+  
21 16
   #ifdef NEWPANEL
22
-
23
-    
24 17
     #define EN_C (1<<BLEN_C)
25 18
     #define EN_B (1<<BLEN_B)
26 19
     #define EN_A (1<<BLEN_A)

+ 27
- 13
Marlin/ultralcd.pde Visa fil

@@ -485,7 +485,7 @@ void MainMenu::showPrepare()
485 485
       MENUITEM(  lcdprintPGM(MSG_DISABLE_STEPPERS)  ,  BLOCK;enquecommand("M84");beepshort(); ) ;
486 486
       break;
487 487
     case ItemP_home:
488
-      MENUITEM(  lcdprintPGM(MSG_AUTO_HOME)  ,  BLOCK;enquecommand("G28 X-105 Y-105 Z0");beepshort(); ) ;
488
+      MENUITEM(  lcdprintPGM(MSG_AUTO_HOME)  ,  BLOCK;enquecommand("G28 X0 Y0 Z0");beepshort(); ) ;
489 489
       break;
490 490
     case ItemP_origin:
491 491
       MENUITEM(  lcdprintPGM(MSG_SET_ORIGIN)  ,  BLOCK;enquecommand("G92 X0 Y0 Z0");beepshort(); ) ;
@@ -533,7 +533,7 @@ void MainMenu::showAxisMove()
533 533
                   if(force_lcd_update)
534 534
                   {
535 535
                     lcd.setCursor(0,line);lcdprintPGM(" X:");
536
-                    lcd.setCursor(13,line);lcd.print(ftostr32(current_position[X_AXIS]));
536
+                    lcd.setCursor(11,line);lcd.print(ftostr52(current_position[X_AXIS]));
537 537
                   }
538 538
       
539 539
                   if((activeline!=line) )
@@ -569,7 +569,7 @@ void MainMenu::showAxisMove()
569 569
 			oldencoderpos=encoderpos;
570 570
                         encoderpos=0;
571 571
 		    }
572
-                    lcd.setCursor(13,line);lcd.print(ftostr32(current_position[X_AXIS]));
572
+                    lcd.setCursor(11,line);lcd.print(ftostr52(current_position[X_AXIS]));
573 573
                   }
574 574
           }
575 575
           break;
@@ -578,7 +578,7 @@ void MainMenu::showAxisMove()
578 578
                   if(force_lcd_update)
579 579
                   {
580 580
                     lcd.setCursor(0,line);lcdprintPGM(" Y:");
581
-                    lcd.setCursor(13,line);lcd.print(ftostr32(current_position[Y_AXIS]));
581
+                    lcd.setCursor(11,line);lcd.print(ftostr52(current_position[Y_AXIS]));
582 582
                   }
583 583
       
584 584
                   if((activeline!=line) )
@@ -614,7 +614,7 @@ void MainMenu::showAxisMove()
614 614
 			oldencoderpos=encoderpos;
615 615
                         encoderpos=0;
616 616
 		    }
617
-                    lcd.setCursor(13,line);lcd.print(ftostr32(current_position[Y_AXIS]));
617
+                    lcd.setCursor(11,line);lcd.print(ftostr52(current_position[Y_AXIS]));
618 618
                   }
619 619
           }
620 620
           break;
@@ -623,7 +623,7 @@ void MainMenu::showAxisMove()
623 623
                   if(force_lcd_update)
624 624
                   {
625 625
                     lcd.setCursor(0,line);lcdprintPGM(" Z:");
626
-                    lcd.setCursor(13,line);lcd.print(ftostr32(current_position[Z_AXIS]));
626
+                    lcd.setCursor(11,line);lcd.print(ftostr52(current_position[Z_AXIS]));
627 627
                   }
628 628
       
629 629
                   if((activeline!=line) )
@@ -659,7 +659,7 @@ void MainMenu::showAxisMove()
659 659
 			oldencoderpos=encoderpos;
660 660
                         encoderpos=0;
661 661
 		    }
662
-                    lcd.setCursor(13,line);lcd.print(ftostr32(current_position[Z_AXIS]));
662
+                    lcd.setCursor(11,line);lcd.print(ftostr52(current_position[Z_AXIS]));
663 663
                   }
664 664
           }
665 665
           break;
@@ -1598,7 +1598,7 @@ void MainMenu::showControlMotion()
1598 1598
       if(force_lcd_update)
1599 1599
         {
1600 1600
           lcd.setCursor(0,line);lcdprintPGM(" X steps/mm:");
1601
-          lcd.setCursor(13,line);lcd.print(itostr4(axis_steps_per_unit[0]));
1601
+          lcd.setCursor(11,line);lcd.print(ftostr52(axis_steps_per_unit[0]));
1602 1602
         }
1603 1603
         
1604 1604
         if((activeline!=line) )
@@ -1613,12 +1613,11 @@ void MainMenu::showControlMotion()
1613 1613
           }
1614 1614
           else
1615 1615
           {
1616
-            float factor=float(encoderpos)/float(axis_steps_per_unit[0]);
1616
+            float factor=float(encoderpos)/100/float(axis_steps_per_unit[0]);
1617 1617
             position[X_AXIS]=lround(position[X_AXIS]*factor);
1618 1618
             //current_position[3]*=factor;
1619
-            axis_steps_per_unit[X_AXIS]= encoderpos;
1619
+            axis_steps_per_unit[X_AXIS]= encoderpos/100.0;
1620 1620
             encoderpos=activeline*lcdslow;
1621
-              
1622 1621
           }
1623 1622
           BLOCK;
1624 1623
           beepshort();
@@ -1626,8 +1625,8 @@ void MainMenu::showControlMotion()
1626 1625
         if(linechanging)
1627 1626
         {
1628 1627
           if(encoderpos<5) encoderpos=5;
1629
-          if(encoderpos>9999) encoderpos=9999;
1630
-          lcd.setCursor(13,line);lcd.print(itostr4(encoderpos));
1628
+          if(encoderpos>99999) encoderpos=99999;
1629
+          lcd.setCursor(11,line);lcd.print(ftostr52(encoderpos/100.0));
1631 1630
         }
1632 1631
         
1633 1632
       }break;
@@ -2223,6 +2222,21 @@ char *ftostr51(const float &x)
2223 2222
   return conv;
2224 2223
 }
2225 2224
 
2225
+//  convert float to string with +123.45 format
2226
+char *ftostr52(const float &x)
2227
+{
2228
+  int xx=x*100;
2229
+  conv[0]=(xx>=0)?'+':'-';
2230
+  xx=abs(xx);
2231
+  conv[1]=(xx/10000)%10+'0';
2232
+  conv[2]=(xx/1000)%10+'0';
2233
+  conv[3]=(xx/100)%10+'0';
2234
+  conv[4]='.';
2235
+  conv[5]=(xx/10)%10+'0';
2236
+  conv[6]=(xx)%10+'0';
2237
+  conv[7]=0;
2238
+  return conv;
2239
+}
2226 2240
 
2227 2241
 #endif //ULTRA_LCD
2228 2242
 

Laddar…
Avbryt
Spara