User Tools

Site Tools


zalozeni:logika:terminate

terminate()

Metoda init() byla volana pri vstupu ExperimentStatus do RUNNING. Jak uz nazev metody terminate() napovida, je volana pri opousteni ExperimentStatus ze stavu RUNNING. To nastava v ExperimentLogic celkem na 3 mistech: postAbortedRun(), postRun() a prePause().

Narozdil od init(), ktera inicializovala haldu promennych, terminate() musi pouze spravne zakoncit mereni, tj. napriklad vypnout teplotni rampu a zapsat startovaci teplotu, aby nove mereni mohlo zacit (promenne a servicy jsou jiz inicializovany, nebot logika zarucuje, ze nenastastane situace, ze by se po otevreni markalru nacetlo mereni, ktere by bylo ve stavu RUNNING. Mame jistotu, ze init() byla volana).

	private ChangingStatusReturnCode terminate() {
		try {
			instrument.setSetPoint(0);
		} catch (IOException e) {
			LogService.getInstance().error("IOException while writing setPoint");
			e.printStackTrace();
			return ChangingStatusReturnCode.ERROR;
		} catch (SetValueException e) {
			LogService.getInstance().error("SetValueException while writing setPoint");
			e.printStackTrace();
			return ChangingStatusReturnCode.ERROR;
		} catch (Exception e) {
			LogService.getInstance().error("Unkown Exception while writing setPoint");
			e.printStackTrace();
			return ChangingStatusReturnCode.ERROR;
		}
		return ChangingStatusReturnCode.OK;
	}
zalozeni/logika/terminate.txt · Last modified: 2016/07/29 15:19 by jlochman