Recent

Author Topic: TvPlanIt fixes  (Read 38636 times)

JD

  • Hero Member
  • *****
  • Posts: 1913
Re: TvPlanIt fixes
« Reply #30 on: June 11, 2016, 10:25:33 pm »
@wp I've updated my old copy from the svn version. But anytime I try to load your example project, I get the message

Unable to find the component class "TVpFlexDataStore". It is not registered via RegisterClass and no lfm was found

JD
Linux Mint - Lazarus 4.6/FPC 3.2.2,
Windows - Lazarus 4.6/FPC 3.2.2

mORMot 2, PostgreSQL & MariaDB.

JD

  • Hero Member
  • *****
  • Posts: 1913
Re: TvPlanIt fixes
« Reply #31 on: June 11, 2016, 10:53:56 pm »
Forget about my last post. The problem vanished after I rebuilt Lazarus.

JD
Linux Mint - Lazarus 4.6/FPC 3.2.2,
Windows - Lazarus 4.6/FPC 3.2.2

mORMot 2, PostgreSQL & MariaDB.

wp

  • Hero Member
  • *****
  • Posts: 13625
Re: TvPlanIt fixes
« Reply #32 on: June 11, 2016, 11:01:12 pm »
Good that you could figure it out.

The package has a new name now: laz_visualplanit, and its version number was increased to 1.04. The old package, v103_lazarus, should be uninstalled before using the new package, there could be naming conflicts.

Currently I am experimenting with a datastore specialized for TBufDataset (motivated by DonAlfredo's code, thank you), it makes application of the TVPlanIt components really very easy. After that I think I'll be brave enough tp adapt it to more versatile database libs like Zeos.

Most of the bugs are done now. One thing to note is that the DayView scrolls very slowly, there seems to be something wrong here.

JD

  • Hero Member
  • *****
  • Posts: 1913
Re: TvPlanIt fixes
« Reply #33 on: June 11, 2016, 11:12:42 pm »
The package has a new name now: laz_visualplanit, and its version number was increased to 1.04. The old package, v103_lazarus, should be uninstalled before using the new package, there could be naming conflicts.

That's odd. Mine is still called v103_lazarus 0.0 and the version number is still v1.03. I got mine here https://sourceforge.net/p/lazarus-ccr/svn/2819/tree/components/tvplanit/

Can you give me the link to the one with your changes?

Currently I am experimenting with a datastore specialized for TBufDataset (motivated by DonAlfredo's code, thank you), it makes application of the TVPlanIt components really very easy. After that I think I'll be brave enough tp adapt it to more versatile database libs like Zeos.

Most of the bugs are done now. One thing to note is that the DayView scrolls very slowly, there seems to be something wrong here.

I must commend you for your work also. All in all I hope we are able to get it working properly in Lazarus.

JD
« Last Edit: June 11, 2016, 11:26:57 pm by JD »
Linux Mint - Lazarus 4.6/FPC 3.2.2,
Windows - Lazarus 4.6/FPC 3.2.2

mORMot 2, PostgreSQL & MariaDB.

wp

  • Hero Member
  • *****
  • Posts: 13625
Re: TvPlanIt fixes
« Reply #34 on: June 11, 2016, 11:46:31 pm »
I access lazarus-ccr via svn directly, not via http. In your http link, the "2819" is the revision number which is way too old. My last commit is r4718. Therefore, https://sourceforge.net/p/lazarus-ccr/svn/4718/tree/components/tvplanit/ should work.

I don't know if there is a special symbol to lead you to the head revision, but I don't think so because the head revision does not necessarily contain changes of tvplanit. Instead of fighting with http access I'd recommend to switch to svn directly. On Windows, TortoiseSVN is really easy: install it, create a folder for the files for download, right-click it, select "SVN Checkout" and enter https://svn.code.sf.net/p/lazarus-ccr/svn/components/tvplanit as URL. To get an update just select "SVN Update" in the explorer, and you'll have the latest revision within a few seconds.

JD

  • Hero Member
  • *****
  • Posts: 1913
Re: TvPlanIt fixes
« Reply #35 on: June 12, 2016, 12:18:01 am »
OK I've got the right one now. Thanks.
Linux Mint - Lazarus 4.6/FPC 3.2.2,
Windows - Lazarus 4.6/FPC 3.2.2

mORMot 2, PostgreSQL & MariaDB.

JD

  • Hero Member
  • *****
  • Posts: 1913
Re: TvPlanIt fixes
« Reply #36 on: June 12, 2016, 12:58:03 am »
Currently I am experimenting with a datastore specialized for TBufDataset (motivated by DonAlfredo's code, thank you), it makes application of the TVPlanIt components really very easy. After that I think I'll be brave enough tp adapt it to more versatile database libs like Zeo

Someone tried to use TvPlanit with Zeos & SqLite3. A sample project is posted here http://forum.lazarus.freepascal.org/index.php/topic,24174.msg146212.html#msg146212

JD
Linux Mint - Lazarus 4.6/FPC 3.2.2,
Windows - Lazarus 4.6/FPC 3.2.2

mORMot 2, PostgreSQL & MariaDB.

wp

  • Hero Member
  • *****
  • Posts: 13625
Re: TvPlanIt fixes
« Reply #37 on: June 12, 2016, 01:17:20 am »
The datastore for TBufDataset is online now.

Here are simple steps to use the VisualPlanIt components (following the "official" tutorial-pdf on https://sourceforge.net/projects/tpvplanit/files/tpvplanit_docs/1.03/tpvplanit_docs.zip/download):

  • Add these components to the form:
      - a TVpBufDSDatastore, AutoConnect = true (important!)
      - a TVpControlLink
      - a TVpResourceEditDialog
      - a TPanel, top-align
      - a TVpResourceCombo and a TButton on the panel. Button.Caption = 'New resource'
      - a TVpWeekView, left-aligned to the form
      - a TVpContactGrid, client-aligned to the form
  • Write this OnClick Handler for the Button:
Code: Pascal  [Select][+][-]
  1. procedure TForm1.Button1Click(Sender: TObject);
  2. begin
  3.   VpResourceEditDialog1.AddNewResource;
  4. end;
  • Compile and run
      - Click on the button. Specify a name for the new resource
      - Doubleclick on the Weekview to enter an appointment
      - Doubleclick on the ContactGrid to enter a contact
      - When the program runs the next time select the resource from the combo, or use this code to load the first resource automatically:
Code: Pascal  [Select][+][-]
  1. procedure TForm1.FormCreate(Sender: TObject);
  2. begin
  3.   VpBufDSDatastore1.Load;
  4.  
  5.   // Automatically activate the first resource
  6.   if VpBufDSDatastore1.ResourceTable.RecordCount > 0 then
  7.     VpBufDSDatastore1.ResourceID := 1;
  8. end;

Have fun.

DonAlfredo

  • Hero Member
  • *****
  • Posts: 1883
Re: TvPlanIt fixes
« Reply #38 on: June 12, 2016, 10:16:28 am »
Hi guys,

Solved another longstanding bug (dayview slowdown) !

See (with some other minor updates): https://github.com/LongDirtyAnimAlf/mORMotPlanIt

wp

  • Hero Member
  • *****
  • Posts: 13625
Re: TvPlanIt fixes
« Reply #39 on: June 12, 2016, 11:37:03 am »
You are the king, thank you!

magu

  • New Member
  • *
  • Posts: 37
Re: TvPlanIt fixes
« Reply #40 on: June 12, 2016, 12:15:38 pm »
You guys are incredible! This package is now working brilliantly.
Congrats to all, but especially to wp, in one week he has done what no one had done in a decade!
@wp If there is one thing I can suggest it would be to remove TVpDateEdit - trying to use it raises errors, and I don't think its even necessary.

JD

  • Hero Member
  • *****
  • Posts: 1913
Re: TvPlanIt fixes
« Reply #41 on: June 12, 2016, 12:34:25 pm »
Wonderful work! Thanks a million to wp, DonAlfredo & magu. Your contributions were invaluable.

@DonAlfredo I'm interested to know how you set up mORMot to work in Lazarus. I've skimmed the 2000+ page manual (that's a lot to master in very little time) but I've not had much joy in that respect.

JD
« Last Edit: June 12, 2016, 12:36:39 pm by JD »
Linux Mint - Lazarus 4.6/FPC 3.2.2,
Windows - Lazarus 4.6/FPC 3.2.2

mORMot 2, PostgreSQL & MariaDB.

DonAlfredo

  • Hero Member
  • *****
  • Posts: 1883
Re: TvPlanIt fixes
« Reply #42 on: June 12, 2016, 12:36:24 pm »
@wp

I would like to advice you to also takeover my proposed changes for the Field Mappings.

See (vpflxds.pas):
https://github.com/LongDirtyAnimAlf/mORMotPlanIt/commit/09e43e2ea2c4473d8d5ae6502f077aaae1e9d387
I think its better and speed things up.
Now, we only have to map fields that need mapping.

This will also show you that this mapping is necessary (unit1.pas):
if Fields.FieldName='DingPath' then AddMapping(Fields.FieldName,'AlarmWavPath',VpFlexDataStore1.EventMappings);
      if Fields.FieldName='AlarmAdvance' then AddMapping(Fields.FieldName,'AlarmAdv',VpFlexDataStore1.EventMappings);
      if Fields.FieldName='AlarmAdvanceType' then AddMapping(Fields.FieldName,'AlarmAdvType',VpFlexDataStore1.EventMappings);
      if Fields.FieldName='CustomInterval' then AddMapping(Fields.FieldName,'CustInterval',VpFlexDataStore1.EventMappings);

The above is needed due to the fact that the naming of fields troughout tvplanit is not consistent.
E.g. sometimes "AlarmAdvType" is used, and sometimes "AlarmAdvanceType".
So this reveales that some more (minor) changes to the source are needed to regain consistency.

DonAlfredo

  • Hero Member
  • *****
  • Posts: 1883
Re: TvPlanIt fixes
« Reply #43 on: June 12, 2016, 12:37:44 pm »
@JD.

Tell me your exact problem !
I am running the mORMot (nearly) out-of-the-box on Linux !

JD

  • Hero Member
  • *****
  • Posts: 1913
Re: TvPlanIt fixes
« Reply #44 on: June 12, 2016, 12:46:47 pm »
@JD.

Tell me your exact problem !
I am running the mORMot (nearly) out-of-the-box on Linux !

I can't compile any of the example projects. I keep gettiing an internal compiler error - mORMot.pas(23363,7) Error: Internal error 2006111510
« Last Edit: June 12, 2016, 12:53:13 pm by JD »
Linux Mint - Lazarus 4.6/FPC 3.2.2,
Windows - Lazarus 4.6/FPC 3.2.2

mORMot 2, PostgreSQL & MariaDB.

 

TinyPortal © 2005-2018