Commit 4d83ca8c authored by peastman's avatar peastman
Browse files

Merge pull request #1122 from peastman/xmlversion

Added openmmVersion attribute to serialized XML files
parents a440d0cf 19991c7e
......@@ -6,7 +6,7 @@
* Biological Structures at Stanford, funded under the NIH Roadmap for *
* Medical Research, grant U54 GM072970. See https://simtk.org. *
* *
* Portions copyright (c) 2010 Stanford University and the Authors. *
* Portions copyright (c) 2010-2015 Stanford University and the Authors. *
* Authors: Peter Eastman *
* Contributors: *
* *
......@@ -30,7 +30,9 @@
* -------------------------------------------------------------------------- */
#include "openmm/serialization/StateProxy.h"
#include <OpenMM.h>
#include "openmm/Platform.h"
#include "openmm/State.h"
#include "openmm/Vec3.h"
#include <map>
using namespace std;
......@@ -42,6 +44,7 @@ StateProxy::StateProxy() : SerializationProxy("State") {
void StateProxy::serialize(const void* object, SerializationNode& node) const {
node.setIntProperty("version", 1);
node.setStringProperty("openmmVersion", Platform::getOpenMMVersion());
const State& s = *reinterpret_cast<const State*>(object);
node.setDoubleProperty("time", s.getTime());
Vec3 a,b,c;
......
......@@ -6,7 +6,7 @@
* Biological Structures at Stanford, funded under the NIH Roadmap for *
* Medical Research, grant U54 GM072970. See https://simtk.org. *
* *
* Portions copyright (c) 2010 Stanford University and the Authors. *
* Portions copyright (c) 2010-2015 Stanford University and the Authors. *
* Authors: Peter Eastman *
* Contributors: *
* *
......@@ -32,6 +32,7 @@
#include "openmm/serialization/SystemProxy.h"
#include "openmm/serialization/SerializationNode.h"
#include "openmm/Force.h"
#include "openmm/Platform.h"
#include "openmm/System.h"
#include "openmm/VirtualSite.h"
#include <sstream>
......@@ -44,6 +45,7 @@ SystemProxy::SystemProxy() : SerializationProxy("System") {
void SystemProxy::serialize(const void* object, SerializationNode& node) const {
node.setIntProperty("version", 1);
node.setStringProperty("openmmVersion", Platform::getOpenMMVersion());
const System& system = *reinterpret_cast<const System*>(object);
Vec3 a, b, c;
system.getDefaultPeriodicBoxVectors(a, b, c);
......
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