Commit 720a2f2a authored by AbhijithTam's avatar AbhijithTam

Save File Done ~ All todos accomplished besides the error due to changing the...

Save File Done ~ All todos accomplished besides the error due to changing the value for power of active heating and cooling.
parent fac99b5e
......@@ -101,6 +101,7 @@ public:
bool CoolingFracLast = false;
bool HeatingFracLast = false;
bool AppliedFracLast = false;
bool applied = false;
};
QEnviornmentWidget::QEnviornmentWidget(QPulse& qp, QWidget *parent, Qt::WindowFlags flags) : QDockWidget(parent,flags)
......@@ -262,7 +263,6 @@ QEnviornmentWidget::QEnviornmentWidget(QPulse& qp, QWidget *parent, Qt::WindowFl
m_Controls->ThermalApplication->GetActiveCooling().GetPower().SetValue(0, PowerUnit::J_Per_s);
m_Controls->ThermalApplication->GetActiveHeating().GetPower().SetValue(0, PowerUnit::J_Per_s);
m_Controls->ThermalApplication->GetAppliedTemperature().SetState(eSwitch::Off);
m_Controls->EnvironmentalConditions = new SEChangeEnvironmentConditions(qp.GetEngine().GetSubstanceManager());
connect(m_Controls->ApplyAll, SIGNAL(clicked()), this, SLOT(ControlsToEnvironment()));
......@@ -331,19 +331,8 @@ void QEnviornmentWidget::SelectEnvironmentFile()
void QEnviornmentWidget::SaveEnviornmentFile() {
QString filename = QFileDialog::getSaveFileName(this, "Save Enviornment", "./environments", "Environment Files (*.json)");
if (filename.isEmpty()) {
return;
}
else {
QFile file(filename);
if (!file.open(QIODevice::WriteOnly)) {
QMessageBox::information(this, "Unable to open file", file.errorString());
return;
}
QDataStream out(&file);
out.setVersion(QDataStream::Qt_5_12);
out << QString::fromUtf8(m_Controls->EnvironmentalConditions->GetConditionsFile().c_str());
}
ControlsToEnvironment();
m_Controls->EnvironmentalConditions->GetConditions().SerializeToFile(filename.toStdString(), SerializationFormat::JSON);
}
void QEnviornmentWidget::ControlsToEnvironment()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment