projects
/
clnl
/ blobdiff
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
UI/Model Parse - Sliders - WIP
[clnl]
/
src
/
main
/
main.lisp
diff --git
a/src/main/main.lisp
b/src/main/main.lisp
index f7379786669763f6adc54d22b68a2972526c47cf..920e4e8445d69143a036710ead791d7e1233d335 100644
(file)
--- a/
src/main/main.lisp
+++ b/
src/main/main.lisp
@@
-57,6
+57,8
@@
DESCRIPTION:
(*package* *model-package*))
(eval netlogoed-lisp)))
(*package* *model-package*))
(eval netlogoed-lisp)))
+(defvar *commands-mutex* (sb-thread:make-mutex))
+
(defun run-commands (cmds)
"RUN-COMMANDS CMDS => RESULT
(defun run-commands (cmds)
"RUN-COMMANDS CMDS => RESULT
@@
-69,8
+71,11
@@
DESCRIPTION:
RUN-COMMANDS will take NetLogo commands, put them through the various
stages need to turn them into Common Lisp code, and run it."
RUN-COMMANDS will take NetLogo commands, put them through the various
stages need to turn them into Common Lisp code, and run it."
- (clnl-nvm:with-stop-handler
- (funcall *callback* cmds)))
+
+ ; This mutex is a necessary because we haven't yet moved to a job thread
+ (sb-thread:with-mutex (*commands-mutex*)
+ (clnl-nvm:with-stop-handler
+ (funcall *callback* cmds))))
(defun run-reporter (reporter)
"RUN-REPORTER REPORTER => RESULT
(defun run-reporter (reporter)
"RUN-REPORTER REPORTER => RESULT
@@
-217,7
+222,11
@@
EXAMPLES:
,@(when initialize-interface
`((clnl-interface:initialize
:dims ',(clnl-model:world-dimensions model)
,@(when initialize-interface
`((clnl-interface:initialize
:dims ',(clnl-model:world-dimensions model)
- :buttons ',(clnl-model:buttons model)))))))))
+ :view ',(clnl-model:view model)
+ :buttons ',(clnl-model:buttons model)
+ :textboxes ',(clnl-model:textboxes model)
+ :sliders ',(clnl-model:sliders model)
+ :switches ',(clnl-model:switches model)))))))))
(setf (documentation 'model->single-form-lisp 'function)
"MODEL->SINGLE-FORM-LISP MODEL &key SEED INITIALIZE-INTERFACE NETLOGO-CALLBACK => FORM
(setf (documentation 'model->single-form-lisp 'function)
"MODEL->SINGLE-FORM-LISP MODEL &key SEED INITIALIZE-INTERFACE NETLOGO-CALLBACK => FORM
@@
-271,7
+280,11
@@
DESCRIPTION:
,@(when initialize-interface
`((clnl-interface:initialize
:dims ',(clnl-model:world-dimensions model)
,@(when initialize-interface
`((clnl-interface:initialize
:dims ',(clnl-model:world-dimensions model)
- :buttons ',(clnl-model:buttons model)))))
+ :view ',(clnl-model:view model)
+ :buttons ',(clnl-model:buttons model)
+ :textboxes ',(clnl-model:textboxes model)
+ :sliders ',(clnl-model:sliders model)
+ :switches ',(clnl-model:switches model)))))
,@(when netlogo-callback-fn
`((defun ,netlogo-callback-fn (,(intern "NETLOGO-CODE" *model-package*))
,(netlogo-callback-body prims))))))))
,@(when netlogo-callback-fn
`((defun ,netlogo-callback-fn (,(intern "NETLOGO-CODE" *model-package*))
,(netlogo-callback-body prims))))))))