2017-05-18 Fred Gleason <fredg@paravelsystems.com>

* Added pseudo-schema change 263 to restore missing LOG_MODES table
	records [GitHub issue #000175].
	* Added code to create and remove LOG_MODES table records when
	adding and removing Host definitions.
	* Incremented the database version to 263.
This commit is contained in:
Fred Gleason 2017-05-18 15:26:49 -04:00
parent 0134e46052
commit 1a94f58fff
8 changed files with 79 additions and 7 deletions

View File

@ -15785,3 +15785,9 @@
dependency when generating RPMs for RHEL6. dependency when generating RPMs for RHEL6.
2017-05-18 Fred Gleason <fredg@paravelsystems.com> 2017-05-18 Fred Gleason <fredg@paravelsystems.com>
* Incremented the package version to 2.15.3int06. * Incremented the package version to 2.15.3int06.
2017-05-18 Fred Gleason <fredg@paravelsystems.com>
* Added pseudo-schema change 263 to restore missing LOG_MODES table
records [GitHub issue #000175].
* Added code to create and remove LOG_MODES table records when
adding and removing Host definitions.
* Incremented the database version to 263.

View File

@ -24,7 +24,7 @@
/* /*
* Current Database Version * Current Database Version
*/ */
#define RD_VERSION_DATABASE 262 #define RD_VERSION_DATABASE 263
#endif // DBVERSION_H #endif // DBVERSION_H

View File

@ -207,6 +207,17 @@ void AddStation::okData()
delete q; delete q;
} }
} }
//
// RDAirPlay Log Modes
//
for(int i=0;i<RDAIRPLAY_LOG_QUANTITY;i++) {
sql=QString().sprintf("insert into LOG_MODES set ")+
"STATION_NAME=\""+RDEscapeString(add_name_edit->text())+"\","+
QString().sprintf("MACHINE=%d",i);
q=new RDSqlQuery(sql);
delete q;
}
} }
else { // Use Specified Config else { // Use Specified Config
@ -537,6 +548,26 @@ void AddStation::okData()
} }
delete q; delete q;
//
// RDAirPlay Log Modes
//
sql=QString("select ")+
"MACHINE,"+
"START_MODE,"+
"OP_MODE from LOG_MODES where "+
"STATION_NAME=\""+RDEscapeString(add_exemplar_box->currentText())+"\"";
q=new RDSqlQuery(sql);
while(q->next()) {
sql=QString().sprintf("insert into LOG_MODES set ")+
"STATION_NAME=\""+RDEscapeString(add_name_edit->text())+"\","+
QString().sprintf("MACHINE=%d,",q->value(0).toInt())+
QString().sprintf("START_MODE=%d,",q->value(1).toInt())+
QString().sprintf("OP_MODE=%d",q->value(2).toInt());
q1=new RDSqlQuery(sql);
delete q1;
}
delete q;
// //
// Clone RDPanel Config // Clone RDPanel Config
// //

View File

@ -8382,6 +8382,28 @@ int UpdateDb(int ver)
} }
} }
if(ver<263) { // Add missing LOG_MODES records
sql=QString("select NAME from STATIONS");
q=new QSqlQuery(sql);
while(q->next()) {
for(int i=0;i<3;i++) {
sql=QString("select ID from LOG_MODES where ")+
"(STATION_NAME=\""+RDEscapeString(q->value(0).toString())+"\")&&"+
QString().sprintf("(MACHINE=%d)",i);
q1=new QSqlQuery(sql);
if(!q1->first()) {
sql=QString("insert into LOG_MODES set ")+
"STATION_NAME=\""+RDEscapeString(q->value(0).toString())+"\","+
QString().sprintf("MACHINE=%d",i);
q2=new QSqlQuery(sql);
delete q2;
}
delete q1;
}
}
delete q;
}
// //
// Update Version Field // Update Version Field

View File

@ -216,11 +216,6 @@ EditRDAirPlay::EditRDAirPlay(RDStation *station,RDStation *cae_station,
// //
// Audition/Cue Output // Audition/Cue Output
// //
/*
label=new QLabel(tr("Audition/Cue Output"),this);
label->setFont(small_font);
label->setGeometry(25,304,200,16);
*/
air_card_sel[3]=new RDCardSelector(this); air_card_sel[3]=new RDCardSelector(this);
air_card_sel[3]->setId(3); air_card_sel[3]->setId(3);
air_card_sel[3]->setGeometry(20,322,120,117); air_card_sel[3]->setGeometry(20,322,120,117);

View File

@ -328,5 +328,10 @@ void ListStations::DeleteStation(QString name)
(const char *)RDEscapeString(name)); (const char *)RDEscapeString(name));
q=new RDSqlQuery(sql); q=new RDSqlQuery(sql);
delete q; delete q;
sql=QString("delete from LOG_MODES where ")+
"STATION_NAME=\""+RDEscapeString(name)+"\"";
q=new RDSqlQuery(sql);
delete q;
} }

View File

@ -206,6 +206,10 @@ void MainObject::Revert(int schema) const
case 262: case 262:
Revert262(); Revert262();
break; break;
case 263:
Revert263();
break;
} }
} }
@ -592,6 +596,14 @@ void MainObject::Revert262() const
} }
void MainObject::Revert263() const
{
// Nothing to do here as this is a pseudo-schema change.
SetVersion(262);
}
int MainObject::GetVersion() const int MainObject::GetVersion() const
{ {
QString sql; QString sql;
@ -634,7 +646,7 @@ int MainObject::MapSchema(const QString &ver)
version_map["2.13"]=255; version_map["2.13"]=255;
version_map["2.14"]=258; version_map["2.14"]=258;
version_map["2.15"]=259; version_map["2.15"]=259;
version_map["2.16"]=262; version_map["2.16"]=263;
// //
// Normalize String // Normalize String

View File

@ -58,6 +58,7 @@ class MainObject : public QObject
void Revert260() const; void Revert260() const;
void Revert261() const; void Revert261() const;
void Revert262() const; void Revert262() const;
void Revert263() const;
int GetVersion() const; int GetVersion() const;
void SetVersion(int schema) const; void SetVersion(int schema) const;
int MapSchema(const QString &ver); int MapSchema(const QString &ver);