unit JpConvs;
interface
uses
SysUtils, ConvUtils;
var
{ ************************************************************************* }
{ Distance Conversion Units }
{ basic unit of measurement is meters }
duShaku: TConvType;
duSun: TConvType;
duJyou: TConvType;
duKen: TConvType;
duHiro: TConvType;
duChou: TConvType;
duLi: TConvType;
duMon: TConvType;
{ ************************************************************************* }
{ Area Conversion Units }
{ basic unit of measurement is square meters }
auTsubo: TConvType;
auBu: TConvType;
auGou: TConvType;
auShaku: TConvType;
auSe: TConvType;
auTan: TConvType;
auDan: TConvType;
auChou: TConvType;
{ ************************************************************************* }
{ Volume Conversion Units }
{ basic unit of measurement is cubic meters }
vuShou: TConvType;
vuGou: TConvType;
vuShaku: TConvType;
vuTo: TConvType;
vuKoku: TConvType;
{ ************************************************************************* }
{ Mass Conversion Units }
{ basic unit of measurement is grams }
muKan: TConvType;
muRyou: TConvType;
muMomme: TConvType;
muKin: TConvType;
{ Constants (and their derivatives) used in this unit }
const
MetersPerShaku = 10 / 33;
MetersPerSun = MetersPerShaku / 10;
MetersPerJyou = MetersPerShaku * 10;
MetersPerKen = MetersPerShaku * 6;
MetersPerHiro = MetersPerKen;
MetersPerChou = MetersPerKen * 60;
MetersPerLi = MetersPerChou * 36;
MetersPerMon = 0.024;
SquareMetersPerTsubo = 400 / 121;
SquareMetersPerBu = SquareMetersPerTsubo;
SquareMetersPerGou = SquareMetersPerBu / 10;
SquareMetersPerShaku = SquareMetersPerGou / 10;
SquareMetersPerSe = SquareMetersPerTsubo * 30;
SquareMetersPerTan = SquareMetersPerSe * 10;
SquareMetersPerDan = SquareMetersPerTan;
SquareMetersPerChou = SquareMetersPerTan * 10;
CubicMetersPerShou = 2401 / 1331 / 1000;
CubicMetersPerGou = CubicMetersPerShou / 10;
CubicMetersPerShaku = CubicMetersPerGou / 10;
CubicMetersPerTo = CubicMetersPerShou * 10;
CubicMetersPerKoku = CubicMetersPerTo * 10;
GramsPerKan = 15 / 4 * 1000;
GramsPerRyou = GramsPerKan / 100;
GramsPerMomme = GramsPerRyou / 10;
GramsPerKin = GramsPerRyou * 16;
implementation
uses
StdConvs, JPConvsConsts, DateUtils;
initialization
{ ************************************************************************* }
{ Distance's family type }
duShaku := RegisterConversionType(cbDistance, SShakuDescription, MetersPerShaku);
duSun := RegisterConversionType(cbDistance, SSunDescription, MetersPerSun);
duJyou := RegisterConversionType(cbDistance, SJyouDescription, MetersPerJyou);
duKen := RegisterConversionType(cbDistance, SKenDescription, MetersPerKen);
duHiro := RegisterConversionType(cbDistance, SHiroDescription, MetersPerHiro);
duChou := RegisterConversionType(cbDistance, SChouDescription, MetersPerChou);
duLi := RegisterConversionType(cbDistance, SLiDescription, MetersPerLi);
duMon := RegisterConversionType(cbDistance, SMonDescription, MetersPerMOn);
{ ************************************************************************* }
{ Area's family type }
auTsubo := RegisterConversionType(cbArea, SShakuDescription, SquareMetersPerTsubo);
auBu := RegisterConversionType(cbArea, SBuDescription, SquareMetersPerBu);
auGou := RegisterConversionType(cbArea, SGouDescription, SquareMetersPerGou);
auShaku := RegisterConversionType(cbArea, SShaku2Description, SquareMetersPerShaku);
auSe := RegisterConversionType(cbArea, SSeDescription, SquareMetersPerSe);
auTan := RegisterConversionType(cbArea, STanDescription, SquareMetersPerTan);
auDan := RegisterConversionType(cbArea, SDanDescription, SquareMetersPerDan);
auChou := RegisterConversionType(cbArea, SChou2Description, SquareMetersPerChou);
{ ************************************************************************* }
{ Volume Conversion Units }
vuShou := RegisterConversionType(cbVolume, SShouDescription, CubicMetersPerShou);
vuGou := RegisterConversionType(cbVolume, SGou2Description, CubicMetersPerGou);
vuShaku := RegisterConversionType(cbVolume, SShaku3Description, CubicMetersPerShaku);
vuTo := RegisterConversionType(cbVolume, SToDescription, CubicMetersPerTo);
vuKoku := RegisterConversionType(cbVolume, SKokuDescription, CubicMetersPerKoku);
{ ************************************************************************* }
{ Mass's family type }
muKan := RegisterConversionType(cbMass, SKanDescription, GramsPerKan);
muRyou := RegisterConversionType(cbMass, SRyouDescription, GramsPerRyou);
muMomme := RegisterConversionType(cbMass, SMommeDescription, GramsPerMomme);
muKin := RegisterConversionType(cbMass, SKinDescription, GramsPerKin);
end.
|