1 from __future__
import division, absolute_import
5 worry about name lengths & truncation as old tcc behaves
6 show filters not on inst blk
9 from RO.StringUtil
import quoteStr
11 from .showFocus
import showFocus
14 __all__ = [
"showInstrument"]
18 @param[in] tccActor tcc actor
20 @param[in,out] userCmd user command; if showFull is None then parsedCmd attribute must be set
21 @param[in] setDone set userCmd done when finished? (ignored if userCmd is already done)
22 @param[in] showFull if True then show all data; if False then show an abbreviated version;
23 if None then use the "full" qualifier in userCmd, if present, else use True
26 if "full" in userCmd.parsedCmd.qualDict:
27 showFull = userCmd.parsedCmd.qualDict[
"full"].boolValue
32 instPos = inst.instPos.getName()
35 kwStrs.append(
"Inst=%s; InstPos=%s; GCView=%s" % (
36 quoteStr(tccActor.inst.instName),
38 quoteStr(inst.gcViewName),
42 "T" if (inst.rotID > 0)
else "F",
43 "T" if (inst.gcamID > 0)
else "F",
44 "T" if (inst.gmechID > 0)
else "F"
46 kwStrs.append(
"IPConfig=%s; RotID=%i, 0; GCamID=%i, 0; GMechID=%i" % \
47 (ipConfig, inst.rotID, inst.gcamID, inst.gmechID))
48 kwStrs.append(
"IImScale=%0.4f, %0.4f; IImCtr=%0.2f, %0.2f; IImLim=%0.2f, %0.2f, %0.2f, %0.2f" % (
49 inst.iim_scale[0], inst.iim_scale[1],
50 inst.iim_ctr[0], inst.iim_ctr[1],
51 inst.iim_minXY[0], inst.iim_minXY[1],
52 inst.iim_maxXY[0], inst.iim_maxXY[1],
54 kwStrs.append(
"InstFocus=%0.2f" % (inst.inst_foc,))
55 kwStrs.append(
"RotInstXYAng=%0.6f, %0.6f, %0.6f" % (
61 kwStrs.append(
"GImScale=%0.4f, %0.4f; GImCtr=%0.2f, %0.2f; GImLim=%0.2f, %0.2f, %0.2f, %0.2f" % (
62 inst.gim_scale[0], inst.gim_scale[1],
63 inst.gim_ctr[0], inst.gim_ctr[1],
64 inst.gim_minXY[0], inst.gim_minXY[1],
65 inst.gim_maxXY[0], inst.gim_maxXY[1],
67 kwStrs.append(
"GCNomFocus=%0.2f" % (inst.gcNomFocus,))
69 kwStrs.append(
"GImScale=NaN, NaN; GImCtr=NaN, NaN; GImLim=NaN, NaN, NaN, NaN")
70 kwStrs.append(
"GCNomFocus=NaN")
71 kwStrs.append(
"PtErrProbe=%d" % (inst.ptErrProbe),)
72 for i, probe
in enumerate(inst.gProbe):
74 kwStrs.append(
"GProbeInfo=%d, %s, %0.2f, %0.2f, %0.2f, %0.2f, %0.2f, %0.2f, %0.6f, %0.6f, %0.5f" % (
76 "T" if probe.exists
else "F",
77 probe.ctr[0], probe.ctr[1],
78 probe.minXY[0], probe.minXY[1],
79 probe.maxXY[0], probe.maxXY[1],
80 probe.rot_gp_xy[0], probe.rot_gp_xy[1],
84 kwStrs.append(
"GProbe=%d; GPCtr=%0.2f, %0.2f; GPLim=%0.2f, %0.2f, %0.2f, %0.2f" % (
86 probe.ctr[0], probe.ctr[1],
87 probe.minXY[0], probe.minXY[1],
88 probe.maxXY[0], probe.maxXY[1],
92 tccActor.writeToUsers(
"i", kwStr, userCmd)
95 showFocus(tccActor, userCmd, setDone=
False)
96 if setDone
and not userCmd.isDone:
97 userCmd.setState(userCmd.Done)