📄 pyvcp.lyx
字号:
filename pyvcp_checkbutton2.png\end_inset \layout SubsectionRadiobutton\layout StandardA radiobutton will set one of a number of BIT pins true. The other pins are set false.\layout LyX-Code<radiobutton>\newline <choices>["one","two","three"]</choices> \newline <halpin>"my-radio"</halpin> \newline </radiobutton>\layout Standard\align center \begin_inset Graphics filename pyvcp_radiobutton.png\end_inset \layout StandardNote that the HAL pins in the example above will me named my-radio.one, my-radio.two, and my-radio.three. In the image above, "three" is the selected value.\layout SubsectionNumber\layout StandardThe number widget displays the value of a FLOAT signal.\layout LyX-Code<number>\newline <halpin>"my-number"</halpin>\newline <font>("Helvetica",50)</font>\newline <format>"+4.3f"</format>\newline </number>\layout Standard\align center \begin_inset Graphics filename pyvcp_number.png\end_inset \layout Standard<font> is a Tkinter font type and size specification. Note that on Ubuntu 6.06 "Helvetica" is not available in sizes above ca 40 or 50. One font that will show up to at least size 200 is "courier 10 pitch", so for a really big Number widget you could specify:\layout LyX-Code<font>("courier 10 pitch",100)</font>\layout Standard<format> is a "C-style" format specified that determines how the number is displayed.\layout SubsectionBar\layout StandardA bar widget displays the value of a FLOAT signal both graphically using a bar display and numerically.\layout LyX-Code<bar>\newline <halpin>"my-bar"</halpin>\newline <min_>0</min_>\newline <max_>123</max_>\newline <bgcolor>"grey"</bgcolor>\newline <fillcolor>"red"</fillcolor>\newline </bar>\layout Standard\align center \begin_inset Graphics filename pyvcp_bar.png\end_inset \layout SubsectionMeter\layout StandardMeter displays the value of a FLOAT signal using a traditional dial indicator.\layout LyX-Code<meter>\newline <halpin>"my-meter"</halpin>\newline <text>"Voltage"</text>\newline <size>300</size>\newline <min_>-12</min_>\newline <max_>33</max_>\newline </meter> \layout Standard\align center \begin_inset Graphics filename pyvcp_meter.png lyxscale 50 scale 50\end_inset \layout SubsectionSpinbox\layout StandardSpinbox controls a FLOAT pin. You increase or decrease the value of the pin by either pressing on the arrows, or pointing at the spinbox and rolling your mouse-wheel.\layout LyX-Code<spinbox>\newline <halpin>"my-spinbox"</halpin>\newline <min_>-12</min_>\newline <max_>33</max_>\newline <resolution>0.1</resolution>\newline <format>"2.3f"</format>\newline <font>("Arial",30)</font>\newline </spinbox>\layout Standard\align center \begin_inset Graphics filename pyvcp_spinbox.png\end_inset \layout SubsectionScale\layout StandardScale controls a FLOAT pin. You increase or decrease the value of the pin be either dragging the slider, or pointing at the scale and rolling your mouse-wheel.\layout LyX-Code<scale>\newline <halpin>"my-scale"</halpin>\newline <resolution>0.1</resolution>\newline <orient>HORIZONTAL</orient>\newline <min_>-33</min_>\newline <max_>26</max_>\newline </scale>\layout Standard\align center \begin_inset Graphics filename pyvcp_scale.png\end_inset \layout SubsectionJogwheel\layout StandardJogwheel mimics a real jogwheel by outputting a FLOAT pin which counts up or down as the wheel is turned, either by dragging in a circular motion, or by rolling the mouse-wheel.\layout LyX-Code<jogwheel>\newline <halpin>"my-wheel"</halpin>\newline <cpr>45</cpr>\newline <size>250</size>\newline </jogwheel>\layout Standard\align center \begin_inset Graphics filename pyvcp_jogwheel.png lyxscale 50 scale 50\end_inset \layout SectionpyVCP Container reference\layout StandardContainers are widgets that contain other widgets.\layout SubsectionHbox\layout StandardUse a Hbox when you want to stack widgets horizontally next to each other.\layout LyX-Code<hbox>\newline <label><text>"a vbox:"</text></label>\newline <led></led>\newline <number></number>\newline <bar></bar>\newline </hbox>\layout Standard\align center \begin_inset Graphics filename pyvcp_hbox.png\end_inset \layout StandardInside a Hbox, you can use the \family typewriter <boxfill fill=""/>\family default , \family typewriter <boxanchor anchor=""/>\family default , and \family typewriter <boxexpand expand=""/>\family default tags to choose how items in the box behave when the window is re-sized. For details of how fill, anchor, and expand behave, refer to the Tk \family typewriter pack\family default manual page, \family typewriter pack(3tk)\family default . By default, \family typewriter fill="y"\family default , \family typewriter anchor="center"\family default , \family typewriter expand="yes"\family default .\layout SubsectionVbox\layout StandardUse a Vbox when you want to stack widgets vertically on top of each other.\layout LyX-Code<vbox>\newline <label><text>"a vbox:"</text></label>\newline <led></led>\newline <number></number>\newline <bar></bar>\newline </vbox>\layout Standard\align center \begin_inset Graphics filename pyvcp_vbox.png\end_inset \layout StandardInside a Hbox, you can use the \family typewriter <boxfill fill=""/>\family default , \family typewriter <boxanchor anchor=""/>\family default , and \family typewriter <boxexpand expand=""/>\family default tags to choose how items in the box behave when the window is re-sized. For details of how fill, anchor, and expand behave, refer to the Tk \family typewriter pack\family default manual page, \family typewriter pack(3tk)\family default . By default, \family typewriter fill="x"\family default , \family typewriter anchor="center"\family default , \family typewriter expand="yes"\family default .\layout SubsectionLabel\layout StandardA label is a piece of text on your panel.\layout LyX-Code<label>\newline <text>"This is a Label:"</text>\newline <font>("Helvetica",20)</font>\newline </label> \layout Standard\align center \begin_inset Graphics filename pyvcp_label.png\end_inset \layout SubsectionLabelframe\layout StandardA labelframe is a frame with a groove and a label at the upper-left corner.\layout LyX-Code<labelframe text="Group Title">\newline <hbox>\newline <led/> <led/>\newline </hbox>\newline </labelframe>\layout SubsectionTable\layout StandardA table is a container that allows layout in a grid of rows and columns. Each row is started by a \family typewriter <tablerow/>\family default tag. A contained widget may span rows or columns through the use of the \family typewriter <tablespan rows= cols=/>\family default tag. The sides of the cells to which the contained widgets \begin_inset Quotes eld\end_inset stick\begin_inset Quotes erd\end_inset may be set through the use of the \family typewriter <tablesticky sticky=/>\family default tag. A table expands on its flexible rows and columns.\layout StandardExample:\layout LyX-Code<table flexible_rows="[2]" flexible_columns="[1,4]">\newline <tablesticky sticky="new"/>\newline <tablerow/>\newline <label text="A (cell 1,1)"/>\newline <label text="B (cell 1,2)"/>\newline <tablespan columns="2"/><label text="C, D (cells 1,3 and 1,4)"> \newline <tablerow/>\newline <label text="E (cell 2,1)"/>\newline <tablesticky sticky="nsew"/><tablespan rows="2"/>\newline <label text="'spans\backslash n2 rows'"/>\newline <tablesticky sticky="new"/><label text="G (cell 2,3)"/>\newline <label text="H (cell 2,4)"/>\newline <tablerow/> \newline <label text="J (cell 3,1)"/>\newline <label text="K (cell 3,2)"/>\newline <label text="M (cell 3,4)"/>\newline </table> \the_end
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -