Beispiel #1
0
void KaaClient::start()
{
#ifdef KAA_USE_CONFIGURATION
    auto configHash = configurationPersistenceManager_->getConfigurationHash().getHashDigest();
    if (configHash.empty()) {
        SequenceNumber sn = { 0, 0, 1 };
        status_->setAppSeqNumber(sn);
        setDefaultConfiguration();
    }
#endif
    bootstrapManager_->receiveOperationsServerList();
}
Beispiel #2
0
Preferences::Preferences(QWidget* parent)
: QDialog(parent), lastDirectory("."), m_Data(), m_TemporaryCycleSettings()
{
  this->resetTemporaryCycleSettingsData();
  this->setupUi(this);
  
  connect(this->defaultConfigurationButton, SIGNAL(clicked()), this, SLOT(setDefaultConfiguration()));
  connect(this->defaultBackgroundColorButton, SIGNAL(clicked()), this, SLOT(setDefaultBackgroundColor()));
  connect(this->defaultGridFrontColorButton, SIGNAL(clicked()), this, SLOT(setDefaultGridFrontColor()));
  connect(this->defaultGridBackColorButton, SIGNAL(clicked()), this, SLOT(setDefaultGridBackColor()));
  connect(this->defaultSegmentColorButton, SIGNAL(clicked()), this, SLOT(setDefaultSegmentColor()));
  connect(this->defaultMarkerColorButton, SIGNAL(clicked()), this, SLOT(setDefaultMarkerColor()));
  connect(this->defaultForcePlateColorButton, SIGNAL(clicked()), this, SLOT(setDefaultForcePlateColor()));
  connect(this->defaultForceVectorColorButton, SIGNAL(clicked()), this, SLOT(setDefaultForceVectorColor()));
  connect(this->chartCycleSettingsList, SIGNAL(currentRowChanged(int)), this, SLOT(enableChartCycleButtons(int)));
  connect(this->addChartCycleButton, SIGNAL(clicked()), this, SLOT(addChartCycleSetting()));
  connect(this->removeChartCycleButton, SIGNAL(clicked()), this, SLOT(removeChartCycleSetting()));
  connect(this->editChartCycleButton, SIGNAL(clicked()), this, SLOT(editChartCycleSetting()));
  connect(this->layoutTable, SIGNAL(userLayoutRemoved(int)), this, SLOT(removeUserLayout(int)));
  connect(this->layoutTable, SIGNAL(userLayoutLabelChanged(int, QString)), this, SLOT(relabelUserLayout(int, QString)));
  connect(this->layoutTable, SIGNAL(userLayoutDropped(int, int)), this, SLOT(updateDroppedUserLayouts(int, int)));
  connect(this->defaultTimeBarEventDisplayComboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(forceChartUnitAxisX(int)));
  
  this->m_Data[DefaultConfigurationUse] = false;
  this->m_Data[DefaultConfigurationPath] = "";
  this->m_Data[EventEditorWhenInserting] = false;
  this->m_Data[DefaultGroundOrientation] = -1;
  this->m_Data[DefaultTimeBarEventDisplay] = -1;
  this->m_Data[DefaultBackgroundColor] = QColor();
  this->m_Data[DefaultGridBackColor] = QColor();
  this->m_Data[DefaultGridFrontColor] = QColor();
  this->m_Data[DefaultSegmentColor] = QColor();
  this->m_Data[DefaultMarkerColor] = QColor();
  this->m_Data[DefaultMarkerRadius] = -1;
  this->m_Data[DefaultTrajectoryLength] = -1;
  this->m_Data[ForcePlatformAxesDisplay] = -1;
  this->m_Data[ForcePlatformIndexDisplay] = -1;
  this->m_Data[DefaultForcePlateColor] = QColor();
  this->m_Data[DefaultForceVectorColor] = QColor();
  this->m_Data[DefaultGRFButterflyActivation] = -1;
  this->m_Data[ForcePathDisplay] = -1;
  this->m_Data[UserLayoutIndex] = -1;
  this->m_Data[UserLayouts] = QList<QVariant>();
  this->m_Data[AutomaticCheckUpdateUse] = false;
  this->m_Data[DevelopmentChannelSubscriptionUsed] = false;
  this->m_Data[DefaultPlotLineWidth] = -1;
  this->m_Data[ChartEventDisplay] = -1;
  this->m_Data[chartUnitAxisX] = -1;

  // Force the General tab to be the current.
  this->tabWidget->setCurrentIndex(0);
};
Beispiel #3
0
void KaaClient::initKaaConfiguration()
{
#ifdef KAA_USE_CONFIGURATION
    ConfigurationPersistenceManager *cpm = new ConfigurationPersistenceManager(status_);
    cpm->setConfigurationProcessor(configurationProcessor_.get());
    configurationPersistenceManager_.reset(cpm);

    configurationProcessor_->addOnProcessedObserver(*configurationManager_);
    configurationProcessor_->subscribeForUpdates(*configurationManager_);
    configurationManager_->subscribeForConfigurationChanges(*configurationPersistenceManager_);

    SequenceNumber sn = { 0, 0, 1 };
    status_->setAppSeqNumber(sn);
    setDefaultConfiguration();
#endif
}
    //___________________________________________________
    bool Factory::readConfig()
    {

        bool changed( false );

        /*
        always reload helper
        this is needed to properly handle
        color contrast settings changed
        */
        helper().invalidateCaches();
        helper().reloadConfig();

        // create a config object
        KConfig config("oxygenrc");
        KConfigGroup group( config.group("Windeco") );
        Configuration configuration( group );

        if( configuration.opacityFromStyle() )
        { configuration.readBackgroundOpacity( config.group("Common") ); }

        if( !( configuration == defaultConfiguration() ) )
        {
            setDefaultConfiguration( configuration );
            changed = true;
        }

        // read exceptionsreadConfig
        ExceptionList exceptions( config );
        if( !( exceptions == _exceptions ) )
        {
            _exceptions = exceptions;
            changed = true;
        }

        // read shadowCache configuration
        changed |= shadowCache().readConfig( config );

        // background pixmap
        {
            KConfigGroup group( config.group("Common") );
            helper().setBackgroundPixmap( group.readEntry( "BackgroundPixmap", "" ) );
        }

        return changed;

    }
void resetConfigurationExt(Logging * logger, engine_type_e engineType DECLARE_ENGINE_PARAMETER_S) {
	/**
	 * Let's apply global defaults first
	 */
	setDefaultConfiguration(PASS_ENGINE_PARAMETER_F);
#if EFI_SIMULATOR || defined(__DOXYGEN__)
	engineConfiguration->directSelfStimulation = true;
#endif /* */
	engineConfiguration->engineType = engineType;
	engineConfiguration->headerMagicValue = HEADER_MAGIC_NUMBER;

	/**
	 * And override them with engine-specific defaults
	 */
	switch (engineType) {
	case CUSTOM_ENGINE:
		setCustomEngineConfiguration(PASS_ENGINE_PARAMETER_F);
		break;
	case ACURA_RSX:
		setAcuraRSX(engineConfiguration);
		break;
#if EFI_SUPPORT_DODGE_NEON || defined(__DOXYGEN__)
	case DODGE_NEON_1995:
		setDodgeNeon1995EngineConfiguration(PASS_ENGINE_PARAMETER_F);
		break;
	case DODGE_NEON_2003:
		setDodgeNeonNGCEngineConfiguration(PASS_ENGINE_PARAMETER_F);
		break;
#endif /* EFI_SUPPORT_DODGE_NEON */
#if EFI_SUPPORT_FORD_ASPIRE || defined(__DOXYGEN__)
	case FORD_ASPIRE_1996:
		setFordAspireEngineConfiguration(PASS_ENGINE_PARAMETER_F);
		break;
#endif /* EFI_SUPPORT_FORD_ASPIRE */
#if EFI_SUPPORT_FORD_FIESTA || defined(__DOXYGEN__)
	case FORD_FIESTA:
		setFordFiestaDefaultEngineConfiguration(PASS_ENGINE_PARAMETER_F);
		break;
#endif /* EFI_SUPPORT_FORD_FIESTA */
#if EFI_SUPPORT_NISSAN_PRIMERA || defined(__DOXYGEN__)
	case NISSAN_PRIMERA:
		setNissanPrimeraEngineConfiguration(engineConfiguration);
		break;
#endif
	case HONDA_ACCORD_CD:
		setHondaAccordConfigurationThreeWires(PASS_ENGINE_PARAMETER_F);
		break;
	case HONDA_ACCORD_CD_TWO_WIRES:
		setHondaAccordConfiguration1_24(PASS_ENGINE_PARAMETER_F);
		break;
	case HONDA_ACCORD_CD_DIP:
		setHondaAccordConfigurationDip(PASS_ENGINE_PARAMETER_F);
		break;
	case MITSU_4G93:
		setMitsubishiConfiguration(PASS_ENGINE_PARAMETER_F);
		break;
#if EFI_SUPPORT_1995_FORD_INLINE_6 || defined(__DOXYGEN__)
	case FORD_INLINE_6_1995:
		setFordInline6(PASS_ENGINE_PARAMETER_F);
		break;
#endif /* EFI_SUPPORT_1995_FORD_INLINE_6 */
	case GY6_139QMB:
		setGy6139qmbDefaultEngineConfiguration(PASS_ENGINE_PARAMETER_F);
		break;
	case MAZDA_MIATA_NB:
		setMazdaMiataNbEngineConfiguration(PASS_ENGINE_PARAMETER_F);
		break;
	case MAZDA_323:
		setMazda323EngineConfiguration(engineConfiguration);
		break;
	case MAZDA_626:
		setMazda626EngineConfiguration(PASS_ENGINE_PARAMETER_F);
		break;
	case SATURN_ION_2004:
		setSaturnIonEngineConfiguration(engineConfiguration);
		break;
	case MINI_COOPER_R50:
		setMiniCooperR50(engineConfiguration);
		break;
	case FORD_ESCORT_GT:
		setFordEscortGt(PASS_ENGINE_PARAMETER_F);
		break;
	case MIATA_1990:
		setMiata1990(PASS_ENGINE_PARAMETER_F);
		break;
	case MIATA_1994_DEVIATOR:
		setMiata1994_d(PASS_ENGINE_PARAMETER_F);
		break;
	case MIATA_1994_SPAGS:
		setMiata1994_s(PASS_ENGINE_PARAMETER_F);
		break;
	case MIATA_1996:
		setMiata1996(PASS_ENGINE_PARAMETER_F);
		break;
	case CITROEN_TU3JP:
		setCitroenBerlingoTU3JPConfiguration(PASS_ENGINE_PARAMETER_F);
		break;
	case ROVER_V8:
		setRoverv8(PASS_ENGINE_PARAMETER_F);
		break;
	case SUBARU_2003_WRX:
		setSubaru2003Wrx(PASS_ENGINE_PARAMETER_F);
		break;
	case BMW_E34:
		setBmwE34(PASS_ENGINE_PARAMETER_F);
		break;
	case GM_2_2:
		setGm2_2(PASS_ENGINE_PARAMETER_F);
		break;
	case DODGE_RAM:
		setDodgeRam1996(PASS_ENGINE_PARAMETER_F);
		break;
	case DODGE_STRATUS:
		setDodgeStratus(PASS_ENGINE_PARAMETER_F);
		break;
	case VW_ABA:
		setVwAba(PASS_ENGINE_PARAMETER_F);
		break;
	case TEST_ENGINE:
		setTestEngineConfiguration(PASS_ENGINE_PARAMETER_F);
		break;
	case SACHS:
		setSachs(PASS_ENGINE_PARAMETER_F);
		break;
	case DAIHATSU:
		setDaihatsu(PASS_ENGINE_PARAMETER_F);
		break;

	default:
		warning(OBD_PCM_Processor_Fault, "Unexpected engine type: %d", engineType);
	}
	applyNonPersistentConfiguration(logger PASS_ENGINE_PARAMETER);
	// todo: eliminate triggerShape.operationMode?
	if (engineConfiguration->operationMode != engine->triggerShape.getOperationMode())
		firmwareError("operationMode mismatch");

#if EFI_TUNER_STUDIO
	syncTunerStudioCopy();
#endif
}
Beispiel #6
0
int loadLoaderModules(int debug_mode, int disable_cdrom)
{
	static int load_dvd_config = -1;
	static int load_netsurf_config = -1;
	static int load_usb_config = -1;
	int i;
	int rv;
	int lrv = -1;

	if (debug_mode == 1) {
		/* Network is used by ps2link and can't be used by Linux. */
		network_support = 0;
	}

#ifdef RESET_IOP
	if (debug_mode == -1) {
		graphic_setStatusMessage("Flushing cache");
		FlushCache(0);
		graphic_setStatusMessage("Exit IOP Heap");
		SifExitIopHeap();
		graphic_setStatusMessage("Exit LoadFile");
		SifLoadFileExit();
		graphic_setStatusMessage("Exit FIO");
		fioExit();
		graphic_setStatusMessage("Exit RPC");
		SifExitRpc();
		graphic_setStatusMessage("Stop DMA");
		SifStopDma();
		graphic_setStatusMessage("PreReset Init RPC");
		SifInitRpc(0);
		graphic_setStatusMessage("Reseting IOP");
		while(!SifIopReset(s_pUDNL, 0));

		graphic_setStatusMessage("IOP Sync");
		while (!SifIopSync());

		graphic_setStatusMessage("Initialize RPC");
		SifInitRpc(0);
	}
#endif

	graphic_setStatusMessage("Patching enable LMB");
	sbv_patch_enable_lmb();
	graphic_setStatusMessage("Patching disable prefix check");
	sbv_patch_disable_prefix_check();

	/* CDVDMAN is loaded by IopReset and NVRAM can be read. */
	graphic_setStatusMessage("Read NVRAM from CDVD");

	if (!disable_cdrom) {
		nvram_init();
	}

	eromdrvSupport = 0;

	/* FIXME: eedebug handler seems to crash the ee
	graphic_setStatusMessage("Add eedebug handler");
	addEEDebugHandler();
	*/

	graphic_setStatusMessage("Loading modules");
	for (i = 0; i < moduleLoaderNumberOfModules; i++) {
		const rom_entry_t *romfile;

		if (moduleList[i].debug_mode != 0) {
			if (moduleList[i].debug_mode != debug_mode) {
				continue;
			}
		}

		/* Load configuration when necessary modules are loaded. */
		if (moduleList[i].loadCfg) {
			checkForMusicSupport();

			setDefaultConfiguration(NULL);

			lrv = loadConfiguration(CONFIG_FILE);

			changeMode();

			/* Load configuration on startup and not on IOP reset. */
			moduleList[i].loadCfg = 0;
		}
		graphic_setStatusMessage(moduleList[i].path);
		kprintf("Loading module (%s)\n", moduleList[i].path);

		if (!network_support) {
			if (moduleList[i].network) {
				continue;
			}
		}

		if (moduleList[i].ps2smap) {
			moduleList[i].args = getPS2MAPParameter(&moduleList[i].argLen);
		}
		if (moduleList[i].dns) {
			moduleList[i].args = getPS2DNS(&moduleList[i].argLen);
		}
		if (moduleList[i].checkMc) {
			static char file[256];

			/* Try to load module from MC if available. */
			snprintf(file, sizeof(file), CONFIG_DIR "/%s", moduleList[i].path);
			rv = SifLoadModule(file, moduleList[i].argLen, moduleList[i].args);
		} else {
			rv = -1;
		}
		if (rv < 0) {
			if ((moduleList[i].sms_mod == 0) || (isDVDVSupported())) {
				if (moduleList[i].eromdrv < 0) {
					/* Try to detect EROM driver only the first time. */
					moduleList[i].eromdrv = 1;
					if (disable_cdrom) {
						continue;
					}

					rv = open("rom1:EROMDRV", O_RDONLY);
					if (rv >=0 ) {
						eromdrvpath[12] = 0;

						/* This is an old fat PS2 (working with SCPH-50004 and SCPH-39004). */
						close(rv);
					} else {
						const u8 *nvm;

						nvm = get_nvram();
						if (nvm_errors == 0) {
							/* NVM layout seems to be correct. */
							eromdrvpath[12] = nvm[NVM_REAL_REGION];
							rv = open(eromdrvpath, O_RDONLY);
							if (rv >=0 ) {
								/* Region code seems to be correct. */
								close(rv);
							} else {
								error_printf("The region code stored in the NVRAM S%02x T%02x F%02x R%02x "
									"can't be detected by version string %s (%s).",
									nvm[0x180],
									nvm[0x181],
									nvm[NVM_FAKE_REGION],
									nvm[NVM_REAL_REGION],
									ps2_rom_version);
								continue;
							}
						} else {
							error_printf("%d errors when reading NVRAM. Please set path "
								"to EROMDRV and reload modules.", nvm_errors);
							continue;
						}
					}
				}
				if (moduleList[i].eromdrv != 0) {
					moduleList[i].args = get_eromdrvpath();
					moduleList[i].argLen = strlen(moduleList[i].args) + 1;
				}
				romfile = rom_getFile(moduleList[i].path);
				if (romfile != NULL) {
					int ret;

					ret = SifExecModuleBuffer((void *) romfile->start, romfile->size, moduleList[i].argLen, moduleList[i].args, &rv);
					if (ret < 0) {
						rv = ret;
					}
				} else {
					rv = SifLoadModule(moduleList[i].path, moduleList[i].argLen, moduleList[i].args);
				}
				if (rv < 0) {
					if (moduleList[i].eromdrv != 0) {
						kprintf("Failed to load module \"%s\".\n", get_eromdrvpath());
					} else {
						kprintf("Failed to load module \"%s\".\n", moduleList[i].path);
					}
					if (moduleList[i].ps2smap && !isSlimPSTwo()) {
						network_support = 0;
					} else {
						if (moduleList[i].eromdrv != 0) {
							error_printf("Failed to load module \"%s\".", get_eromdrvpath());
						} else {
							error_printf("Failed to load module \"%s\".", moduleList[i].path);
						}
					}
				} else {
					if (moduleList[i].eromdrv != 0) {
						eromdrvSupport = -1;
					}
				}
			}
		}
	}
	graphic_setStatusMessage(NULL);
	printAllModules();

	fileXioInit();

	if (load_netsurf_config) {
		load_netsurf_config = 0;

		if (lrv != 0) {
			graphic_setStatusMessage("Check for NetSurf config");

			lrv = loadConfiguration(PS2NS_CONFIG_FILE);

			graphic_setStatusMessage(NULL);
		}
	}

	if (load_usb_config) {
		load_usb_config = 0;

		if (lrv != 0) {
			graphic_setStatusMessage("Check for USB config");

			lrv = loadConfiguration(USB_CONFIG_FILE);

			graphic_setStatusMessage(NULL);
		}
	}

	if (load_dvd_config && isDVDVSupported()) {
		load_dvd_config = 0;

		graphic_setStatusMessage("Init DVD driver");

		CDDA_Init();
		CDVD_Init();

		if (lrv != 0) {
			DiskType type;

			graphic_setStatusMessage("Load config from DVD");

			type = CDDA_DiskType();

			if (type == DiskType_DVDV) {
				CDVD_SetDVDV(1);
			} else {
				CDVD_SetDVDV(0);
			}

			kprintf("kloader disc type %u\n", type);
			switch (type) {
			case DiskType_CD:
			case DiskType_DVD:
			case DiskType_DVDV:
				/* Load configuration from disc. */
				lrv = loadConfiguration(DVD_CONFIG_FILE);

				changeMode();
#if 0
				if (lrv != 0) {
					error_printf("Failed to load config from \"%s\", using default configuration.", DVD_CONFIG_FILE);
				}
#endif
				break;
			default:
				kprintf("kloader unsupported disc type %u\n", type);
				break;
			}

			/* Stop CD when finished. */
			CDVD_Stop();
			CDVD_FlushCache();
		}
		graphic_setStatusMessage(NULL);
	}

	snprintf(hardware_information, sizeof(hardware_information),
		"%s with DVD-R %s, %s sound support and %s network adapter",
		isSlimPSTwo() ? "slim PSTwo" : "fat PS2",
		disable_cdrom ? "disabled" : (isDVDVSupported() ? "support" : "problem"),
		(libsd_version <= 0x104) ? "direct" : "indirect",
		network_support ? "with" : "without");

	return 0;
}