/daq/libopc

To get this branch, use:
bzr branch http://suren.me/webbzr/daq/libopc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
UnFinished Functions
--------------------
opcitem.c/opcItemNameFilter



ToDo
----
1. ðÏ ÉÄÅÉ RequestPool ÎÁÄÏ ÐÅÒÅÎÅÓÔÉ × Frontend, Á ÔÏÍÕ ×ÍÅÓÔÏ pctx, ctx
ÐÅÒÅÄÁ×ÁÔØ

2. óÄÅÌÁÔØ ×ÎÕÔÒÅÎÎÉÊ assert ËÏÔÏÒÙÊ ÍÏÖÅÔ ÐÅÒÅÏÐÒÅÄÅÌÑÔØ ×ÓÅ ÔÁËÉÅ ËÏÍÁÎÄÙ × nope. ëÒÏÍÅ ÔÏÇÏ
ÐÏÕÂÉ×ÁÔØ ×ÓÅ ÄÕÂÌÉÒÕÀÝÉÅÓÑ assertÙ ÉÚ opcItem É opcTree ÔÉÐÁ ctx->lock. òÅÛÉÔØ ÞÔÏ ÄÅÌÁÔØ 
Ó Self DeadlockÁÍÉ. äÌÑ Browse ÎÅ ÔÒÅÂÕÀÝÅÇÏ ÂÏÌØÛÏÊ ÓËÏÒÏÓÔÉ ÓÅÊÞÁÓ ÉÓÐÏÌØÚÕÀÔÓÑ _internal
ÆÕÎËÃÉÉ (ÆÁËÔÉÞÅÓËÉ ÌÉÛÎÉÊ ×ÙÚÏ× ÆÕÎËÃÉÉ É ÐÁÒÁ ÏÐÅÒÁÔÏÒÏ× ÐÒÉÓ×ÁÉ×ÁÎÉÑ).... 
ëÒÏÍÅ ÔÏÇÏ ÞÅÒÅÚ ILock ÍÏÖÎÏ ÓÄÅÌÁÔØ ÐÅÒÅÌÏÞÅ×ÁÎÉÅ ×Ï ×ÓÅÈ ×ÉÄÁÈ ËÒÏÍÅ Read->Write.
ó ÐÏÓÌÅÄÎÉÍ ×ÏÚÎÉËÁÀÔ ÐÒÏÂÌÅÍÙ, ÐÏÓËÏÌØËÕ × ÓÌÕÞÁÅ Multiple Readers ÎÁÄÏ ÒÅÛÁÔØ ËÏÇÄÁ ÏÓÔÁÎÅÔÓÑ
ÔÏÌØËÏ ÔÏÌØËÏ ÒÅÁÄÅÒ ÉÚ ÍÏÅÇÏ ÐÏÔÏËÁ, - ÔÏ ÂÉÛØ ÐÏÓÔÏÑÎÎÏ ÈÒÁÎÉÔØ ×ÓÅÈ ËÔÏ ÌÏÞÉÔ ÄÁÎÎÙÊ ÐÏÔÏË, - 
ÒÅÛÉÍÏ ÎÏ ÓÌÏÖÎÏ.... ëÒÏÍÅ ÔÏÇÏ RWLock ÐÏÚ×ÏÌÑÀÔ Read->Read ÐÅÒÅÌÏÞÉ×ÁÎÉÅ ÎÁ ÈÁÌÑ×Õ, ×ÏÚÍÏÖÎÏ ×Ï
ÍÎÏÇÉÈ ÓÌÕÞÁÑÈ ÜÔÏ ÏÐÔÉÍÁÌØÎÙÊ ×ÁÒÉÁÎ, × ÓÌÕÞÁÅ ÖÅ ÏÓÔÕÔÓÔ×ÉÑ ÐÏÄÄÅÒÖËÉ RWLock ÓÉÓÔÅÍÎÏÊ 
ÂÉÂÌÉÏÔÅËÏÊ ÍÏÖÎÏ ÜÔÏ ÒÅÁÌÉÚÏ×ÁÔØ ÞÅÒÅÚ ILock.

3. Rewrite frontend with standard classes. Condition is released in not right
way currently. Remade socket initilization with opcFrontendInitSocket.

4. Remove dependences from opcconfig.h from all library functions.

5. Separation server part from library part. Main point is to decied versioning and other
information corrsepond to which parts.
opc_holder_buffer_size and other such parameters should relly from some mashtabiruemost
parameter and calculating inside.

6. Make OPC_ERR to fit in 0x7FFF

7. opcassert.[ch]


Optimizations
-------------

Think
-----
1. çÄÅ ÌÕÞÛÅ ÉÎÉÃÉÁÌÉÚÉÒÏ×ÁÔØ opcSignal × opc.c ÉÌÉ opcserver.c?
2. Use prime table instead of finding primes every time for double hashing?
3. opcMalloc in case of static structure allocation. ctx->malloc should be
   0 in this case, but static initialization doesn't guarantie this. 
   What to do?
  

Notes
-----
GetText returns either string allocated in some internal static buffers
or string passed to it. So it can be consedered const if you don't 
change passed string.

Check
-----
ëÒÏÍÅ ×ÒÅÍÅÎÉ ××ÅÓÔÉ ËÁËÉÅ-ÎÉÂÕÄØ ËÏÏÒÄÉÎÁÔÙ ÉÔÅÍÁ
÷ frontend.c × ÃÉËÌÅ ÏÔÓÔÒÅÌÉ×ÁÔØ ÕÍÅÒÛÉÈ ÄÅÔÅÊ.
÷ÏÚ×ÒÁÝÁÔØ ÏÝÉÂËÉ ÉÚ frontend.c ËÏÇÄÁ ÎÅ ×ÙÈÏÄÉÔ spawn ÄÅÔÅÊ.
One time read/write to socket? Is Ok? Winsock?
ïÂÒÁÂÏÔËÁ ÏÓÔÁÌØÎÙÈ ËÏÄÏ× × Parse
NON BLOCKING I/O. Catch Broken PIPE.
ðÏÏÂÑ×ÌÑÔØ ÆÕÎËÃÉÉ ÓÔÁÔÉÞÅÓËÉÍÉ


Functions
---------
RegisterItem
	path, name, rate, mode (notification,send), cahce, datatype,
	locale
unregisterItem, pauseItem, resumeItem,




ðÅÒÅÔÁÝÉÔØ SOAP


XSD
---
restriction		- ignoring for now (ÏÇÒÁÎÉÞÅÎÉÅ ÔÉÐÏ×)
extension		- ÒÅËÕÒÓÉ×ÎÏ
element			+
group			+
all			-
choice			+
sequence		+
complexType		+
simpleType		+
attribute		-
attributeGroup		-
complexContent		-
simpleContent		-
ani			-
annotation		+
 documentation		+
 appinfo		+

Info:
	Aligment Format
	Byte Order
	INT Format
	Float Format
	String format (C, Pascal)


I can't see good way to verify signatures if document is unparsed and I only
have name of current node(signature). May be later rewrite xmlsec to make
parse/decrypt/validate one pass saX parsing.

Look
----
XUI (Mozilla) - XML User Interface

OPC Comments
------------
1. åÓÌÉ Quality ÐÏÍÅÎÑÌÏÓØ - Deadband ÉÇÎÏÒÉÒÕÅÔÓÑ
2. Deadband, ???? last cached value?
3. Limit Bit Fields: The Limit Buts is valid regardless of Quality. In some
cases such as Sensor Failure it can provide usefull diagnostic information:
0 - not Limited - None. The value free to move up or down.
1 - lowLimited - The value has 'pegged' at some lower limit.
2 - highLimited - ...
3 - constant - The value is constant and cannot move

DataDescriptor
--------------
1. ëÁË-ÔÏ ÄÏÌÖÎÁ ÂÙÔØ ÐÒÅÄÓÔÁ×ÌÅÎÁ ÉÎÆÏÒÍÁÃÉÑ Ï ÒÁÓÓÞÅÔÅ deadband?
2, Must contain xsd specification and transformation to xml format

History Extension (Buffering)
-----------------
ëÁÖÄÏÍÕ itemÕ ÓÏÐÏÓÔÁ×ÌÑÅÔÓÑ ÎÅËÉÊ handl (ÄÌÑ ÎÅËÏÔÏÒÏÊ ÇÒÕÐÐÉÒÏ×ËÉ). á×ÔÏÍÁÔÏÍÀ.

handle | path+item CHAR [64] | time | Requisitors | CDATA
Requisitors: äÏÂÏ×ÌÑÅÍ, õÂÉÒÁÅÍ ÓÓÙÌËÉ ËÏÍÕ ÎÕÖÎÙ ÜÔÉ ÄÁÎÎÙÅ. åÓÔØ ÐÏÓÔÏÑÎÎÙÅ
ÄÁÎÎÙÅ (-1).

ðÌÕÇÉÎÙ Ó ×ÅÓÁÍÉ ÐÏ ÓËÏÒÏÓÔÉ É Ó ÏÇÒÁÎÉÞÅÎÉÅÍ ÎÁ ÍÁËÓ ÏÂßÅÍ (ÚÁ ÒÁÚ), ÉÎÁÞÅ
ÓÁÍÏ ÐÅÒÅËÉÄÙ×ÁÅÔ, ÔÏ ÞÔÏ ÍÅÎÅÅ ÎÕÖÎÏ.
mem 	1	32MB
hdd	2	64MB
db	10	10GB

Alarm Extension
---------------
Notification required by clients (ÅÓÌÉ ÓÕÝÅÓÔ×ÕÅÔ ÓÏÏÔ×ÅÔÓÔ×ÕÀÝÉÊ extension),
×ÏÚ×ÒÁÝÁÅÔÓÑ ÐÒÉ ÌÀÂÏÍ ÚÁÐÒÏÓÅ, and server-side algoritms. In GRID/DModule
forwarding by our wish.
éÓÔÏÒÉÑ ÈÒÁÎÉÔÓÑ × current ÄÌÑ ËÁÖÄÏÇÏ item.
ôÅËÕÝÁÑ ÈÒÁÎÉÔÓÑ × ctx itemÁ. Algor Ó×ÅÒÑÅÔ Ó ÐÏÓÌÅÄÎÉÍ, ÅÓÌÉ ÁÄÄÒÅÓÓ ÉÚÍÅÎÉÌÓÑ
ÚÎÁÞÉÔ ÎÏ×ÙÊ alarm. ôÏÖÅ ÄÌÑ mirroring, ÞÉÔÁÅÍ ÏÔ×ÅÔ, ÅÓÌÉ ×ÙÓÔÁ×ÌÅÎ alarm
ÚÁÐÉÓÙ×ÁÅÍ × ctx ÌÉÎËÁ.


Yerevan Implementation
----------------------
ëÏÎÔÒÏÌØ, ÅÓÌÉ ÄÉÓÐÅÒÓÉÑ ÂÏÌØÛÅ eps, ËÁÎÁÌ ÉÇÎÏÒÉÒÕÅÍ
äÉÓÐÅÒÓÉÑ ÐÏ ËÁÎÁÌØÎÏ
ëÏÒÒÅÌÑÃÉÏÎÎÙÊ ÁÎÁÌÉÚ + ÎÅËÉÊ lack
ðÏÉÓË ÐÉËÏ× online
ìÏÖÎÁÑ ÔÒÅ×ÏÇÁ É ÜÆÆÅËÔÉ×ÎÏÓÔØ

1. Nor-Amberd Neutron Monitro (18 channels)
    1m, neutrons, 3 sections with 6 detectors
2. Solar Neutron Monitor 1
    1s-10s, 4 channels with 4 thresholds (ÔÁËÏÊ ÜÎÅÒÇÉÉ ÓÔÏÌØËÏ-ÔÏ) (neutron, electron) + 
    4 channel without thresholds (muon)
    + 16 coincidences
    
3. Aragats Neutron Monitor as 1)

4. Aragats Multi Directional Muon Monitor
PC1. 15 channels ( electron + muon ) 
     60 channels ( high energy muons )
PC2. 45 directions channels

5. Nor-Amberd Multi Directional Neutron Monitor

6. Solar Neutron Monitor 2 as 2) a bit bigger number of channels

7. Nor-Amberd Multi Directional Muon Monitor

A) http://www.sec.noaa.gov/ftpmenu/lists/[ace|xray].html
    ACE - L1 Langrangian Point, 1,5km
    GOES - 40,000km geostational orbit
B) IZMIRAN