📄 4.2.2 请求方式.htm
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- saved from url=(0058)http://www.ekany.com/wdg98/cg/contents/chapter4/les422.htm -->
<HTML xmlns="http://www.w3.org/TR/REC-html40" xmlns:v =
"urn:schemas-microsoft-com:vml" xmlns:o =
"urn:schemas-microsoft-com:office:office" xmlns:w =
"urn:schemas-microsoft-com:office:word"><HEAD><TITLE>4</TITLE>
<META http-equiv=Content-Type content="text/html; charset=GB2312">
<META content=FrontPage.Editor.Document name=ProgId>
<META content="MSHTML 6.00.2800.1106" name=GENERATOR>
<META content="Microsoft Word 9" name=Originator><LINK
href="les422.files/filelist.xml" rel=File-List><LINK
href="les422.files/editdata.mso" rel=Edit-Time-Data><!--[if !mso]>
<STYLE>v\:* {
BEHAVIOR: url(#default#VML)
}
o\:* {
BEHAVIOR: url(#default#VML)
}
w\:* {
BEHAVIOR: url(#default#VML)
}
.shape {
BEHAVIOR: url(#default#VML)
}
</STYLE>
<![endif]--><!--[if gte mso 9]><xml> <o:DocumentProperties> <o:Author>zlj</o:Author> <o:Template>Normal</o:Template> <o:LastAuthor>zlj</o:LastAuthor> <o:Revision>2</o:Revision> <o:TotalTime>3</o:TotalTime> <o:Created>1999-04-16T02:53:00Z</o:Created> <o:LastSaved>1999-04-16T02:56:00Z</o:LastSaved> <o:Pages>1</o:Pages> <o:Company>CSCIMS</o:Company> <o:Lines>1</o:Lines> <o:Paragraphs>1</o:Paragraphs> <o:Version>9.2812</o:Version> </o:DocumentProperties></xml><![endif]--><!--[if gte mso 9]><xml> <w:WordDocument> <w:PunctuationKerning/> <w:DrawingGridVerticalSpacing>7.8 磅</w:DrawingGridVerticalSpacing> <w:DisplayHorizontalDrawingGridEvery>0</w:DisplayHorizontalDrawingGridEvery> <w:DisplayVerticalDrawingGridEvery>2</w:DisplayVerticalDrawingGridEvery> <w:Compatibility> <w:SpaceForUL/> <w:BalanceSingleByteDoubleByteWidth/> <w:DoNotLeaveBackslashAlone/> <w:ULTrailSpace/> <w:DoNotExpandShiftReturn/> <w:AdjustLineHeightInTable/> <w:UseFELayout/> </w:Compatibility> </w:WordDocument></xml><![endif]-->
<STYLE>@font-face {
font-family: 宋体;
}
@font-face {
font-family: 楷体_GB2312;
}
@font-face {
font-family: @宋体;
}
@font-face {
font-family: @楷体_GB2312;
}
@page {mso-page-border-surround-header: no; mso-page-border-surround-footer: no; }
@page Section1 {size: 595.3pt 841.9pt; margin: 72.0pt 90.0pt 72.0pt 90.0pt; mso-header-margin: 42.55pt; mso-footer-margin: 49.6pt; mso-paper-source: 0; layout-grid: 15.6pt; }
P.MsoNormal {
TEXT-JUSTIFY: inter-ideograph; FONT-SIZE: 10.5pt; MARGIN: 0cm 0cm 0pt; FONT-FAMILY: "Times New Roman"; TEXT-ALIGN: justify; mso-style-parent: ""; mso-pagination: none; mso-bidi-font-size: 12.0pt; mso-fareast-font-family: 宋体; mso-font-kerning: 1.0pt
}
LI.MsoNormal {
TEXT-JUSTIFY: inter-ideograph; FONT-SIZE: 10.5pt; MARGIN: 0cm 0cm 0pt; FONT-FAMILY: "Times New Roman"; TEXT-ALIGN: justify; mso-style-parent: ""; mso-pagination: none; mso-bidi-font-size: 12.0pt; mso-fareast-font-family: 宋体; mso-font-kerning: 1.0pt
}
DIV.MsoNormal {
TEXT-JUSTIFY: inter-ideograph; FONT-SIZE: 10.5pt; MARGIN: 0cm 0cm 0pt; FONT-FAMILY: "Times New Roman"; TEXT-ALIGN: justify; mso-style-parent: ""; mso-pagination: none; mso-bidi-font-size: 12.0pt; mso-fareast-font-family: 宋体; mso-font-kerning: 1.0pt
}
H3 {
TEXT-JUSTIFY: inter-ideograph; FONT-SIZE: 16pt; MARGIN: 13pt 0cm; TEXT-INDENT: 21.25pt; LINE-HEIGHT: 173%; FONT-FAMILY: "Times New Roman"; TEXT-ALIGN: justify; mso-fareast-language: EN-US; mso-pagination: lines-together; mso-fareast-font-family: 楷体_GB2312; mso-font-kerning: 1.0pt; mso-style-next: 正文; mso-outline-level: 3; mso-layout-grid-align: none
}
P.MsoBodyTextIndent {
TEXT-JUSTIFY: inter-ideograph; FONT-SIZE: 12pt; MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 27pt; FONT-FAMILY: 宋体; TEXT-ALIGN: justify; mso-fareast-language: EN-US; mso-pagination: none; mso-font-kerning: 1.0pt; mso-layout-grid-align: none; mso-hansi-font-family: "Times New Roman"; mso-bidi-font-family: "Times New Roman"
}
LI.MsoBodyTextIndent {
TEXT-JUSTIFY: inter-ideograph; FONT-SIZE: 12pt; MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 27pt; FONT-FAMILY: 宋体; TEXT-ALIGN: justify; mso-fareast-language: EN-US; mso-pagination: none; mso-font-kerning: 1.0pt; mso-layout-grid-align: none; mso-hansi-font-family: "Times New Roman"; mso-bidi-font-family: "Times New Roman"
}
DIV.MsoBodyTextIndent {
TEXT-JUSTIFY: inter-ideograph; FONT-SIZE: 12pt; MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 27pt; FONT-FAMILY: 宋体; TEXT-ALIGN: justify; mso-fareast-language: EN-US; mso-pagination: none; mso-font-kerning: 1.0pt; mso-layout-grid-align: none; mso-hansi-font-family: "Times New Roman"; mso-bidi-font-family: "Times New Roman"
}
A:dink {
COLOR: blue; TEXT-DECORATION: underline; text-underline: single
}
SPAN.MsoHyperlink {
COLOR: blue; TEXT-DECORATION: underline; text-underline: single
}
A:visited {
COLOR: purple; TEXT-DECORATION: underline; text-underline: single
}
SPAN.MsoHyperlinkFollowed {
COLOR: purple; TEXT-DECORATION: underline; text-underline: single
}
P.MsoDocumentMap {
TEXT-JUSTIFY: inter-ideograph; FONT-SIZE: 10.5pt; BACKGROUND: navy; MARGIN: 0cm 0cm 0pt; FONT-FAMILY: "Times New Roman"; TEXT-ALIGN: justify; mso-pagination: none; mso-bidi-font-size: 12.0pt; mso-fareast-font-family: 宋体; mso-font-kerning: 1.0pt
}
LI.MsoDocumentMap {
TEXT-JUSTIFY: inter-ideograph; FONT-SIZE: 10.5pt; BACKGROUND: navy; MARGIN: 0cm 0cm 0pt; FONT-FAMILY: "Times New Roman"; TEXT-ALIGN: justify; mso-pagination: none; mso-bidi-font-size: 12.0pt; mso-fareast-font-family: 宋体; mso-font-kerning: 1.0pt
}
DIV.MsoDocumentMap {
TEXT-JUSTIFY: inter-ideograph; FONT-SIZE: 10.5pt; BACKGROUND: navy; MARGIN: 0cm 0cm 0pt; FONT-FAMILY: "Times New Roman"; TEXT-ALIGN: justify; mso-pagination: none; mso-bidi-font-size: 12.0pt; mso-fareast-font-family: 宋体; mso-font-kerning: 1.0pt
}
DIV.Section1 {
page: Section1
}
</STYLE>
<!--[if gte mso 9]><xml> <o:shapedefaults v:ext="edit" spidmax="1027"/></xml><![endif]--><!--[if gte mso 9]><xml> <o:shapelayout v:ext="edit"> <o:idmap v:ext="edit" data="1"/> </o:shapelayout></xml><![endif]--></HEAD>
<BODY lang=ZH-CN style="TEXT-JUSTIFY-TRIM: punctuation; tab-interval: 21.0pt"
vLink=purple link=blue>
<H3 style="TEXT-INDENT: 0cm"><FONT face=楷体_GB2312 size=4><SPAN
style="mso-fareast-language: ZH-CN"><SPAN lang=EN-US>4.2.2 </SPAN><SPAN
style="FONT-FAMILY: 楷体_GB2312; mso-fareast-language: ZH-CN; mso-ascii-font-family: 'Times New Roman'">请求方式</SPAN></SPAN><SPAN
lang=EN-US style="mso-fareast-language: ZH-CN"><o:p></o:p></SPAN></FONT></H3>
<P class=MsoBodyTextIndent style="TEXT-INDENT: 0px"><SPAN
style="mso-fareast-language: ZH-CN"><FONT face=楷体_GB2312
size=4>此时,只有用输入方式设置命令(或语句)对相应的设备设置成需要的输入方式后,该设备才能作相应的输入处理。</FONT></SPAN><FONT
face=楷体_GB2312 size=4><SPAN lang=EN-US>如:</SPAN></FONT></P>
<P class=MsoBodyTextIndent style="TEXT-INDENT: 0px"><FONT face=楷体_GB2312
size=4><SPAN lang=EN-US> </SPAN></FONT><SPAN lang=EN-US><FONT
face=楷体_GB2312
size=4>request_locator(ws,device_code,x,y)<o:p></o:p></FONT></SPAN></P>
<P class=MsoBodyTextIndent style="TEXT-INDENT: 0px"><SPAN
style="mso-fareast-language: ZH-CN"><FONT face=楷体_GB2312
size=4>该命令是把定位器置成请求输入控制方式,其中<SPAN
lang=EN-US>x、y用来存储一个点的坐标值。在输入命令中,每一种逻辑设备所包括的参数是和输入数据类型有关的,如在请求方式下的笔划输入是:<o:p></o:p></SPAN></FONT></SPAN></P>
<P class=MsoBodyTextIndent style="TEXT-INDENT: 0cm"><SPAN lang=EN-US
style="mso-fareast-language: ZH-CN; mso-tab-count: 1"><FONT face=楷体_GB2312
size=4> </FONT></SPAN><FONT face=楷体_GB2312 size=4><SPAN
lang=EN-US>request_stroke(ws,device_code,n,xa,ya)<o:p></o:p></SPAN></FONT></P>
<P class=MsoBodyTextIndent style="TEXT-INDENT: 0cm"><SPAN
style="mso-fareast-language: ZH-CN"><FONT face=楷体_GB2312 size=4>这里输入的<SPAN
lang=EN-US>n个点的坐标存放在数组xa和ya中,类似地在请求方式下的字符串输入是:<o:p></o:p></SPAN></FONT></SPAN></P>
<P class=MsoBodyTextIndent style="TEXT-INDENT: 0cm"><SPAN lang=EN-US
style="mso-fareast-language: ZH-CN; mso-tab-count: 1"><FONT face=楷体_GB2312
size=4> </FONT></SPAN><FONT face=楷体_GB2312 size=4><SPAN
lang=EN-US>request_string(ws,device_code,nc,text)<o:p></o:p></SPAN></FONT></P>
<P class=MsoBodyTextIndent style="TEXT-INDENT: 0cm"><SPAN
style="mso-fareast-language: ZH-CN"><FONT face=楷体_GB2312 size=4>这里<SPAN
lang=EN-US>nc指定了输入字符串的长度(即字符个数),输入的字符串存放在字符缓存text中。为了能在应用程序中拾取到输入的图段,需要用下列命令设置图段的标志,即:<o:p></o:p></SPAN></FONT></SPAN></P>
<P class=MsoBodyTextIndent style="TEXT-INDENT: 0cm"><SPAN lang=EN-US
style="mso-fareast-language: ZH-CN; mso-tab-count: 1"><FONT face=楷体_GB2312
size=4> </FONT></SPAN><FONT face=楷体_GB2312 size=4><SPAN
lang=EN-US>request_pick(ws,device_code,segment-id)<o:p></o:p></SPAN></FONT></P>
<P class=MsoBodyTextIndent style="TEXT-INDENT: 0cm"><SPAN
style="mso-fareast-language: ZH-CN"><FONT face=楷体_GB2312
size=4>用于请求方式下的输入命令还可以包括其他参数,如有些应用需要对图段中的图素设置标志,如线段、圆、矩形等;也可对图段设置标号,以加快对图段的搜索。<SPAN
lang=EN-US><o:p></o:p></SPAN></FONT></SPAN></P>
<P class=MsoBodyTextIndent><SPAN style="mso-fareast-language: ZH-CN"><FONT
face=楷体_GB2312 size=4>请求方式的工作过程如图<SPAN
lang=EN-US>4.2.1所示。当程序运行到request语句就向输入设备提出输入请求;同时停止运行,等待输入设备的输入数据。直到请求满足之后,程序才继续运行。当程序运行时,输入设备处于等待状态,等待程序的请求。待到程序的请求出现,输入设备立即进入工作,直到满足程序的这一请求为止。然后又重新处于等待状态。因此,在请求方式下,程序和输入设备轮流交换工作状态和等待状态,由程序支配输入设备的启动。<o:p></o:p></SPAN></FONT></SPAN></P>
<P class=MsoBodyTextIndent style="TEXT-INDENT: 0cm"><FONT face=楷体_GB2312
size=4><SPAN lang=EN-US style="mso-fareast-language: ZH-CN"><![if !supportEmptyParas]><![endif]> <o:p></o:p></SPAN></FONT></P>
<P class=MsoBodyTextIndent style="TEXT-INDENT: 0cm"><FONT face=楷体_GB2312
size=4><SPAN lang=EN-US
style="mso-fareast-language: ZH-CN"><!--[if gte vml 1]><v:shapetype
id=_x0000_t75 coordsize = "21600,21600" o:preferrelative = "t" o:spt = "75"
filled = "f" stroked = "f" path = " m@4@5 l@4@11@9@11@9@5 xe"><v:stroke
joinstyle = "miter"></v:stroke><v:formulas><v:f eqn =
"if lineDrawn pixelLineWidth 0 "></v:f><v:f eqn = "sum @0 1 0 "></v:f><v:f eqn =
"sum 0 0 @1 "></v:f><v:f eqn = "prod @2 1 2 "></v:f><v:f eqn =
"prod @3 21600 pixelWidth "></v:f><v:f eqn =
"prod @3 21600 pixelHeight "></v:f><v:f eqn = "sum @0 0 1 "></v:f><v:f eqn =
"prod @6 1 2 "></v:f><v:f eqn = "prod @7 21600 pixelWidth "></v:f><v:f eqn =
"sum @8 21600 0 "></v:f><v:f eqn = "prod @7 21600 pixelHeight "></v:f><v:f eqn =
"sum @10 21600 0 "></v:f></v:formulas><v:path o:extrusionok = "f"
gradientshapeok = "t" o:connecttype = "rect"></v:path><o:lock aspectratio="t"
v:ext="edit"></o:lock></v:shapetype><v:shape id=_x0000_i1025
style="WIDTH: 276.75pt; HEIGHT: 241.5pt" type = "#_x0000_t75" coordsize =
"21600,21600"><v:imagedata o:title="4-2-1" src =
"./les422.files/image002.gif"></v:imagedata></v:shape><![endif]--><![if !vml]><img width=369 height=322 src="les422.files/image002.gif" v:shapes="_x0000_i1025"><![endif]><o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><SPAN lang=EN-US><FONT face=楷体_GB2312 size=4><![if !supportEmptyParas]><![endif]> <o:p></o:p></FONT></SPAN></P>
<P class=MsoNormal><FONT face=楷体_GB2312 size=4><!--[if gte vml 1]><v:shapetype
id=_x0000_t202 coordsize = "21600,21600" o:spt = "202" path =
" m0,0 l0,21600,21600,21600,21600,0 xe"><v:stroke joinstyle =
"miter"></v:stroke><v:path gradientshapeok = "t" o:connecttype =
"rect"></v:path></v:shapetype><v:shape id=_x0000_s1026
style="MARGIN-TOP: 0px; Z-INDEX: 1; LEFT: 0px; MARGIN-LEFT: 0px; WIDTH: 162pt; POSITION: absolute; HEIGHT: 44.2pt; TEXT-ALIGN: left; mso-position-horizontal: left; mso-position-vertical: top; mso-position-vertical-relative: line"
type = "#_x0000_t202" coordsize = "21600,21600" o:allowoverlap = "f" stroked =
"f"><v:textbox
style="MARGIN-TOP: 4.343pt; LEFT: auto; MARGIN-LEFT: 7.937pt; WIDTH: 147.625pt; TOP: auto; HEIGHT: 37pt"><![if !mso]>
<TABLE cellSpacing=0 cellPadding=0 width="100%">
<TBODY>
<TR>
<TD><![endif]>
<DIV>
<P class=MsoNormal><SPAN
style="FONT-SIZE: 9pt; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">图</SPAN><SPAN
lang=EN-US style="FONT-SIZE: 9pt"> 4.2.1 </SPAN><SPAN
style="FONT-SIZE: 9pt; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">请求输入方式的工作过程</SPAN></P></DIV><![if !mso]></TD></TR></TBODY></TABLE><![endif]></v:textbox><w:wrap
type = "square"></w:wrap></v:shape><![endif]--><![if !vml]><img width=218 height=61 src="les422.files/image003.gif" align=left hspace=12 alt="文本框: 图 4.2.1 请求输入方式的工作过程" v:shapes="_x0000_s1026"><![endif]></FONT></P>
<P class=MsoNormal><SPAN style="mso-spacerun: yes"><FONT face=楷体_GB2312
size=4> </FONT></SPAN></P>
<P class=MsoNormal><FONT face=楷体_GB2312 size=4> </FONT></P>
<P class=MsoNormal> </P>
<P class=MsoNormal> </P>
<P class=MsoNormal><SPAN lang=EN-US><A
href="http://www.ekany.com/wdg98/cg/contents/chapter4/les421.htm"><FONT
size=4><FONT face=楷体_GB2312><<SPAN
style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">上一节</SPAN>> </FONT></FONT></A><FONT
size=4> <A
href="http://www.ekany.com/wdg98/cg/contents/chapter4/les423.htm"><<SPAN
style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">下一节</SPAN>>
</A> <A
href="http://www.ekany.com/wdg98/cg/tutorial/chapter4/lesson4-2.htm"><</A></FONT></SPAN><FONT
size=4><A
href="http://www.ekany.com/wdg98/cg/tutorial/chapter4/lesson4-2.htm"><FONT
face=楷体_GB2312><SPAN
style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">返回</SPAN><SPAN
lang=EN-US>></SPAN></FONT></A></FONT></P></BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -