You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Feat connect without elf (#65)
* including DummyParser
* DummyParser does not need an elf file,
* moved locations of the images. (#67)
* update blockdiagram
* pyinstaller to requirements
* Add build executable github actions and pyinstaller spec
* add icon for windows executable
* adding requirements.txt for buildexecutables
* Feat unified parser (#66)
* changed version number
* introduced new implementation of dwarfExpr.
* adding array functionality to structures.
* added demo example
* Feat update unit test (#64)
* remove xc-16 install from github test
* added pyx2cscope package install
* including test for non-existing variable on 16 and 32 bits
* test array pointer
* Bug Fix- Single shot working.
* Adding mchplnet local dependency checkout
* removed repeated variable info.
* Updating package dependecy versions
* Add shared lib dependecy and webInterface Bash script
* Feat import export variable list (#68)
* adding functions to import/export variables
* pickle, yaml, and elf file format
* adding example program
* added test to check for import/export
- single variable
- multiple variables
- all variables
- yaml, pickle, and elf file
* include test for dspic33ak (#74)
* CamelCase to sneak_case and bring examples to same naming convention x2c_scope
* Documentation simplification and improvements.
* run buildexe action only on manual trigger
* Fix web interface thread (#77)
* replace constructor elf to import method
* web is thread safe with x2cscope
* handling invalid watch and scope load files
* bug, x2c is not initialized solved
Co-authored-by: Edras Pacola <edras.pacola@microchip.com>
Co-authored-by: Yash Agarwal <yash.agarwal@microchip.com>
Co-authored-by: Mark Wendler <mark.wendler@microchip.com>
- pyX2Cscope is the Python implementation of the X2Cscope plugin from MPLABX.
7
-
- This will let the user use the functionality of X2Cscope even outside mplabx environment / Standalone.
6
+
The pyx2cscope Python package communicates with X2Cscope enabled firmwares running on microcontrollers. Focusing real time control applications like motor control and power conversion.
It is highly recommended to install python libraries underneath a virtual environment.
30
-
31
-
Nevertheless, to install at system level, we advise to install it on user area. (Global insallation may not work.)
32
-
Execute the following lines:
33
-
34
-
```
35
-
pip install --user pyx2cscope
36
-
```
37
-
38
-
In case you already have installed pyx2cscope, you only need to update the package to the
39
-
new version typing:
40
-
```
41
-
pip install --upgrade pyx2cscope
42
-
```
43
-
44
-
In case of unexpected issues executing pyx2cscope try to reinstall manually:
45
-
```
46
-
pip uninstall pyx2cscope
47
-
pip cache purge
48
-
pip install --user pyx2cscope
49
-
```
50
-
51
26
## Start GUI
52
27
53
-
The GUI interface
54
-
55
-
There are currently two implementations, one based on Qt and one Browser based. These GUIs are more examples
56
-
on how to implement your own custom interfaces than an official user interface.
57
-
58
28
To execute Qt version, type:
59
29
```
60
30
pyx2cscope
@@ -65,125 +35,29 @@ To execute the Browser based version type:
65
35
pyx2cscope -w
66
36
```
67
37
68
-
## Getting Started with Scripting
38
+
## Basic scripting
69
39
70
-
1. Go to the [Examples](https://github.com/X2Cscope/pyx2cscope/tree/main/pyx2cscope/examples) directory in the pyX2Cscope project to check out the available examples or create a new .py file according to your requirements.
71
-
2. start with importing pyX2Cscope: `import pyx2cscope`
72
-
3. Choose the communication interface from the interfaces' module. Currently, **Only Serial** is supported: CAN and LIN coming in near future: <br>
73
-
```
74
-
from x2cscope import X2CScope
75
-
```
76
-
1. Initiate the X2CScope and provide the desired COM port, by default baud rate is set to **_115200_**. . If there's a need to change the baud rate, include the baud_rate parameter with your preferred baud rate, In the same way other setting could be made:
1.##### **clear_trigger()**: Clears and disable trigger
123
-
```
124
-
x2cscope.clear_trigger()
125
-
```
126
-
1.#### **set_sample_time(sample_time: int)**: This parameter defines a pre-scaler when the scope is in the sampling mode. This can be used to extend total sampling time at cost of resolution. 0 = every sample, 1 = every second sample, 2 = every third sample …
127
-
```
128
-
x2cScope.set_sample_time(2)
129
-
```
130
-
1.#### is_scope_data_ready(self) → bool: Returns Scope sampling state. Returns: true if sampling has completed, false if it’s yet in progress.
131
-
```
132
-
while not x2cScope.is_scope_data_ready():
133
-
time.sleep(0.1)
134
-
```
135
-
1.#### get_scope_channel_data(valid_data=False) → Dict[str, List[Number]]: Once sampling is completed, this function could be used to get the sampled data.
136
-
```
137
-
data = x2cScope.get_scope_channel_data()
138
-
```
139
-
1.#### This data now could be used according to the preference.
2. The Firmware of the microcontroller should have the X2Cscope library/Peripheral enabled.
146
-
3. in Tab WatchPlot, five channels values can be viewed, modified and can be plotted in the plot window.
147
-
4. In COM Port, either select **Auto Connect** or select the appropriate COM Port, Baud Rate from the drop-down menus and the ELF file of the project, the microcontroller programmed with. <br>
148
-
5. Sample time can be changed during run time as well, by default its set to 500 ms.
149
-
6. Press on **Connect**
150
-
7. Once the connection between pyX2Cscope and Microcontroller takes place, the buttons will be enabled.
151
-
8. Information related to the microcontroller will be displayed in the top-left corner.
1. ScopeView supports up to 8 PWM resolution channels for precise signal control.
157
-
2. You can configure all trigger settings directly within the window. To enable the trigger for a variable, check the corresponding trigger checkbox.
158
-
3. To apply modifications during sampling, first stop the sampling, make the necessary changes, then click Sample again to update and apply the modifications.
159
-
4. From the plot window, User can export the plot in various formats, including CSV, image files, Matplotlib Window, and Scalable Vector Graphics (SVG).
160
-
5. To zoom in on the plot, left-click and drag on the desired area. To return to the original view, right-click and select View All.
1. WatchView lets users add or remove variables as needed. To remove a variable, click the Remove button next to it.
166
-
2. Users can visualize variables in live mode with an update rate of 500 milliseconds. This rate is the default setting and cannot be changed.
167
-
3. Users can select, view, and modify all global variables during runtime, providing real-time control and adjustments.
168
-
169
-
## Save and Load Config.
170
-
1. The Save and Load buttons, found at the bottom of the GUI, allow users to save or load the entire configuration, including the COM Port, Baud Rate, ELF file path, and all other selected variables across different tabs. This ensures a consistent setup, regardless of which tab is active.
171
-
2. When a pre-saved configuration file is loaded, the system will automatically attempt to load the ELF file and establish a connection. If the ELF file is missing or unavailable at the specified path, user will need to manually select the correct ELF file path.
172
-
173
-
## Contribute
174
-
If you discover a bug or have an idea for an improvement, we encourage you to contribute! You can do so by following these steps:
175
-
176
-
1. Fork the pyX2Cscope repository.
177
-
2. Create a new branch for your changes.
178
-
3. Make the necessary changes and commit them.
179
-
4. Push your changes to your forked repository.
180
-
5. Open a pull request on the main pyX2Cscope repository, describing your changes.
181
-
182
-
We appreciate your contribution!
43
+
# initialize the X2CScope class with serial port, by default baud rate is 115200
44
+
x2c_scope = X2CScope(port="COM8")
45
+
# instead of loading directly the elf file, we can import it after instantiating the X2CScope class
Further [Examples](https://github.com/X2Cscope/pyx2cscope/tree/main/pyx2cscope/examples) directory in the pyX2Cscope project to check out the available examples or create a new .py file according to your requirements.
0 commit comments