package _VisualDVM.TestingSystem.DVM.DVMConfiguration;
import Common.Database.Objects.DBObject;
import _VisualDVM.TestingSystem.Common.Configuration.Configuration;
import _VisualDVM.TestingSystem.Common.Group.Group;
import _VisualDVM.TestingSystem.Common.Settings.Settings;
import _VisualDVM.TestingSystem.Common.Test.Test;
import _VisualDVM.TestingSystem.DVM.DVMConfigurationGroup.DVMConfigurationGroup;
import _VisualDVM.TestingSystem.DVM.DVMConfigurationSettings.DVMConfigurationSettings;
import _VisualDVM.TestingSystem.DVM.DVMConfigurationTest.DVMConfigurationTest;
import _VisualDVM.TestingSystem.DVM.DVMSettings.DVMSettings;
import com.sun.org.glassfish.gmbal.Description;

import java.util.Vector;
//конфгурация тестирования ДВМ
public class DVMConfiguration extends Configuration {
    public int c_maxtime = 40;
    //--
    @Description("IGNORE")
    public Vector<DVMConfigurationGroup> groups = null;
    @Description("IGNORE")
    public Vector<DVMConfigurationTest> tests = null;
    @Description("IGNORE")
    public Vector<DVMConfigurationSettings> settings = null;
    public DVMConfiguration(DVMConfiguration src) {
        this.SynchronizeFields(src);
    }
    public DVMConfiguration() {
    }
    //--
    @Override
    public void SynchronizeFields(DBObject src) {
        super.SynchronizeFields(src);
        DVMConfiguration c = (DVMConfiguration) src;
        c_maxtime = c.c_maxtime;
    }
    @Override
    public void saveGroups(Vector<Group> groups_in) {
        groups = new Vector<>();
        for (Group group : groups_in)
            groups.add(new DVMConfigurationGroup(this, group));
    }
    @Override
    public void saveTests(Vector<Test> tests_in) {
        tests = new Vector<>();
        for (Test test : tests_in)
            tests.add(new DVMConfigurationTest(this, test));
    }
    @Override
    public void saveSettings(Vector<Settings> settings_in) {
        settings = new Vector<>();
        for (Settings dvmSettings : settings_in)
            settings.add(new DVMConfigurationSettings(this, (DVMSettings) dvmSettings));
    }
}
