aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNathanael Sensfelder <SpamShield0@MultiAgentSystems.org>2016-10-07 09:12:20 +0200
committerNathanael Sensfelder <SpamShield0@MultiAgentSystems.org>2016-10-07 09:12:20 +0200
commit8ded3077487e20b905edceed655d88e298285d23 (patch)
tree5c83332e6945109d3e315ca4574f918f33b79429
parent5872c303886568a7210082c0bd4b866bb8f71660 (diff)
downloadnet2rdp-8ded3077487e20b905edceed655d88e298285d23.zip
net2rdp-8ded3077487e20b905edceed655d88e298285d23.tar.bz2
Version 3, Hotfix 2.HEADmaster
-rw-r--r--CHANGELOG7
-rwxr-xr-xnet2rdp.py (renamed from tina_converter.py)9
-rw-r--r--translation_table_sample18
3 files changed, 29 insertions, 5 deletions
diff --git a/CHANGELOG b/CHANGELOG
index 43dbaaf..295f923 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -8,3 +8,10 @@ VERSION 3 (Oct. 5 2016):
Combining both of the above is allowed.
Having a translation table entry name after something already in LeJos is no
longer allowed.
+VERSION 3 HOTFIX 1 (Oct. 6 2016):
+ Fixes a programming error that made places require a label to be counted.
+VERSION 3 HOTFIX 2 (Oct. 6 2016):
+ Fixes a regex error that made places require to have a label if they had
+ tokens.
+ Correcting those two last errors removed the need for an extra place to
+ be added.
diff --git a/tina_converter.py b/net2rdp.py
index 26db9d0..2cbedd7 100755
--- a/tina_converter.py
+++ b/net2rdp.py
@@ -10,7 +10,7 @@ import re
## 'CONSTANTS' ################################################################
TINA_TRANSITION_REGEX = re.compile('tr t([0-9]+) : {(.*)} \[0,w\[ (.*) -> (.*)')
-TINA_PLACE_W_TOKEN_REGEX = re.compile('pl p([0-9]+) : .* \(([0-9]+)\)')
+TINA_PLACE_W_TOKEN_REGEX = re.compile('pl p([0-9]+) ?.* \(([0-9]+)\)')
TINA_PLACE_TOKEN_REGEX = re.compile('pl p([0-9]+) : .*')
TINA_NET_REGEX = re.compile('net (.*)')
CONDITION_OP = dict()
@@ -486,17 +486,16 @@ def convert_tina_net (net_file, tt):
print('[P] If this was unexpected, please inform the developer.')
exit(-1)
- # It appears we have to add an extra place for the output file to be accepted.
first_line = (
- str(len(tokens_at) + 1)
+ str(len(places_aliases))
+ ','
+ ','.join(
[
('0' if i not in tokens_at else tokens_at[i])
- for i in range(0, len(tokens_at))
+ for i in range(0, len(places_aliases))
]
)
- ) + ',0'
+ )
return (first_line + result)
diff --git a/translation_table_sample b/translation_table_sample
new file mode 100644
index 0000000..59e1892
--- /dev/null
+++ b/translation_table_sample
@@ -0,0 +1,18 @@
+noActions::ACTION_EN_COURS::=::0
+noAction::ACTION_EN_COURS::=::0
+arrived::FIN_MVMT::=::1
+go2Base::GO_BASE
+go2WP::GO_NEXT_WP
+noNextWP::DERNIER_WP::=::1
+hasNextWP::DERNIER_WP::=::0
+initNave::INIT_NAVE
+exit::EXIT
+go2NextWP::GO_NEXT_WP
+initLightDetector::ETALON_CAPT_LUMIERE
+raiseArm::LEVER_BRAS
+lowerArm::BAISSER_BRAS
+noDetection::LUMIERE1::<::50
+detection::LUMIERE1::>=::50
+caught::PRISE::=::1
+goDeliver::GO_LIVRAISON
+goBackToWP::GO_LAST_RD_WP