-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun_oneline.py
More file actions
71 lines (38 loc) · 1.35 KB
/
Copy pathrun_oneline.py
File metadata and controls
71 lines (38 loc) · 1.35 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
"""
written by Anton Lodder 2012-2014
all rights reserved.
This software is the property of the author and may not be copied,
sold or redistributed without expressed consent of the author.
"""
"""
This script will build a oneline diagram of a given system file. For
information on how to build a valid system file see HOWTO.txt
--------------------
How to run this file
--------------------
to run this file, make sure that you have a
python distribution installed as well as
Numpy and Scipy packages, and that both python and
the pytreemap library are in your PATH.
Then, in a command prompt type
>>> python run_oneline.py
To specify a system file to be drawn, use
>>> python run_oneline.py [system_file]
e.g.
>>> python run_pytreemap.py case30_geometry.json
"""
import sys
from pytreemap.system.PowerNetwork import OneLineWidget
from pytreemap.visualize.VisBuilder import JSON_systemFile
from PySide.QtGui import QApplication
#get system system_file
system_file= sys.argv[1] if len(sys.argv)>1 else 'case30_geometry.json'
#start QApplication service
app = QApplication(sys.argv)
#load system file
mSystem = JSON_systemFile(sys=system_file)
els = mSystem.Transformers + mSystem.Branches + mSystem.Buses + mSystem.Generators
#build visualization
myVis = OneLineWidget(els)
#run
sys.exit(app.exec_())