⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 istripchart.pas

📁 iocopm3.04源码,一套很好的工控开发工具
💻 PAS
📖 第 1 页 / 共 5 页
字号:
  FXAxisLabelFont := TFont.Create; FXAxisLabelFont.OnChange := BackGroundChangeEvent; FXAxisLabelFont.Color := clWhite;
  FXAxisTitleFont := TFont.Create; FXAxisTitleFont.OnChange := BackGroundChangeEvent; FXAxisTitleFont.Color := clWhite; FXAxisTitleFont.Name := 'Arial';

  FYAxisLabelFont := TFont.Create; FYAxisLabelFont.OnChange := BackGroundChangeEvent; FYAxisLabelFont.Color := clWhite;
  FYAxisTitleFont := TFont.Create; FYAxisTitleFont.OnChange := BackGroundChangeEvent; FYAxisTitleFont.Color := clWhite; FYAxisTitleFont.Name := 'Arial';

  FToolBarActiveModeFont            := TFont.Create; FToolBarActiveModeFont.OnChange   := BackGroundChangeEvent;
  FToolBarActiveModeFont.Color      := clYellow;
  FToolBarActiveModeFont.Style      := [fsBold];

  FToolBarInactiveModeFont          := TFont.Create; FToolBarInactiveModeFont.OnChange := BackGroundChangeEvent;
  FToolBarInactiveModeFont.Color    := clAqua;
  FToolBarInactiveModeFont.Style    := [fsBold];

  FPrinterCommentLinesFont          := TFont.Create;

  FChannelList        := TStringList.Create;
  FLabelChannelList   := TStringList.Create;
  FVerticalLineList   := TStringList.Create;
  FIndexList          := TiDoubleList.Create;
  FPrinterCommentList := TStringList.Create;
  FXMLCommentList     := TStringList.Create;

  AddChannel('Untitled', clRed, iclsSolid, 1);

  FEnableDataDrawMinMax := True;
  FShowToolBar          := True;
  FXAxisLabelPrecision  := 2;
  FYAxisLabelPrecision  := 3;

  FElapsedStartTime := Now;
end;
//****************************************************************************************************************************************************
destructor TiStripChart.Destroy;
begin
  FTitleFont.Free;
  FLegendFont.Free;

  FXAxisLabelFont.Free;
  FXAxisTitleFont.Free;

  FYAxisLabelFont.Free;
  FYAxisTitleFont.Free;

  FToolBarActiveModeFont.Free;
  FToolBarInactiveModeFont.Free;

  FPrinterCommentLinesFont.Free;

  //Kylix TODO
  {$ifndef iCLX}
  if Assigned(FMetaFile)        then FMetaFile.Free;
  {$endif}
  if Assigned(FSnapShotPicture) then FSnapShotPicture.Free;

  RemoveAllChannels;
  RemoveAllLabelChannels;
  RemoveAllVerticalLines;

  FChannelList.Free;
  FLabelChannelList.Free;
  FVerticalLineList.Free;

  FIndexList.Free;
  FPrinterCommentList.Free;
  FXMLCommentList.Free;
  inherited;
end;
//****************************************************************************************************************************************************
procedure TiStripChart.SetTitleText                   (const Value:String );begin SetStringProperty (Value,FTitleText,                   irtBackGround);end;
procedure TiStripChart.SetTitleMargin                 (const Value:Integer);begin SetIntegerProperty(Value,FTitleMargin,                 irtBackGround);end;
procedure TiStripChart.SetAxisGridColor               (const Value:TColor );begin SetColorProperty  (Value,FAxisGridColor,               irtBackGround);end;
procedure TiStripChart.SetXAxisShow                   (const Value:Boolean);begin SetBooleanProperty(Value,FXAxisShow,                   irtBackGround);end;
procedure TiStripChart.SetXAxisTickMinorCount         (const Value:Integer);begin SetIntegerProperty(Value,FXAxisTickMinorCount,         irtBackGround);end;
procedure TiStripChart.SetYAxisTickMinorCount         (const Value:Integer);begin SetIntegerProperty(Value,FYAxisTickMinorCount,         irtBackGround);end;
procedure TiStripChart.SetXAxisLabelMargin            (const Value:Integer);begin SetIntegerProperty(Value,FXAxisLabelMargin,            irtBackGround);end;
procedure TiStripChart.SetXAxisMargin                 (const Value:Integer);begin SetIntegerProperty(Value,FXAxisMargin,                 irtBackGround);end;
procedure TiStripChart.SetYAxisLabelMargin            (const Value:Integer);begin SetIntegerProperty(Value,FYAxisLabelMargin,            irtBackGround);end;
procedure TiStripChart.SetYAxisMargin                 (const Value:Integer);begin SetIntegerProperty(Value,FYAxisMargin,                 irtBackGround);end;
procedure TiStripChart.SetXAxisTickMajorLength        (const Value:Integer);begin SetIntegerProperty(Value,FXAxisTickMajorLength,        irtBackGround);end;
procedure TiStripChart.SetXAxisTickMinorLength        (const Value:Integer);begin SetIntegerProperty(Value,FXAxisTickMinorLength,        irtBackGround);end;
procedure TiStripChart.SetYAxisTickMajorLength        (const Value:Integer);begin SetIntegerProperty(Value,FYAxisTickMajorLength,        irtBackGround);end;
procedure TiStripChart.SetYAxisTickMinorLength        (const Value:Integer);begin SetIntegerProperty(Value,FYAxisTickMinorLength,        irtBackGround);end;
procedure TiStripChart.SetXAxisLabelPrecision         (const Value:Integer);begin SetIntegerProperty(Value,FXAxisLabelPrecision,         irtBackGround);end;
procedure TiStripChart.SetYAxisLabelPrecision         (const Value:Integer);begin SetIntegerProperty(Value,FYAxisLabelPrecision,         irtBackGround);end;
procedure TiStripChart.SetYAxisLabelWidth             (const Value:Integer);begin SetIntegerProperty(Value,FYAxisLabelWidth,             irtBackGround);end;
procedure TiStripChart.SetYAxisLabelWidthFixed        (const Value:Boolean);begin SetBooleanProperty(Value,FYAxisLabelWidthFixed,        irtBackGround);end;
procedure TiStripChart.SetYAxisReverseScale           (const Value:Boolean);begin SetBooleanProperty(Value,FYAxisReverseScale,           irtBackGround);end;
procedure TiStripChart.SetOuterMarginBottom           (const Value:Integer);begin SetIntegerProperty(Value,FOuterMarginBottom,           irtBackGround);end;
procedure TiStripChart.SetOuterMarginLeft             (const Value:Integer);begin SetIntegerProperty(Value,FOuterMarginLeft,             irtBackGround);end;
procedure TiStripChart.SetOuterMarginRight            (const Value:Integer);begin SetIntegerProperty(Value,FOuterMarginRight,            irtBackGround);end;
procedure TiStripChart.SetOuterMarginTop              (const Value:Integer);begin SetIntegerProperty(Value,FOuterMarginTop,              irtBackGround);end;
procedure TiStripChart.SetYAxisShow                   (const Value:Boolean);begin SetBooleanProperty(Value,FYAxisShow,                   irtBackGround);end;
procedure TiStripChart.SetXAxisTickMajorColor         (const Value:TColor );begin SetColorProperty  (Value,FXAxisTickMajorColor,         irtBackGround);end;
procedure TiStripChart.SetXAxisTickMinorColor         (const Value:TColor );begin SetColorProperty  (Value,FXAxisTickMinorColor,         irtBackGround);end;
procedure TiStripChart.SetYAxisTickMajorColor         (const Value:TColor );begin SetColorProperty  (Value,FYAxisTickMajorColor,         irtBackGround);end;
procedure TiStripChart.SetYAxisTickMinorColor         (const Value:TColor );begin SetColorProperty  (Value,FYAxisTickMinorColor,         irtBackGround);end;
procedure TiStripChart.SetGridBackGroundColor         (const Value:TColor );begin SetColorProperty  (Value,FGridBackGroundColor,         irtBackGround);end;
procedure TiStripChart.SetShowGrid                    (const Value:Boolean);begin SetBooleanProperty(Value,FShowGrid,                    irtBackGround);end;
procedure TiStripChart.SetShowLegend                  (const Value:Boolean);begin SetBooleanProperty(Value,FShowLegend,                  irtBackGround);end;
procedure TiStripChart.SetLegendWidth                 (const Value:Integer);begin SetIntegerProperty(Value,FLegendWidth,                 irtBackGround);end;
procedure TiStripChart.SetLegendMargin                (const Value:Integer);begin SetIntegerProperty(Value,FLegendMargin,                irtBackGround);end;
procedure TiStripChart.SetCursorChannelBackGroundColor(const Value:TColor );begin SetColorProperty  (Value,FCursorChannelBackGroundColor,irtBackGround);end;
procedure TiStripChart.SetXAxisTitle                  (const Value:String );begin SetStringProperty (Value,FXAxisTitle,                  irtBackGround);end;
procedure TiStripChart.SetXAxisTitleMargin            (const Value:Integer);begin SetIntegerProperty(Value,FXAxisTitleMargin,            irtBackGround);end;
procedure TiStripChart.SetYAxisTitle                  (const Value:String );begin SetStringProperty (Value,FYAxisTitle,                  irtBackGround);end;
procedure TiStripChart.SetYAxisTitleMargin            (const Value:Integer);begin SetIntegerProperty(Value,FYAxisTitleMargin,            irtBackGround);end;
procedure TiStripChart.SetAutoScrollEnabled           (const Value:Boolean);begin SetBooleanProperty(Value,FAutoScrollEnabled,           irtBackGround);end;
procedure TiStripChart.SetAutoScrollStepSize          (const Value:Double );begin SetDoubleProperty (Value,FAutoScrollStepSize,          irtBackGround);end;
procedure TiStripChart.SetAutoScaleEnabled            (const Value:Boolean);begin SetBooleanProperty(Value,FAutoScaleEnabled,            irtBackGround);end;
procedure TiStripChart.SetAutoScaleHysterisis         (const Value:Double );begin SetDoubleProperty (Value,FAutoScaleHysterisis,         irtBackGround);end;
procedure TiStripChart.SetAutoScaleMaxAdjustEnabled   (const Value:Boolean);begin SetBooleanProperty(Value,FAutoScaleMaxAdjustEnabled,   irtBackGround);end;
procedure TiStripChart.SetAutoScaleMinAdjustEnabled   (const Value:Boolean);begin SetBooleanProperty(Value,FAutoScaleMinAdjustEnabled,   irtBackGround);end;
procedure TiStripChart.SetCursorColor                 (const Value:TColor );begin SetColorProperty  (Value,FCursorColor,                 irtBackGround);end;
procedure TiStripChart.SetCursorChannelFontColor      (const Value:TColor );begin SetColorProperty  (Value,FCursorChannelFontColor,      irtBackGround);end;
procedure TiStripChart.SetCursorHideAllOtherChannels  (const Value:Boolean);begin SetBooleanProperty(Value,FCursorHideAllOtherChannels,  irtBackGround);end;
procedure TiStripChart.SetInterpolateMissingDataPoints(const Value:Boolean);begin SetBooleanProperty(Value,FInterpolateMissingDataPoints,irtBackGround);end;
procedure TiStripChart.SetEnableDataDrawMinMax        (const Value:Boolean);begin SetBooleanProperty(Value,FEnableDataDrawMinMax,        irtBackGround);end;
procedure TiStripChart.SetXAxisDateTimeEnabled        (const Value:Boolean);begin SetBooleanProperty(Value,FXAxisDateTimeEnabled,        irtBackGround);end;
procedure TiStripChart.SetShowToolBar                 (const Value:Boolean);begin SetBooleanProperty(Value,FShowToolBar,                 irtBackGround);end;
procedure TiStripChart.SetXAxisDateTimeFormatString   (const Value:String );begin SetStringProperty (Value,FXAxisDateTimeFormatString,   irtBackGround);end;
procedure TiStripChart.SetLimitLinesOnTop             (const Value:Boolean);begin SetBooleanProperty(Value,FLimitLinesOnTop,             irtInvalidate);end;
procedure TiStripChart.SetGridLinesOnTop              (const Value:Boolean);begin SetBooleanProperty(Value,FGridLinesOnTop,              irtInvalidate);end;
//****************************************************************************************************************************************************
procedure TiStripChart.SetTitleFont              (const Value: TFont);begin FTitleFont.Assign(Value);              BackGroundChange;end;
procedure TiStripChart.SetXAXisLabelFont         (const Value: TFont);begin FXAxisLabelFont.Assign(Value);         BackGroundChange;end;
procedure TiStripChart.SetYAXisLabelFont         (const Value: TFont);begin FYAxisLabelFont.Assign(Value);         BackGroundChange;end;
procedure TiStripChart.SetLegendFont             (const Value: TFont);begin FLegendFont.Assign(Value);             BackGroundChange;end;
procedure TiStripChart.SetXAxisTitleFont         (const Value: TFont);begin FXAxisTitleFont.Assign(Value);         BackGroundChange;end;
procedure TiStripChart.SetYAxisTitleFont         (const Value: TFont);begin FYAxisTitleFont.Assign(Value);         BackGroundChange;end;
procedure TiStripChart.SetToolBarActiveModeFont  (const Value: TFont);begin FToolBarActiveModeFont.Assign(Value);  BackGroundChange;end;
procedure TiStripChart.SetToolBarInactiveModeFont(const Value: TFont);begin FToolBarInactiveModeFont.Assign(Value);BackGroundChange;end;
//****************************************************************************************************************************************************
procedure TiStripChart.EndUpdate;
begin
  inherited;
  CalcNewStartXIndex;
  CalcNewStopXIndex;
  
  if FNeedsDataUpdate then
    begin
      FNeedsDataUpdate := False;
      DoDataUpdate;
    end;
end;
//****************************************************************************************************************************************************
procedure TiStripChart.SetAutoScrollType(const Value: TiAutoScroll);
begin
  if FAutoScrollType  <> Value then
    begin
      FAutoScrollType := Value;
      BackGroundChange;
    end;
end;
//****************************************************************************************************************************************************
procedure TiStripChart.SetPrecisionStyle(const Value: TiPrecisionStyle);
begin
  if FPrecisionStyle <>Value then
    begin
      FPrecisionStyle := Value;
      BackGroundChange;
    end;
end;
//****************************************************************************************************************************************************
procedure TiStripChart.SetGridLineStyle(const Value: TiChannelLineStyle);
begin
  if FGridLineStyle <> Value then
    begin
      FGridLineStyle :=Value;
      BackGroundChange;
    end;
end;
//****************************************************************************************************************************************************
procedure TiStripChart.SetXAxisMax(const Value: Double);
begin
  if FXAXisMax <> Value then
    begin
      FXAxisMax :=Value;
      CalcNewStopXIndex;
      InvalidateChange;
      if Assigned(FOnXAxisMaxChange) then FOnXAxisMaxChange(Self);
    end;
end;
//****************************************************************************************************************************************************
procedure TiStripChart.SetXAxisMin(const Value: Double);
begin
  if FXAxisMin <> Value then
    begin
      FXAxisMin := Value;
      CalcNewStartXIndex;
      InvalidateChange;
      if Assigned(FOnXAxisMinChange) then FOnXAxisMinChange(Self);
    end;
end;
//************************************************************

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -