/*
-----------------------------------------------------------------------------
This source file is part of OpenSpace3D
For the latest info, see http://www.openspace3d.com
Copyright (c) 2012 I-maginer
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by the Free Software
Foundation; either version 2 of the License, or (at your option) any later
version.
This program is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License along with
this program; if not, write to the Free Software Foundation, Inc., 59 Temple
Place - Suite 330, Boston, MA 02111-1307, USA, or go to
http://www.gnu.org/copyleft/lesser.txt
-----------------------------------------------------------------------------
*/
/*
Version : 1.0
First version : 05/08/2010
Author : Hamza Hamdi
*/
/*! \brief Callback on plugIT instance editor closed
*
* Prototype: fun [] [[S S] r1]
*
* \return [[S S] r1] : parameters to save in the instance XML data
**/
fun cbCloseEdit(p)=
let p -> [ctrlhr ctrlspo2 ctrlFormat ctrlinit] in
let getEdCtrlCheckState ctrlhr -> hr in
let getEdCtrlCheckState ctrlspo2 -> spo2 in
let getSelectedEdCtrlSelect ctrlFormat -> formatName in
let getEdCtrlCheckState ctrlinit -> init in
["hr" itoa hr]::
["spo2" itoa spo2]::
["format" formatName]::
["oninit" itoa init]::
nil;;
/*! \brief Callback on plugIT instance editor opened
*
* Prototype: fun [EdWindow PInstance V3Dview] I
*
* \param EdWindow : editor window structure
* \param PInstance : plugIT instance
* \param V3Dview : default 3D view structure
*
* \return @fun [] [[S S] r1] : Callback to call on close
**/
fun dynamicedit(winstr, inst, viewstr, applybtn)=
let [400 200] -> [iw ih] in
(
setEdWindowSize winstr iw ih;
let atoi (getPluginInstanceParam inst "hr") -> hr in
let atoi (getPluginInstanceParam inst "spo2") -> spo2 in
let atoi (getPluginInstanceParam inst "oninit") -> init in
let getPluginInstanceParam inst "format" -> format in
let if hr == nil then 1 else hr -> hr in
let if spo2 == nil then 1 else spo2 -> spo2 in
let if init == nil then 1 else init -> init in
let getPluginInstanceParam inst "format" -> format in
let if format == nil then "Average using 4 value" else format -> format in
let crEdCtrlLabel winstr 10 10 100 20 (loc "OS3DNONIN_0006") nil -> labelFormat in
let crEdCtrlSelect winstr 120 8 210 150 CB_AHSCROLL -> ctrlFormat in
let crEdCtrlCheck winstr 10 30 280 20 (loc "OS3DNONIN_0007") EDWIN_RESIZE_MW -> ctrlhr in
let crEdCtrlCheck winstr 10 60 280 20 (loc "OS3DNONIN_0008") EDWIN_RESIZE_MW -> ctrlspo2 in
let crEdCtrlCheck winstr 10 90 280 20 (loc "OS3DNONIN_0005") EDWIN_RESIZE_MW -> ctrlinit in
(
fillEdCtrlSelect ctrlFormat "Average using 1 value (only spo2)"::"Average using 4 value"::"Average using 8 value"::nil;
selectEdCtrlSelect ctrlFormat format;
setEdCtrlCheckState ctrlhr hr;
setEdCtrlCheckState ctrlspo2 spo2;
setEdCtrlCheckState ctrlinit init;
[mkfun1 @cbCloseEdit [ctrlhr ctrlspo2 ctrlFormat ctrlinit] nil];
);
);;