Skip to content

Commit

Permalink
removing unnecessary operations
Browse files Browse the repository at this point in the history
  • Loading branch information
stebjan committed Jan 26, 2016
1 parent 2d5998c commit 88c7546
Showing 1 changed file with 1 addition and 38 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
******************************************************************************/
package cz.zcu.kiv.eegdatabase.wui.ui.experiments;

import cz.zcu.kiv.eegdatabase.data.dao.GenericDao;
import cz.zcu.kiv.eegdatabase.data.pojo.*;
import cz.zcu.kiv.eegdatabase.wui.app.EEGDataBaseApplication;
import cz.zcu.kiv.eegdatabase.wui.app.session.EEGDataBaseSession;
Expand All @@ -32,9 +31,6 @@
import cz.zcu.kiv.eegdatabase.wui.components.page.MenuPage;
import cz.zcu.kiv.eegdatabase.wui.components.utils.PageParametersUtils;
import cz.zcu.kiv.eegdatabase.wui.components.utils.ResourceUtils;
import cz.zcu.kiv.eegdatabase.wui.core.common.DigitizationFacade;
import cz.zcu.kiv.eegdatabase.wui.core.common.ElectrodeConfService;
import cz.zcu.kiv.eegdatabase.wui.core.common.WeatherFacade;
import cz.zcu.kiv.eegdatabase.wui.core.experimentLicense.ExperimentLicenseFacade;
import cz.zcu.kiv.eegdatabase.wui.core.experiments.ExperimentsFacade;
import cz.zcu.kiv.eegdatabase.wui.core.file.FileFacade;
Expand Down Expand Up @@ -78,17 +74,6 @@ public class ExperimentFormPage extends MenuPage {
@SpringBean
private FileFacade fileFacade;

@SpringBean
private DigitizationFacade digitizationFacade;

@SpringBean
private WeatherFacade weatherFacade;

@SpringBean(name = "subjectGroupDao")
private GenericDao<SubjectGroup, Integer> subjectGroupFacade;

@SpringBean
private ElectrodeConfService electrodeConfService;
@SpringBean
private LicenseFacade licenseFacade;

Expand Down Expand Up @@ -132,31 +117,9 @@ private void setupComponents(final Model<Experiment> model) {

@Override
public void onFinish() {
if (digitizationFacade.getCountRecords() == 0) {
Digitization dig = new Digitization();
dig.setSamplingRate(1000f);
dig.setGain(1f);
dig.setFilter("filter");
digitizationFacade.create(dig);
}
if (electrodeConfService.getCountRecords() == 0) {
ElectrodeConf conf = new ElectrodeConf();
conf.setImpedance(10);
electrodeConfService.create(conf);
}

if (subjectGroupFacade.getCountRecords() == 0) {
SubjectGroup group = new SubjectGroup();
group.setDescription("xxx");
group.setTitle("Title");
subjectGroupFacade.create(group);
}

Experiment experiment = model.getObject();
experiment.setDigitization(digitizationFacade.read(1));
experiment.setElectrodeConf(electrodeConfService.read(1));
experiment.setSubjectGroup(subjectGroupFacade.read(1));
experiment.setWeather(weatherFacade.read(1));


ResearchGroup group = experiment.getResearchGroup();
if (group != null && group.isLock()) {
Expand Down

0 comments on commit 88c7546

Please sign in to comment.