/* ----------------------------------------------------------------------------- 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 ----------------------------------------------------------------------------- */ fun cbCloseEdit(p)= let p -> [ctrlamplitude ctrlperiod ctrloutputrate ctrloffest ctrlwaveform ctrlinit] in let getEdCtrlFloatValue ctrlamplitude -> amplitude in let ftoi (getEdCtrlFloatValue ctrlperiod) -> period in let ftoi (getEdCtrlFloatValue ctrloutputrate) -> outputrate in let getEdCtrlFloatValue ctrloffest -> offset in let getSelectedEdCtrlSelectPos ctrlwaveform -> waveform in let getEdCtrlCheckState ctrlinit -> init in ["waveform" itoa waveform]:: ["amplitude" ftoa amplitude]:: ["period" itoa period]:: ["outputrate" itoa outputrate]:: ["offset" ftoa offset]:: ["init" itoa init]:: nil;; fun dynamicedit(winstr, inst, viewstr, applybtn)= let [420 160] -> [iw ih] in ( setEdWindowSize winstr iw ih; let atoi (getPluginInstanceParam inst "waveform") -> waveform in let if (waveform == nil) then 0 else waveform -> waveform in let atof (getPluginInstanceParam inst "amplitude") -> amplitude in let if amplitude == nil then 1.0 else amplitude -> amplitude in let atoi (getPluginInstanceParam inst "period") -> period in let if period == nil then 2000 else period -> period in let atoi (getPluginInstanceParam inst "outputrate") -> outputrate in let if outputrate == nil then 60 else outputrate -> outputrate in let atof (getPluginInstanceParam inst "offset") -> offset in let if offset == nil then 0.0 else offset -> offset in let atoi (getPluginInstanceParam inst "init") -> init in let if (init == nil) then 1 else init -> init in let 10 -> ypos in let crEdCtrlLabel winstr 10 ypos + 2 170 20 (loc "OS3DSIGNAL_0004") nil -> labelwaveform in let crEdCtrlSelect winstr 180 ypos 170 120 EDWIN_RESIZE_MW -> ctrlwaveform in let crEdCtrlLabel winstr 10 (set ypos = ypos + 25) + 2 170 20 (loc "OS3DSIGNAL_0001") nil -> labelamplitude in let crEdCtrlFloat winstr 180 ypos 130 20 amplitude (-.100000.0) 100000.0 0.01 5 nil EDWIN_RESIZE_MW -> ctrlamplitude in let crEdCtrlLabel winstr 10 (set ypos = ypos + 25) + 2 170 20 (loc "OS3DSIGNAL_0002") nil -> labelperiod in let crEdCtrlFloat winstr 180 ypos 130 20 (itof period) 1.0 1000000.0 1.0 0 nil EDWIN_RESIZE_MW -> ctrlperiod in let crEdCtrlLabel winstr 10 (set ypos = ypos + 25) + 2 170 20 (loc "OS3DSIGNAL_0003") nil -> labeloutputrate in let crEdCtrlFloat winstr 180 ypos 130 20 (itof outputrate) 1.0 1000.0 1.0 0 nil EDWIN_RESIZE_MW -> ctrloutputrate in let crEdCtrlLabel winstr 10 (set ypos = ypos + 25) + 2 170 20 (loc "OS3DSIGNAL_0010") nil -> labeloffset in let crEdCtrlFloat winstr 180 ypos 130 20 offset (-.100000.0) 100000.0 0.01 5 nil EDWIN_RESIZE_MW -> ctrloffset in let crEdCtrlCheck winstr 10 (set ypos = ypos + 25) 280 20 (loc "OS3DSIGNAL_0005") EDWIN_RESIZE_MW -> ctrlinit in ( fillEdCtrlSelect ctrlwaveform (loc "OS3DSIGNAL_0006")::(loc "OS3DSIGNAL_0007")::(loc "OS3DSIGNAL_0008")::(loc "OS3DSIGNAL_0009")::nil; selectEdCtrlSelectByPos ctrlwaveform waveform; setEdCtrlCheckState ctrlinit init; [mkfun1 @cbCloseEdit [ctrlamplitude ctrlperiod ctrloutputrate ctrloffset ctrlwaveform ctrlinit] nil]; ); );;