コード例 #1
0
ファイル: mason_materializer.cpp プロジェクト: CVroland/seqan
seqan::ArgumentParser::ParseResult
parseCommandLine(MasonMaterializerOptions & options, int argc, char const ** argv)
{
    // Setup ArgumentParser.
    seqan::ArgumentParser parser("mason_materializer");
    // Set short description, version, and date.
    setShortDescription(parser, "VCF Materialization");
    setVersion(parser, "2.0");
    setDate(parser, "July 2012");
    setCategory(parser, "Simulators");

    // Define usage line and long description.
    addUsageLine(parser,
                 "[OPTIONS] \\fB-ir\\fP \\fIIN.fa\\fP \\fB-iv\\fP \\fIIN.vcf\\fP \\fB-o\\fP \\fIOUT.fa\\fP ");
    addDescription(parser,
                   "Apply variants from \\fIIN.vcf\\fP to \\fIIN.fa\\fP and write the results to \\fIout.fa\\fP.");

    // Add option and text sections.
    options.addOptions(parser);
    options.addTextSections(parser);

    // Parse command line.
    seqan::ArgumentParser::ParseResult res = seqan::parse(parser, argc, argv);

    // Only extract  options if the program will continue after parseCommandLine()
    if (res != seqan::ArgumentParser::PARSE_OK)
        return res;

    options.getOptionValues(parser);

    return seqan::ArgumentParser::PARSE_OK;
}
コード例 #2
0
ファイル: simplewidgets.cpp プロジェクト: hardik91/subsurface
DateWidget::DateWidget(QWidget *parent) : QWidget(parent),
	calendarWidget(new QCalendarWidget())
{
	setDate(QDate::currentDate());
	setMinimumSize(QSize(80, 64));
	setFocusPolicy(Qt::StrongFocus);
	calendarWidget->setWindowFlags(Qt::FramelessWindowHint);
	calendarWidget->setFirstDayOfWeek(getLocale().firstDayOfWeek());
	calendarWidget->setVerticalHeaderFormat(QCalendarWidget::NoVerticalHeader);

	connect(calendarWidget, SIGNAL(activated(QDate)), calendarWidget, SLOT(hide()));
	connect(calendarWidget, SIGNAL(clicked(QDate)), calendarWidget, SLOT(hide()));
	connect(calendarWidget, SIGNAL(activated(QDate)), this, SLOT(setDate(QDate)));
	connect(calendarWidget, SIGNAL(clicked(QDate)), this, SLOT(setDate(QDate)));
	calendarWidget->installEventFilter(this);
}
コード例 #3
0
ファイル: MailMessage.cpp プロジェクト: 1514louluo/poco
MailMessage::MailMessage(PartStoreFactory* pStoreFactory): 
	_pStoreFactory(pStoreFactory)
{
	Poco::Timestamp now;
	setDate(now);
	setContentType("text/plain");
}
コード例 #4
0
ファイル: app3c.c プロジェクト: Tandrial/AI-SE-Bsc
int main(void) {
	xplained_init();
	fprintf(COMM_LCD, G_NAME);
	setDate(2013, 1, 15, 11, 32, 50);
// 250 ms Timer siehe app3b.c ~ 0,09% Fehler

// Top Wert
	TCC0.PER = 32031;
// Prescaler
	TCC0.CTRLA = TC_CLKSEL_DIV256_gc;

	mcu_enable_interrupt();

	while (1) {
		if (update) {
			clearRow(LCD_ROW1);
			fprintf(COMM_LCD, "%.2i:%.2i:%.2i", hour, min, s);

			//Ganz komischer Fehler mit clearRow(LCD_ROW2), irgendwie wird LCD_ROW0 zum teil überschrieben, deshalb so:
			st7036_goto(LCD_ROW2, 0);
			fprintf(COMM_LCD, "             ");
			st7036_goto(LCD_ROW2, 0);
			fprintf(COMM_LCD, "%i.%i.%i", day, month, year);
			update = false;
		}
	}
	return 0;
}
コード例 #5
0
    foreach (const QString &headerRow, headerLines) {
        QRegExp messageIdRx("^Message-ID: (.*)$", Qt::CaseInsensitive);
        QRegExp fromRx("^From: (.*)$", Qt::CaseInsensitive);
        QRegExp toRx("^To: (.*)$", Qt::CaseInsensitive);
        QRegExp ccRx("^Cc: (.*)$", Qt::CaseInsensitive);
        QRegExp subjectRx("^Subject: (.*)$", Qt::CaseInsensitive);
        QRegExp dateRx("^Date: (.*)$", Qt::CaseInsensitive);
        QRegExp mimeVerstionRx("^MIME-Version: (.*)$", Qt::CaseInsensitive);
        QRegExp contentTransferEncodingRx("^Content-Transfer-Encoding: (.*)$", Qt::CaseInsensitive);
        QRegExp contentTypeRx("^Content-Type: (.*)$", Qt::CaseInsensitive);

        if (messageIdRx.indexIn(headerRow) != -1)
            setMessageId(messageIdRx.cap(1));
        else if (fromRx.indexIn(headerRow) != -1)
            setFrom(headerDecode(fromRx.cap(1)));
        else if (toRx.indexIn(headerRow) != -1)
            setTo(headerDecode(toRx.cap(1)));
        else if (ccRx.indexIn(headerRow) != -1)
            setCc(headerDecode(ccRx.cap(1)));
        else if (subjectRx.indexIn(headerRow) != -1)
            setSubject(headerDecode(subjectRx.cap(1)));
        else if (dateRx.indexIn(headerRow) != -1) {
            QDateTime date = QDateTime::fromString(dateRx.cap(1), Qt::RFC2822Date);
            setDate(date);
        } else if (mimeVerstionRx.indexIn(headerRow) != -1)
            setMimeVersion(mimeVerstionRx.cap(1));
        else if (contentTransferEncodingRx.indexIn(headerRow) != -1)
            setContentTransferEncoding(IqPostmanAbstractContent::contentTransferEncodingFromString(headerRow));
        else if (contentTypeRx.indexIn(headerRow) != -1)
            setContentType(IqPostmanAbstractContentType::createFromString(headerRow));
    }
コード例 #6
0
ファイル: CalendarDate.cpp プロジェクト: jimline/TestProjects
void CalendarDatePrivate::onClicked(CalendarItem* item) {
    if (NULL == item) {
        return;
    }
    ItemType itemOpt = item->getType();
    int itemData = item->getValue();

    int newYear = m_selectedYear;
    int newMonth = m_selectedMonth;
    int newDayOfMonth = m_selectedDayOfMonth;

    switch (m_viewType) {
    case VIEWTYPE_DAY:
        break;
    case VIEWTYPE_MONTH:
        g_return_if_fail(ITEMTYPE_MONTH == itemOpt);
        newMonth = itemData;
        updateDayView(FALSE, 0);
        break;
    case VIEWTYPE_YEAR:
        g_return_if_fail(ITEMTYPE_YEAR == itemOpt);
        newYear = itemData;
        updateMonthView(FALSE, 0);
        break;
    default:
        break;
    }

    GDateTime * newDate = g_date_time_new_local(newYear, newMonth, newDayOfMonth, 0, 0, 0);
    setDate(newDate, FALSE, 0);
    g_date_time_unref(newDate);
}
コード例 #7
0
void
KDatePicker::selectMonthClicked()
{
  // every year can have different month names (in some calendar systems)
  const KCalendarSystem * calendar = KGlobal::locale()->calendar();
  QDate date = d->table->date();
  const int months = calendar->monthsInYear(date);

  QMenu popup(d->selectMonth);

  for (int i = 1; i <= months; i++)
    popup.addAction(calendar->monthName(i, calendar->year(date)))->setData(i);

  //QMenuItem *item = popup.findItem (calendar->month(date) - 1);
  QAction *item=popup.actions()[calendar->month(date)-1];
  if (item) // if this happens the above should already given an assertion
    popup.setActiveAction(item);

  if ( (item = popup.exec(d->selectMonth->mapToGlobal(QPoint(0, 0)), item)) == 0 ) return;  // canceled

  int day = calendar->day(date);
  // ----- construct a valid date in this month:
  calendar->setYMD(date, calendar->year(date), item->data().toInt(), 1);
  date = date.addDays(qMin(day, calendar->daysInMonth(date)) - 1);
  // ----- set this month
  setDate(date);
}
コード例 #8
0
ファイル: kmymoneycalendar.cpp プロジェクト: CGenie/kmymoney
void
kMyMoneyCalendar::selectWeekClicked()
{
  const KCalendarSystem* calendar = KGlobal::locale()->calendar();

  KPopupFrame *popup = new KPopupFrame(this);
  KDatePickerPrivateWeekSelector *picker = new KDatePickerPrivateWeekSelector(calendar, date(), popup);
  picker->resize(picker->sizeHint());
  picker->setWeek(weekOfYear(date()));
  picker->selectAll();
  popup->setMainWidget(picker);
  connect(picker, SIGNAL(closeMe(int)), popup, SLOT(close(int)));
  picker->setFocus();

  if (popup->exec(d->selectWeek->mapToGlobal(QPoint(0, d->selectWeek->height())))) {
    QDate newDate;
    int week = picker->week();
    // check if new week will lead to a valid date
    calendar->setDate(newDate, calendar->year(date()), 1, 1);
    while (weekOfYear(newDate) > 50)
      newDate = newDate.addDays(1);
    while (weekOfYear(newDate) < week && (week != 53 || (week == 53 &&
                                          (weekOfYear(newDate) != 52 || weekOfYear(newDate.addDays(1)) != 1))))
      newDate = newDate.addDays(1);
    if (week == 53 && weekOfYear(newDate) == 52)
      while (weekOfYear(newDate.addDays(-1)) == 52)
        newDate = newDate.addDays(-1);

    // Set the date, if it's invalid in any way then alert user and don't update
    if (!setDate(newDate)) {
      KNotification::beep();
    }
  }
  delete popup;
}
コード例 #9
0
ファイル: Date.cpp プロジェクト: chahuistle/OpenMS
 void Date::set(UInt month, UInt day, UInt year)
 {
   if (!setDate(year, month, day))
   {
     throw Exception::ParseError(__FILE__, __LINE__, __PRETTY_FUNCTION__, String(year) + "-" + String(month) + "-" + String(day), "Invalid date");
   }
 }
コード例 #10
0
void Settings::BirthdayPage::checkDate()
{
    QDate parsedDate = m_locale->readDate(m_dateInput->text());
    if (parsedDate != QDate()) {
        setDate(parsedDate);
    }
}
コード例 #11
0
void DateEditDelegate::setEditorData(QWidget *editor, const QModelIndex &index) const
{
    auto date = index.model()->data(index, Qt::EditRole).toDate();

    auto dateEdit = static_cast<QDateEdit*>(editor);
    dateEdit->setDate(date);
}
コード例 #12
0
void XDateEdit::clear()
{
    if (DEBUG)
        qDebug("%s::clear()",
               qPrintable(parent() ? parent()->objectName() : objectName()));
    setDate(_nullDate, true);
}
コード例 #13
0
ファイル: device.c プロジェクト: billev/literacybridge
void setRTCFromText(char *time) {
	// This function parses the date and or time using any of the following format:
	//  1. #h#m#s
	//  2. #m#d
	//  3. #m#d#h#m#s
	//  where '#' represents any valid positive integer.  
	//  Note that 'm' is used for month and for minute. 'm' will mean month, unless it follows an 'h'.
	//  Note that year is not set because it is used to indicate the time period (see cold_start code)
	
	int month = -1, date = -1, hour = -1, min = -1, sec = -1;
	char *ptr;
	
	if ((ptr = findTimePart(time,'m'))) {
		month = strToInt(ptr);
		if ((ptr = findTimePart(time,'d')))
			date = strToInt(ptr);
		else 
			month = -1;
	}
	if ((ptr = findTimePart(time,'h'))) {
		hour = strToInt(ptr);
		if ((ptr = findTimePart(ptr,'m')))
			min = strToInt(ptr);
		if ((ptr = findTimePart(ptr,'s')))
			sec = strToInt(ptr);
	}
	if (month >= 1 && date >= 1)
		setDate(month,date);
	if (hour >= 0 && min >= 0 && sec >= 0)
		setRTC(hour,min,sec);
}
コード例 #14
0
ファイル: AgendaPlug.cpp プロジェクト: Rusto/qalendar
void AgendaPlug::selectDay()
{
    DatePickDialog *dpd = new DatePickDialog(DatePickDialog::Day, this->date, this);
    if (dpd->exec() == QDialog::Accepted)
        setDate(dpd->date());
    delete dpd;
}
コード例 #15
0
ファイル: Arc_2.0.c プロジェクト: linuxq/Arc_2.0
static void handleTick(struct tm *tick_time, TimeUnits units_changed) {
	calcAngles(tick_time);
	if (units_changed & DAY_UNIT) {
		setDate(tick_time);
	}
	layer_mark_dirty(layer);
}
コード例 #16
0
ファイル: Tv.cpp プロジェクト: juriad/tvp
void Tv::setAttribute( QDomAttr &attr) {
  if(attr.localName().compare("SourceInfoUrl", Qt::CaseInsensitive)==0) {
    setSourceInfoUrl(attr.value());
    return;
  }
  if(attr.localName().compare("SourceDataUrl", Qt::CaseInsensitive)==0) {
    setSourceDataUrl(attr.value());
    return;
  }
  if(attr.localName().compare("Date", Qt::CaseInsensitive)==0) {
    setDate(attr.value());
    return;
  }
  if(attr.localName().compare("GeneratorInfoName", Qt::CaseInsensitive)==0) {
    setGeneratorInfoName(attr.value());
    return;
  }
  if(attr.localName().compare("SourceInfoName", Qt::CaseInsensitive)==0) {
    setSourceInfoName(attr.value());
    return;
  }
  if(attr.localName().compare("GeneratorInfoUrl", Qt::CaseInsensitive)==0) {
    setGeneratorInfoUrl(attr.value());
    return;
  }
}
コード例 #17
0
ファイル: plugintrack.cpp プロジェクト: vakkov/musikloud2
void PluginTrack::loadTrack(const QString &service, const QVariantMap &track) {
    setService(service);
    setArtist(track.value("artist").toString());
    setArtistId(track.value("artistId").toString());
    setDate(track.value("date").toString());
    setDescription(track.value("description").toString());
    setDownloadable(track.value("downloadable", true).toBool());
    setFormat(track.value("format").toString());
    setGenre(track.value("genre").toString());
    setId(track.value("id").toString());
    setLargeThumbnailUrl(track.value("largeThumbnailUrl").toString());
    setPlayCount(track.value("playCount").toLongLong());
    setStreamUrl(track.value("streamUrl").toString());
    setThumbnailUrl(track.value("thumbnailUrl").toString());
    setTitle(track.value("title").toString());
    setUrl(track.value("url").toString());
        
    if (track.value("duration").type() == QVariant::String) {
        setDurationString(track.value("duration").toString());
    }
    else {
        setDuration(track.value("duration").toLongLong());
    }
    
    if (track.value("size").type() == QVariant::String) {
        setSizeString(track.value("size").toString());
    }
    else {
        setSize(track.value("size").toLongLong());
    }
}
コード例 #18
0
ファイル: Date.cpp プロジェクト: IS-ENES-Data/QA-DKRZ
double
Date::getSince(Date &lag, const char *ref)
{
    // this wrapping method returns the time lag since date.
    // valid expr for desc: seconds, minutes, hours, days, months year
    // If date is omitted, a reference date must have been
    // set previously.

    std::string sRef(ref);

    if( sRef.size() > 0 )
        setDate(sRef);

    double dJul=lag.getJulianDay() - getJulianDay();

    if( unitStr.substr(0,1) == "y" )
    {   // ToDo
        return 0.;
    }
    else if( unitStr.substr(0,2) == "mo" )
    {   // ToDo
        return 0.;
    }
    else if( unitStr.substr(0,4) == "day" )
        return static_cast<double>(dJul);
    else if( unitStr.substr(0,1) == "h" )
        return static_cast<double>(dJul*24.);
    else if( unitStr.substr(0,2) == "mi" )
        return static_cast<double>(dJul*24.*60.);
    else if( unitStr.substr(0,1) == "s" )
        return static_cast<double>(dJul*24.*60.*60.);

    return 0.;  // a return statement here is required for the xlc++
}
コード例 #19
0
seqan::ArgumentParser::ParseResult parseCommandLine(ModifyStringOptions & options, int argc, char const ** argv)
{
	seqan::ArgumentParser parser("w1/(soon w50)_creator");
	addOption(parser, seqan::ArgParseOption("i", "input-file", "Path to the input file", seqan::ArgParseArgument::INPUT_FILE, "IN"));
	setRequired(parser, "input-file");
	setShortDescription(parser, "Methylation Tools");
	setVersion(parser, "0.0.6");
	setDate(parser, "November 2017");
	addUsageLine(parser, "-i CX_report.txt [\\fIOPTIONS\\fP] ");
	addOption(parser, seqan::ArgParseOption("l", "window-length", "Size of window",seqan::ArgParseArgument::INTEGER, "INT"));
	setDefaultValue(parser, "window-length", "50");

	addDescription(parser, "Create a w1 (and soon w50) file from a CX report.");
	seqan::ArgumentParser::ParseResult res = seqan::parse(parser, argc, argv);

	// If parsing was not successful then exit with code 1 if there were errors.
	// Otherwise, exit with code 0 (e.g. help was printed).
	if (res != seqan::ArgumentParser::PARSE_OK)
		return res;

	getOptionValue(options.inputFileName, parser, "input-file");
	getOptionValue(options.window_length, parser, "window-length");

	return seqan::ArgumentParser::PARSE_OK;

}
コード例 #20
0
void
kMyMoneyDateTbl::keyPressEvent( QKeyEvent *e )
{
    if ( e->key() == Qt::Key_Prior ) {
        setDate(date.addMonths(-1));
        return;
    }
    if ( e->key() == Qt::Key_Next ) {
        setDate(date.addMonths(1));
        return;
    }

    if ( e->key() == Qt::Key_Up ) {
        if ( date.day() > 7 ) {
            setDate(date.addDays(-7));
            return;
        }
    }
    if ( e->key() == Qt::Key_Down ) {
        if ( date.day() <= date.daysInMonth()-7 ) {
            setDate(date.addDays(7));
            return;
        }
    }
    if ( e->key() == Qt::Key_Left ) {
        if ( date.day() > 1 ) {
            setDate(date.addDays(-1));
            return;
        }
    }
    if ( e->key() == Qt::Key_Right ) {
        if ( date.day() < date.daysInMonth() ) {
            setDate(date.addDays(1));
            return;
        }
    }

    if ( e->key() == Qt::Key_Minus ) {
        setDate(date.addDays(-1));
        return;
    }
    if ( e->key() == Qt::Key_Plus ) {
        setDate(date.addDays(1));
        return;
    }
    if ( e->key() == Qt::Key_N ) {
        setDate(QDate::currentDate());
        return;
    }

    KNotifyClient::beep();
}
コード例 #21
0
void AnnotationDialog::KDateEdit::dateEntered(QDate newDate)
{
    if ((mHandleInvalid || newDate.isValid()) && validate(newDate)) {
        setDate(newDate);
        emit dateChanged(newDate);
        emit dateChanged( DB::ImageDate( QDateTime(newDate), QDateTime(newDate) ) );
    }
}
コード例 #22
0
ファイル: mwin.cpp プロジェクト: BackupTheBerlios/minos-svn
void dtg::setIsoDTG( const std::string &d )
{
   // Untested! No errror handling!
   std::string curDate = d.substr( 2, 6 );
   std::string curTime = d.substr( 9, 8 );
   setDate( curDate, DTGLOG );
   setTime( curTime, DTGDISP );
}
コード例 #23
0
ファイル: Date.cpp プロジェクト: IS-ENES-Data/QA-DKRZ
Date&
Date::operator=( std::string z)
{
    setDate( z );

    isDateSet = true ;
    return *this;
}
コード例 #24
0
void
KDatePicker::yearBackwardClicked()
{
    QDate temp;
    temp = KGlobal::locale()->calendar()->addYears( d->table->date(), -1 );

    setDate( temp );
}
コード例 #25
0
void BuildInfoJSON::fromJSONDate(JSONValue *json_value, bool ignore_extras)
  {
    assert(json_value != NULL);
    const JSONStringValue *json_string = json_value->string_value();
    if (json_string == NULL)
        throw("The value for field Date of BuildInfoJSON is not a string.");
    setDate(std::string(json_string->getData()));
  }
コード例 #26
0
void
ExtDatePicker::monthForwardClicked()
{
    ExtDate temp;
//    temp = KGlobal::locale()->calendar()->addMonths( table->getDate(), 1 );
    temp = d->calendar->addMonths( table->getDate(), 1 );
    setDate( temp );
}
コード例 #27
0
void
ExtDatePicker::yearBackwardClicked()
{
    ExtDate temp;
//    temp = KGlobal::locale()->calendar()->addYears( table->getDate(), -1 );
    temp = d->calendar->addYears( table->getDate(), -1 );
    setDate( temp );
}
コード例 #28
0
/*!
    Constructs datetime picker widget with only date functionalities and with default locale's date format.
    
    \param date QDate value.
*/
HbDateTimePicker::HbDateTimePicker(const QDate &date, QGraphicsItem *parent ):
HbWidget(*new HbDateTimePickerPrivate, parent)
{
    Q_D(HbDateTimePicker);

    d->init(QVariant::Date);
    setDate(date);
}
コード例 #29
0
void DateTime::add(const Duration &duration) {
    if (isValid()) {
        DateTime x = addMSecs(duration.milliseconds());
        setDate( x.date() );
        setTime( x.time() );
        //kDebug(planDbg())<<toString();
    }
}
コード例 #30
0
void
KDatePicker::monthForwardClicked()
{
    QDate temp;
    temp = KGlobal::locale()->calendar()->addMonths( d->table->date(), 1 );

    setDate( temp );
}