MCPcopy Create free account
hub / github.com/Atarity/Lightpack / validatePage

Method validatePage

Software/src/wizard/ConfigureDevicePage.cpp:67–84  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

65}
66
67bool ConfigureDevicePage::validatePage()
68{
69 QString portName = field("serialPort").toString();
70 int baudRate = field("baudRate").toInt();
71 if (field("isAdalight").toBool()) {
72 _transSettings->ledDevice.reset(new LedDeviceAdalight(portName, baudRate));
73 } else if (field("isArdulight").toBool()){
74 _transSettings->ledDevice.reset(new LedDeviceArdulight(portName, baudRate));
75 } else {
76 QMessageBox::information(NULL, "Wrong device", "Try to restart the wizard");
77 qCritical() << "couldn't create LedDevice, unexpected state, device is not selected or device is not configurable";
78 return false;
79 }
80 _transSettings->ledDevice->setColorSequence(field("colorFormat").toString());
81 _transSettings->ledDevice->open();
82
83 return true;
84}
85
86int ConfigureDevicePage::nextId() {
87 if (QApplication::desktop()->screenCount() == 1) {

Callers

nothing calls this directly

Calls 3

resetMethod · 0.45
setColorSequenceMethod · 0.45
openMethod · 0.45

Tested by

no test coverage detected