/** * A channel with the given name of type VDouble. * * @param name the channel name; can't be null * @return an expression representing the channel */ public static ChannelExpression<VDouble, Double> vDouble(String name) { return channel(name, VDouble.class, Double.class); }
/** * A channel with the given name of type VDoubleArray. * * @param name the channel name; can't be null * @return an expression representing the channel */ public static ChannelExpression<VDoubleArray, ArrayDouble> vDoubleArray(String name) { return channel(name, VDoubleArray.class, ArrayDouble.class); }
/** * A channel with the given name of type VByteArray. * * @param name the channel name; can't be null * @return an expression representing the channel */ public static ChannelExpression<VByteArray, ArrayByte> vByteArray(String name) { return channel(name, VByteArray.class, ArrayByte.class); }
/** * A channel with the given name of type VShortArray. * * @param name the channel name; can't be null * @return an expression representing the channel */ public static ChannelExpression<VShortArray, ArrayShort> vShortArray(String name) { return channel(name, VShortArray.class, ArrayShort.class); }
/** * A channel with the given name of type VFloat. * * @param name the channel name; can't be null * @return an expression representing the channel */ public static ChannelExpression<VFloat, Float> vFloat(String name) { return channel(name, VFloat.class, Float.class); }
/** * A channel with the given name of type VShort. * * @param name the channel name; can't be null * @return an expression representing the channel */ public static ChannelExpression<VShort, Short> vShort(String name) { return channel(name, VShort.class, Short.class); }
/** * A channel with the given name of type VIntArray. * * @param name the channel name; can't be null * @return an expression representing the channel */ public static ChannelExpression<VIntArray, ArrayInt> vIntArray(String name) { return channel(name, VIntArray.class, ArrayInt.class); }
/** * A channel with the given name that returns any of the value types. * * @param name the channel name; can't be null * @return an expression representing the channel */ public static ChannelExpression<VType, Object> vType(String name) { return channel(name, VType.class, Object.class); }
/** * A channel with the given name of type VNumber. * * @param name the channel name; can't be null * @return an expression representing the channel */ public static ChannelExpression<VNumber, Number> vNumber(String name) { return channel(name, VNumber.class, Number.class); }
/** * A channel with the given name of type VInt. * * @param name the channel name; can't be null * @return an expression representing the channel */ public static ChannelExpression<VInt, Integer> vInt(String name) { return channel(name, VInt.class, Integer.class); }
/** * A channel with the given name of type VByte. * * @param name the channel name; can't be null * @return an expression representing the channel */ public static ChannelExpression<VByte, Byte> vByte(String name) { return channel(name, VByte.class, Byte.class); }
/** * A channel with the given name of type VFloatArray. * * @param name the channel name; can't be null * @return an expression representing the channel */ public static ChannelExpression<VFloatArray, ArrayFloat> vFloatArray(String name) { return channel(name, VFloatArray.class, ArrayFloat.class); }
/** * A channel with the given name of type VStringArray. * * @param name the channel name; can't be null * @return an expression representing the channel */ @SuppressWarnings("unchecked") public static ChannelExpression<VStringArray, List<String>> vStringArray(String name) { return (ChannelExpression<VStringArray, List<String>>) (ChannelExpression) channel(name, VStringArray.class, List.class); }
/** * A channel with the given name of type VNumberArray. * * @param name the channel name; can't be null * @return an expression representing the channel */ public static ChannelExpression<VNumberArray, ListNumber> vNumberArray(String name) { return channel(name, VNumberArray.class, ListNumber.class); }
/** * A channel with the given name of type VString. * * @param name the channel name; can't be null * @return an expression representing the channel */ public static ChannelExpression<VString, String> vString(String name) { return channel(name, VString.class, String.class); }
/** * A channel with the given name of type VEnum. * * @param name the channel name; can't be null * @return an expression representing the channel */ public static ChannelExpression<VEnum, Integer> vEnum(String name) { return channel(name, VEnum.class, Integer.class); }
/** * A channel with the given name of any type. This expression can be * used both in a read and a write expression. * * @param name the channel name * @return an expression representing the channel */ public static ChannelExpression<Object, Object> channel(String name) { return channel(name, Object.class, Object.class); }
public void b4_synchronousWrite() { PVWriter<Object> pvWriter = PVManager.write(channel("channelName")).sync(); // This will block until the write is done pvWriter.write("New value"); System.out.println("Write finished"); // Remember to close pvWriter.close(); }
public void datasourcesInSWT_CSSTudio() { // In CS-Studio, you should never change the default configuration programmatically // or you will create problems for other applications. All configuration // shoul be done on your own readers/writers. // If you are developing user interfaces in SWT, you will want to route the notifications on the SWT thread. // Import from here // import static org.csstudio.utility.pvmanager.ui.SWTUtil.*; // When creating a pv, remember to ask for notification on the SWT thread PVReader<?> pvReader = PVManager.read(channel("test")).notifyOn(swtThread()).maxRate(ofMillis(100)); }
public void datasourcesInSwing() { // When creating UIs in swing, you will need to route notification directly // on the Event Dispatch Thread. // You can do this on a PV by PV basis, or you can change the default if // you control the whole application. // Import from here // import static org.diirt.util.concurrent.Executors.*; // Route notification for this pv on the Swing EDT PVReader<?> pvReader = PVManager.read(channel("test")).notifyOn(swingEDT()).maxRate(ofMillis(100)); // Or you can change the default PVManager.setDefaultNotificationExecutor(swingEDT()); }