-
Notifications
You must be signed in to change notification settings - Fork 208
/
LengthDescription.ts
72 lines (61 loc) · 2.66 KB
/
LengthDescription.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
/*---------------------------------------------------------------------------------------------
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
* See LICENSE.md in the project root for license terms and full copyright notice.
*--------------------------------------------------------------------------------------------*/
/** @packageDocumentation
* @module Properties
*/
import { IModelApp } from "../IModelApp";
import { QuantityType } from "../quantity-formatting/QuantityFormatter";
import { FormattedQuantityDescription } from "./FormattedQuantityDescription";
/**
* Length Property Description
* @beta
*/
export class LengthDescription extends FormattedQuantityDescription {
constructor(name?: string, displayLabel?: string, iconSpec?: string) {
const defaultName = "length";
super(
name ? name : defaultName,
displayLabel ? displayLabel : IModelApp.localization.getLocalizedString("iModelJs:Properties.Length"),
iconSpec,
);
}
public get formatterQuantityType(): QuantityType { return QuantityType.Length; }
public get quantityType(): string { return "Length"; }
public get parseError(): string { return IModelApp.localization.getLocalizedString("iModelJs:Properties.UnableToParseLength"); }
}
/**
* Survey Length Property Description
* @beta
*/
export class SurveyLengthDescription extends FormattedQuantityDescription {
constructor(name?: string, displayLabel?: string, iconSpec?: string) {
const defaultName = "surveyLength";
super(
name ? name : defaultName,
displayLabel ? displayLabel : IModelApp.localization.getLocalizedString("iModelJs:Properties.Length"),
iconSpec,
);
}
public get formatterQuantityType(): QuantityType { return QuantityType.LengthSurvey; }
public get quantityType(): string { return "LengthSurvey"; }
public get parseError(): string { return IModelApp.localization.getLocalizedString("iModelJs:Properties.UnableToParseLength"); }
}
/**
* Engineering Length Property Description
* @beta
*/
export class EngineeringLengthDescription extends FormattedQuantityDescription {
constructor(name?: string, displayLabel?: string, iconSpec?: string) {
const defaultName = "engineeringLength";
super(
name ? name : defaultName,
displayLabel ? displayLabel : IModelApp.localization.getLocalizedString("iModelJs:Properties.Length"),
iconSpec,
);
}
public get formatterQuantityType(): QuantityType { return QuantityType.LengthEngineering; }
public get quantityType(): string { return "LengthEngineering"; }
public get parseError(): string { return IModelApp.localization.getLocalizedString("iModelJs:Properties.UnableToParseLength"); }
}