├── .gitignore
├── .gitmodules
├── DataModels
└── USI
│ ├── 1_0
│ └── usi_1_0.xsd
│ └── TDM
│ └── 1_0
│ └── USI_TDM_1_0.xml
├── EmbeddedUSICopyrights.chm
├── LICENSE
├── README.md
├── README.zh_CN.md
├── USI_Xerces_License.txt
├── USI_Xerces_Notice.txt
├── Uds.dll
├── audio
└── beep.wav
├── dacasr.dll
├── datalog
├── Lobster_Datalog_20201009_132222.tdm
├── Lobster_Datalog_20201009_132222.tdx
├── Lobster_Datalog_20201222_174229.tdm
└── Lobster_Datalog_20201222_174229.tdx
├── documentation
├── images
│ ├── addnewchannel.PNG
│ ├── channelmanager.PNG
│ ├── close.PNG
│ ├── mainwindow.PNG
│ ├── scopedragdrop.PNG
│ ├── scopezoominout.PNG
│ ├── scriptclean.PNG
│ ├── scriptdebug.PNG
│ ├── scriptfilebuttons.PNG
│ ├── scriptide.PNG
│ ├── scriptrefresh.PNG
│ ├── scriptrunstop.PNG
│ ├── scriptwidget.PNG
│ ├── selectdata.PNG
│ ├── settingsbutton.PNG
│ ├── settingswidget.PNG
│ ├── startbutton.PNG
│ ├── stopbutton.PNG
│ ├── toolbuttons.PNG
│ └── watchwindow.PNG
├── index.html
├── logsystem.html
├── mainwindow.html
├── oscilloscope.html
├── plugins.html
├── plugins
│ ├── drivercanbusplugin.html
│ ├── drivercommplugin.html
│ ├── evoxplugin.html
│ ├── imcplugin.html
│ └── testplugin.html
├── script.html
└── watchwindow.html
├── images
├── Apps-konsole-icon.png
├── Pause-Normal-Red-icon.png
├── Settings-icon.png
├── backward.png
├── clear-icon.png
├── controlpage.png
├── folder-open-icon.png
├── forward.png
├── home.png
├── lobster.png
├── log_replay.png
├── new-file-icon.png
├── refresh-icon.png
├── save-icon.png
├── script_start.png
├── start-icon.png
├── start_debug.png
├── stop-red-icon.png
├── zoomin.png
└── zoomout.png
├── lobster.pro
├── plugin
├── DbcPlugin.dll
├── TmctlPlugin.dll
├── UsbAdcPlugin.dll
├── WaveGeneratorPlugin.dll
├── WocenPowerPlugin.dll
└── XcpCanPlugin.dll
├── projects
├── TestBench
│ ├── HistoryMemory.xml
│ ├── PluginSettingsMemory.xml
│ ├── Tmctl.xml
│ ├── UsbAdc.xml
│ └── WindowsSettings.ini
├── TestDbc
│ ├── Dbc.xml
│ ├── DbcScript.js
│ ├── HistoryMemory.xml
│ ├── PluginSettingsMemory.xml
│ ├── WindowsSettings.ini
│ ├── auto.js
│ ├── go29.dbc
│ └── go29.ini
├── TestPowerAnalyzer
│ ├── HistoryMemory.xml
│ ├── PluginSettingsMemory.xml
│ ├── Tmctl.xml
│ └── WindowsSettings.ini
├── TestWaveGen
│ ├── HistoryMemory.xml
│ ├── PluginSettingsMemory.xml
│ ├── WaveGenerator.xml
│ ├── WindowsSettings.ini
│ └── controlpage
│ │ └── index.html
├── TestWocen
│ ├── HistoryMemory.xml
│ ├── PluginSettingsMemory.xml
│ ├── WindowsSettings.ini
│ └── WocenPower.xml
└── TestXcpCan
│ ├── HistoryMemory.xml
│ ├── PluginSettingsMemory.xml
│ ├── WindowsSettings.ini
│ └── XcpCan.xml
├── resource
├── lobster.ico
└── lobsterico.rc
├── script
├── hecsmCurrentScan.js
└── lib
│ ├── lb.js
│ └── map.js
├── src
├── main.cpp
├── modules
│ ├── channel
│ │ ├── LChannel.cpp
│ │ ├── LChannel.h
│ │ ├── LChannelMgr.cpp
│ │ └── LChannelMgr.h
│ ├── data
│ │ ├── LData.cpp
│ │ ├── LData.h
│ │ ├── LDataBuffer.cpp
│ │ ├── LDataBuffer.h
│ │ ├── LDataManager.cpp
│ │ └── LDataManager.h
│ ├── datalog
│ │ ├── LCsvHandler.cpp
│ │ ├── LCsvHandler.h
│ │ ├── LDataLogHangler.h
│ │ ├── LTdmDllWrapper.cpp
│ │ ├── LTdmDllWrapper.h
│ │ ├── LTdmFileHandler.cpp
│ │ └── LTdmFileHandler.h
│ ├── errorhandle
│ │ ├── LErrorHandler.cpp
│ │ └── LErrorHandler.h
│ ├── observer
│ │ ├── LAttributesObserver.h
│ │ └── LValueObserver.h
│ ├── playback
│ │ ├── LLogFileParser.cpp
│ │ └── LLogFileParser.h
│ ├── script
│ │ ├── LApi.cpp
│ │ ├── LApi.h
│ │ ├── LLobsterApiWrapper.cpp
│ │ ├── LLobsterApiWrapper.h
│ │ ├── LMainApi.cpp
│ │ ├── LMainApi.h
│ │ ├── LPointApi.cpp
│ │ ├── LPointApi.h
│ │ ├── LScriptEvalWrapper.cpp
│ │ ├── LScriptEvalWrapper.h
│ │ ├── LSystemApi.cpp
│ │ └── LSystemApi.h
│ └── settings
│ │ ├── LMainSettingsMgr.cpp
│ │ ├── LMainSettingsMgr.h
│ │ ├── LPluginSettingsMgr.cpp
│ │ ├── LPluginSettingsMgr.h
│ │ ├── LSettingsMgr.cpp
│ │ └── LSettingsMgr.h
└── views
│ ├── channelDlg
│ ├── LAddNewChannelDlg.cpp
│ ├── LAddNewChannelDlg.h
│ ├── LAddNewChannelDlg.ui
│ ├── LChannelMgrDlg.cpp
│ ├── LChannelMgrDlg.h
│ ├── LChannelMgrDlg.ui
│ ├── LChannelMgrDlgWrapper.cpp
│ └── LChannelMgrDlgWrapper.h
│ ├── controlpage
│ ├── LControlPage.cpp
│ ├── LControlPage.h
│ └── LControlPage.ui
│ ├── datalog
│ ├── LSaveLog.cpp
│ ├── LSaveLog.h
│ └── LSaveLog.ui
│ ├── help
│ ├── LHelpWidget.cpp
│ ├── LHelpWidget.h
│ └── LHelpWidget.ui
│ ├── mainwindow
│ ├── LMainWindow.cpp
│ ├── LMainWindow.h
│ ├── LMainWindow.ui
│ ├── LSelectProjectDialog.cpp
│ ├── LSelectProjectDialog.h
│ └── LSelectProjectDialog.ui
│ ├── oscilloscope
│ ├── LCursor.cpp
│ ├── LCursor.h
│ ├── LCurve.cpp
│ ├── LCurve.h
│ ├── LLogSpinBox.cpp
│ ├── LLogSpinBox.h
│ ├── LOscilloscope.cpp
│ ├── LOscilloscope.h
│ ├── LOscilloscope.ui
│ ├── LPlotSettings.cpp
│ ├── LPlotSettings.h
│ ├── LPlotter.cpp
│ ├── LPlotter.h
│ ├── LScopeMenu.cpp
│ ├── LScopeMenu.h
│ ├── LScopeMenu.ui
│ ├── qcustomplot.cpp
│ └── qcustomplot.h
│ ├── playback
│ ├── LPlaybackWidget.cpp
│ ├── LPlaybackWidget.h
│ ├── LPlaybackWidget.ui
│ ├── LPlaybackWidgetTableItem.cpp
│ └── LPlaybackWidgetTableItem.h
│ ├── script
│ ├── SCodeEditor.cpp
│ ├── SCodeEditor.h
│ ├── SConsole.cpp
│ ├── SConsole.h
│ ├── SMainWindow.cpp
│ ├── SMainWindow.h
│ └── SMainWindow.ui
│ ├── selectDlg
│ ├── LSelectDataDlg.cpp
│ ├── LSelectDataDlg.h
│ ├── LSelectDataDlg.ui
│ ├── LSelectDataDlgWrapper.cpp
│ └── LSelectDataDlgWrapper.h
│ ├── settingsDlg
│ ├── LSettingsTabDialog.cpp
│ ├── LSettingsTabDialog.h
│ └── LSettingsTabDialog.ui
│ └── watchwindow
│ ├── LColorSelectButton.cpp
│ ├── LColorSelectButton.h
│ ├── LColorSelectButton.ui
│ ├── LEnumsBox.cpp
│ ├── LEnumsBox.h
│ ├── LWatchWindow.cpp
│ ├── LWatchWindow.h
│ ├── LWatchWindow.ui
│ ├── LWatchWindowItem.cpp
│ └── LWatchWindowItem.h
├── tdms_ebd.dll
├── thirdparty
├── ADIO86.dll
├── ControlCAN.dll
├── LibDBCManager.dll
├── kerneldlls
│ ├── CAN232.dll
│ ├── CANDTU_NET.dll
│ ├── CANDTU_NET_400.dll
│ ├── CANETE.dll
│ ├── CANET_TCP.dll
│ ├── CANWIFI_TCP.dll
│ ├── CANWIFI_UDP.dll
│ ├── PC104C2.dll
│ ├── PC104CAN.dll
│ ├── PCI5121.dll
│ ├── gisadll.dll
│ ├── gpcidll.dll
│ ├── isa5420.dll
│ ├── kerneldll.ini
│ └── usbcan.dll
├── nilibddc.dll
├── objdump.exe
└── tmctl.dll
├── usiEx.dll
├── usiPluginTDM.dll
├── uspTdms.dll
├── utilities
└── python
│ ├── EvoxVar.py
│ ├── EvoxVar_Quantum.csv
│ ├── EvoxVar_Quantum.xml
│ ├── EvoxVar_RTAF.csv
│ ├── EvoxVar_RTAF.xml
│ ├── EvoxVar_test.py
│ ├── VariablesObix.xml
│ ├── en-US.lzma
│ ├── nti_config.csv
│ ├── nti_config.json
│ └── nti_config.py
└── xerces-c_3_1_usi.dll
/.gitignore:
--------------------------------------------------------------------------------
1 | # C++ objects and libs
2 |
3 | *.slo
4 | *.lo
5 | *.o
6 | *.a
7 | *.la
8 | *.lai
9 | *.so
10 | *.dll
11 | *.dylib
12 | vc100.pdb
13 |
14 | # Qt-es
15 |
16 | /.qmake.cache
17 | /.qmake.stash
18 | *.pro.user
19 | *.moc
20 | moc_*.cpp
21 | qrc_*.cpp
22 | ui_*.h
23 | Makefile*
24 | *-build-*
25 |
26 | # debug/release
27 |
28 | /debug
29 | /release
30 |
31 | /temp
32 |
33 | object_script.*.Debug
34 | object_script.*.Release
35 |
36 | !thirdparty/*.dll
37 | !thirdparty/kerneldlls/*.dll
38 | !plugin/*.dll
39 |
40 | log.txt
41 | mocinclude.opt
42 |
--------------------------------------------------------------------------------
/.gitmodules:
--------------------------------------------------------------------------------
1 | [submodule "src/modules/common"]
2 | path = src/modules/common
3 | url = https://github.com/lotusczp/Lobster-SDK.git
4 |
--------------------------------------------------------------------------------
/EmbeddedUSICopyrights.chm:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lotusczp/Lobster/ceb5ec720fdbbd5eddba5eeccc2f875a62d4332e/EmbeddedUSICopyrights.chm
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2021 Steve Cai
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Lobster
2 |
3 | English | [简体中文](./README.zh_CN.md)
4 |
5 | Download pre-built release [Lobster 1.3.0](https://github.com/lotusczp/Lobster/releases/tag/release_1_3_0)
6 |
7 | This repository is for the main program of Lobster. Lobster is a general purpose tool for debugging and testing. The idea is to gather, display and manipulate runtime values in remote devices, especially embedded systems. The main features include:
8 | - Plugin system to customize the communication with plenty of remote devices
9 | - Watch window to display values.
10 | - Oscilloscope to show the curves in realtime, whose UE is like CANoe/CANalyzer.
11 | - Log system to store the values with timestamp for feature analysis.
12 | - Replay system to show the curves of data saved by log file.
13 | - A script system (JavaScript) to extend, which can be used as auto-testing system.
14 | - Control page system to build custom UI using web.
15 |
16 | The snapshot
17 | 
18 |
19 |
20 | ## Plugins
21 | Lobster doesn't have any concrete implementation of communication with any remote devices. It use plugins to deal with them. Users can customize their own plugins using the [SDK](https://github.com/lotusczp/Lobster-SDK). I've already implemented several plugins
22 | - [CCP Plugin](https://github.com/lotusczp/CCP-Plugin)
23 | - [DBC Plugin](https://github.com/lotusczp/DBC-Plugin)
24 | - [WocenPower Plugin](https://github.com/lotusczp/WocenPower-Plugin)
25 | - [Tmctl Plugin](https://github.com/lotusczp/Tmctl-Plugin)
26 | - [USBADC plugin](https://github.com/lotusczp/USBADC-plugin)
27 |
28 | ## Script
29 | We use JavaScript (Qt support the interaction between JS and C++) as the script system of Lobster. The APIs are described in the help.
30 |
31 | ## Todo
32 | - I will build a release version for download directly.
33 | - Control page system is still under development
34 | - Update help
35 | - We need an auto update feature
36 | - Currently the script system is using the deprecated QtScript module. Need to transport to new QJSEngine
37 |
38 | ## How to build
39 | - Qt 5.15.2 (MSVC 2019, 64 bit) is tested. Others I still need to verify.
40 |
41 | ## Thanks to
42 | - Rusk Tao is the 2nd auth of this software.
43 | - The oscilloscope is using [QCustomPlot](https://www.qcustomplot.com/).
44 | - The JavaScript editor widget is using the codes from [this repo](https://github.com/kcrossen/Qt5.6-JavaScript-Editor-Widget) from [@kcrossen](https://github.com/kcrossen). Please contact me if there are any permission issues.
--------------------------------------------------------------------------------
/README.zh_CN.md:
--------------------------------------------------------------------------------
1 | # Lobster
2 |
3 | [English](./README.md) | 简体中文
4 |
5 | 下载release版本 [Lobster 1.3.0](https://github.com/lotusczp/Lobster/releases/tag/release_1_3_0)
6 |
7 | Lobster是一个通用的上位机,主要用于嵌入式系统的远程调试与测试,也可以连接设备,进行自动脚本测试。 主要功能是可以通过插件与远程设备通信,读取采样值,写入控制量。主要功能如下:
8 | - Lobster与远程的通信都是通过插件(DLL)进行的,用户可以根据需要定制自己的插件
9 | - 显示数据的视窗,同时也是一个控制台
10 | - 实时显示数据波形的示波器,其操作类似于CANoe/CANalyzer
11 | - 数据存储功能,供后续分析
12 | - 数据回放系统,可以载入之前记录的存储数据
13 | - 一个基于JavaScript的脚本系统,可以读写数据及进行其他控制,用于建立自动调试、测试系统
14 | - 控制页面,可用于用户自定义UI(基于Web)
15 |
16 | 界面截图
17 | 
18 |
19 | ## 插件系统
20 |
21 | Lobster主程序不提供与嵌入式系统的数据交互。所有的数据传输都是由插件完成的。因此用户可根据自己的通信方式和协议开发自己的插件。开发插件需要的SDK在[Lobster SDK](https://github.com/lotusczp/Lobster-SDK)这个仓库。下面是我已经开发了的部分插件,供直接使用或者作为demo。
22 | - [CCP协议插件,XCP的CAN实现](https://github.com/lotusczp/CCP-Plugin)
23 | - [基于DBC的CAN通信插件](https://github.com/lotusczp/DBC-Plugin)
24 | - [与沃森电源柜通信的插件](https://github.com/lotusczp/WocenPower-Plugin)
25 | - [与恒河功率分析仪通信的Tmctl插件](https://github.com/lotusczp/Tmctl-Plugin)
26 | - [与亚为科技的USBADC盒子通信的插件](https://github.com/lotusczp/USBADC-plugin)
27 |
28 | ## 脚本系统
29 |
30 | Lobster使用Javascript作为脚本扩展,可以读写数据及进行其他控制,用于建立自动调试、测试系统等。所有的API在Help文件中给出。
31 |
32 | ## 下一步工作
33 | - 提交一个编译好的release版本
34 | - 控制页面仍然在开发中
35 | - help文件需要更新
36 | - 需要一个自动更新程序
37 | - 当前的脚本系统使用了已经被Qt官方废弃的QtScript模块,准备替换为QJSEngine以支持新版本Qt
38 |
39 | ## 如何编译
40 | 当前测试过的Qt版本是Qt 5.15.2 (MSVC 2019, 64 bit)
41 |
42 | ## 感谢及声明
43 | - 部分代码为Rusk Tao所写,并且共同参与设计
44 | - 示波器使用了[QCustomPlot](https://www.qcustomplot.com/)库
45 | - 其中的JavaScript编辑器部分使用了[@kcrossen](https://github.com/kcrossen)的[这个仓库](https://github.com/kcrossen/Qt5.6-JavaScript-Editor-Widget)。如有任何侵权问题请联系我。
46 |
--------------------------------------------------------------------------------
/USI_Xerces_Notice.txt:
--------------------------------------------------------------------------------
1 | =========================================================================
2 | == NOTICE file corresponding to section 4(d) of the Apache License, ==
3 | == Version 2.0, in this case for the Apache Xerces distribution. ==
4 | =========================================================================
5 |
6 | This product includes software developed by
7 | The Apache Software Foundation (http://www.apache.org/).
8 |
9 | Portions of this software were originally based on the following:
10 | - software copyright (c) 1999, IBM Corporation., http://www.ibm.com.
11 |
--------------------------------------------------------------------------------
/Uds.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lotusczp/Lobster/ceb5ec720fdbbd5eddba5eeccc2f875a62d4332e/Uds.dll
--------------------------------------------------------------------------------
/audio/beep.wav:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lotusczp/Lobster/ceb5ec720fdbbd5eddba5eeccc2f875a62d4332e/audio/beep.wav
--------------------------------------------------------------------------------
/dacasr.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lotusczp/Lobster/ceb5ec720fdbbd5eddba5eeccc2f875a62d4332e/dacasr.dll
--------------------------------------------------------------------------------
/datalog/Lobster_Datalog_20201009_132222.tdx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lotusczp/Lobster/ceb5ec720fdbbd5eddba5eeccc2f875a62d4332e/datalog/Lobster_Datalog_20201009_132222.tdx
--------------------------------------------------------------------------------
/datalog/Lobster_Datalog_20201222_174229.tdx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lotusczp/Lobster/ceb5ec720fdbbd5eddba5eeccc2f875a62d4332e/datalog/Lobster_Datalog_20201222_174229.tdx
--------------------------------------------------------------------------------
/documentation/images/addnewchannel.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lotusczp/Lobster/ceb5ec720fdbbd5eddba5eeccc2f875a62d4332e/documentation/images/addnewchannel.PNG
--------------------------------------------------------------------------------
/documentation/images/channelmanager.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lotusczp/Lobster/ceb5ec720fdbbd5eddba5eeccc2f875a62d4332e/documentation/images/channelmanager.PNG
--------------------------------------------------------------------------------
/documentation/images/close.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lotusczp/Lobster/ceb5ec720fdbbd5eddba5eeccc2f875a62d4332e/documentation/images/close.PNG
--------------------------------------------------------------------------------
/documentation/images/mainwindow.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lotusczp/Lobster/ceb5ec720fdbbd5eddba5eeccc2f875a62d4332e/documentation/images/mainwindow.PNG
--------------------------------------------------------------------------------
/documentation/images/scopedragdrop.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lotusczp/Lobster/ceb5ec720fdbbd5eddba5eeccc2f875a62d4332e/documentation/images/scopedragdrop.PNG
--------------------------------------------------------------------------------
/documentation/images/scopezoominout.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lotusczp/Lobster/ceb5ec720fdbbd5eddba5eeccc2f875a62d4332e/documentation/images/scopezoominout.PNG
--------------------------------------------------------------------------------
/documentation/images/scriptclean.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lotusczp/Lobster/ceb5ec720fdbbd5eddba5eeccc2f875a62d4332e/documentation/images/scriptclean.PNG
--------------------------------------------------------------------------------
/documentation/images/scriptdebug.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lotusczp/Lobster/ceb5ec720fdbbd5eddba5eeccc2f875a62d4332e/documentation/images/scriptdebug.PNG
--------------------------------------------------------------------------------
/documentation/images/scriptfilebuttons.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lotusczp/Lobster/ceb5ec720fdbbd5eddba5eeccc2f875a62d4332e/documentation/images/scriptfilebuttons.PNG
--------------------------------------------------------------------------------
/documentation/images/scriptide.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lotusczp/Lobster/ceb5ec720fdbbd5eddba5eeccc2f875a62d4332e/documentation/images/scriptide.PNG
--------------------------------------------------------------------------------
/documentation/images/scriptrefresh.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lotusczp/Lobster/ceb5ec720fdbbd5eddba5eeccc2f875a62d4332e/documentation/images/scriptrefresh.PNG
--------------------------------------------------------------------------------
/documentation/images/scriptrunstop.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lotusczp/Lobster/ceb5ec720fdbbd5eddba5eeccc2f875a62d4332e/documentation/images/scriptrunstop.PNG
--------------------------------------------------------------------------------
/documentation/images/scriptwidget.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lotusczp/Lobster/ceb5ec720fdbbd5eddba5eeccc2f875a62d4332e/documentation/images/scriptwidget.PNG
--------------------------------------------------------------------------------
/documentation/images/selectdata.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lotusczp/Lobster/ceb5ec720fdbbd5eddba5eeccc2f875a62d4332e/documentation/images/selectdata.PNG
--------------------------------------------------------------------------------
/documentation/images/settingsbutton.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lotusczp/Lobster/ceb5ec720fdbbd5eddba5eeccc2f875a62d4332e/documentation/images/settingsbutton.PNG
--------------------------------------------------------------------------------
/documentation/images/settingswidget.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lotusczp/Lobster/ceb5ec720fdbbd5eddba5eeccc2f875a62d4332e/documentation/images/settingswidget.PNG
--------------------------------------------------------------------------------
/documentation/images/startbutton.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lotusczp/Lobster/ceb5ec720fdbbd5eddba5eeccc2f875a62d4332e/documentation/images/startbutton.PNG
--------------------------------------------------------------------------------
/documentation/images/stopbutton.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lotusczp/Lobster/ceb5ec720fdbbd5eddba5eeccc2f875a62d4332e/documentation/images/stopbutton.PNG
--------------------------------------------------------------------------------
/documentation/images/toolbuttons.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lotusczp/Lobster/ceb5ec720fdbbd5eddba5eeccc2f875a62d4332e/documentation/images/toolbuttons.PNG
--------------------------------------------------------------------------------
/documentation/images/watchwindow.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lotusczp/Lobster/ceb5ec720fdbbd5eddba5eeccc2f875a62d4332e/documentation/images/watchwindow.PNG
--------------------------------------------------------------------------------
/documentation/logsystem.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Log system
6 |
7 |
8 |
9 | Log system help
10 |
11 | Log system will save the data into a .csv file for further analysis.
12 |
13 | All the data logged are shown in the log widget. Every a hundred rows around,
14 | The program will clear the table and auto-save it into log_temp.csv under temp folder.
15 | If the program crash, you can recover most of the data from log_temp.csv,
16 | but the last dozens of rows without having been auto-saved will be gone.
17 | Note: when the program restart, log_temp.csv will be deleted.
18 | So if you are trying to recover data from this file, DO NOT restart the program!
19 |
20 |
21 | Clicking "Save as" button will save the data temporarily stored in log_temp.csv into the file you specify.
22 |
23 |
24 | Clicking "Clear and Restart" button will clear the data temporarily stored in log_temp.csv and start a brand new log.
25 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/documentation/mainwindow.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | main window
6 |
7 |
8 |
9 | main window help
10 |
11 | Main window contains 3 docking widgets: The oscilloscope, the log widget, the watch window.
12 | Those widgets are docking so you can place them anywhere you like. The Windows menu can control the visibility of them.
13 |
14 |
15 | tool buttons
16 |
17 | 
18 | By Clicking this button, all channels, no matter which transmission it relies on, are started.
19 | Once clicked, the start button will change to pause button, it can be used to pause all the
20 | transmission. "Pause" means the plugin no longer exchange data with Lobster main program but the hardware resource (serial port, etc.) it occupies are not
21 | released.
22 |
23 |
24 | 
25 | By Clicking this "Stop" button, the user can completely stop all transmissions and release all occupied resource.
26 |
27 |
28 | 
29 | Open the settings widgets for all channels.
30 |
31 |
32 | 
33 | Open the script IDE.
34 |
35 |
36 |
37 |
--------------------------------------------------------------------------------
/documentation/oscilloscope.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Oscilloscope
6 |
7 |
8 |
9 | Oscilloscope help
10 |
11 | Oscilloscope shows the curves of all points selected to show in scope.
12 | The curve line will be dot line if the current value of this point is invalid.
13 | The oscilloscope will continuously draw current value until the value is changed.
14 | Todo: The oscilloscope are now using openGL to render but the algorithm is not optimized. So if the time range is too big,
15 | the cpu usage will be high. We need more effects to improve the drawing algorithm.
16 |
17 |
18 | To change the value of Max Y and Min Y and click "set value" can change Y axis of oscilloscope.
19 |
20 | To change the time range can change X axis of oscilloscope.
21 | Note: Time range can only be changed by mouse wheel or UP/DOWN key.
22 |
23 |
24 | Click on the oscilloscope screen, drag and drop, to do this will zoom in the screen to see more details.
25 |
26 |
27 |
28 | Use
to backward/forward the zoom in/out stack.
29 |
30 |
31 |
--------------------------------------------------------------------------------
/documentation/plugins.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Plugin
6 |
7 |
8 |
9 | Plugin help
10 |
11 | Transmission plugin is the key to Lobster program. It handle the concrete communication job for a specified protocol.
12 |
13 | Settings widget
14 | if this channel need any configurations. This configuration is
15 | typically related to hardware. For example, the channels using Evox plugin need to configure the server ip and port(can not be empty).
16 | The channels using IMC plugin need to configure the serial port stuff such as prot number and baudrate.
17 |
18 |
19 | Tool widget
20 | A plugin can have a tool widget with it. The feature can be customized by the plugin. The tool widgets can be viewed by
21 | Tools->channel name, for example, channel "Var" using Evox plugin has a tool widget
22 | that can be accessed by Tools->Var.
23 |
24 |
25 | Currently supported plugins
26 |
27 |
34 |
35 |
36 | The following plugins are still under development
37 |
40 |
41 |
42 |
43 |
44 |
--------------------------------------------------------------------------------
/documentation/plugins/drivercanbusplugin.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Driver Canbus plugin
6 |
7 |
8 |
9 | Driver Canbus plugin help
10 |
11 | Driver Canbus plugin is used to communicate with Motor Driver of NTI project through CAN bus using a customized protocol.
12 | Note: This Plugin requires a third-party dll so it's not cross-platform.
13 |
14 | Settings widget
15 | Need to start/stop can device here.
16 |
17 |
18 | Tool widget
19 | No tool widget available here.
20 |
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/documentation/plugins/drivercommplugin.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Driver Comm plugin
6 |
7 |
8 |
9 | Driver Comm plugin help
10 |
11 | Driver Comm plugin is used to communicate with Motor Driver of NTI project through serial port using a customized protocol.
12 |
13 | Settings widget
14 | Need to configure serial port properties.
15 |
16 |
17 | Tool widget
18 | No tool widget available here.
19 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/documentation/plugins/evoxplugin.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Evox plugin
6 |
7 |
8 |
9 | Evox plugin help
10 |
11 | Evox plugin is used to handle UC800 evox/var protocol.
12 | The plugin send the batch request every 1 second. And send a single write request every 100 ms if has any. If the write command
13 | is coming too fast from Lobster main program, at most 100 write commands will be buffered. The rest will be dropped.
14 |
15 | Settings widget
16 | Evox plugin need to configure the server ip and port(can not be empty) in Settings widget.
17 |
18 |
19 | Tool widget
20 | The tool widget shows the network errors.
21 |
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/documentation/plugins/imcplugin.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IMC(IPC3) plugin
6 |
7 |
8 |
9 | IMC(IPC3) plugin help
10 |
11 | IMC(IPC3) plugin is used to communicate with virtual bit box through serial port using IPC3 protocol.
12 | The plugin read data from virtual bit box every 100ms. Virtual bit box requires continuously writing command otherwise
13 | it will consider this point as "comm loss". The plugin will write the value every 200ms.
14 |
15 | Settings widget
16 | IMC(IPC3) plugin need to configure all properties of serial port.
17 |
18 |
19 | Tool widget
20 | No tool widget available here.
21 |
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/documentation/plugins/testplugin.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Test plugin
6 |
7 |
8 |
9 | Test plugin help
10 |
11 | Test plugin is used to test the communication with Lobster, it just creates a sine wave and a sawtooth wave.
12 |
13 | Settings widget
14 | Not available here.
15 |
16 |
17 | Tool widget
18 | No tool widget available here.
19 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/documentation/watchwindow.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | watchwindow
6 |
7 |
8 |
9 | Watchwindow help
10 |
11 | Watchwindow not only shows the value of all selected points, but also controls the corresponding operations of each point in oscilloscope and log system.
12 |
13 |
14 | Name column
15 | Show the names of points. The name is formed by channel name + "_" + point name to distinguish same points from different channels.
16 | Note: Clicking the name will bolder the corresponding curve in oscilloscope and bring it to the very front.
17 |
18 |
19 | Value column
20 | 1. Show the real-time value of this point. If the value is changed, the background will be yellow. If 500 ms has passed and value
21 | is not changed, the background color will be changed back to normal.
22 | 2. Double-clicking the cell can enter the editing mode. The user can change the value of this point, press enter or somewhere else
23 | can quit the editing mode and send the value to transmission plugin. The plugin will handle the concrete send job.
24 | Note: "NA" means the value is invalid. Write "NA" to the cell will set this point value invalid.
25 | All values are "NA" when first time instantiated.
26 | "CL" means the point is "comm loss". Not all plugins support this.
27 |
28 |
29 | Curve color
30 | Change the color of the corresponding curve if visible in Oscilloscope. Clicking the button will open the pallet. The number show the corresponding RGB value.
31 |
32 |
33 | Scope
34 | Check/uncheck will set the corresponding curve visible/invisible in Oscilloscope
35 | Note: If unchecked, all curve data will be lost. The curve will begin at the time when checked instead of zero x-axis.
36 |
37 |
38 | Curve Gain and Offset
39 | The Y value of curve in Oscilloscope = real value * Curve Gain + Curve offset.
40 |
41 |
42 | Log
43 | Check/uncheck will begin/stop logging the datas of this point
44 |
45 |
46 |
47 |
--------------------------------------------------------------------------------
/images/Apps-konsole-icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lotusczp/Lobster/ceb5ec720fdbbd5eddba5eeccc2f875a62d4332e/images/Apps-konsole-icon.png
--------------------------------------------------------------------------------
/images/Pause-Normal-Red-icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lotusczp/Lobster/ceb5ec720fdbbd5eddba5eeccc2f875a62d4332e/images/Pause-Normal-Red-icon.png
--------------------------------------------------------------------------------
/images/Settings-icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lotusczp/Lobster/ceb5ec720fdbbd5eddba5eeccc2f875a62d4332e/images/Settings-icon.png
--------------------------------------------------------------------------------
/images/backward.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lotusczp/Lobster/ceb5ec720fdbbd5eddba5eeccc2f875a62d4332e/images/backward.png
--------------------------------------------------------------------------------
/images/clear-icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lotusczp/Lobster/ceb5ec720fdbbd5eddba5eeccc2f875a62d4332e/images/clear-icon.png
--------------------------------------------------------------------------------
/images/controlpage.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lotusczp/Lobster/ceb5ec720fdbbd5eddba5eeccc2f875a62d4332e/images/controlpage.png
--------------------------------------------------------------------------------
/images/folder-open-icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lotusczp/Lobster/ceb5ec720fdbbd5eddba5eeccc2f875a62d4332e/images/folder-open-icon.png
--------------------------------------------------------------------------------
/images/forward.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lotusczp/Lobster/ceb5ec720fdbbd5eddba5eeccc2f875a62d4332e/images/forward.png
--------------------------------------------------------------------------------
/images/home.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lotusczp/Lobster/ceb5ec720fdbbd5eddba5eeccc2f875a62d4332e/images/home.png
--------------------------------------------------------------------------------
/images/lobster.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lotusczp/Lobster/ceb5ec720fdbbd5eddba5eeccc2f875a62d4332e/images/lobster.png
--------------------------------------------------------------------------------
/images/log_replay.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lotusczp/Lobster/ceb5ec720fdbbd5eddba5eeccc2f875a62d4332e/images/log_replay.png
--------------------------------------------------------------------------------
/images/new-file-icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lotusczp/Lobster/ceb5ec720fdbbd5eddba5eeccc2f875a62d4332e/images/new-file-icon.png
--------------------------------------------------------------------------------
/images/refresh-icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lotusczp/Lobster/ceb5ec720fdbbd5eddba5eeccc2f875a62d4332e/images/refresh-icon.png
--------------------------------------------------------------------------------
/images/save-icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lotusczp/Lobster/ceb5ec720fdbbd5eddba5eeccc2f875a62d4332e/images/save-icon.png
--------------------------------------------------------------------------------
/images/script_start.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lotusczp/Lobster/ceb5ec720fdbbd5eddba5eeccc2f875a62d4332e/images/script_start.png
--------------------------------------------------------------------------------
/images/start-icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lotusczp/Lobster/ceb5ec720fdbbd5eddba5eeccc2f875a62d4332e/images/start-icon.png
--------------------------------------------------------------------------------
/images/start_debug.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lotusczp/Lobster/ceb5ec720fdbbd5eddba5eeccc2f875a62d4332e/images/start_debug.png
--------------------------------------------------------------------------------
/images/stop-red-icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lotusczp/Lobster/ceb5ec720fdbbd5eddba5eeccc2f875a62d4332e/images/stop-red-icon.png
--------------------------------------------------------------------------------
/images/zoomin.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lotusczp/Lobster/ceb5ec720fdbbd5eddba5eeccc2f875a62d4332e/images/zoomin.png
--------------------------------------------------------------------------------
/images/zoomout.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lotusczp/Lobster/ceb5ec720fdbbd5eddba5eeccc2f875a62d4332e/images/zoomout.png
--------------------------------------------------------------------------------
/plugin/DbcPlugin.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lotusczp/Lobster/ceb5ec720fdbbd5eddba5eeccc2f875a62d4332e/plugin/DbcPlugin.dll
--------------------------------------------------------------------------------
/plugin/TmctlPlugin.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lotusczp/Lobster/ceb5ec720fdbbd5eddba5eeccc2f875a62d4332e/plugin/TmctlPlugin.dll
--------------------------------------------------------------------------------
/plugin/UsbAdcPlugin.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lotusczp/Lobster/ceb5ec720fdbbd5eddba5eeccc2f875a62d4332e/plugin/UsbAdcPlugin.dll
--------------------------------------------------------------------------------
/plugin/WaveGeneratorPlugin.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lotusczp/Lobster/ceb5ec720fdbbd5eddba5eeccc2f875a62d4332e/plugin/WaveGeneratorPlugin.dll
--------------------------------------------------------------------------------
/plugin/WocenPowerPlugin.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lotusczp/Lobster/ceb5ec720fdbbd5eddba5eeccc2f875a62d4332e/plugin/WocenPowerPlugin.dll
--------------------------------------------------------------------------------
/plugin/XcpCanPlugin.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lotusczp/Lobster/ceb5ec720fdbbd5eddba5eeccc2f875a62d4332e/plugin/XcpCanPlugin.dll
--------------------------------------------------------------------------------
/projects/TestBench/HistoryMemory.xml:
--------------------------------------------------------------------------------
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 |
--------------------------------------------------------------------------------
/projects/TestBench/PluginSettingsMemory.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/projects/TestBench/Tmctl.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/projects/TestBench/UsbAdc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/projects/TestBench/WindowsSettings.ini:
--------------------------------------------------------------------------------
1 | [MainWindow]
2 | size=@Size(1373 753)
3 | state="@ByteArray(\0\0\0\xff\0\0\0\0\xfd\0\0\0\x2\0\0\0\0\0\0\x2\xa2\0\0\x2\x98\xfc\x2\0\0\0\x1\xfb\0\0\0\x1a\0L\0O\0s\0\x63\0i\0l\0l\0o\0s\0\x63\0o\0p\0\x65\x1\0\0\0\x43\0\0\x2\x98\0\0\0\x8b\0\xff\xff\xff\0\0\0\x1\0\0\x2\xaf\0\0\x2\x98\xfc\x2\0\0\0\x2\xfb\0\0\0\x18\0L\0W\0\x61\0t\0\x63\0h\0W\0i\0n\0\x64\0o\0w\x1\0\0\0\x43\0\0\x2\x98\0\0\0k\0\xff\xff\xff\xfb\0\0\0\x10\0L\0S\0\x61\0v\0\x65\0L\0o\0g\x2\0\0\x2,\0\0\0\x86\0\0\x3 \0\0\x1\xed\0\0\0\0\0\0\x2\x98\0\0\0\x4\0\0\0\x4\0\0\0\b\0\0\0\b\xfc\0\0\0\x1\0\0\0\x2\0\0\0\x1\0\0\0\xe\0t\0o\0o\0l\0\x42\0\x61\0r\x1\0\0\0\0\xff\xff\xff\xff\0\0\0\0\0\0\0\0)"
4 |
--------------------------------------------------------------------------------
/projects/TestDbc/Dbc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/projects/TestDbc/DbcScript.js:
--------------------------------------------------------------------------------
1 | var vcu1RollingCounterTick = (function(max) {
2 | var i = 0;
3 | return function (max) {
4 | i++;
5 | if(i>max) i = 0;
6 | return i;
7 | }
8 | }
9 | )();
10 |
11 | var DBCMessage = {
12 | VCU1 : {
13 | cycleTime_ms : 50,
14 | OnSend : function () {
15 | //console.log(lbDbcMgr.getSigValue("VCU1_RollingCounter"));
16 | //lbDbcMgr.setSigValue("VCU1_RollingCounter", lbDbcMgr.getSigValue("VCU1_RollingCounter")+1);
17 |
18 | lbDbcMgr.setSigValue("VCU1_CheckSum", 0);
19 | lbDbcMgr.setSigValue("VCU1_MCUModReq", 0);
20 | lbDbcMgr.setSigValue("VCU1_CrashOutputSts", 0);
21 | lbDbcMgr.setSigValue("VCU1_MCUTrqSetPoint", 0);
22 | lbDbcMgr.setSigValue("VCU1_ChrgEnable", 0);
23 | lbDbcMgr.setSigValue("VCU1_BMSEmgyToShutDown", 0);
24 | lbDbcMgr.setSigValue("VCU1_RollingCounter", vcu1RollingCounterTick(15));
25 | lbDbcMgr.setSigValue("VCU1_HillHold", 0);
26 |
27 |
28 | console.log(lbDbcMgr.getMsgBytes("VCU1")[0]);
29 | console.log(lbDbcMgr.getMsgBytes("VCU1")[1]);
30 | console.log(lbDbcMgr.getMsgBytes("VCU1")[2]);
31 | console.log(lbDbcMgr.getMsgBytes("VCU1")[3]);
32 | console.log(lbDbcMgr.getMsgBytes("VCU1")[4]);
33 | console.log(lbDbcMgr.getMsgBytes("VCU1")[5]);
34 | console.log(lbDbcMgr.getMsgBytes("VCU1")[6]);
35 | console.log(lbDbcMgr.getMsgBytes("VCU1")[7]);
36 | console.log("-----------------------------");
37 |
38 |
39 | },
40 | },
41 | VCU2 : {
42 | cycleTime_ms : 500,
43 | OnSend : function () {
44 | },
45 | },
46 | };
--------------------------------------------------------------------------------
/projects/TestDbc/PluginSettingsMemory.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/projects/TestDbc/WindowsSettings.ini:
--------------------------------------------------------------------------------
1 | [MainWindow]
2 | size=@Size(1373 753)
3 | state="@ByteArray(\0\0\0\xff\0\0\0\0\xfd\0\0\0\x2\0\0\0\0\0\0\x2\xa2\0\0\x2\x96\xfc\x2\0\0\0\x1\xfb\0\0\0\x1a\0L\0O\0s\0\x63\0i\0l\0l\0o\0s\0\x63\0o\0p\0\x65\x1\0\0\0\x45\0\0\x2\x96\0\0\0\x89\0\xff\xff\xff\0\0\0\x1\0\0\x2\xaf\0\0\x2\x96\xfc\x2\0\0\0\x2\xfb\0\0\0\x18\0L\0W\0\x61\0t\0\x63\0h\0W\0i\0n\0\x64\0o\0w\x1\0\0\0\x45\0\0\x2\x96\0\0\0k\0\xff\xff\xff\xfb\0\0\0\x10\0L\0S\0\x61\0v\0\x65\0L\0o\0g\x2\0\0\x2,\0\0\0\x86\0\0\x3 \0\0\x1\xed\0\0\0\0\0\0\x2\x96\0\0\0\x4\0\0\0\x4\0\0\0\b\0\0\0\b\xfc\0\0\0\x1\0\0\0\x2\0\0\0\x1\0\0\0\xe\0t\0o\0o\0l\0\x42\0\x61\0r\x1\0\0\0\0\xff\xff\xff\xff\0\0\0\0\0\0\0\0)"
4 |
--------------------------------------------------------------------------------
/projects/TestDbc/auto.js:
--------------------------------------------------------------------------------
1 | /// include lobster wrapper support
2 | include("../../script/lib/lb.js");
3 |
4 | /// The only global variable app
5 | /// It's like a namespace
6 | var app = function () {
7 | return {};
8 | }();
--------------------------------------------------------------------------------
/projects/TestDbc/go29.dbc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lotusczp/Lobster/ceb5ec720fdbbd5eddba5eeccc2f875a62d4332e/projects/TestDbc/go29.dbc
--------------------------------------------------------------------------------
/projects/TestPowerAnalyzer/PluginSettingsMemory.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/projects/TestPowerAnalyzer/Tmctl.xml:
--------------------------------------------------------------------------------
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 |
--------------------------------------------------------------------------------
/projects/TestPowerAnalyzer/WindowsSettings.ini:
--------------------------------------------------------------------------------
1 | [MainWindow]
2 | size=@Size(1373 753)
3 | state="@ByteArray(\0\0\0\xff\0\0\0\0\xfd\0\0\0\x2\0\0\0\0\0\0\x2\xa1\0\0\x2\x98\xfc\x2\0\0\0\x1\xfb\0\0\0\x1a\0L\0O\0s\0\x63\0i\0l\0l\0o\0s\0\x63\0o\0p\0\x65\x1\0\0\0\x43\0\0\x2\x98\0\0\0\x8b\0\xff\xff\xff\0\0\0\x1\0\0\x2\xae\0\0\x2\x98\xfc\x2\0\0\0\x2\xfb\0\0\0\x18\0L\0W\0\x61\0t\0\x63\0h\0W\0i\0n\0\x64\0o\0w\x1\0\0\0\x43\0\0\x2\x98\0\0\0k\0\xff\xff\xff\xfb\0\0\0\x10\0L\0S\0\x61\0v\0\x65\0L\0o\0g\x2\0\0\x2,\0\0\0\x86\0\0\x3 \0\0\x1\xed\0\0\0\x2\0\0\x2\x98\0\0\0\x4\0\0\0\x4\0\0\0\b\0\0\0\b\xfc\0\0\0\x1\0\0\0\x2\0\0\0\x1\0\0\0\xe\0t\0o\0o\0l\0\x42\0\x61\0r\x1\0\0\0\0\xff\xff\xff\xff\0\0\0\0\0\0\0\0)"
4 |
--------------------------------------------------------------------------------
/projects/TestWaveGen/HistoryMemory.xml:
--------------------------------------------------------------------------------
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 |
--------------------------------------------------------------------------------
/projects/TestWaveGen/PluginSettingsMemory.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/projects/TestWaveGen/WaveGenerator.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/projects/TestWaveGen/WindowsSettings.ini:
--------------------------------------------------------------------------------
1 | [MainWindow]
2 | size=@Size(1648 853)
3 | state=@ByteArray(\0\0\0\xff\0\0\0\0\xfd\0\0\0\x1\0\0\0\0\0\0\x6p\0\0\x2\xfd\xfc\x2\0\0\0\x1\xfc\0\0\0\x42\0\0\x2\xfd\0\0\0\x8b\0\xff\xff\xff\xfc\x1\0\0\0\x2\xfc\0\0\0\0\0\0\x2M\0\0\0X\0\xff\xff\xff\xfc\x2\0\0\0\x2\xfb\0\0\0\x18\0L\0W\0\x61\0t\0\x63\0h\0W\0i\0n\0\x64\0o\0w\x1\0\0\0\x42\0\0\x2\xfd\0\0\0k\0\xff\xff\xff\xfb\0\0\0\x10\0L\0S\0\x61\0v\0\x65\0L\0o\0g\0\0\0\x2\x99\0\0\0\xa6\0\0\0\xa0\0\xff\xff\xff\xfb\0\0\0\x1a\0L\0O\0s\0\x63\0i\0l\0l\0o\0s\0\x63\0o\0p\0\x65\x1\0\0\x2S\0\0\x4\x1d\0\0\x2\x30\0\xff\xff\xff\0\0\0\0\0\0\x2\xfd\0\0\0\x4\0\0\0\x4\0\0\0\b\0\0\0\b\xfc\0\0\0\x1\0\0\0\x2\0\0\0\x1\0\0\0\xe\0t\0o\0o\0l\0\x42\0\x61\0r\x1\0\0\0\0\xff\xff\xff\xff\0\0\0\0\0\0\0\0)
4 |
--------------------------------------------------------------------------------
/projects/TestWocen/HistoryMemory.xml:
--------------------------------------------------------------------------------
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 |
--------------------------------------------------------------------------------
/projects/TestWocen/PluginSettingsMemory.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/projects/TestWocen/WindowsSettings.ini:
--------------------------------------------------------------------------------
1 | [MainWindow]
2 | size=@Size(1373 753)
3 | state="@ByteArray(\0\0\0\xff\0\0\0\0\xfd\0\0\0\x2\0\0\0\0\0\0\x2\xa2\0\0\x2\x98\xfc\x2\0\0\0\x1\xfb\0\0\0\x1a\0L\0O\0s\0\x63\0i\0l\0l\0o\0s\0\x63\0o\0p\0\x65\x1\0\0\0\x43\0\0\x2\x98\0\0\0\x84\0\xff\xff\xff\0\0\0\x1\0\0\x2\xaf\0\0\x2\x98\xfc\x2\0\0\0\x2\xfb\0\0\0\x18\0L\0W\0\x61\0t\0\x63\0h\0W\0i\0n\0\x64\0o\0w\x1\0\0\0\x43\0\0\x2\x98\0\0\0k\0\xff\xff\xff\xfb\0\0\0\x10\0L\0S\0\x61\0v\0\x65\0L\0o\0g\x2\0\0\x2,\0\0\0\x86\0\0\x3 \0\0\x1\xed\0\0\0\0\0\0\x2\x98\0\0\0\x4\0\0\0\x4\0\0\0\b\0\0\0\b\xfc\0\0\0\x1\0\0\0\x2\0\0\0\x1\0\0\0\xe\0t\0o\0o\0l\0\x42\0\x61\0r\x1\0\0\0\0\xff\xff\xff\xff\0\0\0\0\0\0\0\0)"
4 |
--------------------------------------------------------------------------------
/projects/TestWocen/WocenPower.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/projects/TestXcpCan/HistoryMemory.xml:
--------------------------------------------------------------------------------
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 |
--------------------------------------------------------------------------------
/projects/TestXcpCan/PluginSettingsMemory.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/projects/TestXcpCan/WindowsSettings.ini:
--------------------------------------------------------------------------------
1 | [MainWindow]
2 | size=@Size(1529 855)
3 | state=@ByteArray(\0\0\0\xff\0\0\0\0\xfd\0\0\0\x2\0\0\0\0\0\0\x5\xf9\0\0\x2\xff\xfc\x2\0\0\0\x1\xfc\0\0\0\x42\0\0\x2\xff\0\0\x1#\0\xff\xff\xff\xfc\x1\0\0\0\x2\xfb\0\0\0\x18\0L\0W\0\x61\0t\0\x63\0h\0W\0i\0n\0\x64\0o\0w\x1\0\0\0\0\0\0\x2:\0\0\0X\0\xff\xff\xff\xfb\0\0\0\x1a\0L\0O\0s\0\x63\0i\0l\0l\0o\0s\0\x63\0o\0p\0\x65\x1\0\0\x2@\0\0\x3\xb9\0\0\x1.\0\xff\xff\xff\0\0\0\x1\0\0\x2[\0\0\x2\xff\xfc\x2\0\0\0\x1\xfb\0\0\0\x10\0L\0S\0\x61\0v\0\x65\0L\0o\0g\0\0\0\x1\x46\0\0\x1\xf9\0\0\0\xa0\0\xff\xff\xff\0\0\0\0\0\0\x2\xff\0\0\0\x4\0\0\0\x4\0\0\0\b\0\0\0\b\xfc\0\0\0\x1\0\0\0\x2\0\0\0\x1\0\0\0\xe\0t\0o\0o\0l\0\x42\0\x61\0r\x1\0\0\0\0\xff\xff\xff\xff\0\0\0\0\0\0\0\0)
4 |
--------------------------------------------------------------------------------
/projects/TestXcpCan/XcpCan.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/resource/lobster.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lotusczp/Lobster/ceb5ec720fdbbd5eddba5eeccc2f875a62d4332e/resource/lobster.ico
--------------------------------------------------------------------------------
/resource/lobsterico.rc:
--------------------------------------------------------------------------------
1 | IDI_ICON1 ICON DISCARDABLE "lobster.ico"
--------------------------------------------------------------------------------
/script/hecsmCurrentScan.js:
--------------------------------------------------------------------------------
1 | include("lib/lb.js");
2 |
3 | var hecsmCurrentScan = function () {
4 | // Private variables
5 | var IdRef = lb.point({channel : "Cgd", point : "IdRef", curveEnable : true, logEnable : true, });
6 | var IdFdb = lb.point({channel : "Cgd", point : "IdFdb", curveEnable : true, logEnable : true, });
7 | var IqRef = lb.point({channel : "Cgd", point : "IqRef", curveEnable : true, logEnable : true, });
8 | var IqFdb = lb.point({channel : "Cgd", point : "IqFdb", curveEnable : true, logEnable : true, });
9 | var IeRef = lb.point({channel : "Cgd", point : "IeRef", curveEnable : true, logEnable : true, });
10 | var IeFdb = lb.point({channel : "Cgd", point : "IeFdb", curveEnable : true, logEnable : true, });
11 | var enablePwm = lb.point({channel : "Cgd", point : "EnablePwm", curveEnable : true, logEnable : true, });
12 |
13 | // Private functions
14 | var setAndVerify = function (ptr, value, equalThres) {
15 | lb.test.setAndVerify ( ptr,
16 | value,
17 | 200, /* Verify timeout in ms*/
18 | function() {
19 | throw new Error("Fail to set the point " + ptr.getName() + "\n" +
20 | "The point value is " + ptr.getValue().toString() + ", but the expected value is " + value.toString() + "\n");
21 | },
22 | equalThres
23 | );
24 | };
25 |
26 | // Public interfaces
27 | return {
28 | init : function() {
29 | // Initialize some configuration
30 | lb.config.updateInterval = 20;
31 |
32 | // Subscribe needed points
33 | IdRef.subscribe();
34 | IdFdb.subscribe();
35 | IqRef.subscribe();
36 | IqFdb.subscribe();
37 | IeRef.subscribe();
38 | IeFdb.subscribe();
39 | enablePwm.subscribe();
40 |
41 | // Set values if needed
42 | setAndVerify(IdRef, 0);
43 | setAndVerify(IqRef, 0);
44 | setAndVerify(enablePwm, 0);
45 | },
46 |
47 | process : function() {
48 | setAndVerify(enablePwm, 1);
49 | IsLimitSquare = 350*350;
50 | for(var IeStep = 0; IeStep < 11; IeStep++) {
51 | var IeCmd_A = IeStep * 1;
52 | for(var IdStep = 0; IdStep < 30; IdStep++) {
53 | var IdCmd_A = IdStep * 10;
54 | for(var IqStep = 0; IqStep < 30; IqStep++) {
55 | var IqCmd_A = IqStep * 10;
56 | if(IdCmd_A*IdCmd_A+IqCmd_A*IqCmd_A < IsLimitSquare) { // Abandon meaningless points
57 | // Give the command
58 | setAndVerify(IeRef, IeCmd_A, 0.05);
59 | setAndVerify(IdRef, IdCmd_A, 0.05);
60 | setAndVerify(IqRef, IqCmd_A, 0.05);
61 | lb.system.wait(1000); // Waiting 5s to stablize
62 |
63 | // Verify the curves if needed
64 | // TODO just test, can be removed
65 | //res = lb.test.matchTwoCurves(IdRef, IdFdb, 40, 3000, 2, 10);
66 | //console.log(res.result);
67 |
68 | // Cool down
69 | setAndVerify(IeRef, 0);
70 | setAndVerify(IdRef, 0);
71 | setAndVerify(IqRef, 0);
72 | lb.system.wait(10000); // Waiting 10s
73 | // TODO wait for temperature to drop if we have the input
74 | }
75 | }
76 | }
77 | }
78 | },
79 | };
80 | }();
81 |
82 |
83 | hecsmCurrentScan.init();
84 | hecsmCurrentScan.process();
--------------------------------------------------------------------------------
/script/lib/map.js:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lotusczp/Lobster/ceb5ec720fdbbd5eddba5eeccc2f875a62d4332e/script/lib/map.js
--------------------------------------------------------------------------------
/src/main.cpp:
--------------------------------------------------------------------------------
1 | #include "LMainWindow.h"
2 | #include
3 | #include
4 | #include
5 | #include
6 | #include "LUniqueResource.h"
7 | #include "LSelectProjectDialog.h"
8 | #include "LPath.h"
9 |
10 | int main(int argc, char *argv[])
11 | {
12 | QApplication a(argc, argv);
13 | // Set the style of App
14 | a.setStyle(QStyleFactory::create("fusion"));
15 |
16 | // Set the current path and fix it to avoid the problem of changing current path on the fly
17 | PATH_ACCESSER->setCurPath();
18 |
19 | // Show splash
20 | QSplashScreen splash(QPixmap(PATH_ACCESSER->getPath(ePathImage, "lobster.png")));
21 | splash.show();
22 | QCoreApplication::processEvents();
23 |
24 | // Get project file
25 | LSelectProjectDialog* pSelectProjDiag = new LSelectProjectDialog;
26 | splash.finish(pSelectProjDiag);
27 | if(pSelectProjDiag->exec() == QDialog::Accepted) {
28 | PATH_ACCESSER->setProjectPath(pSelectProjDiag->getProjectPath());
29 | delete pSelectProjDiag;
30 | }
31 | else {
32 | delete pSelectProjDiag;
33 | return 0;
34 | }
35 |
36 | // Show splash for a few seconds
37 | splash.show();
38 | QCoreApplication::processEvents();
39 |
40 | // Main window instance
41 | LMainWindow w;
42 | w.show();
43 | splash.finish(&w);
44 |
45 | return a.exec();
46 | }
47 |
--------------------------------------------------------------------------------
/src/modules/channel/LChannel.cpp:
--------------------------------------------------------------------------------
1 | #include "LChannel.h"
2 |
3 | LChannel::LChannel()
4 | {
5 | }
6 |
7 | LChannel::LChannel(const QString &a_rChannelName, const QString &a_rCfgPath, LTransmission &a_rTransmission)
8 | {
9 | m_strChannelName = a_rChannelName;
10 | m_strCfgPath = a_rCfgPath;
11 | m_fIsActive = false;
12 | m_pTransmission = &a_rTransmission;
13 | }
14 |
15 | LChannel::~LChannel()
16 | {
17 | if (m_pTransmission != NULL) {
18 | m_pTransmission->stop();
19 |
20 | delete m_pTransmission, m_pTransmission = NULL;
21 | }
22 | }
23 |
24 | void LChannel::setActive(bool a_fIsActive)
25 | {
26 | // set flag
27 | m_fIsActive = a_fIsActive;
28 | }
29 |
30 | bool LChannel::isActive() const
31 | {
32 | return m_fIsActive;
33 | }
34 |
35 | void LChannel::setTransmissionPtr(LTransmission& a_rTransmission)
36 | {
37 | if (m_pTransmission != NULL) {
38 | m_pTransmission->stop();
39 |
40 | delete m_pTransmission, m_pTransmission = NULL;
41 | }
42 | m_pTransmission = &a_rTransmission;
43 | }
44 |
45 | const LTransmission *LChannel::getTransmissionPtr()
46 | {
47 | return m_pTransmission;
48 | }
49 |
50 | void LChannel::setCfgPath(const QString &a_rCfgPath)
51 | {
52 | m_strCfgPath = a_rCfgPath;
53 | }
54 |
55 | QString LChannel::getCfgPath() const
56 | {
57 | return m_strCfgPath;
58 | }
59 |
60 | void LChannel::configChannel(const LObixObjIter &a_rConfigIter)
61 | {
62 | m_pTransmission->configurate(a_rConfigIter);
63 | }
64 |
65 | bool LChannel::getDataList(QList &a_rDataList) const
66 | {
67 | return m_pTransmission->getDataList(a_rDataList);
68 | }
69 |
70 | void LChannel::resetCaredDataList(const QList &a_rCaredDataList)
71 | {
72 | m_pTransmission->resetCaredDataList(a_rCaredDataList);
73 | }
74 |
75 | void LChannel::startTransmission()
76 | {
77 | m_pTransmission->start();
78 | }
79 |
80 | void LChannel::stopTransmission()
81 | {
82 | m_pTransmission->stop();
83 | }
84 |
85 | QWidget *LChannel::getSettingsWidget()
86 | {
87 | return m_pTransmission->getSettingsWidget();
88 | }
89 |
90 | QWidget *LChannel::getToolWidget()
91 | {
92 | return m_pTransmission->getToolWidget();
93 | }
94 |
95 | void LChannel::pullAttributes()
96 | {
97 | m_pTransmission->pullAttributes();
98 | }
99 |
--------------------------------------------------------------------------------
/src/modules/channel/LChannel.h:
--------------------------------------------------------------------------------
1 | #ifndef LCHANNEL_H
2 | #define LCHANNEL_H
3 |
4 | #include
5 |
6 | #include "LTransmission.h"
7 |
8 | class LChannel
9 | {
10 | public:
11 | LChannel(const QString& a_rChannelName, const QString& a_rCfgPath, LTransmission& a_rTransmission);
12 | ~LChannel();
13 |
14 | void setActive(bool a_fIsActive);
15 |
16 | bool isActive() const;
17 |
18 |
19 | void setTransmissionPtr(LTransmission& a_rTransmission);
20 |
21 | //! return the const pointer of transmission
22 | const LTransmission* getTransmissionPtr();
23 |
24 |
25 | void setCfgPath(const QString& a_rCfgPath);
26 |
27 | QString getCfgPath() const;
28 |
29 |
30 | //! set the iterator of the configuration tree for this channel
31 | void configChannel(const LObixObjIter &a_rConfigIter);
32 |
33 | //! get the whole data list of a channel
34 | bool getDataList(QList &a_rDataList) const;
35 |
36 | //! reset the cared data list
37 | void resetCaredDataList(const QList &a_rCaredDataList);
38 |
39 |
40 | //! start the transmission
41 | void startTransmission();
42 |
43 | //! stop the transmission, this will release the hardware resource which was occupied by transmission
44 | void stopTransmission();
45 |
46 |
47 | //! get the setting widget of this channel
48 | QWidget* getSettingsWidget();
49 |
50 | //! get the setting widget of this channel
51 | QWidget* getToolWidget();
52 |
53 | //! Force to pull attributes from this channel
54 | void pullAttributes();
55 |
56 | private:
57 | LChannel();
58 |
59 | private:
60 | QString m_strChannelName; //!< name of this transmission
61 |
62 | QString m_strCfgPath; //!< path of config file
63 |
64 | bool m_fIsActive; //!< whether it's activated by user
65 |
66 | LTransmission* m_pTransmission; //!< the action impelemetion instance for this trans
67 | };
68 |
69 | #endif // LCHANNEL_H
70 |
--------------------------------------------------------------------------------
/src/modules/channel/LChannelMgr.h:
--------------------------------------------------------------------------------
1 | #ifndef LCHANNELMGR_H
2 | #define LCHANNELMGR_H
3 |
4 | #include
5 |
6 |
7 | #include "LChannel.h"
8 | #include "LDataValue.h"
9 |
10 | class LChannelMgr : public QObject
11 | {
12 | Q_OBJECT
13 |
14 | public:
15 | static LChannelMgr* instance();
16 |
17 | static void destroy();
18 |
19 | //! add a new transmission protocol
20 | void addChannel(const QString& a_rChannelName, const QString& a_rCfgPath, LTransmission& a_rTransmission);
21 |
22 | //! delete the existed protocol
23 | void deleteChannel(const QString& a_rChannelName);
24 |
25 |
26 |
27 | //! return the path of config file of this protocol
28 | QString getCfgPathByChannel(const QString& a_rChannelName) const;
29 |
30 | //! set the path of config file of this protocol
31 | void setCfgPathByChannel(const QString& a_rChannelName, const QString& a_rConfigPath);
32 |
33 |
34 |
35 | //! Activate the protocol by user
36 | void activateChannel(const QString& a_rChannelName);
37 |
38 | //! Deactivate the protocol by user
39 | void deactivateChannel(const QString& a_rChannelName);
40 |
41 | //! is this protocol activated by user
42 | bool isChannelActive(const QString& a_rChannelName) const;
43 |
44 |
45 |
46 | //! start all the transmission activated by user
47 | void startActiveChannels();
48 |
49 | //! stop all the transmission activated by user
50 | void stopActiveChannels();
51 |
52 |
53 |
54 | //! return all the protocols for other module to traverse
55 | QList getChannelList() const;
56 |
57 |
58 |
59 | //! set the Transmission Action Poiter
60 | void setTransmissionPtr(const QString &a_rChannelName, LTransmission& a_rTransmission);
61 |
62 |
63 |
64 | //! parse all config files and config all channels
65 | void configurateAllChannels();
66 |
67 | //! reset the cared data list
68 | void resetCaredDataList(const QString& a_rChannelName, const QList &a_rCaredDataList);
69 |
70 | //! get the whole data list of a channel
71 | bool getDataListByChannel(const QString& a_rChannelName, QList &a_rDataList) const;
72 |
73 | //! get the whole data list of all channels
74 | void getAvailableDatas(QList &a_rWholeDataList) const;
75 |
76 |
77 | //! get the setting widgets by channel name
78 | QWidget* getSettingsWidget(const QString& a_rChannelName);
79 |
80 | //! get the setting widgets by channel name
81 | QWidget* getToolWidget(const QString& a_rChannelName);
82 |
83 | //! Pull attributes from all channels
84 | void pullAttriFromAllChannels();
85 |
86 |
87 | private:
88 | LChannelMgr();
89 | ~LChannelMgr();
90 |
91 | void clearChannelMap();
92 |
93 | //! set the iterator of the configuration tree for a single channel
94 | void configChannel(const QString& a_rChannelName, const QString &a_rFilename);
95 |
96 |
97 |
98 |
99 | private:
100 | static LChannelMgr *s_pInstance;
101 |
102 | QMap m_mapChannels; //!< [Channel name][Channel]
103 |
104 | LTree *m_pObixTree; //!< obix tree for all the config files
105 | };
106 |
107 | #endif // LCHANNELMGR_H
108 |
--------------------------------------------------------------------------------
/src/modules/data/LData.cpp:
--------------------------------------------------------------------------------
1 | #include "LValueObserver.h"
2 | #include "LData.h"
3 |
4 | LData::LData(const QString &a_rDataName)
5 | {
6 | m_strName = a_rDataName;
7 | }
8 |
9 | LData::~LData()
10 | {
11 | // do not delete the instance which is pointed by LObserver*
12 | m_listValueObv.clear();
13 | }
14 |
15 | QString LData::getDataName() const
16 | {
17 | return m_strName;
18 | }
19 |
20 | void LData::notifyAllValueObs()
21 | {
22 | LDataValue dataValue;
23 | while (this->popValue(dataValue)) {
24 | QListIterator i(m_listValueObv);
25 | while(i.hasNext()) {
26 | i.next()->updateValue(m_strName, dataValue);
27 | }
28 | }
29 | }
30 |
31 | void LData::attachValueObserver(LValueObserver *a_pObserver)
32 | {
33 | if ( !m_listValueObv.contains(a_pObserver) ) {
34 | m_listValueObv.append(a_pObserver);
35 | }
36 | }
37 |
38 | void LData::detachValueObserver(LValueObserver *a_pObserver)
39 | {
40 | if ( m_listValueObv.contains(a_pObserver) ) {
41 | m_listValueObv.removeOne(a_pObserver);
42 | }
43 | }
44 |
45 | bool LData::pushValue(const LDataValue &a_rValue)
46 | {
47 | return m_inputBuffer.pushValue(a_rValue);
48 | }
49 |
50 | bool LData::popValue(LDataValue &a_rValue)
51 | {
52 | return m_inputBuffer.popValue(a_rValue);
53 | }
54 |
55 | void LData::notifyAllAttriObs()
56 | {
57 | QListIterator i(m_listAttriObv);
58 | while(i.hasNext()) {
59 | LAttributesObserver* pObs = i.next();
60 | pObs->updateAttributes(m_strName, m_attributes);
61 | }
62 | }
63 |
64 | void LData::attachAttriObserver(LAttributesObserver *a_pObserver)
65 | {
66 | if(!m_listAttriObv.contains(a_pObserver)) {
67 | m_listAttriObv.append(a_pObserver);
68 | }
69 | }
70 |
71 | void LData::detachAttriObserver(LAttributesObserver *a_pObserver)
72 | {
73 | if(m_listAttriObv.contains(a_pObserver)) {
74 | m_listAttriObv.removeOne(a_pObserver);
75 | }
76 | }
77 |
78 | void LData::setAttributes(const LAttributes &a_rAttributes)
79 | {
80 | m_attributes = a_rAttributes;
81 | }
82 |
83 | const LAttributes &LData::getAttributes() const
84 | {
85 | return m_attributes;
86 | }
87 |
--------------------------------------------------------------------------------
/src/modules/data/LData.h:
--------------------------------------------------------------------------------
1 | #ifndef LDATA_H
2 | #define LDATA_H
3 |
4 | #include
5 |
6 | #include "LDataBuffer.h"
7 | #include "LValueObserver.h"
8 | #include "LAttributesObserver.h"
9 |
10 |
11 | class LData
12 | {
13 | public:
14 | LData(const QString& a_rDataName);
15 | ~LData();
16 |
17 | //! Get the name of this data
18 | QString getDataName() const;
19 |
20 |
21 | //! Notify all observers with all the values this data currently buffered
22 | void notifyAllValueObs();
23 |
24 | //! Attach a value observer
25 | void attachValueObserver(LValueObserver* a_pObserver);
26 |
27 | //! Detach a value observer
28 | void detachValueObserver(LValueObserver* a_pObserver);
29 |
30 |
31 | //! Add the value to buffer, this will change the buffer
32 | bool pushValue(const LDataValue &a_rValue);
33 |
34 | //! Pop a value from buffer, this will change the buffer
35 | bool popValue(LDataValue &a_rValue);
36 |
37 |
38 | //! Notify all observers with attributes of this data
39 | void notifyAllAttriObs();
40 |
41 | //! Attach a attributes observer
42 | void attachAttriObserver(LAttributesObserver* a_pObserver);
43 |
44 | //! Detach a attributes observer
45 | void detachAttriObserver(LAttributesObserver* a_pObserver);
46 |
47 |
48 | //! set the attributes of this data
49 | void setAttributes(const LAttributes& a_rAttributes);
50 |
51 | //! get the attributes of this data
52 | const LAttributes& getAttributes() const;
53 |
54 |
55 | private:
56 | LData() {}
57 |
58 | private:
59 | QString m_strName; //!< name of data
60 |
61 | LDataBuffer m_inputBuffer; //!< buffer of this data
62 |
63 | LAttributes m_attributes; //!< attributes of this data
64 |
65 | QList m_listValueObv; //!< the target apps who need data value
66 |
67 | QList m_listAttriObv; //!< the target apps who need data attributes
68 | };
69 |
70 | #endif // LDATA_H
71 |
--------------------------------------------------------------------------------
/src/modules/data/LDataBuffer.cpp:
--------------------------------------------------------------------------------
1 | #include "LDataBuffer.h"
2 |
3 | LDataBuffer::LDataBuffer()
4 | {
5 | }
6 |
7 | LDataBuffer::~LDataBuffer()
8 | {
9 | m_queBufferQueue.clear();
10 | }
11 |
12 | bool LDataBuffer::popValue(LDataValue &a_rValue)
13 | {
14 | if (m_queBufferQueue.isEmpty())
15 | {
16 | return false;
17 | }
18 | else
19 | {
20 | a_rValue = m_queBufferQueue.dequeue();
21 | return true;
22 | }
23 | }
24 |
25 | bool LDataBuffer::pushValue(const LDataValue &a_rValue)
26 | {
27 | if (m_queBufferQueue.size() < MAX_BUFFER_SIZE)
28 | {
29 | m_queBufferQueue.enqueue(a_rValue);
30 | return true;
31 | }
32 | else
33 | {
34 | m_queBufferQueue.dequeue();
35 | m_queBufferQueue.enqueue(a_rValue);
36 | return false;
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/src/modules/data/LDataBuffer.h:
--------------------------------------------------------------------------------
1 | #ifndef LDATABUFFER_H
2 | #define LDATABUFFER_H
3 |
4 | #include
5 |
6 | #include "LDataValue.h"
7 |
8 | #define MAX_BUFFER_SIZE 1024
9 |
10 | class LDataBuffer
11 | {
12 | public:
13 | LDataBuffer();
14 |
15 | ~LDataBuffer();
16 |
17 | bool popValue(LDataValue &a_rValue);
18 |
19 | bool pushValue(const LDataValue &a_rValue);
20 |
21 | private:
22 | QQueue m_queBufferQueue;
23 | };
24 |
25 | #endif // LDATABUFFER_H
26 |
--------------------------------------------------------------------------------
/src/modules/data/LDataManager.h:
--------------------------------------------------------------------------------
1 | #ifndef LDATAMANAGER_H
2 | #define LDATAMANAGER_H
3 |
4 | // Qt headers
5 | #include
6 | #include
7 | #include
8 |
9 | // lobster headers
10 | #include "LData.h"
11 | #include "LCommon.h"
12 |
13 |
14 |
15 |
16 | class LDataManager : public QObject
17 | {
18 | Q_OBJECT
19 | public:
20 | static LDataManager* instance();
21 |
22 | static void destroy();
23 |
24 |
25 | void startActiveChannels();
26 |
27 | void pauseActiveChannels();
28 |
29 | void stopActiveChannels();
30 |
31 |
32 |
33 | void fetchAllAvailableDataNames();
34 |
35 | const QStringList& getDataNameCollection() const;
36 |
37 |
38 | void subscribeDataList(const QMap > &a_rDataList);
39 |
40 | void unsubscribeChannel(const QString &a_rChannelName);
41 |
42 |
43 | void attachValueObserver(const QString& a_rDataName, LValueObserver* a_pObserver);
44 |
45 | void detachValueObserver(const QString& a_rDataName, LValueObserver* a_pObserver);
46 |
47 |
48 | void attachAttriObserver(const QString& a_rDataName, LAttributesObserver* a_pObserver);
49 |
50 | void detachAttriObserver(const QString& a_rDataName, LAttributesObserver* a_pObserver);
51 |
52 |
53 | private:
54 | LDataManager();
55 | ~LDataManager();
56 |
57 |
58 | void subscribeDataByChannel(const QString &a_rChannelName, const QList& a_rNamesWithPrefix);
59 |
60 | private:
61 | static LDataManager *s_pInstance;
62 |
63 |
64 | QStringList m_listDataNameCollections; //!< all the name read from data source config files
65 |
66 | QMap m_mapDataList; //!< [data name][data], this is a table of all the data selected by user
67 |
68 | QList m_listExistingNames; //!< a temporary memory of existing data names
69 |
70 | bool m_bIsRunning; //!< the flag for running
71 |
72 | signals:
73 | void sendDataValue(QString a_strDataName, LDataValue a_dDataValue);
74 |
75 | void pullDataValue(QString a_strDataName);
76 |
77 | public slots:
78 | //! Get notify signal for passing received data to user by data list
79 | void getNotifySingleVar(QString a_strDataName, LDataValueList a_lstDataValue);
80 |
81 | //! Get notify signal for passing received data to user by a map of data
82 | void getNotifyMultiVar(LDataValueMap a_mapDataValue);
83 |
84 | //! Receive user-write value
85 | void receiveDataValue(QString a_strDataName, LDataValue a_dDataValue);
86 |
87 | //! Receive user-pull value
88 | void receivePullValueCmd(QString a_strDataName);
89 |
90 | //! Get notify signal for variable attributes
91 | void getNotifyVarAttributes(LAttributesMap a_mapAttributes);
92 |
93 | };
94 |
95 | #endif // LDATAMANAGER_H
96 |
--------------------------------------------------------------------------------
/src/modules/datalog/LCsvHandler.cpp:
--------------------------------------------------------------------------------
1 | #include "LCsvHandler.h"
2 |
3 | #include
4 |
5 | LCsvHandler::LCsvHandler(const QString &a_rstrFileUrl) :
6 | m_file(a_rstrFileUrl),
7 | m_textStream(&m_file)
8 | {
9 |
10 | }
11 |
12 | bool LCsvHandler::openFile()
13 | {
14 | bool res;
15 | if (!m_file.isOpen()) {
16 | if (m_file.open(QIODevice::WriteOnly) ) {
17 | res = true;
18 | }
19 | else {
20 | res = false;
21 | }
22 | }
23 | else {
24 | res = false;
25 | }
26 | return res;
27 | }
28 |
29 | void LCsvHandler::addNewLine(const QStringList &a_rstrLineContent)
30 | {
31 | QStringListIterator lineContentIterator(a_rstrLineContent);
32 | while (lineContentIterator.hasNext())
33 | {
34 | m_textStream << lineContentIterator.next();
35 | }
36 | // insert the return string
37 | m_textStream << "\n";
38 | }
39 |
40 | bool LCsvHandler::saveFile()
41 | {
42 | // Do nothing
43 | return true;
44 | }
45 |
46 | bool LCsvHandler::closeFile()
47 | {
48 | m_file.close();
49 | return true;
50 | }
51 |
52 | bool LCsvHandler::saveAs(const QString &a_rstrNewFileName)
53 | {
54 | return m_file.copy(a_rstrNewFileName);
55 | }
56 |
57 | void LCsvHandler::flush()
58 | {
59 | m_textStream.flush();
60 | }
61 |
62 | bool LCsvHandler::appendFile()
63 | {
64 | bool res;
65 | if (!m_file.isOpen()) {
66 | if (m_file.open(QIODevice::Append) ) {
67 | res = true;
68 | }
69 | else {
70 | res = false;
71 | }
72 | }
73 | else {
74 | res = false;
75 | }
76 | return res;
77 | }
78 |
79 | LCsvHandler::LCsvHandler()
80 | {
81 | }
82 |
--------------------------------------------------------------------------------
/src/modules/datalog/LCsvHandler.h:
--------------------------------------------------------------------------------
1 | #ifndef LCSVHANDLER_H
2 | #define LCSVHANDLER_H
3 |
4 | #include
5 | #include
6 | #include
7 | #include "LDataLogHangler.h"
8 |
9 | class LCsvHandler : public LDataLogHangler
10 | {
11 | public:
12 | LCsvHandler(const QString& a_rstrFileUrl);
13 |
14 | bool openFile();
15 |
16 | void addNewLine(const QStringList& a_rstrLineContent);
17 |
18 | bool saveFile();
19 |
20 | bool closeFile();
21 |
22 | bool saveAs(const QString& a_rstrNewFileName);
23 |
24 | void flush();
25 |
26 | bool appendFile();
27 |
28 | protected:
29 | LCsvHandler();
30 |
31 | protected:
32 | //!< the csv file
33 | QFile m_file;
34 |
35 | //!< the text stream operator
36 | QTextStream m_textStream;
37 |
38 | };
39 |
40 | #endif // LCSVHANDLER_H
41 |
--------------------------------------------------------------------------------
/src/modules/datalog/LDataLogHangler.h:
--------------------------------------------------------------------------------
1 | #ifndef LDATALOGHANGLER_H
2 | #define LDATALOGHANGLER_H
3 |
4 | #include
5 |
6 | class LDataLogHangler
7 | {
8 | public:
9 | LDataLogHangler() {}
10 | virtual ~LDataLogHangler() {}
11 |
12 | virtual bool openFile() = 0;
13 |
14 | virtual bool saveFile() = 0;
15 |
16 | virtual bool closeFile() = 0;
17 |
18 | virtual void addNewLine(const QStringList& a_rstrLineContent) = 0;
19 |
20 | virtual void flush() = 0;
21 |
22 | };
23 |
24 | #endif // LDATALOGHANGLER_H
25 |
--------------------------------------------------------------------------------
/src/modules/datalog/LTdmDllWrapper.cpp:
--------------------------------------------------------------------------------
1 | #include "LTdmDllWrapper.h"
2 | #include
3 |
4 | LTdmDllWrapper* LTdmDllWrapper::s_pInstance = nullptr;
5 |
6 | LTdmDllWrapper::LTdmDllWrapper()
7 | : m_library("./thirdparty/nilibddc.dll")
8 | {
9 | createFile = (DDC_CreateFile*)m_library.resolve("DDC_CreateFile");
10 | addChannelGroup = (DDC_AddChannelGroup*)m_library.resolve("DDC_AddChannelGroup");
11 | addChannel = (DDC_AddChannel*)m_library.resolve("DDC_AddChannel");
12 | saveFile = (DDC_SaveFile*)m_library.resolve("DDC_SaveFile");
13 | closeFile = (DDC_CloseFile*)m_library.resolve("DDC_CloseFile");
14 | removeChannelGroup = (DDC_RemoveChannelGroup*)m_library.resolve("DDC_RemoveChannelGroup");
15 | removeChannel = (DDC_RemoveChannel*)m_library.resolve("DDC_RemoveChannel");
16 | closeChannelGroup = (DDC_CloseChannelGroup*)m_library.resolve("DDC_CloseChannelGroup");
17 | closeChannel = (DDC_CloseChannel*)m_library.resolve("DDC_CloseChannel");
18 | setDataValues = (DDC_SetDataValues*)m_library.resolve("DDC_SetDataValues");
19 | setDataValuesTimestampComponents = (DDC_SetDataValuesTimestampComponents*)m_library.resolve("DDC_SetDataValuesTimestampComponents");
20 | appendDataValues = (DDC_AppendDataValues*)m_library.resolve("DDC_AppendDataValues");
21 | appendDataValuesTimestampComponents = (DDC_AppendDataValuesTimestampComponents*)m_library.resolve("DDC_AppendDataValuesTimestampComponents");
22 | getChannels = (DDC_GetChannels*)m_library.resolve("DDC_GetChannels");
23 | openFileEx = (DDC_OpenFileEx*)m_library.resolve("DDC_OpenFileEx");
24 | getNumChannelGroups = (DDC_GetNumChannelGroups*)m_library.resolve("DDC_GetNumChannelGroups");
25 | getChannelGroups = (DDC_GetChannelGroups*)m_library.resolve("DDC_GetChannelGroups");
26 | getChannelGroupStringPropertyLength = (DDC_GetChannelGroupStringPropertyLength*)m_library.resolve("DDC_GetChannelGroupStringPropertyLength");
27 | getChannelGroupProperty = (DDC_GetChannelGroupProperty*)m_library.resolve("DDC_GetChannelGroupProperty");
28 | getNumChannels = (DDC_GetNumChannels*)m_library.resolve("DDC_GetNumChannels");
29 | getNumDataValues = (DDC_GetNumDataValues*)m_library.resolve("DDC_GetNumDataValues");
30 | getDataValues = (DDC_GetDataValues*)m_library.resolve("DDC_GetDataValues");
31 | getDataValuesDouble = (DDC_GetDataValuesDouble*)m_library.resolve("DDC_GetDataValuesDouble");
32 | getDataValuesTimestampComponents = (DDC_GetDataValuesTimestampComponents*)m_library.resolve("DDC_GetDataValuesTimestampComponents");
33 | freeMemory = (DDC_FreeMemory*)m_library.resolve("DDC_FreeMemory");
34 |
35 | if(createFile == nullptr
36 | || addChannelGroup == nullptr
37 | || addChannel == nullptr
38 | || saveFile == nullptr
39 | || closeFile == nullptr
40 | || removeChannelGroup == nullptr
41 | || removeChannel == nullptr
42 | || closeChannelGroup == nullptr
43 | || closeChannel == nullptr
44 | || setDataValues == nullptr
45 | || setDataValuesTimestampComponents == nullptr
46 | || appendDataValues == nullptr
47 | || appendDataValuesTimestampComponents == nullptr
48 | || getChannels == nullptr
49 | || openFileEx == nullptr
50 | || getNumChannelGroups == nullptr
51 | || getChannelGroups == nullptr
52 | || getChannelGroupStringPropertyLength == nullptr
53 | || getChannelGroupProperty == nullptr
54 | || getNumChannels == nullptr
55 | || getNumDataValues == nullptr
56 | || getDataValues == nullptr
57 | || getDataValuesDouble == nullptr
58 | || getDataValuesTimestampComponents == nullptr
59 | || freeMemory == nullptr
60 | ) {
61 | QMessageBox::warning(nullptr, QObject::tr("Warning"), "Can not parse nilibddc.dll, please check whether it exists in ./thirdparty/ ");
62 | QMessageBox::warning(nullptr, QObject::tr("Warning"), m_library.errorString());
63 |
64 | exit(-1);
65 | }
66 | }
67 |
--------------------------------------------------------------------------------
/src/modules/datalog/LTdmFileHandler.h:
--------------------------------------------------------------------------------
1 | #ifndef LTDMFILEHANDLER_H
2 | #define LTDMFILEHANDLER_H
3 |
4 | #include
5 | #include "LDataLogHangler.h"
6 | #include "LTdmDllWrapper.h"
7 |
8 | class LTdmFileHandler : public LDataLogHangler
9 | {
10 | public:
11 | LTdmFileHandler();
12 |
13 | bool openFile();
14 |
15 | bool saveFile();
16 |
17 | bool closeFile();
18 |
19 | void addNewLine(const QStringList& a_rstrLineContent);
20 |
21 | void flush();
22 |
23 | private:
24 | DDCFileHandle m_fileHandle;
25 | QMap m_mapGroupHandles;
26 | };
27 |
28 | #endif // LTDMFILEHANDLER_H
29 |
--------------------------------------------------------------------------------
/src/modules/errorhandle/LErrorHandler.cpp:
--------------------------------------------------------------------------------
1 | #include "LErrorHandler.h"
2 |
3 | #include
4 |
5 | LErrorHandler* LErrorHandler::s_pInstance = NULL;
6 |
7 | LErrorHandler *LErrorHandler::instance()
8 | {
9 | // Do we have an oracle yet?
10 | if(s_pInstance == NULL) {
11 | // No, create it
12 | s_pInstance = new LErrorHandler();
13 | }
14 |
15 | // Return the instance ptr
16 | return s_pInstance;
17 | }
18 |
19 | void LErrorHandler::destroy()
20 | {
21 | // Clean up the pointer
22 | if(s_pInstance != NULL) {
23 | delete s_pInstance, s_pInstance = NULL;
24 | }
25 | }
26 |
27 | void LErrorHandler::handlePluginError(qint32 /*a_iErrorCode*/, QString a_strDescription, QString a_strSource)
28 | {
29 | QMessageBox::warning(0, QObject::tr("Warning"), "Error From " + a_strSource + ":\n\n" + a_strDescription);
30 | }
31 |
32 | LErrorHandler::LErrorHandler()
33 | {
34 | }
35 |
--------------------------------------------------------------------------------
/src/modules/errorhandle/LErrorHandler.h:
--------------------------------------------------------------------------------
1 | #ifndef LERRORHANDLER_H
2 | #define LERRORHANDLER_H
3 |
4 | #include
5 |
6 | class LErrorHandler : public QObject
7 | {
8 | Q_OBJECT
9 | public:
10 | static LErrorHandler* instance();
11 |
12 | static void destroy();
13 |
14 | public slots:
15 | void handlePluginError(qint32, QString a_strDescription, QString a_strSource);
16 |
17 | private:
18 | LErrorHandler();
19 |
20 | private:
21 | static LErrorHandler *s_pInstance;
22 | };
23 |
24 | #endif // LERRORHANDLER_H
25 |
--------------------------------------------------------------------------------
/src/modules/observer/LAttributesObserver.h:
--------------------------------------------------------------------------------
1 | #ifndef LATTRIBUTESOBSERVER_H
2 | #define LATTRIBUTESOBSERVER_H
3 |
4 | #include "LAttributes.h"
5 |
6 | class LAttributesObserver
7 | {
8 | public:
9 | LAttributesObserver() {}
10 | virtual ~LAttributesObserver() {}
11 |
12 | virtual void updateAttributes(const QString& a_rDataName, const LAttributes& a_rAttributes) = 0;
13 | };
14 |
15 | #endif // LATTRIBUTESOBSERVER_H
16 |
--------------------------------------------------------------------------------
/src/modules/observer/LValueObserver.h:
--------------------------------------------------------------------------------
1 | #ifndef LVALUEOBSERVER_H
2 | #define LVALUEOBSERVER_H
3 |
4 | #include "LDataValue.h"
5 |
6 | class LValueObserver
7 | {
8 | public:
9 | LValueObserver() {}
10 | virtual ~LValueObserver() {}
11 |
12 | virtual void updateValue(const QString& a_rDataName, const LDataValue& a_rDataValue) = 0;
13 |
14 | virtual void start() = 0;
15 |
16 | virtual void stop() = 0;
17 | };
18 |
19 | #endif // LVALUEOBSERVER_H
20 |
--------------------------------------------------------------------------------
/src/modules/playback/LLogFileParser.h:
--------------------------------------------------------------------------------
1 | #ifndef LLOGFILEPARSER_H
2 | #define LLOGFILEPARSER_H
3 |
4 | #include
5 | #include
6 | #include
7 |
8 | #include "LDataValue.h"
9 |
10 | class LLogFileParser : public QObject
11 | {
12 | Q_OBJECT
13 | public:
14 | explicit LLogFileParser(QObject *parent = nullptr);
15 |
16 | signals:
17 | void sendDataValue(QString name, LDataValue value);
18 |
19 | void sendErrors(QString errorMessage);
20 |
21 | void sendNames(QStringList valueNames);
22 |
23 | void sendProcessPercent(int percent);
24 |
25 | void sendProcessFinished();
26 |
27 | public slots:
28 | void parseFile(QString filePath);
29 | };
30 |
31 | #endif // LLOGFILEPARSER_H
32 |
--------------------------------------------------------------------------------
/src/modules/script/LApi.cpp:
--------------------------------------------------------------------------------
1 | #include "LApi.h"
2 |
3 | LApi::LApi(QObject *parent) :
4 | QObject(parent)
5 | {
6 | }
7 |
--------------------------------------------------------------------------------
/src/modules/script/LApi.h:
--------------------------------------------------------------------------------
1 | #ifndef LAPI_H
2 | #define LAPI_H
3 |
4 | #include
5 |
6 | class LApi : public QObject
7 | {
8 | Q_OBJECT
9 | public:
10 | explicit LApi(QObject *parent = 0);
11 |
12 | signals:
13 | void apiCallError(QString errorMsg);
14 |
15 | public slots:
16 |
17 | };
18 |
19 | #endif // LAPI_H
20 |
--------------------------------------------------------------------------------
/src/modules/script/LLobsterApiWrapper.cpp:
--------------------------------------------------------------------------------
1 | #include "LLobsterApiWrapper.h"
2 |
3 | LLobsterApiWrapper::LLobsterApiWrapper(QObject *parent) :
4 | QObject(parent)
5 | {
6 | m_pMainApi = new LMainApi;
7 | m_listApis.append(m_pMainApi);
8 |
9 | m_pPointApi = new LPointApi;
10 | m_listApis.append(m_pPointApi);
11 |
12 | m_pSystemApi = new LSystemApi;
13 | m_listApis.append(m_pSystemApi);
14 | }
15 |
16 | LLobsterApiWrapper::~LLobsterApiWrapper()
17 | {
18 | QListIterator it(m_listApis);
19 | while (it.hasNext()) {
20 | LApi* pLApi = it.next();
21 | if (pLApi) {
22 | delete pLApi;
23 | }
24 | }
25 | m_listApis.clear();
26 | }
27 |
28 | QList LLobsterApiWrapper::getApiList() const
29 | {
30 | return m_listApis;
31 | }
32 |
33 | LPointApi *LLobsterApiWrapper::getPointApiObj()
34 | {
35 | return m_pPointApi;
36 | }
37 |
38 | LMainApi *LLobsterApiWrapper::getMainApiObj()
39 | {
40 | return m_pMainApi;
41 | }
42 |
43 | LSystemApi *LLobsterApiWrapper::getSystemApiObj()
44 | {
45 | return m_pSystemApi;
46 | }
47 |
--------------------------------------------------------------------------------
/src/modules/script/LLobsterApiWrapper.h:
--------------------------------------------------------------------------------
1 | #ifndef LLOBSTERAPIWRAPPER_H
2 | #define LLOBSTERAPIWRAPPER_H
3 |
4 | #include
5 | #include
6 |
7 | #include "LMainApi.h"
8 | #include "LSystemApi.h"
9 | #include "LPointApi.h"
10 |
11 | class LLobsterApiWrapper : public QObject
12 | {
13 | Q_OBJECT
14 | public:
15 | explicit LLobsterApiWrapper(QObject *parent = 0);
16 | ~LLobsterApiWrapper();
17 |
18 | QList getApiList() const;
19 |
20 | LPointApi* getPointApiObj();
21 |
22 | LMainApi* getMainApiObj();
23 |
24 | LSystemApi* getSystemApiObj();
25 |
26 | signals:
27 |
28 | public slots:
29 |
30 | private:
31 | QList m_listApis;
32 |
33 | LMainApi* m_pMainApi;
34 | LPointApi* m_pPointApi;
35 | LSystemApi* m_pSystemApi;
36 | };
37 |
38 | #endif // LLOBSTERAPIWRAPPER_H
39 |
--------------------------------------------------------------------------------
/src/modules/script/LMainApi.cpp:
--------------------------------------------------------------------------------
1 | #include "LMainApi.h"
2 |
3 | LMainApi::LMainApi(QObject *parent) :
4 | LApi(parent)
5 | {
6 | }
7 |
8 | void LMainApi::startTrans()
9 | {
10 | emit sendCmd(true);
11 | }
12 |
13 | void LMainApi::stopTrans()
14 | {
15 | emit sendCmd(false);
16 | }
17 |
--------------------------------------------------------------------------------
/src/modules/script/LMainApi.h:
--------------------------------------------------------------------------------
1 | #ifndef LMAINAPI_H
2 | #define LMAINAPI_H
3 |
4 | #include "LApi.h"
5 |
6 | class LMainApi : public LApi
7 | {
8 | Q_OBJECT
9 | public:
10 | explicit LMainApi(QObject *parent = 0);
11 |
12 | signals:
13 | /// \note comand=true for start, false for stop
14 | void sendCmd(bool command);
15 |
16 | public slots:
17 | void startTrans();
18 |
19 | void stopTrans();
20 | };
21 |
22 | #endif // LMAINAPI_H
23 |
--------------------------------------------------------------------------------
/src/modules/script/LPointApi.h:
--------------------------------------------------------------------------------
1 | #ifndef LPOINTAPI_H
2 | #define LPOINTAPI_H
3 |
4 | #include "LApi.h"
5 | #include
6 | #include "LDataValue.h"
7 | #include
8 | #include
9 |
10 | class LPointApi : public LApi
11 | {
12 | Q_OBJECT
13 | public:
14 | explicit LPointApi(QObject *parent = 0);
15 |
16 | void setDataList(const QList& a_rDataList);
17 |
18 | void updateDataValue(const QString& a_rDataName, const LDataValue& a_rDataValue);
19 |
20 | signals:
21 | /// \note command=true for subscribe, false for unsubscribe
22 | void sendSubCmd(bool command, QString pointName);
23 |
24 | void sendDataValue(QString a_strDataName, LDataValue a_dDataValue);
25 |
26 | void sendCurveEnable(QString a_strDataName, bool a_bIsEnable);
27 |
28 | void sendCurveColorCmd(QString a_strDataName, QColor a_curveColor);
29 |
30 | void sendCurveGainCmd(QString a_strDataName, float a_fCurveGain);
31 |
32 | void sendCurveOffsetCmd(QString a_strDataName, float a_fCurveOffset);
33 |
34 | void sendPullValueCmd(QString a_strDataName);
35 |
36 | void sendLogEnable(QString a_strDataName, bool a_bIsEnable);
37 |
38 | public slots:
39 | void subscribe(QScriptValue a_dataName);
40 |
41 | void unsubscribe(QScriptValue a_dataName);
42 |
43 | QScriptValue getValue(QScriptValue a_dataName);
44 |
45 | void setValue(QScriptValue a_dataName, QScriptValue a_dataValue);
46 |
47 | /// \note boolString true for enable, false for disable
48 | void setCurveEnable(QScriptValue a_dataName, QScriptValue a_boolString);
49 |
50 | void setCurveColor(QScriptValue a_dataName, QScriptValue a_colorString);
51 |
52 | void setCurveGain(QScriptValue a_dataName, QScriptValue a_gain);
53 |
54 | void setCurveOffset(QScriptValue a_dataName, QScriptValue a_offset);
55 |
56 | void pullValue(QScriptValue a_dataName);
57 |
58 | void setLogEnable(QScriptValue a_dataName, QScriptValue a_boolString);
59 |
60 | private:
61 | QMap m_mapPointValues;
62 | };
63 |
64 | #endif // LPOINTAPI_H
65 |
--------------------------------------------------------------------------------
/src/modules/script/LScriptEvalWrapper.h:
--------------------------------------------------------------------------------
1 | #ifndef LSCRIPTEVALWRAPPER_H
2 | #define LSCRIPTEVALWRAPPER_H
3 |
4 | #include
5 | #include
6 | #include
7 |
8 | #include "LLobsterApiWrapper.h"
9 |
10 | class LScriptEvalWrapper : public QObject
11 | {
12 | Q_OBJECT
13 | public:
14 | explicit LScriptEvalWrapper(QObject *parent = 0);
15 |
16 | void startEvaluate(const QString& a_rstrCodes, const QString& a_rstrFileName);
17 |
18 | void debugEvaluate(const QString& a_rstrCodes, const QString& a_rstrFileName);
19 |
20 | void stopEvaluate();
21 |
22 | void setLobsterAPI(LLobsterApiWrapper* a_pLobsterObject);
23 |
24 | bool isFinished() const;
25 |
26 | signals:
27 | void reportEvalError(QString errMsg);
28 |
29 | void evalFinished();
30 |
31 | void shutDownWaiting();
32 |
33 | public slots:
34 |
35 | private:
36 | bool checkSyntax(const QString& a_rstrCodes);
37 |
38 | private:
39 | QScriptEngine m_engine;
40 |
41 | QScriptEngineDebugger m_debugger;
42 |
43 | QString m_strCodes;
44 |
45 | QString m_strFileName;
46 | };
47 |
48 | #endif // LSCRIPTEVALWRAPPER_H
49 |
--------------------------------------------------------------------------------
/src/modules/script/LSystemApi.cpp:
--------------------------------------------------------------------------------
1 | #include "LSystemApi.h"
2 |
3 | #include
4 | #include
5 | #include
6 | #include
7 |
8 | LSystemApi::LSystemApi(QObject *parent) :
9 | LApi(parent)
10 | {
11 | m_pEventloop = NULL;
12 | m_pDebugger = NULL;
13 | }
14 |
15 | void LSystemApi::setDebugger(QScriptEngineDebugger *a_pDebugger)
16 | {
17 | m_pDebugger = a_pDebugger;
18 | }
19 |
20 | void LSystemApi::wait(QScriptValue a_milliSeconds)
21 | {
22 | if (a_milliSeconds.isNumber()) {
23 | if (m_pEventloop == NULL) {
24 | m_pEventloop = new QEventLoop;
25 | }
26 | QTimer::singleShot(a_milliSeconds.toInt32(), m_pEventloop, SLOT(quit()));
27 | m_pEventloop->exec();
28 | delete m_pEventloop, m_pEventloop = NULL;
29 | }
30 | else {
31 | emit apiCallError("Error: The Function \"wait(milliSeconds)\" must take a number as argument.");
32 | }
33 | }
34 |
35 | void LSystemApi::consoleWrite(QScriptValue string)
36 | {
37 | emit sendMsg(string.toString()+"\n");
38 | }
39 |
40 | void LSystemApi::beep(QScriptValue times)
41 | {
42 | int loops = 0;
43 | if (times.isNumber()) {
44 | loops = (int)times.toNumber();
45 | }
46 | emit sendCmdBeep(loops);
47 | }
48 |
49 | void LSystemApi::say(QScriptValue content)
50 | {
51 | emit sendCmdSay(content.toString());
52 | }
53 |
54 | QScriptValue LSystemApi::absTime()
55 | {
56 | return QScriptValue(QDateTime::currentMSecsSinceEpoch()/1000.0);
57 | }
58 |
59 | void LSystemApi::pause()
60 | {
61 | if (m_pDebugger != NULL) {
62 | m_pDebugger->action(QScriptEngineDebugger::InterruptAction)->trigger();
63 | }
64 | }
65 |
66 | void LSystemApi::stopWaiting()
67 | {
68 | if (m_pEventloop != NULL) {
69 | m_pEventloop->quit();
70 | }
71 | }
72 |
--------------------------------------------------------------------------------
/src/modules/script/LSystemApi.h:
--------------------------------------------------------------------------------
1 | #ifndef LSYSTEMAPI_H
2 | #define LSYSTEMAPI_H
3 |
4 | #include "LApi.h"
5 | #include
6 | #include
7 | #include
8 |
9 | class LSystemApi : public LApi
10 | {
11 | Q_OBJECT
12 | public:
13 | explicit LSystemApi(QObject *parent = 0);
14 |
15 | void setDebugger(QScriptEngineDebugger* a_pDebugger);
16 |
17 | signals:
18 | void sendMsg(QString msg);
19 |
20 | void sendCmdBeep(int loops);
21 |
22 | void sendCmdSay(QString content);
23 |
24 | public slots:
25 | // Apis for js
26 | void wait(QScriptValue a_milliSeconds);
27 |
28 | void consoleWrite(QScriptValue string);
29 |
30 | void beep(QScriptValue times);
31 |
32 | void say(QScriptValue content);
33 |
34 | QScriptValue absTime();
35 |
36 | void pause();
37 |
38 | // slots for lobster
39 | void stopWaiting();
40 |
41 | private:
42 | QEventLoop* m_pEventloop;
43 |
44 | QScriptEngineDebugger* m_pDebugger;
45 | };
46 |
47 | #endif // LSYSTEMAPI_H
48 |
--------------------------------------------------------------------------------
/src/modules/settings/LMainSettingsMgr.cpp:
--------------------------------------------------------------------------------
1 | #include "LMainSettingsMgr.h"
2 | #include "LUniqueResource.h"
3 |
4 | LMainSettingsMgr* LMainSettingsMgr::s_pInstance = NULL;
5 |
6 | LMainSettingsMgr *LMainSettingsMgr::instance()
7 | {
8 | // Do we have an oracle yet?
9 | if(s_pInstance == NULL) {
10 | // No, create it
11 | s_pInstance = new LMainSettingsMgr();
12 | }
13 |
14 | // Return the instance ptr
15 | return s_pInstance;
16 | }
17 |
18 | void LMainSettingsMgr::destroy()
19 | {
20 | // Clean up the pointer
21 | if(s_pInstance != NULL) {
22 | delete s_pInstance, s_pInstance = NULL;
23 | }
24 | }
25 |
26 | void LMainSettingsMgr::registerToSettingsMgr(LSettingsRelier *a_pSettingsRelier)
27 | {
28 | m_settingsMgr.registerToSettingsMgr(a_pSettingsRelier);
29 | }
30 |
31 | void LMainSettingsMgr::unregisterToSettingsMgr(const QString &a_rstrRegisterName)
32 | {
33 | m_settingsMgr.unregisterToSettingsMgr(a_rstrRegisterName);
34 | }
35 |
36 | void LMainSettingsMgr::readSettingsFile()
37 | {
38 | m_settingsMgr.readSettingsFile(m_strHistoryFilePath);
39 | }
40 |
41 | void LMainSettingsMgr::writeSettingsFile()
42 | {
43 | m_settingsMgr.writeSettingsFile(m_strHistoryFilePath);
44 | }
45 |
46 | LMainSettingsMgr::LMainSettingsMgr()
47 | {
48 | m_strHistoryFilePath = PATH_ACCESSER->getPath(ePathProject, "HistoryMemory.xml");
49 | }
50 |
--------------------------------------------------------------------------------
/src/modules/settings/LMainSettingsMgr.h:
--------------------------------------------------------------------------------
1 | #ifndef LMAINSETTINGSMGR_H
2 | #define LMAINSETTINGSMGR_H
3 |
4 | #include "LSettingsMgr.h"
5 |
6 | class LMainSettingsMgr
7 | {
8 | public:
9 | static LMainSettingsMgr* instance();
10 |
11 | static void destroy();
12 |
13 |
14 | //! all the objects which need to save settings should inherit LSettingsRelier and register to this manager
15 | void registerToSettingsMgr(LSettingsRelier* a_pSettingsRelier);
16 |
17 | //! all the objects which need to save settings should inherit LSettingsRelier and register to this manager
18 | void unregisterToSettingsMgr(const QString &a_rstrRegisterName);
19 |
20 |
21 | //! read and dispatch setting tree
22 | void readSettingsFile();
23 |
24 | //! write setting tree to the xml file
25 | void writeSettingsFile();
26 |
27 | private:
28 | LMainSettingsMgr();
29 |
30 | private:
31 | static LMainSettingsMgr *s_pInstance;
32 |
33 | QString m_strHistoryFilePath;
34 |
35 | LSettingsMgr m_settingsMgr;
36 |
37 | };
38 |
39 | #endif // LMAINSETTINGSMGR_H
40 |
--------------------------------------------------------------------------------
/src/modules/settings/LPluginSettingsMgr.cpp:
--------------------------------------------------------------------------------
1 | #include "LPluginSettingsMgr.h"
2 | #include "LUniqueResource.h"
3 |
4 | LPluginSettingsMgr* LPluginSettingsMgr::s_pInstance = NULL;
5 |
6 | LPluginSettingsMgr *LPluginSettingsMgr::instance()
7 | {
8 | // Do we have an oracle yet?
9 | if(s_pInstance == NULL) {
10 | // No, create it
11 | s_pInstance = new LPluginSettingsMgr();
12 | }
13 |
14 | // Return the instance ptr
15 | return s_pInstance;
16 | }
17 |
18 | void LPluginSettingsMgr::destroy()
19 | {
20 | // Clean up the pointer
21 | if(s_pInstance != NULL) {
22 | delete s_pInstance, s_pInstance = NULL;
23 | }
24 | }
25 |
26 | void LPluginSettingsMgr::registerToSettingsMgr(LSettingsRelier *a_pSettingsRelier)
27 | {
28 | m_settingsMgr.registerToSettingsMgr(a_pSettingsRelier);
29 | }
30 |
31 | void LPluginSettingsMgr::unregisterToSettingsMgr(const QString &a_rstrRegisterName)
32 | {
33 | m_settingsMgr.unregisterToSettingsMgr(a_rstrRegisterName);
34 | }
35 |
36 | void LPluginSettingsMgr::readSettingsFile()
37 | {
38 | m_settingsMgr.readSettingsFile(m_strHistoryFilePath);
39 | }
40 |
41 | void LPluginSettingsMgr::writeSettingsFile()
42 | {
43 | m_settingsMgr.writeSettingsFile(m_strHistoryFilePath);
44 | }
45 |
46 | LPluginSettingsMgr::LPluginSettingsMgr()
47 | {
48 | m_strHistoryFilePath = PATH_ACCESSER->getPath(ePathProject, "PluginSettingsMemory.xml");
49 | }
50 |
--------------------------------------------------------------------------------
/src/modules/settings/LPluginSettingsMgr.h:
--------------------------------------------------------------------------------
1 | #ifndef LPLUGINSETTINGSMGR_H
2 | #define LPLUGINSETTINGSMGR_H
3 |
4 | #include "LSettingsMgr.h"
5 |
6 | class LPluginSettingsMgr
7 | {
8 | public:
9 | static LPluginSettingsMgr* instance();
10 |
11 | static void destroy();
12 |
13 |
14 | //! all the objects which need to save settings should inherit LSettingsRelier and register to this manager
15 | void registerToSettingsMgr(LSettingsRelier* a_pSettingsRelier);
16 |
17 | //! all the objects which need to save settings should inherit LSettingsRelier and register to this manager
18 | void unregisterToSettingsMgr(const QString &a_rstrRegisterName);
19 |
20 |
21 | //! read and dispatch setting tree
22 | void readSettingsFile();
23 |
24 | //! write setting tree to the xml file
25 | void writeSettingsFile();
26 |
27 | private:
28 | LPluginSettingsMgr();
29 |
30 | private:
31 | static LPluginSettingsMgr *s_pInstance;
32 |
33 | QString m_strHistoryFilePath;
34 |
35 | LSettingsMgr m_settingsMgr;
36 | };
37 |
38 | #endif // LPLUGINSETTINGSMGR_H
39 |
--------------------------------------------------------------------------------
/src/modules/settings/LSettingsMgr.h:
--------------------------------------------------------------------------------
1 | #ifndef LSETTINGSMGR_H
2 | #define LSETTINGSMGR_H
3 |
4 | #include
5 |
6 | #include "LSettingsRelier.h"
7 |
8 | class LSettingsMgr
9 | {
10 | public:
11 | LSettingsMgr();
12 | ~LSettingsMgr();
13 |
14 | //! all the objects which need to save settings should inherit LSettingsRelier and register to this manager
15 | void registerToSettingsMgr(LSettingsRelier* a_pSettingsRelier);
16 |
17 | //! all the objects which need to save settings should inherit LSettingsRelier and register to this manager
18 | void unregisterToSettingsMgr(const QString& a_rstrRegisterName);
19 |
20 |
21 | //! read and dispatch setting tree
22 | void readSettingsFile(const QString& a_rstrFilePath);
23 |
24 | //! write setting tree to the xml file
25 | void writeSettingsFile(const QString& a_rstrFilePath);
26 |
27 | private:
28 | QMap m_mapReliers; //!< map of all registered settings relier
29 |
30 | LTree *m_pSettingsTree; //!< tree of all settings
31 | };
32 |
33 | #endif // LSETTINGSMGR_H
34 |
--------------------------------------------------------------------------------
/src/views/channelDlg/LAddNewChannelDlg.cpp:
--------------------------------------------------------------------------------
1 | #include "LAddNewChannelDlg.h"
2 | #include "ui_LAddNewChannelDlg.h"
3 |
4 | #include
5 |
6 | LAddNewChannelDlg::LAddNewChannelDlg(QWidget *parent) :
7 | QDialog(parent),
8 | ui(new Ui::LAddNewChannelDlg)
9 | {
10 | ui->setupUi(this);
11 | }
12 |
13 | LAddNewChannelDlg::~LAddNewChannelDlg()
14 | {
15 | delete ui;
16 | }
17 |
18 | void LAddNewChannelDlg::on_buttonBox_accepted()
19 | {
20 | if ((ui->lineEditName->text() != "") && (ui->lineEditConfigPath->text() != "") && (ui->lineEditPluginPath->text() != "")) {
21 | emit sendNewChannel(ui->lineEditName->text(), ui->lineEditConfigPath->text(), ui->lineEditPluginPath->text());
22 | }
23 | else {
24 | if (ui->lineEditName->text() == "") {
25 | QMessageBox::warning(0, QObject::tr("Warning"), ui->labelName->text()+" can not be empty");
26 | }
27 | if (ui->lineEditConfigPath->text() == "") {
28 | QMessageBox::warning(0, QObject::tr("Warning"), ui->labelConfigPath->text()+" can not be empty");
29 | }
30 | if (ui->lineEditPluginPath->text() == "") {
31 | QMessageBox::warning(0, QObject::tr("Warning"), ui->lineEditPluginPath->text()+" can not be empty");
32 | }
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/src/views/channelDlg/LAddNewChannelDlg.h:
--------------------------------------------------------------------------------
1 | #ifndef LADDNEWCHANNELDLG_H
2 | #define LADDNEWCHANNELDLG_H
3 |
4 | #include
5 |
6 | namespace Ui {
7 | class LAddNewChannelDlg;
8 | }
9 |
10 | class LAddNewChannelDlg : public QDialog
11 | {
12 | Q_OBJECT
13 |
14 | public:
15 | explicit LAddNewChannelDlg(QWidget *parent = 0);
16 | ~LAddNewChannelDlg();
17 |
18 | signals:
19 | void sendNewChannel(QString a_strChannelName, QString a_strConfigPath, QString a_strPluginPath);
20 |
21 | private slots:
22 | void on_buttonBox_accepted();
23 |
24 | private:
25 | Ui::LAddNewChannelDlg *ui;
26 | };
27 |
28 | #endif // LADDNEWCHANNELDLG_H
29 |
--------------------------------------------------------------------------------
/src/views/channelDlg/LAddNewChannelDlg.ui:
--------------------------------------------------------------------------------
1 |
2 |
3 | LAddNewChannelDlg
4 |
5 |
6 |
7 | 0
8 | 0
9 | 400
10 | 178
11 |
12 |
13 |
14 | Add a new Channel
15 |
16 |
17 | -
18 |
19 |
-
20 |
21 |
22 |
23 |
24 |
25 |
26 | -
27 |
28 |
29 | -
30 |
31 |
32 | Plugin Path
33 |
34 |
35 |
36 | -
37 |
38 |
39 | Configuration Path
40 |
41 |
42 |
43 | -
44 |
45 |
46 | ./plugin/
47 |
48 |
49 |
50 | -
51 |
52 |
53 | Name
54 |
55 |
56 |
57 |
58 |
59 | -
60 |
61 |
62 | Qt::Horizontal
63 |
64 |
65 | QDialogButtonBox::Cancel|QDialogButtonBox::Ok
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 | buttonBox
75 | accepted()
76 | LAddNewChannelDlg
77 | accept()
78 |
79 |
80 | 248
81 | 254
82 |
83 |
84 | 157
85 | 274
86 |
87 |
88 |
89 |
90 | buttonBox
91 | rejected()
92 | LAddNewChannelDlg
93 | reject()
94 |
95 |
96 | 316
97 | 260
98 |
99 |
100 | 286
101 | 274
102 |
103 |
104 |
105 |
106 |
107 |
--------------------------------------------------------------------------------
/src/views/channelDlg/LChannelMgrDlg.h:
--------------------------------------------------------------------------------
1 | #ifndef LCHANNELMGRDLG_H
2 | #define LCHANNELMGRDLG_H
3 |
4 | #include
5 | #include
6 | #include
7 |
8 | namespace Ui {
9 | class LChannelMgrDlg;
10 | }
11 |
12 |
13 | struct ChannelContent {
14 | QString name;
15 | QString pluginPath;
16 | QString configPath;
17 | };
18 |
19 | typedef QMap ChannelContentMap;
20 | typedef QMapIterator ChlMapIter;
21 |
22 | class LChannelMgrDlg : public QDialog
23 | {
24 | Q_OBJECT
25 |
26 | public:
27 | explicit LChannelMgrDlg(QWidget *parent = 0);
28 | ~LChannelMgrDlg();
29 |
30 | void loadHistory(const QMap& a_rMapChannelContent);
31 |
32 | void clickOk();
33 |
34 | signals:
35 | void acceptChannel(QMap a_mapChannelContent);
36 |
37 | public slots:
38 | void getNewChannel(QString a_strName, QString a_strConfigPath, QString a_strPluginPath);
39 |
40 | private slots:
41 | void on_addChannel_clicked();
42 |
43 | void on_deleteChannel_clicked();
44 |
45 | void on_buttonBox_accepted();
46 |
47 | void on_listChannelNames_itemClicked(QListWidgetItem *item);
48 |
49 | void on_listChannelNames_itemSelectionChanged();
50 |
51 | void on_lineEditName_editingFinished();
52 |
53 | void on_lineEditConfigPath_editingFinished();
54 |
55 | void on_lineEditPluginPath_editingFinished();
56 |
57 | void on_reloadChannel_clicked();
58 |
59 | void on_reloadAllChannels_clicked();
60 |
61 | private:
62 | void refreshChannelList();
63 |
64 | //! if apply channel contents succeed, return true, else return return false
65 | bool applyChannelContent(const ChannelContentMap& a_rmapChannelContent);
66 |
67 | //! delete this channel content by user
68 | void deleteChannel(const QString& a_rstrChannelName);
69 |
70 | private:
71 | Ui::LChannelMgrDlg *ui;
72 |
73 | ChannelContentMap m_mapChannelContent; //!< a map of transmission content
74 |
75 | };
76 |
77 | #endif // LCHANNELMGRDLG_H
78 |
--------------------------------------------------------------------------------
/src/views/channelDlg/LChannelMgrDlgWrapper.h:
--------------------------------------------------------------------------------
1 | #ifndef LCHANNELMGRDLGWRAPPER_H
2 | #define LCHANNELMGRDLGWRAPPER_H
3 |
4 | #include "LChannelMgrDlg.h"
5 | #include "LSettingsRelier.h"
6 |
7 | typedef QList LDeletedChannelList;
8 |
9 |
10 | class LChannelMgrDlgWrapper : public QObject, public LSettingsRelier
11 | {
12 | Q_OBJECT
13 | public:
14 | LChannelMgrDlgWrapper();
15 | ~LChannelMgrDlgWrapper();
16 |
17 | void loadHistory();
18 |
19 |
20 | void createDialog(QWidget* parent);
21 |
22 | void execDialog();
23 |
24 |
25 | //! an external command to click ok
26 | void clickOk();
27 |
28 | signals:
29 | void sendDeletedChannels(LDeletedChannelList a_listChannelNames);
30 |
31 | public slots:
32 | void getAcceptSig(QMap a_mapChannelContent);
33 |
34 | protected:
35 | virtual void parseFromSetting(LObixTreeIter a_obixIter) Q_DECL_OVERRIDE;
36 |
37 | virtual void convertToSetting() Q_DECL_OVERRIDE;
38 |
39 | private:
40 | LChannelMgrDlg* m_pDialog;
41 |
42 | QMap m_mapChannelContent;
43 |
44 | };
45 |
46 | #endif // LCHANNELMGRDLGWRAPPER_H
47 |
--------------------------------------------------------------------------------
/src/views/controlpage/LControlPage.cpp:
--------------------------------------------------------------------------------
1 | #include "LControlPage.h"
2 | #include "ui_LControlPage.h"
3 |
4 | LControlPage::LControlPage(QWidget *parent) :
5 | QWidget(parent),
6 | ui(new Ui::LControlPage)
7 | {
8 | ui->setupUi(this);
9 | }
10 |
11 | LControlPage::~LControlPage()
12 | {
13 | delete ui;
14 | }
15 |
16 | void LControlPage::setControlPage(const QString &a_rHtmlPath)
17 | {
18 | ui->webView->load(QUrl(a_rHtmlPath));
19 | ui->webView->show();
20 | }
21 |
--------------------------------------------------------------------------------
/src/views/controlpage/LControlPage.h:
--------------------------------------------------------------------------------
1 | #ifndef LCONTROLPAGE_H
2 | #define LCONTROLPAGE_H
3 |
4 | #include
5 |
6 | namespace Ui {
7 | class LControlPage;
8 | }
9 |
10 | class LControlPage : public QWidget
11 | {
12 | Q_OBJECT
13 |
14 | public:
15 | explicit LControlPage(QWidget *parent = nullptr);
16 | ~LControlPage();
17 |
18 | void setControlPage(const QString &a_rHtmlPath);
19 |
20 | private:
21 | Ui::LControlPage *ui;
22 | };
23 |
24 | #endif // LCONTROLPAGE_H
25 |
--------------------------------------------------------------------------------
/src/views/controlpage/LControlPage.ui:
--------------------------------------------------------------------------------
1 |
2 |
3 | LControlPage
4 |
5 |
6 |
7 | 0
8 | 0
9 | 1077
10 | 644
11 |
12 |
13 |
14 | Control Page
15 |
16 |
17 | -
18 |
19 |
20 |
21 |
22 |
23 |
24 | QWebEngineView
25 | QWidget
26 |
27 | 1
28 |
29 |
30 |
31 |
32 |
33 |
--------------------------------------------------------------------------------
/src/views/datalog/LSaveLog.h:
--------------------------------------------------------------------------------
1 | #ifndef LSAVELOG_H
2 | #define LSAVELOG_H
3 |
4 | #include
5 | #include
6 |
7 | #include "LValueObserver.h"
8 | #include "LDataLogHangler.h"
9 |
10 | namespace Ui {
11 | class LSaveLog;
12 | }
13 |
14 | class LSaveLog : public QDockWidget, public LValueObserver
15 | {
16 | Q_OBJECT
17 |
18 | public:
19 | explicit LSaveLog(QWidget *parent = nullptr);
20 | virtual ~LSaveLog() Q_DECL_OVERRIDE;
21 |
22 | //! inherit from LObserver
23 | virtual void updateValue(const QString& a_rDataName, const LDataValue& a_rDataValue) Q_DECL_OVERRIDE;
24 |
25 | //! inherit from LObserver
26 | virtual void start() Q_DECL_OVERRIDE;
27 |
28 | //! inherit from LObserver
29 | virtual void stop() Q_DECL_OVERRIDE;
30 |
31 |
32 | private slots:
33 | void scanRows();
34 |
35 | void on_pushButtonStart_clicked();
36 |
37 | void on_pushButtonStop_clicked();
38 |
39 | private:
40 | Ui::LSaveLog *ui;
41 |
42 | bool m_bIsObserverStarted;
43 | bool m_bIsSaving;
44 |
45 | LDataLogHangler* m_pDataLogHandler; //!< log file handler
46 |
47 | QTimer *m_pScanTimer; //!< scan timer
48 |
49 | unsigned int m_uCurrentRowNumber; //!< current row count
50 | };
51 |
52 | #endif // LSAVELOG_H
53 |
--------------------------------------------------------------------------------
/src/views/datalog/LSaveLog.ui:
--------------------------------------------------------------------------------
1 |
2 |
3 | LSaveLog
4 |
5 |
6 |
7 | 0
8 | 0
9 | 800
10 | 401
11 |
12 |
13 |
14 |
15 | 800
16 | 160
17 |
18 |
19 |
20 | Log
21 |
22 |
23 |
24 | -
25 |
26 |
27 | false
28 |
29 |
30 | 100
31 |
32 |
33 | false
34 |
35 |
36 | false
37 |
38 |
39 |
40 | Name
41 |
42 |
43 |
44 |
45 | Value
46 |
47 |
48 |
49 |
50 | Absolute Time
51 |
52 |
53 |
54 |
55 | -
56 |
57 |
-
58 |
59 |
60 |
61 | 100
62 | 35
63 |
64 |
65 |
66 | Start saving
67 |
68 |
69 |
70 | -
71 |
72 |
73 |
74 | 100
75 | 35
76 |
77 |
78 |
79 | Stop saving
80 |
81 |
82 |
83 | -
84 |
85 |
86 | Qt::Horizontal
87 |
88 |
89 |
90 | 40
91 | 20
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
--------------------------------------------------------------------------------
/src/views/help/LHelpWidget.cpp:
--------------------------------------------------------------------------------
1 | #include "LHelpWidget.h"
2 | #include "ui_LHelpWidget.h"
3 | #include "LUniqueResource.h"
4 |
5 | LHelpWidget::LHelpWidget(QWidget *parent) :
6 | QWidget(parent),
7 | ui(new Ui::LHelpWidget)
8 | {
9 | ui->setupUi(this);
10 |
11 | // set scale
12 | QList sizeList;
13 | sizeList.append(100);
14 | sizeList.append(600);
15 | ui->splitter->setSizes(sizeList);
16 |
17 | // help content brower
18 | ui->homeButton->setIcon(QIcon(PATH_ACCESSER->getPath(ePathImage, "home.png")));
19 | ui->homeButton->adjustSize();
20 | ui->backwardButton->setIcon(QIcon(PATH_ACCESSER->getPath(ePathImage, "backward.png")));
21 | ui->backwardButton->adjustSize();
22 | ui->backwardButton->setEnabled(false);
23 | ui->forwardButton->setIcon(QIcon(PATH_ACCESSER->getPath(ePathImage, "forward.png")));
24 | ui->forwardButton->adjustSize();
25 | ui->forwardButton->setEnabled(false);
26 |
27 | connect(ui->textBrowser, &QTextBrowser::backwardAvailable, ui->backwardButton, &QPushButton::setEnabled);
28 | connect(ui->textBrowser, &QTextBrowser::forwardAvailable, ui->forwardButton, &QPushButton::setEnabled);
29 |
30 | ui->textBrowser->setSource(QUrl::fromLocalFile(PATH_ACCESSER->getPath(ePathDoc, "index.html")));
31 | }
32 |
33 | LHelpWidget::~LHelpWidget()
34 | {
35 | delete ui;
36 | }
37 |
38 | void LHelpWidget::on_homeButton_clicked()
39 | {
40 | // start all over
41 | ui->textBrowser->clearHistory();
42 | ui->backwardButton->setEnabled(false);
43 | ui->forwardButton->setEnabled(false);
44 | // set homepage
45 | ui->textBrowser->setSource(QUrl::fromLocalFile(PATH_ACCESSER->getPath(ePathDoc, "index.html")));
46 | }
47 |
48 | void LHelpWidget::on_backwardButton_clicked()
49 | {
50 | ui->textBrowser->backward();
51 | }
52 |
53 | void LHelpWidget::on_forwardButton_clicked()
54 | {
55 | ui->textBrowser->forward();
56 | }
57 |
58 | void LHelpWidget::on_listWidget_itemDoubleClicked(QListWidgetItem *item)
59 | {
60 | // start all over
61 | ui->textBrowser->clearHistory();
62 | ui->backwardButton->setEnabled(false);
63 | ui->forwardButton->setEnabled(false);
64 | // set the corresponding page
65 | ui->textBrowser->setSource(QUrl::fromLocalFile(PATH_ACCESSER->getPath(ePathDoc, item->text() + ".html")));
66 | }
67 |
--------------------------------------------------------------------------------
/src/views/help/LHelpWidget.h:
--------------------------------------------------------------------------------
1 | #ifndef LHELPWIDGET_H
2 | #define LHELPWIDGET_H
3 |
4 | #include
5 | #include
6 |
7 | namespace Ui {
8 | class LHelpWidget;
9 | }
10 |
11 | class LHelpWidget : public QWidget
12 | {
13 | Q_OBJECT
14 |
15 | public:
16 | explicit LHelpWidget(QWidget *parent = 0);
17 | ~LHelpWidget();
18 |
19 | private slots:
20 | void on_homeButton_clicked();
21 |
22 | void on_backwardButton_clicked();
23 |
24 | void on_forwardButton_clicked();
25 |
26 | void on_listWidget_itemDoubleClicked(QListWidgetItem *item);
27 |
28 | private:
29 | Ui::LHelpWidget *ui;
30 | };
31 |
32 | #endif // LHELPWIDGET_H
33 |
--------------------------------------------------------------------------------
/src/views/help/LHelpWidget.ui:
--------------------------------------------------------------------------------
1 |
2 |
3 | LHelpWidget
4 |
5 |
6 |
7 | 0
8 | 0
9 | 978
10 | 600
11 |
12 |
13 |
14 | Lobster Help
15 |
16 |
17 | -
18 |
19 |
20 | Qt::Horizontal
21 |
22 |
23 |
24 | 0
25 |
26 |
27 |
28 | contents
29 |
30 |
31 |
-
32 |
33 |
-
34 |
35 | index
36 |
37 |
38 | -
39 |
40 | script
41 |
42 |
43 | -
44 |
45 | plugins
46 |
47 |
48 | -
49 |
50 | mainwindow
51 |
52 |
53 | -
54 |
55 | oscilloscope
56 |
57 |
58 | -
59 |
60 | watchwindow
61 |
62 |
63 | -
64 |
65 | logsystem
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 | Qt::Horizontal
102 |
103 |
104 |
105 | 40
106 | 20
107 |
108 |
109 |
110 |
111 |
112 |
113 | -
114 |
115 |
116 |
117 |
118 |
119 |
120 |
121 |
122 |
123 |
124 |
125 |
--------------------------------------------------------------------------------
/src/views/mainwindow/LMainWindow.h:
--------------------------------------------------------------------------------
1 | #ifndef LMAINWINDOW_H
2 | #define LMAINWINDOW_H
3 |
4 | #include
5 | #include
6 | #include
7 |
8 |
9 | #include "LWatchWindow.h"
10 | #include "LOscilloscope.h"
11 | #include "LSaveLog.h"
12 | #include "LSelectDataDlgWrapper.h"
13 | #include "LChannelMgrDlgWrapper.h"
14 | #include "LSettingsTabDialog.h"
15 | #include "LPluginSettingsMgr.h"
16 | #include "SMainWindow.h"
17 | #include "LHelpWidget.h"
18 | #include "LControlPage.h"
19 | #include "LPlaybackWidget.h"
20 |
21 | namespace Ui {
22 | class LMainWindow;
23 | }
24 |
25 | class LMainWindow : public QMainWindow
26 | {
27 | Q_OBJECT
28 |
29 | public:
30 | explicit LMainWindow(QWidget *parent = 0);
31 | ~LMainWindow();
32 |
33 | void handlePlayerState();
34 |
35 | protected:
36 | virtual void closeEvent(QCloseEvent *event);
37 |
38 | public slots:
39 | void receiveScopeEnableState(QString name, bool state);
40 |
41 | void receiveCurveColor(QString name, QColor curveColor);
42 | void receiveCurveSelected(QString name, bool selected);
43 | void receiveMergeValueAxis(QList names);
44 | void receiveDemergeValueAxis(QList names);
45 |
46 | void receiveLogEnableState(QString name, bool state);
47 |
48 | void receiveDeletedChannels(LDeletedChannelList a_listChannelNames);
49 |
50 | void handleMainApiCmd(bool command);
51 |
52 | void handlePointApiCmd(bool command, QString pointName);
53 |
54 | private slots:
55 | void playPauseAllChannels();
56 |
57 | void stopRunAllChannels();
58 |
59 | void openAllSettingsWindow();
60 |
61 | void openToolWindow();
62 |
63 | void openScriptIde();
64 |
65 | void openPlaybackWindow();
66 |
67 | void openControlPage();
68 |
69 |
70 | void on_actionSelect_Data_triggered();
71 |
72 | void on_actionManager_triggered();
73 |
74 | void on_actionContents_triggered();
75 |
76 | void on_actionAbout_triggered();
77 |
78 | void on_actionSave_Project_triggered();
79 |
80 | private:
81 | void initialize();
82 |
83 | void createToolBar();
84 |
85 | void createMenu();
86 |
87 | void popSelectDataDlg();
88 |
89 | void popChannelMgrDlg();
90 |
91 | void createSettingTabWidget();
92 |
93 | void addToolWidget();
94 |
95 |
96 | void readWindowsSettings();
97 |
98 | void writeWindowsSettings();
99 |
100 | void acceptSelection(QList a_listNames);
101 |
102 |
103 | private:
104 | Ui::LMainWindow *ui;
105 |
106 | enum PlayerState {
107 | play,
108 | pause,
109 | stop
110 | };
111 |
112 | PlayerState m_channelState;
113 |
114 | // toolbar
115 | QToolButton* m_pStopButton;
116 | QToolButton* m_pRunButton;
117 | QToolButton* m_pConfigButton;
118 |
119 | // observer
120 | LWatchWindow* m_pWatchWindow;
121 | LOscilloscope* m_pOscilloscope;
122 | LSaveLog* m_pLog;
123 |
124 | // dialog wrappers
125 | LSelectDataDlgWrapper* m_pSelectDataDlgWrapper;
126 | LChannelMgrDlgWrapper* m_pChannelMgrDlgWrapper;
127 | LSettingsTabDialog* m_pSettingTabWidget;
128 |
129 | // script related
130 | SMainWindow* m_pSMainWindow;
131 |
132 | // Playback window
133 | LPlaybackWidget *m_pPlaybackWidget;
134 |
135 | // Control page
136 | LControlPage *m_pControlPage;
137 |
138 | // help contents widget
139 | LHelpWidget* m_pHelpWidget;
140 | };
141 |
142 | #endif // LMAINWINDOW_H
143 |
--------------------------------------------------------------------------------
/src/views/mainwindow/LMainWindow.ui:
--------------------------------------------------------------------------------
1 |
2 |
3 | LMainWindow
4 |
5 |
6 |
7 | 0
8 | 0
9 | 1024
10 | 768
11 |
12 |
13 |
14 |
15 | 微软雅黑
16 |
17 |
18 |
19 | Lobster
20 |
21 |
22 |
71 |
72 |
73 |
74 | toolBar
75 |
76 |
77 |
78 | 32
79 | 32
80 |
81 |
82 |
83 | TopToolBarArea
84 |
85 |
86 | false
87 |
88 |
89 |
90 |
91 | Select Data
92 |
93 |
94 |
95 |
96 | Channel Manager
97 |
98 |
99 |
100 |
101 | Contents
102 |
103 |
104 |
105 |
106 | About
107 |
108 |
109 |
110 |
111 | Save Project
112 |
113 |
114 |
115 |
116 |
117 |
118 |
--------------------------------------------------------------------------------
/src/views/mainwindow/LSelectProjectDialog.cpp:
--------------------------------------------------------------------------------
1 | #include "LSelectProjectDialog.h"
2 | #include "ui_LSelectProjectDialog.h"
3 |
4 | #include
5 |
6 | LSelectProjectDialog::LSelectProjectDialog(QWidget *parent) :
7 | QDialog(parent),
8 | ui(new Ui::LSelectProjectDialog)
9 | {
10 | ui->setupUi(this);
11 | }
12 |
13 | LSelectProjectDialog::~LSelectProjectDialog()
14 | {
15 | delete ui;
16 | }
17 |
18 | QString LSelectProjectDialog::getProjectPath() const
19 | {
20 | return ui->filePathEdit->text();
21 | }
22 |
23 | void LSelectProjectDialog::on_browseButton_clicked()
24 | {
25 | QString dir = QFileDialog::getExistingDirectory(this,
26 | tr("Open Directory"),
27 | tr("./projects"),
28 | QFileDialog::ShowDirsOnly | QFileDialog::DontResolveSymlinks);
29 | ui->filePathEdit->setText(dir);
30 | }
31 |
--------------------------------------------------------------------------------
/src/views/mainwindow/LSelectProjectDialog.h:
--------------------------------------------------------------------------------
1 | #ifndef LSELECTPROJECTDIALOG_H
2 | #define LSELECTPROJECTDIALOG_H
3 |
4 | #include
5 |
6 | namespace Ui {
7 | class LSelectProjectDialog;
8 | }
9 |
10 | class LSelectProjectDialog : public QDialog
11 | {
12 | Q_OBJECT
13 |
14 | public:
15 | explicit LSelectProjectDialog(QWidget *parent = nullptr);
16 | ~LSelectProjectDialog();
17 |
18 | QString getProjectPath() const;
19 |
20 | private slots:
21 | void on_browseButton_clicked();
22 |
23 | private:
24 | Ui::LSelectProjectDialog *ui;
25 | };
26 |
27 | #endif // LSELECTPROJECTDIALOG_H
28 |
--------------------------------------------------------------------------------
/src/views/mainwindow/LSelectProjectDialog.ui:
--------------------------------------------------------------------------------
1 |
2 |
3 | LSelectProjectDialog
4 |
5 |
6 |
7 | 0
8 | 0
9 | 504
10 | 186
11 |
12 |
13 |
14 |
15 | 微软雅黑
16 |
17 |
18 |
19 | Dialog
20 |
21 |
22 | -
23 |
24 |
-
25 |
26 |
27 |
28 | 11
29 |
30 |
31 |
32 | Please select project file
33 |
34 |
35 |
36 | -
37 |
38 |
-
39 |
40 |
41 | -
42 |
43 |
44 | Browse
45 |
46 |
47 |
48 |
49 |
50 | -
51 |
52 |
53 | Qt::Vertical
54 |
55 |
56 |
57 | 20
58 | 40
59 |
60 |
61 |
62 |
63 |
64 |
65 | -
66 |
67 |
68 | Qt::Horizontal
69 |
70 |
71 | QDialogButtonBox::Cancel|QDialogButtonBox::Ok
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 | buttonBox
81 | accepted()
82 | LSelectProjectDialog
83 | accept()
84 |
85 |
86 | 248
87 | 254
88 |
89 |
90 | 157
91 | 274
92 |
93 |
94 |
95 |
96 | buttonBox
97 | rejected()
98 | LSelectProjectDialog
99 | reject()
100 |
101 |
102 | 316
103 | 260
104 |
105 |
106 | 286
107 | 274
108 |
109 |
110 |
111 |
112 |
113 |
--------------------------------------------------------------------------------
/src/views/oscilloscope/LCursor.cpp:
--------------------------------------------------------------------------------
1 | #include "LCursor.h"
2 |
3 | LCursor::LCursor(QCustomPlot *parentPlot)
4 | : QCPItemStraightLine(parentPlot)
5 | {
6 |
7 | }
8 |
9 |
10 |
--------------------------------------------------------------------------------
/src/views/oscilloscope/LCursor.h:
--------------------------------------------------------------------------------
1 | #ifndef LCURSOR_H
2 | #define LCURSOR_H
3 |
4 | #include "qcustomplot.h"
5 |
6 | class LCursor : public QCPItemStraightLine
7 | {
8 | Q_OBJECT
9 | public:
10 | enum Status
11 | {
12 | ePressed,
13 | eReleased,
14 | };
15 |
16 | public:
17 | explicit LCursor(QCustomPlot *parentPlot);
18 |
19 | void setStatus(Status a_eStatus)
20 | {
21 | m_eStatus = a_eStatus;
22 | }
23 |
24 | Status getStatus() const
25 | {
26 | return m_eStatus;
27 | }
28 |
29 | signals:
30 |
31 | private:
32 | Status m_eStatus;
33 | };
34 |
35 | #endif // LCURSOR_H
36 |
--------------------------------------------------------------------------------
/src/views/oscilloscope/LCurve.cpp:
--------------------------------------------------------------------------------
1 | #include "LCurve.h"
2 |
3 | LCurve::LCurve(QCPAxis *keyAxis, QCPAxis *valueAxis)
4 | {
5 | m_pLine = new QCPGraph(keyAxis, valueAxis);
6 | connect(m_pLine, SIGNAL(selectionChanged(bool)), this, SLOT(receiveCurveSelected(bool)));
7 | }
8 |
9 | LCurve::~LCurve()
10 | {
11 | //! \note No need to delete m_pLine, its ownership belongs to QCustomPlot instance
12 | }
13 |
14 | void LCurve::setName(const QString &a_rName)
15 | {
16 | m_pLine->setName(a_rName);
17 | }
18 |
19 | QString LCurve::getName() const
20 | {
21 | return m_pLine->name();
22 | }
23 |
24 | void LCurve::addPoint(const QPointF &a_rPoint)
25 | {
26 | m_pLine->addData(a_rPoint.x(), a_rPoint.y());
27 | }
28 |
29 | void LCurve::clear()
30 | {
31 | m_pLine->setData(QVector(), QVector());
32 | }
33 |
34 | void LCurve::setColor(const QColor& a_rColor)
35 | {
36 | QPen pen = m_pLine->pen();
37 | pen.setColor(a_rColor);
38 | m_pLine->setPen(pen);
39 | #if 0
40 | pen = m_pLine->keyAxis()->basePen();
41 | pen.setColor(a_rColor);
42 | m_pLine->valueAxis()->setBasePen(pen);
43 | pen = m_pLine->keyAxis()->tickPen();
44 | pen.setColor(a_rColor);
45 | m_pLine->valueAxis()->setTickPen(pen);
46 | pen = m_pLine->keyAxis()->subTickPen();
47 | pen.setColor(a_rColor);
48 | m_pLine->valueAxis()->setSubTickPen(pen);
49 | #endif
50 | }
51 |
52 | void LCurve::setPenStyle(const Qt::PenStyle &a_rPenStyle)
53 | {
54 | QPen pen = m_pLine->pen();
55 | if(pen.style() != a_rPenStyle) {
56 | pen.setStyle(a_rPenStyle);
57 | m_pLine->setPen(pen);
58 | }
59 | }
60 |
61 | void LCurve::setSelected(bool a_bSelected)
62 | {
63 | if(a_bSelected) {
64 | QCPDataRange range;
65 | // Select the last 2 points
66 | if(m_pLine->data()->size() >= 2) {
67 | range.setEnd(m_pLine->data()->size()-1);
68 | range.setBegin(m_pLine->data()->size()-2);
69 | }
70 | m_pLine->setSelection(QCPDataSelection(range));
71 | }
72 | else {
73 | m_pLine->setSelection(QCPDataSelection());
74 | }
75 | }
76 |
77 | void LCurve::receiveCurveSelected(bool a_bSelected)
78 | {
79 | emit sendCurveSelected(a_bSelected);
80 | }
81 |
--------------------------------------------------------------------------------
/src/views/oscilloscope/LCurve.h:
--------------------------------------------------------------------------------
1 | #ifndef LCURVE_H
2 | #define LCURVE_H
3 |
4 | #include
5 | #include
6 | #include
7 | #include
8 |
9 | #include "qcustomplot.h"
10 |
11 |
12 | class LCurve : public QObject
13 | {
14 | Q_OBJECT
15 | public:
16 | LCurve(QCPAxis *keyAxis, QCPAxis *valueAxis);
17 | virtual ~LCurve();
18 |
19 | // name
20 | void setName(const QString& a_rName);
21 | QString getName() const;
22 |
23 | //! add point to current twisted line
24 | void addPoint(const QPointF& a_rPoint);
25 |
26 | //! clear all points of all lines
27 | void clear();
28 |
29 | //! Set the color of this curve
30 | void setColor(const QColor& a_rColor);
31 |
32 | void setPenStyle(const Qt::PenStyle &a_rPenStyle);
33 |
34 | void setSelected(bool a_bSelected);
35 |
36 | QCPAxis* getXAxis() {return m_pLine->keyAxis();}
37 |
38 | QCPAxis* getYAxis() {return m_pLine->valueAxis();}
39 |
40 |
41 | QCPRange getXRange(bool & foundRange) {return m_pLine->getKeyRange(foundRange);}
42 |
43 | QCPRange getYRange(bool & foundRange) {return m_pLine->getValueRange(foundRange);}
44 |
45 | QCPGraph* getLine() {return m_pLine;}
46 |
47 |
48 | signals:
49 | void sendCurveSelected(bool selected);
50 |
51 |
52 | private:
53 | LCurve() {}
54 |
55 | private slots:
56 | void receiveCurveSelected(bool a_bSelected);
57 |
58 | private:
59 | QCPGraph *m_pLine;
60 | };
61 |
62 | #endif // LCURVE_H
63 |
--------------------------------------------------------------------------------
/src/views/oscilloscope/LLogSpinBox.cpp:
--------------------------------------------------------------------------------
1 | #include
2 | #include "cmath"
3 |
4 | #include "LLogSpinBox.h"
5 |
6 | // low limit should be pow(10,x)
7 | #define LOW_LIMIT 0.1
8 |
9 | LLogSpinBox::LLogSpinBox(QWidget *parent) :
10 | QDoubleSpinBox(parent)
11 | {
12 | setButtonSymbols(QAbstractSpinBox::NoButtons);
13 | setSuffix(" s");
14 | setMinimum(LOW_LIMIT);
15 | // init it with the min value
16 | setValue(LOW_LIMIT);
17 | m_dOutputValue = minimum();
18 | }
19 |
20 | void LLogSpinBox::keyPressEvent(QKeyEvent *event)
21 | {
22 | if (event->key() == Qt::Key_Up)
23 | {
24 | increaseNum();
25 | }
26 | else if(event->key() == Qt::Key_Down)
27 | {
28 | decreaseNum();
29 | }
30 |
31 | this->setValue(m_dOutputValue);
32 | }
33 |
34 | void LLogSpinBox::wheelEvent(QWheelEvent *event)
35 | {
36 | if (event->delta() > 0)
37 | {
38 | increaseNum();
39 | }
40 | else if (event->delta() < 0)
41 | {
42 | decreaseNum();
43 | }
44 |
45 | this->setValue(m_dOutputValue);
46 | }
47 |
48 | void LLogSpinBox::increaseNum()
49 | {
50 | double dValue = this->value();
51 | int iPower = (int)floor(log10(dValue));
52 | int iNumber = (int)(dValue/pow(10.0,iPower));
53 | switch(iNumber) {
54 | case 1:
55 | m_dOutputValue = pow(10.0,iPower) * 2;
56 | break;
57 | case 2:
58 | m_dOutputValue = pow(10.0,iPower) * 5;
59 | break;
60 | case 5:
61 | m_dOutputValue = pow(10.0,iPower+1);
62 | break;
63 | default:
64 | // can not reach here
65 | break;
66 | }
67 |
68 | if (m_dOutputValue < minimum()) {
69 | m_dOutputValue = minimum();
70 | }
71 | }
72 |
73 | void LLogSpinBox::decreaseNum()
74 | {
75 | double dValue = this->value();
76 | int iPower = (int)floor(log10(dValue));
77 | int iNumber = (int)(dValue/pow(10.0,iPower));
78 | switch(iNumber) {
79 | case 1:
80 | m_dOutputValue = pow(10.0,iPower-1) * 5;
81 | break;
82 | case 2:
83 | m_dOutputValue = pow(10.0,iPower);
84 | break;
85 | case 5:
86 | m_dOutputValue = pow(10.0,iPower) * 2;
87 | break;
88 | default:
89 | // can not reach here
90 | break;
91 | }
92 |
93 | if (m_dOutputValue < minimum()) {
94 | m_dOutputValue = minimum();
95 | }
96 | }
97 |
98 | void LLogSpinBox::setNum(double value)
99 | {
100 | if (value < minimum()) {
101 | m_dOutputValue = minimum();
102 | }
103 | else {
104 | int iPower = (int)floor(log10(value));
105 | double dNumber = (value/pow(10.0,iPower));
106 | if (dNumber!=1 && dNumber!=2 && dNumber!=5) {
107 | // In case the value is changed manully
108 | // Normally this will not happen
109 | if (dNumber < 1) {
110 | m_dOutputValue = pow(10.0,iPower-1) * 5;
111 | }
112 | else if (dNumber < 2) {
113 | m_dOutputValue = pow(10.0,iPower);
114 | }
115 | else if (dNumber < 5) {
116 | m_dOutputValue = pow(10.0,iPower) * 2;
117 | }
118 | else {
119 | m_dOutputValue = pow(10.0,iPower) * 5;
120 | }
121 | }
122 | else {
123 | m_dOutputValue = value;
124 | }
125 | }
126 | this->setValue(m_dOutputValue);
127 | }
128 |
--------------------------------------------------------------------------------
/src/views/oscilloscope/LLogSpinBox.h:
--------------------------------------------------------------------------------
1 | #ifndef LLOGSPINBOX_H
2 | #define LLOGSPINBOX_H
3 |
4 | #include
5 |
6 | class LLogSpinBox : public QDoubleSpinBox
7 | {
8 | Q_OBJECT
9 | public:
10 | explicit LLogSpinBox(QWidget *parent = 0);
11 |
12 | void setNum(double value);
13 |
14 | signals:
15 |
16 | public slots:
17 |
18 | protected:
19 | void keyPressEvent(QKeyEvent *event);
20 | void wheelEvent(QWheelEvent * event);
21 |
22 | void increaseNum();
23 |
24 | void decreaseNum();
25 |
26 | double m_dOutputValue;
27 | };
28 |
29 | #endif // LLOGSPINBOX_H
30 |
--------------------------------------------------------------------------------
/src/views/oscilloscope/LOscilloscope.cpp:
--------------------------------------------------------------------------------
1 | #include "LOscilloscope.h"
2 | #include "ui_LOscilloscope.h"
3 |
4 | #include
5 |
6 | #include "LMainSettingsMgr.h"
7 |
8 |
9 | LOscilloscope::LOscilloscope(QWidget *parent) :
10 | QDockWidget(parent),
11 | ui(new Ui::LOscilloscope)
12 | {
13 | ui->setupUi(this);
14 |
15 | // connect signals
16 | connect(ui->menu, &LScopeMenu::sendShowCursor, ui->scope, &LPlotter::showCursor);
17 | connect(ui->menu, &LScopeMenu::sendShowGrid, ui->scope, &LPlotter::showGrid);
18 | connect(ui->scope, &LPlotter::sendCursorInfo, ui->menu, &LScopeMenu::receiveCursorInfo);
19 |
20 | // settings
21 | LSettingsRelier* pSettingsRelier = ui->menu;
22 | LMainSettingsMgr::instance()->registerToSettingsMgr(pSettingsRelier);
23 |
24 | m_bIsStarted = false;
25 | }
26 |
27 | LOscilloscope::~LOscilloscope()
28 | {
29 | delete ui;
30 | }
31 |
32 | void LOscilloscope::updateValue(const QString& a_rDataName, const LDataValue& a_rDataValue)
33 | {
34 | if(m_bIsStarted) {
35 | #if 0
36 | if(m_iScopeStartTime == -1) {
37 | m_iScopeStartTime = a_rDataValue.getAbsTime();
38 | }
39 | m_dCurrentXTime = (double(a_rDataValue.getAbsTime() - m_iScopeStartTime))/1000.0;
40 |
41 | // if x-axis is full, restart at the beginning
42 | if (m_dCurrentXTime >= ui->scope->getMaxX()) {
43 | // this indicate a whole new original point
44 | m_dCurrentXTime = 0;
45 | m_iScopeStartTime = a_rDataValue.getAbsTime();
46 | ui->scope->clearAllCurvePoints();
47 | }
48 | #else
49 | if(m_iScopeStartTime == -1) {
50 | m_iScopeStartTime = a_rDataValue.getAbsTime();
51 | }
52 |
53 | double dElapsedTime = (double(a_rDataValue.getAbsTime() - m_iScopeStartTime))/1000.0;
54 | if (dElapsedTime >= ui->scope->getMaxX()) {
55 | ui->scope->setMaxX(dElapsedTime);
56 | }
57 |
58 | #endif
59 | // We can only display valid values
60 | if (a_rDataValue.getStatus() == LDataValue::eAvailable) {
61 | // insert the current value
62 | ui->scope->addCurvePoint(a_rDataName, QPointF(dElapsedTime , a_rDataValue.getValue()));
63 | }
64 | }
65 | }
66 |
67 | void LOscilloscope::start()
68 | {
69 | // clear all first
70 | ui->scope->clearAllCurvePoints();
71 |
72 | m_bIsStarted = true;
73 | #if 1
74 | m_iScopeStartTime = -1;
75 | #else
76 | m_iScopeStartTime = QDateTime::currentMSecsSinceEpoch();
77 | #endif
78 | ui->scope->startRefresh(true);
79 | }
80 |
81 | void LOscilloscope::stop()
82 | {
83 | m_bIsStarted = false;
84 | ui->scope->startRefresh(false);
85 | }
86 |
87 | void LOscilloscope::addNewCurve(const QString &a_rDataName)
88 | {
89 | ui->scope->addNewCurve(a_rDataName);
90 | // set the curve to be solid
91 | ui->scope->setCurveStyle(a_rDataName, Qt::SolidLine);
92 |
93 | }
94 |
95 | void LOscilloscope::eraseCurve(const QString& a_rDataName)
96 | {
97 | ui->scope->deleteCurve(a_rDataName);
98 | }
99 |
100 | void LOscilloscope::setCurveColor(const QString &a_rName, const QColor &a_rColor)
101 | {
102 | ui->scope->setCurveColor(a_rName, a_rColor);
103 | }
104 |
105 | void LOscilloscope::setCurveSelected(const QString &a_rName, bool a_bSelected)
106 | {
107 | ui->scope->setCurveSelected(a_rName, a_bSelected);
108 | }
109 |
110 | void LOscilloscope::mergeValueAxis(QList a_listMergedName)
111 | {
112 | ui->scope->mergeValueAxis(a_listMergedName);
113 | }
114 |
115 | void LOscilloscope::demergeValueAxis(QList a_listName)
116 | {
117 | ui->scope->demergeValueAxis(a_listName);
118 | }
119 |
120 | void LOscilloscope::setCurveYGain(const QString &a_rName, float a_fCurveYGain)
121 | {
122 | ui->scope->setCurveYGain(a_rName, a_fCurveYGain);
123 | }
124 |
125 | void LOscilloscope::setCurveYOffset(const QString &a_rName, float a_fCurveYOffset)
126 | {
127 | ui->scope->setCurveYOffset(a_rName, a_fCurveYOffset);
128 | }
129 |
--------------------------------------------------------------------------------
/src/views/oscilloscope/LOscilloscope.h:
--------------------------------------------------------------------------------
1 | #ifndef LOSCILLOSCOPE_H
2 | #define LOSCILLOSCOPE_H
3 |
4 | #include
5 |
6 | #include "LValueObserver.h"
7 |
8 | #include "LPlotter.h"
9 | #include "LScopeMenu.h"
10 |
11 | namespace Ui {
12 | class LOscilloscope;
13 | }
14 |
15 | class LOscilloscope : public QDockWidget, public LValueObserver
16 | {
17 | Q_OBJECT
18 |
19 | public:
20 | explicit LOscilloscope(QWidget *parent = 0);
21 | ~LOscilloscope();
22 |
23 |
24 | //! inherit from LObserver
25 | virtual void updateValue(const QString& a_rDataName, const LDataValue& a_rDataValue) Q_DECL_OVERRIDE;
26 |
27 | //! inherit from LObserver
28 | virtual void start() Q_DECL_OVERRIDE;
29 |
30 | //! inherit from LObserver
31 | virtual void stop() Q_DECL_OVERRIDE;
32 |
33 |
34 | void addNewCurve(const QString& a_rDataName);
35 |
36 | void eraseCurve(const QString& a_rDataName);
37 |
38 |
39 | void setCurveColor(const QString &a_rName, const QColor &a_rColor);
40 |
41 | void setCurveSelected(const QString &a_rName, bool a_bSelected);
42 |
43 | void mergeValueAxis(QList a_listMergedName);
44 |
45 | void demergeValueAxis(QList a_listName);
46 |
47 | void setCurveYGain(const QString &a_rName, float a_fCurveYGain);
48 |
49 | void setCurveYOffset(const QString &a_rName, float a_fCurveYOffset);
50 |
51 | signals:
52 | void curveSelected();
53 |
54 | private:
55 | Ui::LOscilloscope *ui;
56 |
57 | qint64 m_iScopeStartTime;
58 |
59 | bool m_bIsStarted;
60 | };
61 |
62 | #endif // LOSCILLOSCOPE_H
63 |
--------------------------------------------------------------------------------
/src/views/oscilloscope/LOscilloscope.ui:
--------------------------------------------------------------------------------
1 |
2 |
3 | LOscilloscope
4 |
5 |
6 |
7 | 0
8 | 0
9 | 771
10 | 460
11 |
12 |
13 |
14 | Oscilloscope
15 |
16 |
17 |
18 | -
19 |
20 |
21 | Qt::Horizontal
22 |
23 |
24 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 | LPlotter
52 | QWidget
53 |
54 | 1
55 |
56 |
57 | LScopeMenu
58 | QWidget
59 |
60 | 1
61 |
62 |
63 |
64 |
65 |
66 |
--------------------------------------------------------------------------------
/src/views/oscilloscope/LPlotSettings.cpp:
--------------------------------------------------------------------------------
1 | #include
2 |
3 | #include "LPlotSettings.h"
4 |
5 |
6 | ////////////////////////////////////////////////////////////
7 | LPlotSettings::LPlotSettings()
8 | {
9 | minX = 0.0;
10 | maxX = 10.0;
11 | numXTicks = 5;
12 | minY = 0.0;
13 | maxY = 10.0;
14 | numYTicks = 5;
15 | }
16 |
17 | void LPlotSettings::scroll(int dx, int dy)
18 | {
19 | double stepX = spanX() / numXTicks;
20 | minX += dx * stepX;
21 | maxX += dx * stepX;
22 | double stepY = spanY() / numYTicks;
23 | minY += dy * stepY;
24 | maxY += dy * stepY;
25 | }
26 |
27 | void LPlotSettings::adjust()
28 | {
29 | adjustAxis(minX, maxX, numXTicks);
30 | adjustAxis(minY, maxY, numYTicks);
31 | }
32 |
33 | void LPlotSettings::adjustAxis(double &min, double &max,
34 | int &numTicks)
35 | {
36 | const int MinTicks = 4;
37 | double grossStep = (max - min) / MinTicks;
38 | double step = pow(10.0, floor(log10(grossStep)));
39 | if (5 * step < grossStep) {
40 | step *= 5;
41 | } else if (2 * step < grossStep) {
42 | step *= 2;
43 | }
44 | numTicks = int(ceil(max / step) - floor(min / step));
45 | if (numTicks < MinTicks)
46 | numTicks = MinTicks;
47 | min = floor(min / step) * step;
48 | max = ceil(max / step) * step;
49 | }
50 |
--------------------------------------------------------------------------------
/src/views/oscilloscope/LPlotSettings.h:
--------------------------------------------------------------------------------
1 | #ifndef LPLOTSETTINGS_H
2 | #define LPLOTSETTINGS_H
3 |
4 | #include
5 |
6 | class LPlotter;
7 |
8 |
9 | //PlotSettings determines the range of x and y, and number of scales
10 | class LPlotSettings
11 | {
12 | friend class LPlotter;
13 |
14 | public:
15 | LPlotSettings();
16 |
17 | private:
18 | static void adjustAxis(qreal &min, qreal &max, int &numTicks);
19 |
20 | void scroll(int dx, int dy);
21 | void adjust();
22 | qreal spanX() const { return maxX - minX; }
23 | qreal spanY() const { return maxY - minY; }
24 |
25 | qreal minX;
26 | qreal maxX;
27 | int numXTicks;
28 | qreal minY;
29 | qreal maxY;
30 | int numYTicks;
31 | };
32 |
33 | #endif // LPLOTSETTINGS_H
34 |
--------------------------------------------------------------------------------
/src/views/oscilloscope/LPlotter.h:
--------------------------------------------------------------------------------
1 | #ifndef LPLOTTER_H
2 | #define LPLOTTER_H
3 |
4 | #include
5 | #include
6 |
7 | #include "LPlotSettings.h"
8 | #include "LCurve.h"
9 | #include "qcustomplot.h"
10 | #include "LCursor.h"
11 |
12 |
13 | class LPlotter : public QCustomPlot
14 | {
15 | Q_OBJECT
16 |
17 | public:
18 | LPlotter(QWidget *parent = nullptr);
19 | virtual ~LPlotter();
20 |
21 | void setMaxX(double a_dValue);
22 |
23 | float getMaxX() const;
24 |
25 | void startRefresh(bool a_bStart);
26 |
27 | void showCursor(bool a_bShow);
28 |
29 | void showGrid(bool a_bShow);
30 |
31 |
32 | void addNewCurve(const QString& a_rName);
33 |
34 | void addCurvePoint(const QString& a_rName, const QPointF &a_rPoint);
35 |
36 | void mergeValueAxis(const QList &a_rMergedName);
37 |
38 | void demergeValueAxis(const QList &a_rDemergedName);
39 |
40 | void setCurveSelected(const QString& a_rName, bool a_bSelected);
41 |
42 |
43 | void deleteAllCurve();
44 |
45 | void clearAllCurvePoints();
46 |
47 | void deleteCurve(const QString& a_rName);
48 |
49 | void clearCurvePoints(const QString& a_rName);
50 |
51 |
52 | void setCurveStyle(const QString& a_rName, const Qt::PenStyle& a_rCurveStyle);
53 |
54 | void setCurveColor(const QString &a_rName, const QColor &a_rColor);
55 |
56 | void setCurveWeight(const QString &a_rName, int a_iCurveWeight);
57 |
58 | void setCurveYGain(const QString &a_rName, float a_fCurveYGain);
59 |
60 | void setCurveYOffset(const QString &a_rName, float a_fCurveYOffset);
61 |
62 | signals:
63 | void curveSelected(QString name, bool selected);
64 |
65 | void sendCursorInfo(double x1, double y1, double x2, double y2);
66 |
67 | protected:
68 | virtual void mousePressEvent(QMouseEvent * event);
69 |
70 | virtual void mouseMoveEvent(QMouseEvent *event);
71 |
72 | virtual void mouseReleaseEvent(QMouseEvent *event);
73 |
74 | private:
75 | void refresh();
76 |
77 | void receiveCurveSelected(bool selected);
78 |
79 | void swapValueAxis(QCPAxis* a_pFirstAxis, QCPAxis* a_pSecondAxis);
80 |
81 | void setCursorPosition(QCPItemStraightLine *a_pCursor, double x1, double y1, double x2, double y2);
82 |
83 | private:
84 | double m_dMaxX;
85 |
86 | QCPAxis *m_pTimeAxis;
87 |
88 | QTimer *m_pTimer;
89 |
90 | bool m_bShowCursor;
91 |
92 | QMap m_mapCurve; //!< [curve name] [curve]
93 |
94 | LCursor *m_pCursorX1;
95 | LCursor *m_pCursorX2;
96 | LCursor *m_pCursorY1;
97 | LCursor *m_pCursorY2;
98 | };
99 |
100 | #endif // LPLOTTER_H
101 |
--------------------------------------------------------------------------------
/src/views/oscilloscope/LScopeMenu.cpp:
--------------------------------------------------------------------------------
1 | #include "LScopeMenu.h"
2 | #include "ui_LScopeMenu.h"
3 |
4 | LScopeMenu::LScopeMenu(QWidget *parent) :
5 | QWidget(parent),
6 | ui(new Ui::LScopeMenu)
7 | {
8 | ui->setupUi(this);
9 |
10 | m_strRegisterName = "ScopeMenu";
11 |
12 | }
13 |
14 | LScopeMenu::~LScopeMenu()
15 | {
16 | delete ui;
17 | }
18 |
19 | void LScopeMenu::receiveCursorInfo(double x1, double y1, double x2, double y2)
20 | {
21 | ui->lineEditX1->setText(QString::number(x1));
22 | ui->lineEditX2->setText(QString::number(x2));
23 | ui->lineEditY1->setText(QString::number(y1));
24 | ui->lineEditY2->setText(QString::number(y2));
25 |
26 | double dx = x2-x1;
27 | double dy = y2-y1;
28 | ui->label_dx->setText(QString::number(dx));
29 | ui->label_dy->setText(QString::number(dy));
30 | ui->label_1_dx->setText(QString::number(1/dx));
31 | ui->label_dy_dx->setText(QString::number(dy/dx));
32 | }
33 |
34 | void LScopeMenu::parseFromSetting(LObixTreeIter a_obixIter)
35 | {
36 | }
37 |
38 | void LScopeMenu::convertToSetting()
39 | {
40 |
41 | }
42 |
43 | void LScopeMenu::on_checkBoxCursorEnable_stateChanged(int arg1)
44 | {
45 | emit sendShowCursor(arg1!=0);
46 | #if 0
47 | if(arg1==0) {
48 | ui->lineEditX1->clear();
49 | ui->lineEditX2->clear();
50 | ui->lineEditY1->clear();
51 | ui->lineEditY2->clear();
52 |
53 | ui->label_dx->clear();
54 | ui->label_dy->clear();
55 | ui->label_1_dx->clear();
56 | ui->label_dy_dx->clear();
57 | }
58 | #endif
59 | }
60 |
61 | void LScopeMenu::on_checkBoxShowGrid_stateChanged(int arg1)
62 | {
63 | emit sendShowGrid(arg1!=0);
64 | }
65 |
--------------------------------------------------------------------------------
/src/views/oscilloscope/LScopeMenu.h:
--------------------------------------------------------------------------------
1 | #ifndef LSCOPEMENU_H
2 | #define LSCOPEMENU_H
3 |
4 | #include
5 |
6 | #include "LSettingsRelier.h"
7 |
8 | namespace Ui {
9 | class LScopeMenu;
10 | }
11 |
12 | class LScopeMenu : public QWidget, public LSettingsRelier
13 | {
14 | Q_OBJECT
15 |
16 | public:
17 | explicit LScopeMenu(QWidget *parent = 0);
18 | ~LScopeMenu();
19 |
20 | void receiveCursorInfo(double x1, double y1, double x2, double y2);
21 |
22 | signals:
23 | void sendShowCursor(bool a_bShow);
24 |
25 | void sendShowGrid(bool a_bShow);
26 |
27 | private slots:
28 | void on_checkBoxCursorEnable_stateChanged(int arg1);
29 |
30 | void on_checkBoxShowGrid_stateChanged(int arg1);
31 |
32 | protected:
33 | virtual void parseFromSetting(LObixTreeIter a_obixIter) Q_DECL_OVERRIDE;
34 |
35 | virtual void convertToSetting() Q_DECL_OVERRIDE;
36 |
37 | private:
38 | Ui::LScopeMenu *ui;
39 | };
40 |
41 | #endif // LSCOPEMENU_H
42 |
--------------------------------------------------------------------------------
/src/views/playback/LPlaybackWidget.h:
--------------------------------------------------------------------------------
1 | #ifndef LPLAYBACKWIDGET_H
2 | #define LPLAYBACKWIDGET_H
3 |
4 | #include
5 | #include
6 | #include
7 | #include
8 |
9 | #include "LPlaybackWidgetTableItem.h"
10 | #include "LLogFileParser.h"
11 |
12 | namespace Ui {
13 | class LPlaybackWidget;
14 | }
15 |
16 | class LPlaybackWidget : public QWidget
17 | {
18 | Q_OBJECT
19 |
20 | public:
21 | explicit LPlaybackWidget(QWidget *parent = nullptr);
22 | ~LPlaybackWidget();
23 |
24 | signals:
25 | void sendFileToParse(QString filePath);
26 |
27 | private slots:
28 | void receiveCurveColorChangedByItem(QString name);
29 |
30 | void receiveDataValue(QString name, LDataValue value);
31 |
32 | void receiveErrors(QString errorMessage);
33 |
34 | void receiveNames(QStringList valueNames);
35 |
36 | void receiveProcessFinished();
37 |
38 | void receiveProcessPercent(int percent);
39 |
40 | void handleCustomContextMenu(const QPoint &pos);
41 |
42 | void handleMergeValueAxis();
43 |
44 | void handleDemergeValueAxis();
45 |
46 | void on_browseButton_clicked();
47 |
48 | void on_loadButton_clicked();
49 |
50 | void on_tableWidget_cellClicked(int row, int column);
51 |
52 |
53 | private:
54 | Ui::LPlaybackWidget *ui;
55 |
56 | unsigned int m_uRowCount;
57 |
58 | qint64 m_iScopeStartTime;
59 |
60 | qreal m_dMaxX;
61 | qreal m_dMinY;
62 | qreal m_dMaxY;
63 | QString m_strSelectedName;
64 |
65 | QMap m_mapItems; //!< a map of all items shown
66 |
67 | QMenu *m_pNameContextMenu;
68 |
69 | QThread *m_pParserThread;
70 | LLogFileParser m_logFileParser;
71 | };
72 |
73 | #endif // LPLAYBACKWIDGET_H
74 |
--------------------------------------------------------------------------------
/src/views/playback/LPlaybackWidget.ui:
--------------------------------------------------------------------------------
1 |
2 |
3 | LPlaybackWidget
4 |
5 |
6 |
7 | 0
8 | 0
9 | 1138
10 | 625
11 |
12 |
13 |
14 | Playback Widget
15 |
16 |
17 | -
18 |
19 |
-
20 |
21 |
22 |
23 | 微软雅黑
24 | 75
25 | true
26 |
27 |
28 |
29 | Log file:
30 |
31 |
32 |
33 | -
34 |
35 |
36 |
37 |
38 |
39 |
40 | -
41 |
42 |
43 | Browse
44 |
45 |
46 |
47 | -
48 |
49 |
50 | Load
51 |
52 |
53 |
54 |
55 |
56 | -
57 |
58 |
59 | 0
60 |
61 |
62 |
63 | -
64 |
65 |
66 | Qt::Horizontal
67 |
68 |
69 |
70 |
71 | 0
72 | 0
73 |
74 |
75 |
76 |
77 | 0
78 | 0
79 |
80 |
81 |
82 |
83 | 16777215
84 | 16777215
85 |
86 |
87 |
88 | Qt::LeftToRight
89 |
90 |
91 | QAbstractItemView::ExtendedSelection
92 |
93 |
94 | Qt::ElideLeft
95 |
96 |
97 | true
98 |
99 |
100 | true
101 |
102 |
103 | false
104 |
105 |
106 | 27
107 |
108 |
109 | 100
110 |
111 |
112 | false
113 |
114 |
115 | false
116 |
117 |
118 |
119 | Name
120 |
121 |
122 |
123 |
124 | Color
125 |
126 |
127 |
128 |
129 |
130 |
131 |
132 |
133 |
134 |
135 | LOscilloscope
136 | QWidget
137 |
138 | 1
139 |
140 |
141 |
142 |
143 |
144 |
--------------------------------------------------------------------------------
/src/views/playback/LPlaybackWidgetTableItem.cpp:
--------------------------------------------------------------------------------
1 | #include "LPlaybackWidgetTableItem.h"
2 |
3 | LPlaybackWidgetTableItem::LPlaybackWidgetTableItem(const QString &a_rDataName) :
4 | m_strDataName(a_rDataName),
5 | m_curveColor(255,0,0)
6 | {
7 |
8 | }
9 |
10 | LPlaybackWidgetTableItem &LPlaybackWidgetTableItem::operator=(const LPlaybackWidgetTableItem &other)
11 | {
12 | m_strDataName = other.m_strDataName;
13 | m_curveColor = other.m_curveColor;
14 |
15 | return *this;
16 | }
17 |
18 | void LPlaybackWidgetTableItem::getColorChanged(QColor color)
19 | {
20 | m_curveColor = color;
21 | emit sendCurveColorChangedByItem(m_strDataName);
22 | }
23 |
24 | LPlaybackWidgetTableItem::LPlaybackWidgetTableItem()
25 | {
26 |
27 | }
28 |
--------------------------------------------------------------------------------
/src/views/playback/LPlaybackWidgetTableItem.h:
--------------------------------------------------------------------------------
1 | #ifndef LPLAYBACKWIDGETTABLEITEM_H
2 | #define LPLAYBACKWIDGETTABLEITEM_H
3 |
4 | #include
5 | #include
6 | #include
7 |
8 | class LPlaybackWidgetTableItem : public QObject
9 | {
10 | Q_OBJECT
11 |
12 | public:
13 | LPlaybackWidgetTableItem(const QString& a_rDataName);
14 |
15 | const QString& getName() const {return m_strDataName;}
16 |
17 | const QColor& getCurveColor() const {return m_curveColor;}
18 | void setCurveColor(const QColor &a_rColor) {m_curveColor = a_rColor;}
19 |
20 | LPlaybackWidgetTableItem &operator=(const LPlaybackWidgetTableItem &other);
21 |
22 | signals:
23 | void sendCurveColorChangedByItem(QString name);
24 |
25 | public slots:
26 | void getColorChanged(QColor color);
27 |
28 | private:
29 | LPlaybackWidgetTableItem();
30 |
31 | private:
32 | QString m_strDataName; //!< name of this data
33 |
34 | QColor m_curveColor; //!< color of the curve
35 | };
36 |
37 | #endif // LPLAYBACKWIDGETTABLEITEM_H
38 |
--------------------------------------------------------------------------------
/src/views/script/SConsole.cpp:
--------------------------------------------------------------------------------
1 | #include "SConsole.h"
2 | #include
3 |
4 | #define REFRESH_TIME_ms 500
5 |
6 | SConsole::SConsole(QWidget *parent) :
7 | QPlainTextEdit(parent)
8 | {
9 | m_pTimer = new QTimer(this);
10 | m_pTimer->setInterval(REFRESH_TIME_ms);
11 | m_pTimer->setSingleShot(true);
12 | connect(m_pTimer, &QTimer::timeout, this, &SConsole::refresh);
13 | m_pTimer->start();
14 | }
15 |
16 | SConsole::~SConsole()
17 | {
18 | delete m_pTimer;
19 | }
20 |
21 | void SConsole::addText(const QString &a_rstrText)
22 | {
23 | m_strText += a_rstrText;
24 | if(!m_pTimer->isActive()) {
25 | m_pTimer->start();
26 | }
27 | }
28 |
29 | void SConsole::clearText()
30 | {
31 | m_strText.clear();
32 | this->clear();
33 | }
34 |
35 | void SConsole::refresh()
36 | {
37 | this->appendPlainText(m_strText);
38 | m_strText.clear();
39 | }
40 |
41 |
42 |
--------------------------------------------------------------------------------
/src/views/script/SConsole.h:
--------------------------------------------------------------------------------
1 | #ifndef SCONSOLE_H
2 | #define SCONSOLE_H
3 |
4 | #include
5 | #include
6 |
7 | class SConsole : public QPlainTextEdit
8 | {
9 | Q_OBJECT
10 |
11 | public:
12 | explicit SConsole(QWidget *parent = nullptr);
13 | virtual ~SConsole();
14 |
15 | void addText(const QString &a_rstrText);
16 |
17 | void clearText();
18 |
19 | private slots:
20 | void refresh();
21 |
22 | private:
23 | QString m_strText;
24 | QTimer *m_pTimer;
25 | };
26 |
27 | #endif // SCONSOLE_H
28 |
--------------------------------------------------------------------------------
/src/views/script/SMainWindow.h:
--------------------------------------------------------------------------------
1 | #ifndef SMAINWINDOW_H
2 | #define SMAINWINDOW_H
3 |
4 | #include
5 | #include
6 | #include
7 | #include
8 | #include
9 |
10 | #include "LLobsterApiWrapper.h"
11 | #include "LScriptEvalWrapper.h"
12 |
13 | #include "LValueObserver.h"
14 |
15 | namespace Ui {
16 | class SMainWindow;
17 | }
18 |
19 | class SMainWindow : public QMainWindow, public LValueObserver
20 | {
21 | Q_OBJECT
22 |
23 | public:
24 | explicit SMainWindow(QWidget *parent = 0);
25 | ~SMainWindow();
26 |
27 | // set auto completion reference string list
28 | void setAutoCompModelStrings(const QList& a_rModelStringlist);
29 |
30 | void setDataList(const QList& a_rDataList);
31 |
32 | // inherit from LObserver
33 | virtual void updateValue(const QString& a_rDataName, const LDataValue& a_rDataValue) Q_DECL_OVERRIDE;
34 | virtual void start() Q_DECL_OVERRIDE;
35 | virtual void stop() Q_DECL_OVERRIDE;
36 |
37 | public slots:
38 | void addText2Console(QString text);
39 |
40 | void handleApiCallError(QString ErrorMsg);
41 |
42 | void handleMainApiCmd(bool command);
43 |
44 | void handlePointApiSubCmd(bool command, QString pointName);
45 |
46 | void handleSysApiBeepCmd(int loops);
47 |
48 | void handleSysApiSayCmd(QString content);
49 |
50 | void receiveDataValue(QString a_strDataName, LDataValue a_dDataValue);
51 |
52 | void handlePointApiCurveEnableCmd(QString a_strDataName, bool a_bIsEnable);
53 |
54 | void handlePointApiCurveColorCmd(QString a_strDataName, QColor a_curveColor);
55 |
56 | void handlePointApiCurveGainCmd(QString a_strDataName, float a_fCurveGain);
57 |
58 | void handlePointApiCurveOffsetCmd(QString a_strDataName, float a_fCurveOffset);
59 |
60 | signals:
61 | /// \note comand=true for start, false for stop
62 | void sendMainCmd(bool command);
63 | /// \note command=true for subscribe, false for unsubscribe
64 | void sendPointCmd(bool command, QString pointName);
65 |
66 | void sendDataValue(QString a_strDataName, LDataValue a_dDataValue);
67 | void sendPullValueCmd(QString a_strDataName);
68 |
69 | void sendCurveEnable(QString a_strDataName, bool a_bIsEnable);
70 |
71 | void sendCurveColor(QString a_strDataName, QColor a_curveColor);
72 |
73 | void sendCurveGain(QString a_strDataName, float a_fCurveGain);
74 |
75 | void sendCurveOffset(QString a_strDataName, float a_fCurveOffset);
76 |
77 | void sendLogEnable(QString a_strDataName, bool a_bIsEnable);
78 |
79 |
80 | protected:
81 | virtual void closeEvent(QCloseEvent *event) Q_DECL_OVERRIDE;
82 |
83 | private:
84 | void setupEditor();
85 | void setupConsole();
86 | void setupSplitter();
87 | void setupToolbar();
88 |
89 | void setupScriptEval();
90 |
91 | void editTittle();
92 |
93 | private slots:
94 | void newScript();
95 | void saveScript();
96 | void openScript();
97 | void refreshScript();
98 | void runScript();
99 | void debugScript();
100 | void stopScript();
101 | void scriptStopped();
102 |
103 | void cleanConsole();
104 |
105 | void on_actionNew_triggered();
106 |
107 | void on_actionSave_triggered();
108 |
109 | void on_actionOpen_triggered();
110 |
111 | void on_actionSave_As_triggered();
112 |
113 | private:
114 | Ui::SMainWindow *ui;
115 |
116 | // editor related
117 | QCompleter *m_pCompleter;
118 |
119 | // buttons
120 | QToolButton* m_pRunScriptButton;
121 |
122 | QToolButton* m_pDebugScriptButton;
123 |
124 | QToolButton* m_pStopScriptButton;
125 |
126 | // script
127 | LScriptEvalWrapper* m_pScriptEval;
128 |
129 | LLobsterApiWrapper* m_pLobsterAPI;
130 |
131 | // codes
132 | QString m_strScriptPath;
133 |
134 | QString m_strScript;
135 |
136 | // audio support
137 | QSound *m_pSound;
138 |
139 | QTextToSpeech *m_pTextToSpeech;
140 | };
141 |
142 | #endif // SMAINWINDOW_H
143 |
--------------------------------------------------------------------------------
/src/views/selectDlg/LSelectDataDlg.h:
--------------------------------------------------------------------------------
1 | #ifndef LSELECTDATADLG_H
2 | #define LSELECTDATADLG_H
3 |
4 | #include
5 | #include
6 | #include
7 |
8 | namespace Ui {
9 | class LSelectDataDlg;
10 | }
11 |
12 | class LSelectDataDlg : public QDialog
13 | {
14 | Q_OBJECT
15 |
16 | public:
17 | explicit LSelectDataDlg(QWidget *parent = 0);
18 | ~LSelectDataDlg();
19 |
20 | void setDataNameCollection(const QStringList& a_rDataNameCol);
21 |
22 | void loadHistory(const QList& a_rSelectNames);
23 |
24 | void clickOk();
25 |
26 | void selectName(const QString& a_rstrDataName);
27 | void unselectName(const QString& a_rstrDataName);
28 |
29 |
30 | signals:
31 | void acceptSelection(QList a_listNames);
32 |
33 |
34 | private slots:
35 | void on_lineEditKeyWord_textChanged(const QString &arg1);
36 |
37 | void on_lineEditKeyWordSelect_textChanged(const QString &arg1);
38 |
39 | void on_listWidgetCollection_itemDoubleClicked(QListWidgetItem *item);
40 |
41 | void on_listWidgetSelected_itemDoubleClicked(QListWidgetItem *item);
42 |
43 | void on_buttonBox_accepted();
44 |
45 | void on_pushButtonAdd_clicked();
46 |
47 | void on_pushButtonAddAll_clicked();
48 |
49 | void on_pushButtonRemove_clicked();
50 |
51 | void on_pushButtonRemoveAll_clicked();
52 |
53 | private:
54 | Ui::LSelectDataDlg *ui;
55 |
56 | QMap > m_mapTempStorage; //!< [protocol][names of this protocol], this is for name list storage before quit this dialog
57 | };
58 |
59 | #endif // LSELECTDATADLG_H
60 |
--------------------------------------------------------------------------------
/src/views/selectDlg/LSelectDataDlgWrapper.cpp:
--------------------------------------------------------------------------------
1 | #include "LSelectDataDlgWrapper.h"
2 |
3 | LSelectDataDlgWrapper::LSelectDataDlgWrapper()
4 | {
5 | m_strRegisterName = "SelectedNames";
6 | }
7 |
8 | LSelectDataDlgWrapper::~LSelectDataDlgWrapper()
9 | {
10 | }
11 |
12 | void LSelectDataDlgWrapper::setDataNameCollection(const QStringList &a_rDataNameCol)
13 | {
14 | m_pDialog->setDataNameCollection(a_rDataNameCol);
15 | }
16 |
17 | void LSelectDataDlgWrapper::createDialog(QWidget* parent)
18 | {
19 | m_pDialog = new LSelectDataDlg(parent);
20 | m_pDialog->setAttribute(Qt::WA_DeleteOnClose);
21 | m_pDialog->setWindowTitle(tr("Select Data"));
22 | connect(m_pDialog, &LSelectDataDlg::acceptSelection, this, &LSelectDataDlgWrapper::getAcceptSig);
23 | }
24 |
25 | void LSelectDataDlgWrapper::execDialog()
26 | {
27 | m_pDialog->exec();
28 | }
29 |
30 | void LSelectDataDlgWrapper::clickOk()
31 | {
32 | m_pDialog->clickOk();
33 | }
34 |
35 | void LSelectDataDlgWrapper::getAcceptSig(QList a_listNames)
36 | {
37 | m_listHistoryNames = a_listNames;
38 |
39 | convertToSetting();
40 |
41 | emit triggerAcceptSelection(m_listHistoryNames);
42 |
43 | if (m_pDialog != NULL) {
44 | delete m_pDialog, m_pDialog = NULL;
45 | }
46 | }
47 |
48 |
49 | void LSelectDataDlgWrapper::parseFromSetting(LObixTreeIter a_obixIter)
50 | {
51 | m_listHistoryNames.clear();
52 |
53 | QList listNames;
54 | a_obixIter.moveToRoot();
55 | a_obixIter.moveToFirstChild();
56 | if (a_obixIter.getValue().getType() == eObj) {
57 | listNames.append(a_obixIter.getValue().getProperty("name"));
58 | }
59 | while(a_obixIter.hasSibling()) {
60 | a_obixIter.moveToNextSibling();
61 | if (a_obixIter.getValue().getType() == eObj) {
62 | listNames.append(a_obixIter.getValue().getProperty("name"));
63 | }
64 | }
65 | m_listHistoryNames = listNames;
66 | }
67 |
68 | void LSelectDataDlgWrapper::convertToSetting()
69 | {
70 | m_obixMutableIter.moveToRoot();
71 | // build a new subtree
72 | if (m_obixMutableIter.hasChild())
73 | m_obixMutableIter.removeChildren();
74 | QListIterator i(m_listHistoryNames);
75 | while (i.hasNext()) {
76 | QString strDataName = i.next();
77 | LObixObj obixObj("obj", "name", strDataName);
78 | m_obixMutableIter.appendChild(obixObj);
79 | }
80 |
81 | }
82 |
83 | void LSelectDataDlgWrapper::loadHistory()
84 | {
85 | //force dialog to apply history settings
86 | m_pDialog->loadHistory(m_listHistoryNames);
87 | }
88 |
89 | void LSelectDataDlgWrapper::selectName(const QString &a_rstrDataName)
90 | {
91 | m_pDialog->selectName(a_rstrDataName);
92 | }
93 |
94 | void LSelectDataDlgWrapper::unselectName(const QString &a_rstrDataName)
95 | {
96 | m_pDialog->unselectName(a_rstrDataName);
97 | }
98 |
--------------------------------------------------------------------------------
/src/views/selectDlg/LSelectDataDlgWrapper.h:
--------------------------------------------------------------------------------
1 | #ifndef LSELECTDATAWRAPPER_H
2 | #define LSELECTDATAWRAPPER_H
3 |
4 | #include "LSettingsRelier.h"
5 | #include "LSelectDataDlg.h"
6 |
7 |
8 | class LSelectDataDlgWrapper : public QObject, public LSettingsRelier
9 | {
10 | Q_OBJECT
11 | public:
12 | LSelectDataDlgWrapper();
13 | ~LSelectDataDlgWrapper();
14 |
15 | void setDataNameCollection(const QStringList& a_rDataNameCol);
16 |
17 | void loadHistory();
18 |
19 | void selectName(const QString& a_rstrDataName);
20 | void unselectName(const QString& a_rstrDataName);
21 |
22 |
23 | void createDialog(QWidget* parent);
24 | void execDialog();
25 |
26 | //! an external command to click ok
27 | void clickOk();
28 |
29 | signals:
30 | void triggerAcceptSelection(QList a_listNames);
31 |
32 | public slots:
33 | void getAcceptSig(QList a_listNames);
34 |
35 | protected:
36 | virtual void parseFromSetting(LObixTreeIter a_obixIter) Q_DECL_OVERRIDE;
37 |
38 | virtual void convertToSetting() Q_DECL_OVERRIDE;
39 |
40 |
41 | private:
42 | LSelectDataDlg* m_pDialog;
43 |
44 | QList m_listHistoryNames;
45 | };
46 |
47 | #endif // LSELECTDATAWRAPPER_H
48 |
--------------------------------------------------------------------------------
/src/views/settingsDlg/LSettingsTabDialog.cpp:
--------------------------------------------------------------------------------
1 | #include "LSettingsTabDialog.h"
2 | #include "ui_LSettingsTabDialog.h"
3 |
4 | LSettingsTabDialog::LSettingsTabDialog(QWidget *parent) :
5 | QDialog(parent),
6 | ui(new Ui::LSettingsTabDialog)
7 | {
8 | ui->setupUi(this);
9 | }
10 |
11 | LSettingsTabDialog::~LSettingsTabDialog()
12 | {
13 | delete ui;
14 | }
15 |
16 | int LSettingsTabDialog::addTab(QWidget *page, const QString &label)
17 | {
18 | if (ui->tabWidget->indexOf(page) == -1) {
19 | // this widget is new
20 | return ui->tabWidget->addTab(page, label);
21 | }
22 | else {
23 | // this widget already exists
24 | return (-1);
25 | }
26 | }
27 |
28 | int LSettingsTabDialog::count() const
29 | {
30 | return ui->tabWidget->count();
31 | }
32 |
--------------------------------------------------------------------------------
/src/views/settingsDlg/LSettingsTabDialog.h:
--------------------------------------------------------------------------------
1 | #ifndef LSETTINGSTABDIALOG_H
2 | #define LSETTINGSTABDIALOG_H
3 |
4 | #include
5 |
6 | namespace Ui {
7 | class LSettingsTabDialog;
8 | }
9 |
10 | class LSettingsTabDialog : public QDialog
11 | {
12 | Q_OBJECT
13 |
14 | public:
15 | explicit LSettingsTabDialog(QWidget *parent = 0);
16 | ~LSettingsTabDialog();
17 |
18 | //! add tab to the tab widget
19 | int addTab(QWidget * page, const QString & label);
20 |
21 | //! count of tabs
22 | int count() const;
23 |
24 | private:
25 | Ui::LSettingsTabDialog *ui;
26 | };
27 |
28 | #endif // LSETTINGSTABDIALOG_H
29 |
--------------------------------------------------------------------------------
/src/views/settingsDlg/LSettingsTabDialog.ui:
--------------------------------------------------------------------------------
1 |
2 |
3 | LSettingsTabDialog
4 |
5 |
6 |
7 | 0
8 | 0
9 | 560
10 | 330
11 |
12 |
13 |
14 | Settings Tab Widget
15 |
16 |
17 | -
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/src/views/watchwindow/LColorSelectButton.cpp:
--------------------------------------------------------------------------------
1 | #include "LColorSelectButton.h"
2 | #include "ui_LColorSelectButton.h"
3 |
4 | #include
5 | #include
6 |
7 | LColorSelectButton::LColorSelectButton(QWidget *parent) :
8 | QWidget(parent),
9 | ui(new Ui::LColorSelectButton)
10 | {
11 | ui->setupUi(this);
12 | }
13 |
14 | LColorSelectButton::~LColorSelectButton()
15 | {
16 | delete ui;
17 | }
18 |
19 | void LColorSelectButton::setColor(const QColor &a_rColor)
20 | {
21 | if (a_rColor != m_color) {
22 | m_color = a_rColor;
23 | applyColorChange();
24 | }
25 | }
26 |
27 | const QColor &LColorSelectButton::getColor() const
28 | {
29 | return m_color;
30 | }
31 |
32 | void LColorSelectButton::on_pushButton_clicked()
33 | {
34 | QColor color = QColorDialog::getColor(m_color, this, "Select Color");
35 | // if color changed
36 | if ((color.isValid()) && (color != m_color)) {
37 | m_color = color;
38 | applyColorChange();
39 | emit colorChanged(m_color);
40 | }
41 | }
42 |
43 | void LColorSelectButton::applyColorChange()
44 | {
45 | QString strColor("#"
46 | + QString(m_color.red() < 16? "0" : "") + QString::number(m_color.red(),16)
47 | + QString(m_color.green() < 16? "0" : "") + QString::number(m_color.green(),16)
48 | + QString(m_color.blue() < 16? "0" : "") + QString::number(m_color.blue(),16) );
49 |
50 | QString styleSheet("background: " + strColor + ";");
51 |
52 | ui->pushButton->setStyleSheet(styleSheet);
53 | ui->pushButton->update();
54 | }
55 |
56 |
--------------------------------------------------------------------------------
/src/views/watchwindow/LColorSelectButton.h:
--------------------------------------------------------------------------------
1 | #ifndef LCOLORSELECTBUTTON_H
2 | #define LCOLORSELECTBUTTON_H
3 |
4 | #include
5 |
6 | namespace Ui {
7 | class LColorSelectButton;
8 | }
9 |
10 | class LColorSelectButton : public QWidget
11 | {
12 | Q_OBJECT
13 |
14 | public:
15 | explicit LColorSelectButton(QWidget *parent = 0);
16 | ~LColorSelectButton();
17 |
18 | void setColor(const QColor &a_rColor);
19 | const QColor& getColor() const;
20 |
21 | signals:
22 | void colorChanged(QColor color);
23 |
24 | private slots:
25 | void on_pushButton_clicked();
26 |
27 | private:
28 | void applyColorChange();
29 |
30 | private:
31 | Ui::LColorSelectButton *ui;
32 |
33 | QColor m_color; //!< color of the button
34 | };
35 |
36 | #endif // LCOLORSELECTBUTTON_H
37 |
--------------------------------------------------------------------------------
/src/views/watchwindow/LColorSelectButton.ui:
--------------------------------------------------------------------------------
1 |
2 |
3 | LColorSelectButton
4 |
5 |
6 |
7 | 0
8 | 0
9 | 43
10 | 33
11 |
12 |
13 |
14 | Form
15 |
16 |
17 |
18 |
19 | 6
20 | 6
21 | 31
22 | 21
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
--------------------------------------------------------------------------------
/src/views/watchwindow/LEnumsBox.cpp:
--------------------------------------------------------------------------------
1 | #include "LEnumsBox.h"
2 |
3 | #include
4 |
5 | LEnumsBox::LEnumsBox(QWidget *parent) :
6 | QComboBox(parent)
7 | {
8 |
9 | }
10 |
11 | void LEnumsBox::wheelEvent(QWheelEvent *e)
12 | {
13 | // Disable mouse wheel features
14 | e->ignore();
15 | }
16 |
--------------------------------------------------------------------------------
/src/views/watchwindow/LEnumsBox.h:
--------------------------------------------------------------------------------
1 | #ifndef LENUMSBOX_H
2 | #define LENUMSBOX_H
3 |
4 | #include
5 |
6 | class LEnumsBox : public QComboBox
7 | {
8 | Q_OBJECT
9 | public:
10 | explicit LEnumsBox(QWidget *parent = 0);
11 |
12 | protected:
13 | virtual void wheelEvent(QWheelEvent * e) Q_DECL_OVERRIDE;
14 | };
15 |
16 | #endif // LENUMSBOX_H
17 |
--------------------------------------------------------------------------------
/src/views/watchwindow/LWatchWindow.ui:
--------------------------------------------------------------------------------
1 |
2 |
3 | LWatchWindow
4 |
5 |
6 |
7 | 0
8 | 0
9 | 773
10 | 732
11 |
12 |
13 |
14 | Watch Window
15 |
16 |
17 |
18 | -
19 |
20 |
21 | Qt::LeftToRight
22 |
23 |
24 | QAbstractItemView::DoubleClicked
25 |
26 |
27 | QAbstractItemView::ExtendedSelection
28 |
29 |
30 | Qt::ElideLeft
31 |
32 |
33 | true
34 |
35 |
36 | false
37 |
38 |
39 | 6
40 |
41 |
42 | false
43 |
44 |
45 | 27
46 |
47 |
48 | 100
49 |
50 |
51 | false
52 |
53 |
54 |
55 | Name
56 |
57 |
58 |
59 |
60 | Value
61 |
62 |
63 |
64 |
65 | Attributes
66 |
67 |
68 |
69 |
70 | Curve Color
71 |
72 |
73 |
74 |
75 | Scope
76 |
77 |
78 |
79 |
80 | Log
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
--------------------------------------------------------------------------------
/src/views/watchwindow/LWatchWindowItem.cpp:
--------------------------------------------------------------------------------
1 | #include "LWatchWindowItem.h"
2 |
3 | LWatchWindowItem::LWatchWindowItem(const QString &a_rDataName) :
4 | m_strDataName(a_rDataName),
5 | m_strValue("NA"),
6 | m_bScopeEnabled(false),
7 | m_curveColor(255,0,0),
8 | m_bLogEnabled(false)
9 | {
10 |
11 | }
12 |
13 | const QString &LWatchWindowItem::getName() const
14 | {
15 | return m_strDataName;
16 | }
17 |
18 | const QString &LWatchWindowItem::getValue() const
19 | {
20 | return m_strValue;
21 | }
22 |
23 | void LWatchWindowItem::setValue(const QString &a_strValue)
24 | {
25 | m_strValue = a_strValue;
26 | }
27 |
28 | bool LWatchWindowItem::isScopeEnable() const
29 | {
30 | return m_bScopeEnabled;
31 | }
32 |
33 | void LWatchWindowItem::setScopeEnable(bool a_bEnable)
34 | {
35 | m_bScopeEnabled = a_bEnable;
36 | }
37 |
38 | const QColor &LWatchWindowItem::getCurveColor() const
39 | {
40 | return m_curveColor;
41 | }
42 |
43 | void LWatchWindowItem::setCurveColor(const QColor &a_rColor)
44 | {
45 | m_curveColor = a_rColor;
46 | }
47 |
48 | bool LWatchWindowItem::isLogEnable() const
49 | {
50 | return m_bLogEnabled;
51 | }
52 |
53 | void LWatchWindowItem::setLogEnable(bool a_bEnable)
54 | {
55 | m_bLogEnabled = a_bEnable;
56 | }
57 |
58 | LWatchWindowItem &LWatchWindowItem::operator=(const LWatchWindowItem &other)
59 | {
60 | m_strDataName = other.m_strDataName;
61 | m_bScopeEnabled = other.m_bScopeEnabled;
62 | m_curveColor = other.m_curveColor;
63 | m_bLogEnabled = other.m_bLogEnabled;
64 |
65 | return *this;
66 | }
67 |
68 | void LWatchWindowItem::getScopeCheckState(bool a_bState)
69 | {
70 | m_bScopeEnabled = a_bState;
71 | emit sendScopeEnableStateByItem(m_strDataName, a_bState);
72 | }
73 |
74 | void LWatchWindowItem::getLogCheckState(bool a_bState)
75 | {
76 | m_bLogEnabled = a_bState;
77 | emit sendLogEnableStateByItem(m_strDataName, a_bState);
78 | }
79 |
80 | void LWatchWindowItem::getColorChanged(QColor color)
81 | {
82 | m_curveColor = color;
83 | emit sendCurveColorChangedByItem(m_strDataName);
84 | }
85 |
86 | LWatchWindowItem::LWatchWindowItem()
87 | {
88 | }
89 |
--------------------------------------------------------------------------------
/src/views/watchwindow/LWatchWindowItem.h:
--------------------------------------------------------------------------------
1 | #ifndef LWATCHWINDOWITEM_H
2 | #define LWATCHWINDOWITEM_H
3 |
4 | #include
5 | #include
6 | #include
7 |
8 | class LWatchWindowItem : public QObject
9 | {
10 | Q_OBJECT
11 | public:
12 | LWatchWindowItem(const QString& a_rDataName);
13 |
14 | const QString& getName() const;
15 |
16 | const QString& getValue() const;
17 | void setValue(const QString& a_strValue);
18 |
19 | bool isScopeEnable() const;
20 | void setScopeEnable(bool a_bEnable);
21 |
22 | const QColor& getCurveColor() const;
23 | void setCurveColor(const QColor &a_rColor);
24 |
25 | bool isLogEnable() const;
26 | void setLogEnable(bool a_bEnable);
27 |
28 | LWatchWindowItem &operator=(const LWatchWindowItem &other);
29 |
30 | signals:
31 | void sendScopeEnableStateByItem(QString name, bool state);
32 |
33 | void sendCurveColorChangedByItem(QString name);
34 |
35 | void sendLogEnableStateByItem(QString name, bool state);
36 |
37 | public slots:
38 | void getScopeCheckState(bool a_bState);
39 | void getLogCheckState(bool a_bState);
40 |
41 | void getColorChanged(QColor color);
42 |
43 | private:
44 | LWatchWindowItem();
45 |
46 | private:
47 | QString m_strDataName; //!< name of this data
48 |
49 | QString m_strValue; //!< value of this data in string format
50 |
51 | bool m_bScopeEnabled; //!< enable this data shown on scope
52 |
53 | QColor m_curveColor; //!< color of the curve
54 |
55 | bool m_bLogEnabled; //!< enable this data been logged
56 |
57 | };
58 |
59 | #endif // LWATCHWINDOWITEM_H
60 |
--------------------------------------------------------------------------------
/tdms_ebd.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lotusczp/Lobster/ceb5ec720fdbbd5eddba5eeccc2f875a62d4332e/tdms_ebd.dll
--------------------------------------------------------------------------------
/thirdparty/ADIO86.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lotusczp/Lobster/ceb5ec720fdbbd5eddba5eeccc2f875a62d4332e/thirdparty/ADIO86.dll
--------------------------------------------------------------------------------
/thirdparty/ControlCAN.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lotusczp/Lobster/ceb5ec720fdbbd5eddba5eeccc2f875a62d4332e/thirdparty/ControlCAN.dll
--------------------------------------------------------------------------------
/thirdparty/LibDBCManager.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lotusczp/Lobster/ceb5ec720fdbbd5eddba5eeccc2f875a62d4332e/thirdparty/LibDBCManager.dll
--------------------------------------------------------------------------------
/thirdparty/kerneldlls/CAN232.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lotusczp/Lobster/ceb5ec720fdbbd5eddba5eeccc2f875a62d4332e/thirdparty/kerneldlls/CAN232.dll
--------------------------------------------------------------------------------
/thirdparty/kerneldlls/CANDTU_NET.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lotusczp/Lobster/ceb5ec720fdbbd5eddba5eeccc2f875a62d4332e/thirdparty/kerneldlls/CANDTU_NET.dll
--------------------------------------------------------------------------------
/thirdparty/kerneldlls/CANDTU_NET_400.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lotusczp/Lobster/ceb5ec720fdbbd5eddba5eeccc2f875a62d4332e/thirdparty/kerneldlls/CANDTU_NET_400.dll
--------------------------------------------------------------------------------
/thirdparty/kerneldlls/CANETE.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lotusczp/Lobster/ceb5ec720fdbbd5eddba5eeccc2f875a62d4332e/thirdparty/kerneldlls/CANETE.dll
--------------------------------------------------------------------------------
/thirdparty/kerneldlls/CANET_TCP.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lotusczp/Lobster/ceb5ec720fdbbd5eddba5eeccc2f875a62d4332e/thirdparty/kerneldlls/CANET_TCP.dll
--------------------------------------------------------------------------------
/thirdparty/kerneldlls/CANWIFI_TCP.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lotusczp/Lobster/ceb5ec720fdbbd5eddba5eeccc2f875a62d4332e/thirdparty/kerneldlls/CANWIFI_TCP.dll
--------------------------------------------------------------------------------
/thirdparty/kerneldlls/CANWIFI_UDP.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lotusczp/Lobster/ceb5ec720fdbbd5eddba5eeccc2f875a62d4332e/thirdparty/kerneldlls/CANWIFI_UDP.dll
--------------------------------------------------------------------------------
/thirdparty/kerneldlls/PC104C2.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lotusczp/Lobster/ceb5ec720fdbbd5eddba5eeccc2f875a62d4332e/thirdparty/kerneldlls/PC104C2.dll
--------------------------------------------------------------------------------
/thirdparty/kerneldlls/PC104CAN.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lotusczp/Lobster/ceb5ec720fdbbd5eddba5eeccc2f875a62d4332e/thirdparty/kerneldlls/PC104CAN.dll
--------------------------------------------------------------------------------
/thirdparty/kerneldlls/PCI5121.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lotusczp/Lobster/ceb5ec720fdbbd5eddba5eeccc2f875a62d4332e/thirdparty/kerneldlls/PCI5121.dll
--------------------------------------------------------------------------------
/thirdparty/kerneldlls/gisadll.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lotusczp/Lobster/ceb5ec720fdbbd5eddba5eeccc2f875a62d4332e/thirdparty/kerneldlls/gisadll.dll
--------------------------------------------------------------------------------
/thirdparty/kerneldlls/gpcidll.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lotusczp/Lobster/ceb5ec720fdbbd5eddba5eeccc2f875a62d4332e/thirdparty/kerneldlls/gpcidll.dll
--------------------------------------------------------------------------------
/thirdparty/kerneldlls/isa5420.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lotusczp/Lobster/ceb5ec720fdbbd5eddba5eeccc2f875a62d4332e/thirdparty/kerneldlls/isa5420.dll
--------------------------------------------------------------------------------
/thirdparty/kerneldlls/kerneldll.ini:
--------------------------------------------------------------------------------
1 | [KERNELDLL]
2 | COUNT=47
3 | 1=PCI51XXE.dll
4 | 2=PCI9810.dll
5 | 3=USBCAN.dll
6 | 4=USBCAN.dll
7 | 5=PCI9820B.dll
8 | 6=CAN232.dll
9 | 7=PCI51XXE.dll
10 | 8=CANLite.dll
11 | 9=ISA9620B.dll
12 | 10=ISA5420.dll
13 | 11=PC104CAN.dll
14 | 12=CANETE.dll
15 | 13=DNP9810B.dll
16 | 14=PCI9840B.dll
17 | 15=PC104C2.dll
18 | 16=PCI9820I.dll
19 | 17=CANET_TCP.dll
20 | 18=pec9920.dll
21 | 19=pci50xx_u.dll
22 | 20=USBCAN_E.dll
23 | 21=USBCAN_E.dll
24 | 22=pci50xx_u.dll
25 | 23=topcliff_can.dll
26 | 24=pcie9221.dll
27 | 25=CANWIFI_TCP.dll
28 | 26=CANWIFI_UDP.dll
29 | 27=pcie9120.dll
30 | 28=pcie9110.dll
31 | 29=pcie9140.dll
32 | 30=pci5010p.dll
33 | 31=USBCAN_4E_U.dll
34 | 32=CANDTU.DLL
35 | 33=CANDTU_MINI.dll
36 | 34=USBCAN_8E_U.dll
37 | 35=CAN_REPLAY.dll
38 | 36=CANDTU_NET.dll
39 | 37=CANDTU.dll
40 | 38=zpcfd_x86.dll
41 | 39=zpcfd_x86.dll
42 | 40=zpcfd_x86.dll
43 | 41=usbcanfd.dll
44 | 42=usbcanfd.dll
45 | 43=usbcanfd.dll
46 | 44=canfdcom100ie.dll
47 | 45=canscope.dll
48 | 46=zlgcould.dll
49 | 47=CANDTU_NET_400.dll
50 |
--------------------------------------------------------------------------------
/thirdparty/kerneldlls/usbcan.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lotusczp/Lobster/ceb5ec720fdbbd5eddba5eeccc2f875a62d4332e/thirdparty/kerneldlls/usbcan.dll
--------------------------------------------------------------------------------
/thirdparty/nilibddc.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lotusczp/Lobster/ceb5ec720fdbbd5eddba5eeccc2f875a62d4332e/thirdparty/nilibddc.dll
--------------------------------------------------------------------------------
/thirdparty/objdump.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lotusczp/Lobster/ceb5ec720fdbbd5eddba5eeccc2f875a62d4332e/thirdparty/objdump.exe
--------------------------------------------------------------------------------
/thirdparty/tmctl.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lotusczp/Lobster/ceb5ec720fdbbd5eddba5eeccc2f875a62d4332e/thirdparty/tmctl.dll
--------------------------------------------------------------------------------
/usiEx.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lotusczp/Lobster/ceb5ec720fdbbd5eddba5eeccc2f875a62d4332e/usiEx.dll
--------------------------------------------------------------------------------
/usiPluginTDM.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lotusczp/Lobster/ceb5ec720fdbbd5eddba5eeccc2f875a62d4332e/usiPluginTDM.dll
--------------------------------------------------------------------------------
/uspTdms.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lotusczp/Lobster/ceb5ec720fdbbd5eddba5eeccc2f875a62d4332e/uspTdms.dll
--------------------------------------------------------------------------------
/utilities/python/EvoxVar.py:
--------------------------------------------------------------------------------
1 | # This script is to generate source config file for Lobster
2 | # It currently supports EvoxVar - 2015.12.23
3 | #
4 | # - Written by Steve Cai
5 | # Copyright (C) 2015 by The Trane Company
6 |
7 |
8 | import csv
9 |
10 |
11 |
12 | with open('EvoxVar_Quantum.csv', 'rb') as csvfile:
13 | reader = csv.reader(csvfile)
14 | lineNum = 0
15 | obj = []
16 | for line in reader:
17 | lineNum = lineNum + 1
18 | if lineNum > 1:
19 | obj.append( line )
20 |
21 |
22 |
23 | from xml.etree import ElementTree
24 | from xml.etree.ElementTree import Element
25 | from xml.etree.ElementTree import SubElement
26 | from xml.dom import minidom
27 |
28 | def prettify(elem):
29 | # Return a pretty-printed XML string for the Element. #
30 | rough_string = ElementTree.tostring(elem, 'utf-8')
31 | reparsed = minidom.parseString(rough_string)
32 | return reparsed.toprettyxml(indent=" ")
33 |
34 |
35 | content = Element( 'obj', attrib={'is': 'Evox Var Config'} )
36 | listEle = SubElement( content, 'list', attrib={'is': 'Var Points'} )
37 |
38 |
39 | for varPoint in obj:
40 | objEle = SubElement( listEle, 'obj', attrib={'is': 'Point'} )
41 | SubElement(objEle, 'str', name='PointName', attrib={'val': varPoint[0]} )
42 | if varPoint[1] != "Auto" : # Auto is default
43 | SubElement(objEle, 'str', name='Href', attrib={'val': varPoint[1]} )
44 | if varPoint[2] != "real" : # real is default
45 | SubElement(objEle, 'str', name='ValueType', attrib={'val': varPoint[2]} )
46 | if varPoint[3] != "1" : # 1 is default
47 | SubElement(objEle, 'real', name='Slope', attrib={'val': varPoint[3]} )
48 | if varPoint[4] != "0" : # 0 is default
49 | SubElement(objEle, 'real', name='Offset', attrib={'val': varPoint[4]} )
50 | if varPoint[5] != "ReadWrite": # ReadWrite is default
51 | SubElement(objEle, 'str', name='Authority', attrib={'val': varPoint[5]} )
52 | if varPoint[6] != "NULL" : # NULL stands for not nick name
53 | SubElement(objEle, 'str', name='Nickname', attrib={'val': varPoint[6]} )
54 |
55 |
56 | output_file = open( 'EvoxVar_Quantum.xml', 'w' )
57 | output_file.write( prettify(content) )
58 | output_file.close()
59 |
--------------------------------------------------------------------------------
/utilities/python/EvoxVar_Quantum.csv:
--------------------------------------------------------------------------------
1 | PointName,Href,ValueType,Slope,Offset,Authority,Nickname
2 | 0x0201DBFF,Auto,int,1,0,ReadOnly,$UnitSystemOverride
3 | 0x0201DBFE,Auto,bool,1,0,ReadWrite,$UnitOccSwitch
4 | 0x0201DBFD,Auto,bool,1,0,ReadWrite,$UnitSTInput
5 | 0x0201DBFC,Auto,bool,1,0,ReadWrite,$UnitRRInput
6 | 0x03010018,Auto,int,1,0,ReadOnly,$SFanSlewRatedCmd
7 | 0x03010017,Auto,int,1,0,ReadWrite,$SFanActingStatus
8 | 0x030100FF,Auto,int,1,0,ReadOnly,$SAState
9 | 0x030100FE,Auto,int,1,0,ReadOnly,$SFanState
10 | 0x030100FD,Auto,int,1,0,ReadOnly,$SAPressState
11 | 0x030100FC,Auto,int,1,0,ReadOnly,$SAPressHLDiagState
12 | 0x0301FF00,Auto,real,1,0,ReadOnly,$SoftloadingTarget
13 | 0x0301009A,Auto,int,1,0,ReadOnly,$SFMode
14 | 0x0301009B,Auto,bool,1,0,ReadWrite,$SFSTSetting
15 | 0x0301009C,Auto,bool,1,0,ReadWrite,$SFSTManualCmd
16 | 0x0301009E,Auto,bool,1,0,ReadOnly,$SFRapidRestartRequest
17 | 0x0301009F,Auto,bool,1,0,ReadOnly,$SFActiveSAOnOffRequestForAuto
18 | 0x030100A8,Auto,real,1,0,ReadWrite,$SFSpeedSTCmd
19 | 0x030100A9,Auto,bool,1,0,ReadWrite,$SFSpeedSTSetting
20 | 0x030100AA,Auto,int,1,0,ReadOnly,$SFSpeedRapidStartReqeust
21 | 0x030100AB,Auto,int,1,0,ReadWrite,$SFSpeedMode
22 | 0x030100AD,Auto,int,1,0,ReadWrite,$MuxSFSpeedRequest
23 | 0x0501000B,Auto,int,1,0,ReadWrite,$OADActingStatus
24 | 0x07010001,Auto,bool,1,0,ReadOnly,$EFanRelayCmd
25 | 0x07010002,Auto,real,1,0,ReadOnly,$EADVoltageCmd
26 | 0x07010003,Auto,bool,1,0,ReadWrite,$EFanProvingInput
27 | 0x07010004,Auto,bool,1,0,ReadWrite,$EAD_ActingIsReverse
28 | 0x07010005,Auto,int,1,0,ReadWrite,$EAD_StrokeTime
29 | 0x07010006,Auto,real,1,0,ReadWrite,$EAD_MinVoltage
30 | 0x07010007,Auto,real,1,0,ReadWrite,$EAD_MaxVoltage
31 | 0x07010008,Auto,int,1,0,ReadOnly,$EADActingStatus
32 | 0x07010009,Auto,real,1,0,ReadWrite,$ActiveEADPosRequest
33 | 0x0701000A,Auto,real,1,0,ReadWrite,$EADPosStatus
34 | 0x0701000B,Auto,bool,1,0,ReadWrite,$ActiveEFanOnOffRequest
35 | 0x0701000D,Auto,real,1,0,ReadWrite,$ActiveSpacePressInput
36 | 0x07010014,Auto,real,1,0,ReadWrite,$SP_PID_KP
37 | 0x070100FF,Auto,int,1,0,ReadOnly,$EA_DebugState
38 | 0x070100FE,Auto,int,1,0,ReadOnly,$EATrackOA_DebugState
39 | 0x070100FD,Auto,int,1,0,ReadOnly,$SP_DebugState
40 | 0x060100FF,Auto,int,1,0,ReadOnly,$RA_DebugState
41 | 0x1F010001,Auto,bool,1,0,ReadOnly,$VOMActiveMode
42 | 0x1F010002,Auto,int,1,0,ReadOnly,$VOMErrorCode
43 | 0x1F010031,Auto,bool,1,0,ReadWrite,$VOMSettingLockA
44 | 0x1F010032,Auto,bool,1,0,ReadWrite,$VOMSettingLockB
45 | 0x1F010033,Auto,bool,1,0,ReadWrite,$VOMSettingLockC
46 | 0x1F010034,Auto,bool,1,0,ReadWrite,$VOMSettingLockD
47 | 0x1F010035,Auto,bool,1,0,ReadWrite,$VOMSettingLockE
48 | 0x1F010040,Auto,bool,1,0,ReadOnly,$VOMActiveSFan
49 | 0x1F010041,Auto,bool,1,0,ReadWrite,$VOMSFanA
50 | 0x1F010042,Auto,bool,1,0,ReadWrite,$VOMSFanB
51 | 0x1F010043,Auto,bool,1,0,ReadWrite,$VOMSFanC
52 | 0x1F010044,Auto,bool,1,0,ReadWrite,$VOMSFanD
53 | 0x1F010045,Auto,bool,1,0,ReadWrite,$VOMSFanE
54 | 0x1F010050,Auto,int,1,0,ReadOnly,$VOMActiveSFanSpeed
55 | 0x1F010051,Auto,int,1,0,ReadWrite,$VOMSFanSpeedA
56 | 0x1F010052,Auto,int,1,0,ReadWrite,$VOMSFanSpeedB
57 | 0x1F010053,Auto,int,1,0,ReadWrite,$VOMSFanSpeedC
58 | 0x1F010054,Auto,int,1,0,ReadWrite,$VOMSFanSpeedD
59 | 0x1F010055,Auto,int,1,0,ReadWrite,$VOMSFanSpeedE
60 | 0x1F010060,Auto,int,1,0,ReadOnly,$VOMActiveEFan
61 | 0x1F010070,Auto,int,1,0,ReadOnly,$VOMActiveRFan
62 | 0x1F010065,Auto,int,1,0,ReadWrite,$VOMEFanE
63 | 0x1F0100A5,Auto,int,1,0,ReadWrite,$VOMHeatE
64 | 0x1F0100B5,Auto,int,1,0,ReadWrite,$VOMOccRelayE
65 |
--------------------------------------------------------------------------------
/utilities/python/EvoxVar_RTAF.csv:
--------------------------------------------------------------------------------
1 | PointName,Href,ValueType,Slope,Offset,Authority,Nickname
2 | Current Setpoint Cprsr1A,/evox/var/Cmprsr1CurrentStpt/,real,1,0,ReadOnly,NULL
3 | Fan Control Diff Pressure Setpoint,/evox/var/CndFan1FanCtrlDiffPressStpt/,real,1,0,ReadWrite,NULL
4 | 0x00010002,Auto,real,1,0,ReadWrite,AAA
5 | 0x00010003,Auto,real,1,0,ReadWrite,BBB
6 | 0x00010004,Auto,real,1,0,ReadWrite,CCC
7 | 0x0401000D,Auto,real,1,0,ReadWrite,DDD
8 | 0x04010029,Auto,real,1,0,ReadWrite,EEE
9 | 0x22010068,Auto,real,1,0,ReadWrite,FFF
10 |
--------------------------------------------------------------------------------
/utilities/python/EvoxVar_RTAF.xml:
--------------------------------------------------------------------------------
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 |
--------------------------------------------------------------------------------
/utilities/python/EvoxVar_test.py:
--------------------------------------------------------------------------------
1 | # This script is to generate source config file for Lobster
2 | # It currently supports EvoxVar - 2016.3.15
3 | #
4 | # - Written by Steve Cai
5 | # Copyright (C) 2015 by The Trane Company
6 |
7 |
8 | from xml.etree import ElementTree
9 | from xml.etree.ElementTree import Element
10 | from xml.etree.ElementTree import SubElement
11 | from xml.dom import minidom
12 |
13 | import httplib
14 |
15 | headers = {"Content-type": "xml"}
16 |
17 | httpClient = httplib.HTTPConnection("192.168.1.3/evox/", 80, timeout=30)
18 | httpClient.connect()
19 |
20 | ##httpClient.request('GET', '/evox/var')
21 | ##response = httpClient.getresponse()
22 | ##
23 | ##httpClient.request("POST", "/evox/var", "readAll", headers)
24 | ##
25 | ##response = httpClient.getresponse()
26 | ##print response.status
27 | ##print response.reason
28 | ##print response.read()
29 | ##print response.getheaders()
30 |
31 |
32 |
33 | def prettify(elem):
34 | # Return a pretty-printed XML string for the Element. #
35 | rough_string = ElementTree.tostring(elem, 'utf-8')
36 | reparsed = minidom.parseString(rough_string)
37 | return reparsed.toprettyxml(indent=" ")
38 |
39 | ##tree = ElementTree.ElementTree(file='VariablesObix.xml')
40 | ##root = tree.getroot()
41 | ##dataInfoList = root[1]
42 | ##print dataInfoList.attrib
43 | ##for dataInfo in dataInfoList:
44 | ## print dataInfo.attrib['href']
45 |
46 |
47 | ##content = Element( 'obj', attrib={'is': 'Evox Var Config'} )
48 | ##listEle = SubElement( content, 'list', attrib={'is': 'Var Points'} )
49 | ##
50 | ##
51 | ##for varPoint in obj:
52 | ## objEle = SubElement( listEle, 'obj', attrib={'is': 'Point'} )
53 | ## SubElement(objEle, 'str', name='PointName', attrib={'val': varPoint[0]} )
54 | ## SubElement(objEle, 'str', name='Href', attrib={'val': varPoint[1]} )
55 | ## SubElement(objEle, 'str', name='ValueType', attrib={'val': varPoint[2]} )
56 | ## SubElement(objEle, 'real', name='Slope', attrib={'val': varPoint[3]} )
57 | ## SubElement(objEle, 'real', name='Offset', attrib={'val': varPoint[4]} )
58 | ## SubElement(objEle, 'str', name='Authority', attrib={'val': varPoint[5]} )
59 | ## SubElement(objEle, 'str', name='Nickname', attrib={'val': varPoint[6]} )
60 | ##
61 | ##
62 | ##output_file = open( 'EvoxVar_RTAF.xml', 'w' )
63 | ##output_file.write( prettify(content) )
64 | ##output_file.close()
65 |
--------------------------------------------------------------------------------
/utilities/python/en-US.lzma:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lotusczp/Lobster/ceb5ec720fdbbd5eddba5eeccc2f875a62d4332e/utilities/python/en-US.lzma
--------------------------------------------------------------------------------
/utilities/python/nti_config.csv:
--------------------------------------------------------------------------------
1 | Name,Address,IsPU,Authority,Type
2 | IA,0x0101,TRUE,RO,Input
3 | IB,0x0102,TRUE,RO,Input
4 | IC,0x0103,TRUE,RO,Input
5 | Vdc,0x0104,TRUE,RO,Input
6 | angle,0x0105,TRUE,RO,Input
7 | IdFdb,0x0106,TRUE,RO,Input
8 | IqFdb,0x0107,TRUE,RO,Input
9 | SpdFdb,0x0108,TRUE,RO,Input
10 | Vd,0x0109,TRUE,RO,Input
11 | Vq,0x010A,TRUE,RO,Input
12 | Vdq,0x010B,TRUE,RO,Input
13 | InputReserved1,0x010C,TRUE,RO,Input
14 | InputReserved2,0x010D,TRUE,RO,Input
15 | enablePwm,0x0201,FALSE,RW,Register
16 | enableRelay,0x0202,FALSE,RW,Register
17 | IdRef,0x0203,TRUE,RW,Register
18 | IdKp,0x0204,TRUE,RW,Register
19 | IdKi,0x0205,TRUE,RW,Register
20 | IqRef,0x0206,TRUE,RW,Register
21 | IqKp,0x0207,TRUE,RW,Register
22 | IqKi,0x0208,TRUE,RW,Register
23 | SpdRef,0x0209,TRUE,RW,Register
24 | SpdKp,0x020A,TRUE,RW,Register
25 | SpdKi,0x020B,TRUE,RW,Register
26 | Vref,0x020C,TRUE,RW,Register
27 | FreqRef,0x020D,TRUE,RW,Register
28 | RegReserved1,0x020E,TRUE,RW,Register
29 | RegReserved2,0x020F,TRUE,RW,Register
30 |
--------------------------------------------------------------------------------
/utilities/python/nti_config.py:
--------------------------------------------------------------------------------
1 | import json
2 | import csv
3 |
4 |
5 | # open and parse csv file
6 | with open('nti_config.csv', 'rb') as csvfile:
7 | reader = csv.reader(csvfile)
8 | lineNum = 0
9 | obj = []
10 | for line in reader:
11 | lineNum = lineNum + 1
12 | if lineNum > 1: #skip the first line
13 | obj.append( line )
14 |
15 | # transmit it to the json object
16 | pyObj = {}
17 | pointArray = []
18 |
19 | for lineEle in obj:
20 | data = {}
21 | data["Name"] = lineEle[0]
22 | data["Address"] = lineEle[1]
23 | data["IsPU"] = lineEle[2]
24 | data["Authority"] = lineEle[3]
25 | data["Type"] = lineEle[4]
26 | pointArray.append(data)
27 |
28 | pyObj["PointList"] = pointArray
29 | pyObj["SlaveAddress"] = 0x01
30 |
31 | jsonObj = json.dumps(pyObj, encoding="gbk", sort_keys=True, indent=4, separators=(',', ': '))
32 | print(jsonObj)
33 |
34 | with open('nti_config.json', 'w') as f:
35 | f.write(jsonObj)
36 |
37 |
38 | # end of script
39 |
--------------------------------------------------------------------------------
/xerces-c_3_1_usi.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lotusczp/Lobster/ceb5ec720fdbbd5eddba5eeccc2f875a62d4332e/xerces-c_3_1_usi.dll
--------------------------------------------------------------------------------