From 9cc4c619cc85194fc0b8eb7db4fdb96559a5d048 Mon Sep 17 00:00:00 2001 From: curt Date: Tue, 19 Oct 2004 19:07:24 +0000 Subject: [PATCH] Fix the kr-87 search functionality so it works in the subsystem/instrumentation infrastructure. --- NEWS | 2 +- package/Win32-Inno/FlightGear-0.9.6.iss | 76 +++++++++++++++++++++++++ src/Instrumentation/kr_87.cxx | 26 ++++++--- src/Instrumentation/kr_87.hxx | 5 +- 4 files changed, 99 insertions(+), 10 deletions(-) create mode 100755 package/Win32-Inno/FlightGear-0.9.6.iss diff --git a/NEWS b/NEWS index 9e98bb8be..9ebc25248 100644 --- a/NEWS +++ b/NEWS @@ -13,10 +13,10 @@ New in 0.9.6 * Updated aircraft: A320, Bo-105, Comper Swift, Concorde, F16, Fokker-50, Fokker-100, Hunter, MD11, PC7, Spitfire, adjust C172 cockpit sound levels, and Sgs-233. - * Updated joystick configs: CH pro yoke usb, Cyborg Evo, Thrustmaster FCS. * Fix a bug in the nasal fuel tank management code. * Return Canadian ILS's to nav data. +* Cleaned up some of the 3d models around the bay area. * Add support for display list based rendering which yields substantial performance gains for many systems. * Synced with latest JSBSim code. diff --git a/package/Win32-Inno/FlightGear-0.9.6.iss b/package/Win32-Inno/FlightGear-0.9.6.iss new file mode 100755 index 000000000..ab61a4dbb --- /dev/null +++ b/package/Win32-Inno/FlightGear-0.9.6.iss @@ -0,0 +1,76 @@ +; Script generated by the Inno Setup Script Wizard. +; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES! +; +; This script creates an installable FlightGear package for Win32 using the +; "Inno Setup" package builder. Inno Setup is free (but probably not open +; source?.) The official web site for this package building software is: +; +; http://www.jrsoftware.org/isinfo.php +; +; Note: the files must appear in the X: drive. +; You can do this with the command below: +; +; subst X: path_to_files +; +; For example: +; +; C:\> subst X: F:\Path\to\FlightGear\root +; C:\> subst X: F:\ +; + +[Setup] +AppName=FlightGear +AppVerName=FlightGear v0.9.6 +AppPublisher=The FlightGear Organization +AppPublisherURL=http://www.flightgear.org +AppSupportURL=http://www.flightgear.org +AppUpdatesURL=http://www.flightgear.org +DefaultDirName={pf}\FlightGear +DefaultGroupName=FlightGear v0.9.6 +LicenseFile=X:\data\COPYING +Uninstallable=yes + +[Tasks] +; NOTE: The following entry contains English phrases ("Create a desktop icon" and "Additional icons"). You are free to translate them into another language if required. +Name: "desktopicon"; Description: "Create a &desktop icon"; GroupDescription: "Additional icons:" + +[Files] +; NOTE: run subst X: F:\ (or whatever path the expanded tree resides at) +Source: "X:\*.*"; DestDir: "{app}"; Flags: ignoreversion +Source: "X:\bin\*.*"; DestDir: "{app}\bin"; Flags: ignoreversion recursesubdirs +Source: "X:\data\*.*"; DestDir: "{app}\data"; Flags: ignoreversion recursesubdirs +Source: "X:\docs\*.*"; DestDir: "{app}\docs"; Flags: ignoreversion recursesubdirs +; Source: "X:\bin\Win32\fgrun.prefs"; DestDir: "{userappdata}\flightgear.org"; Flags: ignoreversion +; Source: "X:\bin\Win32\fgadmin.prefs"; DestDir: "{userappdata}\flightgear.org"; Flags: ignoreversion +; Source: "X:\src\*.*"; DestDir: "{app}\src"; Flags: ignoreversion recursesubdirs +; NOTE: Don't use "Flags: ignoreversion" on any shared system files + +[Icons] +Name: "{group}\FlightGear Launcher"; Filename: "{app}\bin\Win32\fgrun.exe"; WorkingDir: "{app}"; +; Name: "{group}\FlightGear"; Filename: "{app}\bin\Win32\fgfs.exe"; Parameters: "--fg-root=."; WorkingDir: "{app}"; +Name: "{group}\Install & Uninstall Scenery"; Filename: "{app}\bin\Win32\fgadmin.exe"; WorkingDir: "{app}"; +Name: "{group}\FlightGear Documentation"; Filename: "{app}\data\docs\index.html" +Name: "{group}\Explore Documentation Folder"; Filename: "{app}\docs" +Name: "{group}\Uninstall FlightGear v0.9.6"; Filename: "{uninstallexe}" +Name: "{userdesktop}\FlightGear v0.9.6"; Filename: "{app}\bin\Win32\fgrun.exe"; WorkingDir: "{app}"; Tasks: desktopicon +; For running flightgear directly +; Name: "{userdesktop}\FlightGear v0.9.6"; Filename: "{app}\bin\Win32\fgfs.exe"; Parameters: "--fg-root=."; WorkingDir: "{app}"; Tasks: desktopicon + +[Run] +; Put installation directory into the fgrun.prefs +; filename: "{app}\bin\Win32\mkfgrunp.bat"; WorkingDir: "{app}\bin\Win32"; Parameters: """{app}"" ""{userappdata}""" +filename: "{app}\bin\Win32\fgrun.exe"; WorkingDir: "{app}\bin\Win32"; Parameters: "--silent ""--fg-exe={app}\bin\Win32\fgfs.exe"" ""--fg-root={app}\data"" ""--fg-scenery={app}\data\Scenery;{app}\scenery""" + +; Put installation and source directories into the fgadmin.prefs +; filename: "{app}\bin\Win32\mkfgadminp.bat"; WorkingDir: "{app}\bin\Win32"; Parameters: """{src}"" ""{app}"" ""{userappdata}""" +filename: "{app}\bin\Win32\fgadmin.exe"; WorkingDir: "{app}\bin\Win32"; Parameters: "--silent ""--install-source={src}\."" ""--scenery-dest={app}\scenery""" +; filename: "{app}\bin\Win32\testbatch.bat"; WorkingDir: "{app}\bin\Win32"; Parameters: "--silent ""--install-source={src}"" ""--scenery-dest={app}\scenery""" + +; Make the user installable scenery directory +filename: "{app}\bin\Win32\mkscenerydir.bat"; WorkingDir: "{app}" + +; NOTE: The following entry contains an English phrase ("Launch"). You are free to translate it into another language if required. +Filename: "{app}\bin\Win32\fgrun.exe"; WorkingDir: "{app}"; Description: "Launch FlightGear"; Flags: postinstall skipifsilent +; For running flightgear directly +; Filename: "{app}\bin\Win32\fgfs.exe"; Parameters: "--fg-root=."; WorkingDir: "{app}"; Description: "Launch FlightGear"; Flags: postinstall skipifsilent + diff --git a/src/Instrumentation/kr_87.cxx b/src/Instrumentation/kr_87.cxx index 404a5e46f..d0c81c8ba 100644 --- a/src/Instrumentation/kr_87.cxx +++ b/src/Instrumentation/kr_87.cxx @@ -102,7 +102,8 @@ FGKR_87::FGKR_87( SGPropertyNode *node ) : needle_deg(0.0), flight_timer(0.0), elapsed_timer(0.0), - tmp_timer(0.0) + tmp_timer(0.0), + _time_before_search_sec(0) { } @@ -233,7 +234,7 @@ void FGKR_87::unbind () { // Update the various nav values based on position and valid tuned in navs -void FGKR_87::update( double dt ) { +void FGKR_87::update( double dt_sec ) { double acft_lon = lon_node->getDoubleValue() * SGD_DEGREES_TO_RADIANS; double acft_lat = lat_node->getDoubleValue() * SGD_DEGREES_TO_RADIANS; double acft_elev = alt_node->getDoubleValue() * SG_FEET_TO_METER; @@ -244,6 +245,12 @@ void FGKR_87::update( double dt ) { Point3D station; double az1, az2, s; + // On timeout, scan again + _time_before_search_sec -= dt_sec; + if ( _time_before_search_sec < 0 ) { + search(); + } + //////////////////////////////////////////////////////////////////////// // Radio //////////////////////////////////////////////////////////////////////// @@ -283,7 +290,7 @@ void FGKR_87::update( double dt ) { } if ( set_rst_btn == 1 && set_rst_btn == last_set_rst_btn ) { // button depressed and was last iteration too - tmp_timer += dt; + tmp_timer += dt_sec; // cout << "tmp_timer = " << tmp_timer << endl; if ( tmp_timer > 2.0 ) { // button held depressed for 2 seconds @@ -308,14 +315,14 @@ void FGKR_87::update( double dt ) { last_set_rst_btn = set_rst_btn; // timers - flight_timer += dt; + flight_timer += dt_sec; if ( set_rst_btn == 0 ) { // only count if set/rst button not depressed if ( count_mode == 0 ) { - elapsed_timer += dt; + elapsed_timer += dt_sec; } else if ( count_mode == 1 ) { - elapsed_timer -= dt; + elapsed_timer -= dt_sec; if ( elapsed_timer < 1.0 ) { count_mode = 0; elapsed_timer = 0.0; @@ -332,7 +339,7 @@ void FGKR_87::update( double dt ) { if ( count_mode < 2 ) { et_ann = stby_mode && timer_mode; } else { - et_flash_time += dt; + et_flash_time += dt_sec; if ( et_ann && et_flash_time > 0.5 ) { et_ann = false; et_flash_time -= 0.5; @@ -435,7 +442,7 @@ void FGKR_87::update( double dt ) { while ( diff < -180.0 ) { diff += 360.0; } while ( diff > 180.0 ) { diff -= 360.0; } - needle_deg += diff * dt * 4; + needle_deg += diff * dt_sec * 4; while ( needle_deg < 0.0 ) { needle_deg += 360.0; } while ( needle_deg >= 360.0 ) { needle_deg -= 360.0; } @@ -487,6 +494,9 @@ void FGKR_87::search() { // FIXME: the panel should handle this static string last_ident = ""; + // reset search time + _time_before_search_sec = 1.0; + //////////////////////////////////////////////////////////////////////// // ADF. //////////////////////////////////////////////////////////////////////// diff --git a/src/Instrumentation/kr_87.hxx b/src/Instrumentation/kr_87.hxx index bc2f3d569..cd047e9c4 100644 --- a/src/Instrumentation/kr_87.hxx +++ b/src/Instrumentation/kr_87.hxx @@ -103,6 +103,9 @@ class FGKR_87 : public SGSubsystem bool flt_ann; bool et_ann; + // internal periodic station search timer + double _time_before_search_sec; + public: FGKR_87( SGPropertyNode *node ); @@ -111,7 +114,7 @@ public: void init (); void bind (); void unbind (); - void update (double dt); + void update (double dt_sec); // Update nav/adf radios based on current postition void search (); -- 2.39.5