forked from JMMC-OpenDev/oitools
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Set constants to serialize user appreciation of the images reconstruc…
…tions in OIMaging
- Loading branch information
Martin Pratoussy
committed
Jul 27, 2021
1 parent
93b141c
commit 13bd7a4
Showing
2 changed files
with
76 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
68 changes: 68 additions & 0 deletions
68
src/main/java/fr/jmmc/oitools/image/UserAppreciationParam.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
/* | ||
* Copyright (C) 2018 CNRS - JMMC project ( http://www.jmmc.fr ) | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
/******************************************************************************* | ||
* JMMC project ( http://www.jmmc.fr ) - Copyright (C) CNRS. | ||
******************************************************************************/ | ||
package fr.jmmc.oitools.image; | ||
|
||
import fr.jmmc.oitools.fits.FitsTable; | ||
import fr.jmmc.oitools.meta.KeywordMeta; | ||
import fr.jmmc.oitools.meta.Types; | ||
import java.io.Serializable; | ||
|
||
/** | ||
* | ||
* @author martin | ||
*/ | ||
public class UserAppreciationParam extends FitsTable implements Serializable { | ||
|
||
// Define User appreciation keywords | ||
private final static KeywordMeta KEYWORD_RATING = new KeywordMeta(ImageOiConstants.KEYWORD_RATING, "User rating of the reconstructed image", Types.TYPE_INT); | ||
private final static KeywordMeta KEYWORD_COMMENTS = new KeywordMeta(ImageOiConstants.KEYWORD_COMMENTS, "Optional user comments", Types.TYPE_CHAR); | ||
|
||
public UserAppreciationParam() { | ||
super(); | ||
|
||
// add standard keywords | ||
addKeywordMeta(KEYWORD_RATING); | ||
addKeywordMeta(KEYWORD_COMMENTS); | ||
|
||
// Set default values | ||
setNbRows(0); | ||
setExtVer(1); | ||
setExtName(ImageOiConstants.EXTNAME_IMAGE_OI_USER_APPRECIATION_PARAM); | ||
} | ||
|
||
/* | ||
* --- Keywords ------------------------------------------------------------ | ||
*/ | ||
public int getRating() { | ||
return getKeywordInt(ImageOiConstants.KEYWORD_RATING); | ||
} | ||
|
||
public void setRating(int rating) { | ||
setKeywordInt(ImageOiConstants.KEYWORD_RATING, rating); | ||
} | ||
|
||
public String getComments() { | ||
return getKeyword(ImageOiConstants.KEYWORD_COMMENTS); | ||
} | ||
|
||
public void setComments(String comments) { | ||
setKeyword(ImageOiConstants.KEYWORD_COMMENTS, comments); | ||
} | ||
} |