How to change the color of the lamp?
Ältere Kommentare anzeigen
I just started converting my program to an app; I am using the one called boreholestability as the frontpage and then app2 as the one with operations which is referred to in boreholestability app
But I am failing to understand why I dont get changed the color of the lamp when the number of salts entered is greater than 3 or less than 2, this is the criterion I have coded for the lamp to change color.
Can anybody help me with that...? :)
1 Kommentar
Voss
am 22 Feb. 2023
Try starting with a simpler app, say an app with one NumericEditField and one lamp. In that app, get the lamp to change color based on the Value of the NumericEditField. Then build up from there to where you want to go, verifying that each incremental change you make works as you expect.
Antworten (1)
Kevin Holly
am 22 Feb. 2023
0 Stimmen
Please see the app attached.
Note, you can set limits on your edit fields. I set this one from 1 to 4.
5 Kommentare
Muazma Ali
am 22 Feb. 2023
Bearbeitet: Muazma Ali
am 22 Feb. 2023
Muazma Ali
am 22 Feb. 2023
Kevin Holly
am 22 Feb. 2023
Please see the screen shot attached to see where to edit the range.
I created a callback on the salt editfield, because I assumed you wanted to update the lamp color when that field was changed and not just when the zone edit field was changed.
The callback for the zone edit field was called "Numer_of_zonesEditFieldValueChanged"
so I just called it with
Numer_of_zonesEditFieldValueChanged(app)
Muazma Ali
am 24 Feb. 2023
Kevin Holly
am 24 Feb. 2023
I noticed the same thing. The callback shown (see screenshot attached) is linked to the zones' edit field. I had to delete the edit field for number of salts and create a new one.
In the app you just attached, app.EnterthenragainTextArea does not exist as a uicomponent. Change the two occurances of "app.EnterthenragainTextArea.Value" to "app.TextArea.Value".
Kategorien
Mehr zu Develop Apps Programmatically finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!