Rename AuDaGeFrame "type" column to "datatype".
This commit is contained in:
@@ -91,7 +91,7 @@ export:
|
|||||||
tagname:
|
tagname:
|
||||||
translate:
|
translate:
|
||||||
columns: Name
|
columns: Name
|
||||||
type:
|
datatype:
|
||||||
const: REAL
|
const: REAL
|
||||||
address:
|
address:
|
||||||
const: ""
|
const: ""
|
||||||
|
|||||||
@@ -13,10 +13,10 @@ import:
|
|||||||
type: str
|
type: str
|
||||||
translate:
|
translate:
|
||||||
columns: tagname
|
columns: tagname
|
||||||
type:
|
datatype:
|
||||||
type: str
|
type: str
|
||||||
translate:
|
translate:
|
||||||
columns: type
|
columns: datatype
|
||||||
address:
|
address:
|
||||||
type: str
|
type: str
|
||||||
translate:
|
translate:
|
||||||
@@ -29,9 +29,9 @@ export:
|
|||||||
tagname:
|
tagname:
|
||||||
translate:
|
translate:
|
||||||
columns: tagname
|
columns: tagname
|
||||||
type:
|
datatype:
|
||||||
translate:
|
translate:
|
||||||
columns: type
|
columns: datatype
|
||||||
address:
|
address:
|
||||||
translate:
|
translate:
|
||||||
columns: address
|
columns: address
|
||||||
|
|||||||
30
extensions/csv.yaml
Normal file
30
extensions/csv.yaml
Normal 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
|
||||||
@@ -99,7 +99,7 @@ export:
|
|||||||
tagname:
|
tagname:
|
||||||
translate:
|
translate:
|
||||||
columns: Tag Name
|
columns: Tag Name
|
||||||
type:
|
datatype:
|
||||||
const: "String[82]"
|
const: "String[82]"
|
||||||
address:
|
address:
|
||||||
const: ""
|
const: ""
|
||||||
|
|||||||
@@ -99,7 +99,7 @@ export:
|
|||||||
tagname:
|
tagname:
|
||||||
translate:
|
translate:
|
||||||
columns: tagname
|
columns: tagname
|
||||||
type:
|
datatype:
|
||||||
const: ""
|
const: ""
|
||||||
address:
|
address:
|
||||||
const: ""
|
const: ""
|
||||||
|
|||||||
@@ -132,7 +132,7 @@ export:
|
|||||||
tagname:
|
tagname:
|
||||||
translate:
|
translate:
|
||||||
columns: tagname
|
columns: tagname
|
||||||
type:
|
datatype:
|
||||||
const: ""
|
const: ""
|
||||||
address:
|
address:
|
||||||
const: ""
|
const: ""
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ export:
|
|||||||
tagname:
|
tagname:
|
||||||
translate:
|
translate:
|
||||||
columns: tagname
|
columns: tagname
|
||||||
type:
|
datatype:
|
||||||
const: ""
|
const: ""
|
||||||
address:
|
address:
|
||||||
const: ""
|
const: ""
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ export:
|
|||||||
tagname:
|
tagname:
|
||||||
translate:
|
translate:
|
||||||
columns: tagname
|
columns: tagname
|
||||||
type:
|
datatype:
|
||||||
const: ""
|
const: ""
|
||||||
address:
|
address:
|
||||||
const: ""
|
const: ""
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ export:
|
|||||||
tagname:
|
tagname:
|
||||||
translate:
|
translate:
|
||||||
columns: tagname
|
columns: tagname
|
||||||
type:
|
datatype:
|
||||||
const: ""
|
const: ""
|
||||||
address:
|
address:
|
||||||
const: ""
|
const: ""
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ export:
|
|||||||
tagname:
|
tagname:
|
||||||
translate:
|
translate:
|
||||||
columns: tagname
|
columns: tagname
|
||||||
type:
|
datatype:
|
||||||
const: ""
|
const: ""
|
||||||
address:
|
address:
|
||||||
const: ""
|
const: ""
|
||||||
|
|||||||
@@ -1,7 +1,5 @@
|
|||||||
$schema: "\
|
$schema: >-
|
||||||
https://primegit.primecontrols-dev.com/j.lucas/AuDaGe/raw/branch/\
|
https://primegit.primecontrols-dev.com/j.lucas/AuDaGe/raw/branch/main/extensions/schema.yaml
|
||||||
main/extensions/schema.yaml
|
|
||||||
"
|
|
||||||
format: csv
|
format: csv
|
||||||
import:
|
import:
|
||||||
filter:
|
filter:
|
||||||
@@ -48,7 +46,7 @@ import:
|
|||||||
- Double
|
- Double
|
||||||
- String
|
- String
|
||||||
translate:
|
translate:
|
||||||
columns: type
|
columns: datatype
|
||||||
operations:
|
operations:
|
||||||
operation: type_iec_to_opcua
|
operation: type_iec_to_opcua
|
||||||
Respect Data Type:
|
Respect Data Type:
|
||||||
@@ -122,7 +120,7 @@ export:
|
|||||||
tagname:
|
tagname:
|
||||||
translate:
|
translate:
|
||||||
columns: Tag Name
|
columns: Tag Name
|
||||||
type:
|
datatype:
|
||||||
translate:
|
translate:
|
||||||
columns: Data Type
|
columns: Data Type
|
||||||
operations:
|
operations:
|
||||||
|
|||||||
@@ -122,7 +122,7 @@ export:
|
|||||||
tagname:
|
tagname:
|
||||||
translate:
|
translate:
|
||||||
columns: Tag Name
|
columns: Tag Name
|
||||||
type:
|
datatype:
|
||||||
translate:
|
translate:
|
||||||
columns: Data Type
|
columns: Data Type
|
||||||
operations:
|
operations:
|
||||||
|
|||||||
@@ -122,7 +122,7 @@ export:
|
|||||||
tagname:
|
tagname:
|
||||||
translate:
|
translate:
|
||||||
columns: Tag Name
|
columns: Tag Name
|
||||||
type:
|
datatype:
|
||||||
translate:
|
translate:
|
||||||
columns: Data Type
|
columns: Data Type
|
||||||
operations:
|
operations:
|
||||||
|
|||||||
@@ -122,7 +122,7 @@ export:
|
|||||||
tagname:
|
tagname:
|
||||||
translate:
|
translate:
|
||||||
columns: Tag Name
|
columns: Tag Name
|
||||||
type:
|
datatype:
|
||||||
translate:
|
translate:
|
||||||
columns: Data Type
|
columns: Data Type
|
||||||
operations:
|
operations:
|
||||||
|
|||||||
@@ -122,7 +122,7 @@ export:
|
|||||||
tagname:
|
tagname:
|
||||||
translate:
|
translate:
|
||||||
columns: Tag Name
|
columns: Tag Name
|
||||||
type:
|
datatype:
|
||||||
translate:
|
translate:
|
||||||
columns: Data Type
|
columns: Data Type
|
||||||
operations:
|
operations:
|
||||||
|
|||||||
@@ -122,7 +122,7 @@ export:
|
|||||||
tagname:
|
tagname:
|
||||||
translate:
|
translate:
|
||||||
columns: Tag Name
|
columns: Tag Name
|
||||||
type:
|
datatype:
|
||||||
translate:
|
translate:
|
||||||
columns: Data Type
|
columns: Data Type
|
||||||
operations:
|
operations:
|
||||||
|
|||||||
@@ -371,7 +371,7 @@ properties:
|
|||||||
properties:
|
properties:
|
||||||
tagname:
|
tagname:
|
||||||
$ref: "#/$defs/exportColumn"
|
$ref: "#/$defs/exportColumn"
|
||||||
type:
|
datatype:
|
||||||
$ref: "#/$defs/exportColumn"
|
$ref: "#/$defs/exportColumn"
|
||||||
address:
|
address:
|
||||||
$ref: "#/$defs/exportColumn"
|
$ref: "#/$defs/exportColumn"
|
||||||
|
|||||||
@@ -211,7 +211,7 @@ class AuDaGeMandatoryColumns(BetterStrEnum):
|
|||||||
"""Enum of columns required by AuDaGeFrame."""
|
"""Enum of columns required by AuDaGeFrame."""
|
||||||
|
|
||||||
TAGNAME = "tagname"
|
TAGNAME = "tagname"
|
||||||
TYPE = "type"
|
DATATYPE = "datatype"
|
||||||
ADDRESS = "address"
|
ADDRESS = "address"
|
||||||
COMMENT = "comment"
|
COMMENT = "comment"
|
||||||
|
|
||||||
|
|||||||
@@ -217,7 +217,7 @@ class IECType:
|
|||||||
lambda row: f"{name}[{','.join(str(dim) for dim in row)}]",
|
lambda row: f"{name}[{','.join(str(dim) for dim in row)}]",
|
||||||
axis=1,
|
axis=1,
|
||||||
),
|
),
|
||||||
AC.M.TYPE: str(self.array_type),
|
AC.M.DATATYPE: str(self.array_type),
|
||||||
AC.M.ADDRESS: [
|
AC.M.ADDRESS: [
|
||||||
self.array_type.length * i for i in range(len(all_indices))
|
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)
|
match = re.match(STRING_SPEC_PATTERN, spec, re.IGNORECASE)
|
||||||
try:
|
try:
|
||||||
# Unresolved attribute is handled by `except AttributeError` below.
|
# Unresolved attribute is handled by `except AttributeError` below.
|
||||||
# ty: ignore[unresolved-attribute]
|
# ty: ignore[missing-union-attribute]
|
||||||
length = int(match.group(1)) * DataUnit.BYTE
|
length = int(match.group(1)) * DataUnit.BYTE
|
||||||
if length <= 0:
|
if length <= 0:
|
||||||
raise InvalidSpecError(
|
raise InvalidSpecError(
|
||||||
|
|||||||
@@ -6,15 +6,15 @@ from AuDaGe.frame import AuDaGeFrame
|
|||||||
class TestAuDaGeFrame(unittest.TestCase):
|
class TestAuDaGeFrame(unittest.TestCase):
|
||||||
def test_init(self):
|
def test_init(self):
|
||||||
valid_af = {
|
valid_af = {
|
||||||
"name": ["a", "b", "c"],
|
"tagname": ["a", "b", "c"],
|
||||||
"type": ["d", "e", "f"],
|
"datatype": ["d", "e", "f"],
|
||||||
"address": [1, 2, 3],
|
"address": [1, 2, 3],
|
||||||
"comment": ["g", "h", "i"],
|
"comment": ["g", "h", "i"],
|
||||||
}
|
}
|
||||||
self.assertTrue(AuDaGeFrame(valid_af).is_valid())
|
self.assertTrue(AuDaGeFrame(valid_af).is_valid())
|
||||||
invalid_af = {
|
invalid_af = {
|
||||||
"name": ["a", "b", "c"],
|
"tagname": ["a", "b", "c"],
|
||||||
# "type": ["d", "e", "f"],
|
# "datatype": ["d", "e", "f"],
|
||||||
"address": [1, 2, 3],
|
"address": [1, 2, 3],
|
||||||
"comment": ["g", "h", "i"],
|
"comment": ["g", "h", "i"],
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user