52 lines
1.9 KiB
Python
52 lines
1.9 KiB
Python
|
import toml
|
||
|
import sys
|
||
|
|
||
|
# -----------------------------
|
||
|
# Functions
|
||
|
# -----------------------------
|
||
|
|
||
|
def print_text(text: str):
|
||
|
print(r'-------------------------------------------------------------------------------------------------------')
|
||
|
print(text)
|
||
|
print(r'-------------------------------------------------------------------------------------------------------')
|
||
|
|
||
|
def map_tags():
|
||
|
print("-- Mapping Tags --")
|
||
|
|
||
|
def query_vtscada():
|
||
|
print("-- Query VTScada tags --")
|
||
|
|
||
|
# -----------------------------
|
||
|
# Main
|
||
|
# -----------------------------
|
||
|
print(r' _ _ _____ _____ _______ ____ _____ _____ _____ _ _______ ____ ____ _ _____ ')
|
||
|
print(r'| | | |_ _|/ ____|__ __/ __ \| __ \|_ _/ ____| /\ | | |__ __/ __ \ / __ \| | / ____|')
|
||
|
print(r'| |__| | | | | (___ | | | | | | |__) | | || | / \ | | | | | | | | | | | | | (___ ')
|
||
|
print(r'| __ | | | \___ \ | | | | | | _ / | || | / /\ \ | | | | | | | | | | | | \___ \ ')
|
||
|
print(r'| | | |_| |_ ____) | | | | |__| | | \ \ _| || |____ / ____ \| |____ | | | |__| | |__| | |____ ____) |')
|
||
|
print(r'|_| |_|_____|_____/ |_| \____/|_| \_\_____\_____/_/ \_\______| |_| \____/ \____/|______|_____/ ')
|
||
|
|
||
|
config = toml.load("setup.toml")
|
||
|
|
||
|
tags_path = config['system']['tags_path']
|
||
|
system_timezone = config['system']['system_timezone']
|
||
|
application_user = config['user']['application_user']
|
||
|
application_pass = config['user']['application_pass']
|
||
|
real_precision = config['data']['real_precision']
|
||
|
|
||
|
if len(sys.argv) == 2:
|
||
|
query_type = sys.argv[1]
|
||
|
|
||
|
print("")
|
||
|
|
||
|
if query_type == "VTScada":
|
||
|
print_text('VTScada Data Query')
|
||
|
query_vtscada()
|
||
|
elif query_type == "AVEVA":
|
||
|
print_text('AVEVA Historian - Not Implemented')
|
||
|
elif query_type == "ClearSCADA":
|
||
|
print_text('ClearSCADA - Not Implemetned')
|
||
|
else:
|
||
|
print("Invalid arguments!")
|
||
|
|