Jump to content

Need way for user input without duplication


Recommended Posts

Nice implementation crelf. Since Fred said the valid values are from 0-15, simply changing the constant (initial) value going into the shift-register from 0, to say 16 (or any value outside of 0-15) will do the trick. Of course, you will have to change the 'minmum' on the Device Numbers control to 0 (from 1).

-Khalid

Link to comment
Nice implementation crelf. Since Fred said the valid values are from 0-15, simply changing the constant (initial) value going into the shift-register from 0, to say 16 (or any value outside of 0-15) will do the trick. Of course, you will have to change the 'minmum' on the Device Numbers control to 0 (from 1).

-Khalid

Oops - I gotta get better at reading my requirements / functional specification documents :wacko:

Link to comment
just a suggestion:

You may want to move the popup message outside the loop. If you have two or more duplicates you will only have one warning message.

But you can't have more than one duplicate - as soon as a duplicate occurs, it will be detected and the arrays values will be set back to what they were before the duplicate existed.

Link to comment
that's true :yes:

Not sure I understand all that, but I naturally changed the low number to 0 right away. The problem I am having is that I need to read that array periodically... I cannot seem to do that, seemingly because the only time the array is seen is when there is a value change.. So much for my specification document.. sigh... How do I handle that?

Fred

PS. I also hid the up/down buttons, to stop the frustration factor if a duplicate is in the way of the desired setting.. :-)

Link to comment
What do you mean by this exactly. Where do you need to use the array? The best implementation always depends on the details

jimi,

I read that array to determine the order and identity of 5 hardware data acquisition boxes via USB. I do this every few seconds. If I can read the array at will, I can handle the rest.

Fred

Link to comment
jimi,

I read that array to determine the order and identity of 5 hardware data acquisition boxes via USB. I do this every few seconds. If I can read the array at will, I can handle the rest.

Fred

Is there an initialization stage where the user enters these device IDs, and then from then on you check this array (which implies the user can't change it now)? Or, you would like to check the array all the time, even while the user is entering the device IDs?

The devil is indeed in the details.

-Khalid

Link to comment
Is there an initialization stage where the user enters these device IDs, and then from then on you check this array (which implies the user can't change it now)?

YES, that is what I was trying to say... Still learning to communicate...

Currently I have a "maintenance" section of the front panel with this in it.

It will only get changed when a box or chassis changes...

I am guessing I won't have any trouble getting this into my .exe, but have not tried yet.

I have yet to seriously tackle the process of generating an .exe, with all its' details.

My few trials, while successful, made it seem pretty non intuitive to me.

Been focused on getting the program functional first.

It is essentially a data logging application, catering to a special scenario.

tnx,

Fred

Link to comment
jimi,

I read that array to determine the order and identity of 5 hardware data acquisition boxes via USB. I do this every few seconds. If I can read the array at will, I can handle the rest.

Fred

The simplest way (if you want to read it any time) is to create a local variable of the array. (by right clicking on the control, choose 'Create', then Local Variable). Then you can right click and 'Change to Read'.

Link to comment
The simplest way (if you want to read it any time) is to create a local variable of the array. (by right clicking on the control, choose 'Create', then Local Variable). Then you can right click and 'Change to Read'.

Interestingly, I had tried that, but because I had hidden the "index display", the option was greyed out, except at the very top edge of the object... sigh.. as I found out much later. Thanks for the encouragement!

Fred

Link to comment
YES, that is what I was trying to say... Still learning to communicate...

Currently I have a "maintenance" section of the front panel with this in it.

It will only get changed when a box or chassis changes...

I am guessing I won't have any trouble getting this into my .exe, but have not tried yet.

I have yet to seriously tackle the process of generating an .exe, with all its' details.

My few trials, while successful, made it seem pretty non intuitive to me.

Been focused on getting the program functional first.

It is essentially a data logging application, catering to a special scenario.

tnx,

Fred

There's a lot going on here that perhaps you haven't considered. When your app is an exe, how will you store the settings so that they can be recalled later? You probably need to save them to a config file and then read them upon startup. Also, you need to decide on a storage mechanism of your variables that is internal to your program. You can use a local variable as stated to read the array but then how do you pass it throughout your app? Wires and shift registers come to mind but you might want to consider functional globals. Here is a link to a post I made way back that has a working example code of what you might want to do:

http://forums.lavag.org/index.php?s=&s...post&p=8956

Notice that, once the configuration panel is closed, the configuration is available from anywhere in the program via the functional global. If you look inside the functional global you will see a state that handles saving of the configuration. Here is where you would implement your preffered method of configuration saving so oan executable can read it. This design pattern may seem trivial but it works.

Link to comment
There's a lot going on here that perhaps you haven't considered. When your app is an exe, how will you store the settings so that they can be recalled later? You probably need to save them to a config file and then read them upon startup. Also, you need to decide on a storage mechanism of your variables that is internal to your program. You can use a local variable as stated to read the array but then how do you pass it throughout your app? Wires and shift registers come to mind but you might want to consider functional globals. Here is a link to a post I made way back that has a working example code of what you might want to do:

http://forums.lavag.org/index.php?s=&s...post&p=8956

Notice that, once the configuration panel is closed, the configuration is available from anywhere in the program via the functional global. If you look inside the functional global you will see a state that handles saving of the configuration. Here is where you would implement your preffered method of configuration saving so oan executable can read it. This design pattern may seem trivial but it works.

Michael,

You are correct, I had not considered that, thanks for the timely post! :-)

Slowly I learn...

Best regards,

Fred

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.