Raritan PX2/PX3 JSON-RPC API
AssetStripConfig.idl
1 /* SPDX-License-Identifier: BSD-3-Clause */
2 /*
3  * Copyright 2011 Raritan Inc. All rights reserved.
4  */
5 
6 #ifndef __ASSETMGRMODEL_ASSETSTRIP_CONFIG_IDL__
7 #define __ASSETMGRMODEL_ASSETSTRIP_CONFIG_IDL__
8 
9 #include <Event.idl>
10 #include <UserEvent.idl>
11 
12 /**
13  * Asset Management Model
14  */
15 module assetmgrmodel {
16  /** Asset Strip Config interface */
18 
19  /**
20  * %AssetStripConfig scan mode is active
21  *
22  * This is a demonstration feature providing a 'running lights' kind of effect
23  * where not all LEDs are lit statically (depending on their mode) but
24  * only a few LED which change all the time.
25  */
26  enumeration ScanMode {
27  SCANMODE_DISABLED, ///< LED scanmode is disabled, all LEDs are lit up statically
28  SCANMODE_BOTH ///< LED scanmode is enabled providing a 'running light' effect
29  };
30 
31  /**
32  * %AssetStripConfig rack unit numbering mode
33  *
34  * Indicates the way the rack unit numbers are defined.
35  * Basically this determines what number are 'written/printed' at a specific rack unit
36  * on the rack.
37  *
38  * An additional numberingOffset may be specified in the settings if the numbering
39  * does not start at the default 1.
40  */
41  enumeration NumberingMode {
42  TOP_DOWN, ///< numbering goes from top to bottom, top is the smallest number
43  BOTTOM_UP ///< numbering goes from bottom to top, bottom is the smallest number
44  };
45 
46  /**
47  * %AssetStripConfig orientation
48  *
49  * The asset strip may be mounted in a rack
50  * a) with its cable connector on top, growing top->bottom
51  * b) with its cable connector on bottom, growing bottom->top
52  *
53  * This enumeration indicates the mounting option.
54  * It is detected automatically and writes to the setting are ignored.
55  */
56  enumeration Orientation {
57  TOP_CONNECTOR, ///< cable connector on top, strip growing top->bottom
58  BOTTOM_CONNECTOR ///< cable connector on top, strip growing bottom->top
59  };
60 
61  /**
62  * Operation mode for the LED of a single rack unit.
63  *
64  * The LED may either be manually controlled or its color
65  * may be chosen automatically depending on whether an asset tag
66  * is connected or not. In automatic mode the LED is always on.
67  */
68  enumeration LEDOperationMode {
69  LED_OPERATION_MANUAL, ///< LED color and mode is manually controlled
70  LED_OPERATION_AUTO ///< LED color controlled automatically, LED always on
71  };
72 
73  /**
74  * Mode for the LED of a single rack unit
75  */
76  enumeration LEDMode {
77  LED_MODE_ON, ///< LED on
78  LED_MODE_OFF, ///< LED off
79  LED_MODE_BLINK_FAST, ///< LED is blinking (fast)
80  LED_MODE_BLINK_SLOW ///< LED is blinking (slow)
81  };
82 
83  /**
84  * The LED color in RGB format, 8 bit per channel
85  *
86  * Supported range is 0-255
87  */
88  structure LEDColor {
89  int r; ///< red channel of the LED
90  int g; ///< green channel of the LED
91  int b; ///< blue channel of the LED
92  };
93 
94  /**
95  * Settings for this Asset Strip
96  */
97  structure StripSettings {
98  int rackUnitCount; ///< rack unit count, number of rack units (range: 8..64), will be ignored on strips that auto-detect their rack unit count
99  string name; ///< user defined name (up to 64 alphanumeric characters)
100  ScanMode scanMode; ///< LED scan (demo) mode
101  LEDColor defaultColorConnected; ///< auto color for rack units with an asset tag connected
102  LEDColor defaultColorDisconnected; ///< auto color for rack units without an asset tag connected
103  NumberingMode numberingMode; ///< rack unit numbering mode (top down, bottom up)
104  int numberingOffset; ///< rack unit numbering starting offset (default is 1)
105  Orientation orientation; ///< orientation. If orientationSensAvailable, writes are ignored
106  };
107 
108  /**
109  * Settings for a single rack unit (LED state)
110  */
111  structure RackUnitSettings {
112  LEDOperationMode opmode; ///< Operation mode for this rack unit
113  LEDMode mode; ///< LED mode (on,off,blinking)
114  LEDColor color; ///< Color of the LED at this rack unit
115  string name; ///< user defined name (up to 64 alphanumeric characters)
116  };
117 
118  /** Event: Asset strip settings were changed */
119  valueobject StripSettingsChangedEvent extends event.UserEvent {
120  StripSettings oldSettings; ///< Settings before change
121  StripSettings newSettings; ///< Settings after change
122  };
123 
124  /** Event: A rack unit's settings were changed */
125  valueobject RackUnitSettingsChangedEvent extends event.UserEvent {
126  int rackUnitNumber; ///< Affected rack unit position
127  RackUnitSettings oldSettings; ///< Settings before change
128  RackUnitSettings newSettings; ///< Settings after change
129  };
130 
131  /**
132  * Get the asset strip settings which are not rack unit specific
133  *
134  * @return settings settings for this asset strip
135  */
136  StripSettings getStripSettings();
137 
138  /**
139  * Set the asset strip settings which are not rack unit specific
140  *
141  * @param settings Settings for this asset strip
142  * @return NO_ERROR on success
143  * @return ERR_INVALID_PARAM one or more of the settings is invalid
144  */
145  int setStripSettings(in StripSettings settings);
146 
147  /**
148  * Get settings of a rack unit at once
149  *
150  * @param rackUnitNumber rack unit to get the settings for, range 0..rackUnitCount-1
151  * @param settings settings for this rack unit
152  * @return NO_ERROR on success
153  * @return ERR_INVALID_PARAM rack unit count exceeded
154  */
155  int getRackUnitSettings(in int rackUnitNumber, out RackUnitSettings settings);
156 
157  /**
158  * Get settings for all rack units
159  *
160  * @return Result: the rack unit settings
161  */
162  vector<RackUnitSettings> getAllRackUnitSettings();
163 
164  /**
165  * Set all settings of the specified rack unit at once
166  *
167  * The addressed rack unit is part of the parameter
168  *
169  * @param rackUnitNumber rack unit to set the settings for, range 0..rackUnitCount-1
170  * @param settings settings for this rack unit
171  * @return NO_ERROR on success
172  * @return ERR_INVALID_PARAM one or more of the settings is invalid
173  */
174  int setRackUnitSettings(in int rackUnitNumber, in RackUnitSettings settings);
175 
176  /**
177  * Set all settings of multiple rack units at once
178  *
179  * @param settings map of rack units and their settings
180  * @return NO_ERROR on success
181  * @return ERR_INVALID_PARAM one or more of the settings is invalid
182  * (rack unit count exceeded or color/mode not supported,
183  * rack unit count and setting count differ...)
184  */
185  int setMultipleRackUnitSettings(in map<int, RackUnitSettings> settings);
186  };
187 }
188 
189 #endif /* __ASSETMGRMODEL_ASSETSTRIP_CONFIG_IDL__ */
NumberingMode numberingMode
rack unit numbering mode (top down, bottom up)
Definition: AssetStripConfig.idl:103
Asset Strip Config interface.
Definition: AssetStripConfig.idl:17
ScanMode scanMode
LED scan (demo) mode.
Definition: AssetStripConfig.idl:100
LED off.
Definition: AssetStripConfig.idl:78
Orientation
AssetStripConfig orientation
Definition: AssetStripConfig.idl:56
int numberingOffset
rack unit numbering starting offset (default is 1)
Definition: AssetStripConfig.idl:104
RackUnitSettings newSettings
Settings after change.
Definition: AssetStripConfig.idl:128
LEDOperationMode opmode
Operation mode for this rack unit.
Definition: AssetStripConfig.idl:112
LEDMode
Mode for the LED of a single rack unit.
Definition: AssetStripConfig.idl:76
LED is blinking (fast)
Definition: AssetStripConfig.idl:79
ScanMode
AssetStripConfig scan mode is active
Definition: AssetStripConfig.idl:26
int b
blue channel of the LED
Definition: AssetStripConfig.idl:91
cable connector on top, strip growing top->bottom
Definition: AssetStripConfig.idl:57
LEDMode mode
LED mode (on,off,blinking)
Definition: AssetStripConfig.idl:113
LED on.
Definition: AssetStripConfig.idl:77
string name
user defined name (up to 64 alphanumeric characters)
Definition: AssetStripConfig.idl:115
LEDColor color
Color of the LED at this rack unit.
Definition: AssetStripConfig.idl:114
Orientation orientation
orientation. If orientationSensAvailable, writes are ignored
Definition: AssetStripConfig.idl:105
Settings for this Asset Strip.
Definition: AssetStripConfig.idl:97
numbering goes from top to bottom, top is the smallest number
Definition: AssetStripConfig.idl:42
int g
green channel of the LED
Definition: AssetStripConfig.idl:90
LEDColor defaultColorConnected
auto color for rack units with an asset tag connected
Definition: AssetStripConfig.idl:101
RackUnitSettings oldSettings
Settings before change.
Definition: AssetStripConfig.idl:127
LEDColor defaultColorDisconnected
auto color for rack units without an asset tag connected
Definition: AssetStripConfig.idl:102
The LED color in RGB format, 8 bit per channel.
Definition: AssetStripConfig.idl:88
int rackUnitCount
rack unit count, number of rack units (range: 8..64), will be ignored on strips that auto-detect thei...
Definition: AssetStripConfig.idl:98
Asset Management Model.
Definition: AssetStrip.idl:15
StripSettings newSettings
Settings after change.
Definition: AssetStripConfig.idl:121
NumberingMode
AssetStripConfig rack unit numbering mode
Definition: AssetStripConfig.idl:41
LED scanmode is disabled, all LEDs are lit up statically.
Definition: AssetStripConfig.idl:27
string name
user defined name (up to 64 alphanumeric characters)
Definition: AssetStripConfig.idl:99
int r
red channel of the LED
Definition: AssetStripConfig.idl:89
LED color and mode is manually controlled.
Definition: AssetStripConfig.idl:69
LEDOperationMode
Operation mode for the LED of a single rack unit.
Definition: AssetStripConfig.idl:68
Settings for a single rack unit (LED state)
Definition: AssetStripConfig.idl:111