Package ve.net.dcs.sc.component

Examples of ve.net.dcs.sc.component.ScaleConnector


    int endCut = Integer.parseInt(SCUIFeature.get("DEFAULT_ENDCUT"));
    int sIndicatorPos = Integer.parseInt(SCUIFeature.get("DEFAULT_SINDICATORPOS"));
    int sIndicator = Integer.parseInt(SCUIFeature.get("DEFAULT_SINDICATOR"));
    int fPoint = Integer.parseInt(SCUIFeature.get("DEFAULT_FPOINT"));

    ScaleConnector sc = new ScaleConnector(serialPort, baud, dataBits, stopBits, parity);
    sc.setByteCount(byteCount);
    sc.setStartCharacter(startCharacter);
    sc.setEndCharacter(endCharacter);
    sc.setReadings(readings);
    sc.setStartCutPosition(startCut);
    sc.setEndCutPosition(endCut);
    sc.setStabilityValuePosition(sIndicatorPos);
    sc.setStabilityValue(sIndicator);
    sc.setFloatingPoint(fPoint);

    try {
      System.out.println("Value: " + sc.readValue());
    } catch (SerialPortTimeoutException e) {
      logger.severe("Finish timeout");
      e.printStackTrace();
    } catch (Exception e) {
      logger.severe("Error reading serial port");
View Full Code Here


            SCUIFeature.save();
          } catch (Exception ex) {
            ex.printStackTrace();
          }

          ScaleConnector sc = new ScaleConnector(port, baud, dataBits, stopBits, parity);
          sc.setByteCount(byteCount);
          sc.setReadings(readings);
          sc.setStartCharacter(startChar);
          sc.setEndCharacter(endChar);
          sc.setStartCutPosition(startCut);
          sc.setEndCutPosition(endCut);
          sc.setStabilityValuePosition(sIndicatorPos);
          sc.setStabilityValue(sIndicator);
          sc.setFloatingPoint(fPoint);

          byte[] bytesPortValue = null;
          String portValue = "";

          bytesPortValue = sc.readBytes();
          portValue = sc.readValue();

          viewServerMode.getLblPortValue().setText(portValue);

          if (sc.isStableValue()) {
            viewServerMode.getLblStatusValue().setText(SCUILocale.get("ViewServerMode.STATUS_STABLE"));
            viewServerMode.getLblStatusValue().setForeground(Color.GREEN);
          } else {
            viewServerMode.getLblStatusValue().setText(SCUILocale.get("ViewServerMode.STATUS_UNSTABLE"));
            viewServerMode.getLblStatusValue().setForeground(Color.RED);
View Full Code Here

TOP

Related Classes of ve.net.dcs.sc.component.ScaleConnector

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.