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

📄 iclasses.pas

📁 iocopm3.04源码,一套很好的工控开发工具
💻 PAS
📖 第 1 页 / 共 4 页
字号:
{*******************************************************}
{                                                       }
{       iClasses                                        }
{                                                       }
{       Copyright (c) 1997,2003 Iocomp Software         }
{                                                       }
{*******************************************************}
{$I iInclude.inc}

{$ifdef iVCL}unit  iClasses;{$endif}
{$ifdef iCLX}unit QiClasses;{$endif}

interface

uses
  {$I iIncludeUses.inc}
  {$IFDEF iVCL} iTypes, iGPFunctions,   iDoubleList, iDataNullList;{$ENDIF}
  {$IFDEF iCLX}QiTypes, QiGPFunctions, QiDoubleList, QiDataNullList;{$ENDIF}

type                                                   
  TiURLShowCommand = (ssHide,
                      ssMaximize,
                      ssMinimize,
                      ssRestore,
                      ssShow,
                      ssShowDefault,
                      ssShowMaximized,
                      ssShowMinimized,
                      ssShowMinNoActivate,
                      ssShowNA,
                      ssShowNoActivate,
                      ssShowNormal);

  TiMemoryStream = class(TMemoryStream)
  public
    procedure WriteString    (Value : String);
    procedure WriteStringCRLF(Value : String);
    procedure WriteCRLF;
    function  ReadChar : Char;
  end;

  TiUserSchemeList            = class(TStringList) end;
  TiIocompSchemeList          = class(TStringList) end;
  TiSchemeListClass           = class of TStringList;

  TiXMLMemoryStream = class(TiMemoryStream)
  private                           
    FCurrentElementStart: String;
  public
    procedure StartElement(Name : String);
    procedure EndElement  (Name : String);
    procedure WriteElement(Name, Value : String);

    function  GetElement      (Name  : String) : String;
    procedure GotoElementStart(Value : String);
    function  GetNameElementStart : String;
    function  GetElementValue     : String;
    function  GetNameElementStop  : String;

    function  GetNextPiece : String;
    function  PeekNextPiece: String;
    property  CurrentElementStart : String read FCurrentElementStart;
  end;

  TiPercentItemObject = class(TObject)
  public
    Title : String;
    Color : TColor;
    Value : Double;
  end;

  TiLimitObject = class(TObject)
  public
    UpperValue        : Double;
    LowerValue        : Double;
    PointerSize       : Integer;
    PointerMargin     : Integer;
    DrawScaleSide     : Boolean;
    UpperPointerColor : TColor;
    LowerPointerColor : TColor;
    ShowUpperPointer  : Boolean;
    ShowLowerPointer  : Boolean;
  end;

  TiStripChartVertLineObject = class(TObject)
  public
    Position : Double;
    Color    : TColor;
    Width    : Integer;
    Style    : TiChannelLineStyle;
  end;


  TiStripChartChannelObject = class(TObject)
  private
    FTrackLimitColors          : Boolean;
    FColor                     : TColor;
    FControlLimitUpperColor    : TColor;
    FControlLimitLowerColor    : TColor;
    FWarningLimitUpperColor    : TColor;
    FWarningLimitLowerColor    : TColor;
    procedure SetColor                 (const Value: TColor);
    procedure SetControlLimitLowerColor(const Value: TColor);
    procedure SetControlLimitUpperColor(const Value: TColor);
    procedure SetWarningLimitLowerColor(const Value: TColor);
    procedure SetWarningLimitUpperColor(const Value: TColor);
  public
    Title                      : String;
    LineStyle                  : TiChannelLineStyle;
    LineWidth                  : Integer;
    HighestIndex               : Integer;
    Visible                    : Boolean;
    VisibleInLegend            : Boolean;
    ControlLimitUpperValue     : Double;
    ControlLimitLowerValue     : Double;
    WarningLimitUpperValue     : Double;
    WarningLimitLowerValue     : Double;
    ControlLimitUpperShow      : Boolean;
    ControlLimitLowerShow      : Boolean;
    WarningLimitUpperShow      : Boolean;
    WarningLimitLowerShow      : Boolean;
    ControlLimitUpperLineStyle : TiChannelLineStyle;
    ControlLimitLowerLineStyle : TiChannelLineStyle;
    WarningLimitUpperLineStyle : TiChannelLineStyle;
    WarningLimitLowerLineStyle : TiChannelLineStyle;
    ControlLimitUpperLineWidth : Integer;
    ControlLimitLowerLineWidth : Integer;
    WarningLimitUpperLineWidth : Integer;
    WarningLimitLowerLineWidth : Integer;
    UseFixedAxis               : Boolean;

    constructor Create; virtual;
    procedure   DataClear;                                                                                virtual; abstract;
    procedure   SetBufferSize    (Value: Integer);                                                        virtual; abstract;
    procedure   SetRingBufferSize(Value: Integer);                                                        virtual; abstract;
    procedure   DataDeleteRange  (Value: Integer);                                                        virtual; abstract;
    procedure   DataAdd          (Value: Double);                                                         virtual; abstract;
    function    GetDataItem      (Index: Integer; var IsNull : Boolean): Double;                          virtual; abstract;
    function    GetDataStatus    (Index: Integer): TiChannelDataSatus;                                    virtual; abstract;
    procedure   SetDataItem      (Index: Integer; const Value: Double; const Status: TiChannelDataSatus); virtual; abstract;
    property    Color                  : TColor read FColor                  write SetColor;
    property    ControlLimitUpperColor : TColor read FControlLimitUpperColor write SetControlLimitUpperColor;
    property    ControlLimitLowerColor : TColor read FControlLimitLowerColor write SetControlLimitLowerColor;
    property    WarningLimitUpperColor : TColor read FWarningLimitUpperColor write SetWarningLimitUpperColor;
    property    WarningLimitLowerColor : TColor read FWarningLimitLowerColor write SetWarningLimitLowerColor;
  end;

  TiStripChartContinuousDataChannelObject = class(TiStripChartChannelObject)
  private
    FDataList : TiDataNullList;
  public
    constructor Create;                                                                                   override;
    destructor  Destroy;                                                                                  override;
    procedure   DataClear;                                                                                override;
    procedure   SetBufferSize    (Value: Integer);                                                        override;
    procedure   SetRingBufferSize(Value: Integer);                                                        override;
    function    GetDataStatus    (Index: Integer): TiChannelDataSatus;                                    override;
    procedure   DataDeleteRange  (Value: Integer);                                                        override;
    procedure   DataAdd          (Value: Double );                                                        override;
    function    GetDataItem      (Index: Integer; var IsNull : Boolean): Double;                          override;
    procedure   SetDataItem      (Index: Integer; const Value: Double; const Status: TiChannelDataSatus); override;
  end;

  TiStripChartDiscontinuousDataChannelObject = class(TiStripChartChannelObject)
  private
    FDataList : TiDataNullList;
  public
    constructor Create;                                                                                   override;
    destructor  Destroy;                                                                                  override;
    procedure   DataClear;                                                                                override;
    procedure   SetBufferSize    (Value: Integer);                                                        override;
    procedure   SetRingBufferSize(Value: Integer);                                                        override;
    function    GetDataStatus    (Index: Integer): TiChannelDataSatus;                                    override;
    procedure   DataDeleteRange  (Value: Integer);                                                        override;
    procedure   DataAdd          (Value: Double );                                                        override;
    function    GetDataItem      (Index: Integer; var IsNull : Boolean): Double;                          override;
    procedure   SetDataItem      (Index: Integer; const Value: Double; const Status: TiChannelDataSatus); override;
  end;

  TiLabelChannelObject = class(TObject)
  public
    YPosition  : Double;
    Font       : TFont;
    LabelList  : TStringList;
    Visible    : Boolean;
    constructor Create;
    destructor  Destroy; override;
  end;

  TiDrawObject = class(TObject)
  private
    FCount         : Integer;
    FPointArray    : PointDoubleDynamicArray;
    function  GetPolyPoint(Index: Integer): TPointDouble;
    procedure SetPolyPoint(Index: Integer; const Value: TPointDouble);
    function GetPolyPointCount: Integer;
  public
    AType           : TiDrawObjectType;
    Visible         : Boolean;
    X               : Double;
    Y               : Double;
    Width           : Double;
    Height          : Double;
    StartAngle      : Double;
    StopAngle       : Double;

    ImageIndex      : Integer;

    FontCaption     : String;
    FontName        : String;
    FontSize        : Integer;
    FontColor       : TColor;
    FontBold        : Boolean;
    FontItalic      : Boolean;
    FontUnderLine   : Boolean;
    FontStrikeOut   : Boolean;

    BrushColor      : TColor;
    BrushStyle      : TBrushStyle;

    PenColor        : TColor;
    PenStyle        : TPenStyle;
    PenWidth        : Integer;
    DrawRect        : TRect;


    procedure   AddPolyPoint(Point: TPointDouble);
    procedure   ClearPolyPoints;

    property    PolyPoint[Index: Integer] : TPointDouble read GetPolyPoint write SetPolyPoint;
    property    PolyPointCount : Integer read GetPolyPointCount;

    destructor  Destroy; override;
  end;

  TiMinMaxPoint = class(TPersistent)
  public
    Empty             : Boolean;
    IsNull            : Boolean;
    PixelsX           : Integer;
    YMax              : Double;
    YMin              : Double;
    YFirst            : Double;
    YLast             : Double;
    procedure AssignDown(Source: TPersistent);
    procedure Clear;
    procedure AddData(Value: Double; Null: Boolean; X: Integer);
    constructor Create;
  end;

  TDigitalSequenceData = class(TObject)
  public
    StartSet         : Boolean;
    StartXValue      : Double;
    StartYValue      : Boolean;
    StopSet          : Boolean;
    StopXValue       : Double;
    TransitionSet    : Boolean;
    TransitionXValue : Double;

    procedure Clear;
  end;


  TiPlotMinMaxPoint = class(TPersistent)
  private
  public
    Empty             : Boolean;
    XPixels           : Integer;
    XValue            : Double;
    YMax              : Double;
    YMin              : Double;
    YFirst            : Double;
    YLast             : Double;

    constructor Create;
    procedure Clear;
    procedure AddData(const NewXValue, NewYValue: Double; const NewXPixels: Integer);
    procedure AssignDown(const Source: TiPlotMinMaxPoint);
  end;

  TiButton = class(TPersistent)
  private
    FTop               : Integer;
    FBottom            : Integer;
    FRight             : Integer;
    FLeft              : Integer;
    FVisible           : Boolean;
    FMouseDown         : Boolean;
    FOnClick           : TNotifyEvent;
    FOnInvalidate      : TNotifyEvent;
    FEnabled           : Boolean;
    FGroupIndex        : Integer;
    FCaption           : String;
    FFont              : TFont;
    procedure SetEnabled(const Value: Boolean);
    procedure SetVisible(const Value: Boolean);
  protected
    function  GetDrawRect: TRect;
    function  GetHeight  : Integer;
    function  GetWidth   : Integer;

    procedure SetDrawRect(const Value: TRect);
    procedure SetCaption (const Value: String);
    procedure SetFont    (const Value: TFont);

    procedure FontChange(Sender : TObject);

    procedure Invalidate;
    procedure DoChange;
    procedure SetMouseDown(const Value: Boolean);
  public
    constructor Create; virtual;
    destructor  Destroy; override;

⌨️ 快捷键说明

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