mirror of
https://gitlab.com/eql/lqml.git
synced 2025-12-06 02:30:38 -08:00
example 'meshtastic': some fixes
This commit is contained in:
parent
4c39d57633
commit
05bec3c58b
4 changed files with 15 additions and 8 deletions
|
|
@ -101,7 +101,7 @@ QVariant QT::lastPosition() {
|
|||
#ifdef Q_OS_ANDROID
|
||||
pos << getDoubleField("_position_lat_")
|
||||
<< getDoubleField("_position_lon_")
|
||||
<< QString::number(getLongField("_position_time_")); // 'QString': see QML 'lastPosition()'
|
||||
<< QString::number(getLongField("_position_time_") / 1000); // 'QString': see QML 'lastPosition()'
|
||||
#endif
|
||||
return pos;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -189,20 +189,24 @@
|
|||
(text (qfrom-utf8 payload)))
|
||||
(setf msg:*message-id* (max mid msg:*message-id*))
|
||||
(if (x:starts-with ":e" text) ; 'echo'
|
||||
(qsingle-shot 1000 (lambda () (send-message (x:cc "<b>echo:</b>" (subseq text #.(length ":e"))))))
|
||||
(progn
|
||||
#+mobile
|
||||
(qlater 'loc:update-my-position)
|
||||
(qsingle-shot 2000 (lambda () (send-message (x:cc "<b>echo:</b>" (subseq text #.(length ":e")))))))
|
||||
(progn
|
||||
(when (x:starts-with "<b>echo:</b>" text)
|
||||
;; send convenient response containing signal info, position, distance
|
||||
(let ((pos (getf loc:*positions* (me:from packet)))
|
||||
(my-pos (loc:last-gps-position)))
|
||||
(setf text (format nil "~A~%~%snr: <b>~F</b> rssi: <b>~D</b>~%lat: ~F lon: ~F~%distance: <b>~:D m</b>"
|
||||
(my-pos #+mobile (loc:last-gps-position)
|
||||
#-mobile nil))
|
||||
(setf text (format nil "~A~%~%snr: <b>~F</b> rssi: <b>~D</b>~%lat: ~,5F lon: ~,5F~%distance: <b>~:D m</b>"
|
||||
text
|
||||
(me:rx-snr packet)
|
||||
(me:rx-rssi packet)
|
||||
(if pos (getf pos :lat) "-")
|
||||
(if pos (getf pos :lon) "-")
|
||||
(if my-pos (first my-pos) "-")
|
||||
(if my-pos (second my-pos) "-")
|
||||
(if (and pos my-pos)
|
||||
(loc:distance (cons (first my-pos) (second my-pos))
|
||||
(loc:distance (cons (first my-pos) (second my-pos))
|
||||
(cons (getf pos :lat) (getf pos :lon)))
|
||||
"-")))))
|
||||
(msg:add-message
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@
|
|||
#:*edit*
|
||||
#:*group*
|
||||
#:*group-icon*
|
||||
#:*group-view*
|
||||
#:*find*
|
||||
#:*find-text*
|
||||
#:*loading*
|
||||
|
|
@ -27,6 +28,7 @@
|
|||
(defparameter *edit* "edit")
|
||||
(defparameter *group* "group")
|
||||
(defparameter *group-icon* "group_icon")
|
||||
(defparameter *group-view* "group_view")
|
||||
(defparameter *find* "find")
|
||||
(defparameter *find-text* "find_text")
|
||||
(defparameter *loading* "loading")
|
||||
|
|
|
|||
|
|
@ -32,6 +32,7 @@ Rectangle {
|
|||
|
||||
ListView {
|
||||
id: view
|
||||
objectName: "group_view"
|
||||
anchors.topMargin: rowModem.height
|
||||
anchors.fill: parent
|
||||
anchors.margins: 9
|
||||
|
|
@ -65,7 +66,7 @@ Rectangle {
|
|||
}
|
||||
|
||||
if (person.current) {
|
||||
view.currentIndex = view.count - 1
|
||||
view.currentIndex = i
|
||||
view.positionViewAtIndex(view.currentIndex, ListView.Contain)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue