Skip to content
View in the app

A better way to browse. Learn more.

The AVSIM Community

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Duplicate values from one part

Featured Replies

fs9 - FSDS351 - Win XP I am doing the VC of a 4 piston engined aircraft. The Mixture levers control two engines each, left and right pairs. I have the cockpit view XML gauges working properly as I can set both the (K:..._SET ) values in the same line of code with a simple 'd' [duplicate] command.My problem is that I cannot do a similar thing in the 'MakeMDL <part>' gauge, something like this:-

	<mouserect>		<cursor>Hand</cursor>		<help_id>HELPID_GAUGE_THROTTLE_MIXTURE</help_id>		<tooltip_id>TOOLTIPTEXT_THROTTLE_MIXTURE_PERCENT</tooltip_id>		<mouse_flags>LeftSingle+LeftDrag</mouse_flags>		<callback_dragging>			<variable>GENERAL ENG MIXTURE LEVER POSITION:1</variable>			<units>percent</units>			<scale>163.84</scale>			<yscale>163.84</yscale>			<minvalue>4424</minvalue>			<maxvalue>16384</maxvalue>			d			<event_id>MIXTURE1_SET</event_id>			<event_id>MIXTURE2_SET</event_id>		</callback_dragging>	</mouserect>

I have a <callback_code> routine that looked promising but after four days of tweaking I am unable to get an acceptable outputI cannot use an invisible lever since there is another pair of control levers that do a similar thing but for the outboard and inboard engines.Ted.

  • Moderator

You cannot use two <EventID>s in a single mouse rectangle. You need to use <callback_code> instead:

		<callback_dragging>			<variable>GENERAL ENG MIXTURE LEVER POSITION:1</variable>			<units>percent</units>			<scale>163.84</scale>			<yscale>163.84</yscale>			<minvalue>4424</minvalue>			<maxvalue>16384</maxvalue>			<callback_code>				  (>K:MIXTURE1_SET)				  (>K:MIXTURE2_SET)			</callback_code>		</callback_dragging>

Fr. Bill    

AOPA Member: 07141481 AARP Member: 3209010556


     Avsim Board of Directors | Avsim Forums Moderator

Why not store the value into s0 before assigning it to the first event_id and re-load it with l0 before the second event? Probably the first event_id kills the stack completely, so your duplication would be gone as well... But Bill is right, callback_code is more powerful for this kind of thing.

  • Author

Thanks for the fast reply.

You cannot use two <EventID>s in a single mouse rectangle. You need to use <callback_code> instead:
		<callback_dragging>			<variable>GENERAL ENG MIXTURE LEVER POSITION:1</variable>			<units>percent</units>			<scale>163.84</scale>			<yscale>163.84</yscale>			<minvalue>4424</minvalue>			<maxvalue>16384</maxvalue>			<callback_code>				  (>K:MIXTURE1_SET)				  (>K:MIXTURE2_SET)			</callback_code>		</callback_dragging>

Can the <callback_code> tags be wrapped in <callback_dragging> tags ?I have had a look in the default MakeMdl.parts file but there is no part like that to examine.I have tried to get the value that is passed to the <event_id> to be passed into the <callback_code> but nothing happens. The cursor appears with the usual grabbing action but thats all.I am now trying to get a proper dragging action using a simple <callback_code> in the <mouserect> section.
  • Author

I abandoned the <callback_dragging> route and finally had some success with this cunning code. 'LULU' is my test modelNote that I needed the minimum mixture to be 27% but it was developed using 0% as the minimum. Just change the 0.27 and 4424 values to 0.

<part>	<name>lever_double_mixture</name>	<!-- LULU -->		<animation>		<rotation>Y</rotation>		<parameter>			<code>				(A:GENERAL ENG MIXTURE LEVER POSITION:2,part) 0.27 max 1 min 100 *			</code>		</parameter>	</animation>	<mouserect>		<cursor>Hand</cursor>		<tooltip_text>Port mixtures</tooltip_text>		<mouse_flags>LeftSingle+LeftDrag</mouse_flags>		<callback_code>			(M:Event) 'LeftSingle' scmp 0 != 				if{ (L:Pmixref, position) 0 !=					if{ (L:Pmixref, position) (M:Y) - 400 / /-/ (A:General eng mixture lever position:2,part) + 						16384 * int 16384 min 4424 max d (>K:MIXTURE1_SET) (>K:MIXTURE2_SET) }					   }				(M:Y) (>L:Pmixref, position)		 </callback_code> 	</mouserect></part>

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.