|
12 | 12 | import java.util.concurrent.atomic.AtomicReference; |
13 | 13 | import java.util.logging.Level; |
14 | 14 |
|
15 | | -import org.epics.vtype.VBoolean; |
16 | | -import org.epics.vtype.VDouble; |
17 | | -import org.epics.vtype.VEnum; |
18 | | -import org.epics.vtype.VFloat; |
19 | | -import org.epics.vtype.VInt; |
20 | | -import org.epics.vtype.VLong; |
21 | | -import org.epics.vtype.VShort; |
22 | | -import org.epics.vtype.VString; |
23 | 15 | import org.epics.vtype.VType; |
24 | 16 | import org.phoebus.pv.PV; |
25 | 17 |
|
@@ -468,36 +460,8 @@ public CompletableFuture<?> asyncWrite(final Object new_value) throws Exception |
468 | 460 | return result; |
469 | 461 | } |
470 | 462 |
|
471 | | - private void performWrite(final Object newvalue, final PutListener put_listener) throws Exception |
| 463 | + private void performWrite(final Object new_value, final PutListener put_listener) throws Exception |
472 | 464 | { |
473 | | - //Manage type of PV to convert the value in good format |
474 | | - VType vType = read(); |
475 | | - Object new_value = newvalue; |
476 | | - if(vType instanceof VString) { |
477 | | - new_value = newvalue.toString(); |
478 | | - } |
479 | | - else if(vType instanceof VDouble) { |
480 | | - new_value = Double.valueOf(new_value.toString()); |
481 | | - } |
482 | | - else if(vType instanceof VLong) { |
483 | | - new_value = Double.valueOf(new_value.toString()).longValue(); |
484 | | - } |
485 | | - else if(vType instanceof VFloat) { |
486 | | - new_value = Double.valueOf(new_value.toString()).floatValue(); |
487 | | - } |
488 | | - else if(vType instanceof VInt) { |
489 | | - new_value = Double.valueOf(new_value.toString()).intValue(); |
490 | | - } |
491 | | - else if(vType instanceof VShort) { |
492 | | - new_value = Double.valueOf(new_value.toString()).shortValue(); |
493 | | - } |
494 | | - else if(vType instanceof VEnum) { |
495 | | - new_value = Double.valueOf(new_value.toString()).intValue(); |
496 | | - } |
497 | | - else if(vType instanceof VBoolean) { |
498 | | - new_value = Boolean.parseBoolean(new_value.toString()); |
499 | | - } |
500 | | - |
501 | 465 | if (new_value instanceof String) |
502 | 466 | { |
503 | 467 | if (channel.getFieldType().isBYTE() && channel.getElementCount() > 1) |
@@ -588,14 +552,6 @@ else if (new_value instanceof Long) |
588 | 552 | channel.put(val); |
589 | 553 | } |
590 | 554 | } |
591 | | - else if (new_value instanceof Boolean) |
592 | | - { |
593 | | - final short val = ((Boolean)new_value) ? (short)1 : (short)0; |
594 | | - if (put_listener != null) |
595 | | - channel.put(val, put_listener); |
596 | | - else |
597 | | - channel.put(val); |
598 | | - } |
599 | 555 | else if (new_value instanceof Long []) |
600 | 556 | { // Channel only supports put(int[]), not long[] |
601 | 557 | logger.log(Level.WARNING, "Truncating long[] to int[] for PV " + getName()); |
|
0 commit comments