/dev/trunk

To get this branch, use:
bzr branch http://darksoft.org/webbzr/dev/trunk

« back to all changes in this revision

Viewing changes to setups/katrin/classes/kdbconstants.php

  • Committer: Suren A. Chilingaryan
  • Date: 2014-01-25 16:38:03 UTC
  • Revision ID: csa@dside.dyndns.org-20140125163803-mhmpyk4dpzz7qabw
Detach setups

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
<?php
2
 
// $Id$
3
 
// Author: Sebastian Voecking <sebastian.voecking@uni-muenster.de>
4
 
 
5
 
define('kTypeOrca', 0);
6
 
define('kTypeOrcaRoot', 1);
7
 
define('kTypeCrun', 2);
8
 
define('kTypeHeader', 3);
9
 
define('kTypePlot', 4);
10
 
define('kTypeCustom', 5);
11
 
define('kTypePreview', 6);
12
 
define('kTypeXml', 7);
13
 
 
14
 
define('kHardwareUw', 0);
15
 
define('kHardwareIpe3', 1);
16
 
define('kHardwareIpe4', 2);
17
 
define('kHardwareInvalid', 3);
18
 
 
19
 
define("kSystemMainSpec", 0);
20
 
define("kSystemPreSpec", 1);
21
 
define("kSystemFPD", 2);
22
 
define("kSystemMonSpec", 3);
23
 
define("kSystemMyon", 4);
24
 
define("kSystemInvalid", 5);
25
 
 
26
 
class KDBConstants
27
 
{
28
 
    private static $gTypeNames = array(
29
 
        kTypeOrca => 'orca',
30
 
        kTypeOrcaRoot => 'orcaroot',
31
 
        kTypeCrun => 'crun',
32
 
        kTypeHeader => 'header',
33
 
        kTypePlot => 'plot',
34
 
        kTypeCustom => 'custom',
35
 
        kTypePreview => 'preview',
36
 
        kTypeXml => 'xml');
37
 
 
38
 
    private static $gHardwareNames = array(
39
 
        kHardwareUw => 'uw',
40
 
        kHardwareIpe3 => 'ipe3',
41
 
        kHardwareIpe4 => 'ipe4',
42
 
        kHardwareInvalid => 'invalid');
43
 
 
44
 
    private static $gSystemNames = array(
45
 
        kSystemMainSpec => 'kms',
46
 
        kSystemPreSpec => 'kps',
47
 
        kSystemFPD => 'fpd',
48
 
        kSystemMonSpec => 'mos',
49
 
        kSystemMyon => 'myo',
50
 
        kSystemInvalid => 'xxx');
51
 
    
52
 
    static function FileTypeName($value)
53
 
    {
54
 
        if (array_key_exists($value, self::$gTypeNames)) {
55
 
            return self::$gTypeNames[$value];
56
 
        }
57
 
        else {
58
 
            throw new ADEIException("Unknown file type $value");
59
 
        }
60
 
    }
61
 
 
62
 
    static function FileTypeValue($type) {
63
 
        $value = array_search($type, self::$gTypeNames);
64
 
        if ($value !== FALSE) {
65
 
            return $value;
66
 
        }
67
 
        else {
68
 
            throw new ADEIException("Unknown file type '$type'");
69
 
        }
70
 
    }
71
 
 
72
 
    static function HardwareName($value)
73
 
    {
74
 
        if (array_key_exists($value, self::$gHardwareNames)) {
75
 
            return self::$gHardwareNames[$value];
76
 
        }
77
 
        else {
78
 
            throw new ADEIException("Unknown hardware $value");
79
 
        }
80
 
    }
81
 
 
82
 
    static function HardwareValue($type) {
83
 
        $value = array_search($type, self::$gHardwareNames);
84
 
        if ($value !== FALSE) {
85
 
            return $value;
86
 
        }
87
 
        else {
88
 
            throw new ADEIException("Unknown hardware '$type'");
89
 
        }
90
 
    }
91
 
    
92
 
    static function OrcaSystemName($value)
93
 
    {
94
 
        if (array_key_exists($value, self::$gSystemNames)) {
95
 
            return self::$gSystemNames[$value];
96
 
        }
97
 
        else {
98
 
            throw new ADEIException("Unknown Orca system $value");
99
 
        }
100
 
    }
101
 
 
102
 
    static function OrcaSystemValue($type) {
103
 
        $value = array_search($type, self::$gSystemNames);
104
 
        if ($value !== FALSE) {
105
 
            return $value;
106
 
        }
107
 
        else {
108
 
            throw new ADEIException("Unknown Orca system '$type'");
109
 
        }
110
 
    }
111
 
}
112
 
?>