Chinaunix首页 | 论坛 | 博客
  • 博客访问: 419553
  • 博文数量: 55
  • 博客积分: 167
  • 博客等级: 入伍新兵
  • 技术积分: 1167
  • 用 户 组: 普通用户
  • 注册时间: 2012-08-28 10:20
个人简介

一个算是正常的中国码农!

文章分类

全部博文(55)

文章存档

2014年(1)

2013年(31)

2012年(23)

我的朋友

分类: IT业界

2012-09-12 18:42:11

我这些天利用delphi系统做了一个图片单井综合管理平台。
里面有一个实时监控的趋势图,我使用了ixyplot等空间。
一下是它的使用情况,这是一下的图片代码,记住只要设置好通道每个通道的编号都是从0开始的,这个我开始第时候出了错误,这里特别强调一下。
一下是代码,希望想用的直接看代码就ok
procedure TForm1.sys_init(MAX:Double;MIN:Double;chennal_no:Integer;iXYPlot_temp:TiXYPlot);
  var
  index_max,index_min:Integer;
 // i:Real;
begin
 // StrToFloat()
  index_max := iXYPlot_temp.AddLimit;
  iXYPlot_temp.Limit[index_max].YAxisName:=iXYPlot_temp.Channel[chennal_no].YAxisName;
  iXYPlot_temp.Limit[index_max].LineWidth := 1;
  iXYPlot_temp.Limit[index_max].Style := iplsLiney;
  iXYPlot_temp.Limit[index_max].Color := clRed;
  iXYPlot_temp.Limit[index_max].LineStyle := psSolid;
  iXYPlot_temp.Limit[index_max].Line1Position:=MAX;
  //Result:=index_max;
  index_min := iXYPlot_temp.AddLimit;
  iXYPlot_temp.Limit[index_min].YAxisName:=iXYPlot_temp.Channel[chennal_no].YAxisName;
  iXYPlot_temp.Limit[index_min].LineWidth := 1;
  iXYPlot_temp.Limit[index_min].Style := iplsLiney;
  iXYPlot_temp.Limit[index_min].Color := clRed;
  iXYPlot_temp.Limit[index_min].LineStyle := psSolid;
  iXYPlot_temp.Limit[index_min].Line1Position:=MIN;

end;
procedure TForm1.bar_create(value_channel_1:Double ;  iPlot_temp:TiPlot ; getime_temp:TDateTime);

begin
  try
    //for i :=0 to count_temp-1 do
    //begin
      // 通道0的数据显示参数
       iPlot_temp.Channel[0].DataStyle := ipdsFullFeature ;
       iPlot_temp.Channel[0].TraceVisible := False;
       iPlot_temp.Channel[0].BarEnabled := True;
       iPlot_temp.Channel[0].BarWidth := 0.1 ;
       iPlot_temp.Channel[0].BarPenUseChannelColor := False ;
       iPlot_temp.Channel[0].AddXY(getime_temp+0.2, value_channel_1);
      //通道1的数据显示参数
   // end;
  except
       Application.MessageBox('数据建图出错','提示',0);
       Exit;
  end ;
end;
procedure TForm1.bar_create_0(value_channel_1:Double ;  iPlot_temp:TiPlot ; getime_temp:TDateTime);
begin
  try
     iPlot_temp.Channel[1].DataStyle := ipdsFullFeature ;
     iPlot_temp.Channel[1].TraceVisible := False;
     iPlot_temp.Channel[1].BarEnabled := True;
     iPlot_temp.Channel[1].BarWidth := 0.1 ;
     iPlot_temp.Channel[1].BarPenUseChannelColor := False ;
     iPlot_temp.Channel[1].AddXY(getime_temp+0.2, value_channel_1);
  except
  end

end;
这是一段过程代码,直接考过就可以使用,希望对象学的有用!
阅读(3821) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~