2018-02-12 14:15:04 +00:00
|
|
|
#include "unitofmeasure.h"
|
|
|
|
|
2018-03-10 07:51:17 +00:00
|
|
|
UnitOfMeasure::UnitOfMeasure(string name, string plural, string abbreviation, int type, double coef){
|
2018-02-12 18:20:38 +00:00
|
|
|
this->name = name;
|
|
|
|
this->plural = plural;
|
2018-03-03 09:18:38 +00:00
|
|
|
this->abbreviation = abbreviation;
|
2018-03-04 08:05:20 +00:00
|
|
|
this->type = type;
|
2018-03-10 07:51:17 +00:00
|
|
|
this->metricCoefficient = coef;
|
2018-03-03 09:18:38 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
UnitOfMeasure::UnitOfMeasure(string name){
|
|
|
|
this->name = name;
|
|
|
|
this->plural = name + "s";
|
|
|
|
this->abbreviation = "NULL";
|
2018-03-04 08:05:20 +00:00
|
|
|
this->type = MISC;
|
2018-03-10 07:51:17 +00:00
|
|
|
this->metricCoefficient = 1;
|
2018-03-03 09:18:38 +00:00
|
|
|
///TODO: Make actual guessing of this stuff.
|
2018-02-12 18:20:38 +00:00
|
|
|
}
|
|
|
|
|
2018-03-10 07:51:17 +00:00
|
|
|
UnitOfMeasure::UnitOfMeasure() : UnitOfMeasure::UnitOfMeasure("", "", "", MISC, 1.0){
|
2018-02-12 19:27:27 +00:00
|
|
|
//Default constructor initializes all fields to empty strings.
|
|
|
|
}
|
|
|
|
|
2018-02-13 09:22:05 +00:00
|
|
|
string UnitOfMeasure::getName() const{
|
2018-02-12 18:20:38 +00:00
|
|
|
return this->name;
|
|
|
|
}
|
|
|
|
|
2018-02-13 09:22:05 +00:00
|
|
|
string UnitOfMeasure::getNamePlural() const{
|
2018-02-12 18:20:38 +00:00
|
|
|
return this->plural;
|
|
|
|
}
|
2018-02-12 14:15:04 +00:00
|
|
|
|
2018-02-13 09:22:05 +00:00
|
|
|
string UnitOfMeasure::getAbbreviation() const{
|
2018-03-04 08:05:20 +00:00
|
|
|
return this->abbreviation;
|
|
|
|
}
|
|
|
|
|
|
|
|
int UnitOfMeasure::getType() const{
|
|
|
|
return this->type;
|
2018-02-12 14:15:04 +00:00
|
|
|
}
|
2018-03-10 07:51:17 +00:00
|
|
|
|
|
|
|
double UnitOfMeasure::getMetricCoefficient() const{
|
|
|
|
return this->metricCoefficient;
|
|
|
|
}
|