• Content Count

  • Joined

  • Last visited

Community Reputation

0 Neutral

Profile Information

  • Gender

Flight Sim Profile

  • Commercial Member
  • Online Flight Organization Membership
  • Virtual Airlines
  1. Hi all,C++ Airspeed Indicator and Airspeed Bug Mouse problem:The Airspeed Bug needle and mouse function is working, the problem is that I have not been able to limit the values controlled by the mouse, which despite all efforts still varies between 0 to 990 knots. Relevant code://-- (main .c file) -->MODULE_VAR airspeed_bug = {AUTOPILOT_AIRSPEED_HOLD_VAR};//-- (asi.c file -->MOUSE_FUNCTION asi_speed_up_set; //airspeed bug setMOUSE_FUNCTION asi_speed_down_set; //airspeed bug setMOUSE_BEGIN( asi_mouse_rect, 0, 0, 0 ) MOUSE_CHILD_FUNCT( 283, 24, 30, 30, CURSOR_UPARROW, MOUSE_LEFTSINGLE | MOUSE_DOWN_REPEAT, asi_speed_up ) MOUSE_CHILD_FUNCT( 250, 24, 30, 30, CURSOR_DOWNARROW, MOUSE_LEFTSINGLE | MOUSE_DOWN_REPEAT, asi_speed_down ) MOUSE_CHILD_FUNCT( 31, 24, 30, 30, CURSOR_HAND, MOUSE_LEFTSINGLE, asi_bug_set ) MOUSE_CHILD_FUNCT( 283, 260, 30, 40, CURSOR_UPARROW, MOUSE_LEFTSINGLE | MOUSE_DOWN_REPEAT, asi_speed_up_set ) MOUSE_CHILD_FUNCT( 247, 260, 30, 40, CURSOR_DOWNARROW, MOUSE_LEFTSINGLE | MOUSE_DOWN_REPEAT, asi_speed_down_set ) MOUSE_END// Maximum/minimum airspeed bug to be registered#define GAUGE_MAX_AIRSPEED_BUG 250#define GAUGE_MIN_AIRSPEED_BUG 60UINT32 airspeed = 0; //Reset airspeed bug set---// MOUSE Airspeed Bug UP SetBOOL FSAPI asi_speed_up_set( PPIXPOINT relative_point, FLAGS32 mouse_flags ){ lookup_var(&airspeed_bug); airspeed = (int)((double)airspeed_bug.var_value.n); if (airspeed < 60) airspeed = 60; trigger_key_event (KEY_AP_SPD_VAR_INC,1); return FALSE;}// MOUSE Airspeed Bug DOWN SetBOOL FSAPI asi_speed_down_set( PPIXPOINT relative_point, FLAGS32 mouse_flags ){ lookup_var(&airspeed_bug); airspeed = (int)((double)airspeed_bug.var_value.n); if (airspeed > 250) airspeed = 250; trigger_key_event (KEY_AP_SPD_VAR_DEC,1); return FALSE;}// Airspeed bug needle dayFLOAT64 FSAPI asi_speedbug_src_cb_day (PELEMENT_NEEDLE pelement){ lookup_var(&airspeed_bug); airspeed = (int)((double)airspeed_bug.var_value.n); if ( airspeed > GAUGE_MAX_AIRSPEED_BUG ) airspeed = GAUGE_MAX_AIRSPEED_BUG; if ( airspeed < GAUGE_MIN_AIRSPEED_BUG ) airspeed = GAUGE_MIN_AIRSPEED_BUG; if ( airspeed > 250 ) airspeed = 250; else if ( airspeed < 60 ) airspeed = 60; return airspeed;}//-- end -->The airspeed bug needle works fine, but mouse values is starting from 0 up to 990 knots as monitored by the FSlook program. Help on this one is appreciated!Best regardsJan H. Sorensenhttp://www.jspanels.com/images/logo_small.gifHomepage: http://www.jspanels.com
  2. ATT: Kd527Okay, please send me an e-mail, so I can send a mail directly to you. You can use the email link in the Webmaster box (down left) on my homepage.Best regardsJan H. Sorensenhttp://www.jspanels.com/images/logo_small.gifHomepage: http://www.jspanels.com
  3. Hi, Yes sure, it's not easy to get in there :). Email sent.Best regardsJan H. Sorensenhttp://www.jspanels.com/images/logo_small.gifHomepage: http://www.jspanels.com
  4. Hi, no problem :). The sd2gau17.zip by Dai Griffiths can be downloaded from www.flightsim.com, file size 3256 KB.Best regardsJan H. Sorensenhttp://www.jspanels.com/images/logo_small.gifHomepage: http://www.jspanels.com
  5. ATT: Kd527In Dai Griffiths' latest Gauge Tutorial (rev. 17) - sd2gau17.zip you can find complete source code for Panel Switches with sound.Regarding the forum problems, check out "Help for the AVSIM Forums" above, it might be problems related to cookie or security settings in your Internet Browser.Best regardsJan H. Sorensenhttp://www.jspanels.com/images/logo_small.gifHomepage: http://www.jspanels.com
  6. ATT: ryanloganThe code used here is compiled and built using the FS2002 SDK. The gauge can also be used in FS2004. The code was earlier setup with the MSFSSound routines by Daniel Steiner, refer to the "FS2000 and CFS Gauge Creation" document by Dai Griffiths. I have also tested this code with FS2004 Gauges.h and it seem to work, but not tested extensively.When converting the code to use the "TGaugePlaySound" concept I could remove the links to fssound_msvc.lib and dsound.lib in Visual C ++ 6.0 Object/Library (modules). By doing this you will be able to compile & build gauges with sound(s) which not are dependant of FSSound.h and FSSound.dll (which has to be resident in FS2XXmodules).Best regardsJan H. Sorensenhttp://www.jspanels.com/images/logo_small.gifHomepage: http://www.jspanels.com
  7. Hi Bill,Thank you for the tip, I will check that out ASAP. I have BTW reworked the code by using the Token Var {RADIO_HEIGHT}. I will draw a new Flow Diagram and try to figure out all the pointers, there are still quite a few :). It's easy to get a broken link here and there! I will come back to you later with the result of this.Another thing which might make things more complicated: This FS2002 gauge has still subgauges using FSSound.dll. I will therefore rework all sub's to use the TGaugePlaySound concept. Otherwise I am using Visual C ++ 6.0 STD (SP5) and the FS2K2Gauges.h (243 KB) with the timestamp 11JULY 2002 13:02.Best regardsJan H. Sorensenhttp://www.jspanels.com/images/logo_small.gifHomepage: http://www.jspanels.com
  8. Hi Arne,Certainly I read your post, I even save your postings here. Regarding the latest advices from you, I did follow it up, but got some errors messages. I have now sorted those problems out and have added the lines you suggested and will work further on the code.Best regardsJan H. Sorensenhttp://www.jspanels.com/images/logo_small.gifHomepage: http://www.jspanels.com
  9. Hi Arne and Bill.Thanks again for your help! Well, for me it's not so simple! Unfortunately the sound loop is still there. Here's what I have done so far:Global UINT's and Vars (in the main c file)://--->UINT32 Plane = 0;UINT32 Ground = 0;UINT32 Alt = 0;UINT32 AltCheck = 0;UINT32 Down = 0;UINT32 Gearup = 0;UINT32 gearwarn = 0;UINT32 gearflag = 0;MODULE_VAR landed = {AIRCRAFT_ON_GROUND};MODULE_VAR gearpos = {GEAR_POS_LEFT}; //0 = up, 16K = dn MODULE_VAR PHeight = {PLANE_ALTITUDE};MODULE_VAR GHeight = {GROUND_ALTITUDE};/-->The gear warning callback in the Callout.c:FLOAT64 FSAPI gear_cb(PELEMENT_ICON pelement) { FLOAT64 gearwarn=pelement->source_var.var_value.n;lookup_var(&gearpos );lookup_var(&PHeight );lookup_var(&GHeight );lookup_var(&landed );Down = (int)((double)landed.var_value.n);Plane = (int)((double)PHeight.var_value.n);Ground = (int)((double)GHeight.var_value.n);Ground = Ground/256;Gearup = (int)((double)gearpos.var_value.n);Alt = Plane - Ground;Alt = (int)((double)Alt * 3.28083989501312);if (Alt < 500) AltCheck = 1 ; //Check that aircraft is below 500 feetif (Down = 1) AltCheck = 0; //If aircraft has landed then reset the altitude checkgearwarn = (float)Gearup ; if ( gearwarn > 1 ) { Gearup = 0 ; } if ( gearwarn < 0 ) { Gearup = 1 ; } if ( Gearup == 0 ) { gearflag = 1 ; }if ( Gearup == 1 && gearflag == 1 ) { gearflag = 0 ; }if ( Gearup == 0 && Alt < 500 && gearflag)gearflag = 0 ;GaugePlaySound("soundJSATRJSATR_gear.wav","",0);return Gearup; }//--->The TGaugePlaySound is set up with the sound declaration and in the Main Gauge Callback and should work. There are no error or warning messages during compilation or build.Best regardsJan H. Sorensen
  10. Thank you both for the replies, I will test these options. This gauge is setup using the MSFSSound routines by Daniel Steiner, and I have tried to setup the callback functions in PANEL_SERVICE_PRE_UPDATE. Now, the sound is playing when the condition are met, but still looping. But I will investigate this one further.The FLOAT64 FSAPI callback is absolutely interesting! I noticed this line:--->if ( test_rotary == 1 && test1 == 1 ) { test1 = 0 ; (GaugePlaySound)("soundESDGitt_warn.wav","",0) ; }--->The statement (GaugePlaySound) will be tested, but I guess that means that I have to leave the MSFSSound concept?Best regardsJan H. Sorensen
  11. Hi All,I am working on a C++ callout (sound) gauge. This gauge does not use mouse clicks, but is only intended to play sounds at specific events. The code used here is modified from another gauge using mouse clicks and that's perhaps the problem? The sound does come up, but plays in an endless loop!Here are extracts from the code://--->// --------------------------------------------------------------------------// icons set to OFF or zero value// --------------------------------------------------------------------------UINT32 gearup = 0;// --------------------------------------------------------------------------// callbacks for the icons// --------------------------------------------------------------------------FLOAT64 FSAPI gear_cb(PELEMENT_ICON);// --------------------------------------------------------------------------// main gauge callback// --------------------------------------------------------------------------void FSAPI callout_cb(PGAUGEHDR, int, UINT32);// --------------------------------------------------------------------------// local variables// --------------------------------------------------------------------------char callout_gauge_name[] = GAUGE_NAME;extern PELEMENT_HEADER callout_list;extern MOUSERECT callout_mouse_rect[];// --------------------------------------------------------------------------// this variable will hold the actual width of the gauge; //needed in some mouse callbacks// --------------------------------------------------------------------------double width;// --------------------------------------------------------------------------// variables/definitions for the sound buffers:// sound files in FS Sound folder// --------------------------------------------------------------------------MFSSoundFileVars(gear_sound, "SOUNDJSATR_gear.WAV");// --------------------------------------------------------------------------// MODULE IMPORT AND EXPORT DEFINITIONS// --------------------------------------------------------------------------GAUGE_HEADER_FS700(GAUGE_W, callout_gauge_name, &callout_list, callout_mouse_rect, callout_cb, 0, 0, 0 );// --------------------------------------------------------------------------// DRAWING ELEMENTS DEFINITIONS// --------------------------------------------------------------------------MAKE_ICON( gear, CALLOUT, NULL, NULL, IMAGE_USE_ERASE | IMAGE_USE_TRANSPARENCY | IMAGE_HIDDEN, 0, 0, 0, MODULE_VAR_NONE, gear_cb, ICON_SWITCH_TYPE_SET_CUR_ICON, 1, 0, 0)// --------------------------------------------------------------------------// link the drawing elements to the background// --------------------------------------------------------------------------PELEMENT_HEADER callout_plist1[] = { &gear.header, NULL};MAKE_STATIC( callout_background, CALLOUT_BACKGROUND, &callout_plist1, NULL, IMAGE_USE_TRANSPARENCY | IMAGE_USE_ERASE |IMAGE_HIDDEN, 0, 0,0)PELEMENT_HEADER callout_list = &callout_background.header;// --------------------------------------------------------------------------// RESET VARS TO ZERO - MODULE Vars// --------------------------------------------------------------------------UINT32 Plane = 0;UINT32 Ground = 0;UINT32 Alt = 0; //Radio AltitudeUINT32 AltCheck = 0;UINT32 Down = 0;UINT32 Gearup = 0;MODULE_VAR landed = {AIRCRAFT_ON_GROUND};MODULE_VAR gearpos = {GEAR_POS_LEFT}; MODULE_VAR PHeight = {RADIO_HEIGHT};MODULE_VAR GHeight = {GROUND_ALTITUDE};// --------------------------------------------------------------------------// DRAWING ELEMENT CALLBACKS// --------------------------------------------------------------------------// icon callbacksFLOAT64 FSAPI gear_cb(PELEMENT_ICON pelement) { FLOAT64 val=pelement->source_var.var_value.n; lookup_var(&gearpos ); lookup_var(&PHeight ); lookup_var(&GHeight ); lookup_var(&landed ); Down = (int)((double)landed.var_value.n); Plane = (int)((double)PHeight.var_value.n); Ground = (int)((double)GHeight.var_value.n); Ground = Ground/256; Gearup = (int)((double)gearpos.var_value.n); Alt = Plane - Ground; Alt = (int)((double)Alt * 3.28083989501312);//Check that aircraft is below 400 feet if (Alt < 400) { AltCheck = 1; }//If aircraft has landed then reset the altitude check if (Down == 1) { AltCheck = 0; }// Play altitude callout if (Gearup == 0 ) { Gearup = 1 ; } else { Gearup = 0 ; } MFSSoundFilePlay(gear_sound, FALSE); return FALSE;}// --------------------------------------------------------------------------// MAIN GAUGE CALLBACK// --------------------------------------------------------------------------void FSAPI callout_cb(PGAUGEHDR pgauge, int service_id, UINT32 extra_data) { switch(service_id) { case PANEL_SERVICE_POST_INSTALL: // sounds need to be registered before they can be played MFSSoundFileRegister(gear_sound); break; case PANEL_SERVICE_PRE_INITIALIZE: // save the actual with of the gauge width = ((PELEMENT_STATIC_IMAGE)pgauge->elements_list[0]) ->image_data.final->dim.x; break; case PANEL_SERVICE_PRE_UPDATE: /* "pre_update_routine()"*/ break; case PANEL_SERVICE_PRE_DRAW: /* "draw_routine()"*/ break; case PANEL_SERVICE_PRE_KILL: // never forget to unregister the sounds MFSSoundUnregister(gear_sound); break; }}// --------------------------------------------------------------------------// MOUSE SPECIFIC DEFINITIONS// --------------------------------------------------------------------------MOUSE_BEGIN(callout_mouse_rect, HELP_NONE, 0, 0)MOUSE_END// --------------------------------------------------------------------------// CLEAN UP// --------------------------------------------------------------------------#undef GAUGE_NAME#undef GAUGEHDR_VAR_NAME#undef GAUGE_W//--->I would indeed appreciate help on this one!Best regardsJan H. Sorensen
  12. On several occasions I have experienced that the aircraft heading and track suddenly goes offset by a large number of degrees. This seem to be happening on the Northern Hemisphere (I haven't checked on the Southern Hemisphere yet). Yesterday at the fix MAMED (N38 34.80 E057 42.00) we where two pilots flying online with the PSS B747 and we both came into the same trouble at this position, which made the FMC's unserviceable. The other pilot got an compass error of about plus 45 degress, and I got an error of about plus 115 degrees.Later I have checked on WSSS Singapore (our destination) offline and also with default aircraft and the same error occurs. We have both installed FSNavigator (latest version), and the navigation data there seem to be correct. We would appreciate help on this problem :-).Best regardsJan H. Sorensenhttp://www.jspanels.com/images/logo_small.gifHomepage: http://www.jspanels.com
  13. jspan_com

    FS9 Texture Problems

    ATT: NicolasHi and thank you very much :-). That was the solution! I did a new installation and this time the colors of the ground textures look fine!Best regardsJan H. Sorensenhttp://www.jspanels.com/images/logo_small.gifHomepage: http://www.jspanels.com
  14. jspan_com

    FS9 Texture Problems

    ATT: BigshotThanks, I have reset FS9 to default and also deleted FS9.cfg, and then tried the KSEA Seattle Tacoma "default" flight, but the red ground textures are still there :-(. Best regardsJan H. Sorensenhttp://www.jspanels.com/images/logo_small.gifHomepage: http://www.jspanels.com
  15. jspan_com

    FS9 Texture Problems

    ATT: W. SieffertThank you for the reply :-). I have tried all options as described in your post, the latest VIA Chipset driver is installed (v4.51) as well as the latest 56.64 Nvidia driver. In the Graphics card advanced option I have tried both with or without Application-controlled settings for AA and AF, but the problem is still there. Also the latest DirectX 9.0b version is installed. One slight problem when running dxdiag: The diagnosis program is not able to access the latest information on the usage of DirectX. I am using WinXP Pro English SP2 v.2082.Best regardsJan H. Sorensenhttp://www.jspanels.com/images/logo_small.gifHomepage: http://www.jspanels.com