Author Topic: Controls not refreshing  (Read 2382 times)

daveyh

  • Newbie
  • *
  • Posts: 23
    • View Profile
Controls not refreshing
« on: June 15, 2015, 04:13:05 PM »
When the program starts, the waterpump controls text is initially "INVALID VALUE RETURNED" but then updates once the PLC is read via OPC. However, the "INVALID VALUE RETURNED" text remains in the background. Iv'e tried refreshing the control, the control behind it, and the form.

On a related note, I have several pipe fitting in the form, just for graphics, in front of a bar graph. All of the fittings work fine except 3 which don't re-draw after the bar graph is updated. I can force a refresh but then I get an irritating flicker each timer cycle. In the attached pic, the leftmost elbow is forced to redraw else it would disappear like the other two. I have them all brought all the way forward and the bad all the way back.

Unrelated question- is there a property that sets the pen color for the trend chart?


Thanks!

Godra

  • Hero Member
  • *****
  • Posts: 1439
    • View Profile
Re: Controls not refreshing
« Reply #1 on: June 15, 2015, 07:15:59 PM »
You could check the last post in this topic for your unrelated trend chart question:

http://advancedhmi.com/forum/index.php?topic=650.0

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5270
    • View Profile
    • AdvancedHMI
Re: Controls not refreshing
« Reply #2 on: June 15, 2015, 09:07:10 PM »
One of the downsides to the WinForm base controls is that they do not like to be overlapped. When your BarLevel erases the pipe fitting it will not come back because refreshing is disabled exactly for the purpose you discovered, heavy flickering.

The BasicTrendChart is hard coded to be a Blue line. I wouldn't invest too much into the BasicTrendChart because a new chart called ChartBySampling is in the works. It is tremendously more flexible. It should be in the next version within a week. It is similar to the ChartByArray in the version 3.98p, but plots a line from a single value similar to the BasicTrendChart

daveyh

  • Newbie
  • *
  • Posts: 23
    • View Profile
Re: Controls not refreshing
« Reply #3 on: June 16, 2015, 11:24:37 AM »
The thing that is confusing is that 5 of the 8 pipes (the straight sections) and the 3 pumps work perfectly. They don't visibly get erased nor re-drawn; they just stay solid and visible as the bar graph changes behind them.

For the pump text, even if I move the pump so that there's nothing behind it, the text is still persistent.

The new chart sounds exciting! Thanks for working on it. Unfortunately, having garbled text on the pumps is a showstopper so the project is dead if that's not resolvable :-( Is it possible to turn the text off, including the error messages?

Thanks for all that you do!

Davey

daveyh

  • Newbie
  • *
  • Posts: 23
    • View Profile
Re: Controls not refreshing
« Reply #4 on: June 16, 2015, 11:48:02 AM »
Setting SuppressErrorDisplay to True and then not programmatically changing the text 'works'. :-/

The tank level (the bar graph) doesn't change that often so I can probably live with the occasional flicker.

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5270
    • View Profile
    • AdvancedHMI
Re: Controls not refreshing
« Reply #5 on: June 16, 2015, 11:56:54 AM »
You beat me to it. I was just about to say to set SuppressErrorMessage

I will play around with the pipe fittings to see why one repaints, but another doesn't

daveyh

  • Newbie
  • *
  • Posts: 23
    • View Profile
Re: Controls not refreshing
« Reply #6 on: June 16, 2015, 06:47:03 PM »
Another odd tidbit of info...when I had the trackbar on the main screen with the bargraph and refreshing the pipes with a 1-sec timer, the re-draws were horrible- taking fractions of a second. When I moved the trackbar to a separate 'demo screen' form, the redraws are now not detectable. I still have to do refreshes, but there nary a flicker of the pipes being redrawn.

This didn't affect the pump text not re-drawing, but as long as i can keep the test from changing it's not an issue.

Thanks!