示例#1
0
bool CSVWriter::writeCell(bool data)
{
    if (data)
        return writeCell("true");
    else
        return writeCell("false");
}
示例#2
0
//display the field with position. (ascii cells)
void showField(uint8_t *field, int position)
{
	//calculate x and y location from position.
	x = position%fieldWidth;
	if(!(position%fieldWidth))
	{
		y++;
		if(y>=(fieldHeight))
		{
			y=0;
		}
	}
	//set this location.
	lcd.setCursor(x,y);
	//draw a cell if there is a 1 at this position.
	//else draw a empty block.
	if(field[position])
	{
		writeCell();
	}
	else
	{
		writeBlock();
	}
}
示例#3
0
bool CSVWriter::writeCell(float data)
{
    char buf [100];

    sprintf(buf, "%f", data);

    return writeCell(buf);
}
示例#4
0
void MWWorld::Cells::write (ESM::ESMWriter& writer, Loading::Listener& progress) const
{
    for (std::map<std::pair<int, int>, CellStore>::iterator iter (mExteriors.begin());
        iter!=mExteriors.end(); ++iter)
        if (iter->second.hasState())
        {
            writeCell (writer, iter->second);
            progress.increaseProgress();
        }

    for (std::map<std::string, CellStore>::iterator iter (mInteriors.begin());
        iter!=mInteriors.end(); ++iter)
        if (iter->second.hasState())
        {
            writeCell (writer, iter->second);
            progress.increaseProgress();
        }
}
示例#5
0
void writeLibrary(QXmlStreamWriter &stream, const QVariantList &v)
{
    stream.writeStartElement("library");
    stream.writeAttribute("name", v[1].toString());

    for (int i = 2; i < v.size(); i++)
    {
        QVariant v2 = v[i];
        if (v2.type() == QVariant::List)
        {
            QVariantList l2 = v2.toList();
            if (l2.size() > 0)
            {
                if (l2.first() == "cell")
                {
                    writeCell(stream, l2);
                }
            }
        }
    }

    stream.writeEndElement();
}
void 
write_htmlNastStat::writePartialStatistics(void){
  dataDrawerListIterator   p;         // browse the list
  dataDrawer               *dataB;    // dataDrawer of the function
  fnctData                 *fData;    // current function Data
  nastNumData              *nnData;   // statistics of a function
  long                     sumTot;    // sum of the totals node in the functions

  htmlpage << "This table show what's the portion that can be "
	   << "reached when, from a first compound_stmt of the"
	   << "function's body, we navigate between the nodes<br><br>\n";

  htmlpage << "<table border=\"0\" width=\"420\" cellspacing=\"2\">\n";

  htmlpage << "\t<tr>\n";
  // table titles
  writeCell("");
  writeCell("*_TYPE");
  writeCell("*_DECL");
  writeCell("*_STMT");
  writeCell("*_CST");
  writeCell("*_EXPR");
  writeCell("Other");
  writeCell("<b>TOTAL<b>");
  htmlpage << "\t</tr>\n";

  // browse one function for time
  p = dataBL->begin();
  while (p != dataBL->end()) {
    dataB = *p;
    p++;
    
    fData = dataB->getFnctData();
    
    if (fData->hasBody()) {
      
      nnData = dataB->getNastNumData();

      htmlpage << "\t<tr>\n";

      htmlpage << "\t<td  bgcolor=\"lightblue\" width=\"70\">"
	       << "<a href=\"" 
	       << HTMLfilesRegister::htmlFile(*fData)
	       << "\">" << fData->getName() << "</a><td>\n";
      
      // write partial stat
      writeCell(nnData->totalTypeNastNode(),
		getX100(nnData->totalTypeNastNode(),totals));
      writeCell(nnData->totalDeclNastNode(),
		getX100(nnData->totalDeclNastNode(),totals));
      writeCell(nnData->totalStmtNastNode(),
		getX100(nnData->totalStmtNastNode(),totals));
      writeCell(nnData->totalCstNastNode(),
		getX100(nnData->totalCstNastNode(),totals));
      writeCell(nnData->totalExprNastNode(),
		getX100(nnData->totalExprNastNode(),totals));
      writeCell(nnData->totalOthrNastNode(),
		getX100(nnData->totalOthrNastNode(),totals));

      sumTot = (nnData->totalTypeNastNode() +
		nnData->totalDeclNastNode() +
		nnData->totalStmtNastNode() +
		nnData->totalCstNastNode() +
		nnData->totalExprNastNode() +
		nnData->totalOthrNastNode());
      writeCell(sumTot,getX100(sumTot,totals));

      htmlpage << "\t</tr>\n";

    }
  }
  
  htmlpage << "</table>";
  
  return;
}