-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathsnippets.json
117 lines (117 loc) · 2.89 KB
/
snippets.json
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
{
"DataTypeChnFloat32": {
"prefix": [
"DataTypeChnFloat32"
],
"body": [
"\"DataTypeChnFloat32\""
],
"description": "Defines a float32 data type"
},
"DataTypeChnFloat64": {
"prefix": [
"DataTypeChnFloat64"
],
"body": [
"\"DataTypeChnFloat64\""
],
"description": "Defines a float64 data type"
},
"DataTypeChnString": {
"prefix": [
"DataTypeChnString"
],
"body": [
"\"DataTypeChnString\""
],
"description": "Defines a string data type"
},
"DataTypeChnDate": {
"prefix": [
"DataTypeChnDate"
],
"body": [
"\"DataTypeChnDate\""
],
"description": "Defines a date data type"
},
"DataTypeChnUInt8": {
"prefix": [
"DataTypeChnUInt8"
],
"body": [
"\"DataTypeChnUInt8\""
],
"description": "Defines a byte data type"
},
"DataTypeChnInt16": {
"prefix": [
"DataTypeChnInt16"
],
"body": [
"\"DataTypeChnInt16\""
],
"description": "Defines a int16 data type"
},
"DataTypeChnInt32": {
"prefix": [
"DataTypeChnInt32"
],
"body": [
"\"DataTypeChnInt32\""
],
"description": "Defines a int32 data type"
},
"DataTypeChnInt64": {
"prefix": [
"DataTypeChnInt64"
],
"body": [
"\"DataTypeChnInt64\""
],
"description": "Defines a int64 data type"
},
"main": {
"prefix": "if __name__",
"body": [
"if __name__ == \"__main__\":",
"\tprint(\"To test your plugin first, run the Python file directly from the command line\")",
"\tp = Plugin()",
"\tdir_path = os.path.dirname(os.path.realpath(__file__))",
"\tparameter = {",
"\t\t\"file\": os.path.join(dir_path, \"Example.csv\")",
"\t}",
"\tprint(\"\\n %s\" % p.read_store(parameter))",
"\tprint(\"\\nChannel length: %s\" % p.read_channel_length(0, 0))",
"\tprint(\"\\nChannel values: %s\" % p.read_channel_values(0, 0, 0, 1024))"
],
"description": "Code snippet for: __main__"
},
"readChannelLength": {
"prefix": "def read_channel_length",
"body": [
"def read_channel_length(self, grp_index, chn_index):",
"\treturn len(self.data)"
],
"description": "Code snippet for: read_channel_length"
},
"readStore": {
"prefix": "def read_store",
"body": [
"def read_store(self, parameter):",
"\tfile_path = os.path.realpath(parameter['file'])",
"\tself.tdm_model['Example'] = {\"description\": \"Example file\"}",
"\treturn self.tdm_model"
],
"description": "Code snippet for: read_store"
},
"readChannelValues": {
"prefix": "def read_channel_values",
"body": [
"def read_channel_values(self, grp_index, chn_index, numberToSkip, numberToTake):",
"\tvalues = []",
"\tvalues[numberToSkip:numberToTake+numberToSkip]"
],
"description": "Code snippet for: read_channel_values"
}
}