Delphi实习报告_开发区实习报告
Delphi实习报告由刀豆文库小编整理,希望给你工作、学习、生活带来方便,猜你可能喜欢“开发区实习报告”。
实 习 报 告 书 专 用 纸
实 习 报 告 书
引言
题
目: Delphi 学
院:
专
业: 地理信息系统 班
级:
姓
名: 学
号:
2013年
6月日
实 习 报 告 书 专 用 纸
娱乐场所信息查询软件,软件界面设计简洁,美观,其人性化的软件流程,可以让一般人方便的查询娱乐场所,上手极易,不用打开多个窗口可重复查询。系统需求分析
根据用户的需求,对本系统做整体的需求分析,这是保证系统有效性和实用性的前提。
2.1 功能需求分析
在设计本系统之前,作者与相关工作人员进行了交流,并对此进行了归纳提炼,得出建立一个娱乐场所信息查询应具备如下功能:
(1)娱乐场所信息查询。可以对任何一个娱乐场所的详细信息进行查询,其中包括名称、所处路名、ID等。
(2)娱乐场所所在地区的地图显示。(3)最短路径的分析。(4)地图打印。
2.2 数据需求
根据功能需求的要求,需要有一系列的数据来支撑,本系统需要的数据包括所处地区的地图模板、道路信息、娱乐场所信息等 系统设计
为确保系统顺利的实施,本系统遵循软件工程原理和方法,对系统进行总体设计和详细设计;其次,应满足先进性原则,依照国际标准,借鉴主流系统的体系结构,保证系统具有较长的生命力和扩展能力;此外,还应满足成熟性原则、实用性原则、高可靠性原则等。根据需求分析的结果,本着以上原则展开对本系统的设计。
3.1 界面设计
为了界面设计,增强系统的美观性、灵活性,使系统易于操作,采用了很多优秀的实 习 报 告 书 专 用 纸
3.1.1 登录界面
该系统需要输入用户名、密码才可运用,具有较好的保护性
3.1.2 关于界面
3.2 技术路线
本系统采用Embarcadero Delphi XE3作为开发工具。Delphi,是Windows平台下著名的快速应用程序开发工具,最早的版本由美国Borland(宝兰)公司于1995年开发。
实 习 报 告 书 专 用 纸
Delphi是一个集成开发环境(IDE),使用的核心是由传统Pascal语言发展而来的Object Pascal,以图形用户界面为开发环境,通过集成开发环境、VCL工具与编译器,配合连结数据库的功能,构成一个以面向对象程序设计为中心的应用程序开发工具。
“真正的程序员用C,聪明的程序员用Delphi”,这句话是对Delphi最经典、最实在的描述。Delphi最大的特点是简单易学、执行高效而且功能强大。和Microsoft Visual Studio C++ 相比,Delphi更易于掌握,学习周期也比较短,而在功能上却丝毫不逊色;而与Visual Basic相比,Delphi功能更强大、更实用,尤其在开发数据库方面,它的特点更是体现得淋漓尽致。这正是作者选用Delphi作为开发工具的原因。
Delphi发展至今,从Delphi 1到现在的Delphi XE2,不断添加和改进各种特性,功能越来越强大。Delphi 2010内置了Direct 2D模块及开发库,其新加的功能包括:○1○1支持64位Windows操作系统的开发;○2○2称为FireMonkey的新的跨平台框架;○3○3在Windows上开发,用来编译Max OS X的交叉编译器;④FireMonkey支持iOS(Apple iPad及iPhone)的开发;⑤LiveBindings的新的数据绑定功能,允许你将任何可视对象绑定到任何使用表达式的源对象。系统实现
4.1 概述
在完成了需求分析、系统设计和技术路线的选定后,按照前期工作的思路,逐步的实现商品管理系统。本系统以Delphi XE3为开发环境,实现了连云港娱乐场所信息查询功能。
4.2 功能模块实现
4.2.1 登录模块
实 习 报 告 书 专 用 纸
操作部分核心代码如下所示:
procedure TForm2.Button1Click(Sender: TObject);begin
ClientDataSet1.Close;ClientDataSet1
.CommandText
:='select
*
from
Table01
where name='''+edit1.Text+''' and “PASSWORDs” ='''+edit2.text+'''';ClientDataSet1.Open;if ClientDataSet1.RecordCount=0 then begin ShowMeage('口令错误');end else begin ModalResult:=mrOk;end;end;4.2.2 图层管理
实 习 报 告 书 专 用 纸
操作部分核心代码如下所示:
procedure TForm1.FormCreate(Sender: TObject);var denglu: TForm2;begin pShpLayer := TGIS_LayerSHP.Create;pShpLayer.path := 'D:delphi连云港.shp';ttkViewer1.Add(pShpLayer);pShpLayer := TGIS_LayerSHP.Create;pShpLayer.path := 'D:delphi道路.shp';ttkViewer1.Add(pShpLayer);pShpLayer := TGIS_LayerSHP.Create;pShpLayer.path := 'D:delphi娱乐.shp';pShpLayer.Params.Labels.Field := '名称';pShpLayer.Params.Labels.color := clred;ttkViewer1.Add(pShpLayer);ttkViewer1.FullExtent;pShpLayer1 := ttkViewer1.items[0] as TGIS_LayerVector;pShpLayer2 := ttkViewer1.items[1] as TGIS_LayerVector;pShpLayer3 := ttkViewer1.items[2] as TGIS_LayerVector;denglu := TForm2.Create(Self);denglu.showmodal;
实 习 报 告 书 专 用 纸
denglu.Free;end;4.2.3 图层的放大缩小(1)点击缩放
操作部分核心代码如下所示
procedure TForm1.Button2Click(Sender: TObject);begin ttkViewer1.mode := giszoomex;end;
(2)点击暂停缩放
操作部分核心代码如下所示:
procedure TForm1.Button3Click(Sender: TObject);begin ttkViewer1.mode := gisSelect;end;4.2.4点击地图平移
实 习 报 告 书 专 用 纸
操作部分核心代码如下所示:
procedure TForm1.Button5Click(Sender: TObject);begin ttkViewer1.mode := gisdrag;end;4.2.5点击属性查询
实 习 报 告 书 专 用 纸
操作部分核心代码如下所示:
procedure TForm1.Button4Click(Sender: TObject);begin ttkViewer1.mode := gisSelect;end;4.2.6路名显示 点击路名显示
操作部分核心代码如下所示:
procedure TForm1.Button8Click(Sender: TObject);begin pShpLayer1.Params.Labels.Visible := false;pShpLayer3.Params.Labels.Field := '名称';pShpLayer2.Params.Labels.Field := '路名';ttkViewer1.FullExtent;end;4.2.7最短路径分析 点击最短路径查询
实 习 报 告 书 专 用 纸
操作部分核心代码如下所示:
procedure TForm1.Button6Click(Sender: TObject);var ii, jj: Integer;I: Integer;aa, bb: string;begin presultlayer := TGIS_LayerVector.Create;presultlayer.CS := ttkViewer1.CS;presultlayer.Params.Line.color := clred;presultlayer.Params.Line.Width := 40;presultlayer.HideFromLegend := True;ttkViewer1.Add(presultlayer);
proadlayer := ttkViewer1.Items[1] as TGIS_LayerVector;
pgeocoding := tgis_geocoding.Create(proadlayer);pgeocoding.RoadName := 'GIS_UID';(ttkViewer1.Get('TGIS_Geocoding')
as
实 习 报 告 书 专 用 纸
TGIS_LayerVector).HideFromLegend := True;
pshortespath := TGIS_ShortestPath.Create(ttkViewer1);pshortespath.LoadTheData(proadlayer);pshortespath.RoadName := 'GIS_UID ';pshortespath.UpdateTheData;pshape := proadlayer.FindFirst(proadlayer.Extent, '路名=''' + Edit1.Text + '''');aa := pshape.GetField('gis_uid');ii := pgeocoding.Parse(aa);if ii > 0 then begin pstartpoint := pgeocoding.Point[0];Edit1.Text := pgeocoding.Query[0];pgeocoding.AddPoint(pstartpoint, 3 / ttkViewer1.Zoom, nil);end else begin ShowMeage(Edit1.Text + ' 是无效地名');Exit;end;
pshape := proadlayer.FindFirst(proadlayer.Extent, '路名=''' + Edit2.Text + '''');bb := pshape.GetField('gis_uid');jj := pgeocoding.Parse(bb);if jj > 0 then begin pstoppoint := pgeocoding.Point[0];Edit2.Text := pgeocoding.Query[0];pgeocoding.AddPoint(pstoppoint, 3 / ttkViewer1.Zoom, nil);end else
实 习 报 告 书 专 用 纸
begin ShowMeage(Edit2.Text + ' 是无效地名');Exit;end;
pshortespath.UpdateTheData;if pshortespath.Find(pstartpoint, pstoppoint)then begin presultlayer.RevertAll;for I := 0 to pshortespath.ItemsCount-1 do begin pshape pshortespath.Items[I].Layer.GetShape(pshortespath.Items[I].Uid);if pshape nil then presultlayer.AddShape(pshape);end;ttkViewer1.VisibleExtent := presultlayer.Extent;ttkViewer1.Zoom := ttkViewer1.Zoom * 0.8;ttkViewer1.Update;end else begin ShowMeage(' 此路不通 ');end;end;4.2.8打印 点击打印
:=
实 习 报 告 书 专 用 纸
操作部分核心代码如下所示:
procedure TForm1.Button9Click(Sender: TObject);begin ttksimple.preview;end;4.2.9定点查询 点击定点查询
操作部分核心代码如下所示:
procedure TForm1.Button1Click(Sender: TObject);var pshape: TGIS_Shape;
实 习 报 告 书 专 用 纸
pLayer: TGIS_LayerVector;begin pLayer := ttkViewer1.items[2] as TGIS_LayerVector;pshape := pLayer.FindFirst(pLayer.Extent, '名称=''' + Edit3.Text + '''');if pshape nil then begin ttkViewer1.Center := pshape.Centroid;pshape := pshape.MakeEditable;pshape.IsSelected := true;ttkattrib.ShowShape(pshape);ttkattrib.Visible := true;ttkViewer1.Update;end;end;4.2.9关于模板
4.3 系统功能及效率分析
经过测试,系统总体的执行效率比较高。能够满足用户的基本要求。总结
本论文主要是探讨娱乐场所信息查询服务的设计与实现问题。在系统设计之初,尽管作者做了调查,但依然缺少足够的管理方面的经验,在结构和功能方面尚有考虑不到的地方。