예제 #1
0
int main(int , char * const []) {
#ifndef SK_BUILD_FOR_MAC
    #error "use fonts installed on Mac"
#endif
    FILE* out = font_header();
    generate_fonts(out);
    generate_index(DEFAULT_FONT_NAME, out);
    fclose(out);
    return 0;
}
예제 #2
0
AppDisplay::AppDisplay() : QWidget() {
  this->successful = false;
  this->resize(WIDTH, HEIGHT);
  this->setWindowTitle("Illini Motorsports CAN Translator - 2015-2016");
  this->setLayout(&layout);

  connect(&data, SIGNAL(error(QString)), this, SLOT(handleError(QString)));
  connect(&data, SIGNAL(progress(int)), this, SLOT(updateProgress(int)));
  connect(&config, SIGNAL(error(QString)), this, SLOT(handleError(QString)));

  computeThread.data = &data;
  coalesceComputeThread.data = &data;

  layout.addLayout(&layout_headers);

  QFont font_header("Helvetica", 20, QFont::Bold);
  QFont font_subheader("Helvetica", 15);
  QFont font_message("Helvetica", 15, QFont::Black);
  QFont font_signal("Helvetica", 9);

  lbl_header.setText("Illini Motorsports CAN Translator - 2015-2016");
  lbl_header.setFont(font_header);
  lbl_header.setStyleSheet("QLabel { color: black; }");
  lbl_header.setAlignment(Qt::AlignCenter);
  layout_headers.addWidget(&lbl_header, 1);

  lbl_subheader.setText("Created By: Andrew Mass");
  lbl_subheader.setFont(font_subheader);
  lbl_subheader.setAlignment(Qt::AlignCenter);
  layout_headers.addWidget(&lbl_subheader, 1);

  lbl_keymaps.setText("[c] Convert Custom File     [v] Convert Vector File     [s] Coalesce Converted Logfiles     [q] Quit");
  lbl_keymaps.setFont(font_subheader);
  lbl_keymaps.setAlignment(Qt::AlignCenter);
  layout_headers.addWidget(&lbl_keymaps, 1);

  btn_read_custom.setText("Select Custom File to Convert");
  layout_reads.addWidget(&btn_read_custom, 1);

  btn_read_vector.setText("Select Vector File to Convert");
  layout_reads.addWidget(&btn_read_vector, 1);

  btn_coalesce.setText("Coalesce Converted Logfiles");
  layout_reads.addWidget(&btn_coalesce, 1);

  layout.addLayout(&layout_reads);

  // Configure config area (left side)
  area_config_helper.setLayout(&layout_config);
  area_config.setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOn);
  area_config.setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
  area_config.setWidgetResizable(true);
  area_config.setWidget(&area_config_helper);

  // Configure progress area (right side)
  layout_progress.addWidget(&bar_convert, 1);

  // Add config and progress areas to main layout
  layout_main.addWidget(&area_config);
  layout_main.addLayout(&layout_progress);
  layout.addLayout(&layout_main);

  // Parse CAN spec from config file
  map<uint16_t, Message> messages = config.getMessages();
  if (messages.size() > 0) {
    this->successful = true;
  }

  // Add message defintions to config area
  typedef map<uint16_t, Message>::iterator it_msg;
  for(it_msg msgIt = messages.begin(); msgIt != messages.end(); msgIt++) {
    Message msg = msgIt->second;

    QGroupBox* messageGroup = new QGroupBox(msg.toString());
    QVBoxLayout* signalsLayout = new QVBoxLayout();
    messageGroup->setLayout(signalsLayout);

    for (Signal sig: msg.sigs) {
      signalsLayout->addWidget(new QLabel(sig.toString()));
    }

    layout_config.addWidget(messageGroup);
  }

  connect(&computeThread, SIGNAL(finish(bool)), this, SLOT(convertFinish(bool)));
  connect(&computeThread, SIGNAL(addFileProgress(QString)), this, SLOT(addFileProgress(QString)));
  connect(&coalesceComputeThread, SIGNAL(finish(bool)), this, SLOT(coalesceFinish(bool)));

  connect(&btn_read_custom, SIGNAL(clicked()), this, SLOT(readDataCustom()));
  connect(&btn_read_vector, SIGNAL(clicked()), this, SLOT(readDataVector()));
  connect(&btn_coalesce, SIGNAL(clicked()), this, SLOT(coalesceLogfiles()));
}