epicsdev 2.1.1__tar.gz → 2.1.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: epicsdev
3
- Version: 2.1.1
3
+ Version: 2.1.2
4
4
  Summary: Helper module for creating EPICS PVAccess servers using p4p
5
5
  Project-URL: Homepage, https://github.com/ASukhanov/epicsdev
6
6
  Project-URL: Bug Tracker, https://github.com/ASukhanov/epicsdev
@@ -31,7 +31,7 @@ python -m pypeto -c config -f epicsdev
31
31
  ## Multi-channel waveform generator
32
32
  Module **epicdev.multiadc** can generate large amount of data for stress-testing
33
33
  the EPICS environment. For example the following command will generate 10000 of
34
- 100-pont noisy waveforms and 40000 of scalar parameters per second.
34
+ 100-point noisy waveforms and 40000 of scalar parameters per second.
35
35
  ```
36
36
  python -m epicsdev.multiadc -s0.1 -c10000 -n100
37
37
  ```
@@ -43,3 +43,16 @@ The graphs should look like this:
43
43
  [plots](docs/epicsdev_pvplot.jpg).
44
44
 
45
45
  Example of [Phoebus display](docs/phoebus_epicsdev.jpg), as defined in config/epicsdev.bob.
46
+
47
+ ## Using AI to generate PVAccess server for arbitrary instruments.
48
+ The epicsdev module is designed to be suitable for automatic development using AI agents.<br>
49
+ The roadmap to create a server for new instrument using copilot at github:
50
+ - Create new repository.
51
+ - In the prompt section enter something like this:<br>
52
+ 'Build device support for Tektronix MSO oscilloscopes using epicsdev_rigol_scope as a template and programming manual at < link to a pdf file >.'
53
+ - In 20-40 minutes the copilot will create a pull request.
54
+ - Follow instructions to review, commit and merge.
55
+
56
+ As an example, the generated server for Tektronix MSO oscilloscope was 99% correct and it reqiured very minor modifications.
57
+
58
+
@@ -0,0 +1,43 @@
1
+ # epicsdev
2
+ Helper module for creating EPICS PVAccess servers.
3
+
4
+ Demo:
5
+ ```
6
+ python pip install epicsdev
7
+ python -m epicsdev.epicsdev
8
+ ```
9
+
10
+ To control and plot:
11
+ ```
12
+ python pip install pypeto,pvplot
13
+ python -m pypeto -c config -f epicsdev
14
+ ```
15
+
16
+ ## Multi-channel waveform generator
17
+ Module **epicdev.multiadc** can generate large amount of data for stress-testing
18
+ the EPICS environment. For example the following command will generate 10000 of
19
+ 100-point noisy waveforms and 40000 of scalar parameters per second.
20
+ ```
21
+ python -m epicsdev.multiadc -s0.1 -c10000 -n100
22
+ ```
23
+ The GUI for monitoring:<br>
24
+ ```python -m pypeto -c config -f multiadc```
25
+
26
+ The graphs should look like this:
27
+ [control page](docs/epicsdev_pypet.png),
28
+ [plots](docs/epicsdev_pvplot.jpg).
29
+
30
+ Example of [Phoebus display](docs/phoebus_epicsdev.jpg), as defined in config/epicsdev.bob.
31
+
32
+ ## Using AI to generate PVAccess server for arbitrary instruments.
33
+ The epicsdev module is designed to be suitable for automatic development using AI agents.<br>
34
+ The roadmap to create a server for new instrument using copilot at github:
35
+ - Create new repository.
36
+ - In the prompt section enter something like this:<br>
37
+ 'Build device support for Tektronix MSO oscilloscopes using epicsdev_rigol_scope as a template and programming manual at < link to a pdf file >.'
38
+ - In 20-40 minutes the copilot will create a pull request.
39
+ - Follow instructions to review, commit and merge.
40
+
41
+ As an example, the generated server for Tektronix MSO oscilloscope was 99% correct and it reqiured very minor modifications.
42
+
43
+
@@ -1,6 +1,6 @@
1
1
  """Skeleton and helper functions for creating EPICS PVAccess server"""
2
2
  # pylint: disable=invalid-name
3
- __version__= 'v2.1.1 26-02-05'# sleep() returns False if a periodic update occurred. Simplified waveform randomization.
3
+ __version__= 'v2.1.2 26-02-07'# do nothing in sleep() if stopped.
4
4
  #Issue: There is no way in PVAccess to specify if string PV is writable.
5
5
  # As a workaround we append description with suffix ' Features: W' to indicate that.
6
6
 
@@ -163,14 +163,18 @@ def _create_PVs(pvDefs):
163
163
  spv.post(ivalue, timestamp=ts)
164
164
  else:
165
165
  v['display.description'] = desc
166
- for field in extra.keys():
167
- if field in ['limitLow','limitHigh','format','units']:
168
- v[f'display.{field}'] = extra[field]
169
- if field.startswith('limit'):
170
- v[f'control.{field}'] = extra[field]
171
- if field == 'valueAlarm':
172
- for key,value in extra[field].items():
173
- v[f'valueAlarm.{key}'] = value
166
+ for field in extra.keys():
167
+ try:
168
+ if field in ['limitLow','limitHigh','format','units']:
169
+ v[f'display.{field}'] = extra[field]
170
+ if field.startswith('limit'):
171
+ v[f'control.{field}'] = extra[field]
172
+ if field == 'valueAlarm':
173
+ for key,value in extra[field].items():
174
+ v[f'valueAlarm.{key}'] = value
175
+ except KeyError as e:
176
+ print(f'Cannot set {field} for {pname}: {e}')
177
+ sys.exit(1)
174
178
  spv.post(v)
175
179
 
176
180
  # add new attributes.
@@ -335,13 +339,15 @@ def sleep():
335
339
  Returns False if a periodic update occurred.
336
340
  """
337
341
  time.sleep(pvv('sleep'))
342
+ sleeping = True
343
+ if serverState().startswith('Stop'):
344
+ return sleeping
338
345
  tnow = timer()
339
346
  C_.cycleTimeSum += tnow - C_.lastCycleTime
340
347
  C_.lastCycleTime = tnow
341
348
  C_.cyclesAfterUpdate += 1
342
349
  C_.cycle += 1
343
350
  printv(f'cycle {C_.cycle}')
344
- sleeping = True
345
351
  if tnow - C_.lastUpdateTime > PeriodicUpdateInterval:
346
352
  avgCycleTime = C_.cycleTimeSum / C_.cyclesAfterUpdate
347
353
  printv(f'Average cycle time: {avgCycleTime:.6f} S.')
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "epicsdev"
7
- version = "2.1.1"
7
+ version = "2.1.2"
8
8
  authors = [
9
9
  { name="Andrey Sukhanov", email="sukhanov@bnl.gov" },
10
10
  ]
epicsdev-2.1.1/README.md DELETED
@@ -1,30 +0,0 @@
1
- # epicsdev
2
- Helper module for creating EPICS PVAccess servers.
3
-
4
- Demo:
5
- ```
6
- python pip install epicsdev
7
- python -m epicsdev.epicsdev
8
- ```
9
-
10
- To control and plot:
11
- ```
12
- python pip install pypeto,pvplot
13
- python -m pypeto -c config -f epicsdev
14
- ```
15
-
16
- ## Multi-channel waveform generator
17
- Module **epicdev.multiadc** can generate large amount of data for stress-testing
18
- the EPICS environment. For example the following command will generate 10000 of
19
- 100-pont noisy waveforms and 40000 of scalar parameters per second.
20
- ```
21
- python -m epicsdev.multiadc -s0.1 -c10000 -n100
22
- ```
23
- The GUI for monitoring:<br>
24
- ```python -m pypeto -c config -f multiadc```
25
-
26
- The graphs should look like this:
27
- [control page](docs/epicsdev_pypet.png),
28
- [plots](docs/epicsdev_pvplot.jpg).
29
-
30
- Example of [Phoebus display](docs/phoebus_epicsdev.jpg), as defined in config/epicsdev.bob.
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes