forked from ddrilling/AsbCloudServer
35cd538b1d
Add generic TelemetryDataController; Add TelemetryDataSpin and model; Add migration;
91 lines
9.1 KiB
C#
91 lines
9.1 KiB
C#
using Microsoft.EntityFrameworkCore;
|
||
using System;
|
||
using System.ComponentModel.DataAnnotations;
|
||
using System.ComponentModel.DataAnnotations.Schema;
|
||
using System.Text.Json.Serialization;
|
||
|
||
namespace AsbCloudDb.Model
|
||
{
|
||
[Table("t_telemetry_data_spin"), Comment("набор основных данных по SpinMaster")]
|
||
public class TelemetryDataSpin
|
||
{
|
||
[Key]
|
||
[Column("id")]
|
||
public int Id { get; set; }
|
||
|
||
[Column("id_telemetry")]
|
||
public int IdTelemetry { get; set; }
|
||
[Column("date", TypeName = "timestamp with time zone"), Comment("'2021-10-19 18:23:54+05'")]
|
||
public DateTime Date { get; set; }
|
||
|
||
[Column("top_drive_speed"), Comment("Скорость СВП")] public double? TopDriveSpeed { get; set; }
|
||
[Column("top_drive_speed_min"), Comment("нижний предел")] public double? TopDriveSpeedMin { get; set; }
|
||
[Column("top_drive_speed_max"), Comment("верхний предел")] public double? TopDriveSpeedMax { get; set; }
|
||
[Column("top_drive_speed_offset"), Comment("смещение")] public double? TopDriveSpeedOffset { get; set; }
|
||
[Column("top_drive_speed_err")] public int? TopDriveSpeedErr { get; set; }
|
||
[Column("top_drive_torque"), Comment("Момент СВП")] public double? TopDriveTorque { get; set; }
|
||
[Column("top_drive_torque_min")] public double? TopDriveTorqueMin { get; set; }
|
||
[Column("top_drive_torque_max")] public double? TopDriveTorqueMax { get; set; }
|
||
[Column("top_drive_torque_offset")] public double? TopDriveTorqueOffset { get; set; }
|
||
[Column("top_drive_torque_err")] public int? TopDriveTorqueErr { get; set; }
|
||
[Column("top_drive_speed_sp_from"), Comment("Заданная скорость c СВП")] public double? TopDriveSpeedSpFrom { get; set; }
|
||
[Column("top_drive_speed_sp_from_min")] public double? TopDriveSpeedSpFromMin { get; set; }
|
||
[Column("top_drive_speed_sp_from_max")] public double? TopDriveSpeedSpFromMax { get; set; }
|
||
[Column("top_drive_speed_sp_from_offset")] public double? TopDriveSpeedSpFromOffset { get; set; }
|
||
[Column("top_drive_speed_sp_from_err")] public int? TopDriveSpeedSpFromErr { get; set; }
|
||
[Column("top_drive_torque_sp_from"), Comment("Заданный момент c СВП")] public double? TopDriveTorqueSpFrom { get; set; }
|
||
[Column("top_drive_torque_sp_from_min")] public double? TopDriveTorqueSpFromMin { get; set; }
|
||
[Column("top_drive_torque_sp_from_max")] public double? TopDriveTorqueSpFromMax { get; set; }
|
||
[Column("top_drive_torque_sp_from_offset")] public double? TopDriveTorqueSpFromOffset { get; set; }
|
||
[Column("top_drive_torque_sp_from_err")] public int? TopDriveTorqueSpFromErr { get; set; }
|
||
[Column("top_drive_speed_sp_to"), Comment("Задание скорости на СВП")] public double? TopDriveSpeedSpTo { get; set; }
|
||
[Column("top_drive_speed_sp_to_min")] public double? TopDriveSpeedSpToMin { get; set; }
|
||
[Column("top_drive_speed_sp_to_max")] public double? TopDriveSpeedSpToMax { get; set; }
|
||
[Column("top_drive_speed_sp_to_offset")] public double? TopDriveSpeedSpToOffset { get; set; }
|
||
[Column("top_drive_speed_sp_to_err")] public int? TopDriveSpeedSpToErr { get; set; }
|
||
[Column("top_drive_torque_sp_to"), Comment("Задание момента на СВП")] public double? TopDriveTorqueSpTo { get; set; }
|
||
[Column("top_drive_torque_sp_to_min")] public double? TopDriveTorqueSpToMin { get; set; }
|
||
[Column("top_drive_torque_sp_to_max")] public double? TopDriveTorqueSpToMax { get; set; }
|
||
[Column("top_drive_torque_sp_to_offset")] public double? TopDriveTorqueSpToOffset { get; set; }
|
||
[Column("top_drive_torque_sp_to_err")] public int? TopDriveTorqueSpToErr { get; set; }
|
||
[Column("w2800"), Comment("Установка нуля энкодера")] public int? W2800 { get; set; }
|
||
[Column("w2810"), Comment(" автоматический сброс блокировки")] public int? W2810 { get; set; }
|
||
[Column("mode"), Comment("Выбранный режим управления")] public int? Mode { get; set; }
|
||
[Column("w2808"), Comment("Неисправность энкодера")] public int? W2808 { get; set; }
|
||
[Column("torque_starting"), Comment(" Страгивающий момент")] public double? TorqueStarting { get; set; }
|
||
[Column("rotor_torque_avg"), Comment(" Момент в роторе средний")] public double? RotorTorqueAvg { get; set; }
|
||
[Column("encoder_resolution "), Comment(" Разрешение энкодера")] public double? EncoderResolution { get; set; }
|
||
[Column("ratio"), Comment(" Коэффициент редукции редектора")] public double? Ratio { get; set; }
|
||
[Column("torque_right_limit"), Comment("Ограничение крутящего момента вправо")] public double? TorqueRightLimit { get; set; }
|
||
[Column("torque_left_limit"), Comment("Ограничение крутящего момента влево")] public double? TorqueLeftLimit { get; set; }
|
||
[Column("revols_right_limit"), Comment("Ограничение числа оборотов вправо")] public double? RevolsRightLimit { get; set; }
|
||
[Column("revols_left_limit"), Comment("Ограничение числа оборотов влево")] public double? RevolsLeftLimit { get; set; }
|
||
[Column("speed_right_sp"), Comment("Заданная скорость вращения вправо")] public double? SpeedRightSp { get; set; }
|
||
[Column("speed_left_sp"), Comment("Заданная скорость вращения влево")] public double? SpeedLeftSp { get; set; }
|
||
[Column("revols_right_total"), Comment("Суммарное количество оборотов вправо")] public double? RevolsRightTotal { get; set; }
|
||
[Column("revols_left_total"), Comment("Суммарное количество оборотов влево")] public double? RevolsLeftTotal { get; set; }
|
||
[Column("turn_right_once_by_torque"), Comment("Доворот по моменту единожды вправо")] public double? TurnRightOnceByTorque { get; set; }
|
||
[Column("turn_left_once_by_torque"), Comment("Доворот по моменту единожды влево")] public double? TurnLeftOnceByTorque { get; set; }
|
||
[Column("turn_right_once_by_angle"), Comment("Доворот по градусам единожды вправо")] public double? TurnRightOnceByAngle { get; set; }
|
||
[Column("turn_left_once_by_angle"), Comment("Доворот по градусам единожды влево")] public double? TurnLeftOnceByAngle { get; set; }
|
||
[Column("turn_right_once_by_revols"), Comment("Доворот по оборотам единожды вправо")] public double? TurnRightOnceByRevols { get; set; }
|
||
[Column("turn_left_once_by_revols"), Comment("Доворот по оборотам единожды влево")] public double? TurnLeftOnceByRevols { get; set; }
|
||
[Column("break_angle_k"), Comment("Коэффициент для расчёта за какой угол нужно тормозить")] public double? BreakAngleK { get; set; }
|
||
[Column("reverse_k_torque"), Comment("Коэффициент на который умножается момент, для того чтобы система поняла что мы движемся в обратную сторону")] public double? ReverseKTorque { get; set; }
|
||
[Column("position_zero"), Comment("Нулевая позиция осциляции")] public double? PositionZero { get; set; }
|
||
[Column("position_right"), Comment("Крайний правый угол осциляции")] public double? PositionRight { get; set; }
|
||
[Column("torque_ramp_time"), Comment("Время нарастания момента")] public double? TorqueRampTime { get; set; }
|
||
[Column("ver"), Comment("Версия ПО ПЛК")] public double? Ver { get; set; }
|
||
[Column("reverse_speed_sp_zero_time"), Comment("Время выдачи сигнала нулевой скорости на при смене направления")] public int? ReverseSpeedSpZeroTime { get; set; }
|
||
[Column("unlock_by_sector_out"), Comment(" Градус отклонения от сектора для автоматического сброса блокировки")] public double? UnlockBySectorOut { get; set; }
|
||
[Column("pid_mux_torque_left_limit"), Comment(" Момент при котором определяется ехать назад по моменту или по скорости")] public double? PidMuxTorqueLeftLimit { get; set; }
|
||
[Column("state"), Comment("Переменная этапа")] public int? State { get; set; }
|
||
[Column("break_angle_left"), Comment("Угол торможения влево при работе по моменту")] public double? BreakAngleLeft { get; set; }
|
||
|
||
[JsonIgnore]
|
||
[ForeignKey(nameof(IdTelemetry))]
|
||
[InverseProperty(nameof(Model.Telemetry.DataSpin))]
|
||
public virtual Telemetry Telemetry { get; set; }
|
||
}
|
||
}
|