2
// $Id: kdbrunidentifier.php 8097 2010-07-15 09:57:24Z s_voec01 $
3
// Author: Sebastian Voecking <sebastian.voecking@uni-muenster.de>
5
ADEI::RequireClass('KDBConstants', TRUE);
9
public $system = kSystemInvalid;
13
function __construct()
15
if (func_num_args() == 1 && is_string(func_get_arg(0))) {
16
$this->ParseString(func_get_arg(0));
19
if (func_num_args() >= 1) {
20
$this->system = func_get_arg(0);
22
if (func_num_args() >= 2) {
23
$this->number = func_get_arg(1);
25
if (func_num_args() >= 3) {
26
$this->subRun = func_get_arg(2);
41
function SetSubRun($subrun)
43
$this->subRun = $subrun;
53
return sprintf("%s%08d", $this->GetSystemName(), $this->number);
58
$name = $this->GetRunName();
59
if ($this->subRun != 0) {
60
$name .= sprintf(".%05d", $this->subRun);
68
return $this->system != kSystemInvalid && $this->number != 0;
71
private function ParseString($text)
73
$pattern = '=^(?<system>[a-z]+)(?<run>\d+)(\.(?<subrun>\d+))?=';
75
if (preg_match($pattern, $text, $matches)) {
78
KDBConstants::OrcaSystemValue($matches['system']);
80
catch (ADEIException $e) {
81
$this->system = kSystemInvalid;
84
$this->number = (int) $matches['run'];
85
if (array_key_exists('subrun', $matches)) {
86
$this->subRun = (int) $matches['subrun'];
91
private function GetSystemName()
93
return KDBConstants::OrcaSystemName($this->system);
b'\\ No newline at end of file'