DS7Control ARexx Documentation ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ Version 1.0 (12.04.97) Introduction ŻŻŻŻŻŻŻŻŻŻŻŻ The program "DS7Control" (without icon) is an ARexx host which has a number of commands to control the camera, transfer images and for the user interface. The global settings are set in "DS7Prefs" and are saved as environment variables. With this method, they can be read from ARexx scripts easily. Environment Variables ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ They can be found in "ENV:DS7Control". DEVICE serial device UNIT unit for the device BAUD speed (in baud) PATHARCHIVE pathes which are set in DS7Prefs PATHPHOTOS PATHMAIN <- important to find and start DS7Control TEMPDIR SAVETIME 1: save time and date as file comment 0: do not save file comment VIEWER external program to view pictures Usage ŻŻŻŻŻ Camera: First, the camera has to be opened with OPENCAMERA. Then you can call commands that access the camera. After you finished using the camera, free it with CLOSECAMERA. Image Processing: To rotate or scale images, there are some commands which all have the word IMAGE in their name. You can load an image file with LOADIMAGE, then perform a SCALEIMAGE or ROTATEIMAGE command and save it to disk with SAVEIMAGE. User Interface: There are common file and directory requester, a photo requester and a progress requester. ARexx Commands ŻŻŻŻŻŻŻŻŻŻŻŻŻŻ Name of the ARexx message port: "DS7Control" in alphabetical order: ---------------------------------------- NAME ADDNAMETOPATH Concatenates a path name and a filename SYNOPSIS ADDNAMETOPATH PATH,FILENAME PATH FILENAME RESULTS FULLNAME Name with path. ---------------------------------------- NAME CLOSECAMERA Frees the camera opened with OPENCAMERA. The camera is also freed when the control program "DS7Control" is terminated. SYNOPSIS CLOSECAMERA RESULTS ---------------------------------------- NAME CLOSEPROGREQ The window with the progress bar is closed. SYNOPSIS CLOSEPROGREQ RESULTS ---------------------------------------- NAME DISPOSEIMAGE The image buffer is freed. SYNOPSIS DISPOSEIMAGE RESULTS ---------------------------------------- NAME GETABORT Tests if user has clicked on "Abort" in the progress requester. The window is not closed when the user clocks on "Abort". SYNOPSIS GETABORT RESULTS ABORT/N ABORT=1, if abort requested, else 0 ---------------------------------------- NAME GETNUMPICS Reads the number of photos in the camera. SYNOPSIS GETNUMPICS RESULTS NUM/N Number of photos in the camera. ---------------------------------------- NAME GETPHOTO Transfers a photo from the camera and saves it in a file (JPEG format). SYNOPSIS GETPHOTO NUM/N/A,FILE/A,PROGFROM/N,PROGTO/N NUM : Number of the photo to transfer. FILE : Filename PROGFROM: Value of the progress bar before calling this function PROGTO : Value of the progress bar after calling this function. The progress bar is updated between these values while the transfer is performed. RESULTS ---------------------------------------- NAME GETPHOTOINFO Reads information about a photo. SYNOPSIS GETPHOTOINFO NUM/N/A NUM : Number of the photo to examine. RESULTS ORIENTATION/N,DATE,TIME ORIENTATION : orientation 0: normal, -90: 90° left, 90: 90° right, 180: upside down DATE : Date when photo was taken ("DD.MM.YYYY") TIME : Time when photo was taken ("HH:MM:SS") ---------------------------------------- NAME GETPHOTONAME Read filename of the photo from the camera SYNOPSIS GETPHOTONAME NUM/N/A NUM : number of the photo RESULTS NAME NAME : name of photo in camera (like "DSC00007.JPG") ---------------------------------------- NAME IMAGEINFO Get size of the image in the buffer. SYNOPSIS IMAGEINFO RESULTS WIDTH/N,HEIGHT/N WIDTH : Width in pixels HEIGHT : Height in pixels ---------------------------------------- NAME LOADIMAGE Load a JPEG file into the internal buffer. SYNOPSIS LOADIMAGE FILE/A FILE : Filename RESULTS ---------------------------------------- NAME OPENCAMERA Opens the serial device and initializes the camera for data transfer The camera cannot be accessed by other programs until the command CLOSECAMERA is called or the program "DS7Control" is terminated. SYNOPSIS OPENCAMERA DEVICE/A,UNIT/N/A,BAUD/N/A DEVICE : serial device UNIT : unit of the serial device BAUD : speed in baud. Possible values are: 9600, 12000, 14400, 16800, 19200, 28800, 38400, 57600 (other values are rounded to the next lower) RESULTS ---------------------------------------- NAME OPENPROGREQ Opens a window with a progress bar and an optional text (one line). SYNOPSIS OPENPROGREQ TITLE/K,TEXT/K,FROM/N,TO/N,SCREEN/K TITLE : Window title. TEXT : Additional text (one line). FROM,TO : Value range for the progress bar (example: 0 to 100 or 14 to 27) default: 0 to 100 SCREEN : Name of the public screen to open the requester on. The default and fallback is the Workbench screen. RESULTS ---------------------------------------- NAME QUIT Terminate "DS7Control" SYNOPSIS QUIT RESULTS ---------------------------------------- NAME REQUESTDIR A directory requester. SYNOPSIS REQUESTDIR PATH/K,TITLE/K,SCREEN/K,SAVE/S PATH : default path TITLE : window title SCREEN : Name of the public screen to open the requester on. The default and fallback is the Workbench screen. SAVE : open the requester in "save" mode RESULTS PATH selected path (RC=5 if aborted, RC=10 if window could not be opened, in both cases is the PATH parameter returned) ---------------------------------------- NAME REQUESTFILE A file requester. SYNOPSIS REQUESTFILE PATH/K,FILE/K,TITLE/K,PATTERN/K,SCREEN/K,SAVE/S PATH : default path FILE : default file name TITLE : window title PATTERN : pattern for the file name SCREEN : Name of the public screen to open the requester on. The default and fallback is the Workbench screen. SAVE : open the requester in "save" mode RESULTS PATH,FILE path and filename ---------------------------------------- NAME REQUESTOPTION The user can choose between several options. SYNOPSIS REQUESTOPTION TITLE/K,TEXT/K/A,OPTIONS/K/M/A,SCREEN/K TITLE : window title TEXT : Text to show in the window. For multiline text, separate the lines with '\'. OPTIONS : List of options SCREEN : Name of the public screen to open the requester on. The default and fallback is the Workbench screen. RESULTS SELECTION/N left option=0, then 1, etc. error codes: RC=0 ok RC=7 Window could not be opened. (SELECTION=right option) ---------------------------------------- NAME REQUESTPHOTO A window where the user can choose one or more photos from the camera. SYNOPSIS REQUESTPHOTO TITLE/K,TEXT/K,SCREEN/K,MULTI/S,ALL/S,CURRENT/S TITLE : window title TEXT : Additional text to be displayed (optional, for explanation) Seperate the lines with '\'. SCREEN : Name of the public screen to open the requester on. The default and fallback is the Workbench screen. MULTI : It is possible to select more than one photo. ALL : (only with MULTI) Initially all photos are selected. CURRENT : (only with MULTI) Only one (the current) photo is selected. RESULTS NUM/N/M Numbers of the selected pictures. error codes: RC=0 ok RC=5 user aborted RC=6 no photos in camera RC=7 window could not be opened RC=10 camera has not been opened ---------------------------------------- NAME ROTATEIMAGE Rotates the image in the buffer. SYNOPSIS ROTATEIMAGE ANGLE/N/A ANGLE : rotation angle in degrees (must be multiple of 90) RESULTS ---------------------------------------- NAME SAVEIMAGE Saves the image buffer as JPEG or IFF file. SYNOPSIS SAVEIMAGE FILE/A,QUALITY/N,IFF24/S FILE : filename QUALITY : JPEG quality setting (1..100) IFF24 : save image in IFF-ILBM format (24 bit color depth) RESULTS ---------------------------------------- NAME SETPROGRESS Update the progress bar. SYNOPSIS SETPROGRESS TEXT/K,VALUE/N/K TEXT : new text to display VALUE : new value of the bar RESULTS