home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 9 / 09.iso / e / e002 / 1.ddi / ORGSYS.CN_ / ORGSYS.CN
Encoding:
Text File  |  1993-09-21  |  3.4 KB  |  144 lines

  1. /*********************************************
  2.  *    Variables Definition:
  3.  *     You may define any variables that you
  4.  *     would like below, using the syntax
  5.  *    Key = Value,
  6.  *     where key is the variable name, and Value is the value.
  7.  *
  8.  ********************************************/
  9. pi = 3.1415926
  10. /* The following variables are used by Origin, and are
  11.  * necessary for the proper operation of the program. */
  12.  
  13. fitnpts = 60
  14. fitx1 = 1
  15. fitx2 = 10
  16.  
  17. TimerCycle=5;    #User installed timer period
  18. AcceptFit=0.05;    #Norm of Chi^2 to terminate fitting
  19. FitWtMode = 0; #Weight method on fit data
  20. initNfitPts=60;    #Number of data pts used in least square fitting
  21.             #The initial step size = NumPtsInData/initNfitPts
  22. AveStep=3;        #Number of points used in Running Averaging
  23.  
  24. /*
  25.  *  Baseline related variables 
  26.  */
  27.  
  28. MV_BASELINE_PTS=12
  29. /* Number of data points used in cursor move baseline */
  30.  
  31. /* LR -B DataSet command uses the 
  32.  * following variables 
  33.  */
  34.  
  35. Chk_Linear_R=10
  36. /* Sets the amount of tolerance in the automatic
  37.  * determination of linear segments from the data
  38.  */
  39.     
  40. MAX_L_RANGE=40
  41. /* percentage of the entire data range to 
  42.  * be examined by the find linear segment routine
  43.  */
  44.  
  45. /*****************************************************************
  46.  * 
  47.  * 
  48.  The following section contains a number of user-definable macros.
  49.  * 
  50.  * 
  51.  *****************************************************************/
  52.  
  53. /* After an empty new document is created */
  54. def DocBegin { }
  55.  
  56. def NotReady {
  57.     ty -b This operation is not available at the current version...
  58. }
  59.  
  60. def ImportAscii {
  61.     GetFileName *.DAT *.*;
  62.         /* change to any other extensions if desired
  63.          * GetFileName puts result into the string variable %A
  64.          */
  65.     Open -w %A;
  66.         /* Open the file in %A into the current worksheet window */
  67. }
  68.     
  69.  
  70. def new {create %1 -n %2;set %1 -e %2}
  71.     /* example: new test 100
  72.      * create a default data set with 100 elements
  73.      */
  74.      
  75. def Separator {/* draw a line in the script window, %1 = number of columns */
  76.     for(i=1;i<=%1;i+1) {
  77.         type -L "-----------"
  78.         /* the -L switch turns off CR/LF */
  79.     }
  80.     ty;/* to add the CR/LF */
  81. }
  82.  
  83. /* When you double-click the window, Origin
  84.  * will first try to find the object on the
  85.  * location, if found, will invoke the corresponding
  86.  * dialog box. If nothing can be found, the following
  87.  * macros are executed if defined, otherwise the Hand
  88.  * appear.
  89.  
  90. def DBCLayer {
  91.     ty -b Nothing can be found, open layer dialog?;
  92.     layer;
  93. }
  94.  * inside the layer frame
  95.  *
  96.  */
  97.  
  98.  
  99. /* inside layer bounds but outside layer frame
  100. def DBCBound Page
  101.  *
  102.  */
  103.  
  104. def DBCPage Page
  105. /* anywhere else */
  106.  
  107. def Enlarger.Ctrl {
  108.     %B=%H;/* save window name */
  109.     layer -c;/* count data sets and result in %Z */
  110.     layer -s;active = i;
  111.     /* get the active layer number into i and save it */
  112.     doc -e Open (win -i);/* put all open windows into icons */
  113.     
  114.     GetNamedWin    Enlarged;
  115.     layer -i %Z;
  116.     win -a %B;
  117.     layer -s active;
  118.     label -p 50 50;
  119.     draw -n ZoomRect -File Read ZoomRect.OGO;/* read ZoomRect.OGO in as ZoomRect */
  120.     win -system Tile;
  121.     draw -n ZoomRect -Run;/* run its script */
  122. }
  123.  
  124.  
  125. /* run the script of the named graphic object */
  126. def doButton {
  127.     draw -n %1 -r;
  128. }
  129.  
  130. /* from %C to generate %B for the
  131.  * specified type of curve
  132.  */
  133. def GetCuvName {
  134.     %B="%(count,@W).%(count,@C).%1";
  135.         /* %B is the name of the interpolated curve */
  136.     if(%[%B]>24) /* name too long */
  137.     {
  138.         doc -cs %1;
  139.         %B=%1.$(count+1);
  140.     }
  141. }
  142.  
  143.  
  144.