Ejemplo n.º 1
0
const char *MSLabelOut::formatOutput(MSString &buffer_,double data_)
{
  if (data_<UINT_MAX)
   {
     unsigned index=unsigned(data_);
     if (index<labels().length())
      {
	buffer_=labels()(index);
	return buffer_.string();
      }
   }
  switch (format().formatType())
   {
   case MSFormat::Date:
     {
       MSDate aDate((MSJulian)data_);
       return aDate.format(buffer_,format());
     }
   case MSFormat::Money:
     {
       MSMoney aMoney(data_);
       return aMoney.format(buffer_,format());
     }
   case MSFormat::Rate:
     {
       MSRate aRate(data_);
       return aRate.format(buffer_,format());
     }
   case MSFormat::Time:
     {
       MSTime aTime((time_t)data_);
       return aTime.format(buffer_,format());
     }
   case MSFormat::Float:
   default:
     {
       MSFloat aFloat(data_);
       return aFloat.format(buffer_,format());
     }
   }
  /* return buffer_.string(); */
}
Ejemplo n.º 2
0
MapWinCtrl::MapWinCtrl()
{
    QDate aDate(1998,2,3);

    colorList = new QList<QColor>();

    colorList->append(QColor("#F2FCC2"));
    colorList->append(QColor("#FCCDB6"));
    colorList->append(QColor("#b3f3fc"));
    colorList->append(QColor("#fcc5ea"));
    colorList->append(QColor("#b8b3fc"));
    colorList->append(QColor("#b6fcb3"));
    colorList->append(QColor("#f2f1f0"));

    //fake data
    aFacility2 = new Facility(5,"TheFacility",4,2,4,5,6); //Will use the main facility list, but for now.LEt's assume 1 facility TO CHANGE
    /*aFacility3 = new Facility(5,"ttt",4,2,4,5,6, Qt::blue, 2, 2); //Will use the main facility list, but for now.LEt's assume 1 facility TO CHANGE
    aFacility4 = new Facility(5,"eeee",4,2,4,5,6, Qt::green, 2, 2); //Will use the main facility list, but for now.LEt's assume 1 facility TO CHANGE
    */
    aPatient15 = new Patient ("12e","Bob","Henry",aDate,aDate,7,8);
    aPatient16 = new Patient ("12e","Bob","Henry",aDate,aDate,7,8);
    aPatient17 = new Patient ("12e","Bob","Henry",aDate,aDate,7,8);

    listOfPatient.append(aPatient15);listOfPatient.append(aPatient16);listOfPatient.append(aPatient17);
    listOfFacility.append(aFacility2);//listOfFacility.append(aFacility3);listOfFacility.append(aFacility4);

    listOfFacility.at(0)->addPatientAcute(aPatient15);
    listOfFacility.at(0)->addPatientAcute(aPatient16);
    listOfFacility.at(0)->addPatientAcute(aPatient17);
    listOfFacility.at(0)->addWaitingList(aPatient15);
  // setupFacility(); //Where in reality our Db will only contains 1 facility ? So only the first facility will be set there.
  //  setupPatients(); //Put all patients inside the facility

   //canceled = false;

    AddFacCtrl::getInstance()->setList(&listOfFacility);

}