esa / opengeode

OpenGEODE - a free SDL editor
https://opengeode.net
GNU Lesser General Public License v3.0
69 stars 20 forks source link

ASN.1 compiler failed - [Errno2] No such file or directory: 'dataview-uniq.asn' #68

Closed nuaaysh closed 4 years ago

nuaaysh commented 4 years ago

Hello, I try to check my SDL model, but it returns this kind of error: ASN.1 compiler failed - [Errno2] No such file or directory: 'dataview-uniq.asn'. But the .asn file exists and is at the same folder with the .pr file. The screenshot also shows the opengeode has read the .asn file. sdl.png I follow the readme to install the asn compiler. Could you please give me some suggestions? In fact, when I try the TASTE tool, the SDL model is right.
Some information is listed as follow:

..:~$ mono /opt/asn1scc/asn1.exe -v
asn1scc version 4.2.1.3f
..:~$ echo $PATH
..:/opt/asn1scc:..
...:~$ opengeode -v
3.0.8

Best wishes,

maxime-esa commented 4 years ago

I don't understand. Your screenshot shows the ASN.1 types, meaning that the model was loaded. Can you show the complete error log on the bottom of the screen ?

nuaaysh commented 4 years ago

I check the same model and show the error information from the terminal:

...:~$ opengeode
[INFO] Model backup enabled - auto-saving every 2 minutes
[ERROR] ASN.1 compiler failed - [Errno 2] No such file or directory: 'dataview-uniq.asn'
[ERROR] Type DEVICE_PowerOn_Command not found in ASN.1 model
[ERROR] File not found: dataview-uniq.asn
[ERROR] File not found: dataview-uniq.asn
[ERROR] File not found: dataview-uniq.asn
[ERROR] Type DEVICE_PowerOn_Command not found in ASN.1 model(line 33)
[ERROR] Type Trigger not found in ASN.1 model
[ERROR] Type Trigger not found in ASN.1 model - "t Trigger"
[ERROR] Type Trigger not found in ASN.1 model(line 48)
[ERROR] Type Trigger not found in ASN.1 model - "trigger Trigger"
[ERROR] Type DEVICE_PowerOn_Command not found in ASN.1 model - "dpc DEVICE_PowerOn_Command"
[ERROR] Wrong number of parameters or type mismatch
[ERROR] In call to data_parser: Type of parameter 1 is incorrect (UnknownType) - Cannot resolve type of "dpc" - "data_parser(dpc)"
[ERROR] In "trigger:=data_parser(dpc)": Type mismatch (UnknownType vs UnknownType - Cannot resolve type of "data_parser(dpc)")
[ERROR] In call to trigger_start: Type of parameter 1 is incorrect (UnknownType) - Cannot resolve type of "trigger" - trigger_start(trigger)
[ERROR] No return value expected in procedure data_parser
maxime-esa commented 4 years ago

Can you run opengeode with the -g flag and report the output (just the exact call to the ASN.1 compiler, not all the errors afterwards)?

nuaaysh commented 4 years ago

OK, Here is the report:


...:~$ opengeode -g
[DEBUG] Starting OpenGEODE version 3.0.8
[
[DEBUG] /usr/bin/mono /opt/asn1scc/asn1.exe -customStgAstVersion 4 -customStg /opt/asn1scc/python.stg::/tmp/tmp4q9yt45d/21279baa8438f4b740b96aab7592d1dc.py -renamePolicy 0 -customIcdUper /tmp/tmp4q9yt45d/pretty_print_asn1.stg::/tmp/tmp4q9yt45d/21279baa8438f4b740b96aab7592d1dc.html dataview-uniq.asn
[DEBUG] /usr/bin/mono /opt/asn1scc/asn1.exe -customStgAstVersion 4 -customStg /opt/asn1scc/python.stg::/tmp/tmp4q9yt45d/21279baa8438f4b740b96aab7592d1dc.py -renamePolicy 0 -customIcdUper /tmp/tmp4q9yt45d/pretty_print_asn1.stg::/tmp/tmp4q9yt45d/21279baa8438f4b740b96aab7592d1dc.html dataview-uniq.asn
[DEBUG] Parsing complete. Summary, found 0 warnings and 0 errors
[DEBUG] Parsing string: /* CIF TEXT (295, 241), (538, 281) */
-- Text area for declarations and comments
use dv comment 'dataview-uniq.asn';
signal DPC(DEVICE_PowerOn_Command);
signal DCC; 
signal DSM;
/* CIF ENDTEXT */ with elem text_area
[DEBUG] Traceback (most recent call last):
  File "/home/shyuan/.local/lib/python3.8/site-packages/opengeode/Asn1scc.py", line 98, in parse_asn1
    filehash.update(open(each).read().encode('utf-8'))
FileNotFoundError: [Errno 2] No such file or directory: 'dataview-uniq.asn'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/shyuan/.local/lib/python3.8/site-packages/opengeode/ogParser.py", line 200, in set_global_DV
    DV = parse_asn1(tuple(asn1_filenames),
  File "/home/shyuan/.local/lib/python3.8/site-packages/opengeode/Asn1scc.py", line 104, in parse_asn1
    raise TypeError (str(err))
TypeError: [Errno 2] No such file or directory: 'dataview-uniq.asn'
maxime-esa commented 4 years ago

I am unable to reproduce. It's not the call to asn1scc that fails, it's the Python call to "open("dataview-uniq.asn")" that says FileNotFound. If the ASN.1 file is in the same folder as the SDL model (.pr) I do not see how this can fail.

Can you send me a tarball with the files for me to check what is going wrong?

Thanks

nuaaysh commented 4 years ago

Hi, I have sent an email to you (Maxime.Perrotin@esa.int). The attachment includes my SDL project (.pr and .asn files) Best wishes,

maxime-esa commented 4 years ago

Thanks. This should be fixed now. The tool was loosing track of the working folder when the model was loaded from a different directory.

nuaaysh commented 4 years ago

Many Thanks! I test it just now, it works! Thanks for the good SDL tool provided by you.