Convert dSPACE ControlDesk measurements to MATLAB/Simulink timeseries (updated)
- With this updated MATLAB script, multiple dSPACE ControlDesk measurements can be imported with a single execution
- The result is saved as a tscollection (collection of timeseries) and all signals are saved with their corresponding name
- Access imported data with Simulink ‘From Workspace’ block and, e.g., dsp_tscs{1}.my_signal
Convert dSPACE ControlDesk measurement to MATLAB timeseries that can be used in Simulink
- dSPACE ControlDesk can export measurements to mdf4 files or mat files
- mat file exports can be converted to timeseries with this MATLAB script
- The timeseries can then be imported into Simulink with the ‘From Workspace’ blog
- Multiple signals can be imported at once
Example output:
>> import_dspace_mat_to_simulink_ts --Imported dSPACE mat file C:\Users\Nicolai\Nextcloud\foo.mat into workspace variable dsp_ts --Time: 0.000000 s to 42.399572 s, 423980 steps --2 variables are in dsp_ts: 'In1' 'In1_1'
Export object_list of a django-filters FilterView to CSV
This is a simple way to allow users to export the data they have just filtered using django-filter as CSV. # Normal View (has a link to export view and keeps GET parameters) @method_decorator(staff_member_required(login_url=’user_login’), name=’dispatch’) class PaymentListView(FilterView): filterset_class = filters.PaymentFilter template_name = “barsys/userarea/payment_list.html” paginate_by = 10 # Export View @method_decorator(staff_member_required(login_url=’user_login’), name=’dispatch’) class PaymentExportView(FilterView): filterset_class = filters.PaymentFilter