Package tcg.scada.sim.iecsim.datastore

Examples of tcg.scada.sim.iecsim.datastore.DataPoint


  }

  //Set MI data point value (2 Word. Boolean) // TESTED
  public synchronized void SetMIPoint(String pointname, long value)
  {
    DataPoint dp = dsTable_.getDataPoint(pointname);
    if (dp == null) {
      logger_.error("Can not find datapoint " + pointname + " for datastore " + datastore_.getId());
      return;
    }

    try
    {
      dp.setLongValue(value);
    }
    catch (Exception ex)
    {
      //ignore
    }
View Full Code Here


  public synchronized void SetAllMIPoints(long value)
  {
    Collection<DataPoint> dpList = dsTable_.getAllMIPoints();
    Iterator<DataPoint> it = dpList.iterator();
   
    DataPoint dp = null;
    while(it.hasNext())
    {
      dp = it.next();
      if (dp == null) continue;
     
      try
      {
        dp.setLongValue(value);
      }
      catch (Exception ex)
      {
        //ignore
      }     
View Full Code Here

  }

  //Get MI data point value (2 Word) // TESTED
  public long GetMIPoint(String pointname) throws Exception
  {
    DataPoint dp = dsTable_.getDataPoint(pointname);
    if (dp == null) {
      logger_.error("Can not find datapoint " + pointname + " for datastore " + datastore_.getId());
      return 0;
    }

    return dp.getLongValue();
  }
View Full Code Here

  }

  //Set UTC data point value (2 Word. Boolean)
  public synchronized void SetUTCPoint(String pointname)
  {
    DataPoint dp = dsTable_.getDataPoint(pointname);
    if (dp == null) {
      logger_.error("Can not find datapoint " + pointname + " for datastore " + datastore_.getId());
      return;
    }

    //additional validation
    if (dp.getDataPointType() != EDataPointType.TYPE_UTC)
      return;
   
    try
    {
      int value = (int)(new Date().getTime() / 1000);
      dp.setIntValue(value);
    }
    catch (Exception ex)
    {
      //ignore
    }
View Full Code Here

    }
  }

  public synchronized void SetUTCPoint(String pointname, Date value)
  {
    DataPoint dp = dsTable_.getDataPoint(pointname);
    if (dp == null)
    {
      logger_.error("Can not find datapoint " + pointname + " for datastore " + datastore_.getId());
      return;
    }
   
    //additional validation
    if (dp.getDataPointType() != EDataPointType.TYPE_UTC)
      return;
   
    try
    {
      int intVal = (int)(value.getTime() / 1000);
      dp.setIntValue(intVal);
    }
    catch (Exception ex)
    {
      //ignore
    }
View Full Code Here

  }


  public synchronized void SetUTCPoint(String pointname, String value)
  {
    DataPoint dp = dsTable_.getDataPoint(pointname);
    if (dp == null)
    {
      logger_.error("Can not find datapoint " + pointname + " for datastore " + datastore_.getId());
      return;
    }
   
    //additional validation
    if (dp.getDataPointType() != EDataPointType.TYPE_UTC)
      return;
   
    try
    {
      Date date = sdf_.parse(value);
      int intVal = (int)(date.getTime() / 1000);
      dp.setIntValue(intVal);
    }
    catch (ParseException pe)
    {
      logger_.error("Invalid date string format: " + value +
              ". Must be in '" + sdf_.toString() + "' format.");
View Full Code Here

  {
    int intVal = (int)(new Date().getTime() / 1000);
    Collection<DataPoint> dpList = dsTable_.getAllUTCPoints();
    Iterator<DataPoint> it = dpList.iterator();
   
    DataPoint dp = null;
    while(it.hasNext())
    {
      dp = it.next();
      if (dp == null) continue;
     
      try
      {
        dp.setIntValue(intVal);
      }
      catch (Exception ex)
      {
        //ignore
      }     
View Full Code Here

    }

    Collection<DataPoint> dpList = dsTable_.getAllUTCPoints();
    Iterator<DataPoint> it = dpList.iterator();
   
    DataPoint dp = null;
    while(it.hasNext())
    {
      dp = it.next();
      if (dp == null) continue;
     
      try
      {
        dp.setIntValue(intVal);
      }
      catch (Exception ex)
      {
        //ignore
      }     
View Full Code Here

    int intVal = (int)(value.getTime() / 1000);

    Collection<DataPoint> dpList = dsTable_.getAllUTCPoints();
    Iterator<DataPoint> it = dpList.iterator();
   
    DataPoint dp = null;
    while(it.hasNext())
    {
      dp = it.next();
      if (dp == null) continue;
     
      try
      {
        dp.setIntValue(intVal);
      }
      catch (Exception ex)
      {
        //ignore
      }     
View Full Code Here

  }

  //Get UTC data point value (2 Word) // TESTED
  public Date GetUTCPoint(String pointname) throws Exception
  {
    DataPoint dp = dsTable_.getDataPoint(pointname);
    if (dp == null)
    {
      logger_.error("Can not find datapoint " + pointname + " for datastore " + datastore_.getId());
      throw new Exception("Invalid datapoint");
    }
   
    //additional validation
    if (dp.getDataPointType() != EDataPointType.TYPE_UTC)
    {
      throw new Exception("Not UTC datapoint");
    }
   
    int value = 0;
    try
    {
      value = dp.getIntValue();
    }
    catch (Exception ex)
    {
      //ignore
    }
View Full Code Here

TOP

Related Classes of tcg.scada.sim.iecsim.datastore.DataPoint

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.