Project

General

Profile

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

Anonymous, 17/03/2016 17:06

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 3 Anonymous
h2. *1 - Situation1 - One HMI-series 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 3 Anonymous
20 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
21 1 Anonymous
22 1 Anonymous
!Selection_085.png!
23 1 Anonymous
24 1 Anonymous
The create a hashmap which key value equals series name and the content equals the filelist, 
25 1 Anonymous
!Selection_086.png!
26 1 Anonymous
27 1 Anonymous
Use if or switch to set and get the map values for creation of  the reference list
28 1 Anonymous
!Selection_087.png!
29 1 Anonymous
30 1 Anonymous
h2. *3 - Situation3 - Multi HMI-series to multi-targets .fits files*
31 1 Anonymous
32 1 Anonymous
!Selection_083.png!
33 1 Anonymous
34 1 Anonymous
h3. Delete all list and hashmap defined above, in case more or less target files in the target directory,
35 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.
36 1 Anonymous
      Here is the codes well-encapsulated by guanji :
37 1 Anonymous
!Selection_088.png!
38 1 Anonymous
39 1 Anonymous
!Selection_089.png!
40 1 Anonymous
41 1 Anonymous
42 2 Anonymous
h2. *4 - The creation for the Object - FileOrderResource*
43 1 Anonymous
 
44 1 Anonymous
     h3. It contains 2 elements(reference.getPath(), filename with wave and series information), it is modificable according to the user needs.
45 1 Anonymous
46 1 Anonymous
!Selection_090.png!
47 1 Anonymous
48 1 Anonymous
49 2 Anonymous
h2. *5 - When and how to use the 3 method:*
50 1 Anonymous
51 1 Anonymous
h3. 
52 1 Anonymous
# If the target files are certain and for saving time, use the first 2 methods.
53 1 Anonymous
# If the target files are uncertain and too many to define the list, use the last one. 
54 1 Anonymous
55 2 Anonymous
h2.  *6 - Modification in TarOutputRepresentation and ZipOutputRepresentation*
56 2 Anonymous
 
57 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
58 1 Anonymous
59 2 Anonymous
!Selection_091.png!
60 1 Anonymous
61 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.
62 2 Anonymous
63 2 Anonymous
h2. *7 - You can find all commits and resources related in the link:*
64 1 Anonymous
65 1 Anonymous
h3. https://git.ias.u-psud.fr/gwang/Sitools2-V3.0/commit/341a4a2f4941fd12384a2bdc37069fb0bdaab596