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