Skip to content

Commit fccddac

Browse files
committed
intial files
1 parent 41ea147 commit fccddac

File tree

11 files changed

+83
-57
lines changed

11 files changed

+83
-57
lines changed

.gitignore

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
# Byte-compiled / optimized / DLL files
2+
__pycache__/
3+
*.py[cod]
4+
5+
# C extensions
6+
*.so
7+
8+
# Distribution / packaging
9+
.Python
10+
env/
11+
build/
12+
develop-eggs/
13+
dist/
14+
downloads/
15+
eggs/
16+
.eggs/
17+
lib/
18+
lib64/
19+
parts/
20+
sdist/
21+
var/
22+
*.egg-info/
23+
.installed.cfg
24+
*.egg
25+
26+
# PyInstaller
27+
# Usually these files are written by a python script from a template
28+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
29+
*.manifest
30+
*.spec
31+
32+
# Installer logs
33+
pip-log.txt
34+
pip-delete-this-directory.txt
35+
36+
# Unit test / coverage reports
37+
htmlcov/
38+
.tox/
39+
.coverage
40+
.coverage.*
41+
.cache
42+
nosetests.xml
43+
coverage.xml
44+
*,cover
45+
46+
# Translations
47+
*.mo
48+
*.pot
49+
50+
# Django stuff:
51+
*.log
52+
53+
# Sphinx documentation
54+
docs/_build/
55+
56+
# PyBuilder
57+
target/

Control-Panel.png

-17.7 KB
Binary file not shown.

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ Modbus Simulator with GUI based on modbus-tk
2626
$ kivy main.py
2727
A GUi should show up if all the requirements are met !!
2828

29-
![Screen Shot 2015-11-01 at 7.25.50 PM.png](https://bitbucket.org/repo/X9byrq/images/4179375251-Screen%20Shot%202015-11-01%20at%207.25.50%20PM.png)
29+
![main_screen.png](/img/main_screen.png)
3030

3131
## Usage instructions
3232
1. Select the interface (only TCP supported as of now)
@@ -43,7 +43,7 @@ A GUi should show up if all the requirements are met !!
4343
* to delete a datablock ,select an item and use 'delete' button in Datablock pane
4444
6. To simulate data , press 'Simulate' button
4545
7. All the settings for various modbus related settings (block size/minimum/maximun values/logging) could be set and accessed from settings panel (use F1 or click on Settings icon at the bottom)
46-
![Screen Shot 2015-11-01 at 8.20.07 PM.png](https://bitbucket.org/repo/X9byrq/images/2785617559-Screen%20Shot%202015-11-01%20at%208.20.07%20PM.png)
46+
![settings_screen.png](img/settings_screen.png)
4747

4848
## Packaging for different OS (Standalone applications)
4949
A standalone application specific to target OS can be created with Kivy package manager

common.py

Lines changed: 2 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,8 @@
88

99
def path(name=""):
1010
"""
11-
Retrieve the relative filepath to a supplied name from the BrightEdge
12-
root directory. If the name begins with a "/", then consider the supplied
13-
name to be an absolute path.
14-
15-
Example:
16-
If BrightEdge Root is: /home/vagrant/brightedge
17-
path() will return "/home/vagrant/brightedge"
18-
path("tools/analyze") will return "/home/vagrant/brightedge/tools/analyze"
19-
path("/usr/bin/python") will return "/usr/bin/python"
11+
Retrieve the relative filepath to a supplied name
12+
2013
"""
2114
if name.startswith(os.path.sep):
2215
return name
@@ -105,47 +98,3 @@ def remove_dir(name):
10598
"""
10699
if os.path.exists(name):
107100
shutil.rmtree(name)
108-
109-
110-
def json_dump(contents, name=None, indent=4, as_list=False, default=repr):
111-
repr_data = []
112-
if name is not None:
113-
repr_data = [name]
114-
try:
115-
json_data = json.dumps(
116-
contents, sort_keys=True, indent=indent, default=default
117-
).split("\n")
118-
repr_data.extend(json_data)
119-
except Exception:
120-
repr_data.append(contents)
121-
if as_list is True:
122-
return repr_data
123-
else:
124-
for line in repr_data:
125-
print line
126-
127-
128-
class ValueStore(object):
129-
130-
def to_json(self, sort_keys=True, indent=4, default=repr, **kwargs):
131-
return json.dumps(
132-
self.to_dict(),
133-
sort_keys=sort_keys,
134-
indent=indent,
135-
default=default,
136-
**kwargs
137-
)
138-
139-
def to_dict(self):
140-
return self.__dict__.copy()
141-
142-
def clone(self):
143-
return self.__class__(**self.to_dict())
144-
145-
def pprint(self):
146-
print self.to_json()
147-
148-
def __repr__(self):
149-
items = self.__dict__.items()
150-
elems = ["%s=%s" % (k, v) for k, v in items if v is not None]
151-
return "%s(%s)" % (self.__class__.__name__, ", ".join(elems))

favicon.ico

-32.2 KB
Binary file not shown.

img/icon_settings.png

5.11 KB
Loading

img/main_screen.png

49.4 KB
Loading

img/modbus.png

14.3 KB
Loading

img/settings_screen.png

77.9 KB
Loading

modbussimu.ini

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
[Modbus]
2+
ip = 127.0.0.1
3+
block start = 0
4+
block size = 100
5+
bin min = 0
6+
bin max = 1
7+
reg min = 0
8+
reg max = 65535
9+
10+
[Logging]
11+
log file = /Users/sanjay/Library/Application Support/modbussimu/modbus.log
12+
logging = 1
13+
console logging = 1
14+
console log level = DEBUG
15+
file log level = DEBUG
16+
file logging = 1
17+
18+
[Simulation]
19+
time interval = 1
20+

0 commit comments

Comments
 (0)