User Tools

Site Tools


struktura:marklar-core:logicmodule

Logic Module

K definovani experimentu samotneho ExperimentInstance nestaci. ExperimentInstance obsahuje jenom zakladni informace, ktere se ukladaji do DB (jmeno, popis, namerena data, vysledky). K experimentu je treba doplnit i grafiku a logiku mernei. To vse zastituje trida ExperimentType.

ExperimentType

ExperimentType obsahuje nekolik abstraktnich metod, vracejicich tridy, ktere musi kazdy projekt odvozeny z markalru implementovat.

public abstract ExperimentInstanceDataService getDataService(ExperimentInstance instance);
public abstract ExperimentLogic getExperimentLogic();
public abstract ExperimentTypeGraphicFactory getGraphicFactory();
public abstract ExpTypeSettingsService getExpDefaultSettingsService();
public abstract ExpInstanceSettingsService getExpInstanceSettignsService(ExperimentInstance expInstance);
public abstract ExperimentExportService getExperimentExportService(List<ExperimentInstance> expInstances);	

ExperimentInstanceDataService bylo definovano jiz v Experiment Instance. ExpTypeSettingsService a ExpInstanceSettingsService jsou definovany v Settings. ExperimentExportService je jednoducha servica, ktera si nezaslouzi velkeho komentare. ExperimentLogic a ExperimentTypeGraphicFactory je venovan zbytek teto sekce.

ExperimentLogic

Trida reprezentujici logiku experimentu. Definuje nasledujici metody

public abstract ChangingStatusReturnCode postAbortedRun();
public abstract ChangingStatusReturnCode postChashed();
public abstract ChangingStatusReturnCode postPause();
public abstract ChangingStatusReturnCode postRun();
public abstract ChangingStatusReturnCode postSuspend();
public abstract ChangingStatusReturnCode prePause();
public abstract ChangingStatusReturnCode preRun();
public abstract ChangingStatusReturnCode preSuspend();
public abstract ChangingStatusReturnCode restore();

LogicModuleManager ridi prepinani mezi ruznymi stavy ExperimentStatus. Pri prepinani se vola nektera z metod uvedenych vyse.

ExperimentLogic obsahuje uzitecne metody pro raisovani eventu

protected void raiseExpInstanceEvent(LogicModuleEvent event);
protected void raiseExpTypeEvent(LogicModuleEvent event);
protected void raiseInstrumentEvent(LogicModuleEvent event);

a jelikoz implementuje interface Runnable, tak nesmi chybet metoda run(), ktera je opet volana LogicModuleManagerem.

ExperimentTypeGraphicFactory

Tato Factory definuje vsechny GraphicControllerDTO (encapsuluje view + controler), ktere musi experiment poskytovat grafice. GenericCell je cell pouzita v ExperimentListView. Detailne je zminena v Generic Cells. ExperimentTypeGraphicFactory definuje tyto metody

// settigns pro expInstance a expType
public GraphicControllerDTO getSettingsGraphic();
 
// pane v prave horni casti slouzici ke zobrazovani aktualnich dat a 
public GraphicControllerDTO getMeasurementControllPanel(ExperimentInstance expInstance);
 
// pane v prave dolni casti - vykresleni grafu, tabulky namerenych dat, informace o mereni, zalozky pro export
public GraphicControllerDTO getExperimentTabs(ExperimentInstance expInstance);
 
// pane s kalibraci
public GraphicControllerDTO getCallibrationGraphic(Instrument instrument);
 
// pane s nastavenim protokolu
public GraphicControllerDTO getProtocolGraphic();
 
// pane s korekcnimi tabulkami
public GraphicControllerDTO getCorrectionersGraphics(Instrument actualInstrument);
 
// pane se specifickymi informacemi o mereni
public GraphicControllerDTO getExperimentInfoTab(ExperimentInstance expInstance);
 
// v zavislosti na ExperimentStatus ExperimentInsance zvoli prislusnou GenericCell
public GenericCell getMainTableCellForInstance(ExperimentInstance expInstance);
 
// GenericCell pro vykresleni souhrneho vysledku nekolika expInstances
public GenericCell getMainResultCellForInstances(List<ExperimentInstance> expInstances);
struktura/marklar-core/logicmodule.txt · Last modified: 2016/07/20 11:43 by jlochman