(require 'cgn) (progn (use-package :cgn) (use-package :ltk) (load "newrandomseheult.lisp")) (defun sgui () (with-ltk () (let* ((f (make-instance 'frame)) (l00 (make-instance 'label :master nil :text "Seheult GUI")) (scalex (make-instance 'scale :master f :label "X-RI" :digits 6 :troughcolor 'cyan :resolution .001 :from 1.4 :to 1.6)) (scaley (make-instance 'scale :master f :label "Y-RI" :troughcolor 'cyan :resolution .001 :from 1.4 :to 1.6)) (scalesd (make-instance 'scale :master f :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 :label "mu" :digits 9 :troughcolor 'orange :resolution 1.5181932 :from 1.5181932 :to 15.181932)) (scaletau (make-instance 'scale :master f3 :label "tau" :digits 9 :troughcolor 'orange :resolution 0.0036737733 :from 0.0036737733 :to 0.036737733)) (f2 (make-instance 'frame)) (l1 (make-instance 'label :master f2)) (b1 (make-instance 'button :master f2 :text "Seheultize me, Cap'n!" :command (lambda () (new-random-seheult 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-seheult (value scalex) (value scaley) (value scalesd) (value scalemu) (value scaletau)))) (with-gnuplot ( 'linux ) (format-gnuplot "reset") (format-gnuplot "set xlabel \"X - Refractive Index\"") (format-gnuplot "set ylabel \"Y - Refractive Index\"") (format-gnuplot "set zlabel \"Likelihood Ratio\"") (format-gnuplot "set-view 65,15") (set-title "Seheult Data") (format-gnuplot "splot 'randomdata.dat', 'sliderdata.dat'"))))) ) (pack f) (pack l00 :before f) (pack scalex :side :left) (pack scaley :side :left) (pack scalesd :side :right) (pack f3 :side :left) (pack l2) (pack scalemu :side :left) (pack scaletau :side :left) (pack f2 :side :bottom :after f) (pack l1) (pack b1) )))