1 3 123
1 10 27

: object Pascal (Delphi)

  1. #1

    Mar 2012
    Athens, , Greece.
    :
    99

    object Pascal (Delphi)



    object pascal (Delphi). .

    .
    1. & (Class vs Object). .
    2. Object encapsulation, , .
    3. , .
    4. TCP/IP sockets
    5. - (Threads) .
    6. TCP/IP Server
    7. Modbus TCP/IP
    8. . .

    ?

  2. #2

    Oct 2010
    Athens, , Greece.
    :
    1,632
    Delphi .

    , ..

    modbus?



    Burn baby, burn

  3. #3

    Oct 2005
    Nikea, , Greece.
    :
    2,979
    .

    1995 ....



    I believe we should all pay our tax with a smile. I tried - but they wanted cash...

  4. #4

    Mar 2012
    Athens, , Greece.
    :
    99
    .

    TCP/IP servers . OO Win32 Delphi.

    , C Fortran objects. . , , ( ) .
    , .


  5. #5

    Mar 2012
    Athens, , Greece.
    :
    99
    1. &
    A . M$oft, 90, C++ compiler C++ COM, Sun Java open source Borland VB killer, Delphi.

    (class) / . (), . (), .



    Abstraction :
    Encapsulation: .
    (Inheritance) : .
    (Polymorphism): .

    (constructor) . (class).

    .

    Delphi objects pointer. compiler ^ objects.

    (destructor) ..

    Stream. http://delphi.about.com/od/vclusing/l/aa110803a.htm
    TStream . TMemoryStream TFileStream, , .

    http://www.swissdelphicenter.ch/torr...ode.php?id=822 procedure CompressStream(inpStream, outStream: TStream);
    stream , stream.

    TFileStream (x 1) (x2) (x 3) .

    var fs1, fs2: TFileStream;
    begin
    fs1 := nil;
    fs2 := nil;
    try
    fs1:=TFileStream.Create('c:\fs1.dat',fmOpenRead or fmShareExclusive);
    fs2:=TFileStream.Create('c:\fs2.dat',fmOpenWrite or fmCreate);
    CompressStream(fs1, fs2);
    finally
    fs2.Free;
    fs1.Free;
    end;
    end;

    http://pages.cs.wisc.edu/~rkennedy/vmt Compress TStream TMemoryStream & TFileSTream.

    TFilestream ?
    http://www.koders.com/delphi/fidD3C8...B9D.aspx?s=zip .

    objects, (attributes/properties).
    . , objects. .
    attributes () object.

    16 1998 Rolling Stones .
    PCL ( user name) .
    project 2 , .

    barcode, 100 . . call center , , , , , ( barcode) .

    .
    1. Venue (, ) /. , ( ) .
    2. (Show), , /.
    3. block , - .
    4.
    5. , , .
    6. , , , , .
    7. .

    object ? ( ?)

    ( , , ) ( ).

    PDC (Problem Domain Components).

    . http://www.tanea.gr/oikonomia/article/?aid=4034166
    Larry Elison Oracle Angie.


    . .



    TSex = (sxMale,sxFemale);

    TMammal = class
    private
    fAge : double;
    fWeight:double;
    fHeight:double;
    fSex:TSex;
    public
    constructor Birth;
    destructor Die;
    procedure Sleep;
    procedure Work;
    procedure Eat;
    property Age : double read fAge write fAge;
    property Weight:double read fWeight write fWeight;
    property Height:double read fHeight write fHeight;
    property Sex:TSex read fSex write fSex;
    end;

    THuman = class(TMammal)
    public
    procedure Vote;
    end;

    . . .
    .


    - . font . .

    . .

    HIC (Human Interaction Components). HMI / plc.

    VenueForm .
    , , PDC .

    database ?
    Oracle text files. , 1998, . M$oft sqlserver db . select * from table . performance writers readers.

    . . , ( ) (surrogate key). ( 32 bit integer). Guids. .
    (Foreign Keys). . (constraints) .

    DMC (Data Management Component) PDC SQL database.

    H DMC database, 1.. sql database client (Oracle OCI M$oft dblib) TCP/IP database server.
    transactions.
    transactions . , transactions transaction.

    deadlocks. transaction PK A transaction B transaction .

    deadlock Oracle. & .
    .

    Client Server 3 Tier
    HIC, PDC & DMC PC. 100 Mbits . 1 100 101 insert into table column list values list begin transaction & commit transaction.

    database . HIC & PDC DMC database .

    , ( xml) PDC .
    , xml to sql maper http://stackoverflow.com/questions/1...to-sql-mapping / .

    . ?

    Application Server
    application server, Web Server http (internet) xml .

    open source Apache Web Server (, Delphi).

    Ti application Server, o Web Server database server. , TCP/IP , (thread) .

    Delphi application server custom , thread () PDC object sql . Apache http , xml php . database server, database client, sql .

    The Delphi Way
    Delphi Pascal . . data aware components , , .
    Tragic.
    . . , , , / . .

    project. , objects global . objects. ( ), , bugs.

  6. #6

    Jun 2008
    Glyfada, , Greece.
    :
    3,101
    pda :
    18 portable , ...
    pfys 1000 OOP, ...

    1993 ...
    OOP &

    :
    : Polymorphism...
    Polymorphism is Greek "for many shapes" and it is just that: a way of giving an action...

    ;
    . .. . ' .
    Delphi objects .. TGata .. KaloGataki TKaloGataki .. : kgGourgourizon, kgKakistro, kgGriniazon, kgKleftizon
    object , encapsulates .. , . .
    TSiamGata TGata KaloGataki. . :
    Oura TOura : gStraviOura, gHorisOura, gNormalOura

    objects records Pascal. 3 records TSunData, THliakosStruc, TBoilerStruc. THliakosStruc boiler TBoilerStruc

    .... ' , , , !






  7. #7

    Mar 2012
    Athens, , Greece.
    :
    99

    . . . ?

    ?. . . . , , .

    . PDC Customer .


    TCustomer = class
    private
    FCUSTID:Integer;
    FFNAME:String;
    FLNAME: String;
    FLASTPICKUP: String;
    FAFM: String;
    FADDRSTR: String;
    FADDRNUM: String;
    FADDRZIP: String;
    FADDRCITY: String;
    FTEL1: String;
    FTEL2: String;
    FCOMPANY: String;
    FPROFESSION: String;
    FDOY: String;
    Protected
    // d
    procedure SetCustId(value:integer);
    // .
    procedure SetFM(const value:string);

    public
    Property CUSTID:Integer read FCustId write SetCustId;
    Property FNAME:String read FFName write FFname;
    Property LNAME:String read FLName write FLname;
    Property AFM:String read FAFM write SetAFM;
    ...
    End;

    DMC
    TDMCustomer =class(Customer)
    Public
    // .
    Constructor Create(ID:integer);
    Procedure Save;
    Procedure Update;
    End;



    https://picasaweb.google.com/1078235...03951973481138

    TCustForm Cust . TCust TDMCust .

    Delphi. data aware components

    1. , .
    2.
    3. .

    .



    objects. . /.

    .

    TSunEnergy = class
    Public
    Function EnergyFlowouble; // ..
    Property Month
    Property Day
    End;

    ,

    TSolarPanel = class
    public
    property Slope :double; //
    property SouthDeviation:double; //
    property Surface:double; //
    property Flow:double; // Lt/h
    property GlycolePerc : double;
    end;

    boiler ,

    Boiler = class
    public
    property Volume:double;
    property AverageDaylyConsuption:double;
    property WaterTemperature:double;
    property SolarHeatExchangeSurface :double; // m2
    end;

    H TCalculator
    ,

    aDate,
    FromTime ToTime step
    aSolarPanel
    boiler aBoiler.


    TCalculator = class
    procedure Calc(aDate:TDate; //
    FromTime, ToTime:TTime; step: integer;
    aSolarPanel:TSolarPanel;
    aBoiler:TBoiler);
    property CalcCount:integer;
    property Time[index:integer]:TTime; //
    property SunHeight[index:integer]:degrees;
    property SunAzimou8io [index:integer]:degrees;
    property BoilerTemp [index:integer]:double;
    property CollectorTempIn [index:integer]:double;
    property CollectorTempOut [index:integer]:double;
    ...
    end;




    For i:=0 to Calculator.CalcCount do
    begin
    Grid[0,i]:= FormatTime(Calculator.Time[i]);
    Grid[1,i]:= FormatDegrees(Calculator.SunHeight [i]);
    Grid[2,i]:= FormatDegrees(Calculator.SunAzimou8io [i]);
    Grid[3,i]:= Format('%.1f',[Calculator.BoilerTemp [i]]);
    Grid[4,i]:= Format('%.1f',[Calculator.CollectorTempIn[i]]);
    Grid[5,i]:= Format('%.1f',[Calculator.CollectorTempOut[i]]);
    ...
    End;

    unit. Calculator.


    , , . / .

    .
    1. . . objects

    2. , THuman . (, , ). [:0]


  8. #8

    Mar 2012
    Athens, , Greece.
    :
    99
    quote:
    18 portable , ...
    , ? [:I]

  9. #9

    Jun 2008
    Glyfada, , Greece.
    :
    3,101
    quote: , ?
    pda ...
    1. , ! ( ) 25 PC. ! 60 ! objects Pascal .
    . ! . ޻
    2. . . 60 . ,

    :
    quote: objects
    . . ! Fortran . .
    objects . C++ SysUtils



  10. #10

    Mar 2012
    Athens, , Greece.
    :
    99


    , Aurdino .
    quote:
    .
    . , . heat tanks think tank.

    " , .
    . , 208

    quote:
    Fortran
    http://www.computer.org/csdl/mags/co...012070008.html

    quote:
    .
    . . fortran, C turbo pascal (instantiate) .

    , , , . (bottom-up).

    , , . (top-down)

    quote:
    objects records Pascal. 3 records TSunData, THliakosStruc, TBoilerStruc. THliakosStruc boiler TBoilerStruc
    , records. , object , . (encapsulates) .

    , , , .

    To http://www.monachos.gr/forum/topic.asp?TOPIC_ID=3832 . (stom )

    .


    :
    TSunEnergy = class
    
    Public
    
    //     GeoPlatos,     W/m2
        function Energy:Double; overload; 
    //      W/m2
        function Energy(aTime:integer):Double; overload; 
    
        property Time:integer; // seconds since midnight
        property Month:integer;
        property Day:integer;
        property GeoPlatos:double;
        property SunPerc:double;//  
    End;
    panel. .

    uSunEnergy.pas


    , .

    :
    TSolarPanel = class
    public
    
        function Energy(EnergyIn):double; //      kWh
        function Flow:double;    //  Lt/h
    
        property SolarAbsorbtion:double; //    
        property Slope :double; // 
        property SouthDeviation:double; //    
        property Surface:double; //   
    
        property Efficiency:double; //  
    
        property GlycolePerc : double;
        property WaterInTemperature:double;  // .   
        property WaterOutTemperature:double; // .   
    
    end;
    H TSolarPanle.Energy . TSunEnergy panel.


    uSolarPanel.pas

    boiler ,

    :
    THeatSource = (hsSolarPanel, hsBurner, hsElectricity)
    
    Boiler = class
    
    public
    
    //           boiler
    
        function Heat(inEnergy:double; from:THeatSource):double; //   Kw
    
        function AccumulatedEnergy:double; //      Kwh
    
        function SolarFraction:double; //     /   
    
        property WaterVolume:double;
        property AverageDayConsuption:double; // lt 
        property WaterInTemperature:double;    //    .
        property WaterOutTemperature:double;  //    .
    
        property SolarHeatExchangeSurface :double;   // m2
        property BurnerHeatExchangeSurface :double; // m2
    
    end;
    To boiler .

    uBoiler.pas


    objects . TSunEnergy.Energy(aTime) 15 min.

    H TCalculator (TSunEnergy, TSolarPanel, Boiler) (uses) uSunEnergy.pas, uSolarPanel.pas, uBoiler.pas

    ,

    aDate,
    FromTime ToTime step
    aSolarPanel
    boiler aBoiler.

    :
    TCalculator = class
    
        procedure Calc(aDate:TDate; //   
                       FromTime, ToTime:TTime; step: integer;
                       aSolarPanel:TSolarPanel;
                       aBoiler:TBoiler);
        property CalcCount:integer;
        property Time[index:integer]:TTime; //
        property SunHeight[index:integer]:degrees;
        property SunAzimou8io [index:integer]:degrees;
        property BoilerTemp [index:integer]:double;
        property CollectorTempIn [index:integer]:double;
        property CollectorTempOut [index:integer]:double;
    ...
    end;
    post threads, CPU.


  • You may not post new threads
  • You may not post attachments
  •