Skip to content

Commit

Permalink
Use human-readable strings for TextFormat enum values
Browse files Browse the repository at this point in the history
  • Loading branch information
GDYendell committed May 22, 2024
1 parent 6f4d27d commit e585fc0
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
12 changes: 6 additions & 6 deletions schemas/pvi.device.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -993,14 +993,14 @@
"TextFormat": {
"description": "Format to use for display of Text{Read,Write} widgets on a UI",
"enum": [
0,
1,
2,
3,
4
"decimal",
"hexadecimal",
"engineer",
"exponential",
"string"
],
"title": "TextFormat",
"type": "integer"
"type": "string"
},
"TextRead": {
"additionalProperties": false,
Expand Down
10 changes: 5 additions & 5 deletions src/pvi/device.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,11 @@ def enforce_pascal_case(s: str) -> str:
class TextFormat(Enum):
"""Format to use for display of Text{Read,Write} widgets on a UI"""

decimal = 0
hexadecimal = 1
engineer = 2
exponential = 3
string = 4
decimal = "decimal"
hexadecimal = "hexadecimal"
engineer = "engineer"
exponential = "exponential"
string = "string"


class AccessModeMixin(BaseModel):
Expand Down
2 changes: 1 addition & 1 deletion tests/convert/output/simDetector.pvi.device.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ children:
read_pv: $(P)$(R)XMLErrorMsg_RBV
read_widget:
type: TextRead
format: 4
format: string

- type: SignalR
name: Dimensions
Expand Down

0 comments on commit e585fc0

Please sign in to comment.