自动控制毕业论文中英文资料外文翻译文献_第1页
自动控制毕业论文中英文资料外文翻译文献_第2页
自动控制毕业论文中英文资料外文翻译文献_第3页
自动控制毕业论文中英文资料外文翻译文献_第4页
自动控制毕业论文中英文资料外文翻译文献_第5页
已阅读5页,还剩28页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

1、 毕业论文外文译文 学 院 自动化与电气工程学院 专 业 自动控制 Component-based Safety Computer of Railway Signal Interlocking System1 IntroductionSignal Interlocking System is the critical equipment which can guarantee traffic safety and enhance operational efficiency in railway transportation. For a long time, the core control

2、 computer adopts in interlocking system is the special customized high-grade safety computer, for example, the SIMIS of Siemens, the EI32 of Nippon Signal, and so on. Along with the rapid development of electronic technology, the customized safety computer is facing severe challenges, for instance,

3、the high development costs, poor usability, weak expansibility and slow technology update. To overcome the flaws of the high-grade special customized computer, the U.S. Department of Defense has put forward the concept:we should adopt commercial standards to replace military norms and standards for

4、meeting consumers demand 1. In the meantime, there are several explorations and practices about adopting open system architecture in avionics. The United Stated and Europe have do much research about utilizing cost-effective fault-tolerant computer to replace the dedicated computer in aerospace and

5、other safety-critical fields. In recent years, it is gradually becoming a new trend that the utilization of standardized components in aerospace, industry, transportation and other safety-critical fields.2 Railways signal interlocking system2.1 Functions of signal interlocking systemThe basic functi

6、on of signal interlocking system is to protect train safety by controlling signal equipments, such as switch points, signals and track units in a station, and it handles routes via a certain interlocking regulation.Since the birth of the railway transportation, signal interlocking system has gone th

7、rough manual signal, mechanical signal, relay-based interlocking, and the modern computer-based Interlocking System.2.2 Architecture of signal interlocking system Generally, the Interlocking System has a hierarchical structure. According to the function of equipments, the system can be divided to th

8、e function of equipments; the system can be divided into three layers as shown in figure1.Figure 1 Architecture of Signal Interlocking System3 Component-based safety computer design3.1 Design strategyThe design concept of component-based safety critical computer is different from that of special cus

9、tomized computer. Our design strategy of SIC is on a base of fault-tolerance and system integration. We separate the SIC into three layers, the standardized component unit layer, safety software layer and the system layer. Different safety functions are allocated for each layer, and the final integr

10、ation of the three layers ensures the predefined safety integrity level of the whole SIC. The three layers can be described as follows:(1) Component unit layer includes four independent standardized CPU modules. A hardware “SAFETY AND” logic is implemented in this year.(2) Safety software layer main

11、ly utilizes fail-safe strategy and fault-tolerant management. The interlocking safety computing of the whole system adopts two outputs from different CPU, it can mostly ensure the diversity of software to hold with design errors of signal version and remove hidden risks.(3) System layer aims to impr

12、ove reliability, availability and maintainability by means of redundancy.3.2Design of hardware fault-tolerant structureAs shown in figure 2, the SIC of four independent component units (C11, C12, C21, C22). The fault-tolerant architecture adopts dual 2 vote 2 (2v22) structure, and a kind of high-per

13、formance standardized module has been selected as computing unit which adopts Intel X Scale kernel, 533 MHZ. The operation of SIC is based on a dual two-layer data buses. The high bus adopts the standard Ethernet and TCP/IP communication protocol, and the low bus is Controller Area Network (CAN). C1

14、1、C12 and C21、C22 respectively make up of two safety computing components IC1 and IC2, which are of 2v2 structure. And each component has an external dynamic circuit watchdog that is set for computing supervision and switching. Figure 2 Hardware structure of SIC3.3Standardized component unitAfter co

15、mponent module is made certain, according to the safety-critical requirements of railway signal interlocking system, we have to do a secondary development on the module. The design includes power supply, interfaces and other embedded circuits.The fault-tolerant processing, synchronized computing, an

16、d fault diagnosis of SIC mostly depend on the safety software. Here the safety software design method is differing from that of the special computer too. For dedicated computer, the software is often specially designed based on the bare hardware. As restricted by computing ability and application ob

17、ject, a special scheduling program is commonly designed as safety software for the computer, and not a universal operating system. The fault-tolerant processing and fault diagnosis of the dedicated computer are tightly hardware-coupled. However, the safety software for SIC is exoteric and loosely ha

18、rdware-coupled, and it is based on a standard Linux OS. The safety software is vital element of secondary development. It includes Linux OS adjustment, fail-safe process, fault-tolerance management, and safety interlocking logic. The hierarchy relations between them are shown in Figure 4. Figure 4 S

19、afety software hierarchy of SIC3.4Fault-tolerant model and safety computation3.4.1 Fault-tolerant modelThe Fault-tolerant computation of SIC is of a multilevel model:SIC=F1002D(F2002(Sc11,Sc12),F2002(Sc21,Sc22)Firstly, basic computing unit Ci1 adopts one algorithm to complete the SCi1, and Ci2 finis

20、hes the SCi2 via a different algorithm, secondly 2 out of 2 (2oo2) safety computing component of SIC executes 2oo2 calculation and gets FSICi from the calculation results of SCi1 SCi2, and thirdly, according the states of watchdog and switch unit block, the result of SIC is gotten via a 1 out of 2 w

21、ith diagnostics (1oo2D) calculation, which is based on FSIC1 and FSIC2.The flow of calculations is as follows:(1) Sci1=F ci1 (Dnet1,Dnet2,Ddi,Dfss)(2) Sci2=F ci2 (Dnet1,Dnet2,Ddi,Dfss)(3) FSICi=F2oo2 (Sci1, Sci2 ),(i=1,2)(4) SIC_OutPut=F1oo2D (FSIC1, FSIC2)3.4.2 Safety computationAs interlocking sys

22、tem consists of a fixed set of task, the computational model of SIC is task-based. In general, applications may conform to a time-triggered, event-triggered or mixed computational model. Here the time-triggered mode is selected, tasks are executed cyclically. The consistency of computing states betw

23、een the two units is the foundation of SIC for ensuring safety and credibility. As SIC works under a loosely coupled mode, it is different from that of dedicated hardware-coupled computer. So a specialized synchronization algorithm is necessary for SIC.SIC can be considered as a multiprocessor distr

24、ibuted system, and its computational model is essentially based on data comparing via high bus communication. First, an analytical approach is used to confirm the worst-case response time of each task. To guarantee the deadline of tasks that communicate across the network, the access time and delay

25、of communication medium is set to a fixed possible value. Moreover, the computational model must meets the real time requirements of railway interlocking system, within the system computing cycle, we set many check points Pi (i=1,2,. n) , which are small enough for synchronization, and computation r

26、esult voting is executed at each point. The safety computation flow of SIC is shown in Figure 5.Figure 5 Safety computational model of SIC4. Hardware safety integrity level evaluation4.1 Safety Integrity As an authoritative international standard for safety-related system, IEC 61508 presents a defin

27、ition of safety integrity: probability of a safety-related system satisfactorily performing the required safety functions under all the stated conditions within a stated period of time. In IEC 61508, there are four levels of safety integrity are prescribe, SIL1SIL4. The SIL1 is the lowest, and SIL4

28、highest.According to IEC 61508, the SIC belongs to safety-related systems in high demand or continuous mode of operation. The SIL of SIC can be evaluated via the probability of dangerous per hour. The provision of SIL about such system in IEC 61508, see table 1.Table 1-Safety Integrity levels: targe

29、t failure measures for a safety function operating in high demand or continuous mode of operationSafety Integrity levelHigh demand or continuous mode of Operation(Probability of a dangerous Failure per hour)4 10-9 to 10-83 10-8 to 10-72 10-7 to 10-61 10-6 to 10-54.2 Reliability block diagram of SIC

30、After analyzing the structure and working principle of the SIC, we get the bock diagram of reliability, as figure 6.Figure 6 Block diagram of SIC reliability5. Conclusions In this paper, we proposed an available standardized component-based computer SIC. Railway signal interlocking is a fail-safe sy

31、stem with a required probability of less than 10-9 safety critical failures per hour. In order to meet the critical constraints, fault-tolerant architecture and safety tactics are used in SIC. Although the computational model and implementation techniques are rather complex, the philosophy of SIC pr

32、ovides a cheerful prospect to safety critical applications, it renders in a simpler style of hardware, furthermore, it can shorten development cycle and reduce cost. SIC has been put into practical application, and high performance of reliability and safety has been proven. From: 毕业设计译文模块化安全铁路信号计算机联

33、锁系统1概述信号联锁系统是保证交通安全、提高铁路运输效率的关键设备。长期以来,在联锁系统中采用的核心控制计算机是特定的高档安全计算机,例如,西门子的SIMIS、日本信号的EI32等。随着电子技术的飞速发展,定制的安全计算机面临着严重的挑战,例如:高的开发成本、可用性差、弱可扩展性、和缓慢的技术更新。为了克服高档特定计算机的缺点,美国国防部提出:我们应该采用商业标准,来取代军事准则和满足客户需要的标准。与此同时,有许多关于在电子设备中采用开放式系统结构的探索与实践。美国和欧洲已经做了很多关于利用利用划算的容错计算机来代替专用电脑在航天和其它安全关键领域。近年来,在航空航天、工业、交通和其它安全关

34、键领域,利用标准化部件正逐步成为一种新的趋势。2 铁路信号联锁系统2.1信号联锁系统的功能信号联锁系统的基本功能是通过控制信号设备,保护列车运行安全。如控制道岔的转换、信号的开放和控制列车通过车站,它通过一种联锁处理规则控制线路。自铁路运输诞生以来、信号联锁系统已经经历了手动信号、机械信号、继电器联锁和现代计算机联锁系统。2.2信号联锁系统的构架一般来说,联锁系统具有层次结构。根据设备的功能,系统可分为三层,如图2.1所示。图2.1 信号联锁系统的结构3 安全计算机的组件设计3.1设计策略模块化安全关键计算机组件的设计理念不同于那些特殊定制的计算机。我们对安全联锁计算机的设计理念是基于系统的容

35、错性和系统的综合需求。将其分为三层:标准化组成单元层、软件安全层与系统层,并给每一层分配不同的安全功能,最终将三层集成,并确保系统达到预定的安全完整性水平。三层可以描述如下: (1) 标准化组成单元层包括四个独立的标准化CPU模块。这一层实现硬件“安全”逻辑联锁。 (2) 软件安全层主要用故障-安用策略和容错算法。由于一个完整的安全联锁系统采用两个不同的CPU输出的结果,所以最能确保软件设计某一版本,在设计时存在的多种错误,清除潜在的风险。 (3) 系统层,旨在提高系统的可用性和冗余系统的可维护性。3.2容错结构的硬件设计如图3.1,安全联锁计算机由四个独立单元组成(C11,C12,C21,C

36、22)。采用双容错结构设计(22取2)结构,计算单元选用高可靠性、高效率的模块,采用了英特尔XScale内核,533兆赫的处理器。安全联锁计算机的操作基于两层数据总线上。高速总线采用标准以太网结构和TCP / IP通信协议、低总线控制器局域网(CAN)。C11、C12和C21、C22分别组成两个独立的安全计算部件IC1和IC2,并构成2乘2取2结构,并且每一部分都有计算机监控和外部开关电路动态监测。图3.1 SIC硬件结构3.3标准化组成单元在研究清楚组成模块后,根据铁路信号联锁系统的临界安全性要求,我们必须做一个二次开发的模块。该设计主要包括电源、接口和其他嵌入式电路。安全联锁计算机的容错计

37、算、处理、故障的同步诊断主要依靠安全软件。这个安全软件的设计方法不同于其他专用的特殊计算机。在专用特殊计算机中,软件通常基于单一裸露硬件而特别设计,限于计算处理能力和软件兼容性,在电脑上特殊的调度程序一般基于安全性软件设计,而不是一个普通的操作系统。专用计算机中容错处理系统和故障诊断系统通过硬件耦合。然而,安全联锁计算机中的安全软件是开放、宽松的,它基于标准的Linux操作系统。安全软件的二次开发是至关重要的。它包括Linux系统调整,故障-安全导向、容错性管理,安全联锁的逻辑。它们之间的层次关系如图3.3。图3.3 SIC的安全软件层次关系3.4容错模型和安全估计算3.4.1 容错模型安全联

38、锁计算机的多层容错计算模型:SIC= F1oo2D (F2oo2(SC11, S C12 ), F2oo2 (SC21,SC22)首先,根据计算单元Ci1采用一个算法来完成Sci1,Ci2计算单元通过不同的算法完成Sci2,其次,安全联锁计算机实行二乘二取二算法计算得到的结果和Sci1、Sci2计算,输出到FSICi中的结果,再进行二乘二取二运算,第三,根据监视系统和开关单元块,安全联锁计算机运算的结果在基于FSIC1和 FSIC2输出的结果上,经过与门的诊断处理(2取1),就计算出Sci1。同样的,根据Ci2的计算结果通过不同的算法也完成Sci2。计算流程如下:(1)Sci1=F ci1 (

39、D net1,Dnet2,Ddi,Dfss);(2)Sci2=F ci2 (D net1,Dnet2,Ddi,Dfss);(3)FSIC1=F2oo2 (S ci1,Sci2),(i=1,2);(4) SIC OutPut=Floo2D(FSIC1,FSIC2)。3.4.2 安全性计算由于联锁系统由一组固定的任务构成,故SIC的计算模型是基于任务的。通常,应用程序可符合一个时间触发、事件触发或者混合的计算模型。这里选用时间触发的计算模型,循环执行任务。为保证安全性和可信度,单元之间的计算机状态的一致性是SIC的基础。因为SIC工作在一个松散耦合的模式,它不同于专用的硬件耦合的计算机。所以SIC

40、需要一个专业的同步算法。SIC可以被视为是一种多处理器分布式系统,其计算模型实质上是基于通过较高的总线通信的数据。首先,一种解析方法是用于证实每项任务的最差的响应时间。为了保证通过网络沟通的任务的最后期限,传播媒介的访问时间和延迟被设计为固定值。此外,计算模型必须满足铁路联锁系统在系统计算周期的实时要求,我们设了许多检查点Pi(i=1,2,n),取值很小,能实现同步,并且在每个检查点得出计算结果。SIC的安全计算流如图3.4所示。图3.5 SIC的安全计算模型4 硬件的安全完整性水平评价4.1安全完整性作为国际权威的安全体系方面的标准,国际电工委员会61508提出关于安全完整性方面的定义:在规

41、定的条件下、规定的时间内,安全系统成功实现所要求的安全功能的概率。IEC61508定义了4个层次的安全完整性,SIL1 SIL4。SIL1是最低的,SIL4最高。根据IEC 61508,安全联锁计算机属于高需求或连续运行模式系统。安全联锁计算机的安全完整性级别可以通过系统每小时的潜在危险估算出来,在IEC61508中,安全完整性级别是这样定义的,如表4.1:表4.1 高需求或连续运行模式系统在安全功能启动情况下的失效点安全完整性水平 高需求或连续模式行动(故障概率每小时)4 10-9 to 10-83 10-8 to 10-72 10-7 to 10-61 10-6 to 10-54.2安全联

42、锁计算机的可靠性框图在分析了安全完整性级别的的结构和工作原理的基础上,我们得到其可靠性的结构图,如图4.1所示。图4.1 SIC的可靠性结构图5结论在本文中,我们提出了一种有效的标准模块化计算机的的安全完整性,铁路信号联锁系统是故障-安全系统,每小时的失效故障率必须要低于10-9,尽管计算模型和实施技术相当复杂,但是为了达到系统规定的参数值,安全完整性系统中必须使用容错系统结构和安全性策略。安全完整性的思想和理论给安全关键性应用展现了一个美好的应用前景。它提供一种简单的硬件组成,而且还可以缩短开发周期,降低成本。现在,安全联锁计算机已投入实际应用,其高性能、可靠性和安全性已经被证实。 附录资料

43、:不需要的可以自行删除 C语言曲线函数像素函数putpixel() 画像素点函数 getpixel()返回像素色函数 直线和线型函数line() 画线函数 lineto() 画线函数 linerel() 相对画线函数 setlinestyle() 设置线型函数 getlinesettings() 获取线型设置函数 setwritemode() 设置画线模式函数 多边形函数HYPERLINK /view/553113.htmrectangle() 画矩形函数 bar() 画条函数 bar3d() 画条块函数 drawpoly() 画多边形函数 圆、弧和曲线函数getaspectratio()获取

44、纵横比函数 circle()画圆函数 arc() 画圆弧函数 ellipse()画HYPERLINK /view/36981.htm椭圆弧函数 fillellipse() 画椭圆区函数 pieslice() 画扇区函数 sector() 画椭圆扇区函数 getarccoords()获取圆弧坐标函数 填充函数setfillstyle() 设置填充图样和颜色函数 setfillpattern() 设置用户图样函数 floodfill() 填充闭域函数 fillpoly() 填充多边形函数 getfillsettings() 获取填充设置函数 getfillpattern() 获取用户图样设置函数

45、图像函数imagesize() 图像存储大小函数 getimage() 保存图像函数 putimage() 输出图像函数 图形和图像函数对许多图形HYPERLINK /view/330120.htm应用程序,直线和HYPERLINK /view/400.htm曲线是非常有用的。但对有些图形只能靠操作单个像素才能画出。当然如果没有画像素的功能,就无法操作直线和曲线的函数。而且通过大规模使用像素功能,整个图形就可以保存、写、擦除和与屏幕上的原有图形进行叠加。 (一) 像素函数putpixel() 画像素点函数功能: 函数putpixel() 在图形模式下屏幕上画一个像素点。 用法: 函数调用方式为

46、void putpixel(int x,int y,int color); 说明: 参数x,y为像素点的坐标,color是该像素点的颜色,它可以是颜色符号名,也可以是整型色彩值。 此函数相应的HYPERLINK /view/668911.htm头文件是graphics.h 返回值: 无 例: 在屏幕上(6,8)处画一个红色像素点: putpixel(6,8,RED); getpixel()返回像素色函数功能: 函数getpixel()返回像素点颜色值。 用法: 该函数调用方式为int getpixel(int x,int y); 说明: 参数x,y为像素点坐标。 函数的返回值可以不反映实际彩色

47、值,这取决于HYPERLINK /view/1120949.htm调色板的设置情况(参见setpalette()函数)。 这个函数相应的头文件为graphics.h 返回值: 返回一个像素点色彩值。 例: 把屏幕上(8,6)点的像素颜色值赋给变量color。 color=getpixel(8,6); (二) 直线和线型函数有三个画直线的函数,即line(),lineto(),linerel()。这些直线使用整型坐标,并相对于当前图形视口,但不一定受视口限制,如果视口裁剪标志clip为真,那么直线将受到视口边缘截断;如果clip为假,即使终点坐标或新的当前位置在图形视口或屏幕极限之外,直线截断到

48、屏幕极限。 有两种线宽及几种线型可供选择,也可以自己定义线图样。下面分别介绍直线和线型函数。 line() 画线函数功能: 函数line()使用当前绘图色、线型及线宽,在给定的两点间画一直线。 用法: 该函数调用方式为void line(int startx,int starty,int endx,int endy); 说明: 参数startx,starty为起点坐标,endx,endy为终点坐标,函数调用前后,图形状态下屏幕光标(一般不可见)当前位置不改变。 此函数相应的头文件为graphics.h 返回值: 无 例: 见函数60.linerel()中的实例。 lineto() 画线函数功能

49、: 函数lineto()使用当前绘图色、线型及线宽,从当前位置画一直线到指定位置。 用法: 此函数调用方式为void lineto(int x,int y); 说明: 参数x,y为指定点的坐标,函数调用后,当前位置改变到指定点(x,y)。 该函数对应的头文件为graphics.h 返回值: 无 例: 见函数60.linerel()中的实例。 linerel() 相对画线函数功能: 函数linerel() 使用当前绘图色、线型及线宽,从当前位置开始,按指定的水平和垂直偏移距离画一直线。 用法: 这个函数调用方式为void linerel(int dx,int dy); 说明: 参数dx,dy分别

50、是水平偏移距离和垂直偏移距离。 函数调用后,当前位置变为增加偏移距离后的位置,例如,原来的位置是(8,6),调用函数linerel(10,18)后,当前位置为(18,24)。 返回值:无 例: 下面的程序为画线函数调用实例: #i nclude void main() int driver,mode; driver=DETECT; mode=0; initgraph(&driver,&mode,); setcolor(15); line(66,66,88,88); lineto(100,100); linerel(36,64); getch(); restorecrtmode(); setli

51、nestyle() 设置线型函数功能: setlinestyle() 为画线函数设置当前线型,包括线型、线图样和线宽。 用法: setlinestyle() 函数调用方式为void setlinestyle(int stly,unsigned pattern,int wigth); 说明: 参数style为线型取值,也可以用相应名称表示,如表1-10中所示。 参数pattern用于自定义线图样,它是16位(bit)字,只有当style=USERBIT_LINE(值为1)时,pattern的值才有意义,使用用户自定义线图样,与图样中“1”位对应的像素显示,因此,pattern=0 xFFFF,则

52、画实线;pattern=0 x9999,则画每隔两个像素交替显示的虚线,如果要画长虚线,那么pattern的值可为0 xFF00和0 xF00F,当style不为USERBIT_LINE值时,虽然pattern的值不起作用,但扔须为它提供一个值,一般取为0。 参数wigth用来设定线宽,其取值见表1-11,表中给出了两个值,即1和3,实际上,线宽取值为2也是可以接受的。 若用非法参数调用setlinestyle()函数,那么graphresult()会返回错误代码,并且当前线型继续有效。 Turbo C提供的线型与线宽定义在头文件graphics.h中,表1-10和1-11分别列出了参数的取值

53、与含义。 表1-10 线型 名称取值含义SOLID_LINE0实线DOTTED_LINE1点线CENTER_LINE2中心线DASHED_LINE3虚线USERBIT_LINE4用户自定义线型表1-11 线宽 名 称取 值说 明NORM_WIDTH(常宽)1一个像素宽(缺省值)THICK_WIDTH(加宽)3三个像素宽这个函数的头文件是graphics.h 返回值: 无 例: 下面的程序显示了BC中所提供的线型图样: #i nclude void main() int driver,mode;i; driver=DETECT; mode=0; initgraph(&driver,&mode,)

54、; for(i=0;i4;i+) setlinestyle(i,0,1); line(i*50,200,i*50+60,200) ; getch(); restorecrtmode(); getlinesettings() 获取线型设置函数功能: 函数getlinesettings() 用当前设置的线型、线图样和线宽填 写linesettingstype型结构。 用法: 函数调用方式为void getlinesettings(struct linesettingstype *info); 说明: 此函数调用执行后,当前的线型、线图样和线宽值被装入info指向的结构里,从而可从该结构中获得线型设

55、置。 linesettingstype型结构定义如下: struct linesettingstype int linestyle; unsigned upattern; int thickness; ; 其中linestyle用于存放线型,线型值为表1-10中的各值之一。 upattern用为装入用户自定义线图样,这是16位字,每一位等于一个像素,如果哪个位被设置,那么该像素打开,否则关闭。 thickness为线宽值存放的变量,可参见表1-11。 getlinesettings()函数对应的头文件为graphics.h 返回值: 返回的线型设置存放在info指向的结构中。 例: 把当前线型

56、的设置写入info结构: struct linesettingstype info; getlinesettings(&info); setwritemode() 设置画线模式函数功能: 函数setwritemode() 设置画线模式 用法: 函数调用方式为 void setwritemode()(int mode); 说明: 参数mode只有两个取值0和1,若mode为0,则新画的线将覆盖屏幕上原有的图形,此为缺省画线输出模式。如果mode为1,那么新画的像素点与原有图形的像素点先进行异或(XOR)运算,然后输出到屏幕上,使用这种画线输出模式,第二次画同一图形时,将擦除该图形。调用setwr

57、itemode()设置的画线输出模式只影响函数line(),lineto(),linerel(),recangle()和drawpoly()。 setwritemode()函数对应的头文件是graphics.h 返回值: 无 例: 设置画线输出模式为0: setwritemode(0); (三)、多边形函数对多边形,无疑可用画直线函数来画出它,但直接提供画多边形的函数会给用户很大方便。最常见的多边形有矩形、矩形块(或称条形)、多边形和多边形块,我们还把长方形条块也放到这里一起考虑,虽然它不是多边形,但它的特例就是矩形(块)。下面直接介绍画多边形的函数。 rectangle() 画矩形函数功能:

58、 函数rectangle() 用当前绘图色、线型及线宽,画一个给定左上角与右下角的矩形(正方形或长方形)。 用法: 此函数调用方式为void rectangle(int left,int top,int right,int bottom); 说明: 参数left,top是左上角点坐标,right,bottom是右下角点坐标。如果有一个以上角点不在当前图形视口内,且裁剪标志clip设置的是真(1),那么调用该函数后,只有在图形视口内的矩形部分才被画出。 这个函数对应的头文件为graphics.h 返回值: 无 例: 下面的程序画一些矩形实例: #i nclude void main() int

59、driver,mode; driver=DETECT; mode=0; initgraph(&driver,&mode,); rectangle(80,80,220,200); rectangle(140,99,180,300); rectangle(6,6,88,88); rectangle(168,72,260,360); getch(); restorecrtmode(); bar() 画条函数功能: 函数bar()用当前填充图样和填充色(注意不是给图色)画出一个指定上左上角与右下角的实心长条形(长方块或正方块),但没有四条边线)。 用法: bar()函数调用方式为void bar(in

60、t left,int top,int right,int bottom); 说明: 参数left,topright,bottom分别为左上角坐标与右下角坐标,它们和调用函数rectangle()的情形相同,调用此函数前,可用setfillstyle()或setfillpattern()设置当前填充图样和填充色。 注意此函数只画没有边线的条形,如果要画有边线的的条形,可调用下面的函数bar3d()来画,并将深度参数设为0,同时topflag参数要设置为真,否则该条形无顶边线。 这 应的头文件为graphics.h 返回值: 无 例: 见函数bar3d()中的实例。 bar3d() 画条块函数功能

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论