Compare commits
10 Commits
63b3237488
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0e62c9871c | ||
|
|
9f830271d5 | ||
|
|
c9acb3419e | ||
|
|
00dde1197b | ||
|
|
f08595a7d5 | ||
|
|
0344516b17 | ||
|
|
629be48196 | ||
|
|
1f5e9923b0 | ||
|
|
4cf73109fa | ||
|
|
e0d57ba47a |
@@ -64,7 +64,7 @@ $autoload['libraries'] = array('session', 'lang_detect', 'database', 'access', '
|
||||
| $autoload['helper'] = array('url', 'file');
|
||||
*/
|
||||
|
||||
$autoload['helper'] = array('date', 'url', 'form', 'language', 'string', 'asset', 'text');
|
||||
$autoload['helper'] = array('date', 'url', 'form', 'language', 'string', 'asset', 'text', 'html');
|
||||
|
||||
|
||||
/*
|
||||
|
||||
@@ -204,7 +204,6 @@ class Access {
|
||||
$this->CI->session->sess_destroy();
|
||||
$this->CI->session->sess_create();
|
||||
|
||||
$this->CI->messages->add(_('Logged out successfully'), 'success');
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -64,9 +64,11 @@ class MY_Session extends CI_Session {
|
||||
|
||||
// before continuing, we need to determine if there is any custom data to deal with.
|
||||
foreach (array('session_id', 'user_id', 'ip_address', 'user_agent', 'last_activity') as $val) {
|
||||
if(isset($customUserdata[$val])) {
|
||||
unset($customUserdata[$val]);
|
||||
$cookieUserdata[$val] = $this->userdata[$val];
|
||||
}
|
||||
}
|
||||
|
||||
// did we find any custom data? If not, we turn the empty array into a string
|
||||
if (count($customUserdata) === 0) {
|
||||
@@ -76,6 +78,10 @@ class MY_Session extends CI_Session {
|
||||
$customUserdata = $this->_serialize($customUserdata);
|
||||
}
|
||||
|
||||
if(!isset($this->userdata['user_id'])) {
|
||||
$this->userdata['user_id'] = '';
|
||||
}
|
||||
|
||||
// run the update query
|
||||
$this->CI->db->where('session_id', $this->userdata['session_id']);
|
||||
$this->CI->db->update($this->sess_table_name, array('last_activity' => $this->userdata['last_activity'], 'user_id' => $this->userdata['user_id'], 'user_data' => $customUserdata));
|
||||
|
||||
@@ -30,8 +30,9 @@
|
||||
class Scatt extends Program_runner {
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param unknown_type $params
|
||||
* @param mixed $params
|
||||
*/
|
||||
public function __construct($params) {
|
||||
$this->CI =& get_instance();
|
||||
@@ -44,35 +45,54 @@ class Scatt extends Program_runner {
|
||||
}
|
||||
|
||||
/**
|
||||
* Mapping function to generate correct float values
|
||||
*/
|
||||
private function formatNumbers($data) {
|
||||
if($data['type'] == 'float')
|
||||
$data['value'] = sprintf('%.6f', $data['value']);
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
/**
|
||||
* Generate dafault.calc and param_dsm.dat files.
|
||||
*
|
||||
* @param unknown_type $experimentId
|
||||
* @param string $experimentId
|
||||
*/
|
||||
public function _createJob($experimentId) {
|
||||
$this->CI->load->library('parser');
|
||||
|
||||
$experiment = $this->CI->experiment->getById($experimentId);
|
||||
|
||||
// create default.calc
|
||||
$path = FCPATH . 'uploads/' . $experiment['project_id'] . '/' . $experiment['id'] . '/';
|
||||
$handler = fopen($path . 'default.calc', "w");
|
||||
|
||||
// if we didn't specify a model for this experiment, copy the default
|
||||
// from the project.
|
||||
if (!file_exists($path . 'default.obj')) {
|
||||
@copy(FCPATH . 'uploads/' . $experiment['project_id'] . '/defaultmodel.obj', $path . 'default.obj');
|
||||
}
|
||||
|
||||
$data['parameters'] = $this->CI->experiment->getParameters($experimentId);
|
||||
// get the parameters for this experiment and convert the simple float values to %.6f
|
||||
$data['parameters'] = array_map(array($this, 'formatNumbers'), $this->CI->experiment->getParameters($experimentId));
|
||||
|
||||
@fwrite($handler, $this->CI->parser->parse_string($this->program['config_template'], $data, true));
|
||||
@fclose($handler);
|
||||
|
||||
// all param_dsm.dat files have the same header:
|
||||
$dsm_dat = "¶m_scat\n";
|
||||
$dsm_dat .= "filein_name='./default.obj',\n";
|
||||
$dsm_dat .= "tmat_file_name='./default.tma',\n";
|
||||
$dsm_dat .= "scat_diag_file_name='./default.out',\n";
|
||||
|
||||
// sscatt requires a specific number format, so we need to convert the
|
||||
// values
|
||||
foreach ($data['parameters'] as $par) {
|
||||
if ($par['type'] == 'float') {
|
||||
$par['value'] = number_format((double) $par['value'], 6, '.', '').'d0';
|
||||
}
|
||||
|
||||
if ($par['name'] == 'refractive_idx_im') {
|
||||
$refractive_idx_im = $par['value'];
|
||||
} else if ($par['name'] == 'refractive_idx_re') {
|
||||
@@ -82,6 +102,7 @@ class Scatt extends Program_runner {
|
||||
}
|
||||
}
|
||||
|
||||
// add a field that contains a combination of the refractive indices
|
||||
$dsm_dat .= "ind_ref=({$refractive_idx_re},{$refractive_idx_im})\n";
|
||||
$dsm_dat .= "/\n";
|
||||
|
||||
@@ -91,6 +112,7 @@ class Scatt extends Program_runner {
|
||||
}
|
||||
|
||||
/**
|
||||
* Parse results from an .out file.
|
||||
*
|
||||
* @param string $experimentId
|
||||
*/
|
||||
@@ -101,14 +123,17 @@ class Scatt extends Program_runner {
|
||||
|
||||
$path = FCPATH . 'uploads/' . $experiment['project_id'] . '/' . $experiment['id'] . '/';
|
||||
|
||||
// there was no results file found. return an empty array
|
||||
if (!file_exists($path . 'default.out')) {
|
||||
return array();
|
||||
}
|
||||
|
||||
// open the results file
|
||||
$handler = fopen($path . 'default.out', "r");
|
||||
|
||||
$results = array();
|
||||
|
||||
// and parse its contents
|
||||
while (($line = fgets($handler)) !== false) {
|
||||
$values = array();
|
||||
$i = 0;
|
||||
|
||||
@@ -296,7 +296,18 @@ class User extends CI_Model {
|
||||
|
||||
$this->db->insert('users', array_merge($data, $additionalData));
|
||||
|
||||
return $this->db->affected_rows() > 0 ? $data['id'] : false;
|
||||
$user_created = $this->db->affected_rows() == 1;
|
||||
|
||||
if($user_created) {
|
||||
// set the initial user settings
|
||||
$settings['user_id'] = $data['id'];
|
||||
$settings['jobs_check_interval'] = 5;
|
||||
|
||||
$this->db->insert('users_settings', $settings);
|
||||
return substr($data['id'], 0, 16);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
<script type="text/javascript">
|
||||
if (typeof jQuery == 'undefined') document.write(unescape("%3Cscript src='<?=base_url('/assets/js/jquery-1.6.2.min.js');?>' type='text/javascript'%3E%3C/script%3E"));
|
||||
</script>
|
||||
<?=js_asset('jquery.tablednd.js');?>
|
||||
<?=js_asset('minmax.js');?>
|
||||
<?=js_asset('scattport.js');?>
|
||||
|
||||
|
||||
@@ -9,9 +9,9 @@
|
||||
</div>
|
||||
|
||||
<div id="copyright">
|
||||
<?=image_asset('iwt.png');?>
|
||||
<?=image_asset('dfg.png');?>
|
||||
<?=image_asset('uni.png');?>
|
||||
<a href="http://www.dfg.de/en/index.jsp" target="_blank"><?=img(array('src' => 'assets/images/dfg.png', 'title' => 'Deutsche Forschungsgemeinschaft'))?></a>
|
||||
<a href="http://www.hs-emden-leer.de/en/startseite.html" target="_blank"><?=img(array('src' => 'assets/images/hsemden.png', 'title' => 'University of Applied Sciences Emden'))?></a>
|
||||
<a href="http://www.uni-bremen.de/en.html" target="_blank"><?=img(array('src' => 'assets/images/unibremen.png', 'title' => 'University of Bremen'))?></a>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
BIN
assets/images/hsemden.png
Normal file
BIN
assets/images/hsemden.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.8 KiB |
|
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 1.8 KiB |
@@ -133,6 +133,12 @@ $(document).ready(function() {
|
||||
/*
|
||||
* Notification stuff
|
||||
*/
|
||||
|
||||
// set a default JOBS_CHECK_INTERVAL
|
||||
if(typeof(window.JOBS_CHECK_INTERVAL) == "undefined") {
|
||||
JOBS_CHECK_INTERVAL = 5;
|
||||
}
|
||||
|
||||
$('#notifications').hide();
|
||||
getNotifications();
|
||||
setInterval('getNotifications()', '5000');
|
||||
|
||||
Reference in New Issue
Block a user