(require 'cgn) (progn (use-package :cgn) (use-package :ltk) (load "newrandomgrove.lisp")) (defun ggui () (with-ltk () (let* ((f (make-instance 'frame)) (l00 (make-instance 'label :master nil :text "Grove GUI")) (scalex (make-instance 'scale :master f :orientation 'horizontal :label "X-RI" :digits 6 :troughcolor 'cyan :resolution .001 :from 1.4 :to 1.6)) (scaley (make-instance 'scale :master f :orientation 'horizontal :label "Y-RI" :troughcolor 'cyan :resolution .001 :from 1.4 :to 1.6)) (scalesd (make-instance 'scale :master f :orientation 'horizontal :label "S.D." :troughcolor 'cyan :resolution .00001 :from .00001 :to .00025)) (f3 (make-instance 'frame)) (l2 (make-instance 'label :master f3 :text "NOTE: It is not recommended to change the orange sliders.")) (scalemu (make-instance 'scale :master f3 :orientation 'horizontal :label "mu" :digits 9 :troughcolor 'orange :resolution 1.5181932 :from 1.5181932 :to 15.181932)) (scaletau (make-instance 'scale :master f3 :orientation 'horizontal :label "tau" :digits 9 :troughcolor 'orange :resolution 0.0036737733 :from 0.0036737733 :to 0.036737733)) (canvas (make-instance 'canvas)) (image0 (make-image)) (image1 (make-image)) (image2 (make-image)) (f2 (make-instance 'frame)) (l1 (make-instance 'label :master f2)) (b1 (make-instance 'button :master f2 :text "Groveize me, Cap'n!" :command (lambda () (new-random-grove 1.4 1.6 (round (* 1.e5 (value scalesd))) (round (* 1.e5 (value scalesd))) (value scalemu) (value scaletau)) (setf (text l1) (format nil "Slider Data returns LR of: ~a." (handle-grove (value scalex) (value scaley) (value scalesd) (value scalemu) (value scaletau)))) (with-gnuplot ( 'linux ) (format-gnuplot "reset") (format-gnuplot "set xlabel \"X - RI\"") (format-gnuplot "set ylabel \"Y - RI\"") (format-gnuplot "set zlabel \"LR\"") (set-title "Grove Data") (format-gnuplot "set terminal gif") (format-gnuplot "set size .6,.6") (format-gnuplot "set view 65,15") (format-gnuplot "set output \"0.gif\"") (format-gnuplot "splot 'randomdata.dat', 'sliderdata.dat'") (format-gnuplot "set view 85,315") (format-gnuplot "set output \"1.gif\"") (format-gnuplot "splot 'randomdata.dat', 'sliderdata.dat'") (format-gnuplot "set view 0,360") (format-gnuplot "set output \"2.gif\"") (format-gnuplot "splot 'randomdata.dat', 'sliderdata.dat'") (sleep 1) (image-load image0 "0.gif") (image-load image1 "1.gif") (image-load image2 "2.gif") (create-image canvas 0 0 :image image0) (create-image canvas 0 289 :image image1) (create-image canvas 0 578 :image image2) ;(configure canvas :width 384) ;(configure canvas :height 865) ))))) (configure canvas :width 384) (configure canvas :height 865) (pack canvas :side :right) (pack f) (pack l00 :before f) (pack scalex :side :bottom) (pack scaley :side :bottom) (pack scalesd :side :bottom) (pack f3 :side :left) (pack l2) (pack scalemu :side :bottom) (pack scaletau :side :bottom) (pack f2 :side :bottom :after f) (pack l1) (pack b1) )))