move *probe* to clog-gui

This commit is contained in:
David Botton 2024-06-02 14:56:21 -04:00
parent 9ed9267d49
commit 46c1f230dd
3 changed files with 8 additions and 7 deletions

View file

@ -98,6 +98,7 @@
(dialog-out-stream class) (dialog-out-stream class)
(clog-break function) (clog-break function)
(clog-probe macro) (clog-probe macro)
(*probe* variable)
(*clog-debug-instance* variable) (*clog-debug-instance* variable)
"CLOG-GUI - Look and Feel" "CLOG-GUI - Look and Feel"
@ -118,6 +119,7 @@
;; CLOG GUI based ebugger settings ;; CLOG GUI based ebugger settings
(defparameter *clog-debug-instance* nil (defparameter *clog-debug-instance* nil
"Default location to open debugger windows") "Default location to open debugger windows")
(defvar *probe* nil "Result value of a probe")
;; Menus ;; Menus
(defparameter *menu-bar-class* "w3-bar w3-black w3-card-4") (defparameter *menu-bar-class* "w3-bar w3-black w3-card-4")
@ -297,7 +299,7 @@ the moment pressed. When time-out is nil, :q quits the probe and cancel
repeats the probe with out changing value. When time-out is nil modal is repeats the probe with out changing value. When time-out is nil modal is
always nil. If auto-probe is set, modal and time-out is set to nil and the always nil. If auto-probe is set, modal and time-out is set to nil and the
probe is run again in auto-probe seconds. If not tile is set, the symbol is probe is run again in auto-probe seconds. If not tile is set, the symbol is
used for title. If save-value is true clog-user:*probe* is set to value of used for title. If save-value is true clog-gui:*probe* is set to value of
symbol before any change is made by dialog." symbol before any change is made by dialog."
`(let ((body (or ,clog-body `(let ((body (or ,clog-body
*clog-debug-instance*)) *clog-debug-instance*))
@ -311,7 +313,7 @@ symbol before any change is made by dialog."
(setf value (ppcre:regex-replace-all "<" value "&lt;")) (setf value (ppcre:regex-replace-all "<" value "&lt;"))
(setf value (ppcre:regex-replace-all ">" value "&gt;")) (setf value (ppcre:regex-replace-all ">" value "&gt;"))
(when ,save-value (when ,save-value
(setf clog-user:*probe* ovalue)) (setf clog-gui:*probe* ovalue))
(input-dialog body (input-dialog body
(format nil "Probe in thread ~A :<br><code>~A</code> New Value?" (format nil "Probe in thread ~A :<br><code>~A</code> New Value?"
(bordeaux-threads:thread-name (bordeaux-threads:thread-name
@ -351,7 +353,7 @@ symbol before any change is made by dialog."
:title (format nil "clog-probe ~A" title)) :title (format nil "clog-probe ~A" title))
:q) :q)
(when ,save-value (when ,save-value
(setf clog-user:*probe* ovalue)) (setf clog-gui:*probe* ovalue))
(return))))) (return)))))
:name (format nil "clog-probe ~A" title)))))) :name (format nil "clog-probe ~A" title))))))

View file

@ -22,14 +22,13 @@
(defpackage #:clog-user (defpackage #:clog-user
(:use #:cl #:clog #:clog-gui #:clog-web) (:use #:cl #:clog #:clog-gui #:clog-web)
(:import-from :clog-tools #:clog-builder-probe) (:import-from :clog-tools #:clog-builder-probe)
(:export :*body* :*probe* :clog-repl)) (:export :*body* :clog-repl))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Implementation - CLOG Utilities ;; Implementation - CLOG Utilities
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defvar clog-user:*body* nil "clog-repl access to body") (defvar clog-user:*body* nil "clog-repl access to body")
(defvar clog-user:*probe* nil "Used by probes to return value of symbol")
;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;
;; clog-install-dir ;; ;; clog-install-dir ;;

View file

@ -1,10 +1,10 @@
(in-package :clog-tools) (in-package :clog-tools)
(defparameter *inspectors* (defparameter *inspectors*
`((:name "Set object to clog-user:*probe*" `((:name "Set object to clog-gui:*probe*"
:func ,(lambda (symbol title value clog-obj) :func ,(lambda (symbol title value clog-obj)
(declare (ignore title value clog-obj)) (declare (ignore title value clog-obj))
(setf clog-user:*probe* symbol))) (setf clog-gui:*probe* symbol)))
(:name "Print to Console" (:name "Print to Console"
:func ,(lambda (symbol title value clog-obj) :func ,(lambda (symbol title value clog-obj)
(declare (ignore symbol)) (declare (ignore symbol))