Asotop Posted February 28, 2014 Report Share Posted February 28, 2014 (edited) Hello. I'm currently working on a bachelor assignment and I've encountered a problem. As you can see by the picture the only column and i want to control is the "Control" column. Im sure of MCL is even the best solution to what im trying to achieve. In the code i've made a event handler, so i was atleast able to edit the items in the selected cell. Would appreciate any help. Regards Asotop MCL test.vi Edited February 28, 2014 by Asotop Quote Link to comment
Tim_S Posted February 28, 2014 Report Share Posted February 28, 2014 As a note, clicking the stop button won't stop your VI until some other event occurs. If I understand what you're trying to do, you want to cause any double-clicks on a row to edit the "Control" column? If that's the case, you can change the column of the cell position to always be the control column. There is a little more than that, so make sure to read the help for the Edit Position property. Quote Link to comment
Asotop Posted February 28, 2014 Author Report Share Posted February 28, 2014 (edited) Thanks, i will check it out. By the way, do you think an object oriented approach would be better? I have to handle a large amount of valves / sensors etc. Edited February 28, 2014 by Asotop Quote Link to comment
hooovahh Posted February 28, 2014 Report Share Posted February 28, 2014 Attached is what I think you want. It has the close fix mentioned by Tim. It also handles a close to stop as well. Basically I added a Mouse Down? event and then discard the click if it was in a column other then the Control Value. I still set the Value Signaling event so that when a row is clicked the value changes and gets the data from that set and does the string conversion you already had. I also set the listbox to highlight the entire row. Visually I like this better. I also changed the data type back to a scalar because you only allowed them to select 1 item anyway. MCL test Hooovahh Edit.vi Quote Link to comment
Asotop Posted February 28, 2014 Author Report Share Posted February 28, 2014 Nice It looked really nice, how did you get the execution to become like that by the way? Quote Link to comment
hooovahh Posted February 28, 2014 Report Share Posted February 28, 2014 Without knowing the scope of the application it's hard to say if an OO approach is necessary. What question by the way do you have about the "Execution"? Be more specific what feature you want to know how it was done. Quote Link to comment
Asotop Posted February 28, 2014 Author Report Share Posted February 28, 2014 Normally when you run the labview file, all the grid lines show in the background. But in your code it doesn't show. Quote Link to comment
hooovahh Posted February 28, 2014 Report Share Posted February 28, 2014 I changed the Window appearance first. Hit CTRL + I or go to the VI Properties window, then I went to Window Appearance and selected Dialog, then hit customize and made the window non-modal (default), and allowed minimizing the window. Then I colored the panel by bringing up the paint tool and selecting the System Color "Window" which is the system color that a normal Windows program will have as a background. These steps help make the UI more Windows like. Quote Link to comment
Asotop Posted March 5, 2014 Author Report Share Posted March 5, 2014 (edited) Hey again. Almost done with the program now, the only problem now is that you have to click once in order to write the value and one more time to set it. If i click once and then write the value, and click at another row, the error handling will not execute. What event should i chose in order to fix this? Regards Asotop Hydraulic Pressure units.vi Edited March 5, 2014 by Asotop Quote Link to comment
Asotop Posted March 5, 2014 Author Report Share Posted March 5, 2014 To rephrase it: I want the value to be updated when I click an other row. Quote Link to comment
hooovahh Posted March 5, 2014 Report Share Posted March 5, 2014 I'm having some weirdness with the edit cell position selecting the 0,0 cell when it shouldn't so I won't upload what I have. But what you need to do is add an event to the event structure which is "Edit Cell?". Here you can get the String which is the new string value of the cell you edit. Then convert that to a number then back to a string. This is a much simpler way of getting a valid number. Then write that back to the String on the right side of the event structure. In that case you should also fire another Value Signaling event causing the output values to be recalculated with the new value. Also Decimal Digit? function takes a string, not a single char character. You can use this to validate the input as well. Quote Link to comment
Asotop Posted March 5, 2014 Author Report Share Posted March 5, 2014 I've tried for hours now, still cant get it to work :/ Quote Link to comment
hooovahh Posted March 6, 2014 Report Share Posted March 6, 2014 I've tried for hours now, still cant get it to work :/ Attached is what I was describing. Hydraulic Pressure units Hooovahh Edit2.vi 1 Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.