git-svn-id: svn://db.shs.com.ru/libs@107 a8b55f48-bf90-11e4-a774-851b48703e85
This commit is contained in:
@@ -129,10 +129,14 @@ void Core::k_parse(PIIODevice * d) {
|
|||||||
void Core::k_update(PIIODevice * d) {
|
void Core::k_update(PIIODevice * d) {
|
||||||
KSection uk = k_;
|
KSection uk = k_;
|
||||||
k_parse(d);
|
k_parse(d);
|
||||||
|
bool kn = false;
|
||||||
if (!uk.isEmpty())
|
if (!uk.isEmpty())
|
||||||
if (!uk.isSameStructure(k_))
|
if (!uk.isSameStructure(k_)) {
|
||||||
piCout << "ask for save names";
|
piCout << "ask for save names";
|
||||||
|
K_KeepNamesRequest(&kn);
|
||||||
|
}
|
||||||
|
uk.update(k_, kn);
|
||||||
|
k_ = uk;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -29,6 +29,7 @@ public:
|
|||||||
|
|
||||||
EVENT(K_Sended)
|
EVENT(K_Sended)
|
||||||
EVENT(K_Received)
|
EVENT(K_Received)
|
||||||
|
EVENT1(K_KeepNamesRequest, bool*, kn)
|
||||||
EVENT_HANDLER(void, K_Send);
|
EVENT_HANDLER(void, K_Send);
|
||||||
EVENT_HANDLER(void, K_Request);
|
EVENT_HANDLER(void, K_Request);
|
||||||
|
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ KInterface::KInterface() {
|
|||||||
k_file_size = 0;
|
k_file_size = 0;
|
||||||
CONNECTU(core, K_Sended, this, sended);
|
CONNECTU(core, K_Sended, this, sended);
|
||||||
CONNECTU(core, K_Received, this, received);
|
CONNECTU(core, K_Received, this, received);
|
||||||
|
CONNECTU(core, K_KeepNamesRequest, this, keepNamesRequest);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -29,6 +29,7 @@ public:
|
|||||||
|
|
||||||
EVENT(sended)
|
EVENT(sended)
|
||||||
EVENT(received)
|
EVENT(received)
|
||||||
|
EVENT1(keepNamesRequest, bool*, kn)
|
||||||
EVENT_HANDLER(void, send);
|
EVENT_HANDLER(void, send);
|
||||||
EVENT_HANDLER(void, request);
|
EVENT_HANDLER(void, request);
|
||||||
bool configure(const PIString & config, const PIString & sect = PIStringAscii("k"));
|
bool configure(const PIString & config, const PIString & sect = PIStringAscii("k"));
|
||||||
|
|||||||
@@ -154,7 +154,7 @@ KSection KParser::parse(PIIODevice * d) {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
parseEnumLine(line, &cev, &type, &comment);
|
parseEnumLine(line, &cev, &type, &comment);
|
||||||
piCout << line << "=" << cev << "//" << type << comment;
|
//piCout << line << "=" << cev << "//" << type << comment;
|
||||||
ck = KType(cev, line, type, "", "", comment);
|
ck = KType(cev, line, type, "", "", comment);
|
||||||
cs[cev] = ck;
|
cs[cev] = ck;
|
||||||
cevalues[line] = cev;
|
cevalues[line] = cev;
|
||||||
|
|||||||
@@ -280,14 +280,14 @@ void CD_Pult::on_buttonHideAll_clicked() {
|
|||||||
|
|
||||||
void CD_Pult::on_buttonRead_clicked() {
|
void CD_Pult::on_buttonRead_clicked() {
|
||||||
K.readFile();
|
K.readFile();
|
||||||
addToList(trUtf8("Readed K file \"%1\": %2 coeffs, %3 bytes").arg(PI2QString(K.file())).arg(K.count()).arg(K.fileSize()), Qt::darkMagenta);
|
addToList(trUtf8("Read K file \"%1\": %2 coeffs, %3 bytes").arg(PI2QString(K.file())).arg(K.count()).arg(K.fileSize()), Qt::darkMagenta);
|
||||||
updateTree();
|
updateTree();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void CD_Pult::on_buttonWrite_clicked() {
|
void CD_Pult::on_buttonWrite_clicked() {
|
||||||
K.writeFile();
|
K.writeFile();
|
||||||
addToList(trUtf8("Written K file \"%1\": %2 coeffs, %3 bytes").arg(PI2QString(K.file())).arg(K.count()).arg(K.fileSize()), Qt::darkMagenta);
|
addToList(trUtf8("Write K file \"%1\": %2 coeffs, %3 bytes").arg(PI2QString(K.file())).arg(K.count()).arg(K.fileSize()), Qt::darkMagenta);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -389,15 +389,9 @@ void CD_Pult::updateDiag() {
|
|||||||
|
|
||||||
|
|
||||||
void CD_Pult::updateKDesc(bool ask_move) {
|
void CD_Pult::updateKDesc(bool ask_move) {
|
||||||
/*int cind = parseHeader(kdesc_file, kdesc);
|
addToList(trUtf8("Update K description file \"%1\"").arg(PI2QString(kdesc_file)), Qt::darkMagenta);
|
||||||
if (K.size_s() < cind) {
|
PIFile f(kdesc_file, PIIODevice::ReadOnly);
|
||||||
ui->spinSize->setValue(cind);
|
K.update(&f);
|
||||||
ui->spinSize->setStyleSheet("background-color: rgb(220, 220, 255);");
|
|
||||||
}
|
|
||||||
bool move = false;
|
|
||||||
if (ask_move)
|
|
||||||
move = (QMessageBox::question(this, "KX Pult", "Save values at associated names?", QMessageBox::Yes | QMessageBox::No, QMessageBox::Yes) == QMessageBox::Yes);
|
|
||||||
*/
|
|
||||||
updateTree(ask_move);
|
updateTree(ask_move);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user