hawkt1 Posted December 14, 2015 Report Posted December 14, 2015 Hello Paul, FSUIPC related but more a question of vb, or more specifically the most productive way to achieve a result. At present I have a textbox.text changed event which then triggers another sub routine. However I want to get rid of the textboxes and detect when values change that I have pulled from fsuipc So for example detect the com value change and then trigger an event Dim nav1bcd As Offset(Of Short) = New FSUIPC.Offset(Of Short)(&H0350)Dim nav1String = ""nav1String = nav1bcd.Value.ToString("X4")I did think a timer to check the value might be the best way but im sure thats not the most resource easy way to do that.Need to monitor upto 40 different variables Any thoughts?
Paul Henty Posted December 15, 2015 Report Posted December 15, 2015 Hi, Your timer loop idea is the only way it can be done. You just have to keep reading the data and then compare the new values against the old ones that you've saved from the previous read. When you detect a change you can either fire your own event(s) or just call the appropriate subroutine(s) directly if you prefer. Monitoring 40 variables like this won't cause you any performance or memory problems at all (you could easily do 400 if you wanted). Paul
hawkt1 Posted December 15, 2015 Author Report Posted December 15, 2015 Thanks Paul for confirming that. I think the best thing to do would be to literally compare the current value against the old value and then call the relevant sub routine to action, something like Dim nav1 = 1 Dim nav1old = "" nav1old = nav1 if nav1 <> nav1old then 'do something endif
Thomas Richter Posted December 15, 2015 Report Posted December 15, 2015 Dim nav1 = 1 Dim nav1old = "" if nav1 <> nav1old then 'do something nav1old = nav1 'to make sure the if statement will work correct endif
buick552 Posted November 24, 2017 Report Posted November 24, 2017 I will ask another question. Lets say we want to check pilots' actions during their flights and seatbelt sign is one of the check items. But the problem with the seatbelt offsets is many different aircraft have different offsets for seatbelt usage. For example, standart seatbelt offset is 341D, pmdg ngx 738 offset is 649F, pmdg 777 ofset is 647B, pmdg 747 offset is 6C2B. And probably other addons are using different offset values also. Is there any way to detect which offset is activated when some switch is turned on or off?
Paul Henty Posted November 24, 2017 Report Posted November 24, 2017 Quote Is there any way to detect which offset is activated when some switch is turned on or off? The only way is to monitor all the possible offsets and see which one changes. There's no way I know of to get the addresses of offsets that change during a period of time. Paul
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now