Recent

Author Topic: Health Daily Monitor (updated links)  (Read 17291 times)

wp

  • Hero Member
  • *****
  • Posts: 11857
Re: Health Daily Monitor - my first foray into Lazarus DB programming
« Reply #15 on: July 25, 2014, 09:59:28 pm »
A question coming back to your first posting: Do you enter the data manually or do you read the blood pressure values from the device? I do have such a device also and it has a usb interface, but rather poor software. It would be interesting to get the data directly out the machine. Any idea how to do that?

minesadorada

  • Sr. Member
  • ****
  • Posts: 452
  • Retired
Re: Health Daily Monitor - my first foray into Lazarus DB programming
« Reply #16 on: July 25, 2014, 10:45:26 pm »
A question coming back to your first posting: Do you enter the data manually or do you read the blood pressure values from the device? I do have such a device also and it has a usb interface, but rather poor software. It would be interesting to get the data directly out the machine. Any idea how to do that?
My app is as simple as simple.  Manual input only.

My guess is that each data format is proprietary and different with these machines.  I would be amazed if there were a public XML schema for example.  Recently I was involved in golfml, which was an attempt to popularise a public xml schema for exchanging golf course related data.  Each golf software manufacturer uses their own proprietary format and all are uninterested in standardising to a public format :(

I thank you again for calendarlite by the way.  It was just the solution I was looking for.
GPL Apps: Health MonitorRetro Ski Run
OnlinePackageManager Components: LazAutoUpdate, LongTimer, PoweredBy, ScrollText, PlaySound, CryptINI

wp

  • Hero Member
  • *****
  • Posts: 11857
Re: Health Daily Monitor - my first foray into Lazarus DB programming
« Reply #17 on: July 25, 2014, 11:29:26 pm »
Quote
I thank you again for calendarlite by the way.
You're welcome. But it would not be fair to give all the merits to me because howardpc made the initial version (http://forum.lazarus.freepascal.org/index.php/topic,21093.msg123508.html#msg123508).

minesadorada

  • Sr. Member
  • ****
  • Posts: 452
  • Retired
Re: Health Daily Monitor - my first foray into Lazarus DB programming
« Reply #18 on: July 26, 2014, 12:13:10 am »
In which case - thank you howardpc as well!

The MySQL edition of Health Monitor is now done. download win32-bit installer here

Once again string concatenation is different - this time CONCAT(sz1,sz2,sz3 etc). and DATE() is CURDATE(), but otherwise the Date functions are similar to MSAccess, so my code changes were minimal in the DB class.  I had to change the GUI to prompt for hostname, port, username etc.

I really like the admin GUI that comes with MySQL (MySQL Workbench 6.1 CE)   Simple, but comprehensive.  MySQL V5.6 would be my SQL server of choice, should I ever need one.
« Last Edit: July 27, 2014, 10:45:04 am by minesadorada »
GPL Apps: Health MonitorRetro Ski Run
OnlinePackageManager Components: LazAutoUpdate, LongTimer, PoweredBy, ScrollText, PlaySound, CryptINI

BigChimp

  • Hero Member
  • *****
  • Posts: 5740
  • Add to the wiki - it's free ;)
    • FPCUp, PaperTiger scanning and other open source projects
Re: Health Daily Monitor - my first foray into Lazarus+DB (updated links)
« Reply #19 on: July 27, 2014, 10:20:30 am »
Ok, I'll look into creating a Firebird version & documenting the process  - just to show it can be done ;)

BTW, in Access, tools/relations, you've defined a relationship between tbl_user and tbl_main on tbl_main.userid<>tbl_user.tbl_userid

... but you haven't checked the Enforce referential integrity checkmark... which seems like a good idea to me so the application won't e.g. be able to add data for non-existent users..
Want quicker answers to your questions? Read http://wiki.lazarus.freepascal.org/Lazarus_Faq#What_is_the_correct_way_to_ask_questions_in_the_forum.3F

Open source including papertiger OCR/PDF scanning:
https://bitbucket.org/reiniero

Lazarus trunk+FPC trunk x86, Windows x64 unless otherwise specified

BigChimp

  • Hero Member
  • *****
  • Posts: 5740
  • Add to the wiki - it's free ;)
    • FPCUp, PaperTiger scanning and other open source projects
Re: Health Daily Monitor - my first foray into Lazarus DB programming
« Reply #20 on: July 27, 2014, 10:29:19 am »
I had to copy the various firebird embedded files to my windows/system32 folder as the IBConnector  visual component can't find them in the project/executable directory.
It should be exactly the same process you used for sqlite: have the .dll (in Firebird's case fbembed.dll+other dlls like
Quote
fbembed.dll
ib_util.dll
icudt30.dll
icuin30.dll
icuuc30.dll
and if necessary (it can't hurt anyway)
Quote
msvcp80.dll
msvcr80.dll
Microsoft.VC80.CRT.manifest
in the directory with the .lpr file (for design time support) and in the directory where the healthmonitor.exe is generated (for support when running or debugging the program)
Copying the entire set to your system directory as you did though is a better move for a development system, IMO, as otherwise you'll have to keep copying dlls when writing a new project.
Want quicker answers to your questions? Read http://wiki.lazarus.freepascal.org/Lazarus_Faq#What_is_the_correct_way_to_ask_questions_in_the_forum.3F

Open source including papertiger OCR/PDF scanning:
https://bitbucket.org/reiniero

Lazarus trunk+FPC trunk x86, Windows x64 unless otherwise specified

minesadorada

  • Sr. Member
  • ****
  • Posts: 452
  • Retired
Re: Health Daily Monitor - my first foray into Lazarus+DB (updated links)
« Reply #21 on: July 27, 2014, 10:37:26 am »
Ok, I'll look into creating a Firebird version & documenting the process  - just to show it can be done ;)

BTW, in Access, tools/relations, you've defined a relationship between tbl_user and tbl_main on tbl_main.userid<>tbl_user.tbl_userid

... but you haven't checked the Enforce referential integrity checkmark... which seems like a good idea to me so the application won't e.g. be able to add data for non-existent users..
Thanks; that would be interesting to see.  The project SVN is all up-to-date, and the Firebird DDL is at the top of the healthclass code.  I was trying for embedded Firebird so that the .fdb file could be distributed with the app, but given theMySQL implementation either server or embedded Firebird would be good.

Any improvements to the DB or code would be welcome :)

I've updated the first post in this thread with the latest links.
« Last Edit: July 27, 2014, 10:41:50 am by minesadorada »
GPL Apps: Health MonitorRetro Ski Run
OnlinePackageManager Components: LazAutoUpdate, LongTimer, PoweredBy, ScrollText, PlaySound, CryptINI

howardpc

  • Hero Member
  • *****
  • Posts: 4144
Re: Health Daily Monitor - my first foray into Lazarus+DB (updated links)
« Reply #22 on: July 27, 2014, 12:54:03 pm »
When I try to run the sqlite-enabled version (on Win 7, 32-bit) the process cannot be started, and returns an error
"A referral was returned from the server", even when attempting with Administrator rights.
What causes this, and how can it be overcome?

BigChimp

  • Hero Member
  • *****
  • Posts: 5740
  • Add to the wiki - it's free ;)
    • FPCUp, PaperTiger scanning and other open source projects
Re: Health Daily Monitor - my first foray into Lazarus+DB (updated links)
« Reply #23 on: July 27, 2014, 01:03:50 pm »
@HowardPC: I had the same problem with the msaccess version. Seems to be some kind of weird permissions/UAC thing at least that's what I got out of searching on the net.
For me, enabling Win XP SP 3 compatibility mode+run as admin fixed it...

Edit: alternatively, unchecking project options/use manifest file to enable themes fixed it..
« Last Edit: July 27, 2014, 01:05:43 pm by BigChimp »
Want quicker answers to your questions? Read http://wiki.lazarus.freepascal.org/Lazarus_Faq#What_is_the_correct_way_to_ask_questions_in_the_forum.3F

Open source including papertiger OCR/PDF scanning:
https://bitbucket.org/reiniero

Lazarus trunk+FPC trunk x86, Windows x64 unless otherwise specified

minesadorada

  • Sr. Member
  • ****
  • Posts: 452
  • Retired
Re: Health Daily Monitor - my first foray into Lazarus+DB (updated links)
« Reply #24 on: July 27, 2014, 02:04:44 pm »
There's some stuff here in Microsoft answers that might be the solution.

I developed the app in Vista with UAC turned off, and have never seen the issue.  Anything I can do in project options to fix it?

==edit just saw BigChimps suggestion =
« Last Edit: July 27, 2014, 02:06:34 pm by minesadorada »
GPL Apps: Health MonitorRetro Ski Run
OnlinePackageManager Components: LazAutoUpdate, LongTimer, PoweredBy, ScrollText, PlaySound, CryptINI

BigChimp

  • Hero Member
  • *****
  • Posts: 5740
  • Add to the wiki - it's free ;)
    • FPCUp, PaperTiger scanning and other open source projects
Re: Health Daily Monitor - my first foray into Lazarus+DB (updated links)
« Reply #25 on: July 27, 2014, 02:13:20 pm »
I developed the app in Vista with UAC turned off, and have never seen the issue.  Anything I can do in project options to fix it?
Looking at
http://msdn.microsoft.com/en-us/library/ms742884%28v=vs.110%29.aspx
it looks like unchecking UI Access in Project Options should be enough...
Tested it, that is indeed sufficient; manifest file/dpi awareness can remain enabled.
Want quicker answers to your questions? Read http://wiki.lazarus.freepascal.org/Lazarus_Faq#What_is_the_correct_way_to_ask_questions_in_the_forum.3F

Open source including papertiger OCR/PDF scanning:
https://bitbucket.org/reiniero

Lazarus trunk+FPC trunk x86, Windows x64 unless otherwise specified

minesadorada

  • Sr. Member
  • ****
  • Posts: 452
  • Retired
Re: Health Daily Monitor - my first foray into Lazarus+DB (updated links)
« Reply #26 on: July 27, 2014, 02:57:06 pm »
I've updated the SQLite installer with the changes, if anyone would like to give it a try..

Linky
GPL Apps: Health MonitorRetro Ski Run
OnlinePackageManager Components: LazAutoUpdate, LongTimer, PoweredBy, ScrollText, PlaySound, CryptINI

BigChimp

  • Hero Member
  • *****
  • Posts: 5740
  • Add to the wiki - it's free ;)
    • FPCUp, PaperTiger scanning and other open source projects
Re: Health Daily Monitor - my first foray into Lazarus+DB (updated links)
« Reply #27 on: July 27, 2014, 02:58:55 pm »
Added Firebird support; my notes for the process:

- Download & install FlameRobin
- Make sure the embedded FIrebird dlls (fbembed.dll etc) are in your system directory
or
in your FlameRobin directory - and copy fbembed.dll to fbclient.dll as Flamerobin looks for that (based on memory, did this a long time ago)
- Start flamerobin, server, register server
display name: embedded
hostname: leave blank
port number: leave blank
- Under that embedded server, create a new database healthdb.fdb
in your project directory, user SYSDBA, password masterkey, charset UTF8, role RDB$ADMIN, page size 16384, sql dialect 3
- connect to the db
- rightclick, execute sql query; copy & paste from healthdb_firebird.sql, omitting the create datbase part, and click the play icon (execute statements)
- the statements should run ok, in the statistics tab you should see blue text (not red) ending in "script execution finished". Note the GRANT statements that give the PUBLIC role (=the default role for any connection with any user) all rights to the table
- commit the statements by clicking the checkmark icon (commit transaction, F5)
- disconnect from the database to avoid keeping the db locked.
Want quicker answers to your questions? Read http://wiki.lazarus.freepascal.org/Lazarus_Faq#What_is_the_correct_way_to_ask_questions_in_the_forum.3F

Open source including papertiger OCR/PDF scanning:
https://bitbucket.org/reiniero

Lazarus trunk+FPC trunk x86, Windows x64 unless otherwise specified

BigChimp

  • Hero Member
  • *****
  • Posts: 5740
  • Add to the wiki - it's free ;)
    • FPCUp, PaperTiger scanning and other open source projects
Re: Health Daily Monitor - my first foray into Lazarus+DB (updated links)
« Reply #28 on: July 27, 2014, 04:47:10 pm »
Note I have opened up the MySQL port on a development machine for testing.  If anyone would like to test Health Monitor MySQL5.6 Edition, use the following info:
<snip>
I would be very interested to see if a remote connection works..
It works though it is quite slow. Clicking e.g. on the user management tab, it takes about 30 seconds for the sheet to display...

I'd also suggest changing at least the port number of the test connection otherwise you'll probably get a huge amount of attacks... unless you've put a throwaway virtual machine behind it of course...
Want quicker answers to your questions? Read http://wiki.lazarus.freepascal.org/Lazarus_Faq#What_is_the_correct_way_to_ask_questions_in_the_forum.3F

Open source including papertiger OCR/PDF scanning:
https://bitbucket.org/reiniero

Lazarus trunk+FPC trunk x86, Windows x64 unless otherwise specified

minesadorada

  • Sr. Member
  • ****
  • Posts: 452
  • Retired
Re: Health Daily Monitor - my first foray into Lazarus+DB (updated links)
« Reply #29 on: July 27, 2014, 05:02:15 pm »
Note I have opened up the MySQL port on a development machine for testing.  If anyone would like to test Health Monitor MySQL5.6 Edition, use the following info:
<snip>
I would be very interested to see if a remote connection works..
It works though it is quite slow. Clicking e.g. on the user management tab, it takes about 30 seconds for the sheet to display...

I'd also suggest changing at least the port number of the test connection otherwise you'll probably get a huge amount of attacks... unless you've put a throwaway virtual machine behind it of course...
Ah, thanks.  I just needed to know if it was possible.  I'll change the port as per suggestion.

Just a bit of GUI tidying up now, and then I can hopefully do the final updates to SF.  Thanks muchly for your help.
GPL Apps: Health MonitorRetro Ski Run
OnlinePackageManager Components: LazAutoUpdate, LongTimer, PoweredBy, ScrollText, PlaySound, CryptINI

 

TinyPortal © 2005-2018