Jump to content

Alexander Elagin

Members
  • Content Count

    198
  • Joined

  • Last visited

  • Days Won

    6

Posts posted by Alexander Elagin


  1. 8 hours ago, aehimself said:

    Sending commands only. I don't have any specific projects in mind; I just see the opportunities of a connection between a Delphi app and an Arduino.

    For the time being I'd just be interested in a hello-world type setup. Make an Arduino light an LED when you check a checbox on a Delphi form. I'll make my way from there, when I have anything specific in mind 🙂

    There is nothing difficult. You can use a serial port (if the host PC doesn't have one, a simple USB-to-COM adapter will do) as a simple communication channel - serial data exchange has been used for decades in multiple industrial applications built with Delphi. In fact, this is the area (custom hardware control / monitoring) where Delphi is used in many companies, but of course most of these applications never appear in public.


  2. ExpressQuantumGrid by default (in the Bound mode) fetches all data from the database table and then uses it for the fast local filtering / sorting / etc functions without further database operations (unless an update is required). There is another mode (Server mode) where data is fetched as needed but in this mode local grid filtering is limited.


  3. I always remember the Peter Gottschling's description of a program comment from his book "Discovering modern C++":
     

    Quote

     

    The primary purpose of a comment is evidently to describe in plain language what is not obvious for everybody in the program sources, like this:

    
    // Transmogrification of the anti-binoxe in O(n log n)
    while(cryptographic(trans_thingy) < end_of(whatever)) { ....


     

     

     

    • Like 1
    • Haha 2

  4. I'd probably use a combination of shared memory and global event object. I.e. the sender and receiver both create a shared memory using CreateFileMapping() and MapViewOfFile(), then the sender fills the buffer located in the shared memory and sets the event, the receiver waits for this event and when it is activated grabs the data from the buffer and resets the event. The sender can also check the state of the event and if it is set (i.e. the receiver has not read the data yet) skip writing the next frame, etc. I do not think that the implementation is going to be too difficult.


  5. 11 hours ago, David Schwartz said:

    PAServer needs to be running in order for Delphi to do anything Linux-related?

    Yes, PAServer is needed to pull the necessary tools and libs from the target Linux machine. After this stage it is needed for deployment/debugging (but the Linux debugging in Delphi is a joke, simple WriteLn's in code can do better...)

     

    The best documentation I've seen so far is here: http://docwiki.embarcadero.com/RADStudio/Rio/en/Linux_Application_Development

    and here: https://chapmanworld.com/2016/12/29/configure-delphi-and-redhat-or-ubuntu-for-linux-development/

    • Like 3

  6. Maybe it is the time for someone with decent resources make a backup of the codecentral content (and structure, if possible)? I do not think that the data size is too huge given that it is built on the two decades old technologies. Probably it is just the matter of parsing the database and replicating it on something modern, probaly creating a better frontend.


  7. Just now, Ian Branch said:

    Well.  That cleared the function error, but now it doesn't like F.customer.  Undeclared identifier.

    That's because the form must have a field or property of this type (like Customer: TCustomer), otherwise there is no place to copy the data from. Alternatively, if the form already has all the necessary data, you can manually fill the resulting record:

    ....
    if Result then begin
      Value.name := F.SomeNameField;
      Value.age := F.SomeAgeField;
    end;
    ....

     


  8. type
      TCurrentCustJobsForm = class(TForm)
      ....
      public
        class function Execute(out Value: Integer): Boolean;
      end;
    
    ......
    
    class function TCurrentCustJobsForm.Execute(out Value: Integer): Boolean;
    var
      F: TCurrentCustJobsForm;
    begin
      F := TCurrentCustJobsForm.Create(nil);
      try
        Result := IsPositiveResult(F.ShowModal);
        if Result then Value:= F.SomeFieldOrPropertyOrEtc;
      finally
        F.Free;
      end;
    
    ......
    
    if TCurrentCustJobsForm.Execute(iRecord) then (* Value selected and valid *) else (* user closed the form without selecting anything *)

     

     

×