示例#1
0
void CustomFunctionsPanel::update()
{
  lock = true;
  int num_fsw = model ? firmware->getCapability(CustomFunctions) : firmware->getCapability(GlobalFunctions);
  for (int i=0; i<num_fsw; i++) {
    refreshCustomFunction(i);
  }
  lock = false;
}
示例#2
0
void CustomFunctionsPanel::customFunctionEdited()
{
  if (!lock) {
    lock = true;
    int index = sender()->property("index").toInt();
    refreshCustomFunction(index, true);
    emit modified();
    lock = false;
  }
}
示例#3
0
void CustomFunctionsPanel::fswDelete()
{
  model.funcSw[selectedFunction].clear();
  // TODO update switch and func
  lock = true;
  populateSwitchCB(fswtchSwtch[selectedFunction], model.funcSw[selectedFunction].swtch, generalSettings, CustomFunctionsContext);
  populateFuncCB(fswtchFunc[selectedFunction], model.funcSw[selectedFunction].func);
  refreshCustomFunction(selectedFunction);
  lock = false;
  emit modified();
}
示例#4
0
void CustomFunctionsPanel::functionEdited()
{
  if (!lock) {
    lock = true;
    int index = sender()->property("index").toInt();
    fswtchParamArmT[index]->setCurrentIndex(0);
    refreshCustomFunction(index, true);
    emit modified();
    lock = false;
  }
}
示例#5
0
void CustomFunctionsPanel::functionEdited()
{
  if (!lock) {
    lock = true;
    int index = sender()->property("index").toInt();
    RawSwitch swtch = functions[index].swtch;
    functions[index].clear();
    functions[index].swtch = swtch;
    functions[index].func = (AssignFunc)fswtchFunc[index]->itemData(fswtchFunc[index]->currentIndex()).toInt();
    refreshCustomFunction(index);
    emit modified();
    lock = false;
  }
}
示例#6
0
void CustomFunctionsPanel::update()
{
  lock = true;
  for (int i=0; i<firmware->getCapability(CustomFunctions); i++) {
    if (!initialized) {
      populateSwitchCB(fswtchSwtch[i], model.funcSw[i].swtch, generalSettings, CustomFunctionsContext);
      populateFuncCB(fswtchFunc[i], model.funcSw[i].func);
      populateGVmodeCB(fswtchGVmode[i], model.funcSw[i].adjustMode);
      populateFuncParamCB(fswtchParamT[i], model, model.funcSw[i].func, model.funcSw[i].param, model.funcSw[i].adjustMode);
    }
    refreshCustomFunction(i);
  }
  initialized = true;
  lock = false;
}
示例#7
0
void CustomFunctionsPanel::update()
{
  lock = true;
  int num_fsw = model ? firmware->getCapability(CustomFunctions) : firmware->getCapability(GlobalFunctions);
  for (int i=0; i<num_fsw; i++) {
    if (!initialized) {
      populateSwitchCB(fswtchSwtch[i], functions[i].swtch, generalSettings, model ? SpecialFunctionsContext : GlobalFunctionsContext);
      populateFuncCB(fswtchFunc[i], functions[i].func);
      populateGVmodeCB(fswtchGVmode[i], functions[i].adjustMode);
      populateFuncParamCB(fswtchParamT[i], functions[i].func, functions[i].param, functions[i].adjustMode);
    }
    refreshCustomFunction(i);
  }
  initialized = true;
  lock = false;
}
示例#8
0
void CustomFunctionsPanel::fswPaste()
{
  const QClipboard *clipboard = QApplication::clipboard();
  const QMimeData *mimeData = clipboard->mimeData();
  if (mimeData->hasFormat("application/x-companion-fsw")) {
    QByteArray fswData = mimeData->data("application/x-companion-fsw");
    FuncSwData *fsw = &model.funcSw[selectedFunction];
    memcpy(fsw, fswData.mid(0, sizeof(FuncSwData)).constData(), sizeof(FuncSwData));
    lock = true;
    populateSwitchCB(fswtchSwtch[selectedFunction], model.funcSw[selectedFunction].swtch, generalSettings, CustomFunctionsContext);
    populateFuncCB(fswtchFunc[selectedFunction], model.funcSw[selectedFunction].func);
    populateGVmodeCB(fswtchGVmode[selectedFunction], model.funcSw[selectedFunction].adjustMode);
    populateFuncParamCB(fswtchParamT[selectedFunction], model, model.funcSw[selectedFunction].func, model.funcSw[selectedFunction].param, model.funcSw[selectedFunction].adjustMode);
    refreshCustomFunction(selectedFunction);
    lock = false;
    emit modified();
  }
}