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

Add a command line option to enable fakeTimer #270

Draft
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

ernstblechaPT
Copy link

As discussed in #265 this adds a command line option to enable the fakeTimer if the feature is compiled in.

@ernstblechaPT
Copy link
Author

I had another thought: since there is the FakeTimeDev and the RMT_DEV it is possible to select the required timer based on the device used.

@ernstblechaPT
Copy link
Author

My Idea of tying automatic enablement of the FakeTimer to the FakeTimeDev poses a problem: the command line switch would need to be turned to a "disable FakeTimer" switch which breaks my use case.

In this state this practically makes the FakeTimer unusable on systems where FORTE is not started via command line. Is there currently someone using FakeTime on any platform other than Win32/Posix that we are aware of?

@cochicde
Copy link
Contributor

cochicde commented Nov 7, 2024

FakeTimeDev

I'm not sure how the FakeTimeDev is being used. I understand that you need to compile forte with FORTE_DEVICE=FakeTimeDev and you get the fakeTimer in it.

What's your use case? Do you want to also have the disable FakeTimer command line to be able to use a regular timer? In that case I think the FakeTimeDev becomes the same to a RMT_DEV, right?

@ernstblechaPT
Copy link
Author

FakeTimeDev

I'm not sure how the FakeTimeDev is being used. I understand that you need to compile forte with FORTE_DEVICE=FakeTimeDev and you get the fakeTimer in it.

What's your use case? Do you want to also have the disable FakeTimer command line to be able to use a regular timer? In that case I think the FakeTimeDev becomes the same to a RMT_DEV, right?

I want to build one FORTE binary and have it start up as a "normal" FORTE as default - and if needed switch it to FakeTime for doing some testing

I have not problem adding a switch for testing, but the default should be the "normal" FORTE

@cochicde
Copy link
Contributor

cochicde commented Nov 7, 2024

I want to build one FORTE binary and have it start up as a "normal" FORTE as default - and if needed switch it to FakeTime for doing some testing

I have not problem adding a switch for testing, but the default should be the "normal" FORTE

But do you actually need the FakeTimeDevice? I see it has the extra input for setting the time it seems. is this something that's actually being used? Do you want to be able to switch between RMT_DEV and FakeTimeDevice or actually between RMT_DEV(with normal timer) and RMT_DEV(with fakeTimer)?

@ernstblechaPT
Copy link
Author

I want to build one FORTE binary and have it start up as a "normal" FORTE as default - and if needed switch it to FakeTime for doing some testing
I have not problem adding a switch for testing, but the default should be the "normal" FORTE

But do you actually need the FakeTimeDevice? I see it has the extra input for setting the time it seems. is this something that's actually being used? Do you want to be able to switch between RMT_DEV and FakeTimeDevice or actually between RMT_DEV(with normal timer) and RMT_DEV(with fakeTimer)?

Having the FakeTimeDevice allows you to set the time during a Debug-Session for a FB via the FB-Debug view in the Debug perspective - this is a really powerful tool

@cochicde
Copy link
Contributor

cochicde commented Nov 8, 2024

Having the FakeTimeDevice allows you to set the time during a Debug-Session for a FB via the FB-Debug view in the Debug perspective - this is a really powerful tool

I see two possible ways of having that:

  1. Allow multiple devices to be compiled: create some factory for the type of device being created. The selection could be then done via a command line flag being the regular RMT_DEV the default one. This will allow also to have the OPCUA_DEV device. The FakeTimeDev would need to set the timer properly in the constructor and set it back to the regular in the destructor.
  2. Extend the interface of the FakeTimeDev to allow switching timers: A boolean input could allow to select between the fake and the normal timer. This will basically convert your FakeTimeDev in to a regular RMT_DEV at runtime.

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.

2 participants