Project

General

Profile

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

Guanji Wang, 17/03/2016 17:06

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