\CDS_Version "2.0.7" \begin_outline "Page1" \end_outline \begin_page{Page1} \title{Set up Simulation} \page_constructor_text "#!/bin/csh -i cd /mit/cdsdev/vaxbin source $CDS_CONFIG_DIR/cds.csh source /mit/cdsdev/beta/backends/gravity/gravity.csh set massarray = (0 0 0 0 0 0 0 0 0 0 0 0) set xarray = (0 0 0 0 0 0 0 0 0 0 0 0) set yarray = (0 0 0 0 0 0 0 0 0 0 0 0) set vxarray = (0 0 0 0 0 0 0 0 0 0 0 0) set vyarray = (0 0 0 0 0 0 0 0 0 0 0 0)" \begin_screen \begin_figure {AtPlotter} \figure_name "plotter-1" autoScale "False"; bottomPosition "901"; clickX "-10.400350"; clickY "161.894780"; floatingX "True"; floatingY "True"; forceSquare "True"; leftPosition "0"; motionX "815.496459"; motionY "263.101832"; rightPosition "557"; title "Plotter"; topPosition "117"; xaxis.max "800"; xaxis.min "-800"; yaxis.max "800"; yaxis.min "-800"; \end_figure \begin_figure {XmPushButton} \figure_name "ResetValues" \callback "Activate" "cds-figure-set-resource $CDS_THIS_PAGE GravConstant value \"6.67e-11\" cds-figure-set-resource $CDS_THIS_PAGE TimeSeconds value \"1.26144e8\" cds-figure-set-resource $CDS_THIS_PAGE TimeYears value \"4\" cds-figure-set-resource $CDS_THIS_PAGE DtSeconds value \"604800\" cds-figure-set-resource $CDS_THIS_PAGE DtDays value \"7\" cds-figure-set-resource $CDS_THIS_PAGE DtWeeks value \"1\"" bottomPosition "102"; labelString "Reset Values "; leftPosition "355"; rightPosition "550"; topPosition "3"; \end_figure \begin_figure {XmText} \figure_name "TimeYears" bottomPosition "188"; font "9x15"; fontList "9x15"; leftPosition "559"; rightPosition "798"; topPosition "137"; value "3"; \end_figure \begin_figure {XmText} \figure_name "GravConstant" bottomPosition "86"; leftPosition "559"; rightPosition "788"; topPosition "35"; value "6.67e-11"; \end_figure \begin_figure {XmLabel} \figure_name "GravLabel" bottomPosition "35"; fontList "6x12"; labelString "Gravitational Constant"; leftPosition "559"; rightPosition "757"; topPosition "0"; \end_figure \begin_figure {XmLabel} \figure_name "TimeLabel" bottomPosition "132"; fontList "6x12"; labelString "Time to run simulation"; leftPosition "558"; rightPosition "747"; topPosition "105"; \end_figure \begin_figure {XmText} \figure_name "TimeSeconds" bottomPosition "188"; font "9x15bold"; fontList "9x15"; leftPosition "559"; rightPosition "798"; topPosition "137"; value "3.26144e8"; wordWrap "False"; \end_figure \begin_figure {XmLabel} \figure_name "UnitLabel" bottomPosition "181"; fontList "7x13"; labelString "years"; leftPosition "798"; rightPosition "907"; topPosition "147"; \end_figure \begin_figure {XmPushButton} \figure_name "UnitToggle" \callback "Activate" "if (${UnitLabel:labelString} == \"years\") then cds-figure-show $CDS_THIS_PAGE TimeSeconds cds-figure-set-resource $CDS_THIS_PAGE UnitLabel labelString \"seconds\" else cds-figure-show $CDS_THIS_PAGE TimeYears cds-figure-set-resource $CDS_THIS_PAGE UnitLabel labelString \"years\" endif " bottomPosition "186"; fontList "6x12"; labelString "Sec/Yrs"; leftPosition "917"; rightPosition "997"; topPosition "135"; \end_figure \begin_figure {XmLabel} \figure_name "PleaseWait" borderWidth "0"; bottomPosition "98"; labelPixmap "/mit/cdsdev/pixmaps/clock"; labelType "PIXMAP"; leftPosition "245"; mappedWhenManaged "False"; rightPosition "322"; topPosition "0"; \end_figure \begin_figure {XmLabel} \figure_name "GravUnitLabel" bottomPosition "83"; fontList "6x12"; labelString " 3 2 m / kg sec"; leftPosition "790"; rightPosition "907"; topPosition "35"; \end_figure \begin_figure {XmText} \figure_name "DtWeeks" bottomPosition "283"; leftPosition "559"; rightPosition "797"; topPosition "233"; value "4"; \end_figure \begin_figure {XmText} \figure_name "DtDays" bottomPosition "283"; leftPosition "559"; rightPosition "789"; topPosition "233"; value "2"; \end_figure \begin_figure {XmText} \figure_name "DtSeconds" bottomPosition "283"; leftPosition "559"; rightPosition "794"; topPosition "233"; value "60480"; \end_figure \begin_figure {XmLabel} \figure_name "DtUnitLabel" bottomPosition "281"; fontList "7x13"; labelString "days"; leftPosition "797"; rightPosition "908"; topPosition "242"; \end_figure \begin_figure {XmLabel} \figure_name "DtLabel" bottomPosition "233"; fontList "6x12"; labelString "Length of each time step"; leftPosition "559"; rightPosition "750"; topPosition "204"; \end_figure \begin_figure {XmPushButton} \figure_name "DtUnitToggle" \callback "Activate" "if (\"${DtUnitLabel:labelString}\" == \"seconds\") then cds-figure-set-resource $CDS_THIS_PAGE DtUnitLabel labelString \"days\" cds-figure-show $CDS_THIS_PAGE DtDays else if (\"${DtUnitLabel:labelString}\" == \"days\") then cds-figure-set-resource $CDS_THIS_PAGE DtUnitLabel labelString \"weeks\" cds-figure-show $CDS_THIS_PAGE DtWeeks else cds-figure-set-resource $CDS_THIS_PAGE DtUnitLabel labelString \"seconds\" cds-figure-show $CDS_THIS_PAGE DtSeconds endif endif" bottomPosition "279"; fontList "6x12"; labelString "Sec/d/wk"; leftPosition "917"; rightPosition "997"; topPosition "235"; \end_figure \begin_figure {XmPushButton} \figure_name "RunSimulation" \callback "Activate" "cds-figure-show $CDS_THIS_PAGE PleaseWait if (\"${UnitLabel:labelString}\" == \"seconds\") then set gravityTime = ${TimeSeconds:value} else set gravityTime = `expr ${TimeYears:value} \* 31536000` endif if (\"${DtUnitLabel:labelString}\" == \"seconds\") then set gravityDt = ${DtSeconds:value} else if (\"${DtUnitLabel:labelString}\" == \"days\") then set gravityDt = `expr ${DtDays:value} \* 86400` else set gravityDt = `expr ${DtWeeks:value} \* 604800` endif endif echo \" \ $CDS_THIS_PAGE \ plotter-1 \ ${GravConstant:value} \ $gravityTime \ $gravityDt \ 4 \ 1.99e30 \ 0\ 0\ 0\ 0\ 3.30e23\ 57.9e9\ 0\ 0\ 47866.843\ 4.87e24\ 1.08e11\ 0\ 0\ 34988 \ 1.90e27\ 7.78e11\ 0\ 0\ 13026\" | gravity cds-figure-hide $CDS_THIS_PAGE PleaseWait" bottomPosition "98"; labelString "Press to draw plot"; leftPosition "0"; rightPosition "235"; topPosition "0"; \end_figure \begin_figure {XmLabel} \figure_name "ToggleLabel" bottomPosition "284"; labelString "Unit Selector Buttons"; leftPosition "914"; marginBottom "100"; rightPosition "1000"; topPosition "0"; \end_figure \begin_figure {XmPushButton} \figure_name "SelectNextObject" \callback "Activate" "set ObjectNum = ${ObjectNumber:labelString} if ($ObjectNum < ${NumberObjects:value}) then set newObjectNum = `expr $ObjectNum + 1` else set newObjectNum = \"1\" endif set massarray[$ObjectNum] = ${MassKg:value} cds-figure-set-resource $CDS_THIS_PAGE MassKg value $massarray[$newObjectNum] set xarray[$ObjectNum] = ${X0:value} cds-figure-set-resource $CDS_THIS_PAGE X0 value $xarray[$newObjectNum] set yarray[$ObjectNum] = ${Y0:value} cds-figure-set-resource $CDS_THIS_PAGE Y0 value $yarray[$newObjectNum] set vxarray[$ObjectNum] = ${vx0:value} cds-figure-set-resource $CDS_THIS_PAGE vx0 value $vxarray[$newObjectNum] set vyarray[$ObjectNum] = ${vy0:value} cds-figure-set-resource $CDS_THIS_PAGE vy0 value $vyarray[$newObjectNum] cds-figure-set-resource $CDS_THIS_PAGE ObjectNumber labelString $newObjectNum" bottomPosition "666"; labelString "Next"; leftPosition "890"; rightPosition "947"; topPosition "620"; \end_figure \begin_figure {XmText} \figure_name "vy0" bottomPosition "970"; fontList "7x13"; leftPosition "731"; rightPosition "891"; topPosition "919"; value "0"; \end_figure \begin_figure {XmText} \figure_name "vx0" bottomPosition "970"; fontList "7x13"; leftPosition "558"; rightPosition "716"; topPosition "919"; value "100"; \end_figure \begin_figure {XmText} \figure_name "Y0" bottomPosition "858"; fontList "7x13"; leftPosition "735"; rightPosition "893"; topPosition "807"; value "120"; \end_figure \begin_figure {XmText} \figure_name "X0" bottomPosition "858"; fontList "7x13"; leftPosition "557"; rightPosition "720"; topPosition "809"; value "10"; \end_figure \begin_figure {XmText} \figure_name "MassKg" bottomPosition "753"; leftPosition "556"; rightPosition "834"; topPosition "699"; value "1e+12"; \end_figure \begin_figure {XmLabel} \figure_name "VelocityLabel" bottomPosition "918"; fontList "6x12"; labelString "Initial velocity (x,y)"; leftPosition "557"; rightPosition "768"; topPosition "889"; \end_figure \begin_figure {XmLabel} \figure_name "untitled" borderWidth "0"; bottomPosition "863"; fontList "*times-*-r-*-*-24-*"; labelString ","; leftPosition "715"; rightPosition "735"; topPosition "828"; \end_figure \begin_figure {XmLabel} \figure_name "InitXLabel" bottomPosition "806"; fontList "6x12"; labelString "Initial position (x,y)"; leftPosition "558"; rightPosition "750"; topPosition "772"; \end_figure \begin_figure {XmLabel} \figure_name "ObjectNumber" bottomPosition "636"; labelString "1"; leftPosition "712"; rightPosition "760"; topPosition "568"; \end_figure \begin_figure {XmLabel} \figure_name "ObjectNumberLabel" alignment "ALIGNMENT_BEGINNING"; bottomPosition "647"; fontList "*-new century schoolbook-*-r-*-*-24-*"; labelString "Object #"; leftPosition "559"; rightPosition "775"; topPosition "559"; \end_figure \begin_figure {XmLabel} \figure_name "MassLabel" bottomPosition "698"; fontList "6x12"; labelString "Mass"; leftPosition "556"; rightPosition "660"; topPosition "664"; \end_figure \begin_figure {XmScale} \figure_name "NumberObjects" \callback "Value Changed" "if (${ObjectNumber:labelString} > ${NumberObjects:value}) then cds-figure-set-resource $CDS_THIS_PAGE ObjectNumber labelString ${NumberObjects:value} endif" bottomPosition "531"; leftPosition "558"; maximum "12"; minimum "1"; orientation "HORIZONTAL"; processingDirection "MAX_ON_RIGHT"; rightPosition "1000"; titleString "Number of objects"; topPosition "436"; value "1"; \end_figure \begin_figure {XmLabel} \figure_name "MassUnitLabel" bottomPosition "753"; fontList "7x13"; labelString "kilograms"; leftPosition "895"; rightPosition "1000"; topPosition "704"; \end_figure \begin_figure {XmLabel} \figure_name "Comma2" borderWidth "0"; bottomPosition "999"; fontList "*times-*-r-*-*-24-*"; labelString ","; leftPosition "716"; rightPosition "732"; topPosition "926"; \end_figure \begin_figure {XmLabel} \figure_name "untitled" borderWidth "10"; bottomPosition "341"; fontList "Fixed"; labelString ""; leftPosition "558"; rightPosition "1000"; topPosition "307"; \end_figure \begin_figure {XmPushButton} \figure_name "SelectPrevObject" \callback "Activate" "set ObjectNum = ${ObjectNumber:labelString} if ($ObjectNum > 1) then set newObjectNum = `expr $ObjectNum - 1` else set newObjectNum = ${NumberObjects:value} endif set massarray[$ObjectNum] = ${MassKg:value} cds-figure-set-resource $CDS_THIS_PAGE MassKg value $massarray[$newObjectNum] set xarray[$ObjectNum] = ${X0:value} cds-figure-set-resource $CDS_THIS_PAGE X0 value $xarray[$newObjectNum] set yarray[$ObjectNum] = ${Y0:value} cds-figure-set-resource $CDS_THIS_PAGE Y0 value $yarray[$newObjectNum] set vxarray[$ObjectNum] = ${vx0:value} cds-figure-set-resource $CDS_THIS_PAGE vx0 value $vxarray[$newObjectNum] set vyarray[$ObjectNum] = ${vy0:value} cds-figure-set-resource $CDS_THIS_PAGE vy0 value $vyarray[$newObjectNum] cds-figure-set-resource $CDS_THIS_PAGE ObjectNumber labelString $newObjectNum" bottomPosition "666"; labelString "Prev"; leftPosition "826"; rightPosition "888"; topPosition "620"; \end_figure \begin_figure {XmPushButton} \figure_name "SelectFirstObject" \callback "Activate" "set ObjectNum = ${ObjectNumber:labelString} set newObjectNum = 1 cds-figure-set-resource $CDS_THIS_PAGE ObjectNumber labelString $newObjectNum set massarray[$ObjectNum] = ${MassKg:value} cds-figure-set-resource $CDS_THIS_PAGE MassKg value $massarray[$newObjectNum] set xarray[$ObjectNum] = ${X0:value} cds-figure-set-resource $CDS_THIS_PAGE X0 value $xarray[$newObjectNum] set yarray[$ObjectNum] = ${Y0:value} cds-figure-set-resource $CDS_THIS_PAGE Y0 value $yarray[$newObjectNum] set vxarray[$ObjectNum] = ${vx0:value} cds-figure-set-resource $CDS_THIS_PAGE vx0 value $vxarray[$newObjectNum] set vyarray[$ObjectNum] = ${vy0:value} cds-figure-set-resource $CDS_THIS_PAGE vy0 value $vyarray[$newObjectNum] " bottomPosition "622"; labelString "First"; leftPosition "777"; rightPosition "834"; topPosition "576"; \end_figure \begin_figure {XmPushButton} \figure_name "SelectLastObject" \callback "Activate" "set newObjectNum = ${NumberObjects:value} set ObjectNum = ${ObjectNumber:labelString} cds-figure-set-resource $CDS_THIS_PAGE ObjectNumber labelString $newObjectNum set massarray[$ObjectNum] = ${MassKg:value} cds-figure-set-resource $CDS_THIS_PAGE MassKg value $massarray[$newObjectNum] set xarray[$ObjectNum] = ${X0:value} cds-figure-set-resource $CDS_THIS_PAGE X0 value $xarray[$newObjectNum] set yarray[$ObjectNum] = ${Y0:value} cds-figure-set-resource $CDS_THIS_PAGE Y0 value $yarray[$newObjectNum] set vxarray[$ObjectNum] = ${vx0:value} cds-figure-set-resource $CDS_THIS_PAGE vx0 value $vxarray[$newObjectNum] set vyarray[$ObjectNum] = ${vy0:value} cds-figure-set-resource $CDS_THIS_PAGE vy0 value $vyarray[$newObjectNum] " bottomPosition "622"; labelString "Last"; leftPosition "937"; rightPosition "994"; topPosition "576"; \end_figure \begin_figure {XmLabel} \figure_name "ObjectSelectorLabel" bottomPosition "621"; labelString "Object Selectors"; leftPosition "836"; rightPosition "936"; topPosition "552"; \end_figure \begin_figure {XmLabel} \figure_name "PositionUnitLabel" bottomPosition "856"; fontList "7x13"; labelString "meters"; leftPosition "895"; rightPosition "1000"; topPosition "807"; \end_figure \begin_figure {XmLabel} \figure_name "VelocityUnitLabel" bottomPosition "968"; fontList "7x13"; labelString "meters/sec"; leftPosition "895"; rightPosition "1000"; topPosition "919"; \end_figure \begin_figure {XmPushButton} \figure_name "TestScript" \callback "Activate" "gravity-make-datafile " bottomPosition "120"; labelString "Script Tester"; leftPosition "234"; rightPosition "344"; topPosition "2"; \end_figure \begin_figure {XmPushButton} \figure_name "LoadData" \callback "Activate" "You can just do set foo = (`awk {...}`) to split it into words. " bottomPosition "421"; labelString "Load data from file"; leftPosition "558"; rightPosition "707"; topPosition "343"; \end_figure \begin_figure {XmText} \figure_name "untitled" bottomPosition "417"; leftPosition "706"; rightPosition "991"; topPosition "361"; value "inner-planets.grav"; \end_figure \end_screen \end_page