package _VisualDVM.TestingSystem.SAPFOR.ServerSapfor;
import Common.Database.Objects.DBObject;
import Common.Database.Objects.riDBObject;
import Common.Utils.Utils_;
import _VisualDVM.ProjectData.LanguageName;
import com.sun.org.glassfish.gmbal.Description;

import java.util.Date;
public class ServerSapfor extends riDBObject {
    //--------------------------------------------------------------------->>>
    @Description("IGNORE")
    public static String version_command = "-ver";//команда запроса версии компилятора.
    @Description("IGNORE")
    public static String help_command = "-help";// команда запроса help
    //--------------------------------------------------------------------->>>
    public LanguageName languageName = LanguageName.fortran;
    public String home_path = ""; //домашняя папка.
    public String call_command = ""; //полная команда вызова.
    public String version = "?";
    public long buildDate = 0;
    @Description("DEFAULT 'Done'")
    public ServerSapforState state = ServerSapforState.Done;
    //--
    public ServerSapfor() {
    }
    public ServerSapfor(ServerSapfor s) {
        SynchronizeFields(s);
    }
    public Date getBuildDate() {
        return new Date(buildDate);
    }
    @Override
    public void SynchronizeFields(DBObject src) {
        super.SynchronizeFields(src);
        ServerSapfor s = (ServerSapfor) src;
        languageName = s.languageName;
        home_path = s.home_path;
        call_command = s.call_command;
        version = s.version;
        buildDate = s.buildDate;
        state = s.state;
    }
    @Override
    public String toString() {
        return call_command;
    }
    public String getVersionCommand() {
        return Utils_.DQuotes(call_command) + " " + version_command;
    }
}
