Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RAD-5573 Improve scheduling and validation logic for Schedule Object #98

Merged
merged 4 commits into from
Jul 15, 2024

Conversation

MertCingoz
Copy link
Member

Addressing scheduling issues discussed in #97

@MertCingoz MertCingoz marked this pull request as ready for review July 1, 2024 15:58
Copy link

@terrypacker terrypacker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, had a discussion with @MertCingoz and I am happy with these changes.

@MertCingoz MertCingoz merged commit c7d50fb into master Jul 15, 2024
@MertCingoz MertCingoz deleted the fix/RAD-5573/scheduling branch July 15, 2024 11:51
@kishorevenki
Copy link

I created my application with Schedule Object like the below:
ScheduleObject Sch1 = new ScheduleObject(localDevice, 1, "Schedule_1",
effectivePeriod, weeklySchedule, exceptionSchedule, new Real(10f),
sequenceDOPR, priorityForWriting.intValue(), false);
Sch1.updatePresentValue();

I have got the above error message:
The method updatePresentValue() from the type ScheduleObject is not visible

So I feel updatePresentValue() for Calendar and Schedule object should be made public.

@MertCingoz
Copy link
Member Author

@kishorevenki why did you need to call this method on your code?

If value is not correct and you need to trigger update, then we need to focus why it is not correct instead of making this method to public.

@kishorevenki
Copy link

  1. "If value is not correct and you need to trigger update" - how to trigger update?
  2. Lets consider the below configurations for Schedule Object:
  • Schedule Object, so is configured with Exception Schedule = Null; Weekly Schedule = Monday to Sunday (8:00AM, 20.00); Schedule Default = 23.0
    
  • In the above configuration every day from 8:00 AM till EOD the so.PV will be 20
  • Assume that at 23:59 there are multiple RP requests for so.PV.
  • For the above couple of requests, the value will be 20 as long as the time is lesser than 23:59:59.
  • But once the time crosses 23:59:59, the value should be 23 which will not happen automatically. In the application we need to explicitly make so to update its PV by calling the method updatePresentValue() which in turn automatically set the PV of DOPR (Device Object Property Ref).
  • Same result will happen when the time reaches at 7:59:59.
  • Because of the above reasons and similar site conditions, updatePresentValue needs to be made Public.
  • Please let me know if any other method to make schedule Engine to calculate its PV from the application.

@MertCingoz
Copy link
Member Author

@kishorevenki thank you for pointing the issue. There were issues around time format and should be fixed here #101.

So you don't need to trigger update method manually.

I think if you really want to trigger force update you need to use WP for any of following properties.

PropertyIdentifier.effectivePeriod
PropertyIdentifier.weeklySchedule
PropertyIdentifier.exceptionSchedule
PropertyIdentifier.scheduleDefault

@kishorevenki
Copy link

@MertCingoz
The test will fail in multiple situations as I mentioned above. Hence its required for the application to call updatePresentValue() of Schedule and Calendar Object.
You can notice the same by creating an application and testing the schedule object.
Updating of Scheduling and Calendar is required when the controller receives
a) TimeSynch
b) RP / RPM request
c) Schedule will update automatically when it receives WP for the above properties as mentioned.

If you need I can create a separate issue for the same.

@MertCingoz
Copy link
Member Author

The test will fail in multiple situations as I mentioned above. Hence its required for the application to call updatePresentValue() of Schedule and Calendar Object. You can notice the same by creating an application and testing the schedule object.

fullTest seems to be very complex than your example and still be able to pass without need of updatePresentValue call.

Did you actually check what is changed? Scheduler is completely broken since beginning, it is scheduling next update 30-40 years later instead of hours-minutes.

Please try your case on top of fix and let me know if it works or not.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants