Skip to content

Commit

Permalink
Radar: Give MP carriers RCS
Browse files Browse the repository at this point in the history
  • Loading branch information
NikolaiVChr committed Sep 23, 2023
1 parent d968b1d commit 43aa7ac
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 9 deletions.
24 changes: 16 additions & 8 deletions Nasal/radar/radar-system-database.nas
Original file line number Diff line number Diff line change
Expand Up @@ -240,19 +240,27 @@ var Database = {
"F-23C_BlackWidow-II": {},
};

if (defined(rcs.rcs_database)) {
foreach(entry : keys(rcs.rcs_database)) {
Database[entry].rcsFrontal = rcs_database[entry];
if (rcs["rcs_database"] != nil) {
foreach(entry ; keys(rcs.rcs_database)) {
if (Database[entry] == nil) {
Database[entry] = {};
}
Database[entry].rcsFrontal = rcs.rcs_database[entry];
}
}

foreach(entry : keys(rcs.rcs_oprf_database)) {
foreach(entry ; keys(rcs.rcs_oprf_database)) {
if (Database[entry] == nil) {
Database[entry] = {};
}
Database[entry].rcsFrontal = rcs.rcs_oprf_database[entry];
}

foreach (entry : keys(Database)) {
if (Database[entry].rcsFrontal == nil) {
print("Database: ",entry," is missing ",rcsFrontal);
foreach (entry ; keys(Database)) {
if (Database[entry]["rcsFrontal"] == nil) {
if (debugLevel > 0) print("Database: ",entry," is missing rcsFrontal, using default");
}
Database[entry]["parents"] = [BaseEntry];
}
}

var debugLevel = 1;
7 changes: 6 additions & 1 deletion Nasal/radar/rcs.nas
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,11 @@ var rcs_database = {
"T-50": 0.5, #low end of sources
"u-2s": 0.01,
"U-2S-model": 0.01,
#Carriers
"mp-clemenceau": 500,
"mp-eisenhower": 500,
"mp-nimitz": 500,
"mp-vinson": 500,
};

var prevVisible = {};
Expand Down Expand Up @@ -177,7 +182,7 @@ var targetRCSSignal = func(targetCoord, targetModel, targetHeading, targetPitch,
target_front_rcs = rcs_database[targetModel];
} else {
return 1;
target_front_rcs = rcs_database["default"];
target_front_rcs = rcs_oprf_database["default"];
}
#print(target_front_rcs," RCS from ", targetModel, " m:", myRadarDistance_m, " rcs:",myRadarStrength_rcs);
var target_rcs = getRCS(targetCoord, targetHeading, targetPitch, targetRoll, myCoord, target_front_rcs);
Expand Down
1 change: 1 addition & 0 deletions f16-base.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1684,6 +1684,7 @@
<file>Aircraft/f16/Nasal/help.nas</file>
</help>
<radar_system>
<file>Aircraft/f16/Nasal/radar/radar-system-database.nas</file>
<file>Aircraft/f16/Nasal/radar/radar-system.nas</file>
<file>Aircraft/f16/Nasal/radar/apg-68.nas</file>
</radar_system>
Expand Down

0 comments on commit 43aa7ac

Please sign in to comment.