How do I simulate the logs I keep?
I have a data stream in a winframe interface. I keep these logs somewhere and when I press the simulate button, I want it to simulate my log records (data, pressed buttons, briefly the log records I keep) in the same interface.
6 Replies
What is your question?
i have winframe. I am reading data by serial communication. I keep this data in log records. I want to be able to simulate log records. For example, there is a serial communication interface where I turn the LED on and off. I did the on-off, on-off operation. I kept logs. Let me show them in the interface when I simulate it; when i pressed the on button when i pressed the off button
could i explain?
winframe?
winforms?
it sounds like you need some abstraction between your UI layer and your device interaction layer so that you have a place to inject events
or brute force it by calling the appropriate button's click method at the right interval
or you could use the windows automation framework to code up some ui automation
or ui unit tests
there's several options, depending on how much control you want
the further you get from your code, the less control you have
this is not what i was looking for
c# windows form application.I have a serial communication. Data is constantly coming. I turn some keys on and off. I keep logs of all these movements. Then I want to watch as a simulation these logs in the same frame interface.
like viewing flight logs
then what you need is an abstraction for the serial communication
something you can feed data to, and something you can set up to get data provided via serial
then something to replay that log with the correct timing
IDevice, with a SerialDevice class, and a ReplayDevice class
The SerialDevice class is responsible for handling the serial communication, the ReplayDevice class is responsible for handling and re-playing the logs
then depending on which mode your in, you use the appropriate abstraction
this may also be referred to as a driver
as it's not too different from device drivers, the distinction from a device driver is that this is running in userspace in your application, and acts like a interface between your application and the hardware
you can swap the driver out to handle different setups
thank youu 🙂