At last I made the crossMeasure function work! All this time spent and the
only problem was a couple of additional curly brackets I was not writing!!!
So the functions look like this:
function crossMeasure(atomListN, atomListM){
set measurementUnits angstroms
set measurements 3
font measure 16 serif bold
var n = atomListM.length
for (var i = 2; i <= n; i++) {
script inline @{"measure @{{" + atomListN + ".ca/1.1}} @{{" +
atomListM + ".ca/" + i + ".1}}"}
}
}
function DELcrossMeasure(atomListN, atomListM){
var n = atomListM.length
for (var i = 2; i <= n; i++) {
script inline @{"measure delete @{{" + atomListN + ".ca/1.1}} @{{" +
atomListM + ".ca/" + i + ".1}}"}
}
}
And I call them like this:
$contenuto2 .= '<td><script>
jmolCheckbox("crossMeasure(\' '.$select_r.' \',\' '.$select_rmodel.'
\')", "DELcrossMeasure(\' '.$select_r.' \',\' '.$select_rmodel.' \')", "");
</script></td></tr>';
Fast and smooth! Thanks a lot for everything. Now how would I add an "echo"
showing the "show measurements" output??
Daniel
2011/4/1 Daniel Carbajo <[email protected]>
> OK I will try it again on Monday and let you know! Thanks!
>
>
> 2011/4/1 Robert Hanson <[email protected]>
>
>> May seem to work, but it isn't a general solution. Trust me, you need to
>> specify models the way I showed you and use script inline.
>>
>>
>> On Fri, Apr 1, 2011 at 10:19 AM, Daniel Carbajo <[email protected]
>> > wrote:
>>
>>> Well it might sound strange, but what really works for me is what I send
>>> you, i.e.: without script inline in the function, and calling the function
>>> adding the curly brackets and the .ca to the php variables.
>>> What I cannot make work anyhow is the other way, i.e.: with script inline
>>> in the function, and calling the function with just the php variables and
>>> escaped single quotes...
>>> It really works...
>>>
>>>
>>> 2011/4/1 Robert Hanson <[email protected]>
>>>
>>>> well, that won't work. See my previous posts.
>>>>
>>>>
>>>> On Fri, Apr 1, 2011 at 3:41 AM, Daniel Carbajo <
>>>> [email protected]> wrote:
>>>>
>>>>> At the end I left it like this (without script inline):
>>>>>
>>>>> function crossMeasure(atomListN, atomListM){
>>>>> set measurementUnits angstroms
>>>>> set measurements 3
>>>>> font measure 16 serif bold
>>>>> var n = atomListM.length
>>>>> for (var i = 2; i <= n; i++) {
>>>>> measure @{atomListN[1]} @{atomListM[i]}
>>>>> }
>>>>> }
>>>>>
>>>>> function DELcrossMeasure(atomListN, atomListM){
>>>>>
>>>>> var n = atomListM.length
>>>>> for (var i = 2; i <= n; i++) {
>>>>> measure delete @{atomListN[1]} @{atomListM[i]}
>>>>> }
>>>>> }
>>>>>
>>>>>
>>>>> And I call it like:
>>>>> $contenuto2 .= '<td><script>
>>>>>
>>>>> jmolCheckbox("crossMeasure({'.$select_r.'.ca},{'.$select_rmodel.'.ca})",
>>>>> "DELcrossMeasure({'.$select_r.'.ca},{'.$select_rmodel.'.ca})", "");
>>>>> </script></td></tr>';
>>>>>
>>>>>
>>>>> It would be nice to show the measure results anyhow, because when there
>>>>> are more than 2 homology models, it is hard to see the distance number
>>>>> (and
>>>>> also because I use some labels). Any way to show the measure results is
>>>>> ok,
>>>>> either as an "echo", an "alert", or in a message box like in the
>>>>> documentation examples. Which is the easiest way? Thanks a lot!
>>>>> Daniel
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> 2011/3/31 Robert Hanson <[email protected]>
>>>>>
>>>>>> sure, but you wouldn't do that inside the for loop. I think you are
>>>>>> confusing Jmol script and JavaScript. First, let's get the crossMeasure
>>>>>> working. What's the final form of that that works?
>>>>>>
>>>>>>
>>>>>> On Thu, Mar 31, 2011 at 4:48 AM, Daniel Carbajo <
>>>>>> [email protected]> wrote:
>>>>>>
>>>>>>> Thanks Bob, but I cannot make it work as an echo; if you remember the
>>>>>>> function you have helped me with these last days, I want to modify it
>>>>>>> so it
>>>>>>> looks something like this
>>>>>>>
>>>>>>> function crossMeasure(atomListN, atomListM){
>>>>>>> set measurementUnits angstroms
>>>>>>> set measurements 3
>>>>>>> font measure 16 serif bold
>>>>>>>
>>>>>>> set echo top left
>>>>>>> font echo 20 serif bolditalic
>>>>>>> color echo green
>>>>>>>
>>>>>>> var n = atomListM.length
>>>>>>> for (var i = 2; i <= n; i++) {
>>>>>>> measure @{atomListN[1]} @{atomListM[i]}
>>>>>>>
>>>>>>> var a =
>>>>>>> jmolGetPropertyAsArray('measurementInfo')[0].strMeasurement
>>>>>>> echo append a ????
>>>>>>> }
>>>>>>> }
>>>>>>>
>>>>>>> Is something like that possible?
>>>>>>>
>>>>>>>
>>>>>>> 2011/3/31 Robert Hanson <[email protected]>
>>>>>>>
>>>>>>>> Check this out:
>>>>>>>>
>>>>>>>>
>>>>>>>> jmolEvaluate('getProperty("measurementInfo")')
>>>>>>>>
>>>>>>>> this gives you the overall format of the measurementInfo data.
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> On Wed, Mar 30, 2011 at 8:46 AM, Daniel Carbajo <
>>>>>>>> [email protected]> wrote:
>>>>>>>>
>>>>>>>>> Hello everybody,
>>>>>>>>> does any of you know if it is possible to display the output of
>>>>>>>>> "show measurements" as an "echo" when using the jmol applet in a php
>>>>>>>>> page?
>>>>>>>>> Alternatively, do you know how to show a message box like in the
>>>>>>>>> documentation pages (like in
>>>>>>>>> http://chemapps.stolaf.edu/jmol/docs/examples-11/measure.htm).
>>>>>>>>> Or, as another alternative, how to use
>>>>>>>>> javascript:alert(jmolGetPropertyAsArray('measurementInfo')) which I
>>>>>>>>> cannot
>>>>>>>>> make work...
>>>>>>>>> Thanks a lot!
>>>>>>>>> Daniel
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> ------------------------------------------------------------------------------
>>>>>>>>> Enable your software for Intel(R) Active Management Technology to
>>>>>>>>> meet the
>>>>>>>>> growing manageability and security demands of your customers.
>>>>>>>>> Businesses
>>>>>>>>> are taking advantage of Intel(R) vPro (TM) technology - will your
>>>>>>>>> software
>>>>>>>>> be a part of the solution? Download the Intel(R) Manageability
>>>>>>>>> Checker
>>>>>>>>> today! http://p.sf.net/sfu/intel-dev2devmar
>>>>>>>>> _______________________________________________
>>>>>>>>> Jmol-users mailing list
>>>>>>>>> [email protected]
>>>>>>>>> https://lists.sourceforge.net/lists/listinfo/jmol-users
>>>>>>>>>
>>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> --
>>>>>>>> Robert M. Hanson
>>>>>>>> Professor of Chemistry
>>>>>>>> St. Olaf College
>>>>>>>> 1520 St. Olaf Ave.
>>>>>>>> Northfield, MN 55057
>>>>>>>> http://www.stolaf.edu/people/hansonr
>>>>>>>> phone: 507-786-3107
>>>>>>>>
>>>>>>>>
>>>>>>>> If nature does not answer first what we want,
>>>>>>>> it is better to take what answer we get.
>>>>>>>>
>>>>>>>> -- Josiah Willard Gibbs, Lecture XXX, Monday, February 5, 1900
>>>>>>>>
>>>>>>>>
>>>>>>>> ------------------------------------------------------------------------------
>>>>>>>> Create and publish websites with WebMatrix
>>>>>>>> Use the most popular FREE web apps or write code yourself;
>>>>>>>> WebMatrix provides all the features you need to develop and
>>>>>>>> publish your website. http://p.sf.net/sfu/ms-webmatrix-sf
>>>>>>>>
>>>>>>>>
>>>>>>>> _______________________________________________
>>>>>>>> Jmol-users mailing list
>>>>>>>> [email protected]
>>>>>>>> https://lists.sourceforge.net/lists/listinfo/jmol-users
>>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> ------------------------------------------------------------------------------
>>>>>>> Create and publish websites with WebMatrix
>>>>>>> Use the most popular FREE web apps or write code yourself;
>>>>>>> WebMatrix provides all the features you need to develop and
>>>>>>> publish your website. http://p.sf.net/sfu/ms-webmatrix-sf
>>>>>>>
>>>>>>> _______________________________________________
>>>>>>> Jmol-users mailing list
>>>>>>> [email protected]
>>>>>>> https://lists.sourceforge.net/lists/listinfo/jmol-users
>>>>>>>
>>>>>>>
>>>>>>
>>>>>>
>>>>>> --
>>>>>> Robert M. Hanson
>>>>>> Professor of Chemistry
>>>>>> St. Olaf College
>>>>>> 1520 St. Olaf Ave.
>>>>>> Northfield, MN 55057
>>>>>> http://www.stolaf.edu/people/hansonr
>>>>>> phone: 507-786-3107
>>>>>>
>>>>>>
>>>>>> If nature does not answer first what we want,
>>>>>> it is better to take what answer we get.
>>>>>>
>>>>>> -- Josiah Willard Gibbs, Lecture XXX, Monday, February 5, 1900
>>>>>>
>>>>>>
>>>>>> ------------------------------------------------------------------------------
>>>>>> Create and publish websites with WebMatrix
>>>>>> Use the most popular FREE web apps or write code yourself;
>>>>>> WebMatrix provides all the features you need to develop and
>>>>>> publish your website. http://p.sf.net/sfu/ms-webmatrix-sf
>>>>>>
>>>>>> _______________________________________________
>>>>>> Jmol-users mailing list
>>>>>> [email protected]
>>>>>> https://lists.sourceforge.net/lists/listinfo/jmol-users
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>> ------------------------------------------------------------------------------
>>>>> Create and publish websites with WebMatrix
>>>>> Use the most popular FREE web apps or write code yourself;
>>>>> WebMatrix provides all the features you need to develop and
>>>>> publish your website. http://p.sf.net/sfu/ms-webmatrix-sf
>>>>>
>>>>> _______________________________________________
>>>>> Jmol-users mailing list
>>>>> [email protected]
>>>>> https://lists.sourceforge.net/lists/listinfo/jmol-users
>>>>>
>>>>>
>>>>
>>>>
>>>> --
>>>> Robert M. Hanson
>>>> Professor of Chemistry
>>>> St. Olaf College
>>>> 1520 St. Olaf Ave.
>>>> Northfield, MN 55057
>>>> http://www.stolaf.edu/people/hansonr
>>>> phone: 507-786-3107
>>>>
>>>>
>>>> If nature does not answer first what we want,
>>>> it is better to take what answer we get.
>>>>
>>>> -- Josiah Willard Gibbs, Lecture XXX, Monday, February 5, 1900
>>>>
>>>>
>>>> ------------------------------------------------------------------------------
>>>> Create and publish websites with WebMatrix
>>>> Use the most popular FREE web apps or write code yourself;
>>>> WebMatrix provides all the features you need to develop and
>>>> publish your website. http://p.sf.net/sfu/ms-webmatrix-sf
>>>>
>>>> _______________________________________________
>>>> Jmol-users mailing list
>>>> [email protected]
>>>> https://lists.sourceforge.net/lists/listinfo/jmol-users
>>>>
>>>>
>>>
>>>
>>> ------------------------------------------------------------------------------
>>> Create and publish websites with WebMatrix
>>> Use the most popular FREE web apps or write code yourself;
>>> WebMatrix provides all the features you need to develop and
>>> publish your website. http://p.sf.net/sfu/ms-webmatrix-sf
>>>
>>> _______________________________________________
>>> Jmol-users mailing list
>>> [email protected]
>>> https://lists.sourceforge.net/lists/listinfo/jmol-users
>>>
>>>
>>
>>
>> --
>> Robert M. Hanson
>> Professor of Chemistry
>> St. Olaf College
>> 1520 St. Olaf Ave.
>> Northfield, MN 55057
>> http://www.stolaf.edu/people/hansonr
>> phone: 507-786-3107
>>
>>
>> If nature does not answer first what we want,
>> it is better to take what answer we get.
>>
>> -- Josiah Willard Gibbs, Lecture XXX, Monday, February 5, 1900
>>
>>
>> ------------------------------------------------------------------------------
>> Create and publish websites with WebMatrix
>> Use the most popular FREE web apps or write code yourself;
>> WebMatrix provides all the features you need to develop and
>> publish your website. http://p.sf.net/sfu/ms-webmatrix-sf
>>
>> _______________________________________________
>> Jmol-users mailing list
>> [email protected]
>> https://lists.sourceforge.net/lists/listinfo/jmol-users
>>
>>
>
------------------------------------------------------------------------------
Create and publish websites with WebMatrix
Use the most popular FREE web apps or write code yourself;
WebMatrix provides all the features you need to develop and
publish your website. http://p.sf.net/sfu/ms-webmatrix-sf
_______________________________________________
Jmol-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jmol-users