Merge branch 'master' of github.com:collin80/SavvyCAN
This commit is contained in:
@@ -8,7 +8,7 @@ capturing of canbus frames.
|
|||||||
|
|
||||||
Please use the "Discussions" tab here on GitHub to ask questions and interact with the community.
|
Please use the "Discussions" tab here on GitHub to ask questions and interact with the community.
|
||||||
|
|
||||||
Requires at a resolution of at least 1024x768. Fully multi-monitor capable. Works on 4K monitors as well.
|
Requires a resolution of at least 1024x768. Fully multi-monitor capable. Works on 4K monitors as well.
|
||||||
|
|
||||||
You are highly recommended to use the
|
You are highly recommended to use the
|
||||||
[CANDue board from EVTV](http://store.evtv.me/proddetail.php?prod=ArduinoDueCANBUS&cat=23).
|
[CANDue board from EVTV](http://store.evtv.me/proddetail.php?prod=ArduinoDueCANBUS&cat=23).
|
||||||
@@ -16,7 +16,7 @@ You are highly recommended to use the
|
|||||||
The CANDue board must be running the GVRET firmware which can also be found
|
The CANDue board must be running the GVRET firmware which can also be found
|
||||||
within the collin80 repos.
|
within the collin80 repos.
|
||||||
|
|
||||||
It is now possible to use any QT SerialBus driver (socketcan, Vector, PeakCAN, TinyCAN).
|
It is now possible to use any Qt SerialBus driver (socketcan, Vector, PeakCAN, TinyCAN).
|
||||||
There may, however, be some loss of some functionality as
|
There may, however, be some loss of some functionality as
|
||||||
some functions of SavvyCAN are designed for use directly with the
|
some functions of SavvyCAN are designed for use directly with the
|
||||||
EVTVDue and CANDue 2.0 boards.
|
EVTVDue and CANDue 2.0 boards.
|
||||||
@@ -28,7 +28,7 @@ of this program. It can load and save in several formats:
|
|||||||
2. Microchip log file
|
2. Microchip log file
|
||||||
3. CRTD format (OVMS log file format from Mark Webb-Johnson)
|
3. CRTD format (OVMS log file format from Mark Webb-Johnson)
|
||||||
4. GVRET native format
|
4. GVRET native format
|
||||||
5. Generic CSV file (ID,D0 D1 D2 D3 D4 D5 D6 D7)
|
5. Generic CSV file (ID, D0 D1 D2 D3 D4 D5 D6 D7)
|
||||||
6. Vector Trace files
|
6. Vector Trace files
|
||||||
7. IXXAT Minilog files
|
7. IXXAT Minilog files
|
||||||
8. CAN-DO Logs
|
8. CAN-DO Logs
|
||||||
@@ -48,10 +48,10 @@ http://www.qcustomplot.com/
|
|||||||
However, this source code is integrated into the source for SavvyCAN and one isn't required
|
However, this source code is integrated into the source for SavvyCAN and one isn't required
|
||||||
to download it separately.
|
to download it separately.
|
||||||
|
|
||||||
This project requires 5.13.0 or higher because of a dependency on QtSerialBus and other new additions to QT.
|
This project requires 5.13.0 or higher because of a dependency on QtSerialBus and other new additions to Qt.
|
||||||
|
|
||||||
NOTE: QT6 currently lacks support for QtSerialBus and many other QT sub-features. At this time you cannot
|
NOTE: Qt6 currently lacks support for QtSerialBus and many other Qt sub-features. At this time you cannot
|
||||||
use QT6 to compile SavvyCAN. Support for QT6 should be possible around QT6.2.
|
use Qt6 to compile SavvyCAN. Support for Qt6 should be possible around Qt6.2.
|
||||||
|
|
||||||
## Instructions for compiling:
|
## Instructions for compiling:
|
||||||
|
|
||||||
|
|||||||
+11
-1
@@ -3966,7 +3966,17 @@ bool FrameFileIO::loadCabanaFile(QString filename, QVector<CANFrame>* frames)
|
|||||||
bytes[6] = ((tempData >> 8) & 0xFF);
|
bytes[6] = ((tempData >> 8) & 0xFF);
|
||||||
bytes[7] = (tempData & 0xFF);
|
bytes[7] = (tempData & 0xFF);
|
||||||
}
|
}
|
||||||
thisFrame.setPayload(bytes);
|
|
||||||
|
// Shift the bytes back correctly so we have a frame that is the proper length
|
||||||
|
unsigned int framelength = tokens[3].length() / 2;
|
||||||
|
QByteArray finalbytes(framelength,0);
|
||||||
|
uint8_t bytes_shifted_by = 8 - framelength;
|
||||||
|
for (unsigned int j = 0; j < framelength; j++)
|
||||||
|
{
|
||||||
|
finalbytes[j] = bytes[j + bytes_shifted_by];
|
||||||
|
}
|
||||||
|
|
||||||
|
thisFrame.setPayload(finalbytes);
|
||||||
frames->append(thisFrame);
|
frames->append(thisFrame);
|
||||||
}
|
}
|
||||||
else foundErrors = true;
|
else foundErrors = true;
|
||||||
|
|||||||
+33
-2
@@ -54,6 +54,7 @@ protected:
|
|||||||
private:
|
private:
|
||||||
QSet<QString> m_keywords;
|
QSet<QString> m_keywords;
|
||||||
QSet<QString> m_knownIds;
|
QSet<QString> m_knownIds;
|
||||||
|
QSet<QString> m_customIds;
|
||||||
QHash<JSEdit::ColorComponent, QColor> m_colors;
|
QHash<JSEdit::ColorComponent, QColor> m_colors;
|
||||||
QString m_markString;
|
QString m_markString;
|
||||||
Qt::CaseSensitivity m_markCaseSensitivity;
|
Qt::CaseSensitivity m_markCaseSensitivity;
|
||||||
@@ -73,6 +74,7 @@ JSHighlighter::JSHighlighter(QTextDocument *parent)
|
|||||||
m_colors[JSEdit::Keyword] = QColor("#000080");
|
m_colors[JSEdit::Keyword] = QColor("#000080");
|
||||||
m_colors[JSEdit::BuiltIn] = QColor("#008080");
|
m_colors[JSEdit::BuiltIn] = QColor("#008080");
|
||||||
m_colors[JSEdit::Marker] = QColor("#ffff00");
|
m_colors[JSEdit::Marker] = QColor("#ffff00");
|
||||||
|
m_colors[JSEdit::Custom] = QColor("#ff00ff");
|
||||||
|
|
||||||
// https://developer.mozilla.org/en/JavaScript/Reference/Reserved_Words
|
// https://developer.mozilla.org/en/JavaScript/Reference/Reserved_Words
|
||||||
m_keywords << "break";
|
m_keywords << "break";
|
||||||
@@ -249,6 +251,27 @@ JSHighlighter::JSHighlighter(QTextDocument *parent)
|
|||||||
m_knownIds << "window";
|
m_knownIds << "window";
|
||||||
m_knownIds << "navigator";
|
m_knownIds << "navigator";
|
||||||
m_knownIds << "userAgent";
|
m_knownIds << "userAgent";
|
||||||
|
|
||||||
|
//Custom objects
|
||||||
|
m_customIds << "host";
|
||||||
|
m_customIds << "can";
|
||||||
|
m_customIds << "isotp";
|
||||||
|
m_customIds << "uds";
|
||||||
|
//Custom callback functions
|
||||||
|
m_customIds << "setup";
|
||||||
|
m_customIds << "tick";
|
||||||
|
m_customIds << "gotCANFrame";
|
||||||
|
m_customIds << "gotISOTPMessage";
|
||||||
|
m_customIds << "gotUDSMessage";
|
||||||
|
//Custom functions
|
||||||
|
m_customIds << "setTickInterval";
|
||||||
|
m_customIds << "log"; //Duplicate
|
||||||
|
m_customIds << "addParameter";
|
||||||
|
m_customIds << "setFilter";
|
||||||
|
m_customIds << "clearFilters";
|
||||||
|
m_customIds << "sendFrame";
|
||||||
|
m_customIds << "sendISOTP";
|
||||||
|
m_customIds << "sendUDS";
|
||||||
}
|
}
|
||||||
|
|
||||||
void JSHighlighter::setColor(JSEdit::ColorComponent component, const QColor &color)
|
void JSHighlighter::setColor(JSEdit::ColorComponent component, const QColor &color)
|
||||||
@@ -271,6 +294,7 @@ void JSHighlighter::highlightBlock(const QString &text)
|
|||||||
};
|
};
|
||||||
|
|
||||||
QList<int> bracketPositions;
|
QList<int> bracketPositions;
|
||||||
|
QString previousToken;
|
||||||
|
|
||||||
int blockState = previousBlockState();
|
int blockState = previousBlockState();
|
||||||
int bracketLevel = blockState >> 4;
|
int bracketLevel = blockState >> 4;
|
||||||
@@ -351,10 +375,17 @@ void JSHighlighter::highlightBlock(const QString &text)
|
|||||||
case Identifier:
|
case Identifier:
|
||||||
if (ch.isSpace() || !(ch.isDigit() || ch.isLetter() || ch == '_')) {
|
if (ch.isSpace() || !(ch.isDigit() || ch.isLetter() || ch == '_')) {
|
||||||
QString token = text.mid(start, i - start).trimmed();
|
QString token = text.mid(start, i - start).trimmed();
|
||||||
if (m_keywords.contains(token))
|
if (m_customIds.contains(token) && m_customIds.contains(previousToken)) {
|
||||||
|
setFormat(start, i - start, m_colors[JSEdit::Custom]);
|
||||||
|
} else if (m_keywords.contains(token)) {
|
||||||
setFormat(start, i - start, m_colors[JSEdit::Keyword]);
|
setFormat(start, i - start, m_colors[JSEdit::Keyword]);
|
||||||
else if (m_knownIds.contains(token))
|
} else if (m_knownIds.contains(token)) {
|
||||||
setFormat(start, i - start, m_colors[JSEdit::BuiltIn]);
|
setFormat(start, i - start, m_colors[JSEdit::BuiltIn]);
|
||||||
|
if (ch == '.') previousToken = token;
|
||||||
|
} else if (m_customIds.contains(token)) {
|
||||||
|
setFormat(start, i - start, m_colors[JSEdit::Custom]);
|
||||||
|
if (ch == '.') previousToken = token;
|
||||||
|
}
|
||||||
state = Start;
|
state = Start;
|
||||||
} else {
|
} else {
|
||||||
++i;
|
++i;
|
||||||
|
|||||||
@@ -57,6 +57,7 @@ public:
|
|||||||
Identifier,
|
Identifier,
|
||||||
Keyword,
|
Keyword,
|
||||||
BuiltIn,
|
BuiltIn,
|
||||||
|
Custom,
|
||||||
Sidebar,
|
Sidebar,
|
||||||
LineNumber,
|
LineNumber,
|
||||||
Cursor,
|
Cursor,
|
||||||
|
|||||||
@@ -21,6 +21,12 @@ ScriptingWindow::ScriptingWindow(const QVector<CANFrame> *frames, QWidget *paren
|
|||||||
editor->setEnabled(false);
|
editor->setEnabled(false);
|
||||||
editor->setFont(QFont("Monospace", 12));
|
editor->setFont(QFont("Monospace", 12));
|
||||||
editor->show();
|
editor->show();
|
||||||
|
|
||||||
|
//Show whitespaces
|
||||||
|
QTextOption option = editor->document()->defaultTextOption();
|
||||||
|
option.setFlags(QTextOption::ShowTabsAndSpaces);
|
||||||
|
editor->document()->setDefaultTextOption(option);
|
||||||
|
|
||||||
ui->verticalLayout->insertWidget(2,editor, 10);
|
ui->verticalLayout->insertWidget(2,editor, 10);
|
||||||
|
|
||||||
readSettings();
|
readSettings();
|
||||||
|
|||||||
+34
-10
@@ -18,8 +18,14 @@
|
|||||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLabel" name="label_4">
|
<widget class="QLabel" name="label_4">
|
||||||
|
<property name="font">
|
||||||
|
<font>
|
||||||
|
<weight>75</weight>
|
||||||
|
<bold>true</bold>
|
||||||
|
</font>
|
||||||
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Public Variables:</string>
|
<string>Public Variables</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="alignment">
|
<property name="alignment">
|
||||||
<set>Qt::AlignCenter</set>
|
<set>Qt::AlignCenter</set>
|
||||||
@@ -31,6 +37,12 @@
|
|||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLabel" name="label">
|
<widget class="QLabel" name="label">
|
||||||
|
<property name="font">
|
||||||
|
<font>
|
||||||
|
<weight>75</weight>
|
||||||
|
<bold>true</bold>
|
||||||
|
</font>
|
||||||
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Loaded Scripts</string>
|
<string>Loaded Scripts</string>
|
||||||
</property>
|
</property>
|
||||||
@@ -47,21 +59,21 @@
|
|||||||
<item>
|
<item>
|
||||||
<widget class="QPushButton" name="btnNewScript">
|
<widget class="QPushButton" name="btnNewScript">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>New</string>
|
<string>&New</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QPushButton" name="btnRemoveScript">
|
<widget class="QPushButton" name="btnRemoveScript">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Del</string>
|
<string>&Del</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QPushButton" name="btnLoadScript">
|
<widget class="QPushButton" name="btnLoadScript">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Load</string>
|
<string>&Load</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
@@ -73,6 +85,12 @@
|
|||||||
<layout class="QVBoxLayout" name="verticalLayout" stretch="0,0,0,4,0,0">
|
<layout class="QVBoxLayout" name="verticalLayout" stretch="0,0,0,4,0,0">
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLabel" name="label_2">
|
<widget class="QLabel" name="label_2">
|
||||||
|
<property name="font">
|
||||||
|
<font>
|
||||||
|
<weight>75</weight>
|
||||||
|
<bold>true</bold>
|
||||||
|
</font>
|
||||||
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Script Editing Window</string>
|
<string>Script Editing Window</string>
|
||||||
</property>
|
</property>
|
||||||
@@ -86,21 +104,21 @@
|
|||||||
<item>
|
<item>
|
||||||
<widget class="QPushButton" name="btnSaveScript">
|
<widget class="QPushButton" name="btnSaveScript">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Save</string>
|
<string>&Save</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QPushButton" name="btnRevertScript">
|
<widget class="QPushButton" name="btnRevertScript">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Revert</string>
|
<string>&Revert</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QPushButton" name="btnRecompile">
|
<widget class="QPushButton" name="btnRecompile">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Recompile</string>
|
<string>Re&compile</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
@@ -108,8 +126,14 @@
|
|||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLabel" name="label_3">
|
<widget class="QLabel" name="label_3">
|
||||||
|
<property name="font">
|
||||||
|
<font>
|
||||||
|
<weight>75</weight>
|
||||||
|
<bold>true</bold>
|
||||||
|
</font>
|
||||||
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Log Window:</string>
|
<string>Log Window</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="alignment">
|
<property name="alignment">
|
||||||
<set>Qt::AlignCenter</set>
|
<set>Qt::AlignCenter</set>
|
||||||
@@ -122,14 +146,14 @@
|
|||||||
<item>
|
<item>
|
||||||
<widget class="QCheckBox" name="cbAutoScroll">
|
<widget class="QCheckBox" name="cbAutoScroll">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Auto Scroll Log Window</string>
|
<string>&Auto Scroll Log Window</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QPushButton" name="btnClearLog">
|
<widget class="QPushButton" name="btnClearLog">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Clear Log Window</string>
|
<string>Clear Log &Window</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
|||||||
Reference in New Issue
Block a user