|
|
|
|
@ -17,6 +17,9 @@ library::library(QWidget *parent) :
|
|
|
|
|
unsaved=false;
|
|
|
|
|
speakerUnsaved=false;
|
|
|
|
|
dacUnsaved=false;
|
|
|
|
|
initAmps=false;
|
|
|
|
|
initDacs=false;
|
|
|
|
|
initSpeaker=false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
library::~library()
|
|
|
|
|
@ -73,8 +76,6 @@ cdac *library::getDacs()
|
|
|
|
|
|
|
|
|
|
void library::open()
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
ui->listWidget_ampView->setCurrentRow(0);
|
|
|
|
|
QSettings settings("DKM-Tech","Pa-Calculator");
|
|
|
|
|
if (settings.value("library/path","")==""){
|
|
|
|
|
settings.setValue("library/path",QFileDialog::getSaveFileName(this,"Select Library Storage File","","Pa Calculator Library File (*.palib)"));
|
|
|
|
|
@ -131,10 +132,6 @@ void library::refreshModeOverview()
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
//std::cerr<<"refreshModeOverview started"<<std::endl;
|
|
|
|
|
//printAllAmps();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void library::refreshSpeakerView()
|
|
|
|
|
@ -175,7 +172,7 @@ int library::getCurrentDacIndex()
|
|
|
|
|
|
|
|
|
|
void library::ampEdited()
|
|
|
|
|
{
|
|
|
|
|
if(unsaved==false){
|
|
|
|
|
if(ui->lineEdit_ampName->text()!=QString::fromStdString(m_pCamp[getCurrentAmpIndex()].getName()) && unsaved==false){
|
|
|
|
|
ui->listWidget_ampView->currentItem()->setText(ui->listWidget_ampView->currentItem()->text()+QString::fromStdString("*"));
|
|
|
|
|
unsaved =true;
|
|
|
|
|
}
|
|
|
|
|
@ -183,7 +180,7 @@ void library::ampEdited()
|
|
|
|
|
|
|
|
|
|
void library::speakerEdited()
|
|
|
|
|
{
|
|
|
|
|
if (speakerUnsaved==false){
|
|
|
|
|
if (ui->lineEdit_speakerName->text() != QString::fromStdString(m_pSpeaker[getCurrentSpeakerIndex()].getName()) && speakerUnsaved==false){
|
|
|
|
|
ui->listWidget_speakerView->currentItem()->setText(ui->listWidget_speakerView->currentItem()->text()+QString::fromStdString("*"));
|
|
|
|
|
speakerUnsaved =true;
|
|
|
|
|
}
|
|
|
|
|
@ -191,7 +188,7 @@ void library::speakerEdited()
|
|
|
|
|
|
|
|
|
|
void library::dacEdited()
|
|
|
|
|
{
|
|
|
|
|
if (dacUnsaved==false){
|
|
|
|
|
if (ui->lineEdit_dacName->text()!= QString::fromStdString(m_pDac[getCurrentDacIndex()].name()) && dacUnsaved==false){
|
|
|
|
|
ui->listWidget_dacView->currentItem()->setText(ui->listWidget_dacView->currentItem()->text()+QString::fromStdString("*"));
|
|
|
|
|
dacUnsaved =true;
|
|
|
|
|
}
|
|
|
|
|
@ -257,6 +254,7 @@ void library::printAllAmps()
|
|
|
|
|
|
|
|
|
|
void library::on_listWidget_ampView_currentRowChanged(int currentRow)
|
|
|
|
|
{
|
|
|
|
|
if (initAmps){
|
|
|
|
|
if (currentRow>=0){
|
|
|
|
|
ui->lineEdit_ampName->setText(QString::fromStdString(m_pCamp[currentRow].getName()));
|
|
|
|
|
ui->comboBox_sensUnit->setCurrentIndex(m_pCamp[currentRow].getSensivityUnit());
|
|
|
|
|
@ -265,11 +263,21 @@ void library::on_listWidget_ampView_currentRowChanged(int currentRow)
|
|
|
|
|
ui->listWidget_modeSelector->setCurrentRow(0);
|
|
|
|
|
ui->lineEdit_ampName->setEnabled(true);
|
|
|
|
|
ui->doubleSpinBox_inputSensitivity->setEnabled(true);
|
|
|
|
|
ui->comboBox_sensUnit->setEnabled(true);
|
|
|
|
|
ui->lineEdit_modeName->setEnabled(true);
|
|
|
|
|
ui->listWidget_modeSelector->setEnabled(true);
|
|
|
|
|
ui->spinBox_ratedImp->setEnabled(true);
|
|
|
|
|
ui->spinBox_ratedPower->setEnabled(true);
|
|
|
|
|
|
|
|
|
|
}else
|
|
|
|
|
{
|
|
|
|
|
ui->lineEdit_ampName->setEnabled(false);
|
|
|
|
|
ui->doubleSpinBox_inputSensitivity->setEnabled(false);
|
|
|
|
|
}
|
|
|
|
|
}else {
|
|
|
|
|
initAmps =true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -428,6 +436,7 @@ void library::on_pushButton_addSpeaker_clicked()
|
|
|
|
|
|
|
|
|
|
void library::on_listWidget_speakerView_currentRowChanged(int currentRow)
|
|
|
|
|
{
|
|
|
|
|
if (initSpeaker){
|
|
|
|
|
if (currentRow>=0){
|
|
|
|
|
ui->lineEdit_speakerName->setText(QString::fromStdString(m_pSpeaker[currentRow].getName()));
|
|
|
|
|
ui->spinBox_speakerImp->setValue(m_pSpeaker[currentRow].getImpedance());
|
|
|
|
|
@ -436,10 +445,10 @@ void library::on_listWidget_speakerView_currentRowChanged(int currentRow)
|
|
|
|
|
ui->spinBox_speakerHPF->setValue(m_pSpeaker[currentRow].getHPF());
|
|
|
|
|
|
|
|
|
|
ui->lineEdit_speakerName->setEnabled(true);
|
|
|
|
|
//ui->spinBox_speakerImp->setEnabled(true);
|
|
|
|
|
//ui->spinBox_speakerRMSPower->setEnabled(true);
|
|
|
|
|
//ui->spinBox_speakerPeakPower->setEnabled(true);
|
|
|
|
|
//ui->spinBox_speakerHPF->setEnabled(true);
|
|
|
|
|
ui->spinBox_speakerImp->setEnabled(true);
|
|
|
|
|
ui->spinBox_speakerRMSPower->setEnabled(true);
|
|
|
|
|
ui->spinBox_speakerPeakPower->setEnabled(true);
|
|
|
|
|
ui->spinBox_speakerHPF->setEnabled(true);
|
|
|
|
|
|
|
|
|
|
}else {
|
|
|
|
|
ui->lineEdit_speakerName->setEnabled(false);
|
|
|
|
|
@ -448,6 +457,9 @@ void library::on_listWidget_speakerView_currentRowChanged(int currentRow)
|
|
|
|
|
//ui->spinBox_speakerPeakPower->setEnabled(false);
|
|
|
|
|
//ui->spinBox_speakerHPF->setEnabled(false);
|
|
|
|
|
}
|
|
|
|
|
}else{
|
|
|
|
|
initSpeaker=true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -567,13 +579,19 @@ void library::on_pushButton_Apply_clicked()
|
|
|
|
|
|
|
|
|
|
void library::on_listWidget_dacView_currentRowChanged(int currentRow)
|
|
|
|
|
{
|
|
|
|
|
if (initDacs){
|
|
|
|
|
if (currentRow>=0){
|
|
|
|
|
ui->lineEdit_dacName->setText(QString::fromStdString(m_pDac[currentRow].name()));
|
|
|
|
|
ui->spinBox_dacOutputLevel->setValue(m_pDac[currentRow].outputLevel());
|
|
|
|
|
ui->lineEdit_dacName->setEnabled(true);
|
|
|
|
|
ui->spinBox_dacOutputLevel->setEnabled(true);
|
|
|
|
|
}else{
|
|
|
|
|
ui->lineEdit_dacName->setEnabled(false);
|
|
|
|
|
}
|
|
|
|
|
}else{
|
|
|
|
|
initDacs=true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|