In a flink stream, I can only confirm if I should open a window when the data in the middle of window arrived.
For example, for a window that should be located within [0, 10] seconds. When and only when the data at time 5 arrives, I know this window should be created.
How can I implement it?
Thx.
Related
I am developing and Qt/ qml application which runs on a limited resource device. App displays instant data of multiple sensors. Every sensor sends data periodically with different frequencies. Their frequency is much frequency than device can refresh Frame. Currently I am registering every sensors data to qml side as q_property and reassign their value every time one of the sensor sends data which is more frequent that frame can be refreshed. What I want to do is assign properties onlu before refreshing Frame. What is the best way in this situation? I researched about before rendering function of qquickwindow, but couldnt handle it.
From my experience with sensor data i would suggest that you delay/time the input on the c++/sensor side rather than on the GUI side.
e.g. i had data from joysticks on an Arduino that would refresh faster than every 0.01 sec. i than implemented a delay of 0.1 or 0.2 seconds on the arduino/hardware side and send all data from all devices in the same interval. I am guessing from the type of data you are collecting that its not even necessary that it refreshes so fast? So maybe just give it a 5+ second delay? QML than can refresh every 5 seconds.
if thats not an option for you i would also suggest like folibis to use a timer thats sets the new values in an interval.
I've been processing all the numerous individual WM_MOVE, WM_SIZING, and WM_SIZE messages for a multiple-GUI/window application, but I've just learned of the WM_EXITSIZEMOVE message and would like to use it if it lets me avoid all those intermediate messages. But since no parameters are provided by that message, how can I determine which GUI/window has been moved or resized? Or is my thinking incorrect?
All of the messages you reference are only sent to the window that was affected by that operation, which is why there are no parameters provided that identify the window. If the window receives it, it is the window that was just moved, sized, or is exiting size/move.
In other words, if you have windows A and B, and B is resized or moved, then it will receive the messages and window A will not.
I'm building an application using Qt (on linux). My application basically consists of 2 Windows To keep things simple lets just call them "A" and "B".
A is the application's "main window", some kind of "idle" window which is displayed (maximized) when the app has "nothing to do". It contains a lot of pushbuttons.
If the user presses one of those PBs, Window B should be displayed (maximized too). On B, the user does some work, leaves ("closes") B and Window A is redisplayed.
Now, since Win B needs a lot of data, even some of it requested from a server over the network, I wonder if it was a good idea to "create" Win-B only once (at the end of Win-A's ctor ), and later when needed just show(), and when work is done just hide() it. ???
Maybe someone of you Qt gurus out there can give me some advice?
Thanks a lot!
Norbert
If you want to keep the data of window B, showing and hiding is the way to go. If you want to show a clean dialog everytime a user request window B, you should create and destroy it every time.
I'm using Directshow SampleGrabber in callback mode to capture video frame from source file and do some processing. Also I would like to maintain the current playback rate of video and need to support both random, forward and backward seeking. For this I'm also doing some local buffering in a different thread.
I'm running graph with syn source set to NULL, so as to get maximum speed. However when I pause the graph after fixed amount of buffering. The SampleGrabber callback is getting called spuriously even when graph is paused. This is affecting my frame indexing and tracking. I want to resume the graph exactly from the same position at which it was paused. However if I run the graph with default clock it works fine but then my playback get affected. I want buffering thread to finish as soon as possible.
How can I make sure that callback is not called when graph is paused? Any thoughts or suggestion would be of great help.
Thanks in advance
Pradeep
Paused graph typically has all the same streaming internally (active state) with the exception that renderers are blocking streaming, esp. as soon as enough data is received for a preview banner. Since you removed clock from the graph, your renderer is likely to not block execution because it does not hold any clock to pause against. In your case this is the problem coming out of your intent to reuse the same graph for quick parsing through file and playback. Separate graph design looks having more chances to do better.
I have been involved in building a custum QGIS application in which live data is to be shown on the viewer of the application.
The IPC being used is unix message queues.
The data is to be refreshed at a specified interval say, 3 seconds.
Now the problem that i am facing is that the processing of the data which is to be shown is taking more than 3 seconds,so what i have done is that before the app starts to process data for the next update,the refresh QTimer is stopped and after the data is processed i again restart the QTimer.The app should work in such a way that after an update/refresh(during this refresh the app goes unresponsive) the user should get ample time to continue to work on the app apart from seeing the data being updated.I am able to get acceptable pauses for the user to work-- in one scenario.
But on different OS(RHEL 5.0 to RHEL 5.2) the situation is something different.The timer goes wild and continues to fire without giving any pauses b/w the successive updates thus going into an infinite loop.Handling this update data definitely takes longer than 3 sec,but for that very reason i have stopped-restarted the timer while processing..and the same logic works in one scenario while in other it doesnt.. The other fact that i have observed is that when this quick firing of the timer happens the time taken by the refreshing function to exit is very small abt 300ms so the start-stop of the timer that i have placed at the start-and-end of this function happens in that small time..so before the actual processing of the data finishes,there are 3-4 starts of the timer in queue waiting to be executed and thus the infinite looping problem gets worse from that point for every successive update.
The important thing to note here is that for the same code in one OS the refresh time is shown to be as around 4000ms(the actual processing time taken for the same amount of data) while for the other OS its 300ms.
Maybe this has something to do with newer libs on the updated OS..but I dont know how to debug it because i am not able to get any clues why its happening as such... maybe something related to pthreads has changed b/w the OSs??
So, my query is that is there any way that will assure that some processing in my app is timerised(and which is independent of the OS) without using QTimer as i think that QTimer is not a good option to achieve what i want??
What option can be there?? pthreads or Boost threads? which one would be better if i am to use threads as an alternate??But how can i make sure atleast a 3 second gap b/w successive updates no matter how long the update processing takes?
Kindly help.
Thanks.
If I was trying to get an acceptable, longer-term solution, I would investigate updating your display in a separate thread. In that thread, you could paint the display to an image, updating as often as you desire... although you might want to throttle the thread so it doesn't take all of the processing time available. Then in the UI thread, you could read that image and draw it to screen. That could improve your responsiveness to panning, since you could be displaying different parts of the image. You could update the image every 3 seconds based on a timer (just redraw from the source), or you could have the other thread emit a signal whenever the new data is completely refreshed.