06-08-2010 08:02 AM
I am currently working on a program where the user has the ability to create a profile for one of our lab machines to run. When the user selects what parameters they would like, a string indicator shows the user the last input they set followed by a comma. For example, if the user selects which profile they want, and the times they would like to set, the following string would be displayed:
As you can see in the picture above, the profile is updated in the string indicator after every set button is hit. In the event the user makes a mistake, I want them to have the ability to delete the last line that was added.
This is the code I developed so far. The string coming in and leaving is attached to a shift register so it continues to append to the indicator. I tried in this case to count how many lines have been written in the string so far, and I built an array with the current string. Using the delete from array.VI I indexed it to the number of lines that was created so that the last line is deleted. I unfortunately had no luck. Any suggestions?
06-08-2010 08:13 AM
How about assigning each parameter an element in an array? You could convert the array to a string for display, etc. and you could easily replace a parameter if the user makes a mistake by replacing one array element.
06-08-2010 08:48 AM
That's a cheap solution i used for something like that 3-4 years ago.
I used 2- string indicators and used the visible property node to flick between them 2.
Used coordinates to find what text i have highlighted with the mouse to delete it.
You can delet any line of the indicator in that way. I have modified it so you can run it.
Copy the path of 1.txt to load the text file on the file path control
Let me know if that can work in your case
Regards
06-08-2010 09:13 AM - edited 06-08-2010 09:13 AM
I'm sure this is more complex than need be. There is probably a simpler way, but does it work. Yes.
06-08-2010 09:15 AM - edited 06-08-2010 09:16 AM
How About....
06-08-2010 09:24 AM
06-08-2010 12:24 PM
Broken Arrow. I tried your code and it did not work. You need to add another reverse string as shown below:
06-08-2010 12:44 PM
Hey Tbob,
That almost worked. The only issue though is it leaves a null string in its place without moving everything after up one line. Also, if i have a parameter repeating multiple times, it doenst seem to work.
06-08-2010 01:10 PM
Fonzie1104 wrote:Hey Tbob,
That almost worked. The only issue though is it leaves a null string in its place without moving everything after up one line. Also, if i have a parameter repeating multiple times, it doenst seem to work.
I'm confused. If you are deleting the last line, how can there be anything after? What do you mean by a parameter repeating multiple times?
If you look at my example front panel, you will see that the last line is deleted. Isn't this what you asked for?
06-08-2010 01:23 PM - edited 06-08-2010 01:24 PM
tbob wrote:
Fonzie1104 wrote:Hey Tbob,
That almost worked. The only issue though is it leaves a null string in its place without moving everything after up one line. Also, if i have a parameter repeating multiple times, it doenst seem to work.
I'm confused. If you are deleting the last line, how can there be anything after? What do you mean by a parameter repeating multiple times?
If you look at my example front panel, you will see that the last line is deleted. Isn't this what you asked for?
It's due to the fact that your constant doesn't have a comma in the last line. If you add that in, you should be able to reproduce his problem. This is just a guess though, I didn't actually test it to see.