Package tcg.scada.sim.iecsim.datastore

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


 
  //Set DI data point value (1 bit. Boolean) //TESTED
  public synchronized void SetDIPoint(String pointname, boolean value)
  {
    // Find relevant information
    DataPoint dp = dsTable_.getDataPoint(pointname);
    if (dp == null) {
      logger_.error("Can not find datapoint " + pointname + " for datastore " + datastore_.getId());
      return;
    }

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


  //Set DI data point value (1 bit., int)
  public synchronized void SetDIPoint(String pointname, int value)
  {
    // Find relevant information
    DataPoint dp = dsTable_.getDataPoint(pointname);
    if (dp == null) {
      logger_.error("Can not find datapoint " + pointname + " for datastore " + datastore_.getId());
      return;
    }

    boolean boolVal = false;
    if (value != 0)
    {
      boolVal = true;
    }
   
    try
    {
      dp.setBooleanValue(boolVal);
    }
    catch (Exception ex)
    {
      //ignore
    }
View Full Code Here

    }

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

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

  }

  //Toggle DI data points value (1 bit. Boolean.) // TESTED
  public synchronized void ToggleDIPoint(String pointname)
  {
    DataPoint dp = dsTable_.getDataPoint(pointname);
    if (dp == null) {
      logger_.error("Can not find datapoint " + pointname + " for datastore " + datastore_.getId());
      return;
    }

    // toggle the value
    try
    {
      boolean oldValue = dp.getBooleanValue();
      boolean newValue = (oldValue) ? false : true;

      dp.setBooleanValue(newValue);
    }
    catch (Exception ex)
    {
      //ignore
    }
View Full Code Here

    boolean oldValue = false, newValue = false;
   
    Collection<DataPoint> dpList = dsTable_.getAllDIPoints();
    Iterator<DataPoint> it = dpList.iterator();
   
    DataPoint dp = null;
    while(it.hasNext())
    {
      dp = it.next();
      if (dp == null) continue;
     
      try
      {
        // toggle the value
        oldValue = dp.getBooleanValue();
        newValue = (oldValue) ? false : true;
        //set the value
        dp.setBooleanValue(newValue);
      }
      catch (Exception ex)
      {
        //ignore
      }
View Full Code Here

  }

  //Get DI data point value (1 bit) //TESTED
  public boolean GetDIPoint(String pointname) throws Exception
  {
    DataPoint dp = dsTable_.getDataPoint(pointname);
    if (dp == null) {
      logger_.error("Can not find datapoint " + pointname + " for datastore " + datastore_.getId());
      return false;
    }

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


  //Set AI data point value (1 Word. Boolean) // TESTED
  public synchronized void SetAIPoint(String pointname, int value)
  {
    DataPoint dp = dsTable_.getDataPoint(pointname);
    if (dp == null) {
      logger_.error("Can not find datapoint " + pointname + " for datastore " + datastore_.getId());
      return;
    }
   
    try
    {
      dp.setIntValue(value);
    }
    catch (Exception ex)
    {
      //ignore
    }
View Full Code Here

  public synchronized void SetAllAIPoints(int value)
  {
    Collection<DataPoint> dpList = dsTable_.getAllAIPoints();
    Iterator<DataPoint> it = dpList.iterator();
   
    DataPoint dp = null;
    while(it.hasNext())
    {
      dp = it.next();
      if (dp == null) continue;
     
      try
      {
        dp.setIntValue(value);
      }
      catch (Exception ex)
      {
        //ignore
      }     
    }
   
    //DDI is considered as AI
    dpList = dsTable_.getAllDDIPoints();
    it = dpList.iterator();
   
    while(it.hasNext())
    {
      dp = it.next();
      if (dp == null) continue;
     
      try
      {
        dp.setIntValue(value);
      }
      catch (Exception ex)
      {
        //ignore
      }     
    }

    //TDI is considered as AI
    dpList = dsTable_.getAllTDIPoints();
    it = dpList.iterator();
   
    while(it.hasNext())
    {
      dp = it.next();
      if (dp == null) continue;
     
      try
      {
        dp.setIntValue(value);
      }
      catch (Exception ex)
      {
        //ignore
      }     
View Full Code Here

  }

  //Get AI data point value (1 Word) // TESTED
  public int GetAIPoint(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.getIntValue();
  }
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.