X-Git-Url: http://git.osdn.net/view?a=blobdiff_plain;f=test%2Fview%2Fmds%2Fjs%2Fmds.js;fp=test%2Fview%2Fmds%2Fjs%2Fmds.js;h=0000000000000000000000000000000000000000;hb=c189692f3d36280ec1daf8f8b3cf7ea9f506a0ed;hp=9099abcb0415acf071a9ba8715700b32c3e4be2e;hpb=48a1f750f1c16c692021d2b7dec01fd859baf849;p=vem%2Fvem.git diff --git a/test/view/mds/js/mds.js b/test/view/mds/js/mds.js deleted file mode 100644 index 9099abc..0000000 --- a/test/view/mds/js/mds.js +++ /dev/null @@ -1,103 +0,0 @@ -// mds -var $exeParams = { "mag": 0, "spot":0, "int":0, "shift":{"x":0, "y":0}, "defocus":0 } -var $currentParams = { "mag": 0, "spot":0, "int":0, "shift":{"x":0, "y":0}, "defocus":0 } - -$(function () { - $( "#search_button" ).click({mode: "search"}, onMode ); - $( "#focus_button" ).click({mode: "focus"}, onMode ); - $( "#exposure_button" ).click({mode: "exposure"}, onMode ); - $( "#getparams_button" ).click( getCurrentParams ); - $( "#sizech_button" ).toggle( smallScreenSize, bigScreenSize ); - $( "#512_button" ).click({size:0}, changeImageSize ); - $( "#256_button" ).click({size:1}, changeImageSize ); - $( "#plus_defocus_button" ).click({params:1}, changeDefocus ); - $( "#minus_defocus_button" ).click({params:-1}, changeDefocus ); - $( "#reset_defocus_button" ).click( resetDefocus ); -}); - -// changeScreenSize -function smallScreenSize () { - $( "#camera_screen" ).attr( "width", "256"); - $( "#camera_screen" ).attr( "height", "256"); -} - -function bigScreenSize () { - $( "#camera_screen" ).attr( "width", "512"); - $( "#camera_screen" ).attr( "height", "512"); -} - -// onMode -function onMode (event) { - var mode = event.data.mode; - console.log(mode); - changeColor(mode); - getConfigParams(mode); - changeParams(); - //getCurrentParams(); - displayCurrentParams(); -} - -// changeColor -function changeColor (mode) { - resetColor(); - $( "#"+mode+"_button" ).attr( "class", "btn btn-default btn-lg btn-danger"); -} - -function resetColor () { - $( "#search_button" ).attr( "class", "btn btn-default btn-lg btn-default"); - $( "#focus_button" ).attr( "class", "btn btn-default btn-lg btn-default"); - $( "#exposure_button" ).attr( "class", "btn btn-default btn-lg btn-default"); -} - -// changeImageSize -function changeImageSize (event) { - var size = event.data.size; - controlCameraParams(size); - switch (size) { - case 0: - $( "#512_button" ).attr( "class", "btn btn-default btn-danger"); - $( "#256_button" ).attr( "class", "btn btn-default btn-default"); - break; - case 1: - $( "#256_button" ).attr( "class", "btn btn-default btn-danger"); - $( "#512_button" ).attr( "class", "btn btn-default btn-default"); - break; - } -} - -// getConfigParams -function getConfigParams(mode){ - $exeParams["mag"] = params[mode]["mag"]; - $exeParams["spot"] = params[mode]["spot"]; - $exeParams["int"] = params[mode]["int"]; - $exeParams["shift"] = params[mode]["shift"]; - $exeParams["defocus"] = params[mode]["defocus"]; -} - -// changeParams -function changeParams () { - controlMag($exeParams["mag"]); - controlSpotSize($exeParams["spot"]); - // controlShift($exeParams["shift"]); -} - -// getCurrentParams -function getCurrentParams () { - getAllParams(); -} - -// displayCurrentParams -function displayCurrentParams (mode) { - console.log( "display"+$currentParams["spot"] ); - $( "#mag" ).html( $currentParams["mag"]); - $( "#spot" ).html( $currentParams["spot"]); - $( "#int" ).html( $currentParams["int"]); - $( "#shift" ).html( $currentParams["shift"]["x"]+", "+$currentParams["shift"]["y"]); - $( "#defocus" ).html( $currentParams["defocus"]+" nm"); -} - -// changeDefocus -function changeDefocus (event) { - var params = event.data.params; - controlDefocus(params); -}