using System;
using System.Collections;
using System.IO;
using QC.GlobalVariableManager;

namespace QC.QsprShared.QDARTLogging;

public class LogConfigInput
{
	private string logType = "";

	private Hashtable globalVars;

	public string PCNAME => Environment.MachineName;

	public string TREENAME
	{
		get
		{
			string value = GetValue("TREEFILENAME");
			return Path.GetFileNameWithoutExtension(value);
		}
	}

	public string LOG_TYPE => logType;

	public string SN => GetValue("SN");

	public string TECHNOLOGIES => GetValue("TECHNOLOGIES");

	public string DUT_INDEX => GetValue("DUT_INDEX");

	public string DATE => DateTime.Now.ToString("yyyy_MM_dd");

	public string DATE_TIME => DateTime.Now.ToString("yyyy_MM_dd-HH_mm_ss_fff");

	public LogConfigInput(Hashtable globals, string log_type)
	{
		globalVars = globals;
		logType = log_type;
	}

	private string GetValue(string key)
	{
		string gvValue = "";
		if (globalVars.ContainsKey(key) && globalVars[key] != null)
		{
			QTMGlobalVariable.GetGlobalVariable(key, out gvValue);
		}
		return gvValue;
	}
}
