Announcement

Collapse
No announcement yet.

How to detect when screen needs to be redrawn

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • How to detect when screen needs to be redrawn

    Here is an example.

    Suppose I have a mouse function which draws certain indicators based on where I click on my screen.

    If I scroll extreme to the left in eSignal, if the screen has to redraw itself as I do this, when I scroll back to the right whatever was drawn will have disappeared. The data that I have which contains the bars that should be drawn is saved so access to this is not an issue, but I don't want to have to iterate through each bar bar of the day checking to see if it should be redrawn in my main loop for performance reasons.

    Is there a means to detect when my screen has been invalidated and my objects required to be redrawn again? Perhaps some sort of state that I could check?

  • #2
    Re: How to detect when screen needs to be redrawn

    davewolfs
    If you are referring to the download of additional data which occurs as you scroll left when using a Dynamic Time Template then you could check for BARSTATE_ALLBARS
    Alex


    Originally posted by davewolfs
    Here is an example.

    Suppose I have a mouse function which draws certain indicators based on where I click on my screen.

    If I scroll extreme to the left in eSignal, if the screen has to redraw itself as I do this, when I scroll back to the right whatever was drawn will have disappeared. The data that I have which contains the bars that should be drawn is saved so access to this is not an issue, but I don't want to have to iterate through each bar bar of the day checking to see if it should be redrawn in my main loop for performance reasons.

    Is there a means to detect when my screen has been invalidated and my objects required to be redrawn again? Perhaps some sort of state that I could check?

    Comment


    • #3
      You've run into the "dynamic" mode of esignal. This is because your time template is set to a DYNAMIC setting. If you change it to a STATIC setting (like 3~5 DAYS), then you won't experience this issue.

      In DYNAMIC mode, when you scroll to a point on any chart that needs "more data" from the servers, esignal calls the data from the servers, populates the chart with more data (on the left side) and obviously redraws the chart.

      In STATIC mode, this won't happen because you're forcing a fixed number of days/bars to be drawn.

      The only other solution to this if you've stored the data into an array would be to create a "redraw timer". This would force a redraw every n seconds or when a new tick comes thru on the chart. This would prevent having to redraw it all the time (which can suck up processor speed).

      I suggest you try creating a 5 day time template for your charts and sticking with that for daily operation.

      Let me know if this helps?
      Brad Matheny
      eSignal Solution Provider since 2000

      Comment


      • #4
        Re: Re: How to detect when screen needs to be redrawn

        Originally posted by Alexis C. Montenegro
        davewolfs
        If you are referring to the download of additional data which occurs as you scroll left when using a Dynamic Time Template then you could check for BARSTATE_ALLBARS
        Alex
        Will this flag be set as you scroll left if eSignal has to download more data?

        Comment


        • #5
          That would work. I thought of a way of how I could efficiently access my data. If I keep a count of the bars that should be redrawn then it should be efficient for me to redraw my objects.

          Thanks everyone.

          Originally posted by Doji3333
          You've run into the "dynamic" mode of esignal. This is because your time template is set to a DYNAMIC setting. If you change it to a STATIC setting (like 3~5 DAYS), then you won't experience this issue.

          In DYNAMIC mode, when you scroll to a point on any chart that needs "more data" from the servers, esignal calls the data from the servers, populates the chart with more data (on the left side) and obviously redraws the chart.

          In STATIC mode, this won't happen because you're forcing a fixed number of days/bars to be drawn.

          The only other solution to this if you've stored the data into an array would be to create a "redraw timer". This would force a redraw every n seconds or when a new tick comes thru on the chart. This would prevent having to redraw it all the time (which can suck up processor speed).

          I suggest you try creating a 5 day time template for your charts and sticking with that for daily operation.

          Let me know if this helps?

          Comment

          Working...
          X