Exemplo n.º 1
0
        /// <summary>
        /// 解析対象データを作成する
        /// </summary>
        /// <param name="dipBlocLog">骨塩ムラログ</param>
        /// <param name="bloclogConfig">ムラグ解析設定</param>
        /// <param name="_analysisData">ムラログ解析対象データ</param>
        private void CreatetAnalysisData(DipBlocLog dipBlocLog, DtBloclogAnalysisConfig bloclogConfig, out BlocLogAnalysisData _analysisData)
        {
            _analysisData = new BlocLogAnalysisData();

            try
            {
                _logger.EnterJson("{0}", new { dipBlocLog, bloclogConfig });

                var profileValue = new double[AnalysisDataMax];
                for (int i = 0; i < dipBlocLog.ProfileValue.Length; i++)
                {
                    profileValue[i] = double.Parse(dipBlocLog.ProfileValue[i]);
                }

                _analysisData = new BlocLogAnalysisData()
                {
                    ProfileValue              = profileValue,
                    ProfileValueCount         = dipBlocLog.ProfileValue.Length,
                    GpValue                   = int.Parse(dipBlocLog.GpValue),
                    TopUnevennessSkipValue    = bloclogConfig.TopUnevennessSkipValue,
                    BottomUnevennessSkipValue = bloclogConfig.BottomUnevennessSkipValue,
                    McvStandardValue          = bloclogConfig.McvStandardValue,
                    ScvStandardValue1         = bloclogConfig.ScvStandardValue1,
                    ScvStandardValue2         = bloclogConfig.ScvStandardValue2
                };
            }
            catch
            {
                throw; // ログ出力はpublicメソッドにお任せ
            }
            finally
            {
                _logger.LeaveJson("{0}", new { _analysisData });
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// DT_BLOCLOG_ANALYSIS_CONFIGテーブルからDtBloclogAnalysisConfigを取得する
        /// </summary>
        /// <param name="isNormalized">規格化フラグ</param>
        /// <param name="allowNotExist">取得件数が0件である場合を正常系とする場合はtrueを、異常系とする場合はfalseを指定する</param>
        /// <returns>取得したデータ</returns>
        public DtBloclogAnalysisConfig ReadDtBloclogAnalysisConfig(bool isNormalized, bool allowNotExist = true)
        {
            DtBloclogAnalysisConfig model = null;

            try
            {
                _logger.EnterJson("{0}", new { isNormalized });

                DBAccessor.Models.DtBloclogAnalysisConfig entity = null;
                _dbPolly.Execute(() =>
                {
                    using (DBAccessor.Models.RmsDbContext db = new DBAccessor.Models.RmsDbContext(_appSettings))
                    {
                        entity = db.DtBloclogAnalysisConfig.FirstOrDefault(x => x.IsNormalized == isNormalized);
                    }
                });

                if (entity != null)
                {
                    model = entity.ToModel();
                }
                else
                {
                    if (!allowNotExist)
                    {
                        throw new RmsException("DT_BLOCLOG_ANALYSIS_CONFIGテーブルに該当レコードが存在しません。");
                    }
                }

                return(model);
            }
            catch (RmsException)
            {
                throw;
            }
            catch (Exception e)
            {
                throw new RmsException("DT_BLOCLOG_ANALYSIS_CONFIGテーブルのSelectに失敗しました。", e);
            }
            finally
            {
                _logger.LeaveJson("{0}", model);
            }
        }
Exemplo n.º 3
0
        /// <summary>
        /// 解析対象データを作成する
        /// </summary>
        /// <param name="dipAlmiSlopeLog">骨塩アルミスロープログ</param>
        /// <param name="almilogConfig">アルミスロープログ解析設定</param>
        /// <param name="bloclogConfig">ムラグ解析設定</param>
        /// <param name="_analysisData">アルミスロープログ解析対象データ</param>
        private void CreatetAnalysisData(DipAlmiSlopeLog dipAlmiSlopeLog, DtAlmilogAnalysisConfig almilogConfig, DtBloclogAnalysisConfig bloclogConfig, out AlmiLogAnalysisData _analysisData)
        {
            _analysisData = new AlmiLogAnalysisData();

            try
            {
                _logger.EnterJson("{0}", new { dipAlmiSlopeLog, almilogConfig, bloclogConfig });

                var areaStandardDataConfgValue = almilogConfig.AreaStandardData.Split(',').Select(x => int.Parse(x)).ToArray();

                // バリデーション
                if (areaStandardDataConfgValue.Length != AlmiAreaDataNum)
                {
                    // 個数が異なる場合は解析が実施できないためエラー
                    throw new RmsException("アルミスロープログ解析設定の面積算出用データの要素数が不正です");
                }

                var luminanceValue = new int[AnalysisDataMax];
                for (int i = 0; i < dipAlmiSlopeLog.LuminanceValue.Length; i++)
                {
                    luminanceValue[i] = int.Parse(dipAlmiSlopeLog.LuminanceValue[i]);
                }

                // AreaStandardDataのデータ数はAlmiAreaDataNum固定だがCモジュールへデータを渡す都合上サイズはAnalysisDataMax必要
                var areaStandardData = new int[AnalysisDataMax];
                for (int i = 0; i < areaStandardDataConfgValue.Length; i++)
                {
                    areaStandardData[i] = areaStandardDataConfgValue[i];
                }

                _analysisData = new AlmiLogAnalysisData()
                {
                    LuminanceValue       = luminanceValue,
                    LuminanceValueCount  = dipAlmiSlopeLog.LuminanceValue.Length,
                    MinSlopeValue        = almilogConfig.MinSlopeValue,
                    MiddleSlopeValue     = almilogConfig.MiddleSlopeValue,
                    MaxSlopeValue        = almilogConfig.MaxSlopeValue,
                    LowVoltageAreaValue  = almilogConfig.LowVoltageAreaValue,
                    HighVoltageAreaValue = almilogConfig.HighVoltageAreaValue,
                    AreaStandardData     = areaStandardData,
                    AlmiAreaDataNum      = AlmiAreaDataNum,
                    AlsStandardValue     = bloclogConfig.AlsStandardValue
                };
            }
            catch
            {
                throw; // ログ出力はpublicメソッドにお任せ
            }
            finally
            {
                _logger.LeaveJson("{0}", new { _analysisData });
            }
        }