程序设计报告-自动化142徐亮
《自动化导论》课程报告

《自动化导论》课程报告自动化,这个在当今科技领域中熠熠生辉的词汇,正以其强大的力量改变着我们的生活和社会。
通过《自动化导论》这门课程的学习,我仿佛打开了一扇通往未来科技世界的大门,对自动化的概念、应用、发展趋势以及其对社会的深远影响有了更全面和深入的认识。
自动化,简单来说,就是让机器或系统能够在无人直接干预的情况下,按照预定的程序或指令自动运行,完成各种任务。
它并非是一个全新的概念,而是在人类文明的演进过程中逐渐发展起来的。
从早期的简单机械装置,到如今高度复杂的智能控制系统,自动化的发展历程充满了人类智慧的结晶。
在工业生产领域,自动化技术的应用极大地提高了生产效率和产品质量。
自动化生产线能够实现连续、高效的生产,减少了人工操作带来的误差和不确定性。
例如,汽车制造工厂中的机器人焊接、喷漆等工艺,不仅提高了生产速度,还保证了产品的一致性和可靠性。
同时,自动化技术还使得一些危险、繁重的工作得以由机器完成,保障了工人的生命安全。
农业领域也因自动化技术的融入而发生了巨大的变革。
精准农业的出现,通过传感器、卫星定位等技术,实现了对农田的精确监测和管理。
自动灌溉、施肥、植保等系统能够根据农作物的生长需求,精准地提供所需的资源,提高了农业资源的利用效率,减少了浪费和环境污染。
在交通运输领域,自动化技术的发展更是带来了前所未有的改变。
自动驾驶技术的研究和应用正在逐步改变我们的出行方式。
虽然目前自动驾驶技术还面临一些挑战和法律规范上的问题,但不可否认的是,它具有巨大的潜力。
自动驾驶汽车能够提高交通安全性,减少人为因素导致的交通事故;还能够优化交通流量,提高道路的通行能力。
此外,轨道交通中的自动化控制技术也使得列车运行更加安全、准点。
自动化在家庭生活中的应用也越来越广泛。
智能家居系统能够实现对家电、照明、安防等设备的自动化控制,让我们的生活更加便捷和舒适。
通过手机 APP 或者语音指令,我们可以远程控制家中的设备,提前做好各种准备。
院级优秀一览表

论文题目 音乐共享网站 医药物流管理系统 逆风快递全国机房集成项目 京淘折扣购物网站 Quartz调度器与企业项目整合的研究与应用 构建云端运行的博客 鑫优翻译系统 环境管理信息在线填报系统 电影购票网站 基于Web的辽宁粮价信息系统 基于SSM框架的大学生就业共享平台 在线考试系统 基于springboot+mybatis的在线测试系统 喜铺婚礼服务商城 基于Android系统的新闻客户端的设计与实现 基于分布式的电商购物商城 小型咖啡厅管理系统 基于Spring+Struts2+Hibernate的综合物流管理平台速运快递 教务管理系统 基于的CMS内容型网站通用管理系统 房地产行业资本结构问题研究 京东集团全方位价值链成本管理实证研究 专用设备制造业上市公司社会责任信息披露研究 H公司招聘的风险控制管理 基于Flexsim沈阳苏宁物流拣货作业流程的仿真与优化 中海物业公司管培生招聘与培养问题研究 汽车零部件供应商选择的研究——以一汽吉林为例 JL公司应收账款管理分析 国企分类治理下大股东控制对企业投资效率的影响研究 跨国并购财务风险分析——以美的收购库卡为例 丹东万华深海科技有限公司财务预算管理研究
论文题目 不同功率下激光熔覆铈对316L不锈钢耐腐蚀性的影响 含氟渣系的挥发性能研究 Fe-Co-P-Si-B-Cu非晶合金晶华动力学及软磁性的研究 翅片式锂电池强制风冷散热特性的数值模拟 5V/2A准谐振同步整流反激变换器 基于小波变换的加权孪生支持向量机 基于小波变换的电机故障信号处理的研究 基于Backstepping方法的严格反馈随机非线性系统的控制设计 基于BP神经网络和支持向量机的数据分类算法研究 钢铁料场卸船调度问题与信息管理系统的开发设计 基于遗传—模拟退火算法的虚拟企业风险规划问题研究 唐钢1700加热炉钢坯温度神经网络预报模型研究 基于互联网+的多功能PLC实践教学箱的设计与开发 基于Unity的Taptitude小游戏合集的设计与实现 物理摆渡机的设计与实现 直角坐标系中曲线上获取数据的设计与实现 硅修饰纳米TiO2-石墨烯复合材料的制备及其电化学性能研究 以负载钴的多孔炭作燃料电池阴极催化剂的研究 喹啉对4,6-二甲基二苯并噻吩加氢脱硫反应性能毒化作用研究 铜催化取代咔唑的双羰基化反应研究 响应面法优化水溶性沥青/石墨复合材料的制备工艺 EDTA-污泥基活性炭对重金属离子的吸附实验研究 席夫碱衍生物在酸性介质中对低碳钢的缓蚀行为 活性炭再生系统除垢研究 离子交换法处理垃圾渗滤液防垢研究 过渡金属复合活性碳纤维在碱性条件下的氧反应性能研究 多孔硅/碳复合材料的制备及其在锂离子电池中的应用 木鳖子仁中黄酮的提取、鉴定及抗氧化活性的相关研究 响应面法优化细菌ZN-11菌株发酵工艺的研究 产色素放线菌筛选与色素提取及发酵条件优化 微生物选矿的应用研究
时间_事件混合触发通讯系统的研究_徐亮

3
调度方案设计
为了说明方便, 我们可认为每个通讯节点有且
仅有一个通讯任务基于时间触发发送消息 ; 同时有 多个通讯任务基于事件触发发送消息. 我们将每个 调度周期细分为三种不同的时间片: 控制时窗、 确定 时窗、 竞争时窗 . 任务调度表的实例见图 3, 其中控 制时窗的大小固定, 位于每个周期 T 的起始部分, 这个时窗被主控节点占用 , 完成主控节点传输周期 调度信息、 通讯节点同步计时器和解析调度信息 ; 确 定时窗是指分配给某个确定的通讯节点发送时间触 发通讯数据的时间片 ; 竞争时窗是指可以被系统所 有通讯节点利用发送事件触发通讯数据的时间片.
1
引言
普通以太网具有低价格、 高带宽、 技术成熟的特
需要专用的硬件 设备, 例如 T T E 交换机、 板卡、 监 控器等 , 其代价非常高, 限制了其应用的范围 . 针对 有实时性要求但时间粒度要求不高、 希望构建在普 通以太网上的通讯应用 , 本文提出了一种软件实现 方法, 它能通过全局的通讯调度控制 , 最大程度确保 周期任务不超时, 同时减小系统响应异步事件的延 迟时间 . 在网 络 系 统 中, 时 间 触 发 ( T ime T rigg ered, T T ) 是指通讯任务只有在预先决定的时间点上才能 开始运行, 由此可知时间触发机制具有先天的确定 性 , 只要在网络系统运行前设计好了一套可行的任 务调度方案 , 这一系统所要求的实时性理论上是可
最后 , 根据任务优先级次序, 安排确定时窗在调 度表的位置. 这一过程的描述较为复杂 , 详述见文献 [ 7] , 它同时还给出并证明了调度表有效的充分必要 条件 . 这是一种硬实时调度方法 , 对于耗时确定的周 期网络通讯, 这种方法生成的调度表可以保证所有 周期通讯任务的实时性要求. 对于本系统, 因为操作 系统调度导致任务执行时间存在变数, 仍存在少数 任务丢失死限的可能性. 3. 2 调度表编码 每个通讯节点都需要获取属于自己的确定时窗
《MFC编程及应用》课程设计报告

《MFC编程及应用》课程设计报告题目: 简易型科学计算器学号: 姓名:****: ***时间: 2012年5月16日1、设计步骤a)工程建立本工程建立的是一个基于对话框的应用程序。
b)类中新增变量的作用m_inputstr : CEdit类型, 用于与程序中编辑框相关联;m_FormerBase :用于记录上一次是出于何种进制之下, 便于进制转换;c)CMathString: 用于对字符串进行逆波兰表达式的转换并计算结果d)需处理的消息的详细代码对按钮0(OnBnClickedButton0)的响应函数:void CMy1106840420Dlg::OnBnClickedButton0(){CString temp;//定义一个CString对象this->UpdateData(true);//从编辑框获得m_inputstr的值m_inputstr.GetWindowText(temp);//获取字符串并存入temp中temp += '0';//在字符串末尾添加字符‘0’this->m_inputstr.SetWindowText(temp);//将字符串设置回m_inputstr中this->UpdateData(false);//更新数据, 编辑框显示}对按钮1(OnBnClickedButton1)、2(OnBnClickedButton2)、3(OnBnClickedButton3)、4(OnBnClickedButton4)、5(OnBnClickedButton5)、6(OnBnClickedButton6)、7(OnBnClickedButton7)、8(OnBnClickedButton8)、9(OnBnClickedButton9)、A(OnBnClickedButtonA)、B(OnBnClickedButtonB)、C(OnBnClickedButtonC)、D(OnBnClickedButtonD)、E(OnBnClickedButtonE)、F(OnBnClickedButtonF)、左括号(OnBnClickedButtonLbracket)、右括号(OnBnClickedButtonRbracket)、+(OnBnClickedButtonAdd)、—(OnBnClickedButtonMinus)、×(OnBnClickedButtonMultiply)、/(OnBnClickedButtonDiv)、小数点(OnBnClickedButtonPoint)、PI (OnBnClickedButtonPi)的响应函数与按钮0类似, 仅末尾添加的字符变为相应的字符。
可编程控制器的基本指令编程实验报告

可编程控制器的基本指令编程实验报告1. 引言本实验旨在研究可编程控制器的基本指令编程。
可编程控制器(Programmable Logic Controller,简称PLC)是一种专用计算机,常用于工业自动化领域。
通过编程,PLC可以根据输入信号的状态来判断并控制输出信号的状态,实现自动化控制。
2. 可编程控制器的基本指令可编程控制器的基本指令可以分为输入输出指令、变量指令和逻辑指令三大类。
2.1 输入输出指令输入输出指令用于读取输入信号和控制输出信号。
常见的输入输出指令包括:•XIC(eXamine If Closed)指令:用于检测输入信号是否为闭合状态,如果闭合则执行后续程序。
•XIO(eXamine If Open)指令:用于检测输入信号是否为开启状态,如果开启则执行后续程序。
•OTE(Output To External)指令:用于将输出信号设置为高电平或低电平状态,控制外部设备的运行。
2.2 变量指令变量指令用于对变量进行操作,包括赋值、比较、运算等。
常见的变量指令包括:•MOV(Move)指令:用于将一个值赋给一个变量。
•ADD(Addition)指令:用于对两个变量进行加法运算,并将结果保存到一个变量中。
•CMP(Compare)指令:用于对两个变量进行比较,判断它们的大小关系。
•INC(Increment)指令:用于对一个变量进行加1操作。
2.3 逻辑指令逻辑指令用于进行逻辑判断和控制流程。
常见的逻辑指令包括:•LIM(Less Than Immediate)指令:判断一个变量是否小于一个立即数,如果是则执行后续程序。
•JZ(Jump if Zero)指令:如果指定的变量为0,则跳转到指定的标签处继续执行程序。
•CTU(Counter Up)指令:用于实现计数功能,当一个变量达到设定值时,产生一个输出脉冲。
3. 实验过程本实验通过编程软件对一个简单的控制任务进行了模拟。
实验包括以下步骤:3.1 硬件准备搭建实验所需的硬件系统,包括输入设备、输出设备以及可编程控制器。
一种AGV调度用组合式无线通信模块的设计

一种AGV调度用组合式无线通信模块的设计徐亮;陆锦军;焦振宇【摘要】针对目前AGV调度缺乏专用通信解决方案的情况,设计了一种"核心板+底板"的组合式无线通信模块,并制定了相应的通信协议.核心板以STM32F030C8作为控制器,通过ESP8266以串口无线透传方式与调度计算机通信;底板分为串口通信底板与开关量输入底板两种,主要用于将模块分别连接到AGV控制器与设备控制器.经实践证实,该模块掉线率基本在0.5%以内,通信稳定,同时具备安装方便、二次开发简单等优点,能适用于大部分基于WIFI通信的AGV应用项目.%Aimed at the situation that there isn't proprietary communication solution for AGV dispatching,a combined wireless communication module of "coreboard+bottom board" is designed,and the corresponding communication protocol is issued. STM32F030C8 is used as the controller of the core board,and it communicates with dispatch computer by ESP8266 in the way of pass-through between serial port and WIFI.There are two kinds of bottom boards, which contain serial port communication bottom boards and ON-OFF value input bottom boards,and the bottom board is used to connect the module to the AGV controller or the equipment controller mainly. Facts prove that the module communicates stably and the dropped-call rate is under 0.5% basically,and the module also has the advantages of convenient installation,easy secondary development,etc. The module can be applied to most AGV applications based on WIFI communication.【期刊名称】《电子器件》【年(卷),期】2018(041)002【总页数】5页(P474-478)【关键词】无线通信;AGV调度;模块设计;组合式;STM32F030C8;ESP8266【作者】徐亮;陆锦军;焦振宇【作者单位】江苏信息职业技术学院机电工程学院,江苏无锡214153;江苏信息职业技术学院机电工程学院,江苏无锡214153;江苏信息职业技术学院机电工程学院,江苏无锡214153【正文语种】中文【中图分类】TN923;TP21自动引导车AGV(Automated Guided Vehicle)是一种能通过一种或多种传感器检测[1-2],按照设定路线自动巡航的载重小车,目前在物流、仓储、生产等领域扮演着越来越重要的角色[1]。
《自动化导论》课程报告

《自动化导论》课程报告自动化,这个在当今科技领域熠熠生辉的词汇,正以其强大的力量改变着我们的生活和社会。
通过《自动化导论》这门课程的学习,我仿佛打开了一扇通往未来世界的大门,对自动化的奥秘有了初步但深刻的认识。
自动化是什么?简单来说,它是让机器或系统在没有人直接干预的情况下,按照预定的程序或规则自动运行,完成特定的任务。
这听起来似乎有些抽象,但实际上,自动化的应用无处不在。
从我们日常生活中常见的智能家居设备,如能够自动调节温度的空调和根据设定时间自动烹饪的电饭煲,到工业生产中的自动化生产线,能够高效、精准地制造出各种产品,再到交通运输领域的自动驾驶汽车和智能交通系统,自动化的身影无所不在。
自动化的发展历程可谓是一部波澜壮阔的科技进步史。
从早期简单的机械控制装置,到后来的电子控制系统,再到如今融合了计算机技术、通信技术、人工智能等多种先进技术的复杂自动化系统,每一次的突破都带来了巨大的变革。
在工业革命时期,蒸汽机的发明和应用开启了机械化生产的时代,为自动化的发展奠定了基础。
随着电气技术的发展,电动机的出现使得生产过程中的动力控制更加灵活和精确。
而在 20 世纪中叶,计算机技术的兴起则为自动化带来了质的飞跃,使得复杂的控制算法和大规模的数据处理成为可能。
自动化系统通常由感知、决策和执行三个主要部分组成。
感知环节就像是系统的“眼睛”和“耳朵”,通过各种传感器收集环境和工作对象的信息,如温度、压力、位置等。
决策环节则如同系统的“大脑”,对感知到的信息进行分析和处理,根据预设的规则和算法做出决策。
执行环节则是系统的“手脚”,负责将决策转化为实际的动作,如驱动电机、控制阀门等。
这三个环节紧密配合,协同工作,使得自动化系统能够高效、稳定地运行。
在自动化的众多应用领域中,工业自动化无疑是最为重要的领域之一。
在现代工厂中,自动化生产线能够大大提高生产效率、保证产品质量的一致性,同时降低生产成本。
例如,汽车制造工厂中的焊接机器人能够精确地完成焊接工作,速度和质量远远超过人工操作。
14417228-徐亮-自动化142-单片机数字时钟

1.前言1.1课题名称数字时钟设计1.2实习意义1、熟悉单片机的结构和各引脚的的功能以及如何用程序控制。
2、学习用单片机对数字时钟控制、按键扫描及LED数码管显示的设计方法。
3、了解键盘的结构以及工作原理,通过单片机的定义实现对数码管时钟的调整。
1.3设计内容及功能设计一个具有报时功能、停电正常运行(来电无需校时)、带有时分秒显示的电子时钟。
系统由单片机、LED数码管、按键、蜂鸣器、实时时钟等部分构成,能实现时间的调整、定时时间的设定,输出等功能。
系统的功能选择由SB0、SB1、SB2、SB3完成。
其中SB0为时间校对,定时器调整功能键,按SB0 进入调整状态。
按SB1键,依次进入时间时位校对、分位校对、秒位校对状态。
不管是进入那种状态,按动SB2皆可以使被调整位进行不进位增量加1变化。
各预置量设置完成后,系统将所有的设置存入RAM 中,按SB1 退出调整状态。
定时时间到,蜂鸣器发声。
选做:①采用LCD或OLED或上位机显示;②实现用电池供电。
1.4实习进度安排本次实习我们持续两周,时间为从2016年12月26号至2017年01月06号,第一周主要进行题目选择、软件流程分析及硬件原理图的处理,第二周进行软件开发与调试,最终进行设计成果检测。
具体见下表1.1。
表1.1 实习进度安排1.5设计原理及功能本次我们用C51语言进行设计,利用单片机定时器完成计时功能,定时器0定时方式1计时中断程序每隔10ms中断一次并当作一个计数,设定定时1秒的中断计数初值为0,每中断一次中断计数初值加1,当加到20时,则表示1s到了,秒变量加1,同理再判断是否1min钟到了,再判断是否1h到了。
采用动态数码管显示,通过循环对8个数码管依次扫描,使对应数码管点亮,同时向对应数码管输送对应的字码,使其显示数字。
由于数码管扫描周期很短,由于人眼的视觉暂留效应,使数码管看起来总是亮的,从而实现了各种显示。
2.实习设计分析我们采用单片机开发版进行设计,写入程序,然后烧入即可,省去了接线的麻烦,操控单片机开发版上四个按键可进行相应功能模式的选择与切换。
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
序号:学号: 14417228C H A N G Z H O U U N I V E R S I T Y课 程 设 计课程设计名称: 抽乌龟学 院 名 称 :信息数理学院学 生 姓 名: 徐亮 小 组 成 员:林志远 杨蒙姣 徐亮 .设计时间: 2015 年7 月1 日 2015 年7 月10 日目录一、“抽乌龟”任务书 (1)二、翻译 (3)Using cards.dll API (3)How to access the cards.dll API .. 3 Exported functions from cards.dll 3 How to load a Dynamic Link Library (6)Using the 16bit cards.dll library 7 WM_TIMER message (9)WM_LBUTTONDOWN message (10)Requirements (13)三、程序概述 (14)四、结构框图 (15)五、程序代码 (15)六、使用说明 (26)七、设计日志以及心得体会 (27)一、“抽乌龟”任务书"纸牌游戏——抽乌龟”任务书一、目的要求本课程设计任务的目的是要求学生按照分析、设计、编码、调试和测试的软件开发过程独立完成一个纸牌游戏程序,并能最终实现本系统的功能要求。
本任务要求完成拓展一,拓展六。
二、功能要求【题目描述】只要抽对方的牌,抽到一对可以打出去,最后看谁还剩下牌,这个就是乌龟牌。
这个游戏能够勾起不少人童年的回忆,这是多数人小时候经常玩的一种牌。
人机对战抽乌龟的规则是只选取红桃和方片两种牌型,由电脑和玩家随机抽取13张牌,然后从玩家手中的13张牌中随机抽走1张牌。
然后由电脑开始轮流从对方手中抽取一张牌。
一旦一手牌中有两张牌的点数相同(称为对子),则可同时将这两张牌收纳,并获得这两张牌的点数(分数)最后一张不能组成对子的牌就是乌龟,持有乌龟的玩家扣50分。
看电脑和玩家谁先达到100分获胜或-100分失败。
牌的点数计算为2~9的点数为各自的分值,10~K为10分,A为15分。
【程序要求】在屏幕上画出4行扑克,第一行为电脑的收纳牌盒,第二行为电脑持牌,第三行为玩家持牌,第四行为玩家收纳牌盒。
其中电脑持牌不对玩家显示。
在屏幕的最右边需要显示当前电脑得分,玩家得分,当前第几局等信息。
使用鼠标在电脑持牌行选取扑克,当鼠标点击时,将电脑牌翻开停留1秒后保存到自己持牌列,1秒后对自己持牌进行整理。
按下空格键切换到电脑抽牌,电脑抽牌时同样需要经过这2秒的停顿以便玩家能看清。
【难点提示】使用数组或者结构体数组保存扑克的点数以及相应的位置。
由于扑克之间会有重叠,因此需要计算扑克显示的位置,以便鼠标处理。
每当抽牌以后,需要重新计算各个数组中牌的点数和位置。
停顿1s可以使用Sleep(1000)来完成。
但是这将导致这1s中程序不响应,较好的解决办法是使用定时器。
参见拓展二。
二、翻译Using cards.dll APIHow to access the cards.dll APIThe aim of this article is to describe exactly how to use cards.dll, the dynamic link library that has shipped with all versions of windows since version 3.0. This library contains all of the playing card bitmapped images that games such as Windows Solitare use to display their graphics.There are actually two versions of cards.dll. The Windows 95 series of operating systems (this includes Windows 98 and Windows ME) use the original 16bit version which shipped way back with Windows 3.0. Obviously there are going to be problems using this 16bit DLL from your 32bit application, but I will come on to that later. The second version is a 32bit DLL, and ships with the Windows NT series (Windows NT, Windows 2000 etc). I will explain how to use this version first. Exported functions from cards.dllCards.dll exports five functions which your program can use to draw card images. These functions are the the only interface that cards.dll provides to draw cards. Note that these functions never let you have access to the bitmaps; rather, you supply a device context and thecard functions draw the card bitmaps for you. Here is a description of each function, and its prototype.cdtInitBOOL WINAPI cdtInit (int *width, int *height)Initializes the cards.dll library for your application. You must supply the addresses of two variables, in which cards.dll stores the width and height (in pixels) of a card.cdtDrawBOOL WINAPI cdtDraw (HDC hdc, int x, int y, int card, int type, DWORD color)Draws a card at position x, y on the device context hdc. The type parameter controls whether the front, the back, or the inverted front of the card is drawn.The card parameter controls which card is drawn. This parameter is dependent on the value of type. If a card face is to be drawn (type is 0 or 2), then card must be a value from 0 through 51 to represent each card. If type specifies that a card back is to be drawn (type is 1), then card must be a value from 53 to 68 (inclusive), to represent one of the 16 possible card backs.The card faces are organised in increasing order. That is, the aces come first, then the two's and so on. In each group, the cards are ordered by suit. The order is clubs, diamons, hearts, spades. This pattern is repeated as the card values increase.You can use the following values to represent each card suit.#define ecsCLUBS 0#define ecsDIAMONDS 1#define ecsHEARTS 2#define ecsSPADES 3To calculate the value of card given a suit (0-3) and a face value(0-13, 0 being aces, 13 being kings), you can use this simple formula: card = suit + face * 4Here is a list of the 16 possible card backgrounds that you can usein your code.#define ecbCROSSHATCH 53#define ecbWEAVE1 54#define ecbWEAVE2 55#define ecbROBOT 56#define ecbFLOWERS 57#define ecbVINE1 58#define ecbVINE2 59#define ecbFISH1 60#define ecbFISH2 61#define ecbSHELLS 62#define ecbCASTLE 63#define ecbISLAND 64#define ecbCARDHAND 65#define ecbUNUSED 66#define ecbTHE_X 67#define ecbTHE_O 68Lastly, the color parameter sets the background color for the ecbCrossHatch card back, which uses a pattern drawn with lines. All the other backs and fronts are bitmaps, so color has no effect.cdtDrawExtBOOL WINAPI cdtDrawExt (HDC hdc, int x, int y, int dx, int dy,int card, int suit, DWORD color)This procedure is the same as cdtDraw except that you specify the dx and dy parameters to indicate the size of the card. The card bitmaps are stretched or compressed to the specified size.cdtAnimateBOOL WINAPI cdtAnimate (HDC hdc, int cardback, int x, int y, int frame)This function animates the backs of cards by overlaying part of thecard back with an alternative bitmap. It creates effects: blinking lights on the robot, the sun donning sunglasses, bats flying across the castle, and a card sliding out of a sleeve. The function works only for cards of normal size drawn with cdtDraw. To draw each state, start with frame set to 0 and increment through until cdtAnimate returns 0.cdtTermvoid WINAPI cdtTerm (void)This function cleans up the card resources from your program. It takes no parameters, and returns no values. It is a good idea to call this function just before your card game exits.How to load a Dynamic Link LibraryThe best way to access the cards.dll libary is to use the LoadLibrary API call, and then use GetProcAddress to access the individualfunctions that cards.dll exports.HMODULE hCardDll;...BOOL InitCardsDll(void){hCardDll = LoadLibrary("cards.dll");if(hCardDll == 0)return FALSE;cdtInit = (pfcdtInit) GetProcAddress(hCardDll, "cdtInit");cdtDraw = (pfcdtDraw) GetProcAddress(hCardDll, "cdtDraw");cdtDrawEx = (pfcdtDrawEx) GetProcAddress(hCardDll, "cdtDrawExt");cdtTerm = (pfcdtTerm) GetProcAddress(hCardDll, "cdtTerm");return TRUE;}You should use the following typedef's to define each functionprototype:typedef BOOL (WINAPI *pfcdtInit)(int *, int *);typedef BOOL (WINAPI *pfcdtDraw)(HDC, int x, int y, int card, int type, DWORD color);typedef BOOL (WINAPI *pfcdtDrawEx)(HDC, int x, int y, int dx, int dy, int card, int type, DWORD color); typedef BOOL (WINAPI *pfcdtAnimate)(HDC hdc, int cardback, int x, int y, int state);typedef void (WINAPI *pfcdtTerm) (void);Note that all parameters to the 32bit library are themselves 32bitsin size.That's really all there is to it. Don't forget to release the librarywith FreeLibrary before your program exits.Using the 16bit cards.dll libraryo links for additional If you want your card game to run on Windows 95 thenyou have a problem, because 16bit DLLs are not directly compatiblewith a 32bit application. You have two options to choose from. Thefirst is to distribute the 32bit version of cards.dll with your game.This is a bad idea, because firstly it's probably illegal to do thisunless you have permission from Microsoft, and secondly, cards.dllis around 150Kb, which is a bit on the hefty side. Your second optionis to access the 16bit dll from your 32bit code using a technique calledFlat Thunking.Flat Thunking is documented (I won't say fully) in MSDN. It involveswriting two additional thunking DLLs; a 32bit DLL which thunks downto 16bit mode, and a 16bit DLL which calls the functions inside the"target" 16bit DLL.Whilst this is OK in itself, I've always thought it was a little messy to have to distribute two additional DLLs. Fortunately there is an undocumented method to perform a Flat Thunk directly from your win32 application.There is an undocumented function in KERNEL32.DLL called QT_Thunk. This function is used by a flat-thunk DLL pair to perform a thunk from 32 to 16bits. Using a little assembly language we can use this function directly from our own application without any additional DLLs. I won't describe here exactly how to perform this trick as it is fully documented in the source code.Assuming that we can now access the 16bit version of cards.dll, there are a couple of points to mention. The first is that we are dealing with a 16bit executable module. This means that the default size of an integer is 16bits. The consequence of this is that we need to make sure that we only pass 16bit integers to cards.dll. DWORD values can stay as 32bits. The source-code handles this correctly.The demonstration program uses the same 32bit function prototypes to access cards.dll regardless of which version of Windows you are using. The flat thunking is hidden behind a set of 32bit wrapper functions, so the test program does not need to know which version of Windowsit is running under when it calls the cards.dll functions.You may want to check out these tw information on this flat thunking trick.WM_TIMER messagePosted to the installing thread's message queue when a timer expires.The message is posted by the GetMessage or PeekMessage function.#define WM_TIMER 0x0113ParameterswParam [in]The timer identifier.lParam [in]A pointer to an application-defined callback function that waspassed to the SetTimer function when the timer was installed. Return valueType: LRESULTAn application should return zero if it processes this message. RemarksYou can process the message by providing a WM_TIMER case in the window procedure. Otherwise,DispatchMessage will call the TimerProc callback function specified in the call to the SetTimer function used to install the timer.The WM_TIMER message is a low-priority message. The GetMessage and PeekMessage functions post this message only when no other higher-priority messages are in the thread's message queue. RequirementsMinimum supported client Windows 2000 Professional [desktop apps only]Minimum supported server Windows 2000 Server [desktop apps only]Header Winuser.h (include Windows.h)WM_LBUTTONDOWN messagePosted when the user presses the left mouse button while the cursor is in the client area of a window. If the mouse is not captured, the message is posted to the window beneath the cursor. Otherwise, the message is posted to the window that has captured the mouse.A window receives this message through its WindowProc function.C++#define WM_LBUTTONDOWN 0x0201ParameterswParamIndicates whether various virtual keys are down. This parameter can be one or more of the following values.Value MeaningThe CTRL key is down.MK_CONTROL0x0008The left mouse button is down.MK_LBUTTON0x0001The middle mouse button is down.MK_MBUTTON0x0010MK_RBUTTONThe right mouse button is down.0x0002The SHIFT key is down.MK_SHIFT0x0004MK_XBUTTON1The first X button is down.0x0020The second X button is down.MK_XBUTTON20x0040lParamThe low-order word specifies the x-coordinate of the cursor. The coordinate is relative to the upper-left corner of the client area.The high-order word specifies the y-coordinate of the cursor.The coordinate is relative to the upper-left corner of the client area.Return valueIf an application processes this message, it should return zero. RemarksUse the following code to obtain the horizontal and vertical position: xPos = GET_X_LPARAM(lParam);yPos = GET_Y_LPARAM(lParam);As noted above, the x-coordinate is in the low-order short of the return value; the y-coordinate is in the high-order short (both represent signed values because they can take negative values on systems with multiple monitors). If the return value is assigned to a variable, you can use the MAKEPOINTS macro to obtain a POINTS structure from the return value. You can also use the GET_X_LPARAM or GET_Y_LPARAM macro to extract the x- ory-coordinate.Important Do not use the LOWORD or HIWORD macros to extract the x- and y- coordinates of the cursor position because these macros return incorrect results on systems with multiple monitors. Systems with multiple monitors can have negative x- and y- coordinates, and LOWORD and HIWORD treat the coordinates as unsigned quantities. To detect that the ALT key was pressed, check whether GetKeyState with VK_MENU < 0. Note, this must not be GetAsyncKeyState.RequirementsMinimum supported client Windows 2000 Professional [desktop apps only]Minimum supported server Windows 2000 Server [desktop apps only]Header Winuser.h (include Windowsx.h)三、程序概述1、主要功能:本程序为一款经典玩家与电脑对战的游戏程序,名叫抽乌龟,通过抽取对方牌来获得对子,当取得对子便加上当前点数相应的分数,最终计算分数,并持有乌龟牌的玩家减50分,分数高的玩家获得胜利。