added cache length setting
This commit is contained in:
13
caplot.py
13
caplot.py
@ -6,17 +6,19 @@ warnings.filterwarnings("error")
|
||||
|
||||
import argparse
|
||||
|
||||
parser = argparse.ArgumentParser()
|
||||
parser = argparse.ArgumentParser(formatter_class=argparse.ArgumentDefaultsHelpFormatter)
|
||||
parser.add_argument("pvname")
|
||||
parser.add_argument("-n", "--num", type=int, default=1000)
|
||||
clargs = parser.parse_args()
|
||||
|
||||
|
||||
from functools import partial
|
||||
from animation import Animation
|
||||
from plots import Plot0D, Plot1D, Plot2D
|
||||
from sources import Camera, Source
|
||||
|
||||
|
||||
def decide_src_fun(pvname):
|
||||
def decide_src_fun(pvname, num):
|
||||
pvname = pvname.upper()
|
||||
|
||||
if pvname.endswith(":FPICTURE"):
|
||||
@ -33,7 +35,9 @@ def decide_src_fun(pvname):
|
||||
|
||||
if src.nelm == 1:
|
||||
print("Scalar")
|
||||
fun = Plot0D
|
||||
if num <= 0:
|
||||
num = None
|
||||
fun = partial(Plot0D, num)
|
||||
else:
|
||||
print("Curve")
|
||||
fun = Plot1D
|
||||
@ -43,7 +47,8 @@ def decide_src_fun(pvname):
|
||||
|
||||
|
||||
pvname = clargs.pvname
|
||||
src, fun = decide_src_fun(pvname)
|
||||
num = clargs.num
|
||||
src, fun = decide_src_fun(pvname, num)
|
||||
Animation(src, fun)
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user