void tcBallisticDBObject::ReadSql(tcSqlReader& entry) { tcWeaponDBObject::ReadSql(entry); ballisticType = entry.GetInt("BallisticType"); angleError_rad = entry.GetDouble("AngleError_rad"); burstCount = entry.GetInt("BurstCount"); burstDuration_s = entry.GetDouble("BurstDuration_s"); clusterCount = (unsigned int)entry.GetInt("ClusterCount"); clusterEffectRadius_m = entry.GetDouble("ClusterEffectRadius_m"); sensorClass = entry.GetString("SensorClass").c_str(); smartMaxClimb_rad = entry.GetDouble("SmartMaxClimb_rad"); smartError_m = entry.GetDouble("SmartError_m"); lockOnAfterLaunch = entry.GetInt("LockOnAfterLaunch") != 0; if (maxRange_km <= 0) maxRange_km = 20.0f; // set to 20 km for lack of better information if ((sensorClass.size() > 0) && (ballisticType == SMART_BOMB) && (mnModelType != MTYPE_LASERGUIDEDBOMB)) { wxString msg = wxString::Format("DATABASE WARNING - Ballistic DB object %s, model type not set to Guided Bomb but has sensor\n", mzClass.c_str()); fprintf(stderr, msg.c_str()); wxMessageBox(msg); } if ((ballisticType == ROCKET) && (mnModelType != MTYPE_ROCKET)) { mnModelType = MTYPE_ROCKET; wxString msg = wxString::Format("DATABASE WARNING - Ballistic DB object %s, model type not set to Rocket but ballistic type is Rocket--forced model type to ROCKET\n", mzClass.c_str()); fprintf(stderr, msg.c_str()); //wxASSERT(false); } CalculateParams(); }
Params::Params(Bignum N, uint32_t securityLevel) { this->zkp_hash_len = securityLevel; this->zkp_iterations = securityLevel; this->accumulatorParams.k_prime = ACCPROOF_KPRIME; this->accumulatorParams.k_dprime = ACCPROOF_KDPRIME; // Generate the parameters CalculateParams(*this, N, ZEROCOIN_PROTOCOL_VERSION, securityLevel); this->accumulatorParams.initialized = true; this->initialized = true; }
void tcCounterMeasureDBObject::ReadSql(tcSqlReader& entry) { tcDatabaseObject::ReadSql(entry); subType = entry.GetString("SubType").c_str(); lifeSpan_s = entry.GetDouble("LifeSpan_s"); effectiveness = entry.GetDouble("Effectiveness"); maxSpeed_mps = entry.GetDouble("MaxSpeed_mps"); tcAirDetectionDBObject::ReadSql(entry); tcWaterDetectionDBObject::ReadSql(entry); CalculateParams(); }
tcPlatformDBObject::tcPlatformDBObject(const tcPlatformDBObject& obj) : tcDatabaseObject(obj), tcSensorPlatformDBObject(obj), mfMaxSpeed_kts(obj.mfMaxSpeed_kts), mfAccel_ktsps(obj.mfAccel_ktsps), mfTurnRate_degps(obj.mfTurnRate_degps), mfFuelCapacity_kg(obj.mfFuelCapacity_kg), mfFuelRate_kgps(obj.mfFuelRate_kgps), mfToughness(obj.mfToughness), damageEffect(obj.damageEffect), mnNumLaunchers(obj.mnNumLaunchers), mnNumMagazines(obj.mnNumMagazines), launcherDescription(obj.launcherDescription), launcherName(obj.launcherName), launcherFOV_deg(obj.launcherFOV_deg), launcherAz_deg(obj.launcherAz_deg), launcherEl_deg(obj.launcherEl_deg), launcherFireControl(obj.launcherFireControl), launcherFireControl2(obj.launcherFireControl2), launcherIsReloadable(obj.launcherIsReloadable) { int i; for(i=0;i<mnNumLaunchers;i++) { maLauncherClass[i] = obj.maLauncherClass[i]; launcherName[i] = obj.launcherName[i]; } for (i=0; i<MAXMAGAZINES; i++) { maMagazineClass[i] = obj.maMagazineClass[i]; magazineId[i] = obj.magazineId[i]; // valid to do this? why not push_back? } animationInfo.clear(); size_t nAn = obj.animationInfo.size(); for(size_t n=0;n<nAn;n++) { animationInfo.push_back(obj.animationInfo[n]); } CalculateParams(); }
void tcPlatformDBObject::ReadSql(tcSqlReader& entry) { tcDatabaseObject::ReadSql(entry); mfMaxSpeed_kts = entry.GetDouble("MaxSpeed_kts"); mfAccel_ktsps = entry.GetDouble("Accel_ktsps"); mfTurnRate_degps = entry.GetDouble("TurnRate_degps"); mfFuelCapacity_kg = entry.GetDouble("FuelCapacity_kg"); mfFuelRate_kgps = entry.GetDouble("FuelRate_kgps"); mfToughness = entry.GetDouble("Toughness"); damageEffect = entry.GetString("DamageEffect"); // read launchers mnNumLaunchers = 0; launcherName.clear(); maLauncherClass.clear(); launcherFireControl.clear(); launcherId.clear(); // no longer needed since covered by platform_launchers table /* int i; for(i=0;i<MAXLAUNCHERS;i++) { std::string launcherClass; std::string displayName; tcString s; s.Format("L%d_class",i+1); launcherClass = entry.GetString(s.GetBuffer()); s.Format("L%d_name",i+1); displayName = entry.GetString(s.GetBuffer()); if (launcherClass.size() > 0) { maLauncherClass.push_back(launcherClass); launcherName.push_back(displayName); mnNumLaunchers++; } } */ // read magazines mnNumMagazines = 0; maMagazineClass.clear(); magazineId.clear(); // no longer needed since all covered by platform_magazines table /* for (i=0; i<MAXMAGAZINES; i++) { std::string magazineClass; tcString s; s.Format("M%d_class", i+1); magazineClass = entry.GetString(s.GetBuffer()); if (magazineClass.size() > 0) { maMagazineClass.push_back(magazineClass); mnNumMagazines++; } } */ CalculateParams(); tcSensorPlatformDBObject::ReadSql(entry); }