Vivian Meazza wrote: > Josh Babcock wrote > >> Vivian Meazza wrote: >>> Josh >>> >>> >>>> What property can I increment to change the channel on the TACAN? I >> have >>>> a knob on a TACAN instrument that is supposed to either inc/dec the >>>> channel, or the x/y selector, depending on the position of another >>>> switch. I could do this by introducing another property and some nasal >>>> to translate between it and the three existing numeric properties, but >>>> this seems like a bit of a kludge. >>>> >>> You need to set these properties for the individual channels: >>> >>> /instrumentation/tacan/frequencies/selected-channel[1] >>> /instrumentation/tacan/frequencies/selected-channel[2] >>> /instrumentation/tacan/frequencies/selected-channel[3} >>> /instrumentation/tacan/frequencies/selected-channel[4] >>> >>> Note that channel 1 is [1], not [0] as you might have guessed. >>> >>> Vivian >>> >>> >>> >>> >> Yeah, but then I have to write nasal code. If the channel is 099X, there >> is nothing that I can increment to get the right answer. I need to test >> each digit and decide to increment, or zero and carry. It just seems a >> little odd, I would have expected one integer to hold the numbers, and >> one string to hold the X/Y part. >> >> Perhaps I will write some nasal code to live in controls.nas that >> translates between a single number in selected-channel[0] and 1-3. That >> way the existing behavior will be preserved, and there will also be a >> number that can be incremented or decremented between 0 and 126. >> > > It was designed to work with the menu item in which each column is set > independently, and we need a string with which to search the TACAN channel/ > frequency pairing database. > > But I'm not sure what you are trying to. Others have created a TACAN control > panel, so there must be a way to do it. If you would explain in a bit more > detail ... > > Vivian > > > > _______________________________________________ > Flightgear-devel mailing list > Flightgear-devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/flightgear-devel >
I'm modeling a TACAN instrument that has a dial which can be used to increment/decrement the channel number. I want to set up hotspots for that dial. One increments the channel number, one decrements it. Another dial selects another mode where the first dial switches between X and Y channels. http://jrbabcock.home.comcast.net/flightgear/ch53e/tacan.jpg I'm not saying that I can't do it, I'm just saying that I can't do it without implementing some Nasal. It just seems that changing a channel in this manner is a little to basic of a task for plane designers to have to resort to Nasal for. I think I will just make the Nasal code for controls.nas and bind it to all the channel props with a listener. The other option is to create a controls.changeTacanChannel() that has the logic to be able to increment the channel and set the individual channel digit properties. Now that I think about it, the latter sounds like a better way to do things, as it does not require listeners or duplication of data in extra properties. Josh _______________________________________________ Flightgear-devel mailing list Flightgear-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/flightgear-devel