-
Notifications
You must be signed in to change notification settings - Fork 2
/
graph2poris.py
23 lines (16 loc) · 1.04 KB
/
graph2poris.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# Note, thanks to https://github.com/viperior/graphml-interpreter
import argparse # This library allows us to easily parse the command line arguments
from graph2porisprocess import *
######### WE WILL PARSE THE COMMAND LINE ARGUMENTS FOR THE WRAPPER GEN #############
parser = argparse.ArgumentParser(description='Launches a PORIS device generation ODS from an GraphML diagram describing the PORIS instrument')
## The second argument is the api ODS file
parser.add_argument('sys_file',type=argparse.FileType('r'), help="the path of a file containing the PORIS instrument diagram")
# Obtaining the arguments from the command line
args=parser.parse_args()
# Printing the obtained arguments:
print("/* The PORIS instrument diagram filename is:",args.sys_file.name+" */")
deviceName = Path(args.sys_file.name).stem
print("Device name:",deviceName)
# As an example of a constant defined in the configuration file, we'll print the welcome message
print(config.welcome_message)
create_ods_file_from_graphml_file(args.sys_file.name,deviceName)