Rename 'trial' to 'experiment'
This commit is contained in:
@@ -16,25 +16,25 @@ class Job {
|
||||
|
||||
// load models
|
||||
$this->CI->load->model('program');
|
||||
$this->CI->load->model('trial');
|
||||
$this->CI->load->model('experiment');
|
||||
|
||||
log_message('debug', "Trial Class Initialized");
|
||||
log_message('debug', "Job Class Initialized");
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param string $trialId
|
||||
* @param string $experimentId
|
||||
* @return boolean Returns TRUE on success.
|
||||
*/
|
||||
public function createConfigs($trialId) {
|
||||
$trial = $this->CI->trial->getById($trialId);
|
||||
$path = FCPATH . 'uploads/' . $trial['project_id'] . '/' . $trial['id'] . '/';
|
||||
public function createConfigs($experimentId) {
|
||||
$experiment = $this->CI->experiment->getById($experimentId);
|
||||
$path = FCPATH . 'uploads/' . $experiment['project_id'] . '/' . $experiment['id'] . '/';
|
||||
|
||||
$program = $this->CI->program->getById($trial['program_id']);
|
||||
$program = $this->CI->program->getById($experiment['program_id']);
|
||||
|
||||
$handler = fopen($path . 'trial.conf', "w");
|
||||
$handler = fopen($path . 'default.calc', "w");
|
||||
|
||||
$parameters = $this->CI->trial->getParameters($trialId);
|
||||
$parameters = $this->CI->experiment->getParameters($experimentId);
|
||||
foreach ($parameters as $param) {
|
||||
$line = str_replace("{type}", $param['type'], $program['input_line']);
|
||||
$line = str_replace("{param}", $param['name'], $line);
|
||||
|
||||
@@ -31,14 +31,14 @@ class Program_runner {
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a job from the specified trial.
|
||||
* Creates a job from the specified experiment.
|
||||
*
|
||||
* @param string $trialId
|
||||
* @param string $experimentId
|
||||
*/
|
||||
public function createJob($trialId) {
|
||||
if ($this->driver->_createJob($trialId)) {
|
||||
public function createJob($experimentId) {
|
||||
if ($this->driver->_createJob($experimentId)) {
|
||||
$this->CI->load->model('job');
|
||||
$this->CI->job->create(array('trial_id' => $trialId, 'started_by' => $this->CI->session->userdata('user_id')));
|
||||
$this->CI->job->create(array('experiment_id' => $experimentId, 'started_by' => $this->CI->session->userdata('user_id')));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -22,17 +22,17 @@ class Scatt extends Program_runner {
|
||||
|
||||
/**
|
||||
*
|
||||
* @param unknown_type $trialId
|
||||
* @param unknown_type $experimentId
|
||||
*/
|
||||
public function _createJob($trialId) {
|
||||
public function _createJob($experimentId) {
|
||||
$this->CI->load->library('parser');
|
||||
|
||||
$trial = $this->CI->trial->getById($trialId);
|
||||
$experiment = $this->CI->experiment->getById($experimentId);
|
||||
|
||||
$path = FCPATH . 'uploads/' . $trial['project_id'] . '/' . $trial['id'] . '/';
|
||||
$path = FCPATH . 'uploads/' . $experiment['project_id'] . '/' . $experiment['id'] . '/';
|
||||
$handler = fopen($path . 'default.calc', "w");
|
||||
|
||||
$data['parameters'] = $this->CI->trial->getParameters($trialId);
|
||||
$data['parameters'] = $this->CI->experiment->getParameters($experimentId);
|
||||
|
||||
@fwrite($handler, $this->CI->parser->parse_string($this->program['config_template'], $data, true));
|
||||
@fclose($handler);
|
||||
|
||||
Reference in New Issue
Block a user