Esempio n. 1
0
QList<EventDay *> *TablesWizard::getSchedule()
{
    QList<EventDay*>* result = new QList<EventDay*>();

    int day = ui->m_dayCount->value();

    for(auto key : m_editors.keys())
    {
        auto value = m_editors.value(key);

        auto time = key->time();
        value->setData(Qt::DisplayRole,time);
    }

    for(int i = 0; i < day ; ++i)
    {
        auto itemStart = ui->tableWidget->item(i,0);
        auto itemEnd = ui->tableWidget->item(i,1);

        auto event = new EventDay();
        event->setId(i);
        QTime time1 = itemStart->data(Qt::DisplayRole).toTime();
        int time1Min = time1.minute()+time1.hour()*60;
        event->setStartTime(time1Min);

        QTime time2 = itemEnd->data(Qt::DisplayRole).toTime();
        int time2Min = time2.minute()+time2.hour()*60;
        event->setEndTime(time2Min);

        result->append(event);
    }


    return result;
}
void QmlProfilerModelManager::load()
{
    QString filename = d->fileName;

    QFile file(filename);

    if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) {
        emit error(tr("Could not open %1 for reading.").arg(filename));
        return;
    }

    // erase current
    clear();

    setState(QmlProfilerDataState::AcquiringData);

    QmlProfilerFileReader reader;
    connect(&reader, SIGNAL(error(QString)), this, SIGNAL(error(QString)));
    connect(&reader, SIGNAL(rangedEvent(int,int,qint64,qint64,QStringList,QmlDebug::QmlEventLocation,
                                        qint64, qint64, qint64, qint64, qint64)),
            this, SLOT(addQmlEvent(int,int,qint64,qint64,QStringList,QmlDebug::QmlEventLocation,
                             qint64, qint64, qint64, qint64, qint64)));
    connect(&reader, SIGNAL(traceStartTime(qint64)), traceTime(), SLOT(setStartTime(qint64)));
    connect(&reader, SIGNAL(traceEndTime(qint64)), traceTime(), SLOT(setEndTime(qint64)));
    reader.setV8DataModel(d->v8Model);
    reader.load(&file);

    complete();
}
Esempio n. 3
0
VTTCue::VTTCue(ScriptExecutionContext& context, const WebVTTCueData& cueData)
    : TextTrackCue(context, 0, 0)
{
    initialize(context);
    setText(cueData.content());
    setStartTime(cueData.startTime(), IGNORE_EXCEPTION);
    setEndTime(cueData.endTime(), IGNORE_EXCEPTION);
    setId(cueData.id());
    setCueSettings(cueData.settings());
    m_originalStartTime = cueData.originalStartTime();
}
Esempio n. 4
0
void Fact::contradicts(Fact* fact)
{
   if((fact->getType() == getType()) 
      && (negation_ == fact->negation_))
      {
         if(isTrue(fact, fact->starttime())) 
            {
               setEndTime(fact->starttime());
               return;
            }
      }
}
int EventEditor::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
    _id = QObject::qt_metacall(_c, _id, _a);
    if (_id < 0)
        return _id;
    if (_c == QMetaObject::InvokeMetaMethod) {
        if (_id < 11)
            qt_static_metacall(this, _c, _id, _a);
        _id -= 11;
    }
#ifndef QT_NO_PROPERTIES
      else if (_c == QMetaObject::ReadProperty) {
        void *_v = _a[0];
        switch (_id) {
        case 0: *reinterpret_cast< QString*>(_v) = subject(); break;
        case 1: *reinterpret_cast< QString*>(_v) = location(); break;
        case 2: *reinterpret_cast< QDateTime*>(_v) = startTime(); break;
        case 3: *reinterpret_cast< QDateTime*>(_v) = endTime(); break;
        case 4: *reinterpret_cast< int*>(_v) = folderId(); break;
        case 5: *reinterpret_cast< int*>(_v) = accountId(); break;
        case 6: *reinterpret_cast< Mode*>(_v) = mode(); break;
        }
        _id -= 7;
    } else if (_c == QMetaObject::WriteProperty) {
        void *_v = _a[0];
        switch (_id) {
        case 0: setSubject(*reinterpret_cast< QString*>(_v)); break;
        case 1: setLocation(*reinterpret_cast< QString*>(_v)); break;
        case 2: setStartTime(*reinterpret_cast< QDateTime*>(_v)); break;
        case 3: setEndTime(*reinterpret_cast< QDateTime*>(_v)); break;
        case 4: setFolderId(*reinterpret_cast< int*>(_v)); break;
        case 5: setAccountId(*reinterpret_cast< int*>(_v)); break;
        case 6: setMode(*reinterpret_cast< Mode*>(_v)); break;
        }
        _id -= 7;
    } else if (_c == QMetaObject::ResetProperty) {
        _id -= 7;
    } else if (_c == QMetaObject::QueryPropertyDesignable) {
        _id -= 7;
    } else if (_c == QMetaObject::QueryPropertyScriptable) {
        _id -= 7;
    } else if (_c == QMetaObject::QueryPropertyStored) {
        _id -= 7;
    } else if (_c == QMetaObject::QueryPropertyEditable) {
        _id -= 7;
    } else if (_c == QMetaObject::QueryPropertyUser) {
        _id -= 7;
    }
#endif // QT_NO_PROPERTIES
    return _id;
}
Esempio n. 6
0
void TextTrackCue::setEndTime(double value, ExceptionCode& ec)
{
    // NaN, Infinity and -Infinity values should trigger a TypeError.
    if (std::isinf(value) || std::isnan(value)) {
        ec = TypeError;
        return;
    }

    // TODO(93143): Add spec-compliant behavior for negative time values.
    if (m_endTime.toDouble() == value || value < 0)
        return;

    setEndTime(MediaTime::createWithDouble(value));
}
Esempio n. 7
0
/*!
  Specifies the middle time of this summary item. The parameter must be valid
  and non-null. If the parameter is invalid or null, no value is set.

  \param dateTime the middle time
  \sa middleTime()
*/
void KDGanttViewSummaryItem::setMiddleTime( const QDateTime& dateTime )
{
 if (! dateTime.isValid() ) {
    qDebug("KDGanttViewSummaryItem::setMiddleTime():Invalid parameter-no time set");
    return;
  }
  if (!myMiddleTime) myMiddleTime = new QDateTime;
  *myMiddleTime = dateTime;
  if ( myEndTime < middleTime() )
      setEndTime( middleTime() );
  if ( myStartTime > middleTime() )
      setStartTime( middleTime() );
  updateCanvasItems();
}
Esempio n. 8
0
/**
 * @brief Initializes an ISIS cube converting it into a SPICE segment
 *
 * This method is called to extract the perinent contents of an ISIS cube file
 * and accumulate generic information that is used to create the output SPICE
 * kernel segment.  Other specific kernel types can use this class as its base
 * class and add to it additional elements to complete the needed content for
 * the NAIF kernel.
 *
 * @param cube ISIS cube file to accumulate information from
 */
void SpiceSegment::init(Cube &cube) {

  _kernels.UnLoad();  // Unload all active, owned kernels
  init();            // Init local variables

  _fname = cube.fileName();

  //  Extract ISIS CK blob and transform to CK 3 content
  NaifStatus::CheckErrors();
  try {

    // Order is somewhat important here.  The call to initialize Kernels
    // object checks the NAIF pool for existance.  It logs their NAIF
    // status as loaded which may cause trouble from here on...
    Pvl *label = cube.label();
    _kernels.Init(*label);
    Camera *camera = cube.camera();

    //  Determine segment ID from product ID if it exists, otherwise basename
    if ( _name.isEmpty() ) {
      _name = getKeyValue(*label, "ProductId");
      if (_name.isEmpty() ) {
        _name = FileName(_fname).baseName();
      }
    }

    // Get instrument and target ids
    QString value("");
    value = getKeyValue(*label, "InstrumentId");
    if (!value.isEmpty()) { _instId = value; }
    value = getKeyValue(*label, "TargetName");
    if (!value.isEmpty()) { _target = value; }

    // Get default times for sorting purposes
    setStartTime(camera->cacheStartTime().Et());
    setEndTime(camera->cacheEndTime().Et());

  } catch ( IException &ie  ) {
    ostringstream mess;
    mess << "Failed to construct Spice Segment basics from ISIS file " << _fname;
    throw IException(ie, IException::User, mess.str(), _FILEINFO_);
  }

  return;
}
void InbandDataTextTrack::addDataCue(InbandTextTrackPrivate*, const MediaTime& start, const MediaTime& end, PassRefPtr<SerializedPlatformRepresentation> prpPlatformValue, const String& type)
{
    RefPtr<SerializedPlatformRepresentation> platformValue = prpPlatformValue;
    if (m_incompleteCueMap.find(platformValue.get()) != m_incompleteCueMap.end())
        return;

    auto cue = DataCue::create(*scriptExecutionContext(), start, end, platformValue.copyRef(), type);
    if (hasCue(cue.ptr(), TextTrackCue::IgnoreDuration)) {
        LOG(Media, "InbandDataTextTrack::addDataCue ignoring already added cue: start=%s, end=%s\n", toString(cue->startTime()).utf8().data(), toString(cue->endTime()).utf8().data());
        return;
    }

    if (end.isPositiveInfinite() && mediaElement()) {
        cue->setEndTime(mediaElement()->durationMediaTime());
        m_incompleteCueMap.add(WTFMove(platformValue), cue.copyRef());
    }

    addCue(WTFMove(cue), ASSERT_NO_EXCEPTION);
}
Esempio n. 10
0
/**
 * \brief 初始化攻城
 * 读取脚本并向目标场景添加本次攻城
 *
 * \return 初始化是否成功
 */
bool Rush::init(Scene * s)
{
  if (!loadRushData(id,rushDelay,countryID)) return false;
  setEndTime((rushDelay+lasttime)*1000);

  if (s)
  {
    strncpy(mapName,s->name,MAX_NAMESIZE);
    s->addRush(this);
  }
  else
  {
    Scene *scene=SceneManager::getInstance().getSceneByName(mapName);
    if (!scene) return false;
    scene->addRush(this);
  }

  if (0==strncmp("",text,128))
  {
    /*
    Cmd::Session::t_cityRush_SceneSession send;
    bzero(send.bossName,MAX_NAMESIZE);
    bzero(send.rushName,MAX_NAMESIZE);
    bzero(send.mapName,MAX_NAMESIZE);
    strncpy(send.bossName,bossName,MAX_NAMESIZE-1);
    strncpy(send.rushName,rushName,MAX_NAMESIZE-1);
    strncpy(send.mapName,mapName,MAX_NAMESIZE-1);
    send.delay = rushDelay;
    send.countryID = countryID;
    sessionClient->sendCmd(&send,sizeof(send));
    */
  }
  else
  {
    Cmd::Session::t_cityRushCust_SceneSession send;
    bcopy(text,send.text,128,sizeof(send.text));
    Xlogger->debug("%s",text);
    send.countryID = countryID;
    sessionClient->sendCmd(&send,sizeof(send));
  }

  return true;
}
Esempio n. 11
0
void
Programme::setFromData(uint8_t f0, uint8_t f1, uint8_t f2, uint8_t f3, uint8_t f4)
{
	
	if (f0 == 0xFF) {
		// Weekday programme
		setWeekday(true);
		setWeekdays(f2);
	} else {
		// Non-weekday programme
		setWeekday(false);
		setStartDayNumber(f0);
		setEndDayNumber(f2);
	}
	
	// Load start and end times
	setStartTime(f1);
	setEndTime(f3);
	
	// Load temperature
	setTemperature(f4);
}
Esempio n. 12
0
void VideoDecoder::setEndFrame(uint frame) {
	VideoTrack *track = 0;

	for (TrackList::iterator it = _tracks.begin(); it != _tracks.end(); it++) {
		if ((*it)->getTrackType() == Track::kTrackTypeVideo) {
			// We only allow this when one video track is present
			if (track)
				return;

			track = (VideoTrack *)*it;
		}
	}

	// If we didn't find a video track, we can't set the final frame (of course)
	if (!track)
		return;

	Audio::Timestamp time = track->getFrameTime(frame + 1);

	if (time < 0)
		return;

	setEndTime(time);
}
void CC3NodeAnimationSegment::setEndFrameIndex( GLuint endFrameIndex )
{
	setEndTime( m_pBaseAnimation->timeAtFrame( endFrameIndex ) );
}