Skip to content

Commit 4dd04be

Browse files
committed
example ready
1 parent e029b9f commit 4dd04be

9 files changed

+135
-884
lines changed

examples/logging_and_report/current_config.json

Lines changed: 95 additions & 102 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@
3030
"License": "GPLv3",
3131
"ObjectName": "SQLite - 0x196f9a6e",
3232
"Parents": [
33-
242975584,
34-
1826686116
33+
1826686116,
34+
242975584
3535
],
3636
"Plug": true,
3737
"Position": {
@@ -103,11 +103,80 @@
103103
],
104104
"Config": {
105105
"GeneralConfig": {
106-
"Autostart": false,
106+
"Autostart": true,
107107
"Debug": false,
108108
"Logging": false,
109109
"MP": false
110-
}
110+
},
111+
"SpecificConfig": [
112+
{
113+
"Data": "Single fire",
114+
"Index": 0,
115+
"Name": "Mode",
116+
"Type": "ComboBox"
117+
},
118+
{
119+
"Data": "Seconds",
120+
"Index": 0,
121+
"Name": "Timebase",
122+
"Type": "ComboBox"
123+
},
124+
{
125+
"Data": "5",
126+
"Name": "Intervalinput",
127+
"Type": "LineEdit"
128+
},
129+
{
130+
"Data": "10:00",
131+
"Name": "StartTime",
132+
"Type": "LineEdit"
133+
},
134+
{
135+
"Data": "13:00",
136+
"Name": "EndTime",
137+
"Type": "LineEdit"
138+
},
139+
{
140+
"Data": "13:00",
141+
"Name": "SpecificTime",
142+
"Type": "LineEdit"
143+
},
144+
{
145+
"Data": false,
146+
"Name": "Monday",
147+
"Type": "CheckBox"
148+
},
149+
{
150+
"Data": false,
151+
"Name": "Tuesday",
152+
"Type": "CheckBox"
153+
},
154+
{
155+
"Data": false,
156+
"Name": "Wednesday",
157+
"Type": "CheckBox"
158+
},
159+
{
160+
"Data": false,
161+
"Name": "Thursday",
162+
"Type": "CheckBox"
163+
},
164+
{
165+
"Data": false,
166+
"Name": "Friday",
167+
"Type": "CheckBox"
168+
},
169+
{
170+
"Data": false,
171+
"Name": "Saturday",
172+
"Type": "CheckBox"
173+
},
174+
{
175+
"Data": false,
176+
"Name": "Sunday",
177+
"Type": "CheckBox"
178+
}
179+
]
111180
},
112181
"ConstructorCMD_Unix": "cp -u executables/manual_scheduler.py ~/Pythonic/executables/manual_scheduler_BASICDATA_Id.py",
113182
"ConstructorCMD_Win32": "copy executables\\manual_scheduler.py %HOMEPATH%\\Pythonic\\executables\\manual_scheduler_BASICDATA_Id.py",
@@ -122,8 +191,8 @@
122191
"Parents": [],
123192
"Plug": true,
124193
"Position": {
125-
"x": 82,
126-
"y": 768
194+
"x": 110,
195+
"y": 727
127196
},
128197
"PythonicVersion": {
129198
"Major": 1,
@@ -146,8 +215,8 @@
146215
"Config": {
147216
"GeneralConfig": {
148217
"Autostart": false,
149-
"Debug": true,
150-
"Logging": true,
218+
"Debug": false,
219+
"Logging": false,
151220
"MP": false
152221
},
153222
"SpecificConfig": [
@@ -169,13 +238,13 @@
169238
"License": "GPLv3",
170239
"ObjectName": "Telegram - 0x2e4148e2",
171240
"Parents": [
172-
1964450219,
241+
330144042,
173242
2089028521
174243
],
175244
"Plug": true,
176245
"Position": {
177-
"x": 522,
178-
"y": 769
246+
"x": 421,
247+
"y": 728
179248
},
180249
"PythonicVersion": {
181250
"Major": 1,
@@ -193,8 +262,8 @@
193262
"AreaNo": 0,
194263
"Author": "Stephan Avenwedde",
195264
"Childs": [
196-
1826686116,
197-
1433802434
265+
1433802434,
266+
1826686116
198267
],
199268
"Config": {
200269
"GeneralConfig": {
@@ -355,10 +424,17 @@
355424
"Config": {
356425
"GeneralConfig": {
357426
"Autostart": false,
358-
"Debug": false,
427+
"Debug": true,
359428
"Logging": false,
360429
"MP": false
361-
}
430+
},
431+
"SpecificConfig": [
432+
{
433+
"Data": "my_db.bin",
434+
"Name": "Filename",
435+
"Type": "LineEdit2"
436+
}
437+
]
362438
},
363439
"ConstructorCMD_Unix": "cp -u executables/sqlite.py ~/Pythonic/executables/sqlite_BASICDATA_Id.py",
364440
"ConstructorCMD_Win32": "copy executables\\sqlite.py %HOMEPATH%\\Pythonic\\executables\\sqlite_BASICDATA_Id.py",
@@ -393,7 +469,9 @@
393469
"AllowStream": false,
394470
"AreaNo": 0,
395471
"Author": "Stephan Avenwedde",
396-
"Childs": [],
472+
"Childs": [
473+
776030434
474+
],
397475
"Config": {
398476
"GeneralConfig": {
399477
"Autostart": false,
@@ -414,12 +492,11 @@
414492
"License": "GPLv3",
415493
"ObjectName": "ReportGenerator - 0x13ad992a",
416494
"Parents": [
417-
239331030,
418495
1444402311
419496
],
420497
"Plug": true,
421498
"Position": {
422-
"x": 755,
499+
"x": 702,
423500
"y": 502
424501
},
425502
"PythonicVersion": {
@@ -477,90 +554,6 @@
477554
"Minor": 1
478555
}
479556
},
480-
{
481-
"AllowStream": true,
482-
"AreaNo": 0,
483-
"Author": "Stephan Avenwedde",
484-
"Childs": [
485-
330144042
486-
],
487-
"Config": {
488-
"GeneralConfig": {
489-
"Autostart": false,
490-
"Debug": false,
491-
"Logging": false,
492-
"MP": false
493-
}
494-
},
495-
"ConstructorCMD_Unix": "cp -u executables/manual_scheduler.py ~/Pythonic/executables/manual_scheduler_BASICDATA_Id.py",
496-
"ConstructorCMD_Win32": "copy executables\\manual_scheduler.py %HOMEPATH%\\Pythonic\\executables\\manual_scheduler_BASICDATA_Id.py",
497-
"DestructorCMD_Unix": "rm ~/Pythonic/executables/manual_scheduler_BASICDATA_Id.py",
498-
"DestructorCMD_Win32": "del %HOMEPATH%\\Pythonic\\executables\\manual_scheduler_BASICDATA_Id.py",
499-
"Filename": "manual_scheduler_0e43e6d6",
500-
"HighlightState": true,
501-
"Iconname": "ManualScheduler",
502-
"Id": 239331030,
503-
"License": "GPLv3",
504-
"ObjectName": "ManualScheduler - 0x0e43e6d6",
505-
"Parents": [],
506-
"Plug": true,
507-
"Position": {
508-
"x": 488,
509-
"y": 344
510-
},
511-
"PythonicVersion": {
512-
"Major": 1,
513-
"Minor": 3
514-
},
515-
"Socket": false,
516-
"Typename": "ManualScheduler",
517-
"Version": {
518-
"Major": 0,
519-
"Minor": 1
520-
}
521-
},
522-
{
523-
"AllowStream": false,
524-
"AreaNo": 0,
525-
"Author": "Stephan Avenwedde",
526-
"Childs": [
527-
776030434
528-
],
529-
"Config": {
530-
"GeneralConfig": {
531-
"Autostart": false,
532-
"Debug": false,
533-
"Logging": false,
534-
"MP": false
535-
}
536-
},
537-
"ConstructorCMD_Unix": "cp -u executables/stop_process.py ~/Pythonic/executables/manual_stop_process_BASICDATA_Id.py",
538-
"ConstructorCMD_Win32": "copy executables\\stop_process.py %HOMEPATH%\\Pythonic\\executables\\manual_stop_process_BASICDATA_Id.py",
539-
"DestructorCMD_Unix": "rm ~/Pythonic/executables/manual_stop_process_BASICDATA_Id.py",
540-
"DestructorCMD_Win32": "del %HOMEPATH%\\Pythonic\\executables\\manual_stop_process_BASICDATA_Id.py",
541-
"Filename": "manual_stop_process_751721ab",
542-
"HighlightState": true,
543-
"Iconname": "ManualStopProcess",
544-
"Id": 1964450219,
545-
"License": "GPLv3",
546-
"ObjectName": "ManualStopProcess - 0x751721ab",
547-
"Parents": [],
548-
"Plug": true,
549-
"Position": {
550-
"x": 292,
551-
"y": 914
552-
},
553-
"PythonicVersion": {
554-
"Major": 1,
555-
"Minor": 3
556-
},
557-
"Socket": false,
558-
"Typename": "ManualStopProcess",
559-
"Version": {
560-
"Major": 0,
561-
"Minor": 1
562-
}
563-
},
564557
{
565558
"AllowStream": true,
566559
"AreaNo": 0,

examples/logging_and_report/generic_pipe_13ad992a.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,9 @@ def execute(self):
4141
sheets = wb.sheetnames
4242
datasheet = wb['Data']
4343

44-
# example data
45-
self.inputData = [ (1641378333, 5),
46-
(1641378433, 6),
47-
(1641378533, 7)]
4844

4945
# create an iterator over the rows in the datasheet
50-
rows = datasheet.iter_rows(min_row=0, max_row=999, min_col=0, max_col=2)
46+
rows = datasheet.iter_rows(min_row=2, max_row=999, min_col=0, max_col=2)
5147

5248
# Convert unix time [s] back into a datetime object, returns an iterator
5349
reportdata_dt = map(lambda foo: (datetime.datetime.fromtimestamp(foo[0]), foo[1]), self.inputData)
@@ -62,7 +58,7 @@ def execute(self):
6258
# alternative approach (functional)
6359

6460
# zip both iterators together
65-
#data_it = zip(reportdata_dt, rows)
61+
# data_it = zip(reportdata_dt, rows)
6662
# def write_row(data):
6763
# (dt, val), (row_dt, row_val) = data
6864
# row_dt.value = dt

examples/logging_and_report/generic_pipe_2f78d74c.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,15 @@ def __init__(self, id, config, inputData, return_queue, cmd_queue):
1313
def execute(self):
1414

1515
output = None
16+
17+
# only create a output if a report request was received
18+
# if a PythonicError type is received do nothing
19+
1620
if self.inputData == '5m':
1721
t0 = int(time.time()) # get current unix time
1822
t1 = t0 - (60 * 5) # calculate unix stamp time 5 minutes ago
1923

2024
output = 'SELECT * FROM my_table WHERE timestamp BETWEEN {} AND {}'.format(t1, t0)
2125

22-
23-
recordDone = Record(output)
24-
self.return_queue.put(recordDone)
26+
recordDone = Record(output)
27+
self.return_queue.put(recordDone)
1.55 KB
Binary file not shown.

0 commit comments

Comments
 (0)