Skip to content

Commit 6616dad

Browse files
committed
Prepare for publishing
1 parent d74c6a5 commit 6616dad

File tree

5 files changed

+69
-14
lines changed

5 files changed

+69
-14
lines changed

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
.*/
2+
23
*.py[cod]
4+
__pycache__/
5+
6+
*.egg-info/
7+
dist/
38

49
.DS_Store
510
Thumbs.db

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
The [Basler AG](https://www.baslerweb.com) company provides a [TCL](https://docs.baslerweb.com/visualapplets/files/documents/TCL/Content/4_VisualApplets/TCL/Intro.htm) scripting engine to automatize the creation of [VisualApplets](https://www.baslerweb.com/en/products/frame-grabber-portfolio/visualapplets) designs (a former Silicon Software GmbH technology), which is a nice and useful feature but not nice enough, in my opinion.
44

5-
The main idea of the **[visualapplets.py](visualapplets.py)** project is to introduce an additional scripting abstraction and to script the creation of TCL scripts via Python.
5+
The main idea of the **[visualapplets.py](https://github.com/jurihock/visualapplets.py/blob/main/visualapplets.py)** project is to introduce an additional scripting abstraction and to script the creation of TCL scripts via Python.
66

77
Huh, to script a script? Too much meta? Let's study an example...
88

@@ -12,7 +12,7 @@ In this example we will implement the [ReLU](https://en.wikipedia.org/wiki/Recti
1212

1313
Just for practical reasons, we encapsulate the operator logic in a `HierarchicalBox`. So it can be reused many times in a VisualApplets design. Consequently we also create a class in our Python script, for the same purpose of course.
1414

15-
We begin with the first part of the Python script [example.py](example.py):
15+
We begin with the first part of the Python script [example.py](https://github.com/jurihock/visualapplets.py/blob/main/example.py):
1616

1717
```python
1818
import visualapplets as VA
@@ -59,7 +59,7 @@ design = VA.Design('mE5-MA-VCLx', 'Example')
5959
example = Example(design, 'Example', x=1, y=2)
6060
```
6161

62-
Finally import the generated [example.tcl](example.tcl) file in the VisualApplets IDE or execute something like this in the TCL console:
62+
Finally import the generated [example.tcl](https://github.com/jurihock/visualapplets.py/raw/main/example.tcl) file in the VisualApplets IDE or execute something like this in the TCL console:
6363

6464
```
6565
CloseDesign Discard
@@ -68,7 +68,7 @@ source "C:/foo/bar/example.tcl"
6868

6969
The resulting design should look similar to this one:
7070

71-
![](example.png)
71+
![](https://github.com/jurihock/visualapplets.py/raw/main/example.png)
7272

7373
Obviously there are more possibilities to implement the ReLU function. You can replace the fallback value by the `XOR` result or also only check the sign bit of the input value. But the preferred way is probably to utilize the built-in `ClipLow` operator instead... ;-)
7474

@@ -93,7 +93,7 @@ Furthermore each module instance provides an access to
9393
* module port descriptor via `()` accessor and
9494
* module parameter descriptor via `[]` accessor.
9595

96-
Modules with unambiguous assignable output-input port combination can be directly connected without specifying the source and destination port, like `CONST - BRANCH`. Reciprocal connection `BRANCH - CONST` is not necessarily unambiguous, since the branch can have multiple outputs, so you have to specify which one.
96+
Modules with unambiguous assignable output-input port combination can be directly connected without specifying the source and destination port, like `CONST - BRANCH`. Reciprocal connection `BRANCH - CONST` is not necessarily unambiguous, since the branch may have multiple outputs, so you have to specify which one.
9797

9898
## Port
9999

pyproject.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[build-system]
2+
requires = ["setuptools>=42", "wheel"]
3+
build-backend = "setuptools.build_meta"

setup.cfg

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
[metadata]
2+
name = visualapplets
3+
version = attr: visualapplets.__version__
4+
author = Juergen Hock
5+
author_email = [email protected]
6+
url = https://github.com/jurihock/visualapplets.py
7+
description = Python bindings for Basler's VisualApplets TCL script generation.
8+
long_description = file: README.md
9+
long_description_content_type = text/markdown
10+
license = MPL-2.0
11+
license_file = LICENSE
12+
keywords =
13+
automation
14+
basler
15+
camera
16+
cameralink
17+
dsp
18+
fpga
19+
framegrabber
20+
gigevision
21+
high-performance
22+
image-processing
23+
kintex7
24+
machine-vision
25+
microenable
26+
prototyping
27+
python
28+
real-time
29+
siso
30+
tcl
31+
visualapplets
32+
xilinx
33+
classifiers =
34+
Development Status :: 4 - Beta
35+
Intended Audience :: Developers
36+
Intended Audience :: Manufacturing
37+
Intended Audience :: Science/Research
38+
License :: OSI Approved :: Mozilla Public License 2.0 (MPL 2.0)
39+
Programming Language :: Python :: 3
40+
Programming Language :: Tcl
41+
Topic :: Scientific/Engineering
42+
Topic :: Scientific/Engineering :: Electronic Design Automation (EDA)
43+
Topic :: Scientific/Engineering :: Image Processing
44+
Topic :: Scientific/Engineering :: Visualization
45+
Topic :: Software Development
46+
Topic :: Software Development :: Code Generators
47+
Topic :: System :: Hardware
48+
Topic :: Utilities
49+
50+
[options]
51+
py_modules = visualapplets

visualapplets.py

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@
1717
"""
1818

1919

20+
__version__ = '1.0'
21+
22+
2023
operators = {
2124
'ADD': {
2225
'I': lambda n: f'I{n:03d}',
@@ -117,9 +120,6 @@ def print(self, what):
117120
self.file.write('\n')
118121

119122

120-
printer = StdoutPrinter()
121-
122-
123123
class Grid:
124124

125125
def x(self, index):
@@ -131,9 +131,6 @@ def y(self, index):
131131
return ((index or 0) * 40 + 3) * 2 - (1 * 40 + 3)
132132

133133

134-
grid = Grid()
135-
136-
137134
class Design:
138135

139136
def __init__(self, platform, name=None, version=None, description=None):
@@ -426,6 +423,5 @@ def stringify(value):
426423
assert False
427424

428425

429-
if __name__ == '__main__':
430-
431-
pass
426+
grid = Grid()
427+
printer = StdoutPrinter()

0 commit comments

Comments
 (0)