MainWindow::MainWindow(QWidget *iParent)
    : QWidget(iParent)
{
    QWidget *parent = this;
    QVBoxLayout *vblayout = new QVBoxLayout (parent);
    vblayout->addWidget(PGraph = new PaintOutput(parent));

    SignalGenerator
        *PSGen1 = new SGen(),
        *PSGen2 = new SGen();
    SignalMixer *mixer;
    RCLowPassFilter *rclpfilter = new RCLowPassFilter();
    vblayout->addWidget(mixer = new SignalMixer(this));

    PSGen1->SetAmplitude(150.0);
    PSGen1->SetFrequency(5.0);

    PSGen2->SetAmplitude(50.0);
    PSGen2->SetFrequency(10.0);

    mixer->AddSource(PSGen1);
    mixer->AddSource(PSGen2);

    //rclpfilter->SetSource(mixer);

    PGraph->SetGenerator(mixer);

    connect(mixer, SIGNAL(UpdateOutput()), PGraph, SLOT(repaint()));
}
Beispiel #2
0
CCropDialog::CCropDialog(QWidget *parent)
    : QDialog(parent)
{
	Qt::WindowFlags flags = 0;
	flags = Qt::Dialog | Qt::WindowMinimizeButtonHint;
	setWindowFlags(flags);
	
	ui.setupUi(this);

	connect(&m_Process, SIGNAL(readyReadStandardError()),
			this, SLOT(UpdateOutput()));
	connect(&m_Process, SIGNAL(finished(int, QProcess::ExitStatus)),
			this, SLOT(ProcessFinished(int, QProcess::ExitStatus)));
	connect(&m_Process, SIGNAL(error(QProcess::ProcessError)),
			this, SLOT(ProcessError(QProcess::ProcessError)));

	// init ui items
	ui.pushButtonCrop->setEnabled(false);
	ui.pushButtonPauseResume->setEnabled(false);
	ui.progressBarColumn->setValue(0);
	ui.progressBarImage->setValue(0);
	
	//m_nSrcCropCol = nSrcCropCol;
	ReadSettings();
}
Beispiel #3
0
void cFurnaceEntity::OnSlotChanged(cItemGrid * a_ItemGrid, int a_SlotNum)
{
	super::OnSlotChanged(a_ItemGrid, a_SlotNum);
	
	if (m_World == NULL)
	{
		// The furnace isn't initialized yet, do no processing
		return;
	}
	
	ASSERT(a_ItemGrid == &m_Contents);
	switch (a_SlotNum)
	{
		case fsInput:
		{
			UpdateInput();
			break;
		}
		
		case fsFuel:
		{
			UpdateFuel();
			break;
		}
		
		case fsOutput:
		{
			UpdateOutput();
			break;
		}
	}
}
Beispiel #4
0
sout_stream_id_sys_t *sout_stream_sys_t::GetSubId( sout_stream_t *p_stream,
                                                   sout_stream_id_sys_t *id )
{
    size_t i;

    assert( p_stream->p_sys == this );

    if ( UpdateOutput( p_stream ) != VLC_SUCCESS )
        return NULL;

    for (i = 0; i < streams.size(); ++i)
    {
        if ( id == (sout_stream_id_sys_t*) streams[i] )
            return streams[i]->p_sub_id;
    }

    msg_Err( p_stream, "unknown stream ID" );
    return NULL;
}
int CCropDialog::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
    _id = QDialog::qt_metacall(_c, _id, _a);
    if (_id < 0)
        return _id;
    if (_c == QMetaObject::InvokeMetaMethod) {
        switch (_id) {
        case 0: UpdateOutput(); break;
        case 1: on_pushButtonSourceFolderBrowse_clicked(); break;
        case 2: on_pushButtonDestFolderBrowse_clicked(); break;
        case 3: on_pushButtonCrop_clicked(); break;
        case 4: on_pushButtonPauseResume_clicked(); break;
        case 5: on_pushButtonStop_clicked(); break;
        case 6: on_pushButtonClearOutput_clicked(); break;
        case 7: ProcessFinished((*reinterpret_cast< int(*)>(_a[1])),(*reinterpret_cast< QProcess::ExitStatus(*)>(_a[2]))); break;
        case 8: ProcessError((*reinterpret_cast< QProcess::ProcessError(*)>(_a[1]))); break;
        }
        _id -= 9;
    }
    return _id;
}
Beispiel #6
0
void cFurnaceEntity::OnSlotChanged(cItemGrid * a_ItemGrid, int a_SlotNum)
{
	super::OnSlotChanged(a_ItemGrid, a_SlotNum);

	if (m_IsDestroyed)
	{
		return;
	}

	if (m_IsLoading)
	{
		return;
	}

	ASSERT(a_ItemGrid == &m_Contents);
	switch (a_SlotNum)
	{
		case fsInput:  UpdateInput();  break;
		case fsFuel:   UpdateFuel();   break;
		case fsOutput: UpdateOutput(); break;
		default: ASSERT(!"Invalid furnace slot update!"); break;
	}
}
void InitialiseOutput(Output * output)
{
	pinMode(output->pin, OUTPUT);
	UpdateOutput(output);
}