[no commit message]

This commit is contained in:
Alexander Nozik 2016-02-07 20:00:08 +03:00
parent cbcace34d8
commit 83081f5879
18 changed files with 1348 additions and 22 deletions

View File

@ -17,7 +17,7 @@ package inr.numass.cryotemp;
import ch.qos.logback.classic.Level;
import hep.dataforge.exceptions.ControlException;
import hep.dataforge.storage.commons.StoragePlugin;
import hep.dataforge.storage.commons.StorageManager;
import java.io.IOException;
import java.util.Locale;
import javafx.application.Application;
@ -40,7 +40,7 @@ public class PKT8App extends Application {
Locale.setDefault(Locale.US);// чтобы отделение десятичных знаков было точкой
ch.qos.logback.classic.Logger rootLogger = (ch.qos.logback.classic.Logger) LoggerFactory.getLogger(ch.qos.logback.classic.Logger.ROOT_LOGGER_NAME);
rootLogger.setLevel(Level.INFO);
new StoragePlugin().startGlobal();
new StorageManager().startGlobal();
FXMLLoader loader = new FXMLLoader(getClass().getResource("/fxml/PKT8MainView.fxml"));

View File

@ -62,10 +62,6 @@ public class MspDevice extends SingleMeasurementDevice implements PortHandler.Po
private Consumer<MspResponse> responseDelegate;
private Consumer<Throwable> errorDelegate;
public MspDevice(String name, Meta annotation) {
super(name, GlobalContext.instance(), annotation);
}
public MspDevice(String name, Context context, Meta config) {
super(name, context, config);
}

View File

@ -17,7 +17,7 @@ package inr.numass.control.msp.fx;
import ch.qos.logback.classic.Level;
import hep.dataforge.context.GlobalContext;
import hep.dataforge.storage.commons.StoragePlugin;
import hep.dataforge.storage.commons.StorageManager;
import java.io.File;
import java.io.IOException;
import java.util.Locale;
@ -41,7 +41,7 @@ public class MspApp extends Application {
Locale.setDefault(Locale.US);// чтобы отделение десятичных знаков было точкой
ch.qos.logback.classic.Logger rootLogger = (ch.qos.logback.classic.Logger) LoggerFactory.getLogger(ch.qos.logback.classic.Logger.ROOT_LOGGER_NAME);
rootLogger.setLevel(Level.INFO);
new StoragePlugin().startGlobal();
new StorageManager().startGlobal();
FXMLLoader loader = new FXMLLoader(getClass().getResource("/fxml/MspView.fxml"));

View File

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog" prefer="system">
<system systemId="http://javafx.com/javafx/8.0.65" uri="www.oracle.com/technetwork/java/javase/overview/index.html"/>
</catalog>

File diff suppressed because one or more lines are too long

View File

@ -21,7 +21,7 @@ import hep.dataforge.context.GlobalContext;
import static hep.dataforge.context.GlobalContext.out;
import hep.dataforge.io.MetaFileReader;
import hep.dataforge.storage.api.Storage;
import hep.dataforge.storage.commons.StoragePlugin;
import hep.dataforge.storage.commons.StorageManager;
import java.io.File;
import java.io.IOException;
import java.util.Locale;
@ -47,7 +47,7 @@ public class Main {
*/
public static void main(String[] args) throws Exception {
Locale.setDefault(Locale.US);
new StoragePlugin().startGlobal();
new StorageManager().startGlobal();
Meta config = getAnnotation(args);
runConfig(config);
// System.exit(0);//на всякий случай, чтобы закрыть все боковые потоки
@ -79,7 +79,7 @@ public class Main {
private static Storage setupServer(Context context, Meta config) {
Meta storageConfig = config.getNode("storage");
return context.provide("storage", StoragePlugin.class).buildStorage(storageConfig);
return context.provide("storage", StorageManager.class).buildStorage(storageConfig);
}
// private static String getDataPath(Meta config) {

View File

@ -84,7 +84,7 @@ public class CM32Device extends Sensor<Double> {
private int timeout() {
return meta().getInt("timeout", 400);
}
private class CMVacMeasurement extends SimpletMeasurement<Double> {
private static final String CM32_QUERY = "MES R PM 1\r\n";

View File

@ -0,0 +1,31 @@
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package inr.numass.readvac.fx;
import java.net.URL;
import java.util.ResourceBundle;
import javafx.fxml.FXML;
import org.controlsfx.control.ToggleSwitch;
/**
* FXML Controller class
*
* @author Alexander Nozik
*/
public class PoweredVacBoxController extends VacBoxController {
@FXML
ToggleSwitch powerSwitch;
/**
* Initializes the controller class.
*/
@Override
public void initialize(URL url, ResourceBundle rb) {
// TODO
}
}

View File

@ -0,0 +1,39 @@
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package inr.numass.readvac.fx;
import java.net.URL;
import java.util.ResourceBundle;
import javafx.fxml.FXML;
import javafx.fxml.Initializable;
import javafx.scene.control.Label;
import org.controlsfx.control.StatusBar;
/**
* FXML Controller class
*
* @author Alexander Nozik
*/
public class VacBoxController implements Initializable {
@FXML
protected Label deviceNameLabel;
@FXML
protected Label valueLabel;
@FXML
protected Label unitLabel;
@FXML
protected StatusBar status;
/**
* Initializes the controller class.
*/
@Override
public void initialize(URL url, ResourceBundle rb) {
// TODO
}
}

View File

@ -0,0 +1,17 @@
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package inr.numass.readvac.fx;
import hep.dataforge.control.devices.DeviceListener;
import hep.dataforge.control.measurements.MeasurementListener;
/**
*
* @author Alexander Nozik
*/
public interface VacView extends DeviceListener, MeasurementListener<Double> {
}

View File

@ -0,0 +1,41 @@
<?xml version="1.0" encoding="UTF-8"?>
<?import java.net.URL?>
<?import javafx.scene.control.Label?>
<?import javafx.scene.control.Separator?>
<?import javafx.scene.layout.AnchorPane?>
<?import javafx.scene.layout.Pane?>
<?import javafx.scene.layout.VBox?>
<?import org.controlsfx.control.StatusBar?>
<?import org.controlsfx.control.ToggleSwitch?>
<AnchorPane prefHeight="170.0" prefWidth="200.0" styleClass="vacBox" xmlns="http://javafx.com/javafx/8.0.65" xmlns:fx="http://javafx.com/fxml/1">
<stylesheets>
<URL value="@/styles/vacstyles.css" />
</stylesheets>
<children>
<VBox layoutX="50.0" layoutY="6.0" prefHeight="200.0" prefWidth="100.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
<children>
<Pane prefHeight="40.0" styleClass="beveled">
<children>
<Label id="name" fx:id="deviceNameLabel" alignment="CENTER" layoutX="12.0" prefHeight="40.0" prefWidth="176.0" text="device Name" />
</children>
</Pane>
<Separator prefWidth="200.0" />
<Pane prefHeight="60.0" styleClass="beveled">
<children>
<Label id="pressure" fx:id="valueLabel" alignment="CENTER_RIGHT" layoutX="14.0" prefHeight="60.0" prefWidth="90.0" text="1.22e-7" />
<Label id="units" fx:id="unitLabel" layoutX="124.0" prefHeight="60.0" prefWidth="62.0" text="mbar" />
</children>
</Pane>
<Separator prefWidth="200.0" />
<Pane VBox.vgrow="ALWAYS">
<children>
<ToggleSwitch fx:id="powerSwitch" layoutX="58.0" layoutY="8.0" text="Power" />
</children>
</Pane>
<StatusBar fx:id="status" />
</children>
</VBox>
</children>
</AnchorPane>

View File

@ -0,0 +1,36 @@
<?xml version="1.0" encoding="UTF-8"?>
<?import java.net.URL?>
<?import javafx.scene.control.Label?>
<?import javafx.scene.control.Separator?>
<?import javafx.scene.layout.AnchorPane?>
<?import javafx.scene.layout.Pane?>
<?import javafx.scene.layout.VBox?>
<?import org.controlsfx.control.StatusBar?>
<AnchorPane prefHeight="170.0" prefWidth="200.0" styleClass="vacBox" xmlns:fx="http://javafx.com/fxml/1" fx:controller="fxml.VacBoxController">
<stylesheets>
<URL value="@/styles/vacstyles.css" />
</stylesheets>
<children>
<VBox layoutX="50.0" layoutY="6.0" prefHeight="200.0" prefWidth="100.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
<children>
<Pane prefHeight="40.0" styleClass="beveled">
<children>
<Label id="name" fx:id="deviceNameLabel" alignment="CENTER" layoutX="12.0" prefHeight="40.0" prefWidth="176.0" text="device Name" />
</children>
</Pane>
<Separator prefWidth="200.0" />
<Pane prefHeight="60.0" styleClass="beveled">
<children>
<Label id="pressure" fx:id="valueLabel" alignment="CENTER_RIGHT" layoutX="14.0" prefHeight="60.0" prefWidth="90.0" text="1.22e-7" />
<Label id="units" fx:id="unitLabel" layoutX="124.0" prefHeight="60.0" prefWidth="62.0" text="mbar" />
</children>
</Pane>
<Separator prefWidth="200.0" />
<Pane maxHeight="1.7976931348623157E308" VBox.vgrow="ALWAYS" />
<StatusBar fx:id="status" />
</children>
</VBox>
</children>
</AnchorPane>

View File

@ -0,0 +1,25 @@
/*
* Empty Stylesheet file.
*/
.vacBox {
.beveled{
-fx-background-color: #BEBEBE;
-fx-border-color: #676767 white white #676767;
-fx-border-style: solid inside line-join miter;
}
#pressure{
-fx-font-size: 24;
-fx-font-style: bold
}
#units{
-fx-font-size: 24;
}
#name{
-fx-font-size: 18;
}
}

View File

@ -22,7 +22,7 @@ import hep.dataforge.io.envelopes.EnvelopeBuilder;
import hep.dataforge.meta.Meta;
import hep.dataforge.meta.MetaBuilder;
import hep.dataforge.storage.commons.MessageFactory;
import hep.dataforge.storage.commons.StoragePlugin;
import hep.dataforge.storage.commons.StorageManager;
import hep.dataforge.storage.commons.StorageUtils;
import hep.dataforge.values.Value;
import inr.numass.storage.NumassStorage;
@ -204,7 +204,7 @@ public class NumassClient extends MessageFactory implements Closeable {
}
public static void main(String[] args) {
new StoragePlugin().startGlobal();
new StorageManager().startGlobal();
Options options = buildOptions();

View File

@ -22,7 +22,7 @@ import hep.dataforge.meta.MetaBuilder;
import hep.dataforge.storage.api.StateLoader;
import hep.dataforge.storage.commons.AbstractNetworkListener;
import hep.dataforge.storage.commons.LoaderFactory;
import hep.dataforge.storage.commons.StoragePlugin;
import hep.dataforge.storage.commons.StorageManager;
import hep.dataforge.storage.filestorage.FileStorage;
import hep.dataforge.storage.servlet.SorageRatpackHandler;
import inr.numass.storage.NumassStorage;
@ -66,7 +66,7 @@ public class NumassServer extends AbstractNetworkListener {
* @param storage
*/
private void init(FileStorage storage) {
new StoragePlugin().startGlobal();
new StorageManager().startGlobal();
this.root = storage;
try {
rootState = LoaderFactory.buildStateLoder(storage, "@numass", null);

View File

@ -18,7 +18,7 @@ package inr.numass.server;
import hep.dataforge.io.MetaFileReader;
import hep.dataforge.meta.Annotated;
import hep.dataforge.meta.Meta;
import hep.dataforge.storage.commons.StoragePlugin;
import hep.dataforge.storage.commons.StorageManager;
import hep.dataforge.storage.filestorage.FileStorage;
import java.io.File;
import org.apache.commons.daemon.Daemon;
@ -69,7 +69,7 @@ public class NumassServerDaemon implements Daemon, Annotated {
public void init(DaemonContext dc) throws DaemonInitException, Exception {
logger.info("Starting numass server daemon");
logger.info("Starting storage plugin");
new StoragePlugin().startGlobal();
new StorageManager().startGlobal();
File configFile = new File(SERVER_CONFIG_PATH);
if (configFile.exists()) {

View File

@ -15,7 +15,7 @@
*/
package inr.numass.viewer;
import hep.dataforge.storage.commons.StoragePlugin;
import hep.dataforge.storage.commons.StorageManager;
import inr.numass.storage.NumassDataLoader;
import java.io.File;
import java.io.IOException;
@ -31,7 +31,7 @@ public class TestDirectoryViewer extends Application {
@Override
public void start(Stage primaryStage) throws IOException {
new StoragePlugin().startGlobal();
new StorageManager().startGlobal();
NumassDataLoader reader = NumassDataLoader.fromLocalDir(null, new File("C:\\Users\\darksnake\\Dropbox\\PlayGround\\data-test\\20150703143643_1\\"));
// NumassLoader reader = NumassLoader.fromZip(null, new File("C:\\Users\\darksnake\\Dropbox\\PlayGround\\data-test\\20150703143643_1.zip"));

View File

@ -16,7 +16,7 @@
package inr.numass.viewer;
import hep.dataforge.exceptions.StorageException;
import hep.dataforge.storage.commons.StoragePlugin;
import hep.dataforge.storage.commons.StorageManager;
import java.io.IOException;
import javafx.application.Application;
import javafx.concurrent.Task;
@ -33,7 +33,7 @@ public class Viewer extends Application {
@Override
public void start(Stage primaryStage) throws StorageException, IOException {
new StoragePlugin().startGlobal();
new StorageManager().startGlobal();
FXMLLoader fxml = new FXMLLoader(getClass().getResource("/fxml/MainView.fxml"));