Support Board
Date/Time: Tue, 26 Nov 2024 22:31:07 +0000
[Programming Help] - How to check replay status in MessageLog?
View Count: 233
[2023-10-13 16:47:12] |
j4ytr4der_ - Posts: 938 |
I'm trying to track down some specific behavior within my code, and so I'm using the message log to notate when certain spots in the code are reached. Part of what I'm doing relies on the state of replay, and I'm trying to write to the message log when a replay is started, paused, or stopped. Started and stopped seem to work OK, but paused is a problem. It appears that once the pause button has been pushed by the user, all processing ceases until the replay is resumed. Therefore any logging I have after the point I check sc.GetReplayStatusFromChart(sc.ChartNumber), doesn't ever happen unless I manually perform a Recalculation of the chart. I thought I could solve this by forcing a recalculation where my code checks to see if the study is paused, but of course it never gets there so that doesn't work. Only if I do it manually via the menu, does it then push the message to the log. Even performing the pause in code, has the same result: int ReplayStatus = sc.GetReplayStatusFromChart(sc.ChartNumber); sc.PauseChartReplay(sc.ChartNumber); if(ReplayStatus == 2){ // Nothing here will happen unless I manually recalc the chart MessageLogString.Format("Replay paused"); sc.AddMessageToLog(MessageLogString, 0); sc.RecalculateChartImmediate(sc.ChartNumber); return; } Is there any way to check for a paused status and do something if paused? |
To post a message in this thread, you need to log in with your Sierra Chart account: