コード例 #1
0
        public static String GetActualMeasurementValue(Device deviceToRead)
        {
            String actualValue = null;

            switch (deviceToRead.Protocol)
            {
            case "com-1":
                actualValue = new SylcvacComAccess().GetActualValueFromComInterface(deviceToRead);
                break;

            default:
                throw new ReadWriteException("Keine Schnittstelle für das Prokololl " + deviceToRead.Protocol + " implementiert");
            }
            return(actualValue);
        }
コード例 #2
0
        public IHttpActionResult SetValueZero(String id)

        {
            try
            {
                List <Device> devices      = ConfigurationAccess.GetDeviceListFromConfig();
                Device        deviceToRead = DeviceListHandler.GetDeviceFromDeviceList(devices, id);
                String        handShake    = new SylcvacComAccess().SetActualValueToZero(deviceToRead);
                return(Ok(handShake));
            }
            catch (ReadWriteException ex)
            {
                return(BadRequest(ex.Message));
            }
        }