init
This commit is contained in:
53
DataPRO/SensorDB/FactorySensorModel.cs
Normal file
53
DataPRO/SensorDB/FactorySensorModel.cs
Normal file
@@ -0,0 +1,53 @@
|
||||
using DTS.Slice.Users;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace DTS.SensorDB
|
||||
{
|
||||
public static class FactorySensorModel
|
||||
{
|
||||
public static SensorModel CreateModelFromSensor(SensorData sd, SensorCalibration sc, User currentUser)
|
||||
{
|
||||
var model = new SensorModel();
|
||||
|
||||
model.Calibration = new SensorCalibration(sc);
|
||||
|
||||
model.AxisNumber = sd.AxisNumber;
|
||||
model.Bridge = sd.Bridge;
|
||||
model.BridgeResistance = sd.BridgeResistance;
|
||||
model.CalInterval = sd.CalInterval;
|
||||
model.Capacity = sd.Capacity;
|
||||
model.CheckOffset = sd.CheckOffset;
|
||||
model.CouplingMode = sd.CouplingMode;
|
||||
model.Direction = sd.Direction;
|
||||
model.SupportedExcitation = sd.SupportedExcitation;
|
||||
|
||||
model.Filter = sd.Filter;
|
||||
model.IgnoreRange = sd.IgnoreRange;
|
||||
model.Invert = sd.Invert;
|
||||
model.LastModified = DateTime.Now;
|
||||
model.LastUpdatedBy = currentUser.UserName;
|
||||
model.Manufacturer = sd.Manufacturer;
|
||||
model.DisplayUnit = sd.DisplayUnit;
|
||||
model.Model = sd.Model;
|
||||
model.NumberOfAxes = sd.NumberOfAxes;
|
||||
model.OffsetToleranceHigh = sd.OffsetToleranceHigh;
|
||||
model.OffsetToleranceLow = sd.OffsetToleranceLow;
|
||||
model.PhysicalDimension = sd.PhysicalDimension;
|
||||
model.Polarity = sd.Polarity;
|
||||
//
|
||||
model.RangeHigh = sd.RangeHigh;
|
||||
model.RangeLow = sd.RangeLow;
|
||||
model.RangeMedium = sd.RangeMedium;
|
||||
model.Shunt = sd.Shunt;
|
||||
model.UniPolar = sd.UniPolar;
|
||||
model.UserPartNumber = sd.UserSerialNumber;
|
||||
model.Version = sd.Version;
|
||||
return model;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user