#1 mORMot 2 » Mortmot2Test error in procedure TTestCoreBase.DmiSmbios » 2023-01-25 15:30:26

camu72
Replies: 1

Hi ab,

Im running Mormot 2.0.4773 in a Windows 10 home 64 bits, Lazarus 2.2.0 and Freepascal 3.2.0.
my Notebook: HP Pavilion Notebook - 4xAMD A10-8700P Radeon R6

when run the test, there is a fail (not error) in procedure DMISmbios of test.core.base.bas in the line

...
 CheckAgainst(Smbios, _smbios); // << ( aprox. line 5588 in sourcecode of test.core.base )
 ...

and invoque this internal procedure of the same prcedure DMISmbios in the marked line whit (**)

procedure CheckAgainst(const full: TSmbiosInfo; const os: TSmbiosBasicInfos);
  begin
    CheckEqual(full.Bios.VendorName, os[sbiBiosVendor]);
    CheckEqual(full.Bios.Version, os[sbiBiosVersion]);
    CheckEqual(full.Bios.Release, os[sbiBiosRelease]);
    CheckEqual(full.Bios.Firmware, os[sbiBiosFirmware]);
    CheckEqual(full.Bios.BuildDate, os[sbiBiosDate]);
    CheckEqual(full.System.ProductName, os[sbiProductName]); // (** here is the fail )
    CheckEqual(full.System.Version, os[sbiVersion]);
    CheckEqual(full.System.Uuid, os[sbiUuid]);
    if full.Processor <> nil then
      CheckEqual(full.Processor[0].Manufacturer, os[sbiCpuManufacturer]);
    if full.Battery <> nil then
      CheckEqual(full.Battery[0].Manufacturer, os[sbiBatteryManufacturer]);
    if full.Oem <> nil then
      CheckEqual(full.Oem[0], os[sbiOem]);
  end;

in my notebook, according to debug, the values are:
full.System.ProductName: 'HP Notebook Pavilion'
os[sbiProductName        : 'HP Notevook Pavilion ' << with a final balnk.
which causes the check to fail, and we get a red message on the console.

#3 mORMot 1 » Wich version of Firebird work better whit SynDBZeos » 2022-10-17 11:54:37

camu72
Replies: 2

good morning Firebird and mormot users. I am about to start a new project (refactored from a Firebird 1.5 Database), and I would like to know, based on your experience, which version of firebird would be correct to use, depending on how ZEOS works. I know that Firebird 2.5, 3.0 and 4.0 already exist... but which one should I use?

#5 mORMot 1 » How can I get HTTP data from an webpage? » 2021-06-04 13:52:15

camu72
Replies: 2

I need to get the data returned by https://www.dolarsi.com/api/api.php?typ … rincipales in a rawUTF8 variable or variant. Thanks in advance!

#6 Re: mORMot 1 » New proyect for Lazarus and Synopse mORMot framework » 2020-08-17 12:17:55

thanks ab!, a blog entry would be very interesting and would give the project a big boost. Let me make some improvements and then we coordinate it.

#7 mORMot 1 » New proyect for Lazarus and Synopse mORMot framework » 2020-08-16 01:53:39

camu72
Replies: 2

Hi, I invite those interested to see the new project for Lazarus and Synopse mORMot framework in GitHub
https://github.com/camu72/CMProject
It is an attempt to facilitate the development of desktop applications, taking into account the use of Synopse libraries. It is still incomplete, but you can already compile it and see some examples of use with its tabulated interface. I will continue with the development, to implement it in running systems, so I await comments and suggestions. Thank you !!!

#9 mORMot 1 » TSynDictionary: how release objects instances in the Values TDynArray? » 2020-07-09 15:45:07

camu72
Replies: 6

Hi guys, I try to do something like that:
Create a TSynDictionary with images like values, do something with that, an then release de TSynDictionary instance, but before, release the images ( or objects instances in other cases ).
This is the pseudocode:

Type
  TBitmapDynArray = array of TBitmap;
  ....
procedure myProcedure
var
  ImagesDict: TSynDictionary;
begin  
  ImagesDict := TSynDictionary.Create(TypeInfo(TIntegerDynArray),TypeInfo(TBitmapDynArray));
  
  { Loads images from a zip in a rc file }
  LoadImagen(34, 'ImgBuscar12.bmp');
  LoadImagen(15, 'ImgAgregar12.bmp');
  ...
  LoadImagen(12, 'ImgEditar12.bmp');
  
  ....
  Do_a_lot_of_thing_WithImagesIn_ImagesDict;
  ....  
  
  { magesDict.forEach(MyImagesInValues) do
    EachImage.Free } << How do somethin like that?
  // I mean, release the TObjects instances (Bitmaps in this case ) in the 
  // Values TDynArray of a TSynDictionary before free it?
  
  ImagesDict.Free; 
end;

I don't understand de use of ForEach in TSynDictionary... Can samone explainme or pointme samples?
Thanks in advance!

#10 Re: mORMot 1 » The mORMot on Android » 2020-04-28 13:09:25

Very Cool!!! All test passed ... and like Esteban, I would also appreciate a reference to a tutorial ... Congratulations AOG!

#13 Re: mORMot 1 » Defining ServiceDependences in TServiceController.CheckParameters » 2019-05-08 13:27:05

Hi Kixemi, I modified the source of MormotService unit like in a first post, and runs OK, puting in Depenedencies parametrer, the name of Firebird Service in my case. The problems will came when Pull or Fetch the mORMot library... i will lose that changes.... but outside of that, works.

#14 mORMot 1 » Defining ServiceDependences in TServiceController.CheckParameters » 2019-05-04 16:06:23

camu72
Replies: 5

Hi ab, could be posible add a Dependences parameter to CheckParameters in mORMotService unit?

// In Definition change this
class procedure CheckParameters(const ExeFileName: TFileName;
      const ServiceName,DisplayName,Description: string); 

// for this
class procedure CheckParameters(const ExeFileName: TFileName;
      const ServiceName,DisplayName,Description,Dependencies: string);

//and In the implementation add de dependences to :TServiceController.Install
    ... 
    if param='/install' then
     TServiceController.Install(
       ServiceName,DisplayName,Description,true,ExeFileName,Dependencies) else
    ...

If is not posible, how can define dependence of service using CheckParameters?

#16 mORMot 1 » Set of enumerated types as integer » 2018-07-13 13:17:36

camu72
Replies: 2

Hi ab,
I know that TSQLRecord supports "set of enumerated types" in the declaration of its properties and is serialized as an integer. Is there a function in the library that can be used to convert SetOfEnumeratedTypes to integers and vice versa?
I tried to trace in the code, but I could not find where.
Thanks in advance.

#17 Re: mORMot 1 » Delete in maped TSQLRecors to ExternalDB with SQLWhere sentences fail » 2018-06-22 12:36:27

Thanks ab, you work at the speed of light. Everything works ok.

#18 mORMot 1 » Delete in maped TSQLRecors to ExternalDB with SQLWhere sentences fail » 2018-06-21 22:40:03

camu72
Replies: 2

Hi,
I have the follow situation

TSQLmyTable = class(TSQLRecord)
private
  FField_1: integer;
  FField_2: integer;
published
  Field_1: integer read FField_1 write FField_1;
  Field_2: integer read FField_2 write FField_2;
end;
  ...
  { in the model creation }
  ...
  VirtualTableExternalRegister(Result, TSQLmyTable, pPropConexion, 'MY_TABLE');
  Result.Props[TSQLmyTable].ExternalDB.
  MapField('ID','ID_MYTABLE').
  MapField('Field_1','FIELD_ONE').
  MapField('Field_2','FIELD_TWO').
    SetOptions([rpmNoCreateMissingTable, rpmNoCreateMissingField, rpmAutoMapKeywordFields]);

   

The TSQLmyTable point to an external DB (Firebird), and is maped to his real names.

The inserts, an updates are OK, but the Deletion in the follow way fails.

...
myRest.Delete(TSQLmyTable, 'FField_1 > 3')
...

or same SQLWhere where the count of IDs to delete was more than 1.
( when count of IDs is 1 run OK)
According to previous threads, I see that "myRest.Delete(aTable: TSQLRecordClass; SQLWhere: TRawUTF8)", first executes a select and obtains all the IDs that will be deleted according to the SQLWhere, to proceed with the "OnUpdateEvent" on the server.
As I can verify according to the trace, the "select" executes well and returns the list of IDs, but the "delete" fails and shows errors in the names of nonexistent fields, by the use of TSQLRecord names and not the real names of the database .
I do not understand why the select works well and the delete works poorly, both called with the same SQLWhere.
Any coments ar welcome...  thanks

#19 mORMot 1 » TSQLTableJSON and TSQLRecord not in TSQLModel » 2018-04-24 22:41:57

camu72
Replies: 1

In a context of Interfaced Service in Server side i would like (seudocode):

function GetSomeData(someParam: Integer): RawJSON;
var
  aJSON: rawUTF8;
  aObj: TMySQLRecord; // not in the model but declared shared in Server and Client
begin
  ...
  aJSON := '';  
  aObj := TMySQLRecord.Create;
  try
    for i := 0 to 100 do
    begin
      FillMyObject(aObj, i); // Empty and fill the published properties in a complex procedure
      aJSON := AddObjectToJSON(aJSON, aObj); << How can do that?
     { how can add aObj streamed as JSON in a not empty aJSON ready for TSQLTableJSON use?? }
    end
  Finally
    aObj.free;
  end;  
  result := aJSON;
end;

The idea is have a service that retrive a rawUTF8, which in the client side can be managed whit TSQLTableJSON and TMySQLRecord.
Note: TMySQLRecord is not in the model, because is filled with a complex procedure and not have a Table in the ExternalDB asociated.
Best ideas are accepted.
Thanks.

#20 mORMot 1 » TRawUTF8DynArray error when is used as const parameter - Delphi7 » 2018-03-15 12:16:52

camu72
Replies: 2

Hi,

I have the follow code:

uses
  ..., 
 SynCommons,
 ....
procedure myProcedure(const FromNames, ToNames: TRawUTF8DynArray);
begin
  DoSomething....;
end;

implementation
....
  myProcedure(['Name1','Name2'],['ToName1', 'ToName2']); // here error on compiling

1) This is de correct way to invoke myProcedure???
2) If this is OK, then in Delphi7, Win7 32bits have de follow error on compilig:

[Error] TestProyect.dpr[xx]: Ordinal type required

What is wrong here?
Thanks.

#21 Re: mORMot 1 » SQLFieldType inconsistency after instantiating TSQLRecord » 2018-02-19 18:04:24

Thanks mpv...
Ab, thx too for your quick aswer.... I Will Chek yours observations...

#22 mORMot 1 » SQLFieldType inconsistency after instantiating TSQLRecord » 2018-02-19 14:33:08

camu72
Replies: 3

Hi...I just finish the actualization (with GIT) of mormot framework, and I'm not sure that this is a bug, but in previous versions, after a TSQLRecord instance is create, when the fields is TID type, SQLFieldType is tfsInteger, when in previous version of the framework was tfsTID.

Previous versions of framework:
SQLFieldRTTITypeName: 'TID'  and SQLFieldType: sftTID
Actual version of framwokr:
SQLFieldRTTITypeName: 'TID'  and SQLFieldType: sftTInteger

This is a bug?

I work with win7 32 bits - Delphi 7.

Another cuestion: how check in the source the version of mormot framwork?

Thanks....

#23 Re: mORMot 1 » Converting Sample 28 REST ORM Server from Postgre to Firebird Server » 2018-02-04 12:54:10

Maybe the problem is the Firebird version... you with fb3 and I with fb1.5, and the ZeosLib is for FB2.5.... colud be a sintax problem waiting some intruction only available in FB2.5...

#24 Re: mORMot 1 » Converting Sample 28 REST ORM Server from Postgre to Firebird Server » 2018-02-04 12:49:43

HI msgendodoc, i was a similar problem, and if i well remeber, when the table was at lest one record (filled with a external administrator ), the issue stop. This not resolve the problem, but is something that help to trace or resolve the problem.

#25 Re: mORMot 1 » UTF8 encode and persistence layer » 2017-11-11 10:26:24

Ok, Thanks ab...i Will Chek muy knowledge... But in SynFile.exe Is just compiled as it, and when open dB with SQLite administrator the Values Is wrong. Maybe the configuración of this editor Is wrong too. Will Chek this un my PC.

#26 mORMot 1 » UTF8 encode and persistence layer » 2017-11-11 00:08:57

camu72
Replies: 2

Considering this:

TmyRecord = class(TSQLRecord).
TmyRecord instance work with rawUTF8 in runtime.
RestClient.Update(myRecord) save encoding UTF8 in persistence layer (Firebird DB in my case).
but...
I need Firebird DB in Ansi encode ( is a legacy proyect and is shared for reporting with other tecnologies )

My problem:
in FirebirdDB have a field (myField) with the value "cañon"
when retrive myRecord from the FirebirdDB, have a string "cañon" and not "cañon" wich is the correct string in UTF8.
when update myRecord.someOtherField, myField in FirebirdDB is filled with the value "".

1) Actually this is the secuence:
Firebird  : "cañon"
TSQLRecord: "cañon"
Firebird  : ""

2)I need this secuence:
Firebird  : "cañon"
TSQLRecord: "cañon"
Firebird  : "cañon"

I mean, there is a way of load or retrive values from de persistence layer, performing a convertion from Ansi To UTF8 in the TSQLRecord.crete(...), and get the second secuence?

For try, you can play with de SynFile in MainDemo.
1) Execute SynFile.exe
2) Put in same field the value "cañon"
3) Close SynFile.
4) Open SynFile.db3 with an external editor like "SQLite Administrator", and you can comprob that the value is "cañon"
This is the correct way...
5) now, edit and change "cañon" for "cañon"
6) Open SynFile.exe and see the value... only have "ca"

Thanks in advance...
Claudio.

#27 Re: mORMot 1 » DDD Sample » 2016-11-06 12:02:42

Hi Arnuad. I'm starting work in a complete migration of my obsolete erp and I like do it in a DDD direction. Do you have intentions of release the sample?  I think that Will be like a very important start point for all  the interest...
I was use  your library for the last year and have a lot of enhance but still I don't make the big step.
Congratulation for this framework. It's very powerful.
Sorry for my inglish... I'm just a reader of this language.

Board footer

Powered by FluxBB