This commit is contained in:
Itai Nahshon
2017-07-18 17:41:51 +02:00
committed by wmayer
parent a91c5bbae7
commit 29ff650f65
3 changed files with 15 additions and 12 deletions
+3 -3
View File
@@ -1,5 +1,5 @@
/***************************************************************************
* Copyright (c) 2009 Juergen Riegel ([email protected]> *
* Copyright (c) 2009 Juergen Riegel ([email protected]> *
* *
* This file is part of the FreeCAD CAx development system. *
* *
@@ -40,8 +40,8 @@ enum UnitSystem {
ImperialDecimal = 3, /** Imperial with length in inch only */
Centimeters = 4, /** All lengths in centimeters, areas and volumes in square/cubic meters */
ImperialBuilding = 5, /** All lengths in feet + inches + fractions */
MmMin = 6, /** All lengths in mm, Speed in mm/min. Usefull for small parts & CNN */
} ;
MmMin = 6, /** Lengths in mm, Speed in mm/min. Angle in degrees. Useful for small parts & CNC */
};
/** The UnitSchema class
+7 -4
View File
@@ -40,10 +40,13 @@ using namespace Base;
QString UnitsSchemaMmMin::schemaTranslate(const Quantity &quant, double &factor, QString &unitString)
{
Unit unit = quant.getUnit();
if (unit == Unit::Angle) {
// TODO Cascade for the Areas
// default action for all cases without special treatment:
unitString = QString::fromUtf8("\xC2\xB0");
if (unit == Unit::Length) {
unitString = QString::fromLatin1("mm");
factor = 1.0;
}
else if (unit == Unit::Angle) {
//unitString = QString::fromUtf8("\xC2\xB0");
unitString = QString::fromUtf8(u8"\u00B0");
factor = 1.0;
}
else if (unit == Unit::Velocity) {
+5 -5
View File
@@ -1,5 +1,5 @@
/***************************************************************************
* Copyright (c) 2009 Juergen Riegel ([email protected]> *
* Copyright (c) 2009 Juergen Riegel ([email protected]> *
* *
* This file is part of the FreeCAD CAx development system. *
* *
@@ -32,10 +32,10 @@
namespace Base {
/** The standard units schema
* Here is defined what internal (base) units FreeCAD uses.
* FreeCAD uses a mm/kg/deg scala.
* Also it defines how the units get presented.
/* Metric units schema intended for design of small parts and for CNC
* Lengths are alwais in mm.
* Angles in degrees (use degree symbol)
* Velocities in mm/min (as used in g-code).
*/
class UnitsSchemaMmMin: public UnitsSchema
{