using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace CapMachine.Core
{
///
/// 高速规则帮助方法
///
public class HighSpeedFileHelper
{
///
/// 获取文件路径
///
///
///
public static string GetFullFilePath(string FileRootPath, string DcInfo, string ExtInfo)
{
return $@"{FileRootPath}\{DateTime.Now.ToString("yyyy")}\{DcInfo}\{GetFileName(DcInfo)}{ExtInfo}.csv";
}
///
/// 获取本地文件路径
///
///
///
public static string GetLocalFullFilePath(string FileRootPath, string DcInfo, string ExtInfo)
{
return $@"{FileRootPath}\{DateTime.Now.ToString("yyyy")}\{DcInfo}\{GetFileName(DcInfo)}{ExtInfo}.csv";
}
///
/// 获取文件路径
///
///
///
public static string GetFilePath(string FileRootPath)
{
return $@"{FileRootPath}\{DateTime.Now.ToString("yyyy")}\";
}
///
/// 获取试验工况文件路径
///
///
///
public static string GetExpFilePath(string FileRootPath, string ExpName)
{
return $@"{FileRootPath}\{ExpName}";
}
///
/// 获取CSV文件路径
/// 对于一个试验来说,如果时间很长的话,则一天一个CSV文件
///
///
///
public static string GetCSVPath(string FileExpRootPath)
{
//return $@"{FileRootPath}\{DateTime.Now.ToString("yyyy")}\{DateTime.Now.ToString("MM-dd HHmm")}{workCond}.csv";
return $@"{FileExpRootPath}\{DateTime.Now.ToString("yyyy-MM-dd")}.csv";
}
///
/// 获取CSV文件路径
/// 对于一个试验来说,按照小时存储数据
///
///
///
public static string GetHourCSVPath(string FileExpRootPath, string HourFileName)
{
//return $@"{FileRootPath}\{DateTime.Now.ToString("yyyy")}\{DateTime.Now.ToString("MM-dd HHmm")}{workCond}.csv";
return $@"{FileExpRootPath}\{HourFileName}.csv";
}
///
/// 获取CSV文件名称
///
///
///
public static string GetFileName(string DcInfo)
{
return $"{DateTime.Now.ToString("yy")}{DcInfo}";
}
///
/// 获取CSV文件名称
///
///
///
public static string GetFileName(string DcInfo, string ExtInfo)
{
return $"{DateTime.Now.ToString("yy")}{DcInfo}{ExtInfo}.csv";
}
///
/// 获取Title文件-在本地盘 F盘中
///
///
///
public static string GetTitlePath(string Dcinfo, string fileRootPath)
{
//return fileRootPath + @"\Title\Title" + Dcinfo + ".csv";
//return "F:" + @"\Title\Title" + Dcinfo + ".csv";
//return "D:" + @"\DCM\Title\Title" + Dcinfo + ".csv";
return "F:" + @"\Title\Title" + Dcinfo + ".csv";
}
/////
///// 获取UI显示名称信息
/////
/////
/////
//public static string GetUIShowInfo(int DataInof)
//{
// return $"{GetMonthInfo()} {GetDayInfo()}{GetClassInfo()}-{DataInof}";
//}
//public static int StartHour = 6;
//public static int EndHour = 18;
/////
///// 获取白班和夜班的信息
/////
/////
//public static string GetClassInfo()
//{
// var NowTimeHour = DateTime.Now.Hour;
// if (NowTimeHour >= StartHour && NowTimeHour <= EndHour)
// {
// return "-";
// }
// else
// {
// return ":";
// }
//}
}
}