Taker::Taker (CrossType cross_type, ApplyView& view, AccountID const& account, Amounts const& offer, std::uint32_t flags, beast::Journal journal) : BasicTaker (cross_type, account, offer, Quality(offer), flags, calculateRate(view, offer.in.getIssuer(), account), calculateRate(view, offer.out.getIssuer(), account), journal) , view_ (view) , xrp_flow_ (0) , direct_crossings_ (0) , bridge_crossings_ (0) { assert (issue_in () == offer.in.issue ()); assert (issue_out () == offer.out.issue ()); if (journal_.debug) { journal_.debug << "Crossing as: " << to_string (account); if (isXRP (issue_in ())) journal_.debug << " Offer in: " << format_amount (offer.in); else journal_.debug << " Offer in: " << format_amount (offer.in) << " (issuer: " << issue_in ().account << ")"; if (isXRP (issue_out ())) journal_.debug << " Offer out: " << format_amount (offer.out); else journal_.debug << " Offer out: " << format_amount (offer.out) << " (issuer: " << issue_out ().account << ")"; journal_.debug << " Balance: " << format_amount (get_funds (account, offer.in)); } }
int MagnetoSensor::setDelay(int32_t handle, int64_t delay_ns) { int fd; int rate; getAttributeFilePath(input_sysfs_path, SYSFS_PATH_MAG, "rate"); LOGD("XXXXXXXXX magnetometer setting delay %s %lld", input_sysfs_path, delay_ns); if (delay_ns < MIN_DELAY) return -EINVAL; else rate = calculateRate(delay_ns); fd = open(input_sysfs_path, O_RDWR); if (fd >= 0) { char buf[3]; sprintf(buf, "%d", rate); LOGD("XXXXXXXXXXXX magnetometer set rate: %d", rate); write(fd, buf, strlen(buf)+1); close(fd); return 0; } return -1; }
void MainWindow::setAndCalculate(CopyableTable *aTable, int row, QString aText) { setItemAndScroll(aTable, row, 3, aText); calculateRate(aTable, row); }