Rename AuDaGeFrame "type" column to "datatype".

This commit is contained in:
2026-11-17 12:31:47 -06:00
parent 358b5a538c
commit 1f2a6adb83
20 changed files with 59 additions and 31 deletions

View File

@@ -91,7 +91,7 @@ export:
tagname:
translate:
columns: Name
type:
datatype:
const: REAL
address:
const: ""

View File

@@ -13,10 +13,10 @@ import:
type: str
translate:
columns: tagname
type:
datatype:
type: str
translate:
columns: type
columns: datatype
address:
type: str
translate:
@@ -29,9 +29,9 @@ export:
tagname:
translate:
columns: tagname
type:
datatype:
translate:
columns: type
columns: datatype
address:
translate:
columns: address

30
extensions/csv.yaml Normal file
View File

@@ -0,0 +1,30 @@
$schema: >-
https://primegit.primecontrols-dev.com/j.lucas/AuDaGe/raw/branch/main/extensions/schema.yaml
format: csv
import:
columns:
tagname:
translate:
columns: tagname
datatype:
translate:
columns: type
address:
translate:
columns: address
comment:
translate:
columns: comment
export:
tagname:
translate:
columns: tagname
datatype:
translate:
columns: datatype
address:
translate:
columns: address
comment:
translate:
columns: comment

View File

@@ -99,7 +99,7 @@ export:
tagname:
translate:
columns: Tag Name
type:
datatype:
const: "String[82]"
address:
const: ""

View File

@@ -99,7 +99,7 @@ export:
tagname:
translate:
columns: tagname
type:
datatype:
const: ""
address:
const: ""

View File

@@ -132,7 +132,7 @@ export:
tagname:
translate:
columns: tagname
type:
datatype:
const: ""
address:
const: ""

View File

@@ -33,7 +33,7 @@ export:
tagname:
translate:
columns: tagname
type:
datatype:
const: ""
address:
const: ""

View File

@@ -42,7 +42,7 @@ export:
tagname:
translate:
columns: tagname
type:
datatype:
const: ""
address:
const: ""

View File

@@ -33,7 +33,7 @@ export:
tagname:
translate:
columns: tagname
type:
datatype:
const: ""
address:
const: ""

View File

@@ -59,7 +59,7 @@ export:
tagname:
translate:
columns: tagname
type:
datatype:
const: ""
address:
const: ""

View File

@@ -1,7 +1,5 @@
$schema: "\
https://primegit.primecontrols-dev.com/j.lucas/AuDaGe/raw/branch/\
main/extensions/schema.yaml
"
$schema: >-
https://primegit.primecontrols-dev.com/j.lucas/AuDaGe/raw/branch/main/extensions/schema.yaml
format: csv
import:
filter:
@@ -48,7 +46,7 @@ import:
- Double
- String
translate:
columns: type
columns: datatype
operations:
operation: type_iec_to_opcua
Respect Data Type:
@@ -122,7 +120,7 @@ export:
tagname:
translate:
columns: Tag Name
type:
datatype:
translate:
columns: Data Type
operations:

View File

@@ -122,7 +122,7 @@ export:
tagname:
translate:
columns: Tag Name
type:
datatype:
translate:
columns: Data Type
operations:

View File

@@ -122,7 +122,7 @@ export:
tagname:
translate:
columns: Tag Name
type:
datatype:
translate:
columns: Data Type
operations:

View File

@@ -122,7 +122,7 @@ export:
tagname:
translate:
columns: Tag Name
type:
datatype:
translate:
columns: Data Type
operations:

View File

@@ -122,7 +122,7 @@ export:
tagname:
translate:
columns: Tag Name
type:
datatype:
translate:
columns: Data Type
operations:

View File

@@ -122,7 +122,7 @@ export:
tagname:
translate:
columns: Tag Name
type:
datatype:
translate:
columns: Data Type
operations:

View File

@@ -371,7 +371,7 @@ properties:
properties:
tagname:
$ref: "#/$defs/exportColumn"
type:
datatype:
$ref: "#/$defs/exportColumn"
address:
$ref: "#/$defs/exportColumn"

View File

@@ -211,7 +211,7 @@ class AuDaGeMandatoryColumns(BetterStrEnum):
"""Enum of columns required by AuDaGeFrame."""
TAGNAME = "tagname"
TYPE = "type"
DATATYPE = "datatype"
ADDRESS = "address"
COMMENT = "comment"

View File

@@ -217,7 +217,7 @@ class IECType:
lambda row: f"{name}[{','.join(str(dim) for dim in row)}]",
axis=1,
),
AC.M.TYPE: str(self.array_type),
AC.M.DATATYPE: str(self.array_type),
AC.M.ADDRESS: [
self.array_type.length * i for i in range(len(all_indices))
],
@@ -312,7 +312,7 @@ class IECType:
match = re.match(STRING_SPEC_PATTERN, spec, re.IGNORECASE)
try:
# Unresolved attribute is handled by `except AttributeError` below.
# ty: ignore[unresolved-attribute]
# ty: ignore[missing-union-attribute]
length = int(match.group(1)) * DataUnit.BYTE
if length <= 0:
raise InvalidSpecError(

View File

@@ -6,15 +6,15 @@ from AuDaGe.frame import AuDaGeFrame
class TestAuDaGeFrame(unittest.TestCase):
def test_init(self):
valid_af = {
"name": ["a", "b", "c"],
"type": ["d", "e", "f"],
"tagname": ["a", "b", "c"],
"datatype": ["d", "e", "f"],
"address": [1, 2, 3],
"comment": ["g", "h", "i"],
}
self.assertTrue(AuDaGeFrame(valid_af).is_valid())
invalid_af = {
"name": ["a", "b", "c"],
# "type": ["d", "e", "f"],
"tagname": ["a", "b", "c"],
# "datatype": ["d", "e", "f"],
"address": [1, 2, 3],
"comment": ["g", "h", "i"],
}