ch.hevs.isi.field

## Class FieldConnector

- java.lang.Object
- - ch.hevs.isi.field.FieldConnector

All Implemented Interfaces:
  DataPointListener

    public class FieldConnector
    extends java.lang.Object
    implements DataPointListener

### Field Summary

### Fields inherited from interface ch.hevs.isi.core.DataPointListener

`listeners`

### Method Summary

All Methods Static Methods Instance Methods Concrete Methods
`static void` `createRegister(java.lang.String pathToFile)` read the csv-file of the ModbusMap
`static FieldConnector` `getMySelf()` static method to create a singleton pattern of the class checks if an instance of the class is already made if not, it creates an instance of the class FieldConnector
`void` `initialize(java.lang.String host, int port, java.lang.String pathToFile)` this method initialize the fieldConnector it connects the ModbusAccessor, reads the csv-file of the ModbusMap and starts the periodical polling of the modbus registers
`void` `onNewValue(DataPoint dp)`
`void` `startPeriodicalPolling()` method to start a periodical task in our case it is the reading of the modbus registers

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Methods inherited from interface ch.hevs.isi.core.DataPointListener

`subscribeUpdate`

### Method Detail

#### getMySelf

    public static FieldConnector getMySelf()

static method to create a singleton pattern of the class checks if an instance of the class is already made if not, it creates an instance of the class FieldConnector

Returns:
  instance of FieldConnector

#### createRegister

    public static void createRegister(java.lang.String pathToFile)

read the csv-file of the ModbusMap

Parameters:
  `pathToFile` - path to the file of all modbus registers (C:/.../ModbusMap.csv)

#### initialize

    public void initialize(java.lang.String host,
                           int port,
                           java.lang.String pathToFile)

this method initialize the fieldConnector it connects the ModbusAccessor, reads the csv-file of the ModbusMap and starts the periodical polling of the modbus registers

Parameters:
  `host` - ip address of the server
  `port` - port of the server
  `pathToFile` - path to the file of all modbus registers (C:/.../ModbusMap.csv)

#### onNewValue

    public void onNewValue(DataPoint dp)

Specified by:
  `onNewValue` in interface `DataPointListener`

#### startPeriodicalPolling

    public void startPeriodicalPolling()

method to start a periodical task in our case it is the reading of the modbus registers