Altium教程EB1 EB2 Tester 12软件设计C1_第1页
Altium教程EB1 EB2 Tester 12软件设计C1_第2页
Altium教程EB1 EB2 Tester 12软件设计C1_第3页
Altium教程EB1 EB2 Tester 12软件设计C1_第4页
Altium教程EB1 EB2 Tester 12软件设计C1_第5页
已阅读5页,还剩9页未读 继续免费阅读

下载本文档

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

文档简介

1、EB1 EB2 Tester 12软件设计TLCDDisplay : extends TWindow第一部分 原理图1.1TLCDDisplay.SchDoc 1.2LED7.C/ _ _ _ _/ | | | _| _ |_ |/ | | | |_ | | | | / / | | | _| | | | | / / | |_ | |_ | |_| | / / |_|_|_/ /_/ (c 2004 PurPer/ Started: 24.08.2004 Ch.W./ 7 Segment LED driver for NEB#include hware.h#include led7.h#defi

2、ne MaxDigit 5/ lookup table for 7 segment digit patterns 0.Fconst _rom char Seg_Pattern=0x3F,0x06,0x5B,0x4F,0x66,0x6D,0x7D,0x07,0x7F,0x6F,0x77,0x7C,0x39,0x5E,0x79,0x71,0x00; static unsigned char CurrentDigit = 0;/-/ Sets cursor position/-void Seg7_SetCurrentPosition(unsigned char NewPosCurrentDigit

3、= NewPos;if(CurrentDigit MaxDigit CurrentDigit = 0;/-/ Gets cursor position/-unsigned char Seg7_GetCurrentPosition(voidreturn CurrentDigit;/-/ writes current digit to digit pattern and advances cursor to next digit/-void Seg7_WriteDigitP(unsigned char Pattern(*(_bsfr volatile unsigned char * (Seg7_S

4、TART_ADDR + (8*CurrentDigit = Pattern;if(+CurrentDigit MaxDigit CurrentDigit = 0;/-/ writes current digit to decimal digit and advances cursor to next digit/ if the current character is . the decimal point is set on the previous/ digit/-void Seg7_WriteDigitN(unsigned char cunsigned char pattern=0;sw

5、itch(ccase : / clearpattern = 0;break;case.: / TODO: implement decimal pointbreak;default:if(c=0 & (c=A & (c=Fpattern = c-(A-10;elsepattern = 0x10; / catch all: blankpattern = Seg_Patternpattern;Seg7_WriteDigitP(pattern; / this handles cursor advance as well/-/ Sets all segments to values starting a

6、t Pattern/ Segment A = Bit0 . Segment G = Bit6, Decimal Point is Bit 7/-void Seg7_Set(char *Patternunsigned char SfrAddr = Seg7_START_ADDR; / initialise to address of digit A unsigned char i;for(i=0;i6;i+(*(_bsfr volatile unsigned char * SfrAddr = *Pattern+;SfrAddr +=8;/- / Sets All digits to bitpat

7、tern DigitValue/ Segment A = Bit0 . Segment G = Bit6, Decimal Point is Bit 7/- void Seg7_SetAll(unsigned char DigitValueunsigned char i;char Pattern6;for(i=0;i6;i+Patterni=DigitValue;Seg7_Set(Pattern;1.3Undo.PAS . Summary Demonstration of the PCBs Undo system. Three procedures to demonstrate how the

8、 Undo system works - as one large Undo or multiple smaller Undos, and create,modify and delete 1/ Execute UndoEach to undo each object repeatedly with several undos 2/ Execute UndoAll procedure to remove all objects with one Undo 3/ Create, Modify and Undo this new object Copyright (c 2006 by PurPer

9、 Limited .Procedure Create2PCBObjectsWithTwoUndos;VarDepth : Integer;Board : IPCB_Board;Fill1 : IPCB_Fill1;Fill2 : IPCB_Fill2;BeginIf PCBServer = Nil Then Exit;CreateNewDocumentFromDocumentKind(PCB;Board := PCBServer.GetCurrentPCBBoard;If Board = Nil Then Exit;/ Initialize robots in PCB ServerPCBSer

10、ver.PreProcess;Fill1 := PCBServer.PCBObjectFactory(eFillObject, eNoDimension, eCreate_Default;Fill1.X1Location := MilsToCoord(4000;Fill1.Y1Location := MilsToCoord(4000;Fill1.X2Location := MilsToCoord(4400;Fill1.Y2Location := MilsToCoord(4400;Fill1.Rotation := 0;Fill1.Layer := eTopLayer;Board.AddPCBO

11、bject(Fill1;/ Notify the robots that the pcb object has been registered.PCBServer.SendMessageToRobots(Board.I_ObjectAddress, c_Broadcast, PCBM_BoardRegisteration, Fill1.I_ObjectAddress; / Clean up robots in PCB ServerPCBServer.PostProcess;/ Initialize robots in PCB ServerPCBServer.PreProcess;Fill2 :

12、= PCBServer.PCBObjectFactory(eFillObject, eNoDimension, eCreate_Default;Fill2.X1Location := MilsToCoord(5000;Fill2.Y1Location := MilsToCoord(3000;Fill2.X2Location := MilsToCoord(5500;Fill2.Y2Location := MilsToCoord(4000;Fill2.Rotation := 45;Fill2.Layer := eTopLayer;Board.AddPCBObject(Fill2;/ Notify

13、the robots that the pcb object has been registered.PCBServer.SendMessageToRobots(Board.I_ObjectAddress, c_Broadcast, PCBM_BoardRegisteration, Fill2.I_ObjectAddress;/ Clean up robots in PCB ServerPCBServer.PostProcess;Client.SendMessage(PCB:Zoom, Action=Redraw , 255, Client.CurrentView;End; .Procedur

14、e Create2PCBObjectsWithOneUndo;VarBoard : IPCB_Board;Fill1 : IPCB_Fill1;Fill2 : IPCB_Fill2;BeginCreateNewDocumentFromDocumentKind(PCB;Board := PCBServer.GetCurrentPCBBoard;If Board = Nil Then Exit;PCBServer.PreProcess;Fill1 := PCBServer.PCBObjectFactory(eFillObject, eNoDimension, eCreate_Default;Fil

15、l1.X1Location := MilsToCoord(4000;Fill1.Y1Location := MilsToCoord(4000;Fill1.X2Location := MilsToCoord(4400;Fill1.Y2Location := MilsToCoord(4400;Fill1.Rotation := 0;Fill1.Layer := eTopLayer;Board.AddPCBObject(Fill1;/ notify the event manager that the pcb object has been registered.PCBServer.SendMess

16、ageToRobots(Board.I_ObjectAddress, c_Broadcast, PCBM_BoardRegisteration, Fill1.I_ObjectAddress;Fill2 := PCBServer.PCBObjectFactory(eFillObject, eNoDimension, eCreate_Default;Fill2.X1Location := MilsToCoord(5000;Fill2.Y1Location := MilsToCoord(3000;Fill2.X2Location := MilsToCoord(5500;Fill2.Y2Locatio

17、n := MilsToCoord(4000;Fill2.Rotation := 45;Fill2.Layer := eTopLayer;Board.AddPCBObject(Fill2;/ notify the event manager that the pcb object has been registered.PCBServer.SendMessageToRobots(Board.I_ObjectAddress, c_Broadcast, PCBM_BoardRegisteration, Fill2.I_ObjectAddress;PCBServer.PostProcess;Clien

18、t.SendMessage(PCB:Zoom, Action=Redraw , 255, Client.CurrentView;End; .VarFill : IPCB_Fill; .Procedure CreateObject(Dummy : Integer = 0;BeginPCBServer.PreProcess;Fill := PCBServer.PCBObjectFactory(eFillObject, eNoDimension, eCreate_Default;Fill.X1Location := MilsToCoord(4000;Fill.Y1Location := MilsTo

19、Coord(4000;Fill.X2Location := MilsToCoord(4400;Fill.Y2Location := MilsToCoord(4400;Fill.Rotation := 0;Fill.Layer := eTopLayer;/ Adds the Fill object into the PCB database for the current PCB document.Board.AddPCBObject(Fill;PCBServer.PostProcess;End; . Procedure ModifyObject(Dummy : Integer = 0;BeginPCBServer.PreProcess;/Undo the fill object.PCBServer.SendMessageToRobots(Fill.I_ObjectAddress, c_Broadcast, PCBM_BeginModify , c_NoEventData;Fill.Layer := eBottomLayer;PCBServer.SendMessageToRobots(Fill.I_ObjectAddress, c_Broadcast, PCBM_EndModify , c_NoEventData;PCBServer.PostProcess;End; .

温馨提示

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

最新文档

评论

0/150

提交评论