Commit bbabaf97 authored by Maxime Perrotin's avatar Maxime Perrotin
Browse files

Create simpler dataviews

parent aa4b5e3a
...@@ -42,39 +42,51 @@ else ...@@ -42,39 +42,51 @@ else
BEGIN BEGIN
IMPORTS T-Int32, T-UInt32, T-Int8, T-UInt8, T-Boolean FROM TASTE-BasicTypes; IMPORTS T-Int32, T-UInt32, T-Int8, T-UInt8, T-Boolean FROM TASTE-BasicTypes;
TASTE-Boolean ::= BOOLEAN
-- ASN.1 Type definitions must start with an uppercase -- ASN.1 Type definitions must start with an uppercase
-- Field names in records (SEQUENCE) must start with a lowercase -- Field names in records (SEQUENCE) must start with a lowercase
-- Underscores are not allowed: use dash (hyphen) -- Underscores are not allowed: use dash (hyphen)
-- Simple types: -- Simple types:
MyInteger ::= INTEGER (0..255) -- MyInteger ::= INTEGER (0..255)
MyReal ::= REAL (0.0 .. 1000.0) -- MyReal ::= REAL (0.0 .. 1000.0)
MyBool ::= BOOLEAN -- MyBool ::= BOOLEAN
MyEnum ::= ENUMERATED { hello, world, how-are-you } -- MyEnum ::= ENUMERATED { hello, world, how-are-you }
-- Complex types: -- Complex types:
MySeq ::= SEQUENCE { -- MySeq ::= SEQUENCE {
input-data MyInteger, -- input-data MyInteger,
output-data MyInteger, -- output-data MyInteger,
validity ENUMERATED { valid, invalid } -- validity ENUMERATED { valid, invalid }
} -- }
--
MyChoice ::= CHOICE { -- MyChoice ::= CHOICE {
a BOOLEAN, -- a BOOLEAN,
b MySeq -- b MySeq
} -- }
--
MySeqOf ::= SEQUENCE (SIZE (2)) OF MyEnum -- MySeqOf ::= SEQUENCE (SIZE (2)) OF MyEnum
--
-- MyOctStr ::= OCTET STRING (SIZE (3))
--
-- -- You can also declare constants
-- myVar MySeqOf ::= { hello, world }
MyOctStr ::= OCTET STRING (SIZE (3)) END
' > DataView.asn
echo 'TASTE-Dataview DEFINITIONS ::= BEGIN
-- You can also declare constants -- In this ACN model, you can specify custom binary encoding rules for
myVar MySeqOf ::= { hello, world } -- your data types. For example if you require a specific memory layout
-- for a record, or need to add padding fields, define endianness, etc.
-- you can do that with ACN. Refer to the ACN user manual for details.
-- TASTE-Boolean []
END END
' > DataView.asn ' > DataView.acn
fi fi
if [ -z $NONINTERACTIVE ] if [ -z $NONINTERACTIVE ]
...@@ -83,7 +95,7 @@ then ...@@ -83,7 +95,7 @@ then
echo -e "${INFO} Converting the data view to AADL..." echo -e "${INFO} Converting the data view to AADL..."
fi fi
cp $(taste-config --prefix)/share/taste-types/taste-types.asn . # cp $(taste-config --prefix)/share/taste-types/taste-types.asn .
taste-update-data-view taste-update-data-view
......
...@@ -25,7 +25,7 @@ if [ ! -f DataView.aadl ] ...@@ -25,7 +25,7 @@ if [ ! -f DataView.aadl ]
then then
echo -e "${INFO} Creating a default ASN.1 data model." echo -e "${INFO} Creating a default ASN.1 data model."
NONINTERACTIVE=1 taste-create-data-view NONINTERACTIVE=1 taste-create-data-view
NONINTERACTIVE=1 taste-create-acn-model #NONINTERACTIVE=1 taste-create-acn-model
else else
echo -e "${INFO} Using existing DataView.aadl" echo -e "${INFO} Using existing DataView.aadl"
fi fi
......
...@@ -127,7 +127,7 @@ class MyDialog(QDialog): ...@@ -127,7 +127,7 @@ class MyDialog(QDialog):
def periodic_update(self): def periodic_update(self):
self.current_value += 5 self.current_value += 5
if self.current_value >= self.target_value: if self.current_value >= self.target_value:
self.current_value = self.target_value - 1 self.current_value = self.target_value
else: else:
QTimer.singleShot(200, self.periodic_update) QTimer.singleShot(200, self.periodic_update)
self.bar.setValue(self.current_value) self.bar.setValue(self.current_value)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment