Manipulate menustrip items from weather class

Added by freemann over 2 years ago

Is it possible (and how) to:
Change the text of the Weather button on the left menu strip from the weather.class ?

I asks this because i change the weather class and internet translation class. The only downsite is that the weather JSON is (very) big (2.21 KB and 40x lines) and takes some time to load AND the translation class is "slow" because of the slow response of the used service. The result is that the Weather form takes upto (in debug mode) 2-3 secs. to load. I now want to manipulate the Weather menu button, and while loading, add the text "loading" to the button.

I found that the menu items are dynamically created, but how do i access these button? By unique name, class.frame.name, or ......


Replies (4)

RE: Manipulate menustrip items from weather class - Added by freemann over 2 years ago

oke, the "problem" is partly solved.

I change the way it retrieves the JSON and parses it in the system.
Where it first live downloaded the JSON and directly parses it into the form.
I seperated the JSON and form into 2 timer processes.

One "process" downloads the JSON and puts it in a db-table, the user can specify(each 3,5,10,20 min) how often he wants to download new weather data. This way its also possible to create a historical weather form (graphs with temp, wind, rain etc).
The second "process" reloads the form every 1 min. and displays the newest weather data from the table.

Now there is only another "problem";
The timer process that downloads,parse and stores the weather data, causes the application to frees for a few seconds.

Could anybody help me to solve this "frees" problem (async process the data, compressed download, optimize JSON parsing etc.)?

RE: Manipulate menustrip items from weather class - Added by rdnzl over 2 years ago

You can send me the code in progress to take a look.
Normally if you do an async fetch it shouldn't block the rest.

The weather menu button is created upon form creation, I don't think it easy to change while running.

RE: Manipulate menustrip items from weather class - Added by freemann over 2 years ago

You've received a invitation for a dropbox-map with the domotiga source.

RE: Manipulate menustrip items from weather class - Added by freemann over 2 years ago

I realized that i made a lot of database changes.
In the dropbox-folder i uploaded a .sql export.

(1-4/4)