Jump to content

MKaprocki

Frozen-Inactivity
  • Content Count

    322
  • Donations

    $0.00 
  • Joined

  • Last visited

Posts posted by MKaprocki


  1. You only need 1 ICON element. ICONs can change what bitmap they are showing. You tell it the first bitmap, such as BMP_STROBE_OFF, and then later tell it how many bitmaps it can switch between (in this case 2). The callback function tells it which bitmap to show. If the strobes are off it returns 0, which shows BMP_STROBE_OFF. If strobes are on it returns 1, which shows BMP_STROBE_ON (the next bitmap, as defined in the header file). You don't always need a callback, only when you need to do this with data before returning it.Matt


  2. I have a variable that stores the new frequency, like 12345, and another that stores the position I'm editing, like 1000 for the 2. When the user pushes, say 3, it multiplies 3 by what position I'm editing. So if I have 12000, it adds to it (3 * 100), so I get 12300. Then dividing the position by 10, so it adds the next one in the correct spot. When they hit enter, it divides by 100 to get 123.45 and then converts it to BCD and sets it. ;-)Pretty simple really.new_value += (DIGIT)*position;position /= 10;Matt


  3. Not sure what the 57 means.To change the number of bitmaps used in an ICON, change the 1 after ICON_SWITCH_TYPE_SET_CUR_ICON to however many are used. Use a callback function to set the index of the one being shown.I'm not sure if the MAKE_ICON macro is different for FS98, but the one shown may need some changes. plist10 should be &plist10. After the "image flags," there should only be a 0...the ",NULL" shouldn't be there. "{247,83}," should be "247,83,". After STROBE_LIGHTS, you'll need to use a callback function to set the image number, such as: "STROBE_LIGHTS, strobe_cb,". If all of this is different for FS98, I'm sorry. ;)MAKE_ICON( icon_strobe,BMP_ICON,&plist10,NULL,IMAGE_USE_ERASE | IMAGE_USE_BRIGHT | IMAGE_USE_TRANSPARENCY | IMAGE_HIDDEN,0,247,83,STROBE_LIGHTS, strobe_cb,ICON_SWITCH_TYPE_SET_CUR_ICON,1,0,0, );I'll be glad to take a look at the gauge. What kind of error messages are you getting?Edit: I made some changes to the gauge, see if it makes any difference. I'm assuming you're trying to make a switch or light or something showing if the Strobe Lights are on or off. You need 2 seperate bitmaps: one if they're on and one if they're off.Matt


  4. Server Gauge:BOOL fcc_pos;In PANEL_SERVICE_PRE_INSTALL: register_var_by_name (&fcc_pos, TYPE_BOOL, "FCC Power On");In PANEL_SERVICE_PRE_KILL: unregister_var_by_name ("FCC Power On");Make sure the server gauge is on the main panel.Client Gauge:MODULE_VAR fcc_pos;BOOL* FCC_On;In PANEL_SERVICE_PRE_UPDATE:if (fcc_pos.var_ptr == NULL){ initialize_var_by_name (&fcc_pos, "FCC Power On"); FCC_On = fcc_pos.var_ptr;}Use FCC_On as normal. ;)Matt


  5. The problem doing it that way is when you want to draw something to a specific point. I can look at an image in Paint Shop Pro and see that a line is supposed to go to a certain point. Using dx and dy, I can just multiply them by the location I want it at. Your way (although this is how I did it at first) you have to manually figure out what percentage of the canvas size it's located at. Instead of just saying 50,50, you would have to take that 50,50 and divide it by the canvas size on a calculator first. Then later when you go back to look at it, you can't really tell where it's located at. ;-)Matt


  6. Vector Gauges use a different graphing system than FS. 100 pixels in FS is not 100 pixels in a vector gauge. Furthermore, something at, say, location 30x30 in a vector gauge at 1024x768 resolution will be in a different position when the resolution is 800x600. I get it around that problem like this:dx = (float)dim.x / X;dy = (float)dim.y / Y;With X and Y equal to the size of the bitmap in normal pixels.Now any time you want to place something on the gauge, just multiply the x and y by dx and dy. To draw a line from 30x30 to 50x50 you would do:MoveToEx (hdc, 30*dx, 30*dy, NULL);LineTo (hdc, 50*dx, 50*dy);To make it even simpler, create functions that do it for you:void DrawLine(int new_x, int new_y){ LineTo (hdc, new_x*dx, new_y*dy);}and just call DrawLine(50,50); ;-)Matt


  7. A friend of mine needed a C gauge that would tell all his XML gauges if it was night or day and if the panel lights were on or not. What I ended up doing was using A:GENERAL ENG4 GENERATOR SWITCH in the XML gauge and GENERAL_ENGINE4_GENERATOR_SWITCH along with KEY_TOGGLE_ALTERNATOR4 in the C gauge. Setting the alternator to on or off in the C gauge, I could pass boolean data to the XML gauge. Works good as long as the airplane doesn't have 4 engines. ;) The same thing can be done with engines 2 and 3 if it's a single engine plane.Matt


  8. Don't see anything wrong with that, but you do have a blank (really doesn't have to be blank) static image for it to draw over, right? You may also need:SelectObject (hdc, GetStockObject (BLACK_BRUSH));SelectObject (hdc, GetStockObject (BLACK_PEN));before the Rectangle call. This tells Windows to use use a black pen (outline) and black brush (fill). I'm not sure if it defaults to something, so you may need to tell it to load them.A device context (HDC - Handle to a Device Context) basically tells Windows what it is you're outputting to. In this case, we're getting a handle to the DC for a static image we want to draw over.Matt


  9. http://home.cfl.rr.com/mkaprocki/F16/Image5.jpgHere's a pic of the F-16 panel I'm working on. Uses vector gauges for the MFDs, which can be made dimmer or brighter. The radar shows actual AI traffic. It will also feature an authentic HSD. Check out this link to see a couple more previews.http://home.cfl.rr.com/mkaprocki/F16/Now, a question. Does anyone know if it is possible to dynamically move gauge elements? Like, using normal elements (ie, not vector gaues), is it possible to move a string or icon? Don't know of any way to do it, but thought I'd get your opinions.Matt

  10. LDA is just as accurate as a Localizer, just not aligned with the runway. Fly it just like you would a localizer, vor, or gps approach. Here's an excerpt from the AIM:c. Localizer Type Directional Aid (LDA) 1. The LDA is of comparable use and accuracy to a localizer but is not part of a complete ILS. The LDA course usually provides a more precise approach course than the similar Simplified Directional Facility (SDF) installation, which may have a course width of 6 or 12 degrees. 2. The LDA is not aligned with the runway. Straight-in minimums may be published where alignment does not exceed 30 degrees between the course and runway. Circling minimums only are published where this alignment exceeds 30 degrees. 3. A very limited number of LDA approaches also incorporate a glideslope. These are annotated in the plan view of the instrument approach chart with a note, "LDA/Glideslope." These procedures fall under a newly defined category of approaches called Approach with Vertical Guidance (APV) described in paragraph 5-4-5, Instrument Approach Procedure Charts, subparagraph a7(:(, Approach with Vertical Guidance (APV). LDA minima for with and without glideslope is provided and annotated on the minima lines of the approach chart as S-LDA/GS and S-LDA. Because the final approach course is not aligned with the runway centerline, additional maneuvering will be required compared to an ILS approach. Matt

×
×
  • Create New...