Skip to content

Commit

Permalink
Changed time widgets to display time spans instead of milliseconds.
Browse files Browse the repository at this point in the history
Added window icons.
  • Loading branch information
8bitbuddhist committed Nov 27, 2019
1 parent c797c24 commit 8fd6202
Show file tree
Hide file tree
Showing 113 changed files with 601 additions and 397 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@ All notable changes to PixelMaestro Studio will be documented in this file.

The format is loosely based on [Keep a Changelog](http://keepachangelog.com/).

## [v0.51] - In Progress

### Added
- Added window icons.

### Changed
- Changed time widgets to display time spans instead of milliseconds.

## [v0.50.2] - 2019-07-26

### Added
Expand Down
13 changes: 12 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ $ ./PixelMaestro_Studio
### Build Instructions (Linux)
1. [Download and install Qt](https://www.qt.io/download) along with the QtSerialPort module.
2. Clone the GitHub repository to your computer:

- `git clone https://github.com/8bitbuddhist/PixelMaestro-Studio.git`
3. Navigate to the newly created repository folder and use `git submodule` to download the PixelMaestro core library:
```bash
Expand All @@ -60,7 +61,7 @@ $ ./PixelMaestro_Studio

### Building Static Qt

When creating a static build of Qt 5.12.x, `make` might fails with a "bootstrap-private" error. [See this StackOverflow answer for details](https://forum.qt.io/topic/98501/static-compile-error-qt5-12-0-bootstrap-private/8)
When creating a static build of Qt 5.12.x, `make` might fail with a "bootstrap-private" error. [See this StackOverflow answer for details](https://forum.qt.io/topic/98501/static-compile-error-qt5-12-0-bootstrap-private/8)

To fix this, install the following libs:

Expand All @@ -82,6 +83,16 @@ $ make -j3 // -j param specifies the number of cores
$ make install // Compiled static Qt libs will be placed in the install dir
```

### Building MXE

[MXE](https://mxe.cc) is used to build the PixelMaestro Windows executable in Linux.

```bash
$ git clone https://github.com/mxe/mxe.git
$ cd mxe
$ make qtbase qtserialport
```

## Credits

Icons based on the [Monochrome icon set by Danny Allen](https://store.kde.org/p/1002558), retrieved from [Openclipart](https://openclipart.org/).
Binary file modified docs/.doctrees/Home.doctree
Binary file not shown.
Binary file modified docs/.doctrees/api/file_src_dialog_editeventdialog.cpp.doctree
Binary file not shown.
Binary file modified docs/.doctrees/api/file_src_dialog_preferencesdialog.cpp.doctree
Binary file not shown.
Binary file modified docs/.doctrees/api/file_src_utility_cueinterpreter.cpp.doctree
Binary file not shown.
Binary file not shown.
Binary file modified docs/.doctrees/api/file_src_widget_canvascontrolwidget.cpp.doctree
Binary file not shown.
Binary file modified docs/.doctrees/api/file_src_widget_showcontrolwidget.cpp.doctree
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified docs/.doctrees/api/program_listing_file_src_main.cpp.doctree
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified docs/.doctrees/environment.pickle
Binary file not shown.
6 changes: 3 additions & 3 deletions docs/Home.html
Original file line number Diff line number Diff line change
Expand Up @@ -170,15 +170,15 @@ <h1>Home<a class="headerlink" href="#home" title="Permalink to this headline">¶
<p>Welcome to the PixelMaestro Studio documentation!</p>
<div class="section" id="what-is-pixelmaestro-studio">
<h2>What is PixelMaestro Studio?<a class="headerlink" href="#what-is-pixelmaestro-studio" title="Permalink to this headline"></a></h2>
<p>PixelMaestro Studio is a desktop application for managing RGB LEDs, built on the <a class="reference external" href="https://github.com/8bitbuddhist/PixelMaestro/">PixelMaestro library</a>. With PixelMaestro Studio, you can design animations, create dynamic light shows, control lights over USB, and more.</p>
<p>PixelMaestro Studio is an application for controlling RGB LEDs, built on the <a class="reference external" href="https://github.com/8bitbuddhist/PixelMaestro/">PixelMaestro library</a>. With PixelMaestro Studio, you can design animations, create dynamic light shows, control lights over USB, and more.</p>
<p>To get started with PixelMaestro Studio, check out the <a class="reference internal" href="Getting-Started.html"><span class="doc">Getting Started</span></a> guide. If you want to learn more about the PixelMaestro library, visit the <a class="reference external" href="https://github.com/8bitbuddhist/PixelMaestro/">PixelMaestro GitHub page</a> or the <a class="reference external" href="https://8bitbuddhist.github.io/PixelMaestro/index.html">PixelMaestro documentation</a>.</p>
</div>
<div class="section" id="faq">
<h2>FAQ<a class="headerlink" href="#faq" title="Permalink to this headline"></a></h2>
<p><strong>What devices are supported by PixelMaestro Studio?</strong></p>
<p>PixelMaestro Studio works on any device that supports serial communication and runs the PixelMaestro library. This includes Arduino, Raspberry Pi, Teensy, etc.</p>
<p>PixelMaestro Studio can control any device that can run the PixelMaestro library and supports serial communication. This includes Arduino, Raspberry Pi, Teensy, etc.</p>
<p><strong>How do I connect my device to PixelMaestro Studio?</strong></p>
<p>Plug in your device over USB, then follow the instructions in the <a class="reference internal" href="Device-Tab.html"><span class="doc">Device Tab</span></a> documentation.</p>
<p>Plug in your device over USB, then follow the instructions in the <a class="reference internal" href="Device-Tab.html"><span class="doc">Device Tab</span></a> page.</p>
<p><strong>When I click Connect on the Device Tab, nothing happens or I get an error message</strong></p>
<p>Make sure you have read and write access to the serial port that the device is connected on. Also, check that the port isn’t currently being used by another process.</p>
<p><strong>My device is connected, but when I upload a Cuefile or enable Live Updates, nothing happens</strong></p>
Expand Down
6 changes: 3 additions & 3 deletions docs/_sources/Home.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Welcome to the PixelMaestro Studio documentation!
What is PixelMaestro Studio?
----------------------------

PixelMaestro Studio is a desktop application for managing RGB LEDs, built on the `PixelMaestro library <https://github.com/8bitbuddhist/PixelMaestro/>`_. With PixelMaestro Studio, you can design animations, create dynamic light shows, control lights over USB, and more.
PixelMaestro Studio is an application for controlling RGB LEDs, built on the `PixelMaestro library <https://github.com/8bitbuddhist/PixelMaestro/>`_. With PixelMaestro Studio, you can design animations, create dynamic light shows, control lights over USB, and more.

To get started with PixelMaestro Studio, check out the :doc:`Getting Started <Getting-Started>` guide. If you want to learn more about the PixelMaestro library, visit the `PixelMaestro GitHub page <https://github.com/8bitbuddhist/PixelMaestro/>`_ or the :pmdocs:`PixelMaestro documentation <index.html>`.

Expand All @@ -16,11 +16,11 @@ FAQ

**What devices are supported by PixelMaestro Studio?**

PixelMaestro Studio works on any device that supports serial communication and runs the PixelMaestro library. This includes Arduino, Raspberry Pi, Teensy, etc.
PixelMaestro Studio can control any device that can run the PixelMaestro library and supports serial communication. This includes Arduino, Raspberry Pi, Teensy, etc.

**How do I connect my device to PixelMaestro Studio?**

Plug in your device over USB, then follow the instructions in the :doc:`Device Tab <Device-Tab>` documentation.
Plug in your device over USB, then follow the instructions in the :doc:`Device Tab <Device-Tab>` page.

**When I click Connect on the Device Tab, nothing happens or I get an error message**

Expand Down
4 changes: 4 additions & 0 deletions docs/_sources/api/file_src_dialog_editeventdialog.cpp.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ Includes
--------


- ``QIcon``

- ``QTime``

- ``editeventdialog.h`` (:ref:`file_src_dialog_editeventdialog.h`)

- ``ui_editeventdialog.h``
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ Includes

- ``QSettings``

- ``QTime``

- ``preferencesdialog.h`` (:ref:`file_src_dialog_preferencesdialog.h`)

- ``ui_preferencesdialog.h``
Expand Down
2 changes: 2 additions & 0 deletions docs/_sources/api/file_src_utility_cueinterpreter.cpp.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ Includes
--------


- ``QTime``

- ``cueinterpreter.h`` (:ref:`file_src_utility_cueinterpreter.h`)

- ``dialog/preferencesdialog.h`` (:ref:`file_src_dialog_preferencesdialog.h`)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ Includes
--------


- ``QTime``

- ``QWidget``

- ``animation/animation.h``
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ Includes

- ``QPushButton``

- ``QTime``

- ``canvascontrolwidget.h`` (:ref:`file_src_widget_canvascontrolwidget.h`)

- ``ui_canvascontrolwidget.h``
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ Includes

- ``QSettings``

- ``QTime``

- ``controller/showcontroller.h`` (:ref:`file_src_controller_showcontroller.h`)

- ``dialog/editeventdialog.h`` (:ref:`file_src_dialog_editeventdialog.h`)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,16 +118,19 @@ Program Listing for File maestrocontroller.cpp
Show* show = maestro_->get_show();
if (show != nullptr) {
write_cue_to_stream(datastream, maestro_handler->set_show());
ShowCueHandler* show_handler = dynamic_cast<ShowCueHandler*>(maestro_->get_cue_controller().get_handler(CueController::Handler::ShowCueHandler));
write_cue_to_stream(datastream, show_handler->set_looping(show->get_looping()));
write_cue_to_stream(datastream, show_handler->set_timing_mode(show->get_timing()));
// Save events for last until I can nail down the byte alignment issues with event Cues
if (show->get_events() != nullptr) {
write_cue_to_stream(datastream, show_handler->set_events(show->get_events(), show->get_num_events(), false));
}
write_cue_to_stream(datastream, show_handler->set_looping(show->get_looping()));
write_cue_to_stream(datastream, show_handler->set_timing_mode(show->get_timing()));
}
}
// Call Sections
// Save Sections
if (save_handlers == nullptr || save_handlers->contains(CueController::Handler::SectionCueHandler)) {
for (uint8_t section = 0; section < num_sections_; section++) {
save_section_to_datastream(datastream, section, 0, save_handlers);
Expand Down Expand Up @@ -305,7 +308,8 @@ Program Listing for File maestrocontroller.cpp
void MaestroController::write_cue_to_stream(QDataStream& stream, uint8_t* cue) {
if (cue != nullptr) {
stream.writeRawData((const char*)cue, maestro_->get_cue_controller().get_cue_size(cue));
uint32_t size = maestro_->get_cue_controller().get_cue_size(cue);
stream.writeRawData((const char*)cue, (int)size);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ Program Listing for File adddevicedialog.cpp
ui(new Ui::AddDeviceDialog) {
ui->setupUi(this);
setWindowIcon(QIcon("qrc:/../../../docsrc/images/logo.png"));
this->devices_ = devices;
this->device_ = device;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ Program Listing for File cueinterpreterdialog.cpp
CueInterpreterDialog::CueInterpreterDialog(QWidget *parent, uint8_t* cuefile, uint32_t size) : QDialog(parent), ui(new Ui::CueInterpreterDialog), model_(cuefile, size) {
ui->setupUi(this);
setWindowIcon(QIcon("qrc:/../../../docsrc/images/logo.png"));
ui->interpretedCueTableView->setModel(&model_);
ui->interpretedCueTableView->resizeColumnToContents(0);
ui->interpretedCueTableView->setTextElideMode(Qt::ElideRight);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ Program Listing for File editeventdialog.cpp

.. code-block:: cpp
#include <QIcon>
#include <QTime>
#include "editeventdialog.h"
#include "ui_editeventdialog.h"
#include "utility/cueinterpreter.h"
Expand All @@ -18,14 +20,17 @@ Program Listing for File editeventdialog.cpp
EditEventDialog::EditEventDialog(Event& event, QWidget *parent) : QDialog(parent), ui(new Ui::EditEventDialog), event_(event) {
ui->setupUi(this);
setWindowIcon(QIcon("qrc:/../../../docsrc/images/logo.png"));
ui->cueLineEdit->setText(CueInterpreter::interpret_cue(event.get_cue()));
ui->timeSpinBox->setValue(event.get_time());
ui->timeSpinBox->setFocus();
QTime event_time = QTime::fromMSecsSinceStartOfDay(event.get_time());
ui->timeEdit->setTime(event_time);
ui->timeEdit->setFocus();
}
void EditEventDialog::on_buttonBox_accepted() {
uint32_t new_time = ui->timeSpinBox->value();
uint32_t new_time = ui->timeEdit->time().msecsSinceStartOfDay();
if (new_time != event_.get_time()) {
event_.set_time(new_time);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ Program Listing for File maestrodrawingareadialog.cpp
QDialog(parent),
ui(new Ui::MaestroDrawingAreaDialog),
maestro_controller_(maestro_controller) {
setWindowIcon(QIcon("qrc:/../../../docsrc/images/logo.png"));
// Capture button key presses
qApp->installEventFilter(this);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ Program Listing for File paletteeditdialog.cpp
namespace PixelMaestroStudio {
PaletteEditDialog::PaletteEditDialog(PaletteControlWidget* parent, PaletteController::PaletteWrapper* target_palette_wrapper) : QDialog(parent), ui(new Ui::PaletteEditDialog) {
setWindowIcon(QIcon("qrc:/../../../docsrc/images/logo.png"));
ui->setupUi(this);
// If a valid Palette was passed in, pre-populate fields
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ Program Listing for File preferencesdialog.cpp
#include <QSerialPortInfo>
#include <QSettings>
#include <QTime>
#include "preferencesdialog.h"
#include "ui_preferencesdialog.h"
Expand Down Expand Up @@ -71,6 +72,9 @@ Program Listing for File preferencesdialog.cpp
QString PreferencesDialog::events_trigger_device_updates = QStringLiteral("Interface/EventsTriggerDeviceUpdates");
PreferencesDialog::PreferencesDialog(QWidget *parent) : QDialog(parent), ui(new Ui::PreferencesDialog) {
setWindowIcon(QIcon("qrc:/../../../docsrc/images/logo.png"));
ui->setupUi(this);
// Interface settings
Expand All @@ -79,7 +83,7 @@ Program Listing for File preferencesdialog.cpp
// Maestro settings
ui->numSectionsSpinBox->setValue(settings_.value(num_sections, 1).toInt()); // Default to 1 Section
ui->refreshSpinBox->setValue(settings_.value(refresh_rate, 50).toInt()); // Default to 50 ms
ui->refreshTimeEdit->setTime(QTime::fromMSecsSinceStartOfDay(settings_.value(refresh_rate, 50).toInt())); // Default to 50 ms
ui->pauseOnStartCheckBox->setChecked(settings_.value(pause_on_start, false).toBool()); // Default to run on start
// Show settings
Expand All @@ -89,7 +93,7 @@ Program Listing for File preferencesdialog.cpp
void PreferencesDialog::on_buttonBox_accepted() {
// Save Maestro settings
settings_.setValue(refresh_rate, ui->refreshSpinBox->value());
settings_.setValue(refresh_rate, ui->refreshTimeEdit->time().msecsSinceStartOfDay());
settings_.setValue(num_sections, ui->numSectionsSpinBox->value());
settings_.setValue(pause_on_start, ui->pauseOnStartCheckBox->isChecked());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ Program Listing for File sectionmapdialog.cpp
namespace PixelMaestroStudio {
SectionMapDialog::SectionMapDialog(SerialDeviceController& device, QWidget *parent) : QDialog(parent), ui(new Ui::SectionMapDialog), device_(device) {
setWindowIcon(QIcon("qrc:/../../../docsrc/images/logo.png"));
ui->setupUi(this);
// If the model hasn't been initialized, initialize it
Expand Down
10 changes: 7 additions & 3 deletions docs/_sources/api/program_listing_file_src_main.cpp.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ Program Listing for File main.cpp
PixelMaestroStudio::MainWindow w;
// Set global color palette (https://gist.github.com/QuantumCD/6245215)
qApp->setStyle(QStyleFactory::create("fusion"));
app.setStyle(QStyleFactory::create("Fusion"));
QPalette palette;
palette.setColor(QPalette::Window, QColor(53,53,53));
palette.setColor(QPalette::WindowText, Qt::white);
Expand All @@ -41,7 +42,10 @@ Program Listing for File main.cpp
palette.setColor(QPalette::BrightText, Qt::red);
palette.setColor(QPalette::Highlight, QColor(142,45,197).lighter());
palette.setColor(QPalette::HighlightedText, Qt::black);
qApp->setPalette(palette);
app.setPalette(palette);
// Change color of QToolButtons when checked
//app.setStyleSheet(QString(".QToolButton:checked { background-color: rgb(142, 45, 197); }"));
// Set application font
int id = QFontDatabase::addApplicationFont(":/FiraSans-Regular.ttf");
Expand All @@ -60,7 +64,7 @@ Program Listing for File main.cpp
return app.exec();
}
catch (std::exception& ex) {
QMessageBox::critical(&w, QString("Unhandled Exception"), QString("A critical error has occurred, causing the application to close unexpectedly: ") + QString::fromLatin1(ex.what()));
QMessageBox::critical(&w, QString("Unhandled Exception"), QString("A critical error has occurred. The application will now close. Error: ") + QString::fromLatin1(ex.what()));
return 1;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,15 @@ Program Listing for File cuemodel.cpp
namespace PixelMaestroStudio {
CueModel::CueModel(uint8_t* cue, uint32_t size) : QStandardItemModel() {
QStringList header_labels;
header_labels.append("Text");
header_labels.append("Description");
header_labels.append("Size");
header_labels.append("Code (C++)");
header_labels.append("Code");
setHorizontalHeaderLabels(header_labels);
// Interpret Cue by creating a dummy Maestro to run it, then pass valid Cues to a CueInterpreter.
/*
* Validate Cue by running it through a dummy Maestro.
* If it's valid, run it through a CueInterpreter and add it to the list.
*/
Maestro virtual_maestro = Maestro(nullptr, 0);
CueController& cue_controller = virtual_maestro.set_cue_controller(UINT16_MAX);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ Program Listing for File cueinterpreter.cpp

.. code-block:: cpp
#include <QTime>
#include "cueinterpreter.h"
#include "dialog/preferencesdialog.h"
Expand Down Expand Up @@ -118,11 +119,11 @@ Program Listing for File cueinterpreter.cpp
void CueInterpreter::append_animation_timer(uint16_t interval, uint16_t delay, QString& result) {
append_timer(interval, result);
result.append(delimiter + "Delay: " + QString::number(delay));
result.append(delimiter + "Delay: " + QTime::fromMSecsSinceStartOfDay(delay).toString("mm:ss.zzz"));
}
void CueInterpreter::append_timer(uint16_t interval, QString& result) {
result.append(delimiter + "Interval: " + QString::number(interval));
result.append(delimiter + "Interval: " + QTime::fromMSecsSinceStartOfDay(interval).toString("mm:ss.zzz"));
}
QString CueInterpreter::convert_cue_to_byte_array_string(uint8_t* cue, uint16_t size) {
Expand Down
Loading

0 comments on commit 8fd6202

Please sign in to comment.