File tree Expand file tree Collapse file tree 2 files changed +28
-0
lines changed
vcell-api/src/main/java/org/vcell/rest/health
vcell-core/src/main/java/cbit/vcell/biomodel Expand file tree Collapse file tree 2 files changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -239,6 +239,7 @@ private void runsimLoop() {
239239
240240 BioModel templateBioModel = XmlHelper .XMLToBioModel (new XMLSource (vcmlString ));
241241 templateBioModel .clearVersion ();
242+ templateBioModel .visitChildVersionables (new BioModel .ClearVersion ());
242243 String newBiomodelName = "test_" +System .currentTimeMillis ();
243244 templateBioModel .setName (newBiomodelName );
244245 // remove all existing simulations from stored template model, and add new one
Original file line number Diff line number Diff line change 1515import java .beans .VetoableChangeListener ;
1616import java .beans .VetoableChangeSupport ;
1717import java .util .*;
18+ import java .util .function .Consumer ;
1819import java .util .stream .Collectors ;
1920
2021import cbit .image .VCImage ;
@@ -186,6 +187,32 @@ public List<VersionableInfo> gatherChildVersionableInfos() {
186187 return new ArrayList <>(versionSet );
187188 }
188189
190+ public final static class ClearVersion implements Consumer <Versionable > {
191+ @ Override
192+ public void accept (Versionable versionable ) {
193+ versionable .clearVersion ();
194+ }
195+ }
196+
197+ public void visitChildVersionables (Consumer <Versionable > operation ) {
198+ operation .accept (getModel ());
199+ for (SimulationContext sc : getSimulationContexts ()){
200+ operation .accept (sc );
201+ if (sc .getGeometry ()!=null ){
202+ operation .accept (sc .getGeometry ());
203+ if (sc .getGeometry ().getGeometrySpec ().getImage ()!=null ){
204+ operation .accept (sc .getGeometry ().getGeometrySpec ().getImage ());
205+ }
206+ }
207+ if (sc .getMathDescription () != null ){
208+ operation .accept (sc .getMathDescription ());
209+ }
210+ }
211+ for (Simulation sim : getSimulations ()){
212+ operation .accept (sim );
213+ }
214+ }
215+
189216/**
190217 * The addPropertyChangeListener method was generated to support the propertyChange field.
191218 */
You can’t perform that action at this time.
0 commit comments