Exemplo n.º 1
0
 public bool CreateMZHZY(string start, string end, out string msg)
 {
     try
     {
         //执行两个门诊病案存储过程
         sqlClient.ExecuteSP(SqlStr.MZ_MZLGFY);
         sqlClient.ExecuteSP(SqlStr.MZ_MZLGPELBLE);
         log.WriteLog("查询" + start + "-" + end + "门诊和在院流感数据");
         log.WriteLog(SqlStr.MzhzySql(start, end));
         DataTable data = sqlClient.ExecuteQuery(SqlStr.MzhzySql(start, end), CommandType.Text);
         if (data.Rows.Count < 0)
         {
             msg = "无门诊和在院流感数据\n";
         }
         else
         {
             CSVUtil.SaveCSV(data, fluUrl + "\\flu_门诊和在院流感" + start + "-" + end + ".csv");
             CSVUtil.SaveCSV(data, backUpUrl + "\\flu_门诊和在院流感" + start + "-" + end + ".csv");
             msg = "门诊和在院流感数据生成成功\n";
         }
         log.WriteLog("查询成功");
     }
     catch (Exception ex)
     {
         msg = ex.Message;
         log.WriteLog("查询失败:" + ex.Message, LogType.Error);
         return(false);
     }
     return(true);
 }
Exemplo n.º 2
0
 public bool CreateSWJL(string start, string end, out string msg)
 {
     try
     {
         log.WriteLog("查询" + start + "-" + end + "死亡记录数据");
         log.WriteLog(SqlStr.SwjlSql(start, end));
         DataTable data = sqlClient.ExecuteQuery(SqlStr.SwjlSql(start, end), CommandType.Text);
         if (data.Rows.Count < 0)
         {
             msg = "无死亡记录数据\n";
         }
         else
         {
             CSVUtil.SaveCSV(data, fluUrl + "\\hdr_死亡记录" + start + "-" + end + ".csv");
             CSVUtil.SaveCSV(data, backUpUrl + "\\hdr_死亡记录" + start + "-" + end + ".csv");
             msg = "死亡记录数据生成成功\n";
         }
         log.WriteLog("查询成功");
     }
     catch (Exception ex)
     {
         msg = ex.Message;
         log.WriteLog("查询失败:" + ex.Message, LogType.Error);
         return(false);
     }
     return(true);
 }
Exemplo n.º 3
0
		public static Dictionary<int, IllustratedData> GetIllustratedDataDicionary ()
		{
			if (_illustratedDataDictionary == null)
			{
				_illustratedDataDictionary = CSVUtil.Parse<int, IllustratedData>("config/csv/atlas", "id");
//				_illustratedDataDictionary = new Dictionary<int, IllustratedData>();
//				LuaTable luaTable = LuaScriptMgr.Instance.GetLuaTable("gamemanager");
//				object[] objs = LuaScriptMgr.Instance.CallLuaFunction("gamemanager.GetData","illustration_data");
//				LuaTable datas = objs[0] as LuaTable;
//				foreach(DictionaryEntry kvp in datas.ToDictTable())
//				{
//					LuaTable data = kvp.Value as LuaTable;
//					if(data == null)
//						continue;
//					IllustratedData illusData = new IllustratedData();
//					illusData.id = data["id"].ToString().ToInt32();
//					illusData.type = data["type"].ToString().ToInt32();
//					illusData.type_name = data["type_name"].ToString();
//					illusData.sheet = data["sheet"].ToString().ToInt32();
//					illusData.sheet_name = data["sheet_name"].ToString();
//					illusData.hero_id = data["hero_id"].ToString().ToInt32();
//					illusData.hero_star = data["hero_star"].ToString().ToInt32();
//					_illustratedDataDictionary.Add(illusData.id,illusData);
//				}

			}
			return _illustratedDataDictionary;
		}
Exemplo n.º 4
0
    private void CacheTranslationData(string _serializedData)
    {
        string[][] deserializedData = CSVUtil.DeserializeCSV(_serializedData);

        m_languageKeyToIndex = new Dictionary <string, int>();
        m_localizedValues    = new Dictionary <string, List <string> >();

        if (deserializedData != null && deserializedData.Length > 0)
        {
            for (int i = 0; i < deserializedData.Length; i++)
            {
                if (i == 0)
                {
                    DeserializeLanguages(deserializedData[i]);
                }
                else
                {
                    DeserializeTranslations(deserializedData[i]);
                }
            }
        }
        else
        {
            LogHelper.LogWarning("Failed to initialize "
                                 + this.GetType()
                                 + "; "
                                 + nameof(dataFile)
                                 + " is not set",
                                 this
                                 );
        }
    }
Exemplo n.º 5
0
        public static InfoData GetInfoData()
        {
            if (_infoData == null)
            {
#if UNITY_EDITOR
                if (!Application.isPlaying)
                {
                    _infoData = CSVUtil.ParseClass <InfoData>("config/info");
                }
                else
                {
#endif
                string localPath = "config/csv/info";
                if (Common.ResMgr.ResUtil.ExistsInLocal(localPath + ".csv"))
                {
                    _infoData = CSVUtil.ParseClass <InfoData>(localPath);
                }
                else
                {
                    _infoData = CSVUtil.ParseClass <InfoData>("config/info");
                }
#if UNITY_EDITOR
            }
#endif
            }
            return(_infoData);
        }
Exemplo n.º 6
0
        private string GetFeature(int wordId, params int[] fields)
        {
            string[] allFeatures = GetAllFeaturesArray(wordId);
            if (allFeatures is null)
            {
                return(null);
            }
            StringBuilder sb = new StringBuilder();

            if (fields.Length == 0)
            { // All features
                foreach (string feature in allFeatures)
                {
                    sb.Append(CSVUtil.QuoteEscape(feature)).Append(",");
                }
            }
            else if (fields.Length == 1)
            { // One feature doesn't need to escape value
                sb.Append(allFeatures[fields[0]]).Append(",");
            }
            else
            {
                foreach (int field in fields)
                {
                    sb.Append(CSVUtil.QuoteEscape(allFeatures[field])).Append(",");
                }
            }
            return(sb.Remove(sb.Length - 1, 1).ToString());
        }
Exemplo n.º 7
0
        public static RandomNameData GetRandomNameData()
        {
            if (_randomNameDataList == null)
            {
#if UNITY_EDITOR
                string localPath = "config/names";
#else
                string localPath = "config/csv/names";
#endif
                if (Common.ResMgr.ResUtil.ExistsInLocal(localPath + ".csv"))
                {
                    _randomNameDataList = CSVUtil.Parse <RandomNameData>(localPath);
                }
                else
                {
                    _randomNameDataList = CSVUtil.Parse <RandomNameData>("config/names");
                }
            }
            if (_randomNameDataList.Count > 0)
            {
                return(_randomNameDataList[0]);
            }
            else
            {
                return(null);
            }
        }
Exemplo n.º 8
0
        public static List <ModelCommon> ReadArinc429File(String filepath)
        {
            List <String[]>    Arinc429datas = CSVUtil.ReadCsv(filepath);
            List <ModelCommon> arinc429s     = new List <ModelCommon>();

            foreach (String[] data in Arinc429datas)
            {
                Arinc429 arinc429 = new Arinc429();

                arinc429.DateTime_arinc429_1 = ModelUtil.ParseDateTime(data[0], data[1]);
                arinc429.StaticPSSECorrected = float.Parse(data[2]);
                //
                String[] two = Regex.Split(data[3], "-");
                arinc429.ImpactPressure        = float.Parse(two[0]);
                arinc429.Altitude_arinc429_1   = float.Parse(two[1]);
                arinc429.BaroCorrectedAltitude = float.Parse(data[4]);
                arinc429.Mach          = float.Parse(data[5]);
                arinc429.Airspeed      = float.Parse(data[6]);
                arinc429.TrueAirSpeed  = float.Parse(data[7]);
                arinc429.Totaltemp     = float.Parse(data[8]);
                arinc429.veritcalSpeed = float.Parse(data[9]);

                arinc429.magheadingdeg = float.Parse(data[10]);


                arinc429s.Add(arinc429);
            }
            return(arinc429s);
        }
Exemplo n.º 9
0
        public static List <ModelCommon> ReadTracgasFile(String filepath)
        {
            List <String[]>    datas     = CSVUtil.ReadCsv(filepath);
            List <ModelCommon> traceGass = new List <ModelCommon>();

            foreach (String[] data in datas)
            {
                Tracegas tracegas = new Tracegas();

                tracegas.DateTime_tracegas_1 = ModelUtil.ParseDateTime(data[0], data[1]);
                int      secondsMidNight = Convert.ToInt32(data[2]);
                DateTime dateTime        = ModelUtil.ProcessSecondMidNight(filepath, secondsMidNight);
                tracegas.DateTime_tracegas_2 = dateTime;

                tracegas.ARINCAltitudeft_tracegas_1 = float.Parse(data[3]);
                tracegas.ARINCStaticPmb             = float.Parse(data[3]);
                tracegas.RMTStaticC      = float.Parse(data[3]);
                tracegas.DPC             = float.Parse(data[4]);
                tracegas.O3              = float.Parse(data[5]);
                tracegas.NOX             = float.Parse(data[6]);
                tracegas.SO2             = float.Parse(data[7]);
                tracegas.H2O2            = float.Parse(data[8]);
                tracegas.O3_tracegas_1   = float.Parse(data[9]);
                tracegas.NOX_tracegas_1  = float.Parse(data[10]);
                tracegas.SO2_tracegas_1  = float.Parse(data[11]);
                tracegas.H2O2_tracegas_1 = float.Parse(data[12]);
                tracegas.CO_tracegas_1   = float.Parse(data[13]);

                traceGass.Add(tracegas);
            }
            return(traceGass);
        }
Exemplo n.º 10
0
        public static List <ModelCommon> ReadInletcontroldataFile(String filepath)
        {
            List <String[]>    datas             = CSVUtil.ReadCsv(filepath);
            List <ModelCommon> inletcontroldatas = new List <ModelCommon>();

            foreach (String[] data in datas)
            {
                Inletcontroldata inletcontroldata = new Inletcontroldata();
                inletcontroldata.DateTime_inletcontroldata_1 = ModelUtil.ParseDateTime(data[0], data[1]);
                inletcontroldata.tip_flow = float.Parse(data[2]);
                inletcontroldata.tipfltrg = float.Parse(data[3]);
                inletcontroldata.airspeed_inletcontroldata_1 = float.Parse(data[4]);
                inletcontroldata.oat_temp = float.Parse(data[5]);
                inletcontroldata.instflow = float.Parse(data[6]);
                inletcontroldata.inltpres = float.Parse(data[7]);
                inletcontroldata.blwrflow = float.Parse(data[8]);
                inletcontroldata.blwrtarg = float.Parse(data[9]);
                inletcontroldata.blwr_tmp = float.Parse(data[10]);

                inletcontroldata.blwr_pwr = float.Parse(data[11]);
                inletcontroldata.throtpos = float.Parse(data[12]);
                inletcontroldata.fconetmp = float.Parse(data[13]);
                inletcontroldata.rconetmp = float.Parse(data[14]);
                inletcontroldata.pylontmp = float.Parse(data[15]);
                inletcontroldata.sensrtmp = float.Parse(data[16]);
                inletcontroldata.fconepwr = float.Parse(data[17]);
                inletcontroldata.rconepwr = float.Parse(data[18]);
                inletcontroldata.pylonpwr = float.Parse(data[19]);
                inletcontroldata.sensrpwr = float.Parse(data[20]);

                inletcontroldatas.Add(inletcontroldata);
            }
            return(inletcontroldatas);
        }
        /// <summary>
        /// CSV 表映射到对象
        /// </summary>
        private Dictionary <int, T> ReadCSVTable <T>(string csvName)
        {
            Dictionary <int, T> csvTable = new Dictionary <int, T>();

            CSVUtil.ReadCSV(csvName, csvTable);
            return(csvTable);
        }
Exemplo n.º 12
0
 public static Dictionary <uint, SkillData> GetSkillDatas()
 {
     if (_skillDataDic == null)
     {
         _skillDataDic = CSVUtil.Parse <uint, SkillData>("config/csv/skill", "SkillId");
     }
     return(_skillDataDic);
 }
Exemplo n.º 13
0
 public static List <PrizeElementData> GetPrizeElementDatas()
 {
     if (_prizeElementDataList == null)
     {
         _prizeElementDataList = CSVUtil.Parse <PrizeElementData>("config/csv/prize_element");
     }
     return(_prizeElementDataList);
 }
Exemplo n.º 14
0
 public static Dictionary <int, ShopCardRandomData> GetShopCardRandomDataDictionary()
 {
     if (_shopCardRandomDataDictionary == null)
     {
         _shopCardRandomDataDictionary = CSVUtil.Parse <int, ShopCardRandomData>("config/csv/shop_card_random", "id");
     }
     return(_shopCardRandomDataDictionary);
 }
Exemplo n.º 15
0
 public static Dictionary <int, PrizeData> GetPrizeDatas()
 {
     if (_prizeDataDictionary == null)
     {
         _prizeDataDictionary = CSVUtil.Parse <int, PrizeData>("config/csv/prize", "id");
     }
     return(_prizeDataDictionary);
 }
Exemplo n.º 16
0
 public static Dictionary <int, TaskData> GetTaskDataDicionary()
 {
     if (_taskDataDictionary == null)
     {
         _taskDataDictionary = CSVUtil.Parse <int, TaskData>("config/csv/task", "id");
     }
     return(_taskDataDictionary);
 }
Exemplo n.º 17
0
 public static Dictionary <int, ShopItemData> GetShopItemData()
 {
     if (_shopItemDataDictionary == null)
     {
         _shopItemDataDictionary = CSVUtil.Parse <int, ShopItemData>("config/csv/shop_item", "id");
     }
     return(_shopItemDataDictionary);
 }
Exemplo n.º 18
0
 public static Dictionary <int, DungeonStarData> GetDungeonStarDataDictionary()
 {
     if (_dungeonStarDataDictionary == null)
     {
         _dungeonStarDataDictionary = CSVUtil.Parse <int, DungeonStarData>("config/csv/dungeon_star", "id");
     }
     return(_dungeonStarDataDictionary);
 }
Exemplo n.º 19
0
 public static Dictionary <uint, AvatarData> GetAvatarDatas()
 {
     if (_avatarDataDictionary == null)
     {
         _avatarDataDictionary = CSVUtil.Parse <uint, AvatarData>("config/csv/avatar", "Id");
     }
     return(_avatarDataDictionary);
 }
Exemplo n.º 20
0
 public static Dictionary <int, FormationData> GetFormationDatas()
 {
     if (_formationDataDictionary == null)
     {
         _formationDataDictionary = CSVUtil.Parse <int, FormationData>("config/csv/formation", "id");
     }
     return(_formationDataDictionary);
 }
Exemplo n.º 21
0
 public static Dictionary <int, ExpeditionData> GetExpeditionDatas()
 {
     if (_expeditionDataDictionary == null)
     {
         _expeditionDataDictionary = CSVUtil.Parse <int, ExpeditionData>("config/csv/faraway_expedition", "id");
     }
     return(_expeditionDataDictionary);
 }
Exemplo n.º 22
0
 public static Dictionary <int, SignInData> GetSignInDatas()
 {
     if (_SignInDataDictionary == null)
     {
         _SignInDataDictionary = CSVUtil.Parse <int, SignInData>("config/csv/sign", "sign_id");
     }
     return(_SignInDataDictionary);
 }
Exemplo n.º 23
0
 public static Dictionary <int, AudioData> GetAudioDatas()
 {
     if (_audioDataDic == null)
     {
         _audioDataDic = CSVUtil.Parse <int, AudioData>("config/csv/audio", "id");
     }
     return(_audioDataDic);
 }
Exemplo n.º 24
0
 public static Dictionary <uint, MechanicsData> GetMechanicsDatas()
 {
     if (_mechanicsDataDic == null)
     {
         _mechanicsDataDic = CSVUtil.Parse <uint, MechanicsData>("config/csv/mechanics", "Id");
     }
     return(_mechanicsDataDic);
 }
Exemplo n.º 25
0
 public static Dictionary <uint, PassiveData> GetPassiveDatas()
 {
     if (_passiveDataDic == null)
     {
         _passiveDataDic = CSVUtil.Parse <uint, PassiveData>("config/csv/passive", "SkillId");
     }
     return(_passiveDataDic);
 }
Exemplo n.º 26
0
 public static Dictionary <int, HeroData> GetHeroDatas()
 {
     if (_heroDataDictionary == null)
     {
         _heroDataDictionary = CSVUtil.Parse <int, HeroData>("config/csv/hero", "id");
     }
     return(_heroDataDictionary);
 }
Exemplo n.º 27
0
 private static Dictionary <int, ConsumeTipData> GetConsumeTipDataDicionary()
 {
     if (_consumeTipDataDictionary == null)
     {
         _consumeTipDataDictionary = CSVUtil.Parse <int, ConsumeTipData>("config/csv/consumer_tips", "function_id");
     }
     return(_consumeTipDataDictionary);
 }
Exemplo n.º 28
0
 public static Dictionary <int, HeroCombineNeedData> GetHeroCombineNeedDatas()
 {
     if (_heroCombineNeedDataDictionary == null)
     {
         _heroCombineNeedDataDictionary = CSVUtil.Parse <int, HeroCombineNeedData>("config/csv/compose_need", "star");
     }
     return(_heroCombineNeedDataDictionary);
 }
Exemplo n.º 29
0
 public static Dictionary <uint, TeamData> GetTeamDatas()
 {
     if (_teamDataDictionary == null)
     {
         _teamDataDictionary = CSVUtil.Parse <uint, TeamData>("config/csv/team", "team_id");
     }
     return(_teamDataDictionary);
 }
Exemplo n.º 30
0
 public static Dictionary <int, HeroAdvanceData> GetHeroAdvanceDatas()
 {
     if (_heroAdvanceDataDictionary == null)
     {
         _heroAdvanceDataDictionary = CSVUtil.Parse <int, HeroAdvanceData>("config/csv/advance", "star");
     }
     return(_heroAdvanceDataDictionary);
 }