コード例 #1
0
        /// <summary>凍結防止ソケットが必要な場合に存在していないとき警告</summary>
        public static void ValidateTouketsuBoushiSocket(List <TextObject> texts, List <Symbol> symbols)
        {
            string messageId = @"Need Touketsu Boushi. Please install same location of Boiler.";

            var validator = new Validator();

            validator.Validate = delegate()
            {
                if (Static.Drawing.Prefix != "HJA")
                {
                    return(null);
                }

                //水まわり設備=寒冷地仕様
                using (var service = new SocketPlanServiceNoTimeout())
                {
                    var siyoCode = service.GetSiyoCode(Static.ConstructionCode, Static.Drawing.PlanNo);

                    if (!service.IsKanreiArea(Static.ConstructionCode, siyoCode))
                    {
                        return(null);
                    }
                }

                var sockets = symbols.FindAll(p => p.Equipment.Name == Const.EquipmentName.防水E付_02);
                if (sockets.Count > 0)
                {
                    return(null);
                }

                return(new ErrorDialog(messageId, 0));
            };

            validator.Run(messageId);
        }
コード例 #2
0
        /// <summary>凍結防止ソケットとボイラーの数が合わない場合警告</summary>
        public static void WarnTouketsuBoushiSocket(List <TextObject> texts, List <Symbol> symbols)
        {
            string messageId = @"REMINDER: INSTALL SAME NUMBER OF TOUEKTSU BOUSHI WITH BOILER.";

            var validator = new Validator();

            validator.Validate = delegate()
            {
                if (Static.Drawing.Prefix != "HJA")
                {
                    return(null);
                }

                //水まわり設備=寒冷地仕様
                using (var service = new SocketPlanServiceNoTimeout())
                {
                    var siyoCode = service.GetSiyoCode(Static.ConstructionCode, Static.Drawing.PlanNo);

                    if (!service.IsKanreiArea(Static.ConstructionCode, siyoCode))
                    {
                        return(null);
                    }
                }

                var sockets = symbols.FindAll(p => p.Equipment.Name == Const.EquipmentName.防水E付_02);
                if (sockets.Count == 0)
                {
                    return(new ErrorDialog(messageId, 0));
                }

                var boilers = texts.FindAll(p => p.Text.Contains(Const.Text.ガスボイラー) ||
                                            p.Text.Contains(Const.Text.電気温水器) ||
                                            p.Text.Contains(Const.Text.エコキュート));

                if (sockets.Count == boilers.Count)
                {
                    return(null);
                }

                return(new ErrorDialog(messageId, 0));
            };

            validator.Run(messageId);
        }