holado 0.4.2__py3-none-any.whl → 0.5.2__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of holado might be problematic. Click here for more details.
- holado/common/context/session_context.py +6 -0
- {holado-0.4.2.dist-info → holado-0.5.2.dist-info}/METADATA +1 -1
- {holado-0.4.2.dist-info → holado-0.5.2.dist-info}/RECORD +57 -28
- holado_ais/ais/ais_messages.py +44 -15
- holado_ais/ais/patch_pyais.py +47 -176
- holado_ais/tests/behave/steps/ais/ais_messages_steps.py +2 -6
- holado_core/common/resource/persisted_data_manager.py +4 -5
- holado_core/common/resource/resource_manager.py +4 -18
- holado_core/common/tools/converters/converter.py +14 -3
- holado_core/common/tools/tools.py +9 -2
- holado_data/data/generator/generator_manager.py +1 -13
- holado_db/tools/db/clients/base/db_audit.py +94 -0
- holado_db/tools/db/clients/base/db_client.py +145 -59
- holado_db/tools/db/clients/postgresql/postgresql_audit.py +75 -0
- holado_db/tools/db/clients/postgresql/postgresql_client.py +4 -0
- holado_db/tools/db/clients/sqlite/sqlite_audit.py +70 -0
- holado_db/tools/db/clients/sqlite/sqlite_client.py +4 -0
- holado_django/server/patch_djangogrpcframework.py +46 -0
- holado_logging/common/logging/holado_logger.py +1 -6
- holado_multitask/multithreading/thread.py +13 -7
- holado_multitask/multithreading/timer.py +3 -0
- holado_python/common/tools/datetime.py +31 -13
- holado_python/standard_library/ssl/resources/certificates/tcpbin.crt +16 -16
- holado_python/standard_library/ssl/resources/certificates/tcpbin.key +26 -26
- holado_rabbitmq/tools/rabbitmq/rabbitmq_blocking_client.py +24 -2
- holado_rabbitmq/tools/rabbitmq/rabbitmq_client.py +2 -2
- holado_report/report/builders/failure_report_builder.py +129 -0
- holado_report/report/report_manager.py +4 -0
- holado_rest/api/rest/rest_client.py +19 -7
- holado_rest/tests/behave/steps/api/rest_client_steps.py +1 -2
- test_holado/features/NonReg/holado_ais/message_types/type-10.feature +38 -0
- test_holado/features/NonReg/holado_ais/message_types/type-12.feature +37 -0
- test_holado/features/NonReg/holado_ais/message_types/type-14.feature +36 -0
- test_holado/features/NonReg/holado_ais/message_types/type-15.feature +36 -0
- test_holado/features/NonReg/holado_ais/message_types/type-16.feature +38 -0
- test_holado/features/NonReg/holado_ais/message_types/type-17.feature +46 -0
- test_holado/features/NonReg/holado_ais/message_types/type-18.feature +37 -0
- test_holado/features/NonReg/holado_ais/message_types/type-19.feature +38 -0
- test_holado/features/NonReg/holado_ais/message_types/type-1_2_3.feature +42 -0
- test_holado/features/NonReg/holado_ais/message_types/type-20.feature +38 -0
- test_holado/features/NonReg/holado_ais/message_types/type-21.feature +37 -0
- test_holado/features/NonReg/holado_ais/message_types/type-22.feature +84 -0
- test_holado/features/NonReg/holado_ais/message_types/type-23.feature +49 -0
- test_holado/features/NonReg/holado_ais/message_types/type-24.feature +72 -0
- test_holado/features/NonReg/holado_ais/message_types/type-25.feature +143 -0
- test_holado/features/NonReg/holado_ais/message_types/type-26.feature +144 -0
- test_holado/features/NonReg/holado_ais/message_types/type-27.feature +36 -0
- test_holado/features/NonReg/holado_ais/message_types/type-4_11.feature +39 -0
- test_holado/features/NonReg/holado_ais/message_types/type-5.feature +33 -0
- test_holado/features/NonReg/holado_ais/message_types/type-6.feature +37 -0
- test_holado/features/NonReg/holado_ais/message_types/type-7_13.feature +43 -0
- test_holado/features/NonReg/holado_ais/message_types/type-8.feature +37 -0
- test_holado/features/NonReg/holado_ais/message_types/type-9.feature +37 -0
- test_holado/tools/django/api_grpc/manage.py +2 -0
- test_holado/tools/django/api_grpc/patch_djangogrpcframework.py +42 -0
- {holado-0.4.2.dist-info → holado-0.5.2.dist-info}/WHEEL +0 -0
- {holado-0.4.2.dist-info → holado-0.5.2.dist-info}/licenses/LICENSE +0 -0
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
@ais
|
|
2
|
+
@type_27
|
|
3
|
+
Feature: Message type 27
|
|
4
|
+
|
|
5
|
+
Scenario: Create, convert, encode and decode message for Channel A
|
|
6
|
+
# Create message
|
|
7
|
+
When MESSAGE = new AIS message of type 'T27_LONG_RANG_AIS_BROADCAST_MESSAGE'
|
|
8
|
+
| repeat | mmsi | accuracy | raim | status | lon | lat | speed | course | gnss |
|
|
9
|
+
| 1 | 235006280 | True | False | 1 | 65.2 | 20.3 | 11.0 | 6.0 | True |
|
|
10
|
+
|
|
11
|
+
# Verify bytes conversion
|
|
12
|
+
When MESSAGE_TO_BYTES = convert AIS message MESSAGE to bytes
|
|
13
|
+
When MESSAGE_BYTES = new AIS message of type 'T27_LONG_RANG_AIS_BROADCAST_MESSAGE' as bitarray bytes
|
|
14
|
+
| repeat | mmsi | accuracy | raim | status | lon | lat | speed | course | gnss |
|
|
15
|
+
| 1 | 235006280 | True | False | 1 | 65.2 | 20.3 | 11.0 | 6.0 | True |
|
|
16
|
+
Then MESSAGE_TO_BYTES == MESSAGE_BYTES
|
|
17
|
+
|
|
18
|
+
# Encode in NMEA
|
|
19
|
+
When NMEA_SENTENCES = encode AIS raw payload MESSAGE_BYTES to NMEA
|
|
20
|
+
| talker_id | radio_channel | seq_id | group_id |
|
|
21
|
+
| 'AIVDM' | 'A' | 0 | 0 |
|
|
22
|
+
Then ${len(NMEA_SENTENCES)} == 1
|
|
23
|
+
|
|
24
|
+
# Verify some NMEA fields
|
|
25
|
+
Given STRING_NMEA_MSG = split NMEA AIS message NMEA_SENTENCES[0] to fields
|
|
26
|
+
Then STRING_NMEA_MSG[-3] == 'A'
|
|
27
|
+
|
|
28
|
+
# Decode NMEA message
|
|
29
|
+
Given DECODED_NMEA_MESSAGE = decode NMEA AIS message NMEA_SENTENCES as dictionnary
|
|
30
|
+
When DECODED_NMEA_MESSAGE_TABLE = convert dictionary DECODED_NMEA_MESSAGE to table with keys as columns
|
|
31
|
+
Then table DECODED_NMEA_MESSAGE_TABLE is
|
|
32
|
+
| accuracy | course | gnss | lat | lon | mmsi | msg_type | raim | repeat | speed | status |
|
|
33
|
+
| True | 6.0 | True | 20.3 | 65.2 | 235006280 | 27 | False | 1 | 11.0 | N/A |
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
@ais
|
|
2
|
+
@type_4
|
|
3
|
+
@type_11
|
|
4
|
+
Feature: Message types 4 and 11 : Base Station Report
|
|
5
|
+
|
|
6
|
+
Scenario Outline: Create, convert, encode and decode message
|
|
7
|
+
# Create message
|
|
8
|
+
When MESSAGE = new AIS message of type '<message_type>'
|
|
9
|
+
| repeat | mmsi | year | month | day | hour | minute | second | accuracy | lon | lat | epfd | raim | radio |
|
|
10
|
+
| 1 | 235006280 | 2024 | 01 | 01 | 08 | 30 | 56 | True | 70.9 | 44.2 | 1 | False | 1 |
|
|
11
|
+
|
|
12
|
+
# Verify bytes conversion
|
|
13
|
+
When MESSAGE_TO_BYTES = convert AIS message MESSAGE to bytes
|
|
14
|
+
When MESSAGE_BYTES = new AIS message of type '<message_type>' as bitarray bytes
|
|
15
|
+
| repeat | mmsi | year | month | day | hour | minute | second | accuracy | lon | lat | epfd | raim | radio |
|
|
16
|
+
| 1 | 235006280 | 2024 | 01 | 01 | 08 | 30 | 56 | True | 70.9 | 44.2 | 1 | False | 1 |
|
|
17
|
+
Then MESSAGE_TO_BYTES == MESSAGE_BYTES
|
|
18
|
+
|
|
19
|
+
# Encode in NMEA
|
|
20
|
+
When NMEA_SENTENCES = encode AIS raw payload MESSAGE_BYTES to NMEA
|
|
21
|
+
| talker_id | radio_channel | seq_id | group_id |
|
|
22
|
+
| 'AIVDM' | <channel> | 0 | 0 |
|
|
23
|
+
Then ${len(NMEA_SENTENCES)} == 1
|
|
24
|
+
|
|
25
|
+
# Verify some NMEA fields
|
|
26
|
+
Given STRING_NMEA_MSG = split NMEA AIS message NMEA_SENTENCES[0] to fields
|
|
27
|
+
Then STRING_NMEA_MSG[-3] == <channel>
|
|
28
|
+
|
|
29
|
+
# Decode NMEA message
|
|
30
|
+
Given DECODED_NMEA_MESSAGE = decode NMEA AIS message NMEA_SENTENCES as dictionnary
|
|
31
|
+
When DECODED_NMEA_MESSAGE_TABLE = convert dictionary DECODED_NMEA_MESSAGE to table with keys as columns
|
|
32
|
+
Then table DECODED_NMEA_MESSAGE_TABLE is
|
|
33
|
+
| accuracy | day | epfd | hour | lat | lon | minute | mmsi | month | msg_type | radio | raim | repeat | second | year |
|
|
34
|
+
| True | 1 | N/A | 8 | 44.2 | 70.9 | 30 | 235006280 | 1 | <type> | 1 | False | 1 | 56 | 2024 |
|
|
35
|
+
|
|
36
|
+
Examples: With types 4 and 11
|
|
37
|
+
| message_type | type | channel |
|
|
38
|
+
| T4_BASE_STATION_REPORT | 4 | 'A' |
|
|
39
|
+
| T11_BASE_STATION_REPORT | 11 | 'A' |
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
@ais
|
|
2
|
+
@type_5
|
|
3
|
+
Feature: Message type 5 : Ship Static Data
|
|
4
|
+
|
|
5
|
+
Scenario: Create, convert, encode and decode message
|
|
6
|
+
# Create message
|
|
7
|
+
When MESSAGE = new AIS message of type 'T5_SHIP_STATIC_DATA'
|
|
8
|
+
| repeat | mmsi | ais_version | imo | callsign | shipname | ship_type | to_bow | to_stern | to_port | to_starboard | epfd | year | month | day | hour | minute | draught | destination | dte |
|
|
9
|
+
| 1 | 235006280 | 1 | 1 | 'DEL 001' | 'TITANIC' | True | True | True | True | True | 11 | 2024 | 01 | 01 | 08 | 30 | 0.0 | 'SAT KIN' | True |
|
|
10
|
+
|
|
11
|
+
# Verify bytes conversion
|
|
12
|
+
When MESSAGE_TO_BYTES = convert AIS message MESSAGE to bytes
|
|
13
|
+
When MESSAGE_BYTES = new AIS message of type 'T5_SHIP_STATIC_DATA' as bitarray bytes
|
|
14
|
+
| repeat | mmsi | ais_version | imo | callsign | shipname | ship_type | to_bow | to_stern | to_port | to_starboard | epfd | year | month | day | hour | minute | draught | destination | dte |
|
|
15
|
+
| 1 | 235006280 | 1 | 1 | 'DEL 001' | 'TITANIC' | True | True | True | True | True | 11 | 2024 | 01 | 01 | 08 | 30 | 0.0 | 'SAT KIN' | True |
|
|
16
|
+
Then MESSAGE_TO_BYTES == MESSAGE_BYTES
|
|
17
|
+
|
|
18
|
+
# Encode in NMEA
|
|
19
|
+
When NMEA_SENTENCES = encode AIS raw payload MESSAGE_BYTES to NMEA
|
|
20
|
+
| talker_id | radio_channel | seq_id | group_id |
|
|
21
|
+
| 'AIVDM' | 'A' | 0 | 0 |
|
|
22
|
+
Then ${len(NMEA_SENTENCES)} == 2
|
|
23
|
+
|
|
24
|
+
# Verify some NMEA fields
|
|
25
|
+
Given STRING_NMEA_MSG = split NMEA AIS message NMEA_SENTENCES[0] to fields
|
|
26
|
+
Then STRING_NMEA_MSG[-3] == 'A'
|
|
27
|
+
|
|
28
|
+
# Decode NMEA message
|
|
29
|
+
Given DECODED_NMEA_MESSAGE = decode NMEA AIS message NMEA_SENTENCES as dictionnary
|
|
30
|
+
When DECODED_NMEA_MESSAGE_TABLE = convert dictionary DECODED_NMEA_MESSAGE to table with keys as columns
|
|
31
|
+
Then table DECODED_NMEA_MESSAGE_TABLE is
|
|
32
|
+
| ais_version | callsign | day | destination | draught | dte | epfd | hour | imo | minute | mmsi | month | msg_type | repeat | ship_type | shipname | to_bow | to_port | to_starboard | to_stern |
|
|
33
|
+
| 1 | 'DEL 001' | 1 | 'SAT KIN' | 0.0 | True | N/A | 8 | 1 | 30 | 235006280 | 1 | 5 | 1 | N/A | 'TITANIC' | 1 | 1 | 1 | 1 |
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
@ais
|
|
2
|
+
@type_6
|
|
3
|
+
Feature: Message type 6 : Addressed Binary Message
|
|
4
|
+
|
|
5
|
+
Scenario: Create, convert, encode and decode message
|
|
6
|
+
# Create message
|
|
7
|
+
When MESSAGE = new AIS message of type 'T6_ADDRESSED_BINARY_MESSAGE'
|
|
8
|
+
| repeat | mmsi | seqno | dest_mmsi | retransmit | dac | fid | data |
|
|
9
|
+
| 1 | 235006280 | 3 | 23200002 | True | 1 | 1 | b'15007B00' |
|
|
10
|
+
|
|
11
|
+
# Verify bytes conversion
|
|
12
|
+
When MESSAGE_TO_BYTES = convert AIS message MESSAGE to bytes
|
|
13
|
+
When MESSAGE_BYTES = new AIS message of type 'T6_ADDRESSED_BINARY_MESSAGE' as bitarray bytes
|
|
14
|
+
| repeat | mmsi | seqno | dest_mmsi | retransmit | dac | fid | data |
|
|
15
|
+
| 1 | 235006280 | 3 | 23200002 | True | 1 | 1 | b'15007B00' |
|
|
16
|
+
Then MESSAGE_TO_BYTES == MESSAGE_BYTES
|
|
17
|
+
|
|
18
|
+
# Encode in NMEA
|
|
19
|
+
When NMEA_SENTENCES = encode AIS raw payload MESSAGE_BYTES to NMEA
|
|
20
|
+
| talker_id | radio_channel | seq_id | group_id |
|
|
21
|
+
| 'AIVDM' | 'A' | 0 | 0 |
|
|
22
|
+
Then ${len(NMEA_SENTENCES)} == 1
|
|
23
|
+
|
|
24
|
+
# Verify some NMEA fields
|
|
25
|
+
Given STRING_NMEA_MSG = split NMEA AIS message NMEA_SENTENCES[0] to fields
|
|
26
|
+
Then STRING_NMEA_MSG[-3] == 'A'
|
|
27
|
+
|
|
28
|
+
# Decode NMEA message
|
|
29
|
+
Given DECODED_NMEA_MESSAGE = decode NMEA AIS message NMEA_SENTENCES as dictionnary
|
|
30
|
+
When DECODED_NMEA_MESSAGE_TABLE = convert dictionary DECODED_NMEA_MESSAGE to table with keys as columns
|
|
31
|
+
Then table DECODED_NMEA_MESSAGE_TABLE is
|
|
32
|
+
| dac | data | dest_mmsi | fid | mmsi | msg_type | repeat | retransmit | seqno |
|
|
33
|
+
| 1 | b'15007B00' | 23200002 | 1 | 235006280 | 6 | 1 | True | 3 |
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
@ais
|
|
2
|
+
@type_7
|
|
3
|
+
@type_13
|
|
4
|
+
Feature: Message types 7 and 13 : Binary Acknowledge
|
|
5
|
+
|
|
6
|
+
Scenario Outline: Create, convert, encode and decode message
|
|
7
|
+
# Create message
|
|
8
|
+
When MESSAGE = new AIS message of type '<message_type>'
|
|
9
|
+
| repeat | mmsi | mmsi1 | mmsiseq1 | mmsi2 | mmsiseq2 | mmsi3 | mmsiseq3 | mmsi4 | mmsiseq4 |
|
|
10
|
+
| 2 | 235006280 | 23200001 | 3 | 23200002 | 3 | 23200003 | 2 | 23200004 | 1 |
|
|
11
|
+
|
|
12
|
+
# Verify bytes conversion
|
|
13
|
+
When MESSAGE_TO_BYTES = convert AIS message MESSAGE to bytes
|
|
14
|
+
When MESSAGE_BYTES = new AIS message of type '<message_type>' as bitarray bytes
|
|
15
|
+
| repeat | mmsi | mmsi1 | mmsiseq1 | mmsi2 | mmsiseq2 | mmsi3 | mmsiseq3 | mmsi4 | mmsiseq4 |
|
|
16
|
+
| 2 | 235006280 | 23200001 | 3 | 23200002 | 3 | 23200003 | 2 | 23200004 | 1 |
|
|
17
|
+
Then MESSAGE_TO_BYTES == MESSAGE_BYTES
|
|
18
|
+
|
|
19
|
+
# Encode in NMEA
|
|
20
|
+
When NMEA_SENTENCES = encode AIS raw payload MESSAGE_BYTES to NMEA
|
|
21
|
+
| talker_id | radio_channel | seq_id | group_id |
|
|
22
|
+
| 'AIVDM' | <channel> | 0 | 0 |
|
|
23
|
+
Then ${len(NMEA_SENTENCES)} == 1
|
|
24
|
+
|
|
25
|
+
# Verify some NMEA fields
|
|
26
|
+
Given STRING_NMEA_MSG = split NMEA AIS message NMEA_SENTENCES[0] to fields
|
|
27
|
+
Then STRING_NMEA_MSG[-3] == <channel>
|
|
28
|
+
|
|
29
|
+
# Decode NMEA message
|
|
30
|
+
Given DECODED_NMEA_MESSAGE = decode NMEA AIS message NMEA_SENTENCES as dictionnary
|
|
31
|
+
When DECODED_NMEA_MESSAGE_TABLE = convert dictionary DECODED_NMEA_MESSAGE to table with keys as columns
|
|
32
|
+
Then table DECODED_NMEA_MESSAGE_TABLE is
|
|
33
|
+
| mmsi | mmsi1 | mmsi2 | mmsi3 | mmsi4 | mmsiseq1 | mmsiseq2 | mmsiseq3 | mmsiseq4 | msg_type | repeat |
|
|
34
|
+
| 235006280 | 23200001 | 23200002 | 23200003 | 23200004 | 3 | 3 | 2 | 1 | <type> | 2 |
|
|
35
|
+
|
|
36
|
+
Examples: With types 7 and 13
|
|
37
|
+
| message_type | type | channel |
|
|
38
|
+
| T7_BINARY_ACKNOWLEGDE | 7 | 'A' |
|
|
39
|
+
| T13_BINARY_ACKNOWLEGDE | 13 | 'A' |
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
@ais
|
|
2
|
+
@type_8
|
|
3
|
+
Feature: Message type 8 : Binary Broadcast Message
|
|
4
|
+
|
|
5
|
+
Scenario: Create, convert, encode and decode message
|
|
6
|
+
# Create message
|
|
7
|
+
When MESSAGE = new AIS message of type 'T8_BINARY_BROADCAST_MESSAGE'
|
|
8
|
+
| repeat | mmsi | dac | fid | data |
|
|
9
|
+
| 1 | 235006280 | 5 | 3 | b'1' |
|
|
10
|
+
|
|
11
|
+
# Verify bytes conversion
|
|
12
|
+
When MESSAGE_TO_BYTES = convert AIS message MESSAGE to bytes
|
|
13
|
+
When MESSAGE_BYTES = new AIS message of type 'T8_BINARY_BROADCAST_MESSAGE' as bitarray bytes
|
|
14
|
+
| repeat | mmsi | dac | fid | data |
|
|
15
|
+
| 1 | 235006280 | 5 | 3 | b'1' |
|
|
16
|
+
Then MESSAGE_TO_BYTES == MESSAGE_BYTES
|
|
17
|
+
|
|
18
|
+
# Encode in NMEA
|
|
19
|
+
When NMEA_SENTENCES = encode AIS raw payload MESSAGE_BYTES to NMEA
|
|
20
|
+
| talker_id | radio_channel | seq_id | group_id |
|
|
21
|
+
| 'AIVDM' | 'A' | 0 | 0 |
|
|
22
|
+
Then ${len(NMEA_SENTENCES)} == 1
|
|
23
|
+
|
|
24
|
+
# Verify some NMEA fields
|
|
25
|
+
Given STRING_NMEA_MSG = split NMEA AIS message NMEA_SENTENCES[0] to fields
|
|
26
|
+
Then STRING_NMEA_MSG[-3] == 'A'
|
|
27
|
+
|
|
28
|
+
# Decode NMEA message
|
|
29
|
+
Given DECODED_NMEA_MESSAGE = decode NMEA AIS message NMEA_SENTENCES as dictionnary
|
|
30
|
+
When DECODED_NMEA_MESSAGE_TABLE = convert dictionary DECODED_NMEA_MESSAGE to table with keys as columns
|
|
31
|
+
Then table DECODED_NMEA_MESSAGE_TABLE is
|
|
32
|
+
| dac | data | fid | mmsi | msg_type | repeat |
|
|
33
|
+
| 5 | b'1' | 3 | 235006280 | 8 | 1 |
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
@ais
|
|
2
|
+
@type_9
|
|
3
|
+
Feature: Message type 9 : Standard SAR Aircraft Position Report
|
|
4
|
+
|
|
5
|
+
Scenario: Create, convert, encode and decode message
|
|
6
|
+
# Create message
|
|
7
|
+
When MESSAGE = new AIS message of type 'T9_STANDARD_SAR_AIRCRAFT_POSITION_REPORT'
|
|
8
|
+
| repeat | mmsi | alt | speed | accuracy | lon | lat | course | second | reserved_1 | dte | assigned | raim | radio |
|
|
9
|
+
| 1 | 235006280 | 1 | 44.2 | False | 60.3 | 45.0 | 1.7 | 1 | 1 | True | True | True | 1 |
|
|
10
|
+
|
|
11
|
+
# Verify bytes conversion
|
|
12
|
+
When MESSAGE_TO_BYTES = convert AIS message MESSAGE to bytes
|
|
13
|
+
When MESSAGE_BYTES = new AIS message of type 'T9_STANDARD_SAR_AIRCRAFT_POSITION_REPORT' as bitarray bytes
|
|
14
|
+
| repeat | mmsi | alt | speed | accuracy | lon | lat | course | second | reserved_1 | dte | assigned | raim | radio |
|
|
15
|
+
| 1 | 235006280 | 1 | 44.2 | False | 60.3 | 45.0 | 1.7 | 1 | 1 | True | True | True | 1 |
|
|
16
|
+
Then MESSAGE_TO_BYTES == MESSAGE_BYTES
|
|
17
|
+
|
|
18
|
+
# Encode in NMEA
|
|
19
|
+
When NMEA_SENTENCES = encode AIS raw payload MESSAGE_BYTES to NMEA
|
|
20
|
+
| talker_id | radio_channel | seq_id | group_id |
|
|
21
|
+
| 'AIVDM' | 'A' | 0 | 0 |
|
|
22
|
+
Then ${len(NMEA_SENTENCES)} == 1
|
|
23
|
+
|
|
24
|
+
# Verify some NMEA fields
|
|
25
|
+
Given STRING_NMEA_MSG = split NMEA AIS message NMEA_SENTENCES[0] to fields
|
|
26
|
+
Then STRING_NMEA_MSG[-3] == 'A'
|
|
27
|
+
|
|
28
|
+
# Decode NMEA message
|
|
29
|
+
Given DECODED_NMEA_MESSAGE = decode NMEA AIS message NMEA_SENTENCES as dictionnary
|
|
30
|
+
When DECODED_NMEA_MESSAGE_TABLE = convert dictionary DECODED_NMEA_MESSAGE to table with keys as columns
|
|
31
|
+
Then table DECODED_NMEA_MESSAGE_TABLE is
|
|
32
|
+
| accuracy | alt | assigned | course | dte | lat | lon | mmsi | msg_type | radio | raim | repeat | reserved_1 | second | speed |
|
|
33
|
+
| False | 1 | True | 1.7 | True | 45.0 | 60.3 | 235006280 | 9 | 1 | True | 1 | 1 | 1 | 44.0 |
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
|
|
@@ -8,6 +8,8 @@ here = os.path.abspath(os.path.dirname(__file__))
|
|
|
8
8
|
path_proto = os.path.abspath(os.path.join(here, 'api_grpc', 'api1', 'proto'))
|
|
9
9
|
sys.path.insert(0, path_proto)
|
|
10
10
|
|
|
11
|
+
# Patch djangogrpcframework if installed
|
|
12
|
+
import patch_djangogrpcframework # @UnusedImport
|
|
11
13
|
|
|
12
14
|
def main():
|
|
13
15
|
"""Run administrative tasks."""
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
|
|
2
|
+
#################################################
|
|
3
|
+
# HolAdo (Holistic Automation do)
|
|
4
|
+
#
|
|
5
|
+
# (C) Copyright 2021-2025 by Eric Klumpp
|
|
6
|
+
#
|
|
7
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
8
|
+
#
|
|
9
|
+
# The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
10
|
+
|
|
11
|
+
# The Software is provided “as is”, without warranty of any kind, express or implied, including but not limited to the warranties of merchantability, fitness for a particular purpose and noninfringement. In no event shall the authors or copyright holders be liable for any claim, damages or other liability, whether in an action of contract, tort or otherwise, arising from, out of or in connection with the software or the use or other dealings in the Software.
|
|
12
|
+
#################################################
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
#################################################
|
|
16
|
+
#
|
|
17
|
+
# Patches are done to follow ITU recommendation:
|
|
18
|
+
# https://www.e-navigation.nl/sites/default/files/R-REC-M.1371-5-201402-I!!PDF-E_1.pdf
|
|
19
|
+
#
|
|
20
|
+
#################################################
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
import logging
|
|
24
|
+
|
|
25
|
+
logger = logging.getLogger(__name__)
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
# Since Django 4.1, requires_system_checks cannot be a boolean anymore.
|
|
29
|
+
# Framework djangogrpcframework is not maintained anymore.
|
|
30
|
+
# Patch it by removing reference to requires_system_checks
|
|
31
|
+
|
|
32
|
+
try:
|
|
33
|
+
import django_grpc_framework # @UnusedImport
|
|
34
|
+
with_django_grpc_framework = True
|
|
35
|
+
except:
|
|
36
|
+
with_django_grpc_framework = True
|
|
37
|
+
|
|
38
|
+
if with_django_grpc_framework:
|
|
39
|
+
from django_grpc_framework.management.commands.grpcrunserver import Command # @UnusedImport
|
|
40
|
+
del Command.requires_system_checks
|
|
41
|
+
|
|
42
|
+
|
|
File without changes
|
|
File without changes
|