using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Siger.Middlelayer.Redis;
using Siger.Middlelayer.Log;
using Siger.ApiCommon.Result;
using Siger.Middlelayer.Common;
using Siger.Middlelayer.Redis.Repositories;
using Siger.Middlelayer.Common.ModuleEnum;
using Siger.Middlelayer.ToolRepository.Repositories.Interface;
using Siger.Middlelayer.ToolRepository.Request;
using Siger.Middlelayer.Common.Helpers;

namespace Siger.ApiTools.Utilities
{
    public class RealTimeHelper
    {
        private readonly ISigerProjectToolSpindleTrueRepository sigerProjectToolSpindleTrue;
        public RealTimeHelper(ISigerProjectToolSpindleTrueRepository sigerProjectToolSpindleTrueRepository)
        {
            sigerProjectToolSpindleTrue = sigerProjectToolSpindleTrueRepository;
        }
        public RequestRealTime GetLonginInf(string strjs)
        {
            try
            {
                var str = strjs.Replace("\0", "");
                return JsonHelper.DeserializerJsonResult<RequestRealTime>(str);

            }
            catch
            {
                return null;
            }
        }
        private string Condition(string mid,string spindle,string program)
        {
            return mid + spindle + program;
        }
        private string FixedConditRow(string time)
        {
            string strZero = string.Empty;
            for (int i=0;i<5- time.Length;i ++)
            {
                strZero += "0";
            }
            return strZero + time;
        }

    }
}
