forked from xpclove/autofp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
com.py
60 lines (59 loc) · 1.56 KB
/
com.py
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
import sys
import os
import setting
# import plot
import wphase
import prf2origin.prf2origin.python.prf2origin
import paramgroup
import time
run_set=setting.run_set
R={"Rp":100,"Rwp":100,"Re":100,"Chi2":100}
target={"string":'com.R["Rwp"]',"name":'Rwp'}
plot=None
show_plot=plot
sys_stdout=sys.stdout
ui=None
cycle=1
run_mode=1;
des=False;Rwplist=[];wait=0;
autofp_running=False;
origin_path=setting.run_set.origin_path;root_path=os.getcwd()
mode="ui";
log=None;logstr=""
debug=False
autofp_delay=0
text_style={"normal":"<font color=blue>",
"ok":"<font color=green>",
"rwp":"<font color=green>",
"warning":"<font color=purple>",
"error":"<font color=brown>"
}
def com_init(m,root=os.getcwd()):
global root_path,origin_path,run_set,plot,mode,show_plot,log
mode=m
if mode=="ui":
plot=__import__("plot")
show_plot=plot
root_path=os.path.abspath(root)
prf2origin.prf2origin.python.prf2origin.prf2origin_path=os.path.join(root_path,'prf2origin/prf2origin')
run_set.load_setting(path=os.path.join(root_path,"setting.txt"))
origin_path=run_set.origin_path
paramgroup.load_strategy(os.path.join(root_path,"strategy"))
#log=open("log.txt","w")
print origin_path,root_path
def com_exit():
if log!=None:
log.close()
log=None
def com_log_write(s):
global logstr,log
if log!=None:
log.write(s+"<br/>")
def com_log_open(path):
global log
log=open(path,"w")
def autofp_init():
plot.jobs_s=[]
def debug_print():
if debug==True:
0==0