using Microsoft.AspNetCore.Http;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace SolarPower.Models.PowerStation
{
    public enum SolarTypeEnum : byte
    {
        SelfSold = 0, //自建躉售
        HireSold = 1, //租建躉售
        SelfUse  = 2  //自建自用
    }
    public class PowerStation : Created
    {
        private string electricityMeterAt = "", tpcContractAt = "", tpcPurchaseElectricityAt = "", tpcSellElectricityAt = "";

        public int Id { get; set; }
        public byte HealthStatus { get; set; } //狀態
        public int CompanyId { get; set; }
        public int CityId { get; set; } //縣市
        public string CityName { get; set; } //縣市名稱
        public int AreaId { get; set; } //地區
        public string AreaName { get; set; } //地區
        public string Address { get; set; } //地址
        public string Name { get; set; } //名稱
        public string MainDisplay { get; set; } //主要顯示圖片
        public string Code { get; set; } //電站代碼
        public string SerialNumber { get; set; } //四碼流水號
        public byte IsEscrow { get; set; } //是否被代管
        public string EscrowName { get; set; } //被代管公司
        public string ElectricityMeterAt //台電掛錶日
        {
            get
            {
                if (!string.IsNullOrEmpty(electricityMeterAt))
                {
                    return Convert.ToDateTime(electricityMeterAt).ToString("yyyy-MM-dd");
                }
                else
                {
                    return null;
                }
            }
            set { electricityMeterAt = value; }
        }
        public int EstimatedRecoveryTime { get; set; } //預計回收年限
        public double GeneratingCapacity { get; set; } //發電容量
        public double PowerRate { get; set; } //授電費率
        public List<int> OperationPersonnelIds { get; set; } //運維人員編號
        public string Coordinate { get; set; } //座標
        public string InverterBrand { get; set; } //逆變器廠牌
        public string InverterProductModel { get; set; } //逆變器型號
        public int InverterAmount { get; set; } //逆變器數量
        public string PhotovoltaicPanelBrand { get; set; } //光電板廠牌
        public string PhotovoltaicPanelProductModel { get; set; } //光電板型號
        public string PhotovoltaicPanelSpecification { get; set; } //光電板規格
        public int PhotovoltaicPanelAmount { get; set; } //光電板規格
        public string BoEFileName { get; set; } //能源局原檔案名
        public string BoEFile { get; set; } //能源局檔案
        public int BoEDiscountRate { get; set; } //能源局折扣率 
        public string BoEDeviceRegisterNumber { get; set; } //能源局設備登記編號
        public int BoERentRatio { get; set; } //能源局租金比例
        public string TPCContractNumber { get; set; } //台電契約編號
        public string TPCContractAt //台電簽約日期
        {
            get
            {
                if (!string.IsNullOrEmpty(tpcContractAt))
                {
                    return Convert.ToDateTime(tpcContractAt).ToString("yyyy-MM-dd");
                }
                else
                {
                    return null;
                }
            }
            set { tpcContractAt = value; }
        }
        public int TPCSellDeadline { get; set; } //台電售電期限(年)
        public int TPCMeterReading { get; set; } //台電每期抄錶日
        public string TPCPurchaseElectricityAt //台電正式購電日
        {
            get
            {
                if (!string.IsNullOrEmpty(tpcPurchaseElectricityAt))
                {
                    return Convert.ToDateTime(tpcPurchaseElectricityAt).ToString("yyyy-MM-dd");
                }
                else
                {
                    return null;
                }
            }
            set { tpcPurchaseElectricityAt = value; }
        }
        public string TPCSellElectricityAt //台電正式售電日
        {
            get
            {
                if (!string.IsNullOrEmpty(tpcPurchaseElectricityAt))
                {
                    return Convert.ToDateTime(tpcPurchaseElectricityAt).ToString("yyyy-MM-dd");
                }
                else
                {
                    return null;
                }
            }
            set { tpcPurchaseElectricityAt = value; }
        }
        public List<LandBuilding> LandBuildings { get; set; } //土地房屋資料
        public byte SolarType { get; set; } //電站類型
        public double kwh { get; set; } //
        public double Today_kWh { get; set; } //今日發電量
        public double Total_kWh { get; set; } //總發電量
        public double Today_Money { get; set; } //今日發電金額
        public double Total_Money { get; set; } //總發電金額
        public double Today_kwhkwp { get; set; }
        public double Avg_kwhkwp { get; set; }
        public double Today_PR { get; set; }
        public double Avg_PR { get; set; }
        public double Today_Carbon { get; set; } //今日減碳量
        public double Total_Carbon { get; set; } //總減碳量
        public double Today_irradiance { get; set; } //即時平均日照度
        public double Avg_irradiance { get; set; } //平均日照度(30天)
        public double SolarHour { get; set; } //總運轉小時
        public string SiteDB { get; set; } //電站 DB name: solar_com
        public string TodayWeather { get; set; } //今日天氣
        public double TodayWeatherTemp { get; set; } //今日溫度
        public string WeathersStationId { get; set; }//氣象站編號
        public string RateOfRain { get; set; }//降雨機率
        public string CreatorName { get; set; } //創建者名稱
    }

    public class LandBuilding : Created
    {
        private string leaseNotarizationAt;

        public int Id { get; set; }
        public int PowerStationId { get; set; }
        public string Address { get; set; }
        public string LeaseNotarizationAt //租約公證日期
        {
            get
            {
                if (!string.IsNullOrEmpty(leaseNotarizationAt))
                {
                    return Convert.ToDateTime(leaseNotarizationAt).ToString("yyyy-MM-dd");
                }
                else
                {
                    return null;
                }
            }
            set { leaseNotarizationAt = value; }
        }
        public string Landowner { get; set; } //地主姓名
        public string Purpose { get; set; } //房屋用途
        public int LeaseRate { get; set; } //租金比例
        public string Coordinate { get; set; } //經緯度
        public string Phone { get; set; } //電話
        public string CreatorName { get; set; } //創建者名稱

    }

    public class PowerStationOperationPersonnel : Created
    {
        public int PowerStationId { get; set; }
        public int UserId { get; set; }
    }

    public class PostPowerStationInfo
    {
        public int Id { get; set; }
        public int CityId { get; set; } //縣市
        public int AreaId { get; set; } //地區
        public string Address { get; set; } //地址
        public string Name { get; set; } //名稱
        //public string Code { get; set; }
        public byte IsEscrow { get; set; } //是否被代管
        public string EscrowName { get; set; } //被代管公司
        public string ElectricityMeterAt { get; set; } //台電掛錶日
        public int EstimatedRecoveryTime { get; set; } //預計回收年限
        public double GeneratingCapacity { get; set; } //發電容量
        public double PowerRate { get; set; } //授電費率
        public string Coordinate { get; set; } //座標
        public List<int> OperationPersonnelIds { get; set; } //運維人員編號
        public string InverterBrand { get; set; } //逆變器廠牌
        public string InverterProductModel { get; set; } //逆變器型號
        public int InverterAmount { get; set; } //逆變器數量
        public string PhotovoltaicPanelBrand { get; set; } //光電板廠牌
        public string PhotovoltaicPanelProductModel { get; set; } //光電板型號
        public string PhotovoltaicPanelSpecification { get; set; } //光電板規格
        public int PhotovoltaicPanelAmount { get; set; } //光電板規格
        public byte SolarType { get; set; } //電站類型
    }

    public class UpdatePowerStationInfo : Updated
    {
        public int CityId { get; set; } //縣市
        public int AreaId { get; set; } //地區
        public string Address { get; set; } //地址
        public string Name { get; set; } //名稱
        public byte IsEscrow { get; set; } //是否被代管
        public string EscrowName { get; set; } //被代管公司
        public string ElectricityMeterAt { get; set; } //台電掛錶日
        public int EstimatedRecoveryTime { get; set; } //預計回收年限
        public double GeneratingCapacity { get; set; } //發電容量
        public double PowerRate { get; set; } //授電費率
        public string Coordinate { get; set; } //座標
        public string InverterBrand { get; set; } //逆變器廠牌
        public string InverterProductModel { get; set; } //逆變器型號
        public int InverterAmount { get; set; } //逆變器數量
        public string PhotovoltaicPanelBrand { get; set; } //光電板廠牌
        public string PhotovoltaicPanelProductModel { get; set; } //光電板型號
        public string PhotovoltaicPanelSpecification { get; set; } //光電板規格
        public int PhotovoltaicPanelAmount { get; set; } //光電板規格
        public byte SolarType { get; set; } //電站類型
    }

    public class PostBoETPCInfo
    {
        public int Id { get; set; }
        public IFormFile BoEFile { get; set; }
        public int BoEDiscountRate { get; set; }
        public string BoEDeviceRegisterNumber { get; set; }
        public int BoERentRatio { get; set; }
        public string TPCContractNumber { get; set; }
        public string TPCContractAt { get; set; }
        public int TPCSellDeadline { get; set; }
        public int TPCMeterReading { get; set; }
        public string TPCPurchaseElectricityAt { get; set; }
        public string TPCSellElectricityAt { get; set; }
    }

    public class UpdateBoETPCInfo : Updated
    {
        public string BoEFileName { get; set; }
        public string BoEFile { get; set; }
        public int BoEDiscountRate { get; set; }
        public string BoEDeviceRegisterNumber { get; set; }
        public int BoERentRatio { get; set; }
        public string TPCContractNumber { get; set; }
        public string TPCContractAt { get; set; }
        public int TPCSellDeadline { get; set; }
        public int TPCMeterReading { get; set; }
        public string TPCPurchaseElectricityAt { get; set; }
        public string TPCSellElectricityAt { get; set; }
    }

    public class PostLandBuildingInfo
    {
        public int Id { get; set; }
        public int PowerStationId { get; set; }
        public string Address { get; set; }
        public string LeaseNotarizationAt { get; set; }
        public string Landowner { get; set; }
        public string Purpose { get; set; }
        public int LeaseRate { get; set; }
        public string Coordinate { get; set; }
        public string Phone { get; set; }
    }

    public class UpdateLandBuilding : Updated
    {
        public string Address { get; set; }
        public string LeaseNotarizationAt { get; set; }
        public string Landowner { get; set; }
        public string Purpose { get; set; }
        public int LeaseRate { get; set; }
        public string Coordinate { get; set; }
        public string Phone { get; set; }
    }

    public class CitySelectItemList
    {
        public string Text { get; set; }
        public string Value { get; set; }
    }

    public class AreaSelectItemList
    {
        public string Text { get; set; }
        public string Value { get; set; }
    }

    public class Zipcode
    {
        public string City { get; set; }
        public string Area { get; set; }
    }

    public class City
    {
        public int Id { get; set; }
        public string Name { get; set; }
        public string ZipCode { get; set; }
        public int Priority { get; set; }
    }

    public class Area
    {
        public int Id { get; set; }
        public int CityId { get; set; }
        public string Name { get; set; }
        public string ZipCode { get; set; }
    }


    public class OperationInfo : Created
    {
        public int Id { get; set; }
        public int PowerStationId { get; set; }//電廠id
        public int Type { get; set; }//廠商類別
        public string Name { get; set; }//名稱
        public string ContactPerson { get; set; }//聯絡人
        public string Phone { get; set; }//電話
        public string Email { get; set; }//Email
    }

    /// <summary>
    /// 針對電站管理的運維、設備及異常設定
    /// </summary>
    public class PostPowerStationIdAndSelectedId
    {
        public int PowerStationId { get; set; }
        public int SelectedId { get; set; }
    }

    public class OperationTable : OperationInfo
    {
        public string CreatedName { get; set; }//建立者名稱
        public string Function { get; set; }//功能
        public string TypeName { get; set; }
    }

    /// <summary>
    /// 設備裝置下拉選單
    /// </summary>
    public class Type
    {
        public string Name { get; set; }
        public string EName { get; set; }
    }

    public class Root
    {
        public List<Type> Type { get; set; }
    }

    /// <summary>
    /// 表Variable 取來解析
    /// </summary>
    public class Variable
    {
        public string name { get; set; }
        public string value { get; set; }
    }

    /// <summary>
    /// 設備
    /// </summary>
    public class DeviceInfo : UserInfo
    {
        private string installDate;
        public int PowerStationId { get; set; }//所屬電站編號
        public string Name { get; set; }//名稱
        public string Type { get; set; }//類型
        public string Brand { get; set; }//廠牌
        public string ProductModel { get; set; }//型號
        public string DBName { get; set; }
        public string TableName { get; set; }
        public string ColName { get; set; }
        public int ControllerId { get; set; }
        public string TypeName { get; set; }//類型名稱
        public int Enabled { get; set; }//啟用
        public int Status { get; set; }//狀態
        public string InstallDate { get { return Convert.ToDateTime(installDate).ToString("yyyy-MM-dd"); } set { installDate = value; } } //安裝日期
    }

    public class Device : DeviceInfo
    {
        public string UID { get; set; }//設備編號
        public string SerialNumber { get; set; }
        public string PowerStationName { get; set; }
    }

    /// <summary>
    ///設備dataTable 
    /// </summary>
    public class DeviceTable : DeviceInfo
    {
        public string ControllerName { get; set; }
        public string UID { get; set; }//設備編號
        public string Function { get; set; }//功能
        public string PowerStationName { get; set; }
        public string EnabledName { get; set; }//啟用
        public string StatusName { get; set; }//狀態
    }

    /// <summary>
    /// 異常modal
    /// </summary>
    public class ExceptionModal : Created
    {
        public int Id { get; set; }
        public int PowerStationId { get; set; }
        public byte Type { get; set; }
        public decimal UpperLimit { get; set; }
        public decimal LowerLimit { get; set; }
        public byte Alarm { get; set; }
    }

    /// <summary>
    /// 異常設定Table
    /// </summary>
    public class ExceptionTable : ExceptionModal
    {
        public string PowerStationName { get; set; }
        public string PowerStationCode { get; set; }
        public string Function { get; set; }//功能
        public string TypeName { get; set; }
        public string AlarmName { get; set; }
    }

    /// <summary>
    /// 上傳電站圖片
    /// </summary>
    public class PostPowerStationImage
    {
        public int Id { get; set; }
        public int PowerStationId { get; set; }
        public IFormFile[] StationImages { get; set; }
    }

    /// <summary>
    /// 電站圖片資訊
    /// </summary>
    public class PowerStationImage : Created
    {
        public int Id { get; set; }
        public int PowerStationId { get; set; }
        public byte IsMainDisplay { get; set; }
        public string Image { get; set; }
    }

    /// <summary>
    /// 上傳卡片顯示圖
    /// </summary>
    public class PostChangeMainDisplay
    {
        public int PowerStationId { get; set; }
        public int TargetImageId { get; set; }
    }

    /// <summary>
    /// 更新電站圖片
    /// </summary>
    public class UpdataPowerStationImage: Updated
    {
        public int PowerStationId { get; set; }
        public byte IsMainDisplay { get; set; }
        public string Image { get; set; }
    }

    /// <summary>
    /// 上傳單線圖
    /// </summary>
    public class PostPowerStationSingleLine
    {
        public int Id { get; set; }
        public int PowerStationId { get; set; }
        public IFormFile[] SingleLineImages { get; set; }
    }

    /// <summary>
    /// 單線圖片資訊
    /// </summary>
    public class PowerStationSingleLine : Created
    {
        public int Id { get; set; }
        public int PowerStationId { get; set; }
        public string Image { get; set; }
    }

    /// <summary>
    /// 電站縣市分佈
    /// </summary>
    public class SolarCityAmount
    {
        public int CityId { get; set; }
        public string City { get; set; }
        public int Amount { get; set; }
    }

    public class OperationPersonnelSelectItemList
    {
        public string Text { get; set; }
        public string Value { get; set; }
    }
    /// <summary>
    /// 控制器
    /// </summary>
    public class DeviceController : Created
    {
        public int Id { get; set; }
        public int PowerStationId { get; set; }
        public string SerialNumber { get; set; }
        public string ControllerId { get; set; }
    }

    public class DeviceControllerModal : DeviceController
    {
        public int Count { get; set; }//數量
    }
    /// <summary>
    /// 控制器datatable
    /// </summary>
    public class DeviceControllerTable : DeviceController
    {
        public string CreatedName { get; set; }
        public string Function { get; set; }
    }
    /// <summary>
    /// 逆變器
    /// </summary>
    public class Inverter : UserInfo
    {
        private string installDate;

        public int ControllerId { get; set; }//控制器
        public string InverterName { get; set; }//逆變器名稱
        public string InstallDate { get { return Convert.ToDateTime(installDate).ToString("yyyy-MM-dd"); } set { installDate = value; } } //安裝日期
        public string Brand { get; set; }//廠牌
        public string Model { get; set; }//型號
        public double Capacity { get; set; }//裝置容量 kWp
        public int Pyrheliometer { get; set; }//日照計設備流水號
        public int PowerStationId { get; set; }//電站
        public int Enabled { get; set; }//是否啟用
        public int Status { get; set; }//狀態
        public string SerialNumber { get; set; }//流水號
        public string InverterId { get; set; }//逆變器id
    }
    /// <summary>
    /// 控制器datatable
    /// </summary>
    public class InverterTable : Inverter
    {
        public string ControllerName { get; set; }
        public string CreatedName { get; set; }
        public string Function { get; set; }
        public string EnabledName { get; set; }
        public string StatusName { get; set; }
        public string PyrheliometerName { get; set; }
    }
    /// <summary>
    /// 下拉式選單用
    /// </summary>
    public class PowerstationOption
    {
        public string Text { get; set; }
        public string Value { get; set; }
    }
    /// <summary>
    /// 共享設備
    /// </summary>
    public class Sharedevice : Created
    {
        public int Id { get; set; }
        public int PowerStationId { get; set; }
        public int DeviceId { get; set; }
    }


    public class PowerStationHistory
    {
        public int PowerStationId { get; set; }
        public string Timestamp { get; set; }
        public string SITEID { get; set; }
        public string SiteType { get; set; }
        public double KWH { get; set; }
        public double TodayKWh { get; set; }
        public double TotalKWH { get; set; }
        public double KWHKWP { get; set; }
        public double PR { get; set; }
        public double MP { get; set; }
        public double SolarHour { get; set; }
        public double MONEY { get; set; }
        public double CARBON { get; set; }
        public double TODAYMONEY { get; set; }
        public double TOTALMONEY { get; set; }
        public double TODAYCARBON { get; set; }
        public double TOTALCARBON { get; set; }
    }

    public class AvgPowerStationHistory
    {
        public int PowerStationId { get; set; }
        public double AvgKWHKWP { get; set; }
        public double AvgPR { get; set; }
    }

    public class PowerStationHistoryDay
    {
        public int PowerStationId { get; set; }
        public string Timestamp { get; set; }
        public string SITEID { get; set; }
        public string SiteType { get; set; }
        public double TodayKWh { get; set; }
        public double TotalKWH { get; set; }
        public double KWHKWP { get; set; }
        public double PR { get; set; }
        public double MP { get; set; }
        public double SolarHour { get; set; }
        public double MONEY { get; set; }
        public double CARBON { get; set; }
        public double TODAYMONEY { get; set; }
        public double TOTALMONEY { get; set; }
        public double TODAYCARBON { get; set; }
        public double TOTALCARBON { get; set; }
    }

    public class PowerStationHistoryMonth
    {
        public int PowerStationId { get; set; }
        public string Timestamp { get; set; }
        public string SITEID { get; set; }
        public string SiteType { get; set; }
        public double MONTHKWH { get; set; }
        public double TotalKWH { get; set; }
        public double KWHKWP { get; set; }
        public double PR { get; set; }
        public double MP { get; set; }
        public double SolarHour { get; set; }
        public double MONEY { get; set; }
        public double CARBON { get; set; }
        public double TOTALMONEY { get; set; }
        public double TOTALCARBON { get; set; }
    }

    public class PyrheliometerHistory
    {
        public int PowerStationId { get; set; }
        public string Timestamp { get; set; }
        public double Irradiance { get; set; }
        public double Temperature { get; set; }
    }

    public class AvgPyrheliometerHistory
    {
        public int PowerStationId { get; set; }
        public double AvgIrradiance { get; set; }
        public double AvgTemperature { get; set; }
    }

    public class PyrheliometerHistoryDay
    {
        public int PowerStationId { get; set; }
        public string Timestamp { get; set; }
        public double Irradiance { get; set; }
    }

    public class InverterHistory
    {
        public string TIMESTAMP { get; set; }
        public int PowerStationId { get; set; }
        public string INVERTERID { get; set; }
        public double Irradiance { get; set; }
        public double AC1V { get; set; }
        public double AC1A { get; set; }
        public double AC1W { get; set; }
        public double AC1F { get; set; }
        public double AC1WH { get; set; }
        public double AC2V { get; set; }
        public double AC2A { get; set; }
        public double AC2W { get; set; }
        public double AC2F { get; set; }
        public double AC2WH { get; set; }
        public double AC3V { get; set; }
        public double AC3A { get; set; }
        public double AC3W { get; set; }
        public double AC3F { get; set; }
        public double AC3WH { get; set; }
        public double DC1V { get; set; }
        public double DC1A { get; set; }
        public double DC1W { get; set; }
        public double DC1KW { get; set; }
        public double DC1WH { get; set; }
        public double DC2V { get; set; }
        public double DC2A { get; set; }
        public double DC2W { get; set; }
        public double DC2KW { get; set; }
        public double DC2WH { get; set; }
        public double DC3V { get; set; }
        public double DC3A { get; set; }
        public double DC3W { get; set; }
        public double DC3KW { get; set; }
        public double DC3WH { get; set; }
        public double DC4V { get; set; }
        public double DC4A { get; set; }
        public double DC4W { get; set; }
        public double DC4KW { get; set; }
        public double DC4WH { get; set; }
        public double DC5V { get; set; }
        public double DC5A { get; set; }
        public double DC5W { get; set; }
        public double DC5KW { get; set; }
        public double DC5WH { get; set; }
        public double PR { get; set; }
        public double RA1 { get; set; }
        public double RA2 { get; set; }
        public double RA3 { get; set; }
        public double RA4 { get; set; }
        public double RA5 { get; set; }
        public double DCKW { get; set; }
        public double ACKW { get; set; }
        public double KWH { get; set; }
        public double TODAYKWH { get; set; }
        public double KWHKWP { get; set; }
    }
    #region 氣象觀測
    public class FieldsItem
    {
        public string Id { get; set; }
        public string Type { get; set; }
    }

    public class Result
    {
        public string Resource_id { get; set; }
        public List<FieldsItem> Fields { get; set; }
    }

    public class Time
    {
        public string ObsTime { get; set; }
    }

    public class WeatherElementItem
    {
        public string ElementName { get; set; }
        public string ElementValue { get; set; }
        public List<TimeItem> Time { get; set; }
    }

    public class ParameterItem
    {
        public string ParameterName { get; set; }
        public string ParameterValue { get; set; }
    }

    public class LocationItem
    {
        public string Lat { get; set; }
        public string Lon { get; set; }
        public string LocationName { get; set; }
        public string StationId { get; set; }
        public Time Time { get; set; }
        public List<WeatherElementItem> WeatherElement { get; set; }
        public List<ParameterItem> Parameter { get; set; }
    }

    public class Records
    {
        public string DatasetDescription { get; set; }
        public List<LocationItem> Location { get; set; }
    }

    public class Root2 //氣象觀測(主要)(opendata取資料)
    {
        public string Success { get; set; }
        public Result Result { get; set; }
        public Records Records { get; set; }
    }
    #endregion

    public class WeatherObservation //氣象觀測(資料庫)
    {
        public int PowerStationId { get; set; }
        private string obsTime;
        public string ObsTime { get { return Convert.ToDateTime(obsTime).ToString("yyyy-MM-dd HH:mm:ss"); } set { obsTime = value; } }
        public double Temp { get; set; }
    }

    public class WeatherForecast //氣象預報(資料庫) 
    {
        public string LocationName { get; set; }
        public string Wx { get; set; }
        public string WxValue { get; set; }
        public string PoP { get; set; }
        private string startTime;
        public string StartTime { get { return Convert.ToDateTime(startTime).ToString("yyyy-MM-dd HH:mm:ss"); } set { startTime = value; } }
        private string endTime;
        public string EndTime { get { return Convert.ToDateTime(endTime).ToString("yyyy-MM-dd HH:mm:ss"); } set { endTime = value; } }
    }

    public class Parameter//氣象預報(opendata取資料)
    {
        public string ParameterName { get; set; }
        public string ParameterValue { get; set; }
        public string ParameterUnit { get; set; }
    }

    public class TimeItem//氣象預報(opendata取資料)
    {
        public string StartTime { get; set; }
        public string EndTime { get; set; }
        public Parameter Parameter { get; set; }
    }

    public class NowWeather
    {
        public string WeatherKey { get; set; } //現在天氣
        public string PoP { get; set; } //降雨機率
    }

    public class MoneyAndCarbon
    {
        public double MONEY { get; set; }
        public double CARBON { get; set; }
        public double TODAYMONEY { get; set; }
        public double TOTALMONEY { get; set; }
        public double TODAYCARBON { get; set; }
        public double TOTALCARBON { get; set; }
    }

    public class SensorAvgHistory
    {
        public string TIMESTAMP { get; set; }
        public int PowerStationId { get; set; }
        public double SENSORAVG01 { get; set; }
        public double SENSORAVG02 { get; set; }
        public double SENSORAVG03 { get; set; }
        public double SENSORAVG04 { get; set; }
        public double SENSORAVG05 { get; set; }
        public double SENSORAVG06 { get; set; }
        public double SENSORAVG07 { get; set; }
        public double SENSORAVG08 { get; set; }
        public double SENSORAVG09 { get; set; }
        public double SENSORAVG10 { get; set; }
        public double SENSORAVG11 { get; set; }
        public double SENSORAVG12 { get; set; }
        public double SENSORAVG13 { get; set; }
        public double SENSORAVG14 { get; set; }
        public double SENSORAVG15 { get; set; }
        public double SENSORAVG16 { get; set; }
        public double SENSORAVG17 { get; set; }
        public double SENSORAVG18 { get; set; }
        public double SENSORAVG19 { get; set; }
        public double SENSORAVG20 { get; set; }
        public double SENSORAVG21 { get; set; }
        public double SENSORAVG22 { get; set; }
        public double SENSORAVG23 { get; set; }
        public double SENSORAVG24 { get; set; }
        public double SENSORAVG25 { get; set; }
        public double SENSORAVG26 { get; set; }
        public double SENSORAVG27 { get; set; }
        public double SENSORAVG28 { get; set; }
        public double SENSORAVG29 { get; set; }
        public double SENSORAVG30 { get; set; }
        public double SENSORAVG31 { get; set; }
        public double SENSORAVG32 { get; set; }
        public double SENSORAVG33 { get; set; }
        public double SENSORAVG34 { get; set; }
        public double SENSORAVG35 { get; set; }
        public double SENSORAVG36 { get; set; }
        public double SENSORAVG37 { get; set; }
        public double SENSORAVG38 { get; set; }
        public double SENSORAVG39 { get; set; }
        public double SENSORAVG40 { get; set; }
        public double SENSORAVG41 { get; set; }
        public double SENSORAVG42 { get; set; }
        public double SENSORAVG43 { get; set; }
        public double SENSORAVG44 { get; set; }
        public double SENSORAVG45 { get; set; }
        public double SENSORAVG46 { get; set; }
        public double SENSORAVG47 { get; set; }
        public double SENSORAVG48 { get; set; }
        public double SENSORAVG49 { get; set; }
        public double SENSORAVG50 { get; set; }
    }



}
