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

📄 istripchart.pas

📁 iocopm3.04源码,一套很好的工控开发工具
💻 PAS
📖 第 1 页 / 共 5 页
字号:
    property AxisGridColor                 : TColor                 read FAxisGridColor                write SetAxisGridColor                default clGreen;
    property TitleText                     : String                 read FTitleText                    write SetTitleText;
    property TitleMargin                   : Integer                read FTitleMargin                  write SetTitleMargin                  default 0;
    property TitleFont                     : TFont                  read FTitleFont                    write SetTitleFont;

    property XAxisShow                     : Boolean                read FXAxisShow                    write SetXAxisShow                    default True;
    property XAxisMin                      : Double                 read FXAxisMin                     write SetXAxisMin;
    property XAxisMax                      : Double                 read FXAxisMax                     write SetXAxisMax;
    property XAxisDateTimeEnabled          : Boolean                read FXAxisDateTimeEnabled         write SetXAxisDateTimeEnabled         default False;
    property XAxisDateTimeFormatString     : String                 read FXAxisDateTimeFormatString    write SetXAxisDateTimeFormatString;
    property XAxisMargin                   : Integer                read FXAxisMargin                  write SetXAxisMargin                  default 5;
    property XAxisLabelMargin              : Integer                read FXAxisLabelMargin             write SetXAxisLabelMargin             default 5;
    property XAxisLabelFont                : TFont                  read FXAxisLabelFont               write SetXAxisLabelFont;
    property XAxisLabelPrecision           : Integer                read FXAxisLabelPrecision          write SetXAxisLabelPrecision          default 2;
    property XAxisTitle                    : String                 read FXAxisTitle                   write SetXAxisTitle;
    property XAxisTitleMargin              : Integer                read FXAxisTitleMargin             write SetXAxisTitleMargin             default 0;
    property XAxisTitleFont                : TFont                  read FXAxisTitleFont               write SetXAxisTitleFont;
    property XAxisTickMajorCount           : Integer                read FXAxisTickMajorCount          write SetXAxisTickMajorCount          default 11;
    property XAxisTickMajorLength          : Integer                read FXAxisTickMajorLength         write SetXAxisTickMajorLength         default 7;
    property XAxisTickMajorColor           : TColor                 read FXAxisTickMajorColor          write SetXAxisTickMajorColor          default clWhite;
    property XAxisTickMinorCount           : Integer                read FXAxisTickMinorCount          write SetXAxisTickMinorCount          default 4;
    property XAxisTickMinorLength          : Integer                read FXAxisTickMinorLength         write SetXAxisTickMinorLength         default 3;
    property XAxisTickMinorColor           : TColor                 read FXAxisTickMinorColor          write SetXAxisTickMinorColor          default clWhite;

    property YAxisShow                     : Boolean                read FYAxisShow                    write SetYAxisShow                    default True;
    property YAxisMin                      : Double                 read FYAxisMin                     write SetYAxisMin;
    property YAxisMax                      : Double                 read FYAxisMax                     write SetYAxisMax;
    property YAxisMargin                   : Integer                read FYAxisMargin                  write SetYAxisMargin                  default 5;
    property YAxisLabelMargin              : Integer                read FYAxisLabelMargin             write SetYAxisLabelMargin             default 5;
    property YAxisLabelFont                : TFont                  read FYAxisLabelFont               write SetYAxisLabelFont;
    property YAxisLabelPrecision           : Integer                read FYAxisLabelPrecision          write SetYAxisLabelPrecision          default 3;
    property YAxisTitle                    : String                 read FYAxisTitle                   write SetYAxisTitle;
    property YAxisTitleMargin              : Integer                read FYAxisTitleMargin             write SetYAxisTitleMargin             default 0;
    property YAxisTitleFont                : TFont                  read FYAxisTitleFont               write SetYAxisTitleFont;
    property YAxisTickMajorCount           : Integer                read FYAxisTickMajorCount          write SetYAxisTickMajorCount          default 6;
    property YAxisTickMajorLength          : Integer                read FYAxisTickMajorLength         write SetYAxisTickMajorLength         default 7;
    property YAxisTickMajorColor           : TColor                 read FYAxisTickMajorColor          write SetYAxisTickMajorColor          default clWhite;
    property YAxisTickMinorCount           : Integer                read FYAxisTickMinorCount          write SetYAxisTickMinorCount          default 4;
    property YAxisTickMinorLength          : Integer                read FYAxisTickMinorLength         write SetYAxisTickMinorLength         default 3;
    property YAxisTickMinorColor           : TColor                 read FYAxisTickMinorColor          write SetYAxisTickMinorColor          default clWhite;
    property YAxisLabelWidth               : Integer                read FYAxisLabelWidth              write SetYAxisLabelWidth              default 20;
    property YAxisLabelWidthFixed          : Boolean                read FYAxisLabelWidthFixed         write SetYAxisLabelWidthFixed         default False;
    property YAxisReverseScale             : Boolean                read FYAxisReverseScale            write SetYAxisReverseScale            default False;

    property GridLineStyle                 : TiChannelLineStyle     read FGridLineStyle                write SetGridLineStyle                default iclsSolid;
    property GridBackGroundColor           : TColor                 read FGridBackGroundColor          write SetGridBackGroundColor          default clBlack;

    property OuterMarginLeft               : Integer                read FOuterMarginLeft              write SetOuterMarginLeft              default 10;
    property OuterMarginTop                : Integer                read FOuterMarginTop               write SetOuterMarginTop               default 10;
    property OuterMarginRight              : Integer                read FOuterMarginRight             write SetOuterMarginRight             default 10;
    property OuterMarginBottom             : Integer                read FOuterMarginBottom            write SetOuterMarginBottom            default 10;

    property LegendWidth                   : Integer                read FLegendWidth                  write SetLegendWidth                  default 80;
    property LegendMargin                  : Integer                read FLegendMargin                 write SetLegendMargin                 default 10;
    property LegendFont                    : TFont                  read FLegendFont                   write SetLegendFont;

    property ShowGrid                      : Boolean                read FShowGrid                     write SetShowGrid                     default True;
    property ShowLegend                    : Boolean                read FShowLegend                   write SetShowLegend                   default True;
    property ShowToolBar                   : Boolean                read FShowToolBar                  write SetShowToolBar                  default True;

    property AutoScrollEnabled             : Boolean                read FAutoScrollEnabled            write SetAutoScrollEnabled            default True;
    property AutoScrollType                : TiAutoScroll           read FAutoScrollType               write SetAutoScrollType               default iasSmooth;
    property AutoScrollStepSize            : Double                 read FAutoScrollStepSize           write SetAutoScrollStepSize;
    property AutoScrollFirstStyle          : TiAutoScrollFirstStyle read FAutoScrollFirstStyle         write FAutoScrollFirstStyle           default iasfsAuto;

    property AutoScaleEnabled              : Boolean                read FAutoScaleEnabled             write SetAutoScaleEnabled             default True;
    property AutoScaleHysterisis           : Double                 read FAutoScaleHysterisis          write SetAutoScaleHysterisis;
    property AutoScaleMinAdjustEnabled     : Boolean                read FAutoScaleMinAdjustEnabled    write SetAutoScaleMinAdjustEnabled    default True;
    property AutoScaleMaxAdjustEnabled     : Boolean                read FAutoScaleMaxAdjustEnabled    write SetAutoScaleMaxAdjustEnabled    default True;

    property ToolBarActiveModeFont         : TFont                  read FToolBarActiveModeFont        write SetToolBarActiveModeFont;
    property ToolBarInactiveModeFont       : TFont                  read FToolBarInactiveModeFont      write SetToolBarInactiveModeFont;
    property ToolBarMode                   : TiStripChartMode       read FToolBarMode                  write SetToolBarMode                  default iscmPlot;

    property CursorChannel                 : Integer                read FCursorChannel                write SetCursorChannel                default 0;
    property CursorColor                   : TColor                 read FCursorColor                  write SetCursorColor                  default clYellow;
    property CursorChannelBackGroundColor  : TColor                 read FCursorChannelBackGroundColor write SetCursorChannelBackGroundColor default clYellow;
    property CursorChannelFontColor        : TColor                 read FCursorChannelFontColor       write SetCursorChannelFontColor       default clBlack;
    property CursorHideAllOtherChannels    : Boolean                read FCursorHideAllOtherChannels   write SetCursorHideAllOtherChannels   default False;

    property OnModeChange                  : TNotifyEvent           read FOnModeChange                 write FOnModeChange;
    property OnDataUpdate                  : TNotifyEvent           read FOnDataUpdate                 write FOnDataUpdate;
    property OnCursorChange                : TNotifyEvent           read FOnCursorChange               write FOnCursorChange;
    property OnCursorIndexChange           : TNotifyEvent           read FOnCursorIndexChange          write FOnCursorIndexChange;
    property OnXAxisMaxChange              : TNotifyEvent           read FOnXAxisMaxChange             write FOnXAxisMaxChange;
    property OnXAxisMinChange              : TNotifyEvent           read FOnXAxisMinChange             write FOnXAxisMinChange;
    property OnYAxisMaxChange              : TNotifyEvent           read FOnYAxisMaxChange             write FOnYAxisMaxChange;
    property OnYAxisMinChange              : TNotifyEvent           read FOnYAxisMinChange             write FOnYAxisMinChange;

    //Kylix TODO
    {$ifndef iCLX}
    property PrinterOrientation            : TPrinterOrientation    read FPrinterOrientation           write FPrinterOrientation             default poPortrait;
    {$endif}
    property PrinterMarginLeft             : Double                 read FPrinterMarginLeft            write FPrinterMarginLeft;
    property PrinterMarginTop              : Double                 read FPrinterMarginTop             write FPrinterMarginTop;
    property PrinterMarginRight            : Double                 read FPrinterMarginRight           write FPrinterMarginRight;
    property PrinterMarginBottom           : Double                 read FPrinterMarginBottom          write FPrinterMarginBottom;
    property PrinterShowDialog             : Boolean                read FPrinterShowDialog            write FPrinterShowDialog              default True;

    property MaxBufferSize                 : Integer                read FMaxBufferSize                write SetMaxBufferSize                default 0;
    property MinBufferSize                 : Integer                read FMinBufferSize                write SetMinBufferSize                default 0;

    property RestoreXYAxisOnPlotMode       : Boolean                read FRestoreXYAxisOnPlotMode      write FRestoreXYAxisOnPlotMode        default True;
    property EnableDataDrawMinMax          : Boolean                read FEnableDataDrawMinMax         write SetEnableDataDrawMinMax         default True;
    property DiscontinuousDataEnabled      : Boolean                read FDiscontinuousDataEnabled     write SetDiscontinuousDataEnabled     default False;
    property PrecisionStyle                : TiPrecisionStyle       read FPrecisionStyle               write SetPrecisionStyle               default ipsSignificantDigits;
    property InterpolateMissingDataPoints  : Boolean                read FInterpolateMissingDataPoints write SetInterpolateMissingDataPoints default True;

    property PrinterCommentLinesFont       : TFont                  read FPrinterCommentLinesFont      write SetPrinterCommentLinesFont;
    property PrinterCommentLineSpacing     : Double                 read FPrinterCommentLineSpacing    write FPrinterCommentLineSpacing;

    property AddYChannel1Now               : Double                 read GetAddYChannel1Now            write SetAddYChannel1Now              stored False;

    property BorderStyle      default ibsLowered;
    property BackGroundColor  default clBlack;
    property Align;
    property Width            default 500;
    property Height           default 250;
  end;

implementation
//****************************************************************************************************************************************************
constructor TiStripChart.Create(AOwner: TComponent);
begin
  inherited Create(AOwner);

  Width            := 500;
  Height           := 250;
  BackGroundColor  := clBlack;
  BorderStyle      := ibsLowered;

  FXAxisShow                    := True;
  FXAxisMin                     := 0;
  FXAxisMax                     := 10;
  FXAxisMargin                  := 5;
  FXAxisDateTimeFormatString    := 'hh:nn:ssam/pm';
  FXAxisLabelMargin             := 5;
  FXAxisLabelPrecision          := 1;
  FXAxisTickMajorCount          := 11;
  FXAxisTickMajorLength         := 7;
  FXAxisTickMajorColor          := clWhite;
  FXAxisTickMinorCount          := 4;
  FXAxisTickMinorLength         := 3;
  FXAxisTickMinorColor          := clWhite;

  FYAxisShow                    := True;
  FYAxisMin                     := 0;
  FYAxisMax                     := 100;
  FYAxisMargin                  := 5;
  FYAxisLabelMargin             := 5;
  FYAxisLabelPrecision          := 1;
  FYAxisTickMajorCount          := 6;
  FYAxisTickMajorLength         := 7;
  FYAxisTickMajorColor          := clWhite;
  FYAxisTickMinorCount          := 4;
  FYAxisTickMinorLength         := 3;
  FYAxisTickMinorColor          := clWhite;
  FYAxisLabelWidth              := 20;

  FOuterMarginLeft              := 10;
  FOuterMarginTop               := 10;
  FOuterMarginRight             := 10;
  FOuterMarginBottom            := 10;

  FShowGrid                     := True;
  FShowLegend                   := True;
  FShowToolBar                  := False;

  FAutoScrollEnabled            := True;
  FAutoScaleEnabled             := True;

  FAutoScaleMinAdjustEnabled    := True;
  FAutoScaleMaxAdjustEnabled    := True;

  FLegendWidth                  := 80;
  FLegendMargin                 := 10;

  FCursorColor                  := clYellow;
  FCursorChannelBackGroundColor := clYellow;

  FAxisGridColor                := clGreen;

  FPlotStartIndex               := -1;
  FPlotStopIndex                := -1;
  FCursorChannel                := -1;
  FFirstDataPoint               := True;

  FPrinterMarginLeft            := 0.5;
  FPrinterMarginTop             := 0.5;
  FPrinterMarginRight           := 0.5;
  FPrinterMarginBottom          := 0.5;

  FRestoreXYAxisOnPlotMode      := True;
  FInterpolateMissingDataPoints := True;
  FPrinterShowDialog            := True;

  FTitleFont      := TFont.Create; FTitleFont.OnChange      := BackGroundChangeEvent; FTitleFont.Color      := clWhite;
  FLegendFont     := TFont.Create; FLegendFont.OnChange     := BackGroundChangeEvent; FLegendFont.Color     := clWhite;

⌨️ 快捷键说明

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