void SetActiveView::update() {

	unsigned char newInstrument = 0;
	bool wasInstrumentSelected = instrumentButtons_.getSelectedButton(newInstrument);

	panButtons_.update();
	instrumentButtons_.update();
	stepButtons_.update();

	bool isInstrumentSelected = instrumentButtons_.getSelectedButton(newInstrument);
	if ((isInstrumentSelected != wasInstrumentSelected) ||
	    (isInstrumentSelected && (currentInstrumentIndex_ != newInstrument))) {
		currentInstrumentIndex_ = isInstrumentSelected ? newInstrument : currentInstrumentIndex_;
		currentPanIndex_ = 0;
		panButtons_.setSelectedButton(0);
		updateConfiguration();
		return;
	}
	bool shift = LEDsAndButtonsHWWrapper::isButtonDown(SekvojModulePool::buttonMap_->getFunctionButtonIndex());
	if (shift) {

		//We take the highest currently pressed pan
		//to increase number of active steps up to that pan
		for (unsigned char pan = 0; pan < 4; pan++) {
			if (LEDsAndButtonsHWWrapper::isButtonDown(SekvojModulePool::buttonMap_getSubStepButtonIndex(pan))) {
				setActiveUpTo(((pan + 1) * 16) - 1, isInstrumentSelected);
				updateConfiguration();
				break;
			}
		}
		//Change back selected pan since in shift mode changes are not allowed
		panButtons_.setSelectedButton(currentPanIndex_);
	} else {
		unsigned char newPan = 0;
		if (panButtons_.getSelectedButton(newPan) && currentPanIndex_ != newPan) {
			currentPanIndex_ = newPan;
			updateConfiguration();
			return;
		}
	}
	for (unsigned char i = 0; i < 16; i++) {

		// Check whether the status of the step button has been changed
		bool lastState = GETBIT(currentStatuses_, i);
		bool newState = LEDsAndButtonsHWWrapper::hw_->getButtonState(SekvojModulePool::buttonMap_->getStepButtonIndex(i));
		bool stateChanged =  newState != lastState;
		setBit(currentStatuses_, i, newState);

		unsigned char pressedStep = (currentPanIndex_ * 16) + i;
		if (stateChanged) {
			//Update
			setActiveUpTo(pressedStep, isInstrumentSelected);
			updateConfiguration();
		}
	}
}
예제 #2
0
    DigitalPin::DigitalPin(Port port,
                           uint8_t pinNo,
                           Direction direction,
                           Speed speed,
                           OutputType outputType,
                           PullSetting pullSetting
    ) : pinNo(pinNo), config() {
        config.port = port;
        config.pins = getPinByNo(pinNo);

        if(direction == IN) {
            config.mode = Modes::DIGITAL_IN;
        } else if (direction == OUT){
            config.mode = Modes::DIGITAL_OUT;
        } else {
            Reporter::reportError("DigitalPin()","bad direction");
        }

        config.speed = speed;
        config.outputType = outputType;
        config.pullSetting = pullSetting;

        enablePeriphClock(port);
        updateConfiguration();

        clear(); // initialize output in off mode
    }
예제 #3
0
static void
atConfigChangedCallback(SCDynamicStoreRef store, CFArrayRef changedKeys, void *arg)
{
	boolean_t	configChanged;
	int		newState;

	configChanged = updateConfiguration(&newState);

	if (configChanged && (execCommand == 0)) {
		// if the configuration has changed and we're not already transitioning
		if (newState > 0) {
			if (curState > 0) {
				// already running, restart [with new configuration]
				stopAppleTalk(NULL, (void *)newState);
			} else {
				startAppleTalk(NULL, (void *)newState);
			}
		} else {
			if (curState > 0) {
				stopAppleTalk(NULL, (void *)newState);
			}
		}
	}

	curState = newState;

	return;
}
예제 #4
0
파일: glue.c 프로젝트: alfateam123/yukon
void glueDrawable(Display *dpy, GLXDrawable drawable)
{
        if (hotkeyPressed && engine == NULL) {
		hotkeyPressed = 0;

		/* reload configuration in case it changed */
		updateConfiguration();

		Window root;
		unsigned int width, height, unused;
		XGetGeometry(dpy, drawable, &root, (int *)&unused, (int *)&unused, &width, &height, &unused, &unused);

		unsigned long size[2] = { width, height };

		/* create the main engine */
		engine = yukonEngineCreate(yukonGlobal.output, yukonGlobal.scale, size);
		if (engine) {
			logMessage(4, "Yukon engine is active now\n");
		} else {
			logMessage(4, "Failed to create the yukon engine\n");
		}
	}

	if (engine)
		yukonEngineCapture(engine);
}
예제 #5
0
int NavigationView::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
    _id = QGraphicsView::qt_metacall(_c, _id, _a);
    if (_id < 0)
        return _id;
    if (_c == QMetaObject::InvokeMetaMethod) {
        switch (_id) {
        case 0: mouseAtGeoPos((*reinterpret_cast< const QPointF(*)>(_a[1]))); break;
        case 1: newPointAdded((*reinterpret_cast< const QPointF(*)>(_a[1]))); break;
        case 2: newLineAdded((*reinterpret_cast< QPointF(*)>(_a[1])),(*reinterpret_cast< QPointF(*)>(_a[2]))); break;
        case 3: newLandmarkAdded((*reinterpret_cast< const QPointF(*)>(_a[1]))); break;
        case 4: setRoverPosAndHeading((*reinterpret_cast< const QPointF(*)>(_a[1])),(*reinterpret_cast< qreal(*)>(_a[2]))); break;
        case 5: setRoverPosition((*reinterpret_cast< const QPointF(*)>(_a[1]))); break;
        case 6: setRoverHeading((*reinterpret_cast< qreal(*)>(_a[1]))); break;
        case 7: updateConfiguration(); break;
        case 8: plotLineForSelected(); break;
        case 9: plotLineForPoints((*reinterpret_cast< QPointF(*)>(_a[1])),(*reinterpret_cast< QPointF(*)>(_a[2]))); break;
        case 10: plotLineIntersection(); break;
        case 11: selectPoint((*reinterpret_cast< QPointF(*)>(_a[1])),(*reinterpret_cast< bool(*)>(_a[2]))); break;
        case 12: selectPoint((*reinterpret_cast< QPointF(*)>(_a[1]))); break;
        case 13: clearSelectedPoints(); break;
        case 14: selectLines((*reinterpret_cast< QList<QPair<QPointF,QPointF> >(*)>(_a[1]))); break;
        case 15: clearSelectedLines(); break;
        case 16: deleteSelectedPoints(); break;
        case 17: deleteSelectedLines(); break;
        default: ;
        }
        _id -= 18;
    }
    return _id;
}
예제 #6
0
Configuration& Configuration::operator = (const Configuration& info)
{
	m_hspPath       = info.m_hspPath;
	m_hspCommonPath = info.m_hspCommonPath;
	m_compilerPath  = info.m_compilerPath;

	m_editorTabWidth = info.m_editorTabWidth;
	m_editorLineNumberVisibled = info.m_editorLineNumberVisibled;

	m_editorLineNumberFontName = info.m_editorLineNumberFontName;
	m_editorLineNumberFontSize = info.m_editorLineNumberFontSize;
	m_editorFontName = info.m_editorFontName;
	m_editorFontSize = info.m_editorFontSize;

	for(int i = 0; i < ColorMetricsNum; i++) {
		m_colorMetrics[i] = info.m_colorMetrics[i];
	}

	m_keyAssignInfo  = info.m_keyAssignInfo;

	m_toolbarInfo = info.m_toolbarInfo;

	m_tools = info.m_tools;

	emit updateConfiguration(this);

	return *this;
}
예제 #7
0
파일: miniweb.cpp 프로젝트: jeorgun/miniweb
MiniWeb::MiniWeb(QWidget *parent)
	: KWebView(parent)
{
	load(QUrl("about:blank"));

	connect(page(), SIGNAL(linkHovered(QString, QString, QString)),
			this, SIGNAL(statusBarMessage(QString)));

	updateConfiguration();

	m_vi_mode = true;

	m_loading = false;
	connect(this, SIGNAL(loadStarted()),
			this, SLOT(setLoading()));
	connect(this, SIGNAL(loadFinished(bool)),
			this, SLOT(setNotLoading(bool)));
	connect(this, SIGNAL(loadFinished(bool)),
			this, SLOT(setStatusLoaded(bool)));

	connect(this, SIGNAL(urlChanged(QUrl)),
			this, SLOT(setPageChanged()));
	
	connect(this, SIGNAL(linkMiddleOrCtrlClicked(KUrl)),
			this, SLOT(openInNewWindow(KUrl)));

	connect(page(), SIGNAL(downloadRequested(QNetworkRequest)),
			this, SLOT(download(QNetworkRequest)));
}
예제 #8
0
	Renderer::Renderer(Context *context, Conventions conventions, bool exactColorRounding) : VertexProcessor(context), PixelProcessor(context), SetupProcessor(context), context(context), viewport()
	{
		setGlobalRenderingSettings(conventions, exactColorRounding);

		setRenderTarget(0, nullptr);
		clipper = new Clipper;
		blitter = new Blitter;

		#if PERF_HUD
			resetTimers();
		#endif

		for(int i = 0; i < 16; i++)
		{
			vertexTask[i] = nullptr;

			worker[i] = nullptr;
			resume[i] = nullptr;
			suspend[i] = nullptr;
		}

		threadsAwake = 0;
		resumeApp = new Event();

		currentDraw = 0;
		nextDraw = 0;

		qHead = 0;
		qSize = 0;

		for(int i = 0; i < 16; i++)
		{
			triangleBatch[i] = nullptr;
			primitiveBatch[i] = nullptr;
		}

		for(int draw = 0; draw < DRAW_COUNT; draw++)
		{
			drawCall[draw] = new DrawCall();
			drawList[draw] = drawCall[draw];
		}

		for(int unit = 0; unit < 16; unit++)
		{
			primitiveProgress[unit].init();
		}

		for(int cluster = 0; cluster < 16; cluster++)
		{
			pixelProgress[cluster].init();
		}

		clipFlags = 0;

		swiftConfig = new SwiftConfig(disableServer);
		updateConfiguration(true);

		sync = new Resource(0);
	}
예제 #9
0
 void CBasicAuthentication::onConfigurationUpdated(boost::shared_ptr<database::entities::CConfiguration> newConfiguration)
 {
    if (newConfiguration && boost::iequals(newConfiguration->Section(), m_configurationSection) && boost::iequals(newConfiguration->Name(), m_configurationName))
    {
       YADOMS_LOG(information) << "Authentication settings have changes, reload them";
       updateConfiguration();
    }
 }
예제 #10
0
void ViewportConfiguration::setContentsSize(const IntSize& contentSize)
{
    if (m_contentSize == contentSize)
        return;

    m_contentSize = contentSize;
    updateConfiguration();
}
예제 #11
0
void ViewportConfiguration::setMinimumLayoutSize(const FloatSize& minimumLayoutSize)
{
    if (m_minimumLayoutSize == minimumLayoutSize)
        return;

    m_minimumLayoutSize = minimumLayoutSize;
    updateConfiguration();
}
예제 #12
0
void ViewportConfiguration::setViewportArguments(const ViewportArguments& viewportArguments)
{
    if (m_viewportArguments == viewportArguments)
        return;

    m_viewportArguments = viewportArguments;
    updateConfiguration();
}
예제 #13
0
bool ViewportConfiguration::setCanIgnoreScalingConstraints(bool canIgnoreScalingConstraints)
{
    if (canIgnoreScalingConstraints == m_canIgnoreScalingConstraints)
        return false;
    
    m_canIgnoreScalingConstraints = canIgnoreScalingConstraints;
    updateConfiguration();
    return true;
}
예제 #14
0
bool ViewportConfiguration::setMinimumLayoutSize(const FloatSize& minimumLayoutSize)
{
    if (m_minimumLayoutSize == minimumLayoutSize)
        return false;

    m_minimumLayoutSize = minimumLayoutSize;
    updateConfiguration();
    return true;
}
예제 #15
0
파일: main.c 프로젝트: nvanfleet/Coffeed
static void sigHandle (int sig, siginfo_t *siginfo, void *context)
{
	logger.info("Handled signal: %d",sig);
	updateConfiguration();
	server.shutdown();
	heater.shutdown();
	sensor.shutdown();
	state.run = FALSE;
}
예제 #16
0
void KJotsMain::configure()
{
  if( confdiag )
    return;
  confdiag = new ConfDialog;
  connect( confdiag, SIGNAL(confHide()), this, SLOT(configureHide()) );
  connect( confdiag, SIGNAL(commitChanges()), this, SLOT(updateConfiguration()) );
  confdiag->show();
}
예제 #17
0
bool ViewportConfiguration::setContentsSize(const IntSize& contentSize)
{
    if (m_contentSize == contentSize)
        return false;

    m_contentSize = contentSize;
    updateConfiguration();
    return true;
}
예제 #18
0
bool ViewportConfiguration::setViewportArguments(const ViewportArguments& viewportArguments)
{
    if (m_viewportArguments == viewportArguments)
        return false;

    m_viewportArguments = viewportArguments;
    updateConfiguration();
    return true;
}
void SetActiveView::init(unsigned char currentInstrumentIndex, unsigned char currentPanIndex) {

	currentInstrumentIndex_ = currentInstrumentIndex;
	currentPanIndex_ = currentPanIndex;
	panButtons_ .init(SekvojModulePool::buttonMap_getSubStepButtonArray(), 4);
	instrumentButtons_.init(SekvojModulePool::buttonMap_getInstrumentButtonArray(), 6);
	instrumentButtons_.setSelectedButton(currentInstrumentIndex);
	stepButtons_.init(SekvojModulePool::buttonMap_->getStepButtonArray(), 16);
	updateConfiguration();
}
예제 #20
0
void ViewportConfiguration::setDefaultConfiguration(const ViewportConfiguration::Parameters& defaultConfiguration)
{
    ASSERT(!constraintsAreAllRelative(m_configuration));
    ASSERT(!defaultConfiguration.initialScaleIsSet || defaultConfiguration.initialScale > 0);
    ASSERT(defaultConfiguration.minimumScale > 0);
    ASSERT(defaultConfiguration.maximumScale >= defaultConfiguration.minimumScale);

    m_defaultConfiguration = defaultConfiguration;
    updateConfiguration();
}
예제 #21
0
ViewportConfiguration::ViewportConfiguration()
    : m_minimumLayoutSize(1024, 768)
    , m_canIgnoreScalingConstraints(false)
    , m_forceAlwaysUserScalable(false)
{
    // Setup a reasonable default configuration to avoid computing infinite scale/sizes.
    // Those are the original iPhone configuration.
    m_defaultConfiguration = ViewportConfiguration::webpageParameters();
    updateConfiguration();
}
예제 #22
0
NetctlHelper::NetctlHelper(QObject *parent, QVariantMap args)
    : QObject(parent),
      configPath(args[QString("config")].toString()),
      debug(args[QString("debug")].toBool()),
      session(args[QString("session")].toBool()),
      system(args[QString("system")].toBool())
{
    updateConfiguration();
    if (!args[QString("nodaemon")].toBool()) daemon(0, 0);
}
예제 #23
0
__private_extern__
void
prime_PreferencesMonitor()
{
	SCLog(_verbose, LOG_DEBUG, CFSTR("prime() called"));

	/* load the initial configuration from the database */
	updateConfiguration(prefs, kSCPreferencesNotificationApply, (void *)store);

	return;
}
예제 #24
0
   CBasicAuthentication::CBasicAuthentication(boost::shared_ptr<dataAccessLayer::IConfigurationManager> configurationManager, bool skipPasswordCheck)
      :m_configurationManager(configurationManager), m_skipPasswordCheck(skipPasswordCheck)
   {
      if (!m_skipPasswordCheck)
      {
         //read configuration from database
         updateConfiguration();

         m_observer = notification::CHelpers::subscribeBasicObserver<database::entities::CConfiguration>(boost::bind(&CBasicAuthentication::onConfigurationUpdated, this, _1));
      }
   }
void UIActionPool::prepare()
{
    /* Prepare pool: */
    preparePool();
    /* Prepare connections: */
    prepareConnections();
    /* Update configuration: */
    updateConfiguration();
    /* Update shortcuts: */
    updateShortcuts();
}
예제 #26
0
void Netctl::readConfiguration()
{
    if (debug) qDebug() << "[DE]" << "[readConfiguration]";

    // default configuration
    QMap<QString, QString> rawConfig;
    rawConfig[QString("CMD")] = QString("/usr/bin/netctl");
    rawConfig[QString("EXTIP")] = QString("false");
    rawConfig[QString("EXTIPCMD")] = QString("wget -qO- http://ifconfig.me/ip");
    rawConfig[QString("IPCMD")] = QString("/usr/bin/ip");
    rawConfig[QString("NETDIR")] = QString("/sys/class/net/");
    rawConfig[QString("NETCTLAUTOCMD")] = QString("/usr/bin/netctl-auto");

    QString fileName = KGlobal::dirs()->findResource("config", "netctl.conf");
    if (debug) qDebug() << "[DE]" << "[readConfiguration]" << ":" << "Configuration file" << fileName;
    QFile configFile(fileName);
    if (!configFile.open(QIODevice::ReadOnly)) {
        configuration = updateConfiguration(rawConfig);
        return;
    }
    QString fileStr;
    QStringList value;
    while (true) {
        fileStr = QString(configFile.readLine()).trimmed();
        if ((fileStr.isEmpty()) && (!configFile.atEnd())) continue;
        if ((fileStr[0] == QChar('#')) && (!configFile.atEnd())) continue;
        if ((fileStr[0] == QChar(';')) && (!configFile.atEnd())) continue;
        if (fileStr.contains(QChar('='))) {
            value.clear();
            for (int i=1; i<fileStr.split(QChar('=')).count(); i++)
                value.append(fileStr.split(QChar('='))[i]);
            rawConfig[fileStr.split(QChar('='))[0]] = value.join(QChar('='));
        }
        if (configFile.atEnd()) break;
    }
    configFile.close();
    configuration = updateConfiguration(rawConfig);

    return;
}
예제 #27
0
파일: debugger.cpp 프로젝트: sharkpp/hspide
CDebugger::CDebugger(QObject *parent, QLocalSocket* socket)
	: QObject(parent)
	, m_clientConnection(socket)
	, m_targetItem(NULL)
{
	connect(m_clientConnection, SIGNAL(readyRead()),    this, SLOT(recvCommand()));
	connect(m_clientConnection, SIGNAL(destroyed()),    this, SLOT(deleteLater()));

	// 設定の変更通史の登録と設定からの初期化処理
	connect(theConf, SIGNAL(updateConfiguration(const Configuration*)),
	        this,  SLOT(updateConfiguration(const Configuration*)));
	updateConfiguration(theConf);
}
예제 #28
0
void ConfigureDialog::onButtonsClicked( QAbstractButton *button )
{
    QDialogButtonBox::ButtonRole br = buttons->buttonRole( button );

    if ( br == QDialogButtonBox::AcceptRole ) { // OK
        savePageConfigurations();
        accept();
    } else if ( br == QDialogButtonBox::RejectRole ) { // Cancel
        reject();
    } else if ( br == QDialogButtonBox::ApplyRole ) { // Apply
        savePageConfigurations();
        emit updateConfiguration();
    }
}
예제 #29
0
void ConfigurationManager::loadConfiguration()
{
    if (storage_) {
        if (state_->isSDKPropertiesUpdated()) {
            KAA_LOG_INFO("Ignore loading configuration from storage: configuration version updated");
            storage_->clearConfiguration();
        } else {
            auto data = storage_->loadConfiguration();
            if (!data.empty()) {
                updateConfiguration(data.data(), data.size());
                isConfigurationLoaded_ = true;
                KAA_LOG_INFO("Loaded configuration from storage");
            }
        }
    }

    if (!isConfigurationLoaded_) {
        const Botan::SecureVector<std::uint8_t>& config = getDefaultConfigData();
        updateConfiguration(config.begin(), config.size());
        isConfigurationLoaded_ = true;
        KAA_LOG_INFO("Loaded default configuration");
    }
}
예제 #30
0
void connected_ap_info(apinfo_adv_t *ap_info, char *key, int key_len)  //callback, return connected AP info
{
  /*Update fastlink record*/
  int result, result1;
  result = memcmp(&(device_info->conf.fastLinkConf.ap_info), ap_info, sizeof(ApList_adv_t));
  result1 = memcmp(&(device_info->conf.fastLinkConf.key), key, key_len);
  if(device_info->conf.fastLinkConf.availableRecord == 0||result||result1){
    device_info->conf.fastLinkConf.availableRecord = 1;
    memcpy(&(device_info->conf.fastLinkConf.ap_info), ap_info, sizeof(ApList_adv_t));
    memcpy(device_info->conf.fastLinkConf.key, key, key_len);
    device_info->conf.fastLinkConf.key_len = key_len;
    updateConfiguration(device_info);
  }
}