git-svn-id: svn://db.shs.com.ru/libs@107 a8b55f48-bf90-11e4-a774-851b48703e85

This commit is contained in:
2016-07-24 20:23:14 +00:00
parent 46664fd4b8
commit 9e70ad30d9
6 changed files with 15 additions and 14 deletions

View File

@@ -129,10 +129,14 @@ void Core::k_parse(PIIODevice * d) {
void Core::k_update(PIIODevice * d) {
KSection uk = k_;
k_parse(d);
bool kn = false;
if (!uk.isEmpty())
if (!uk.isSameStructure(k_))
if (!uk.isSameStructure(k_)) {
piCout << "ask for save names";
K_KeepNamesRequest(&kn);
}
uk.update(k_, kn);
k_ = uk;
}

View File

@@ -29,6 +29,7 @@ public:
EVENT(K_Sended)
EVENT(K_Received)
EVENT1(K_KeepNamesRequest, bool*, kn)
EVENT_HANDLER(void, K_Send);
EVENT_HANDLER(void, K_Request);

View File

@@ -12,6 +12,7 @@ KInterface::KInterface() {
k_file_size = 0;
CONNECTU(core, K_Sended, this, sended);
CONNECTU(core, K_Received, this, received);
CONNECTU(core, K_KeepNamesRequest, this, keepNamesRequest);
}

View File

@@ -29,6 +29,7 @@ public:
EVENT(sended)
EVENT(received)
EVENT1(keepNamesRequest, bool*, kn)
EVENT_HANDLER(void, send);
EVENT_HANDLER(void, request);
bool configure(const PIString & config, const PIString & sect = PIStringAscii("k"));

View File

@@ -154,7 +154,7 @@ KSection KParser::parse(PIIODevice * d) {
}
} else {
parseEnumLine(line, &cev, &type, &comment);
piCout << line << "=" << cev << "//" << type << comment;
//piCout << line << "=" << cev << "//" << type << comment;
ck = KType(cev, line, type, "", "", comment);
cs[cev] = ck;
cevalues[line] = cev;

View File

@@ -280,14 +280,14 @@ void CD_Pult::on_buttonHideAll_clicked() {
void CD_Pult::on_buttonRead_clicked() {
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();
}
void CD_Pult::on_buttonWrite_clicked() {
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) {
/*int cind = parseHeader(kdesc_file, kdesc);
if (K.size_s() < cind) {
ui->spinSize->setValue(cind);
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);
*/
addToList(trUtf8("Update K description file \"%1\"").arg(PI2QString(kdesc_file)), Qt::darkMagenta);
PIFile f(kdesc_file, PIIODevice::ReadOnly);
K.update(&f);
updateTree(ask_move);
}