The Steem blockchain was upgraded earlier today. You may experience trouble posting and transacting while the new bandwidth system stabilizes. Read more here.

ExPing - Fixed the main function and interface

in utopian-io •  6 months ago

Intro

After the fundamental changes I've done to the programs main loop, it's time to fix the main function of the program, the new changes are added with easier fine tuning and adjust-ability as well as inclusion of additional functions to the program in mind.

New/changed Features

  • Interface elements overhaul

The interface elements such as labels that show the ping delays are now created at the start, this change allows the fine tuning their placement and text alignment that was not easily possible in the old code, with the new changes the program looks much better, but the changes are not just cosmetic, it goes hand to hand with the changes to the ping function to solve a major problem in the old code.

Untitled-1.jpg

to simplify the process and easier changes in future, the labels are created inside two loops:
Screenshot_2.jpg

  • The revamped ping function

The ping function now updates the pre-created labels text and color one by one cycling through them, in the old code each ping return was shown with a newly created label that was very taxing on the computers resources, the new code is much more compact and the memory overflow problem in long use sessions is solved.
since the position of each label is not calculated by each iteration of the ping, the variables holding the x and y position data are removed as well.

Animation 50.gif

  • The empty space

I reduced the number of labels that show on the screen to open up some space underneath, I have two use for this empty space in mind, show a bigger text with calculated average ping delay, or add buttons for additional functions I'm planning to add to the program, I know it's too early to ask, but your input on the matter would be appreciated.


In addition to the code changes, I added some instructions to the readme file and updated the executable file as well as adding the old version back just in case.
In

Github Repo || Linked Pull Request 1 || Linked Pull Request 2



Posted on Utopian.io - Rewarding Open Source Contributors

Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE STEEM!
Sort Order:  

Your contribution cannot be approved because it is too small contribution in Dev Category as compared to other contributions. Please try to improve the contribution by adding more feature and then create a contribution.

You can contact us on Discord.
[utopian-moderator]

·

Hey @codingdefined, I just gave you a tip for your hard work on moderation. Upvote this comment to support the utopian moderators and increase your future rewards!