Skip to content
Snippets Groups Projects
Commit f0951be2 authored by Matthias Puchner's avatar Matthias Puchner
Browse files

serialization

parent 162f52ee
No related branches found
No related tags found
1 merge request!624Remove SessionItem from Instrument items
...@@ -177,6 +177,10 @@ void InstrumentItem::serialize(Serializer& s) ...@@ -177,6 +177,10 @@ void InstrumentItem::serialize(Serializer& s)
s.rw("name", m_name); s.rw("name", m_name);
s.rw("description", m_description); s.rw("description", m_description);
s.rw("pa", m_withPolarizerAnalyzer); s.rw("pa", m_withPolarizerAnalyzer);
s.rw(m_polarization);
s.rw(m_analyzerDirection);
s.rw(m_analyzerEfficiency);
s.rw(m_analyzerTotalTransmission);
s.rw<BackgroundItemCatalog>(m_background); s.rw<BackgroundItemCatalog>(m_background);
s.rw("beam", *m_beam); s.rw("beam", *m_beam);
} }
......
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
#include "GUI/Model/State/InstrumentLibrary.h" #include "GUI/Model/State/InstrumentLibrary.h"
#include "GUI/Model/Item/InstrumentItems.h" #include "GUI/Model/Item/InstrumentItems.h"
#include "GUI/Model/XML/Serializer.h" #include "GUI/Model/XML/Serializer.h"
#include "GUI/Util/DeserializationException.h"
#include "GUI/Util/Path.h" #include "GUI/Util/Path.h"
#include <QFile> #include <QFile>
#include <QXmlStreamWriter> #include <QXmlStreamWriter>
...@@ -125,6 +126,9 @@ bool InstrumentLibrary::load() ...@@ -125,6 +126,9 @@ bool InstrumentLibrary::load()
} catch (const std::exception&) { } catch (const std::exception&) {
m_model.clear(); m_model.clear();
return false; return false;
} catch (const DeserializationException&) {
m_model.clear();
return false;
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment