Пример #1
0
 bool getEvalChild2()  {return (actionMap[getInputs()] & EvalChild2)  ? true : false;}
Пример #2
0
void AcreBrowser::updateExplorer(bool acre)
{    
    if(acre)
    {
        ui->txID->hide();
        ui->txLabel->hide();
        ui->valueLabel->hide();
        ui->valueBox->hide();
        ui->inputLabel->hide();
        ui->inputBox->hide();
        ui->outputLabel->hide();
        ui->outputBox->hide();
        ui->heightLabel->show();
        ui->heightLabel_2->show();
        ui->hashLabel->show();
        ui->hashBox->show();
        ui->merkleLabel->show();
        ui->merkleBox->show();
        ui->nonceLabel->show();
        ui->nonceBox->show();
        ui->bitsLabel->show();
        ui->bitsBox->show();
        ui->timeLabel->show();
        ui->timeBox->show();
        ui->hardLabel->show();
        ui->hardBox->show();;
        ui->pawLabel->show();
        ui->pawBox->show();
        ui->nextButton->show();
        ui->previousButton->show();
        ui->feesLabel->hide();
        ui->feesBox->hide(); 
        int height = ui->heightBox->value();
        int Pawrate = getAcrePawrate(height);
        double Pawrate2 = 0.000;
        Pawrate2 = ((double)Pawrate / 1000);  
        std::string hash = getAcreHash(height);
        std::string merkle = getAcreMerkle(height);
        int nBits = getAcrenBits(height);
        int nNonce = getAcreNonce(height);
        int atime = getAcreTime(height);
        double hardness = getAcreHardness(height);
        QString QHeight = QString::number(height);
        QString QHash = QString::fromUtf8(hash.c_str());
        QString QMerkle = QString::fromUtf8(merkle.c_str());
        QString QBits = QString::number(nBits);
        QString QNonce = QString::number(nNonce);
        QString QTime = QString::number(atime);
        QString QHardness = QString::number(hardness, 'f', 6);
        QString QPawrate = QString::number(Pawrate2, 'f', 3);
        ui->heightLabel->setText(QHeight);
        ui->hashBox->setText(QHash);
        ui->merkleBox->setText(QMerkle);
        ui->bitsBox->setText(QBits);
        ui->nonceBox->setText(QNonce);
        ui->timeBox->setText(QTime);     
        ui->hardBox->setText(QHardness);
        ui->pawBox->setText(QPawrate + " KH/s");
    } 
    
    if(acre == false) {
        ui->heightLabel->hide();
        ui->heightLabel_2->hide();
        ui->hashLabel->hide();
        ui->hashBox->hide();
        ui->merkleLabel->hide();
        ui->merkleBox->hide();
        ui->nonceLabel->hide();
        ui->nonceBox->hide();
        ui->bitsLabel->hide();
        ui->bitsBox->hide();
        ui->timeLabel->hide();
        ui->timeBox->hide();
        ui->hardLabel->hide();
        ui->hardBox->hide();
        ui->pawLabel->hide();
        ui->pawBox->hide();
        ui->nextButton->hide();
        ui->previousButton->hide();
        ui->txID->show();
        ui->txLabel->show();
        ui->valueLabel->show();
        ui->valueBox->show();
        ui->inputLabel->show();
        ui->inputBox->show();
        ui->outputLabel->show();
        ui->outputBox->show();
        ui->feesLabel->show();
        ui->feesBox->show();
        std::string txid = ui->txBox->text().toUtf8().constData();
        double value = getTxTotalValue(txid);
        double fees = getTxFees(txid);
        std::string outputs = getOutputs(txid);
        std::string inputs = getInputs(txid);
        QString QValue = QString::number(value, 'f', 6);
        QString QID = QString::fromUtf8(txid.c_str());
        QString QOutputs = QString::fromUtf8(outputs.c_str());
        QString QInputs = QString::fromUtf8(inputs.c_str());
        QString QFees = QString::number(fees, 'f', 6);
        ui->valueBox->setText(QValue + " FOX");
        ui->txID->setText(QID);
        ui->outputBox->setText(QOutputs);
        ui->inputBox->setText(QInputs);
        ui->feesBox->setText(QFees + " FOX");
    }
}
Пример #3
0
void ShoppingPage::updateExplorer(bool block)
{
    if(block)
    {
        ui->heightLabel_3->show();
        ui->heightLabel_4->show();
        ui->hashLabel_2->show();
        ui->hashBox_2->show();
        ui->merkleLabel_2->show();
        ui->merkleBox_2->show();
        ui->nonceLabel_2->show();
        ui->nonceBox_2->show();
        ui->bitsLabel_2->show();
        ui->bitsBox_2->show();
        ui->timeLabel_2->show();
        ui->timeBox_2->show();
        ui->hardLabel_2->show();
        ui->hardBox_2->show();;
        ui->pawLabel_2->show();
        ui->pawBox_2->show();
        int height = ui->heightBox_2->value();
        if (height > pindexBest->nHeight)
        {
            ui->heightBox_2->setValue(pindexBest->nHeight);
            height = pindexBest->nHeight;
        }
        int Pawrate = getBlockHashrate(height);
        double Pawrate2 = 0.000;
        Pawrate2 = ((double)Pawrate / 1000000);
        std::string hash = getBlockHash(height);
        std::string merkle = getBlockMerkle(height);
        int nBits = getBlocknBits(height);
        int nNonce = getBlockNonce(height);
        int atime = getBlockTime(height);
        double hardness = getBlockHardness(height);
        QString QHeight = QString::number(height);
        QString QHash = QString::fromUtf8(hash.c_str());
        QString QMerkle = QString::fromUtf8(merkle.c_str());
        QString QBits = QString::number(nBits);
        QString QNonce = QString::number(nNonce);
        QString QTime = QString::number(atime);
        QString QHardness = QString::number(hardness, 'f', 6);
        QString QPawrate = QString::number(Pawrate2, 'f', 3);
        ui->heightLabel_4->setText(QHeight);
        ui->hashBox_2->setText(QHash);
        ui->merkleBox_2->setText(QMerkle);
        ui->bitsBox_2->setText(QBits);
        ui->nonceBox_2->setText(QNonce);
        ui->timeBox_2->setText(QTime);
        ui->hardBox_2->setText(QHardness);
        ui->pawBox_2->setText(QPawrate + " MH/s");
    }

    if(block == false) {
        ui->txID_2->show();
        ui->txLabel_2->show();
        ui->valueLabel_2->show();
        ui->valueBox_2->show();
        ui->inputLabel_2->show();
        ui->inputBox_2->show();
        ui->outputLabel_2->show();
        ui->outputBox_2->show();
        ui->feesLabel_2->show();
        ui->feesBox_2->show();
        std::string txid = ui->txBox_2->text().toUtf8().constData();
        double value = getTxTotalValue(txid);
        double fees = getTxFees(txid);
        std::string outputs = getOutputs(txid);
        std::string inputs = getInputs(txid);
        QString QValue = QString::number(value, 'f', 6);
        QString QID = QString::fromUtf8(txid.c_str());
        QString QOutputs = QString::fromUtf8(outputs.c_str());
        QString QInputs = QString::fromUtf8(inputs.c_str());
        QString QFees = QString::number(fees, 'f', 6);
        ui->valueBox_2->setText(QValue + " NET");
        ui->txID_2->setText(QID);
        ui->outputBox_2->setText(QOutputs);
        ui->inputBox_2->setText(QInputs);
        ui->feesBox_2->setText(QFees + " NET");
    }
}
Пример #4
0
 std::vector<Input> Address::getInputs() const {
     auto &instance = DataAccess::Instance();
     return getInputs(*instance.addressIndex, *instance.chain);
 }
Пример #5
0
  void HiEqualization::errorCheck(QString fromListName) {
    const FileList &imageList = getInputs();

    // Ensures number of images is within bound
    if (imageList.size() > 10) {
      QString msg = "The input file [" + fromListName +
        "] cannot contain more than 10 file names";
      throw IException(IException::User, msg, _FILEINFO_);
    }

    // Reference for converting a CPMM number to a CCD number
    const int cpmm2ccd[] = {0, 1, 2, 3, 12, 4, 10, 11, 5, 13, 6, 7, 8, 9};

    // Place ccd in vector, try-catch opening cubes
    vector<int> ccds;
    for (int i = 0; i < imageList.size(); i++) {
      try {
        Cube cube1;
        cube1.open(imageList[i].toString());
        PvlGroup &from1Instrument = cube1.group("INSTRUMENT");
        int cpmmNumber = from1Instrument["CpmmNumber"];
        ccds.push_back(cpmm2ccd[cpmmNumber]);

        // In case we need to alter the order of the input list, keep a record
        // of how the indices changed so we can rearrange the output list later
        movedIndices.push_back(i);
      }
      catch (IException &e) {
        QString msg = "The [" + imageList[i].toString() +
          "] file is not a valid HiRise image";
        throw IException(e, IException::User, msg, _FILEINFO_);
      }
      catch (...) {
        // If any part of the above didn't work, we can safely assume the
        // current file is not a valid HiRise image
        QString msg = "The [" + imageList[i].toString() +
          "] file is not a valid HiRise image";
        throw IException(IException::User, msg, _FILEINFO_);
      }
    }

    // Error checking to ensure CCDID types match
    for (int i = 0; i < imageList.size() - 1; i++) {
      int id1 = getCCDType(ccds[i]);
      int id2 = getCCDType(ccds[i + 1]);

      // CCDID types don't match
      if (id1 != id2) {
        string msg = "The list of input images must be all RED, all IR, or ";
        msg += "all BG";
        throw IException(IException::User, msg, _FILEINFO_);
      }
    }

    // Insertion sorts a list of filenames by their CCD numbers
    for (int i = 1; i < imageList.size(); i++) {
      QString temp = imageList[i].toString();
      int ccd1 = ccds[i];
      int movedIndex = movedIndices[i];

      int j = i - 1;
      int ccd2 = ccds[j];

      while (j >= 0 && ccd2 > ccd1) {
        setInput(j + 1, imageList[j].toString());
        ccds[j + 1] = ccds[j];
        movedIndices[j + 1] = movedIndices[j];

        j--;
        if (j >= 0) ccd2 = ccds[j];
      }

      setInput(j + 1, temp);
      ccds[j + 1] = ccd1;
      movedIndices[j + 1] = movedIndex;
    }

    // Ensures BG and IR only have two files
    if (ccds[0] == 10 || ccds[0] == 11) {
      if (imageList.size() != 2) {
        string msg = "A list of IR images must have exactly two ";
        msg += "file names";
        throw IException(IException::User, msg, _FILEINFO_);
      }
    }
    else if (ccds[0] == 12 || ccds[0] == 13) {
      if (imageList.size() != 2) {
        string msg = "A list of BG images must have exactly two ";
        msg += "file names";
        throw IException(IException::User, msg, _FILEINFO_);
      }
    }
  }
Пример #6
0
 bool getOpReg2Mem1() {return (_actionMap[getInputs()] & OpReg2Mem1) ? true : false;}
Пример #7
0
 bool getCopyRegs()   {return (_actionMap[getInputs()] & (CopyReg1 | CopyReg2)) ? true : false;}
Пример #8
0
 bool getOpReg1Mem2() {return (_actionMap[getInputs()] & OpReg1Mem2) ? true : false;}
Пример #9
0
 bool getCopyReg2()   {return (_actionMap[getInputs()] & CopyReg2)   ? true : false;}
Пример #10
0
 bool getEvalChild1() {return (_actionMap[getInputs()] & EvalChild1) ? true : false;}
Пример #11
0
 bool getCmpMem1Reg2() {return (_actionMap[getInputs()] & CmpMem1Reg2) ? true : false;}
Пример #12
0
void BlockBrowser::updateExplorer(bool block)
{
    if(block)
    {
        ui->heightLabelBE1->show();
        ui->heightLabelBE1->setTextInteractionFlags(Qt::TextSelectableByMouse);
        ui->heightLabelBE2->show();
        ui->heightLabelBE1->setTextInteractionFlags(Qt::TextSelectableByMouse);
        ui->hashLabel->show();
        ui->hashLabel->setTextInteractionFlags(Qt::TextSelectableByMouse);
        ui->hashBox->show();
        ui->hashBox->setTextInteractionFlags(Qt::TextSelectableByMouse);
        ui->merkleLabel->show();
        ui->merkleLabel->setTextInteractionFlags(Qt::TextSelectableByMouse);
        ui->merkleBox->show();
        ui->merkleBox->setTextInteractionFlags(Qt::TextSelectableByMouse);
        ui->nonceLabel->show();
        ui->nonceLabel->setTextInteractionFlags(Qt::TextSelectableByMouse);
        ui->nonceBox->show();
        ui->nonceBox->setTextInteractionFlags(Qt::TextSelectableByMouse);
        ui->bitsLabel->show();
        ui->bitsLabel->setTextInteractionFlags(Qt::TextSelectableByMouse);
        ui->bitsBox->show();
        ui->bitsBox->setTextInteractionFlags(Qt::TextSelectableByMouse);
        ui->timeLabel->show();
        ui->timeLabel->setTextInteractionFlags(Qt::TextSelectableByMouse);
        ui->timeBox->show();
        ui->timeBox->setTextInteractionFlags(Qt::TextSelectableByMouse);
        // ui->hardLabel->show();
        // ui->hardLabel->setTextInteractionFlags(Qt::TextSelectableByMouse);
        // ui->hardBox->show();;
        // ui->hardBox->setTextInteractionFlags(Qt::TextSelectableByMouse);
        // ui->pawLabel->show();
        // ui->pawLabel->setTextInteractionFlags(Qt::TextSelectableByMouse);
        // ui->pawBox->show();
        // ui->pawBox->setTextInteractionFlags(Qt::TextSelectableByMouse);
        int64_t height = ui->heightBox->value();
		CBlock block;
		CBlockIndex* pindexBest = mapBlockIndex[chainActive.Tip()->GetBlockHash()];
        if (height > pindexBest->nHeight)
        {
            ui->heightBox->setValue(pindexBest->nHeight);
            height = pindexBest->nHeight;
        }
        //int64_t Pawrate = getBlockHashrate(height); Wtf
        //double Pawrate2 = 0.000;
        //Pawrate2 = ((double)Pawrate / 1000000);
        std::string hash = getBlockHash(height);
        std::string merkle = getBlockMerkle(height);
        int64_t nBits = getBlocknBits(height);
        int64_t nNonce = getBlockNonce(height);
        int64_t atime = getBlockTime(height);
        //double hardness = getBlockHardness(height);
        QString QHeight = QString::number(height);
        QString QHash = QString::fromUtf8(hash.c_str());
        QString QMerkle = QString::fromUtf8(merkle.c_str());
        QString QBits = QString::number(nBits);
        QString QNonce = QString::number(nNonce);
        QString QTime = QString::number(atime);
        //QString QHardness = QString::number(hardness, 'f', 6);
        //QString QPawrate = QString::number(0);
        ui->heightLabelBE1->setText(QHeight);
        ui->hashBox->setText(QHash);
        ui->merkleBox->setText(QMerkle);
        ui->bitsBox->setText(QBits);
        ui->nonceBox->setText(QNonce);
        ui->timeBox->setText(QTime);
        //ui->hardBox->setText(QHardness);
        //ui->pawBox->setText(QPawrate + " MH/s");
    }

    if(block == false) {
        ui->txID->show();
        ui->txID->setTextInteractionFlags(Qt::TextSelectableByMouse);
        ui->txLabel->show();
        ui->txLabel->setTextInteractionFlags(Qt::TextSelectableByMouse);
        ui->valueLabel->show();
        ui->valueLabel->setTextInteractionFlags(Qt::TextSelectableByMouse);
        ui->valueBox->show();
        ui->valueBox->setTextInteractionFlags(Qt::TextSelectableByMouse);
        ui->inputLabel->show();
        ui->inputLabel->setTextInteractionFlags(Qt::TextSelectableByMouse);
        ui->inputBox->show();
        ui->inputBox->setTextInteractionFlags(Qt::TextSelectableByMouse);
        ui->outputLabel->show();
        ui->outputLabel->setTextInteractionFlags(Qt::TextSelectableByMouse);
        ui->outputBox->show();
        ui->outputBox->setTextInteractionFlags(Qt::TextSelectableByMouse);
        ui->feesLabel->show();
        ui->feesLabel->setTextInteractionFlags(Qt::TextSelectableByMouse);
        ui->feesBox->show();
        ui->feesBox->setTextInteractionFlags(Qt::TextSelectableByMouse);
        std::string txid = ui->txBox->text().toUtf8().constData();
        double value = getTxTotalValue(txid);
        double fees = getTxFees(txid);
        std::string outputs = getOutputs(txid);
        std::string inputs = getInputs(txid);
        QString QValue = QString::number(value, 'f', 6);
        QString QID = QString::fromUtf8(txid.c_str());
        QString QOutputs = QString::fromUtf8(outputs.c_str());
        QString QInputs = QString::fromUtf8(inputs.c_str());
        QString QFees = QString::number(fees, 'f', 6);
        ui->valueBox->setText(QValue + " MUE");
        ui->txID->setText(QID);
        ui->outputBox->setText(QOutputs);
        ui->inputBox->setText(QInputs);
        ui->feesBox->setText(QFees + " MUE");
    }
}