tcp port reconnect
This commit is contained in:
parent
1faf5b452c
commit
7d56682994
@ -1,2 +1,13 @@
|
|||||||
apply plugin: 'base' // To add "clean" task to the root project.
|
configurations {
|
||||||
|
compile.exclude module: 'groovy'
|
||||||
|
compile.exclude module: 'groovy-all'
|
||||||
|
compile.exclude module: 'shichimifx'
|
||||||
|
compile.exclude module: 'zt-zip'
|
||||||
|
}
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
compile project(':numass-storage:numass-client')
|
||||||
|
compile project(':dataforge-plots:plots-jfc')
|
||||||
|
compile project(':dataforge-control')
|
||||||
|
compile project(':dataforge-fx')
|
||||||
|
}
|
@ -9,19 +9,8 @@ version = "0.1.2";
|
|||||||
|
|
||||||
//mainClassName = "inr.numass.readvac.Main"
|
//mainClassName = "inr.numass.readvac.Main"
|
||||||
|
|
||||||
configurations {
|
|
||||||
compile.exclude module: 'groovy'
|
|
||||||
compile.exclude module: 'groovy-all'
|
|
||||||
compile.exclude module: 'shichimifx'
|
|
||||||
compile.exclude module: 'zt-zip'
|
|
||||||
}
|
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
// compile 'commons-cli:commons-cli:1.3'
|
compile project(':numass-control')
|
||||||
// compile 'de.jensd:shichimifx:1.0.5'
|
|
||||||
compile project(':numass-storage:numass-client')
|
|
||||||
compile project(':dataforge-control')
|
|
||||||
compile project(':dataforge-plots:plots-jfc')
|
|
||||||
}
|
}
|
||||||
|
|
||||||
task debug(dependsOn: classes, type: JavaExec) {
|
task debug(dependsOn: classes, type: JavaExec) {
|
||||||
|
@ -6,8 +6,8 @@ import hep.dataforge.control.measurements.Measurement;
|
|||||||
import hep.dataforge.control.measurements.MeasurementListener;
|
import hep.dataforge.control.measurements.MeasurementListener;
|
||||||
import hep.dataforge.exceptions.ControlException;
|
import hep.dataforge.exceptions.ControlException;
|
||||||
import hep.dataforge.exceptions.MeasurementException;
|
import hep.dataforge.exceptions.MeasurementException;
|
||||||
import hep.dataforge.fx.fragments.ConsoleFragment;
|
|
||||||
import hep.dataforge.fx.fragments.FragmentWindow;
|
import hep.dataforge.fx.fragments.FragmentWindow;
|
||||||
|
import hep.dataforge.fx.fragments.LogFragment;
|
||||||
import hep.dataforge.values.Value;
|
import hep.dataforge.values.Value;
|
||||||
import javafx.application.Platform;
|
import javafx.application.Platform;
|
||||||
import javafx.event.ActionEvent;
|
import javafx.event.ActionEvent;
|
||||||
@ -29,7 +29,7 @@ import java.util.ResourceBundle;
|
|||||||
public class PKT8Controller implements Initializable, DeviceListener, MeasurementListener<PKT8Result> {
|
public class PKT8Controller implements Initializable, DeviceListener, MeasurementListener<PKT8Result> {
|
||||||
|
|
||||||
private final PKT8Device device;
|
private final PKT8Device device;
|
||||||
private ConsoleFragment consoleFragment;
|
private LogFragment logFragment;
|
||||||
private PKT8PlotFragment plotFragment;
|
private PKT8PlotFragment plotFragment;
|
||||||
@FXML
|
@FXML
|
||||||
private ToggleButton startStopButton;
|
private ToggleButton startStopButton;
|
||||||
@ -59,11 +59,11 @@ public class PKT8Controller implements Initializable, DeviceListener, Measuremen
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void initialize(URL location, ResourceBundle resources) {
|
public void initialize(URL location, ResourceBundle resources) {
|
||||||
this.consoleFragment = new ConsoleFragment();
|
this.logFragment = new LogFragment();
|
||||||
consoleFragment.addLogHandler(device.getContext().getLogger());
|
logFragment.addLogHandler(device.getContext().getLogger());
|
||||||
//TODO to be removed later
|
//TODO to be removed later
|
||||||
consoleFragment.hookStd();
|
logFragment.hookStd();
|
||||||
new FragmentWindow(consoleFragment).bindTo(consoleButton);
|
new FragmentWindow(logFragment).bindTo(consoleButton);
|
||||||
plotFragment = new PKT8PlotFragment(device);
|
plotFragment = new PKT8PlotFragment(device);
|
||||||
new FragmentWindow(plotFragment).bindTo(plotButton);
|
new FragmentWindow(plotFragment).bindTo(plotButton);
|
||||||
|
|
||||||
|
@ -9,8 +9,5 @@ mainClassName = mainClass
|
|||||||
|
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
compile project(':numass-storage:numass-client')
|
compile project(':numass-control')
|
||||||
compile project(':dataforge-plots:plots-jfc')
|
|
||||||
compile project(':dataforge-fx')
|
|
||||||
compile project(':dataforge-control')
|
|
||||||
}
|
}
|
@ -22,8 +22,8 @@ import hep.dataforge.control.connections.StorageConnection;
|
|||||||
import hep.dataforge.exceptions.ControlException;
|
import hep.dataforge.exceptions.ControlException;
|
||||||
import hep.dataforge.exceptions.PortException;
|
import hep.dataforge.exceptions.PortException;
|
||||||
import hep.dataforge.exceptions.StorageException;
|
import hep.dataforge.exceptions.StorageException;
|
||||||
import hep.dataforge.fx.fragments.ConsoleFragment;
|
|
||||||
import hep.dataforge.fx.fragments.FragmentWindow;
|
import hep.dataforge.fx.fragments.FragmentWindow;
|
||||||
|
import hep.dataforge.fx.fragments.LogFragment;
|
||||||
import hep.dataforge.io.MetaFileReader;
|
import hep.dataforge.io.MetaFileReader;
|
||||||
import hep.dataforge.meta.ConfigChangeListener;
|
import hep.dataforge.meta.ConfigChangeListener;
|
||||||
import hep.dataforge.meta.Configuration;
|
import hep.dataforge.meta.Configuration;
|
||||||
@ -84,7 +84,7 @@ public class MspViewController implements Initializable, MspListener {
|
|||||||
private MspDevice device;
|
private MspDevice device;
|
||||||
private Configuration viewConfig;
|
private Configuration viewConfig;
|
||||||
private JFreeChartFrame plot;
|
private JFreeChartFrame plot;
|
||||||
private ConsoleFragment logArea;
|
private LogFragment logArea;
|
||||||
private StorageConnection connection;
|
private StorageConnection connection;
|
||||||
@FXML
|
@FXML
|
||||||
private Slider autoRangeSlider;
|
private Slider autoRangeSlider;
|
||||||
@ -124,7 +124,7 @@ public class MspViewController implements Initializable, MspListener {
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void initialize(URL url, ResourceBundle rb) {
|
public void initialize(URL url, ResourceBundle rb) {
|
||||||
logArea = new ConsoleFragment();
|
logArea = new LogFragment();
|
||||||
new FragmentWindow(logArea).bindTo(consoleButton);
|
new FragmentWindow(logArea).bindTo(consoleButton);
|
||||||
fillamentSelector.setItems(FXCollections.observableArrayList(1, 2));
|
fillamentSelector.setItems(FXCollections.observableArrayList(1, 2));
|
||||||
fillamentSelector.setConverter(new StringConverter<Integer>() {
|
fillamentSelector.setConverter(new StringConverter<Integer>() {
|
||||||
|
@ -0,0 +1,31 @@
|
|||||||
|
package inr.numass.control;
|
||||||
|
|
||||||
|
import hep.dataforge.control.devices.Device;
|
||||||
|
import hep.dataforge.control.devices.DeviceListener;
|
||||||
|
import hep.dataforge.fx.fragments.Fragment;
|
||||||
|
import javafx.scene.Parent;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by darksnake on 20-Oct-16.
|
||||||
|
*/
|
||||||
|
public abstract class DeviceFragment<T extends Device> extends Fragment implements DeviceListener {
|
||||||
|
|
||||||
|
private final T device;
|
||||||
|
|
||||||
|
protected DeviceFragment(T device) {
|
||||||
|
this.device = device;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected Parent buildRoot() {
|
||||||
|
return buildRoot(device);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected abstract Parent buildRoot(T device);
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void evaluateDeviceException(Device device, String message, Throwable exception) {
|
||||||
|
//do something pretty
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,16 @@
|
|||||||
|
package inr.numass.control;
|
||||||
|
|
||||||
|
import hep.dataforge.control.devices.Device;
|
||||||
|
import hep.dataforge.fx.fragments.Fragment;
|
||||||
|
import hep.dataforge.fx.fragments.LogFragment;
|
||||||
|
import hep.dataforge.utils.MetaFactory;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by darksnake on 20-Oct-16.
|
||||||
|
*/
|
||||||
|
public interface Framework<T extends Device> {
|
||||||
|
LogFragment getLogFragment();
|
||||||
|
Fragment getPlotFragment();
|
||||||
|
DeviceFragment<T> getDeviceFragment();
|
||||||
|
MetaFactory<T> getDeviceFactory();
|
||||||
|
}
|
@ -7,16 +7,6 @@ if (!hasProperty('mainClass')) {
|
|||||||
}
|
}
|
||||||
mainClassName = mainClass
|
mainClassName = mainClass
|
||||||
|
|
||||||
configurations {
|
|
||||||
compile.exclude module: 'groovy'
|
|
||||||
compile.exclude module: 'groovy-all'
|
|
||||||
compile.exclude module: 'shichimifx'
|
|
||||||
compile.exclude module: 'zt-zip'
|
|
||||||
}
|
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
compile project(':numass-storage:numass-client')
|
compile project(':numass-control')
|
||||||
compile project(':dataforge-plots:plots-jfc')
|
|
||||||
compile project(':dataforge-control')
|
|
||||||
compile project(':dataforge-fx')
|
|
||||||
}
|
}
|
@ -14,8 +14,8 @@ import hep.dataforge.control.measurements.MeasurementListener;
|
|||||||
import hep.dataforge.control.measurements.Sensor;
|
import hep.dataforge.control.measurements.Sensor;
|
||||||
import hep.dataforge.exceptions.ControlException;
|
import hep.dataforge.exceptions.ControlException;
|
||||||
import hep.dataforge.exceptions.MeasurementException;
|
import hep.dataforge.exceptions.MeasurementException;
|
||||||
import hep.dataforge.fx.fragments.ConsoleFragment;
|
|
||||||
import hep.dataforge.fx.fragments.FragmentWindow;
|
import hep.dataforge.fx.fragments.FragmentWindow;
|
||||||
|
import hep.dataforge.fx.fragments.LogFragment;
|
||||||
import hep.dataforge.meta.Meta;
|
import hep.dataforge.meta.Meta;
|
||||||
import hep.dataforge.meta.MetaBuilder;
|
import hep.dataforge.meta.MetaBuilder;
|
||||||
import hep.dataforge.plots.data.TimePlottable;
|
import hep.dataforge.plots.data.TimePlottable;
|
||||||
@ -71,7 +71,7 @@ public class VacCollectorController implements Initializable, DeviceListener, Me
|
|||||||
private final String[] intervalNames = {"1 sec", "5 sec", "10 sec", "30 sec", "1 min"};
|
private final String[] intervalNames = {"1 sec", "5 sec", "10 sec", "30 sec", "1 min"};
|
||||||
private final int[] intervals = {1000, 5000, 10000, 30000, 60000};
|
private final int[] intervals = {1000, 5000, 10000, 30000, 60000};
|
||||||
private final List<VacuumeterView> views = new ArrayList<>();
|
private final List<VacuumeterView> views = new ArrayList<>();
|
||||||
private ConsoleFragment consoleWindow;
|
private LogFragment consoleWindow;
|
||||||
private Logger logger;
|
private Logger logger;
|
||||||
private LoaderConnection storageConnection;
|
private LoaderConnection storageConnection;
|
||||||
private VacCollectorDevice device;
|
private VacCollectorDevice device;
|
||||||
@ -111,7 +111,7 @@ public class VacCollectorController implements Initializable, DeviceListener, Me
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
consoleWindow = new ConsoleFragment();
|
consoleWindow = new LogFragment();
|
||||||
new FragmentWindow(consoleWindow).bindTo(logButton);
|
new FragmentWindow(consoleWindow).bindTo(logButton);
|
||||||
consoleWindow.hookStd();
|
consoleWindow.hookStd();
|
||||||
}
|
}
|
||||||
|
@ -19,8 +19,8 @@ import hep.dataforge.exceptions.NameNotFoundException;
|
|||||||
import hep.dataforge.fx.FXDataOutputPane;
|
import hep.dataforge.fx.FXDataOutputPane;
|
||||||
import hep.dataforge.fx.FXReportListener;
|
import hep.dataforge.fx.FXReportListener;
|
||||||
import hep.dataforge.fx.configuration.MetaEditor;
|
import hep.dataforge.fx.configuration.MetaEditor;
|
||||||
import hep.dataforge.fx.fragments.ConsoleFragment;
|
|
||||||
import hep.dataforge.fx.fragments.FragmentWindow;
|
import hep.dataforge.fx.fragments.FragmentWindow;
|
||||||
|
import hep.dataforge.fx.fragments.LogFragment;
|
||||||
import hep.dataforge.fx.work.WorkManagerFragment;
|
import hep.dataforge.fx.work.WorkManagerFragment;
|
||||||
import hep.dataforge.io.IOManager;
|
import hep.dataforge.io.IOManager;
|
||||||
import hep.dataforge.io.MetaFileReader;
|
import hep.dataforge.io.MetaFileReader;
|
||||||
@ -117,7 +117,7 @@ public class NumassWorkbenchController implements Initializable, StagePaneHolder
|
|||||||
logPane = new FXDataOutputPane();
|
logPane = new FXDataOutputPane();
|
||||||
logTab.setContent(logPane.getRoot());
|
logTab.setContent(logPane.getRoot());
|
||||||
|
|
||||||
ConsoleFragment consoleWindow = new ConsoleFragment();
|
LogFragment consoleWindow = new LogFragment();
|
||||||
new FragmentWindow(consoleWindow).bindTo(consoleButton);
|
new FragmentWindow(consoleWindow).bindTo(consoleButton);
|
||||||
consoleWindow.addRootLogHandler();
|
consoleWindow.addRootLogHandler();
|
||||||
consoleWindow.hookStd();
|
consoleWindow.hookStd();
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
dependencies {
|
dependencies {
|
||||||
compile project(':dataforge-storage')
|
compile project(':dataforge-storage')
|
||||||
compile project(':dataforge-grind')
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -21,5 +21,4 @@ dependencies {
|
|||||||
compile project(':numass-storage')
|
compile project(':numass-storage')
|
||||||
compile 'commons-cli:commons-cli:1.3.1'
|
compile 'commons-cli:commons-cli:1.3.1'
|
||||||
compile 'org.zeroturnaround:zt-zip:1.9'
|
compile 'org.zeroturnaround:zt-zip:1.9'
|
||||||
compile project(':dataforge-grind')
|
|
||||||
}
|
}
|
@ -19,8 +19,8 @@ import hep.dataforge.computation.ProgressCallback;
|
|||||||
import hep.dataforge.context.Context;
|
import hep.dataforge.context.Context;
|
||||||
import hep.dataforge.context.GlobalContext;
|
import hep.dataforge.context.GlobalContext;
|
||||||
import hep.dataforge.exceptions.StorageException;
|
import hep.dataforge.exceptions.StorageException;
|
||||||
import hep.dataforge.fx.fragments.ConsoleFragment;
|
|
||||||
import hep.dataforge.fx.fragments.FragmentWindow;
|
import hep.dataforge.fx.fragments.FragmentWindow;
|
||||||
|
import hep.dataforge.fx.fragments.LogFragment;
|
||||||
import hep.dataforge.fx.work.WorkManagerFragment;
|
import hep.dataforge.fx.work.WorkManagerFragment;
|
||||||
import inr.numass.NumassProperties;
|
import inr.numass.NumassProperties;
|
||||||
import inr.numass.storage.NumassData;
|
import inr.numass.storage.NumassData;
|
||||||
@ -101,9 +101,9 @@ public class MainViewerController implements Initializable {
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void initialize(URL url, ResourceBundle rb) {
|
public void initialize(URL url, ResourceBundle rb) {
|
||||||
ConsoleFragment consoleFragment = new ConsoleFragment();
|
LogFragment logFragment = new LogFragment();
|
||||||
consoleFragment.hookStd();
|
logFragment.hookStd();
|
||||||
new FragmentWindow(consoleFragment).bindTo(consoleButton);
|
new FragmentWindow(logFragment).bindTo(consoleButton);
|
||||||
new FragmentWindow(WorkManagerFragment.attachToContext(GlobalContext.instance())).bindTo(processManagerButton);
|
new FragmentWindow(WorkManagerFragment.attachToContext(GlobalContext.instance())).bindTo(processManagerButton);
|
||||||
|
|
||||||
mspController = new MspViewController(getContext());
|
mspController = new MspViewController(getContext());
|
||||||
|
Loading…
Reference in New Issue
Block a user