Exemplo n.º 1
0
STDMETHODIMP HostUSBDeviceFilterWrap::COMGETTER(Manufacturer)(BSTR *aManufacturer)
{
    LogRelFlow(("{%p} %s: enter aManufacturer=%p\n", this, "HostUSBDeviceFilter::getManufacturer", aManufacturer));

    VirtualBoxBase::clearError();

    HRESULT hrc;

    try
    {
        CheckComArgOutPointerValidThrow(aManufacturer);

        AutoCaller autoCaller(this);
        if (FAILED(autoCaller.rc()))
            throw autoCaller.rc();

        hrc = getManufacturer(BSTROutConverter(aManufacturer).str());
    }
    catch (HRESULT hrc2)
    {
        hrc = hrc2;
    }
    catch (...)
    {
        hrc = VirtualBoxBase::handleUnexpectedExceptions(this, RT_SRC_POS);
    }

    LogRelFlow(("{%p} %s: leave *aManufacturer=%ls hrc=%Rhrc\n", this, "HostUSBDeviceFilter::getManufacturer", *aManufacturer, hrc));
    return hrc;
}
	Json::Value ModuleIdentifier::toJSONObject() {
		Json::Value output;
		output["manufacturer"] = getManufacturer();
		output["typeNumber"] = getTypeNumber();
		output["serialNumber"] = getSerialNumber();
		return output;
	}
Exemplo n.º 3
0
QueryData genBiosInfo(QueryContext& context) {
  QueryData results;
  std::string manufacturer;

  WmiRequest wmiComputerSystemReq(
      "select Manufacturer from Win32_ComputerSystem");
  std::vector<WmiResultItem>& wmiComputerSystemResults =
      wmiComputerSystemReq.results();

  if (!wmiComputerSystemResults.empty()) {
    wmiComputerSystemResults[0].GetString("Manufacturer", manufacturer);
    manufacturer = getManufacturer(manufacturer);
  } else {
    return results;
  }

  if (kQueryMap.find(manufacturer) != kQueryMap.end()) {
    WmiRequest wmiBiosReq(std::get<0>(kQueryMap.at(manufacturer)),
                          (std::get<1>(kQueryMap.at(manufacturer))));
    std::vector<WmiResultItem>& wmiResults = wmiBiosReq.results();

    for (unsigned int i = 0; i < wmiResults.size(); ++i) {
      Row r;

      if (manufacturer == "hp") {
        r = getHPBiosInfo(wmiResults[i]);

      } else if (manufacturer == "lenovo") {
        r = getLenovoBiosInfo(wmiResults[i]);

      } else if (manufacturer == "dell") {
        r = getDellBiosInfo(wmiResults[i]);
      }
      if (!r.empty()) {
        results.push_back(r);
      }
    }
  } else {
    LOG(INFO) << "Vendor \"" << manufacturer << "\" is currently not supported";
  }
  return results;
}
Exemplo n.º 4
0
bool EMULATOR_SESSION_CLASS::serialise(FILE *file_ptr)

//  DESCRIPTION     : Serialise the script session to file.
//  PRECONDITIONS   :
//  POSTCONDITIONS  :
//  EXCEPTIONS      :
//  NOTES           :
//<<===========================================================================
{
	// write the file contents
	fprintf(file_ptr, "SESSION\n\n");
	fprintf(file_ptr, "SESSION-TYPE emulator\n");
	fprintf(file_ptr, "SESSION-FILE-VERSION %d\n", CURRENT_SESSION_FILE_VERSION);

	fprintf(file_ptr, "\n# Product Test Session Properties\n");
	fprintf(file_ptr, "SESSION-TITLE \"%s\"\n", getSessionTitle());
	fprintf(file_ptr, "SESSION-ID %03d\n", getSessionId());
	fprintf(file_ptr, "MANUFACTURER \"%s\"\n", getManufacturer());
	fprintf(file_ptr, "MODEL-NAME \"%s\"\n", getModelName());
	fprintf(file_ptr, "SOFTWARE-VERSIONS \"%s\"\n", getSoftwareVersions());
	fprintf(file_ptr, "APPLICATION-ENTITY-NAME \"%s\"\n", getApplicationEntityName());
	fprintf(file_ptr, "APPLICATION-ENTITY-VERSION \"%s\"\n", getApplicationEntityVersion());
	fprintf(file_ptr, "TESTED-BY \"%s\"\n", getTestedBy());
	fprintf(file_ptr, "DATE \"%s\"\n", getDate());

    fprintf(file_ptr, "\n# SUT ACSE Properties\n");
	fprintf(file_ptr, "SUT-ROLE ");
	switch(getSutRole())
    {
    case UP_ACCEPTOR_REQUESTOR:
        fprintf(file_ptr, "acceptorAndRequestor\n");
        break;
    case UP_ACCEPTOR:
        fprintf(file_ptr, "acceptor\n");
        break;
    case UP_REQUESTOR:
        fprintf(file_ptr, "requestor\n");
        break;
    default:
        break;
    }
	fprintf(file_ptr, "SUT-AE-TITLE \"%s\"\n", getSutAeTitle());
	fprintf(file_ptr, "SUT-MAXIMUM-LENGTH-RECEIVED %d\n", getSutMaximumLengthReceived());
	fprintf(file_ptr, "SUT-IMPLEMENTATION-CLASS-UID \"%s\"\n", getSutImplementationClassUid());
	fprintf(file_ptr, "SUT-IMPLEMENTATION-VERSION-NAME ");
	if (getSutImplementationVersionName())
		fprintf(file_ptr, "\"%s\"\n", getSutImplementationVersionName());
	else
		fprintf(file_ptr, "\"\"\n");

	fprintf(file_ptr, "\n# DVT ACSE Properties\n");
	fprintf(file_ptr, "DVT-AE-TITLE \"%s\"\n", getDvtAeTitle());
	fprintf(file_ptr, "DVT-MAXIMUM-LENGTH-RECEIVED %d\n", getDvtMaximumLengthReceived());
	fprintf(file_ptr, "DVT-IMPLEMENTATION-CLASS-UID \"%s\"\n", getDvtImplementationClassUid());
	fprintf(file_ptr, "DVT-IMPLEMENTATION-VERSION-NAME ");
	if (getDvtImplementationVersionName())
		fprintf(file_ptr, "\"%s\"\n", getDvtImplementationVersionName());
	else
		fprintf(file_ptr, "\"\"\n");

	fprintf(file_ptr, "\n# Socket Properties\n");
	fprintf(file_ptr, "SUT-HOSTNAME \"%s\"\n", getSutHostname());
	fprintf(file_ptr, "SUT-PORT %d\n", getSutPort());
	fprintf(file_ptr, "DVT-PORT %d\n", getDvtPort());
	fprintf(file_ptr, "DVT-SOCKET-TIMEOUT %d\n", getDvtSocketTimeout());
	fprintf(file_ptr, "USE-SECURE-SOCKETS %s\n", (getUseSecureSockets()) ? "true" : "false");
	fprintf(file_ptr, "TLS-VERSION \"%s\"\n", getTlsVersion());
	fprintf(file_ptr, "CHECK-REMOTE-CERTIFICATE %s\n", (getCheckRemoteCertificate()) ? "true" : "false");
	fprintf(file_ptr, "CIPHER-LIST \"%s\"\n", getCipherList());
	fprintf(file_ptr, "CACHE-TLS-SESSIONS %s\n", (getCacheTlsSessions()) ? "true" : "false");
	fprintf(file_ptr, "TLS-CACHE-TIMEOUT %d\n", getTlsCacheTimeout());
	fprintf(file_ptr, "CREDENTIALS-FILENAME \"%s\"\n", getCredentialsFilename().c_str());
	fprintf(file_ptr, "CERTIFICATE-FILENAME \"%s\"\n", getCertificateFilename().c_str());

	fprintf(file_ptr, "\n# Test Session Properties\n");
	fprintf(file_ptr, "LOG-ERROR %s\n", (isLogLevel(LOG_ERROR)) ? "true" : "false");
	fprintf(file_ptr, "LOG-WARNING %s\n", (isLogLevel(LOG_WARNING)) ? "true" : "false");
	fprintf(file_ptr, "LOG-INFO %s\n", (isLogLevel(LOG_INFO)) ? "true" : "false");
	fprintf(file_ptr, "LOG-RELATION %s\n", (isLogLevel(LOG_IMAGE_RELATION)) ? "true" : "false");
	fprintf(file_ptr, "LOG-DEBUG %s\n", (isLogLevel(LOG_DEBUG)) ? "true" : "false");

	fprintf(file_ptr, "LOG-DULP-STATE %s\n", (isLogLevel(LOG_DULP_FSM)) ? "true" : "false");
	fprintf(file_ptr, "LOG-SCP-THREAD %s\n", (getLogScpThread()) ? "true" : "false");
	fprintf(file_ptr, "PDU-DUMP %s\n", (isLogLevel(LOG_PDU_BYTES)) ? "true" : "false");

	fprintf(file_ptr, "STORAGE-MODE ");
	switch(getStorageMode())
	{
	case SM_AS_MEDIA:
		fprintf(file_ptr, "as-media\n");
		break;
	case SM_AS_DATASET:
		fprintf(file_ptr, "as-dataset\n");
		break;
	case SM_NO_STORAGE:
	default:
		fprintf(file_ptr, "no-storage\n");
		break;
	}

	fprintf(file_ptr, "STRICT-VALIDATION %s\n", (getStrictValidation()) ? "true" : "false");
	fprintf(file_ptr, "DETAILED-VALIDATION-RESULTS %s\n", (getDetailedValidationResults()) ? "true" : "false");
	fprintf(file_ptr, "SUMMARY-VALIDATION-RESULTS %s\n", (getSummaryValidationResults()) ? "true" : "false");
	fprintf(file_ptr, "INCLUDE-TYPE-3-NOTPRESENT-INRESULTS %s\n", (getIncludeType3NotPresentInResults()) ? "true" : "false");
	fprintf(file_ptr, "AUTO-TYPE-2-ATTRIBUTES %s\n", (getAutoType2Attributes()) ? "true" : "false");
	fprintf(file_ptr, "DEFINE-SQ-LENGTH %s\n", (getDefineSqLength()) ? "true" : "false");
	fprintf(file_ptr, "ADD-GROUP-LENGTH %s\n", (getAddGroupLength()) ? "true" : "false");

	fprintf(file_ptr, "\n# Supported Transfer Syntaxes\n");
	for (int i = 0; i < noSupportedTransferSyntaxes(); i++)
	{
		fprintf(file_ptr, "SUPPORTED-TRANSFER-SYNTAX \"%s\"\n", getSupportedTransferSyntax(i));
	}

	fprintf(file_ptr, "\n# Definitions\n");
	for (UINT i = 0; i < noDefinitionDirectories(); i++)
	{
		fprintf(file_ptr, "DEFINITION-DIRECTORY \"%s\"\n", getDefinitionDirectory(i).c_str());
	}

	for (unsigned int j = 0; j < noDefinitionFiles(); j++)
	{
		DEFINITION_FILE_CLASS *definitionFile_ptr = getDefinitionFile(j);
		fprintf(file_ptr, "DEFINITION \"%s\"\n", definitionFile_ptr->getFilename());
	}

	fprintf(file_ptr, "\n# Results\n");
	fprintf(file_ptr, "RESULTS-ROOT \"%s\"\n", getResultsRoot());
	fprintf(file_ptr, "APPEND-TO-RESULTS-FILE %s\n", (getAppendToResultsFile()) ? "true" : "false");

	fprintf(file_ptr, "\n# Data Directory\n");
	fprintf(file_ptr, "DATA-DIRECTORY \"%s\"\n", getDataDirectory());

	fprintf(file_ptr, "\n# DICOMScript Description Directory\n");
	fprintf(file_ptr, "DESCRIPTION-DIRECTORY \"%s\"\n", getDescriptionDirectory().c_str());

	fprintf(file_ptr, "\nENDSESSION\n");

	// return success
	return true;
}
Exemplo n.º 5
0
    ada::data_t fill_data(std::string const& bada_path, std::string const& aircraft_kind )
    {   
        ada::data_t ac_settings;

        create_proxy_fn_t create_proxy_fn = reinterpret_cast<create_proxy_fn_t> (lib_loader().get_symbol(BADA_DLL,"create_proxy"));
		
		if (create_proxy_fn)
		{
			auto proxy = create_proxy_fn(bada_path);
			//auto proxy = bada::create_proxy(bada_path);

			auto syn_data        = proxy->get_synonim_data(aircraft_kind) ;
            
            if(!syn_data)
                syn_data = proxy->get_synonim_data("A319")  ;

			auto air_data        = proxy->get_aircraft_data(syn_data->getSynonim()) ;
			auto air_global_data = proxy->get_global_data() ;


			ac_settings.base_model        = syn_data->getSynonim();
			ac_settings.manufacturer      = syn_data->getManufacturer();
			ac_settings.model_name        = syn_data->getModelName();
			ac_settings.S                 = air_data->get_S();
			ac_settings.span              = air_data->get_span();
			ac_settings.length            = air_data->get_length();
			ac_settings.engine            = air_data->getEngineType();
			ac_settings.turbulence        = air_data->getWakeCategory();
			ac_settings.cd_0_cruise       = air_data->get_Cd0_cr();
			ac_settings.cd_2_cruise       = air_data->get_Cd2_cr();
			ac_settings.cd_0_approach     = air_data->get_Cd0_ap();
			ac_settings.cd_2_approach     = air_data->get_Cd2_ap();
			ac_settings.cd_0_landing      = air_data->get_Cd0_ld();
			ac_settings.cd_0_landing_gear = air_data->get_Cd0_ldg();
			ac_settings.cd_2_landing      = air_data->get_Cd2_ld();
			ac_settings.cf_1              = air_data->get_Cf_1();
			ac_settings.cf_2              = air_data->get_Cf_2() * cg::kt2mps();
			ac_settings.cf_3              = air_data->get_Cf_3() / 60.;
			ac_settings.cf_4              = air_data->get_Cf_4() * cg::feet2meter();
			ac_settings.cf_cruise         = air_data->get_Cfr();

			switch(ac_settings.engine)
			{
			case bada::jet:
				ac_settings.cf_1 /= (60. * 1000.);
				break;
			case bada::turboprop:
				ac_settings.cf_1 /= (60. * 1000. * cg::kt2mps());
				break;
			case bada::piston:
				ac_settings.cf_1 /= 60.;
				break;
			}

			ac_settings.nominal_ba_to_ld       = 15.; // TODO: make difference to military objects
			ac_settings.nominal_ba             = 35.;
			ac_settings.max_ba_to_ld           = 25.;
			ac_settings.max_ba_hold            = 35.;
			ac_settings.max_ba                 = 45.;
			ac_settings.max_operating_height     = air_data->get_hmo() * cg::feet2meter();
			ac_settings.max_height               = air_data->get_hmax() * cg::feet2meter();
			ac_settings.temperature_gradient     = air_data->get_Gt() * cg::feet2meter();
			ac_settings.mass_gradient            = air_data->get_Gw() * cg::feet2meter();
			ac_settings.max_mass                 = air_data->get_m_max() * 1000;
			ac_settings.min_mass                 = air_data->get_m_min() * 1000;
			ac_settings.max_payload_mass         = air_data->get_m_pyld() * 1000;
			ac_settings.ref_mass                 = air_data->get_m_ref() * 1000;

			if (ac_settings.engine == bada::jet ||ac_settings.engine == bada::piston)
				ac_settings.ct_1 = air_data->get_Ctc_1();
			else // turboprop
				ac_settings.ct_1 = air_data->get_Ctc_1() * cg::kt2mps();

			ac_settings.ct_2  = air_data->get_Ctc_2() * cg::feet2meter();

			if (ac_settings.engine == bada::jet)
				ac_settings.ct_3 = air_data->get_Ctc_3() / cg::sqr(cg::feet2meter());
			else if (ac_settings.engine == bada::turboprop)
				ac_settings.ct_3 = air_data->get_Ctc_3();
			else // piston
				ac_settings.ct_3 = air_data->get_Ctc_3() * cg::kt2mps();

			ac_settings.ct_4                     = air_data->get_Ctc_4();
			ac_settings.ct_5                     = air_data->get_Ctc_5();
			ac_settings.ct_descent_low           = air_data->get_Ct_des_low();
			ac_settings.descent_height_level     = air_data->get_Hp_des() * cg::feet2meter();
			ac_settings.ct_descent_high          = air_data->get_Ct_des_high();
			ac_settings.ct_descent_approach      = air_data->get_Ct_des_app();
			ac_settings.ct_descent_landing       = air_data->get_Ct_des_ld();
			ac_settings.V_1[fms::climb_stage]    = air_data->getDataCLS().getStandardCAS().first * cg::kt2mps();
			ac_settings.V_1[fms::cruise_stage]   = air_data->getDataCRS().getStandardCAS().first * cg::kt2mps();
			ac_settings.V_1[fms::descent_stage]  = air_data->getDataDS().getStandardCAS().first * cg::kt2mps();
			ac_settings.V_2[fms::climb_stage]    = air_data->getDataCLS().getStandardCAS().second * cg::kt2mps();
			ac_settings.V_2[fms::cruise_stage]   = air_data->getDataCRS().getStandardCAS().second * cg::kt2mps();
			ac_settings.V_2[fms::descent_stage]  = air_data->getDataDS().getStandardCAS().second * cg::kt2mps();
			ac_settings.M[fms::climb_stage]      = air_data->getDataCLS().getMach();
			ac_settings.M[fms::cruise_stage]     = air_data->getDataCRS().getMach();
			ac_settings.M[fms::descent_stage]    = air_data->getDataDS().getMach();

			// jet
			ac_settings.v_d_cl[0]       = 5 * cg::kt2mps();
			ac_settings.v_d_cl[1]       = 10 * cg::kt2mps();
			ac_settings.v_d_cl[2]       = 30 * cg::kt2mps();
			ac_settings.v_d_cl[3]       = 60 * cg::kt2mps();
			ac_settings.v_d_cl[4]       = 80 * cg::kt2mps();
			// turboprop/piston
			ac_settings.v_d_cl[5]       = 20 * cg::kt2mps();
			ac_settings.v_d_cl[6]       = 30 * cg::kt2mps();
			ac_settings.v_d_cl[7]       = 35 * cg::kt2mps();

			// jet/turboprop
			ac_settings.v_d_des[0]      = 5 * cg::kt2mps();
			ac_settings.v_d_des[1]      = 10 * cg::kt2mps();
			ac_settings.v_d_des[2]      = 20 * cg::kt2mps();
			ac_settings.v_d_des[3]      = 50 * cg::kt2mps();
			// piston
			ac_settings.v_d_des[4]      = 5 * cg::kt2mps();
			ac_settings.v_d_des[5]      = 10 * cg::kt2mps();
			ac_settings.v_d_des[6]      = 20 * cg::kt2mps();

			ac_settings.v_stall_to = air_data->get_Vstall_to() * cg::kt2mps();
			ac_settings.v_stall_ic = air_data->get_Vstall_ic() * cg::kt2mps();
			ac_settings.v_stall_cr = air_data->get_Vstall_cr() * cg::kt2mps();
			ac_settings.v_stall_ap = air_data->get_Vstall_ap() * cg::kt2mps();
			ac_settings.v_stall_ld = air_data->get_Vstall_ld() * cg::kt2mps();

			ac_settings.v_rw_backtrack = 35 * cg::kt2mps();
			ac_settings.v_taxi         = 15 * cg::kt2mps();
			ac_settings.v_apron        = 10 * cg::kt2mps();
			ac_settings.v_gate         = 5 * cg::kt2mps();

			ac_settings.c_v_min    = air_global_data->getCVmin(0).second;
			ac_settings.c_v_min_to = 1.2;
			ac_settings.h_descent  = air_data->get_Hp_des() * cg::feet2meter();

			ac_settings.h_max_to = 400 * cg::feet2meter();
			ac_settings.h_max_ic = 2000 * cg::feet2meter();
			ac_settings.h_max_ap = 8000 * cg::feet2meter();
			ac_settings.h_max_ld = 3000 * cg::feet2meter();

			ac_settings.takeoff_length = 0.75 * air_data->get_TOL();
			ac_settings.landing_length = air_data->get_LDL();
			ac_settings.max_cas = air_data->get_Vmo() * cg::kt2mps();
			ac_settings.max_mach = air_data->get_Mmo();
		}

        return ac_settings;
    }
	std::string ModuleIdentifier::toString() {
		return "{\"manufacturer\":" + getManufacturer() + "\"typeNumber\":" + getTypeNumber() + "\"serialNumber\":" + getSerialNumber() + "}";
	}