@@ -268,33 +268,6 @@ public void newSnapshot(Node configurationNode) {
268268 });
269269 }
270270
271- public String getValueVType (String pvEntry , List <SnapshotItem > entries ){
272- String valueOutput ="" ;
273- for (SnapshotItem e : entries ) {
274- if (e .getConfigPv ().getPvName ().equals (pvEntry )){
275- VType newValue =e .getValue ();
276- if (newValue instanceof VNumber ) {
277- Number newVType = ((VNumber ) newValue ).getValue ();
278- valueOutput =newVType .toString ();
279- return valueOutput ;
280- } else if (newValue instanceof VString ) {
281- String newVType = ((VString ) newValue ).getValue ();
282- valueOutput =newVType .toString ();
283- return valueOutput ;
284- } else if (newValue instanceof VStringArray ) {
285- List <String > newVType =((VStringArray ) newValue ).getData ();
286- valueOutput =newVType .toString ();
287- return valueOutput ;
288- } else if (newValue instanceof VEnum ) {
289- VEnum newVType = (VEnum ) newValue ;
290- valueOutput =newVType .getValue ().toString ();
291- return valueOutput ;
292- }
293- }
294- }
295- return valueOutput ;
296- }
297-
298271 @ FXML
299272 @ SuppressWarnings ("unused" )
300273 private void takeSnapshot () {
@@ -320,31 +293,11 @@ private void takeSnapshot() {
320293 Date now = new Date ();
321294 formater = new SimpleDateFormat ("yy-MM-dd" );
322295 String defaultTitle ="" ;
323- if (!Preferences .default_title_snapshot_format .equals ("" )) {
324- String [] formatTitle =Preferences .default_title_snapshot_format .split ("_" );
325- for (int index = 0 ; index < formatTitle .length ; index ++) {
326- switch (formatTitle [index ]) {
327- case "<date>" :
328- if (!Preferences .default_title_snapshot_date_format .equals ("" )){
329- formater = new SimpleDateFormat (Preferences .default_title_snapshot_date_format );
330- defaultTitle +=defaultTitle +formater .format (now );
331- }
332- break ;
333- case "<pv1>" :
334- defaultTitle +=getValueVType (Preferences .default_title_snapshot_pv1 ,entries );
335- break ;
336- case "<pv2>" :
337- defaultTitle +=getValueVType (Preferences .default_title_snapshot_pv2 ,entries );
338- break ;
339- default :
340- System .out .println ("nothing" );
341- break ;
342- }
343- if (index <formatTitle .length -1 )
344- defaultTitle +="_" ;
345- }
296+ if (!Preferences .default_title_snapshot_date_format .equals ("" )) {
297+ formater = new SimpleDateFormat (Preferences .default_title_snapshot_date_format );
298+ defaultTitle +=defaultTitle +formater .format (now );
299+ snapshotNameProperty .set (defaultTitle );
346300 }
347- snapshotNameProperty .set (defaultTitle );
348301
349302 })
350303 );
0 commit comments