Jump to content
Sign in to follow this  
Engjell Berisha

Need a second pair of eyes

Recommended Posts

Ok I had it working perfectly then I was adding stuff to it and the COM Swamp function and all the COM INC/DEC FRAC/WHOLE codes won't work at all. I get a arrows showing up in the correct place but they wont do anything. I tried redoing the entire gauge from scratch twice and nothing seems to work so far, I'm hoping that I've overlooked some small detail that someone could spot for me.

<Gauge Name="Radio-Control" Author="Engjell Berisha"><Image Name="Radio-Control.bmp" ImageSizes="384,242"/><Element>   <Position X="0" Y="0"/>      <Visible>(L:PWR-MASTER,bool) || (L:APU-PWR,bool) || (L:EXT-PWR, bool) ||</Visible>      <!--==================================COM==================================-->      <!--==================================COM==================================-->      <!--==================================COM==================================-->      <!--==================================COM==================================-->   <Element>      <Visible>(L:Radio-Control-1,enum) 0 ==</Visible>      <Element>        <Position X="60" Y="35"/>	<Visible>(A:CIRCUIT GENERAL PANEL ON,bool)</Visible>	<Text X="175" Y="40" Length="12" Font="IRS" Color="#cccec9" Adjust="Center" VerticalAdjust="Center" Fixed="Yes">	<String>%((A:COM1 ACTIVE FREQUENCY, Megahertz) abs)%!6.2f!</String>	</Text>      </Element>      <Element>	<Position X="235" Y="35"/>	<Visible>(A:CIRCUIT GENERAL PANEL ON,bool)</Visible>        <Text X="175" Y="40" Length="12" Font="IRS" Color="#cccec9" Adjust="Center" VerticalAdjust="Center" Multiline="No" Fixed="YES">	<String>%((A:COM1 STANDBY FREQUENCY, Megahertz) abs)%!6.2f!</String>	</Text>      </Element>      </Element>      <!--==================================NAV==================================-->      <!--==================================NAV==================================-->      <!--==================================NAV==================================-->      <!--==================================NAV==================================-->   <Element>      <Visible>(L:Radio-Control-1,enum) 1 ==</Visible>      <Element>        <Position X="60" Y="35"/>	<Visible>(A:CIRCUIT GENERAL PANEL ON,bool)</Visible>	<Text X="175" Y="40" Length="12" Font="IRS" Color="#cccec9" Adjust="Center" VerticalAdjust="Center" Fixed="Yes">	<String>%((A:NAV1 ACTIVE FREQUENCY, Megahertz) abs)%!4.2f!</String>	</Text>      </Element>      <Element>	<Position X="235" Y="35"/>	<Visible>(A:CIRCUIT GENERAL PANEL ON,bool)</Visible>        <Text X="175" Y="40" Length="12" Font="IRS" Color="#cccec9" Adjust="Center" VerticalAdjust="Center" Multiline="No" Fixed="YES">	<String>%((A:NAV1 STANDBY FREQUENCY, Megahertz) abs)%!4.2f!</String>	</Text>      </Element>      </Element>      <!--==================================ADF==================================-->      <!--==================================ADF==================================-->      <!--==================================ADF==================================-->      <!--==================================ADF==================================-->   <Element>      <Visible>(L:Radio-Control-1,enum) 2 ==</Visible>      <Element>        <Position X="60" Y="35"/>	<Visible>(A:CIRCUIT GENERAL PANEL ON,bool)</Visible>	<Text X="175" Y="40" Length="12" Font="IRS" Color="#cccec9" Adjust="Center" VerticalAdjust="Center" Fixed="Yes">	<String>%((A:ADF1 ACTIVE FREQUENCY, KHz) abs)%!4.1f!</String>	</Text>      </Element>      <Element>	<Position X="235" Y="35"/>	<Visible>(A:CIRCUIT GENERAL PANEL ON,bool)</Visible>        <Text X="175" Y="40" Length="12" Font="IRS" Color="#cccec9" Adjust="Center" VerticalAdjust="Center" Multiline="No" Fixed="YES">	<String>%((A:ADF1 STANDBY FREQUENCY, KHz) abs)%!4.1f!</String>	</Text>      </Element>      </Element>   </Element>  <Mouse>      <!--=================PAGE-CNTRL=================-->  <Area Left="29" Right="46" Top="143" Bottom="166">     <Click>0 (>L:Radio-Control-1, enum)</Click>     <Cursor Type="Hand"/>  </Area>  <Area Left="267" Right="284" Top="143" Bottom="166">     <Click>1 (>L:Radio-Control-1, enum)</Click>     <Cursor Type="Hand"/>  </Area>      <!--=================XFER=================-->  <Area Left="21" Right="35" Top="45" Bottom="91">    <Cursor Type="Hand"/>    <Click Repeat="No">(L:Radio-Control-1,enum) 0 == if{ 0 (>K:COM_STBY_RADIO_SWAP) }</Click>  </Area>  <Area Left="21" Right="35" Top="45" Bottom="91">    <Cursor Type="Hand"/>    <Click Repeat="No">(L:Radio-Control-1,enum) 1 == if{ 0 (>K:NAV1_RADIO_SWAP) }</Click>  </Area>      <!--=================FREQ-CNTRL=================-->  <Area Left="140" Right="157" Top="192" Bottom="214">   <Cursor Type="DownArrow"/>   <Click Repeat="Yes">(L:Radio-Control-1,enum) 0 == if{ 0 (>K:COM_RADIO_WHOLE_DEC) }</Click>  </Area>  <Area Left="158" Right="175" Top="192" Bottom="214">   <Cursor Type="DownArrow"/>   <Click Repeat="Yes">(L:Radio-Control-1,enum) 0 == if{ 0 (>K:COM_RADIO_FRACT_DEC) }</Click>  </Area>  <Area Left="158" Right="175" Top="170" Bottom="190">   <Cursor Type="UpArrow"/>   <Click Repeat="Yes">(L:Radio-Control-1,enum) 0 == if{ 0 (>K:COM_RADIO_FRACT_INC) }</Click>  </Area>  <Area Left="140" Right="157" Top="170" Bottom="190">   <Cursor Type="UpArrow"/>   <Click Repeat="Yes">(L:Radio-Control-1,enum) 0 == if{ 0 (>K:COM_RADIO_WHOLE_INC) }</Click>  </Area>  <Area Left="140" Right="157" Top="192" Bottom="214">   <Cursor Type="DownArrow"/>   <Click Repeat="Yes">(L:Radio-Control-1,enum) 1 == if{ 0 (>K:NAV1_RADIO_WHOLE_DEC) }</Click>  </Area>  <Area Left="158" Right="175" Top="192" Bottom="214">   <Cursor Type="DownArrow"/>   <Click Repeat="Yes">(L:Radio-Control-1,enum) 1 == if{ 0 (>K:NAV1_RADIO_FRACT_DEC) }</Click>  </Area>  <Area Left="158" Right="175" Top="170" Bottom="190">   <Cursor Type="UpArrow"/>   <Click Repeat="Yes">(L:Radio-Control-1,enum) 1 == if{ 0 (>K:NAV1_RADIO_FRACT_INC) }</Click>  </Area>  <Area Left="140" Right="157" Top="170" Bottom="190">   <Cursor Type="UpArrow"/>   <Click Repeat="Yes">(L:Radio-Control-1,enum) 1 == if{ 0 (>K:NAV1_RADIO_WHOLE_INC) }</Click>  </Area>  </Mouse>   <copyright>©2009 Engjell Berisha</copyright></Gauge>

I appreciate any help you all can offer!


Good Day,

Engjell Berisha

 

Angel-Simulations-Small.png

Share this post


Link to post
Share on other sites

The very first thing I'd try is changing the name of your variable to not use the reserved character "-"...(L:Radio-Control-1,enum) is likely not being recognized as a valid name due to the minus character...try something like this instead:

(L:Radio Control 1,enum)   // variable names may contain spaces!or this:(L:RadioControl1,enum)  or this:(L:Radio_Control_1,enum)

Also, you cannot have two mouse <Areas> defined using the same coordinates. You will need to combine the two into a single entry like this:

<Area Left="21" Right="35" Top="45" Bottom="91">	 <Cursor Type="Hand"/>	 <Click Repeat="No">			(L:Radio_Control_1,enum) 0 == 				 if{ 						 0 (>K:COM_STBY_RADIO_SWAP) 				   }				 els{						 0 (>K:NAV1_RADIO_SWAP) 					  }	 </Click></Area>

or, if your L:variable,enum can be something besides zero or one, then use this format instead to be precise:

<Area Left="21" Right="35" Top="45" Bottom="91">	 <Cursor Type="Hand"/>	 <Click Repeat="No">			(L:Radio_Control_1,enum) 0 == 				 if{ 						 0 (>K:COM_STBY_RADIO_SWAP) 				   }			(L:Radio_Control_1,enum) 1 == 				 if{						 0 (>K:NAV1_RADIO_SWAP) 					}	 </Click></Area>


Fr. Bill    

AOPA Member: 07141481 AARP Member: 3209010556


     Avsim Board of Directors | Avsim Forums Moderator

Share this post


Link to post
Share on other sites

Good it working thx to you, pointed me in the right direction should have done it that way from the begining - lesson for next time. Appreciate the help, thx! :( Here's the finished code incase you were wondering - I add a few other things, all work fine.

<Gauge Name="Radio-Control" Author="Engjell Berisha"><Image Name="Radio-Control.bmp" ImageSizes="384,242"/><Element>   <Position X="0" Y="0"/>      <Visible>(L:PWR-MASTER,bool) || (L:APU-PWR,bool) || (L:EXT-PWR, bool) ||</Visible>      <!--==================================COM==================================-->      <!--==================================COM==================================-->      <!--==================================COM==================================-->      <!--==================================COM==================================-->   <Element>      <Visible>(L:Radio-Control-1,enum) 0 ==</Visible>      <Element>        <Position X="60" Y="35"/>	<Visible>(A:CIRCUIT GENERAL PANEL ON,bool)</Visible>	<Text X="175" Y="40" Length="12" Font="IRS" Color="#cccec9" Adjust="Center" VerticalAdjust="Center" Fixed="Yes">	<String>%((A:COM1 ACTIVE FREQUENCY, Megahertz) abs)%!6.2f!</String>	</Text>      </Element>      <Element>	<Position X="235" Y="35"/>	<Visible>(A:CIRCUIT GENERAL PANEL ON,bool)</Visible>        <Text X="175" Y="40" Length="12" Font="IRS" Color="#cccec9" Adjust="Center" VerticalAdjust="Center" Multiline="No" Fixed="YES">	<String>%((A:COM1 STANDBY FREQUENCY, Megahertz) abs)%!6.2f!</String>	</Text>      </Element>      </Element>      <!--==================================NAV==================================-->      <!--==================================NAV==================================-->      <!--==================================NAV==================================-->      <!--==================================NAV==================================-->   <Element>      <Visible>(L:Radio-Control-1,enum) 1 ==</Visible>      <Element>        <Position X="60" Y="35"/>	<Visible>(A:CIRCUIT GENERAL PANEL ON,bool)</Visible>	<Text X="175" Y="40" Length="12" Font="IRS" Color="#cccec9" Adjust="Center" VerticalAdjust="Center" Fixed="Yes">	<String>%((A:NAV1 ACTIVE FREQUENCY, Megahertz) abs)%!4.2f!</String>	</Text>      </Element>      <Element>	<Position X="235" Y="35"/>	<Visible>(A:CIRCUIT GENERAL PANEL ON,bool)</Visible>        <Text X="175" Y="40" Length="12" Font="IRS" Color="#cccec9" Adjust="Center" VerticalAdjust="Center" Multiline="No" Fixed="YES">	<String>%((A:NAV1 STANDBY FREQUENCY, Megahertz) abs)%!4.2f!</String>	</Text>      </Element>      <Element>	<Position X="175" Y="75"/>	<Visible>(A:CIRCUIT GENERAL PANEL ON,bool)</Visible>        <Text X="175" Y="40" Length="12" Font="IRS" Color="#cccec9" Adjust="Center" VerticalAdjust="Center" Multiline="No" Fixed="YES">	<String>%((A:NAV1 OBS, degrees))%!3d!</String>	</Text>      </Element>     <Element>      <Position X="359" Y="45"/>       <Select>        <Value>(A:NAV1 SOUND,bool)</Value>        <Case Value="1">          <Image Name="Radio-Control-Ident.bmp" Bright="Yes"/>        </Case>       </Select>     </Element>      </Element>      <!--==================================ADF==================================-->      <!--==================================ADF==================================-->      <!--==================================ADF==================================-->      <!--==================================ADF==================================-->   <Element>      <Visible>(L:Radio-Control-1,enum) 2 ==</Visible>      <Element>        <Position X="60" Y="35"/>	<Visible>(A:CIRCUIT GENERAL PANEL ON,bool)</Visible>	<Text X="175" Y="40" Length="12" Font="IRS" Color="#cccec9" Adjust="Center" VerticalAdjust="Center" Fixed="Yes">	<String>%((A:ADF1 ACTIVE FREQUENCY, KHz) abs)%!4.1f!</String>	</Text>      </Element>     <Element>      <Position X="359" Y="45"/>       <Select>        <Value>(A:ADF SOUND,bool)</Value>        <Case Value="1">          <Image Name="Radio-Control-Ident.bmp" Bright="Yes"/>        </Case>       </Select>     </Element>      </Element>      <!--==================================XPN==================================-->      <!--==================================XPN==================================-->      <!--==================================XPN==================================-->      <!--==================================XPN==================================-->   <Element>      <Visible>(L:Radio-Control-1,enum) 3 ==</Visible>      <Element>        <Position X="60" Y="35"/>	<Visible>(A:CIRCUIT GENERAL PANEL ON,bool)</Visible>	<Text X="175" Y="40" Length="12" Font="IRS" Color="#cccec9" Adjust="Center" VerticalAdjust="Center" Fixed="Yes">	<String>%((A:TRANSPONDER1 CODE,enum))%!4d!</String>	</Text>      </Element>      </Element>   </Element>  <Mouse>      <!--=================PAGE-CNTRL=================-->  <Area Left="29" Right="46" Top="143" Bottom="166">     <Click>0 (>L:Radio-Control-1, enum)</Click>     <Cursor Type="Hand"/>  </Area>  <Area Left="267" Right="284" Top="143" Bottom="166">     <Click>1 (>L:Radio-Control-1, enum)</Click>     <Cursor Type="Hand"/>  </Area>  <Area Left="300" Right="317" Top="174" Bottom="197">     <Click>2 (>L:Radio-Control-1, enum)</Click>     <Cursor Type="Hand"/>  </Area>  <Area Left="29" Right="46" Top="174" Bottom="197">     <Click>3 (>L:Radio-Control-1, enum)</Click>     <Cursor Type="Hand"/>  </Area>      <!--=================XFER=================-->  <Area Left="21" Right="35" Top="45" Bottom="91">    <Cursor Type="Hand"/>    <Click Repeat="No"> (L:Radio-Control-1,enum) 0 == if{ 0 (>K:COM_STBY_RADIO_SWAP) } (L:Radio-Control-1,enum) 1 == if{ 0 (>K:NAV1_RADIO_SWAP) }    </Click>  </Area>      <!--=================IDENT=================-->  <Area Left="359" Right="371" Top="45" Bottom="91">    <Cursor Type="Hand"/>    <Click Repeat="No"> (L:Radio-Control-1,enum) 1 == if{ 0 (>K:RADIO_VOR1_IDENT_TOGGLE) } (L:Radio-Control-1,enum) 2 == if{ 0 (>K:RADIO_ADF_IDENT_TOGGLE) }    </Click>  </Area>      <!--=================FREQ-CNTRL=================-->  <Area Left="140" Right="157" Top="192" Bottom="214">   <Cursor Type="DownArrow"/>   <Click Repeat="Yes"> (L:Radio-Control-1,enum) 0 == if{ 0 (>K:COM_RADIO_WHOLE_DEC) } (L:Radio-Control-1,enum) 1 == if{ 0 (>K:NAV1_RADIO_WHOLE_DEC) } (L:Radio-Control-1,enum) 2 == if{ 0 (>K:ADF1_WHOLE_DEC) } (L:Radio-Control-1,enum) 3 == if{ 0 (>K:XPNDR_100_DEC) }   </Click>  </Area>  <Area Left="158" Right="175" Top="192" Bottom="214">   <Cursor Type="DownArrow"/>   <Click Repeat="Yes"> (L:Radio-Control-1,enum) 0 == if{ 0 (>K:COM_RADIO_FRACT_DEC) } (L:Radio-Control-1,enum) 1 == if{ 0 (>K:NAV1_RADIO_FRACT_DEC) } (L:Radio-Control-1,enum) 2 == if{ 0 (>K:ADF1_RADIO_TENTHS_DEC) } (L:Radio-Control-1,enum) 3 == if{ 0 (>K:XPNDR_1_DEC) }   </Click>  </Area>  <Area Left="158" Right="175" Top="170" Bottom="190">   <Cursor Type="UpArrow"/>   <Click Repeat="Yes"> (L:Radio-Control-1,enum) 0 == if{ 0 (>K:COM_RADIO_FRACT_INC) } (L:Radio-Control-1,enum) 1 == if{ 0 (>K:NAV1_RADIO_FRACT_INC) } (L:Radio-Control-1,enum) 2 == if{ 0 (>K:ADF1_RADIO_TENTHS_INC) } (L:Radio-Control-1,enum) 3 == if{ 0 (>K:XPNDR_10_INC) }   </Click>  </Area>  <Area Left="140" Right="157" Top="170" Bottom="190">   <Cursor Type="UpArrow"/>   <Click Repeat="Yes"> (L:Radio-Control-1,enum) 0 == if{ 0 (>K:COM_RADIO_WHOLE_INC) } (L:Radio-Control-1,enum) 1 == if{ 0 (>K:NAV1_RADIO_WHOLE_INC) } (L:Radio-Control-1,enum) 2 == if{ 0 (>K:ADF1_WHOLE_INC) } (L:Radio-Control-1,enum) 3 == if{ 0 (>K:XPNDR_1000_INC) }   </Click>  </Area>      <!--=================COURSE-CNTRL=================-->  <Area Left="210" Right="225" Top="170" Bottom="205">   <Cursor Type="DownArrow"/>   <Click Repeat="Yes">(L:Radio-Control-1,enum) 1 == if{ 0 (>K:VOR1_OBI_DEC) }</Click>  </Area>  <Area Left="226" Right="240" Top="170" Bottom="205">   <Cursor Type="UpArrow"/>   <Click Repeat="Yes">(L:Radio-Control-1,enum) 1 == if{ 0 (>K:VOR1_OBI_INC) }</Click>  </Area>  </Mouse>   <copyright>©2009 Engjell Berisha</copyright></Gauge>


Good Day,

Engjell Berisha

 

Angel-Simulations-Small.png

Share this post


Link to post
Share on other sites

I'm delighted you got it sorted out...Even though it is apparently not a problem, I'd still advise not using math characters such as "-" (minus sign) in variable names... :(


Fr. Bill    

AOPA Member: 07141481 AARP Member: 3209010556


     Avsim Board of Directors | Avsim Forums Moderator

Share this post


Link to post
Share on other sites

Old habits persist, I can't promise anything but I am going to try. I am very comfortable using dashes rather than anything else, I know you can us spaces and underscores but dashes come more naturally.The thing is I've coded so much using dashes, and particularly in this panel I bet most every variable I've used dashes in. I've never had a problem from it although that doesn't mean I wont have one. Thx once again! :(


Good Day,

Engjell Berisha

 

Angel-Simulations-Small.png

Share this post


Link to post
Share on other sites
The thing is I've coded so much using dashes, and particularly in this panel I bet most every variable I've used dashes in. I've never had a problem from it although that doesn't mean I wont have one. Thx once again! :(
One wonders then, where such a habit developed... :( In every real programming language with which I'm familiar, the use of a reserved character in a variable name is strictly forbidden...In C for example, Radio-Control-1 would be interpreted by the compiler as an instruction to subtract the value of Control from the value of Radio, then subtract 1 from the result! :(

Fr. Bill    

AOPA Member: 07141481 AARP Member: 3209010556


     Avsim Board of Directors | Avsim Forums Moderator

Share this post


Link to post
Share on other sites

Yea I see how that would be interpreted.I guess it developed with me naming files on my computer such as pictures and stuff, I always do it, put a dash in something, if the dash isn't there I feel like something is missing and look it over a hundred times as if something is wrong.Especially with aircraft I can never write "EMB120" rather "EMB-120" just seems more logical to me. Although I have to stop using it in gauge, I believe I've even used it in C programing and haven't had any problem - not sure I'll check. I guarenteee you the computer is dazzed by that. :(


Good Day,

Engjell Berisha

 

Angel-Simulations-Small.png

Share this post


Link to post
Share on other sites

Well, not all compilers would whine about it. Come to think of it, unless you explicitly declared each 'part' of a hypenated name as a unique variable, the compiler would throw an error anyway... :(


Fr. Bill    

AOPA Member: 07141481 AARP Member: 3209010556


     Avsim Board of Directors | Avsim Forums Moderator

Share this post


Link to post
Share on other sites

As XML vars are not "true" variables, some special characters can be used in their names without trouble -dashes, spaces,underscores, etc. Anyway I agree it's a better practice to avoid using dashes, which may lead to confusion when working in other programming languages, like C/C++ etc.Tom

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Tom Allensworth,
    Founder of AVSIM Online


  • Flight Simulation's Premier Resource!

    AVSIM is a free service to the flight simulation community. AVSIM is staffed completely by volunteers and all funds donated to AVSIM go directly back to supporting the community. Your donation here helps to pay our bandwidth costs, emergency funding, and other general costs that crop up from time to time. Thank you for your support!

    Click here for more information and to see all donations year to date.
×
×
  • Create New...