Project

General

Profile

Three methods realization and explanation - Code JAVA » History » Version 2

Anonymous, 17/03/2016 16:55

1 1 Anonymous
h1. Three methods realization and explanation - Code JAVA
2 1 Anonymous
3 1 Anonymous
h2.  _*Attention:    For better view, all the code pictures are captured by guanji in his git source, you can find the link at the end of the page. Thank you for your comprehension.*_
4 1 Anonymous
5 1 Anonymous
h2. *1 - Situation1 - One HMI-seires to one target .fits file, ex: hmi.m_720s*
6 1 Anonymous
7 1 Anonymous
!Selection_082.png!
8 1 Anonymous
9 1 Anonymous
10 1 Anonymous
h3. Define the .fits file name and save the series and filename into hashmap as a fast index, other code in the git source
11 1 Anonymous
12 1 Anonymous
!Selection_084.png!
13 1 Anonymous
14 1 Anonymous
h2. *2 - Situation2 - One HMI-series to multi-targets .fits files, ex: hmi.sharp_720s_nrt*
15 1 Anonymous
16 1 Anonymous
!Selection_081.png!
17 1 Anonymous
18 1 Anonymous
h3. Define all target files into a Arraylist, create new object - FileOrderResource then loop all series and files name into a List<Object> listf which Object = FileOrderResource. 
19 1 Anonymous
h3. The code is annotated(// or /* */) as we will use the method 3, you can get the source code in the git source here : https://git.ias.u-psud.fr/gwang/Sitools2-V3.0/commits/dev-3
20 1 Anonymous
21 1 Anonymous
!Selection_085.png!
22 1 Anonymous
23 1 Anonymous
The create a hashmap which key value equals series name and the content equals the filelist, 
24 1 Anonymous
!Selection_086.png!
25 1 Anonymous
26 1 Anonymous
Use if or switch to set and get the map values for creation of  the reference list
27 1 Anonymous
!Selection_087.png!
28 1 Anonymous
29 1 Anonymous
h2. *3 - Situation3 - Multi HMI-series to multi-targets .fits files*
30 1 Anonymous
31 1 Anonymous
!Selection_083.png!
32 1 Anonymous
33 1 Anonymous
h3. Delete all list and hashmap defined above, in case more or less target files in the target directory,
34 1 Anonymous
      use the java.io.File to find the target .fits files recursively, don't forget to throw exception and log for analyzing the process of order.
35 1 Anonymous
      Here is the codes well-encapsulated by guanji :
36 1 Anonymous
!Selection_088.png!
37 1 Anonymous
38 1 Anonymous
!Selection_089.png!
39 1 Anonymous
40 1 Anonymous
41 2 Anonymous
h2. *4 - The creation for the Object - FileOrderResource*
42 1 Anonymous
 
43 1 Anonymous
     h3. It contains 2 elements(reference.getPath(), filename with wave and series information), it is modificable according to the user needs.
44 1 Anonymous
45 1 Anonymous
!Selection_090.png!
46 1 Anonymous
47 1 Anonymous
48 2 Anonymous
h2. *5 - When and how to use the 3 method:*
49 1 Anonymous
50 1 Anonymous
h3. 
51 1 Anonymous
# If the target files are certain and for saving time, use the first 2 methods.
52 1 Anonymous
# If the target files are uncertain and too many to define the list, use the last one. 
53 1 Anonymous
54 2 Anonymous
h2.  *6 - Modification in TarOutputRepresentation and ZipOutputRepresentation*
55 2 Anonymous
 
56 2 Anonymous
h3. Parse the reference.getpath() and seperate by keywords 'datastorage/user' which is from colUrl in web-admin when administrator define the server service to a dataset
57 1 Anonymous
58 2 Anonymous
!Selection_091.png!
59 1 Anonymous
60 2 Anonymous
h3.  Igore the test logs of GUANJI, he just wanted to make sure all path is well parsed @_@, the logs can only be appeeared in console logs, no influence to our dear users.
61 2 Anonymous
62 2 Anonymous
h2. *7 - You can find all commits and resources related in the link:*
63 1 Anonymous
64 1 Anonymous
h3. https://git.ias.u-psud.fr/gwang/Sitools2-V3.0/commit/341a4a2f4941fd12384a2bdc37069fb0bdaab596