mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-03-13 08:58:54 -05:00
Add capabilities for multiple parsers into the timeline gui
Fix delta time controller
This commit is contained in:
@@ -164,17 +164,17 @@ void ControlWidget::update(QString currentTime, QString currentDelta) {
|
||||
void ControlWidget::onValueChange() {
|
||||
float value = static_cast<float>(_setDelta->value());
|
||||
|
||||
int delta;
|
||||
float delta;
|
||||
if (value < 0.f) {
|
||||
value = -value;
|
||||
float d = std::pow(2, value / 10);
|
||||
delta = static_cast<int>(-d);
|
||||
float d = std::pow(2, value / 10) - 1.f;
|
||||
delta = -d;
|
||||
}
|
||||
else {
|
||||
float d = std::pow(2, value / 10);
|
||||
delta = static_cast<int>(d);
|
||||
float d = std::pow(2, value / 10) - 1.f;
|
||||
delta = d;
|
||||
}
|
||||
|
||||
|
||||
QString script = "openspace.time.setDeltaTime(" + QString::number(delta) + ");";
|
||||
emit scriptActivity(script);
|
||||
}
|
||||
|
||||
@@ -116,7 +116,8 @@ void MainWindow::onConnect(QString host, QString port) {
|
||||
|
||||
void MainWindow::readTcpData() {
|
||||
static const uint16_t MessageTypeStatus = 0;
|
||||
static const uint16_t MessageTypePlayBook = 2;
|
||||
static const uint16_t MessageTypePlayBookHongKang = 2;
|
||||
static const uint16_t MessageTypePlayBookLabel = 3;
|
||||
|
||||
QByteArray data = _socket->readAll();
|
||||
|
||||
@@ -139,7 +140,8 @@ void MainWindow::readTcpData() {
|
||||
case MessageTypeStatus:
|
||||
handleStatusMessage(data.mid(2));
|
||||
break;
|
||||
case MessageTypePlayBook:
|
||||
case MessageTypePlayBookHongKang:
|
||||
case MessageTypePlayBookLabel:
|
||||
{
|
||||
const char* payloadDebug = data.mid(2).data();
|
||||
|
||||
|
||||
@@ -86,12 +86,12 @@ void TimelineWidget::paintEvent(QPaintEvent* event) {
|
||||
}
|
||||
|
||||
void TimelineWidget::setData(std::vector<Image> images, std::map<uint8_t, std::string> targetMap, std::map<uint16_t, std::string> instrumentMap) {
|
||||
_images = std::move(images);
|
||||
_images.insert(_images.end(), images.begin(), images.end());
|
||||
|
||||
std::sort(_images.begin(), _images.end(), [](const Image& a, const Image& b) { return a.beginning < b.beginning; });
|
||||
|
||||
_targetMap = std::move(targetMap);
|
||||
_instrumentMap = std::move(instrumentMap);
|
||||
_targetMap.insert(targetMap.begin(), targetMap.end());
|
||||
_instrumentMap.insert(instrumentMap.begin(), instrumentMap.end());
|
||||
|
||||
_instruments.clear();
|
||||
std::set<std::string> instruments;
|
||||
|
||||
Reference in New Issue
Block a user