Пример #1
0
BOOL
ArxDbgUiTdcObjects::OnInitDialog()
{
    ArxDbgUiTdcDbObjectBase::OnInitDialog();

    m_lbObjList.ResetContent();

    AcDbObject* obj;
    CString str;
    Acad::ErrorStatus es;

    int len = m_objList.length();
    for (int i=0; i<len; i++) {
        es = acdbOpenAcDbObject(obj, m_objList[i], AcDb::kForRead, true);		// might have passed in erased ones
        if (es == Acad::eOk) {
            ArxDbgUtils::objToClassAndHandleStr(obj, str);
            m_lbObjList.AddString(str);
            obj->close();
        }
    }

    m_lbObjList.SetCurSel(0);

    buildColumns(m_dataList);
    displayCurrent(0);

    return TRUE;
}
void DisassembleWidget::memoryRead(const GDBMI::ResultRecord& r)
{
  const GDBMI::Value& content = r["asm_insns"];
  QString rawdata;

  clear();

  for(int i = 0; i < content.size(); ++i)
  {
    const GDBMI::Value& line = content[i];

    QString addr = line["address"].literal();
    QString fct = line["func-name"].literal();
    QString offs = line["offset"].literal();
    QString inst = line["inst"].literal();

    addTopLevelItem(new QTreeWidgetItem(this, QStringList() << addr << fct << offs << inst));

    if (i == 0) {
      lower_ = strtoul(addr.toLatin1(), 0, 0);
    } else  if (i == content.size()-1) {
      upper_ = strtoul(addr.toLatin1(), 0, 0);
    }
  }

  displayCurrent();
}
void
ArxDbgUiTdcReferences::OnSelchangedEnts(NMHDR* pNMHDR, LRESULT* pResult) 
{
    NM_TREEVIEW* pNMTreeView = (NM_TREEVIEW*)pNMHDR;
    displayCurrent(static_cast<int>(pNMTreeView->itemNew.lParam));    
    *pResult = 0;
}
Пример #4
0
void DisassembleWidget::memoryRead(const GDBMI::ResultRecord& r)
{
  const GDBMI::Value& content = r["asm_insns"];
  QString rawdata;

  clear();

  for(unsigned i = 0; i < content.size(); ++i)
  {
    const GDBMI::Value& line = content[i];

    QString addr = line["address"].literal();
    QString fct = line["func-name"].literal();
    QString offs = line["offset"].literal();
    QString inst = line["inst"].literal();

    rawdata += QString(addr + "  " + fct+"+"+offs + "    " + inst + "\n");

    if (i == 0) {
      lower_ = strtoul(addr.latin1(), 0, 0);
    } else  if (i == content.size()-1) {
      upper_ = strtoul(addr.latin1(), 0, 0);
    }
  }

  append(rawdata);

  displayCurrent();
}
/**
 * \brief Setup focuser information
 */
void	focusercontrollerwidget::setupFocuser() {
	// make sure the timer does not fire
	statusTimer.stop();

	// make sure no signals are sent
	ui->positionButton->blockSignals(true);
	ui->positionSpinBox->blockSignals(true);

	// read information from the focuser
	if (_focuser) {
		int	minimum = _focuser->min();
		int	maximum = _focuser->max();
		int	current = _focuser->current();
		ui->positionSpinBox->setMaximum(maximum);
		ui->positionSpinBox->setMinimum(minimum);
		ui->positionSpinBox->setValue(current);
		displayCurrent(current);
		ui->positionButton->setEnabled(false);
		statusTimer.start();
		ui->currentField->setEnabled(true);
		ui->positionSpinBox->setEnabled(true);
		ui->positionButton->setEnabled(true);
	} else {
		ui->currentField->setEnabled(false);
		ui->positionSpinBox->setEnabled(false);
		ui->positionButton->setEnabled(false);
	}

	// now we can release the signals again
	ui->positionButton->blockSignals(false);
	ui->positionSpinBox->blockSignals(false);
}
Пример #6
0
void
ArxDbgUiTdcObjects::OnSelchangedObjs()
{
    int index = m_lbObjList.GetCurSel();
    if (index != LB_ERR) {
        displayCurrent(index);
    }
}
void DisassembleWidget::slotShowStepInSource(   const QString &, int,
                                                const QString &currentAddress)
{
    kDebug();

    currentAddress_ = currentAddress;
    address_ = strtoul(currentAddress.toLatin1(), 0, 0);
    if (!active_)
        return;

    if (address_ < lower_ || address_ > upper_ || !displayCurrent())
        getNextDisplay();
}
Пример #8
0
int main ( void )
{
    // declare and initialize local array
    char color[MAX_ELEMENTS] = { 'M', 'R', 'O', 'Y', 'L', 'G', 'T', 'B', 'N', 'P', 'K' };
    int today[MAX_ELEMENTS] = { 130, 120, 115, 105, 93, 83, 77, 70, 65, 60, 50 };
    int group[MAX_ELEMENTS] = { 125, 115, 95, 90, 75, 70, 65, 60, 55, 50, 40 };
    int single[MAX_ELEMENTS] = { 125, 127, 110, 100, 88, 78, 72, 65, 60, 55, 45 };

    // declare and initialize local variables
    char runAgain, tempColor, tempType;
    int mainLoop = 0, tempAmount = 0, subTotal = 0, totalTickets = 0, totalPrice = 0;

    // welcome user
    greetingsEarthlings();

    while ( mainLoop == 0 )
    {
        runAgain = looper();
        if ( runAgain == 'Y' )
        {
            tempColor = getColor( color );
            if ( tempColor != 'Q' )
            {
                tempType = getType();
                tempAmount = getAmount( tempType );
                subTotal = confirmPurchase( tempColor, tempType, tempAmount,
                                            today, group, single );
                if ( subTotal != 0 )
                {
                    totalPrice += subTotal;
                    totalTickets += tempAmount;
                    displayCurrent( &totalTickets, &totalPrice );
                }
                else
                    printf ( "Purchase canceled, returning to main menu.\n\n" );
            }
            else
                mainLoop = 1;
        }
        else if ( runAgain == 'N' )
        {
            mainLoop = 1;
        }
    }// end mainLoop

    printf ( "\nTicket Novice closed by user.\n" );
    closeOut( &totalTickets, &totalPrice );

    system( "PAUSE" );
    return;
}// end main
void DisassembleWidget::slotActivate(bool activate)
{
    kDebug(9012) << "Disassemble widget active: " << activate;

    if (active_ != activate)
    {
        active_ = activate;
        if (active_ && address_)
        {
            if (address_ < lower_ || address_ > upper_ || !displayCurrent())
                getNextDisplay();
        }
    }
}
Пример #10
0
void
ArxDbgUiTdcCmds::OnSelchangedCmd(NMHDR* pNMHDR, LRESULT* pResult) 
{
    NM_TREEVIEW* pNMTreeView = (NM_TREEVIEW*)pNMHDR;
    void* tmpPtr = (void*)pNMTreeView->itemNew.lParam;
	if (tmpPtr == NULL)
		m_curCmdPtr = NULL;
	else
		m_curCmdPtr = static_cast<AcEdCommand*>(tmpPtr);

    displayCurrent();

    *pResult = 0;
}
/**
 * \brief Timer status update slot
 */
void	focusercontrollerwidget::statusUpdate() {
	if (!_focuser) {
		return;
	}
	int	current = _focuser->current();
	if (current != _previousposition) {
		double	f = current / 5000.;
		ui->positionButton->update(f);
		_previousposition = current;
	}
	int	target = ui->positionSpinBox->value();
	bool	targetreached = current == target;
	ui->positionButton->setEnabled(!targetreached);
	displayCurrent(current);
	if ((targetreached) && (delta != 0)) {
		emit targetPositionReached();
	}
	delta = current - target;
}
BOOL
ArxDbgUiTdcReferences::OnInitDialog() 
{
    ArxDbgUiTdcDbObjectBase::OnInitDialog();

    HTREEITEM treeItem;
	CString str;

	treeItem = addOneTreeItem(_T("Hard Pointers"), NULL, TVI_ROOT);
	if (treeItem != NULL) {
		addEntriesToTree(m_hardPointerIds, treeItem);
	    m_entTree.Expand(treeItem, TVE_EXPAND);
	    m_entTree.SelectItem(treeItem);		// select first one
	}

	treeItem = addOneTreeItem(_T("Soft Pointers"), NULL, TVI_ROOT);
	if (treeItem != NULL) {
		addEntriesToTree(m_softPointerIds, treeItem);
	    m_entTree.Expand(treeItem, TVE_EXPAND);
	}

	treeItem = addOneTreeItem(_T("Hard Ownership"), NULL, TVI_ROOT);
	if (treeItem != NULL) {
		addEntriesToTree(m_hardOwnershipIds, treeItem);
	    m_entTree.Expand(treeItem, TVE_EXPAND);
	}

	treeItem = addOneTreeItem(_T("Soft Ownership"), NULL, TVI_ROOT);
	if (treeItem != NULL) {
		addEntriesToTree(m_softOwnershipIds, treeItem);
	    m_entTree.Expand(treeItem, TVE_EXPAND);
	}

    buildColumns(m_dataList);
    displayCurrent(0);

    //m_entTree.Expand(m_entTree.GetRootItem(), TVE_EXPAND);

    return TRUE;
}
Пример #13
0
BOOL
ArxDbgUiTdcCmds::OnInitDialog() 
{
    ArxDbgUiTdcRxObjectBase::OnInitDialog();

	buildCmdGroupMap();

    POSITION pos;
    CString str;
    AcDbVoidPtrArray* cmds = NULL;
    HTREEITEM treeItem;
	AcEdCommand* tmpCmd;
	bool isFirst = true;

    for (pos = m_cmdMap.GetStartPosition(); pos != NULL;) {
        m_cmdMap.GetNextAssoc(pos, str, (void*&)cmds);
 		treeItem = addCmdTreeItem(str, NULL, TVI_ROOT, true);
		if (treeItem != NULL) {
			int len = cmds->length();
			for (int i=0; i<len; i++) {
				tmpCmd = static_cast<AcEdCommand*>(cmds->at(i));
				addCmdTreeItem(tmpCmd->localName(), tmpCmd, treeItem, true);
			}

			if (isFirst) {
				m_cmdTree.SelectItem(treeItem);		// make first one selected
				isFirst = false;
			}
		}
   }

	buildColumns(m_dataList);
    displayCurrent();

    return TRUE;
}
/**
 * \brief This method reads the current position from the focuser
 */
void	focusercontrollerwidget::setCurrent() {
	displayCurrent(_focuser->current());
}
Пример #15
0
void MainWindow::setupConnections()
{
    // Importing
    connect(importButton, SIGNAL(clicked()), this, SLOT(launchImageImport()));
    connect(filedata, SIGNAL(imagesImported()), aListWidget, SLOT(populate()));
    connect(filedata, SIGNAL(imagesImported()), bListWidget, SLOT(populate()));
    connect(filedata, SIGNAL(imagesImported()), vectorListWidget, SLOT(populate()));
    connect(filedata, SIGNAL(imagesImported()), this, SLOT(notifyFolderChange()));
    connect(filedata, SIGNAL(vectorListUpdated()), vectorListWidget, SLOT(update()));

    // Image selection
    connect(aListWidget, SIGNAL(fileClicked(int)), this, SLOT(pivAclicked(int)));
    connect(bListWidget, SIGNAL(fileClicked(int)), this, SLOT(pivBclicked(int)));
    connect(vectorListWidget, SIGNAL(fileClicked(int)), this, SLOT(vectorClicked(int)));
    connect(forwardButton, SIGNAL(clicked()), this, SLOT(forwardOne()));
    connect(backButton, SIGNAL(clicked()), this, SLOT(backwardOne()));

    // Image/vector viewing
    connect(zoomInButton, SIGNAL(clicked()), pivDisplay, SLOT(zoomIn()));
    connect(zoomOutButton, SIGNAL(clicked()), pivDisplay, SLOT(zoomOut()));
    connect(zoomFitButton, SIGNAL(clicked()), pivDisplay, SLOT(zoomFit()));
    // The following should be moved into settings
    connect(vectorToggle, SIGNAL(toggled(bool)), pivDisplay, SLOT(vectorsToggled(bool)));
    //
    connect(colourButtonFiltered, SIGNAL(clicked()), this, SLOT(chooseFilteredColour()));
    connect(colourButtonUnfiltered, SIGNAL(clicked()), this, SLOT(chooseUnfilteredColour()));
    connect(scaleSpin, SIGNAL(valueChanged(double)), settings, SLOT(setVectorScale(double)));
    connect(subSpin, SIGNAL(valueChanged(double)), settings, SLOT(setVectorSub(double)));
    connect(settings, SIGNAL(vectorSettingChanged()), pivDisplay, SLOT(vectorsChanged()));

    // Masking
    connect(maskButton, SIGNAL(clicked()), maskButton, SLOT(showMenu()));
    connect(filedata,SIGNAL(imagesImported()), maskDropDown, SLOT(imageLoaded()));
    connect(maskDropDown, SIGNAL(importMaskClicked()), filedata, SLOT(importMask()));
    connect(filedata, SIGNAL(maskLoaded()), maskDropDown, SLOT(maskLoaded()));
    connect(maskDropDown, SIGNAL(gridToggled(bool)), pivDisplay, SLOT(maskToggled(bool)));
    connect(maskDropDown, SIGNAL(clearMask(bool)), settings, SLOT(setIsMask(bool)));

    // Process tab
    connect(hSizeCombo, SIGNAL(activated(int)), settings, SLOT(setIntLengthX(int)));
    connect(vSizeCombo, SIGNAL(activated(int)), settings, SLOT(setIntLengthY(int)));
    connect(hSpaceSpin, SIGNAL(valueChanged(int)), settings, SLOT(setDeltaX(int)));
    connect(vSpaceSpin, SIGNAL(valueChanged(int)), settings, SLOT(setDeltaY(int)));

    // Filter tab
    connect(globalRangeCheck, SIGNAL(toggled(bool)), this, SLOT(filterChanged()));
    connect(minUedit, SIGNAL(textChanged(QString)), this, SLOT(setFilterValues()));
    connect(maxUedit, SIGNAL(textChanged(QString)), this, SLOT(setFilterValues()));
    connect(minVedit, SIGNAL(textChanged(QString)), this, SLOT(setFilterValues()));
    connect(maxVedit, SIGNAL(textChanged(QString)), this, SLOT(setFilterValues()));
    connect(globalStDevCheck, SIGNAL(toggled(bool)), this, SLOT(filterChanged()));
    connect(nStdDevSpin, SIGNAL(valueChanged(double)), this, SLOT(setFilterValues()));

    connect(localCheck, SIGNAL(toggled(bool)), this, SLOT(filterChanged()));
    connect(localMethodCombo, SIGNAL(currentIndexChanged(int)), this, SLOT(setFilterValues()));
    connect(localNxNCombo, SIGNAL(currentIndexChanged(int)), this, SLOT(setFilterValues()));
    connect(localUedit, SIGNAL(textChanged(QString)), this, SLOT(setFilterValues()));
    connect(localVedit, SIGNAL(textChanged(QString)), this, SLOT(setFilterValues()));

    connect(interpolateCheck, SIGNAL(toggled(bool)), this, SLOT(filterChanged()));
    connect(interpolateMethodCombo, SIGNAL(currentIndexChanged(int)), this, SLOT(setFilterValues()));
    connect(interpolateNxNCombo, SIGNAL(currentIndexChanged(int)), this, SLOT(setFilterValues()));

    connect(smoothCheck, SIGNAL(toggled(bool)), this, SLOT(filterChanged()));
    connect(smoothRadiusEdit, SIGNAL(textChanged(QString)), this, SLOT(setFilterValues()));
    connect(smoothNxNCombo, SIGNAL(currentIndexChanged(int)), this, SLOT(setFilterValues()));

    // DoingPIV
    connect(outputFolderEdit, SIGNAL(textEdited(QString)), this, SLOT(setOutput()));
    connect(outputFolderButton, SIGNAL(clicked()), this, SLOT(chooseOutputFolder()));
    connect(outputFormatCombo, SIGNAL(currentIndexChanged(int)), this, SLOT(setOutput()));
    connect(correlateButton, SIGNAL(clicked()), process, SLOT(processCurrentImagePair()));
    connect(process, SIGNAL(currentProcessed()), pivDisplay, SLOT(displayCurrent()));
    connect(process, SIGNAL(currentProcessed()), output, SLOT(outputCurrent()));
    connect(filterButton, SIGNAL(clicked()), analysis, SLOT(filterCurrent()));
    connect(analysis, SIGNAL(currentFiltered()), pivDisplay, SLOT(displayCurrent()));
    connect(analysis, SIGNAL(currentFiltered()), output, SLOT(outputCurrent()));
    connect(batchButton, SIGNAL(clicked()), process, SLOT(launchBatchWindow()));
    connect(process, SIGNAL(batchProcessed()), this, SLOT(batchDone()));
    connect(pivDisplay, SIGNAL(mouseMoved(QPointF)), this, SLOT(updatePositionLabel(QPointF)));

    // Data Quality
    connect(filterSNRCheck, SIGNAL(toggled(bool)), this, SLOT(qualityChanged()));
    connect(snrEdit, SIGNAL(textEdited(QString)), this, SLOT(qualityChanged()));
    connect(filterIntCheck, SIGNAL(toggled(bool)), this, SLOT(qualityChanged()));
    connect(intensityEdit, SIGNAL(textEdited(QString)), this, SLOT(qualityChanged()));
}