View Issue Details

IDProjectCategoryView StatusLast Update
0005782JEDI VCL00 JVCL Componentspublic2013-12-13 11:25
ReporterlimagitoAssigned Toobones 
PrioritynormalSeverityblockReproducibilityalways
Status resolvedResolutionsuspended 
Product Version3.45 
Target VersionFixed in Version 
Summary0005782: JVScheduledevents doesn't load all settings after Revision 11163
DescriptionAfter revision JVScheduledEvents doesn't load all settings anymore.
The error is located in the TJvEventCollectionItem.Loadstate procedure.
Additional InformationThey left out the following code since 11163 and since then it doesn't load the End Type Settings anymore.

      Schedule.StartDate := AStartDate;
      Schedule.EndType := AEndType;

      if ARecurringType = srkOneShot then
      begin
        Schedule.EndType := sekDate;
        Schedule.EndDate := AStartDate;
        IDayFrequency := Schedule as IJclScheduleDayFrequency;
        with IDayFrequency do
        begin
          StartTime := AStartDate.Time;
          EndTime := AEndDate.Time;
          Interval := 1;
        end;
      end else
      begin

        Case Schedule.EndType of
        sekDate: Schedule.EndDate := AEndDate;
        sekTriggerCount: Schedule.EndCount:= AEndCount;
        sekDayCount: Schedule.EndCount:= AEndCount;
        end;

TagsNo tags attached.

Activities

obones

2012-02-22 15:07

administrator   ~0019463

Please provide the zipped sources of a sample application showing this

2012-04-01 13:57

 

JvScheduledEvents.pas (59,197 bytes)

limagito

2012-04-01 14:14

reporter   ~0019685

Hi,

I've just uploaded a working version of JvScheduledEvents.pas

1) I found another bug. There was some code that was comment in revision 11163 (and older). Someone removed the comment (* *), NOT GOOD. I think it's better to remove this part complete. If this code is uncommented then the start of the schedules are completely wrong. This is done in the .Start Procedure. Don't do it twice.

procedure TJvEventCollectionItem.LoadState

(*
      if IsNullTimeStamp(NextFire) or
        (CompareTimeStamps(NextFire, DateTimeToTimeStamp(Now)) < 0) then
        Schedule.NextEventFromNow(CountMissedEvents);
      if IsNullTimeStamp(NextFire) then
        FState := sesEnded
      else
        FState := sesWaiting;
*)

2) I've changed the .start procedure, no exception but Exit when already started.

procedure TJvEventCollectionItem.Start;
  begin
  if FState in [sesTriggered, sesExecuting] then
    Exit;

3) Removed the exception handling in the Try Except End;
 of the .CMExecEvent Procedure (identical as it is handled in the procedure TScheduleThread.Execute;).

procedure TJvCustomScheduledEvents.CMExecEvent(var Msg: TMessage);
begin
  with Msg do
    try
      DoStartEvent(TJvEventCollectionItem(WParam));
      TJvEventCollectionItem(WParam).Execute;
      DoEndEvent(TJvEventCollectionItem(WParam));
      Result := 1;
    except
    End
end;

Best Regards,
Pascal

obones

2012-06-11 17:40

administrator   ~0019875

Thanks for that but I still need a demo application to see the issue.

obones

2013-12-13 11:25

administrator   ~0020775

No news, suspending the issue

Issue History

Date Modified Username Field Change
2012-02-02 22:31 limagito New Issue
2012-02-22 15:07 obones Note Added: 0019463
2012-02-22 15:07 obones Status new => feedback
2012-04-01 13:57 limagito File Added: JvScheduledEvents.pas
2012-04-01 14:14 limagito Note Added: 0019685
2012-06-11 17:40 obones Note Added: 0019875
2013-12-13 11:25 obones Note Added: 0020775
2013-12-13 11:25 obones Status feedback => resolved
2013-12-13 11:25 obones Resolution open => suspended
2013-12-13 11:25 obones Assigned To => obones