Example #1
0
        public SpectrumModel SoundSpectrumEx([FromBody] FanModel model)
        {
            SpectrumModel outModel = new SpectrumModel();

            log.Debug("Modle Speed :  " + model.Speed);
            log.Debug("Modle Debug :  " + model.Debug);

            Fan f = createFan(model);

            f.SelectInfo = createSelectInfo();

            log.Debug("Record Path : " + f.SelectInfo.RecordDirectory);

            Spectrum stm = KrugerUtil.SoundSpectrumEx(f, model.Speed, model.Debug);

            outModel.Inlet_LPA_Overall    = stm.Inlet_LPA_Overall;
            outModel.Inlet_LpA_Spectrum   = stm.Inlet_LpA_Spectrum;
            outModel.Inlet_LWA_Overall    = stm.Inlet_LWA_Overall;
            outModel.Inlet_LwA_Spectrum   = stm.Inlet_LwA_Spectrum;
            outModel.Inlet_LwLin_Overall  = stm.Inlet_LwLin_Overall;
            outModel.Inlet_LwLin_Spectrum = stm.Inlet_LwLin_Spectrum;


            outModel.Outlet_LPA_Overall    = stm.Outlet_LPA_Overall;
            outModel.Outlet_LpA_Spectrum   = stm.Outlet_LpA_Spectrum;
            outModel.Outlet_LWA_Overall    = stm.Outlet_LWA_Overall;
            outModel.Outlet_LwA_Spectrum   = stm.Outlet_LwA_Spectrum;
            outModel.Outlet_LwLin_Overall  = stm.Outlet_LwLin_Overall;
            outModel.Outlet_LwLin_Spectrum = stm.Outlet_LwLin_Spectrum;

            return(outModel);
        }
Example #2
0
        public Boolean GenerateChart([FromBody] FanModel model)
        {
            Boolean success = true;

            log.Debug("Modle Speed :  " + model.Speed);
            log.Debug("Modle Debug :  " + model.Debug);

            Fan f = createFan(model);

            f.SelectInfo = createSelectInfo();

            String basePath      = String.IsNullOrEmpty(model.chartPath) ? @".\" : model.chartPath;
            String fileName      = String.IsNullOrEmpty(model.chartName) ? @"tmp" : model.chartName;
            int    chartOutput   = model.chartType;
            String fileExtention = ".jpg";

            switch (chartOutput)
            {
            case 0:
                fileExtention = ".gif";
                break;

            case 1:
                fileExtention = ".bmp";
                break;

            case 2:
                fileExtention = ".wmf";
                break;

            default:
                fileExtention = ".jpg";
                break;
            }


            String outputPath = String.Format(@"{0}\{1}{2}", basePath, fileName, fileExtention);

            log.Debug("file output :  " + outputPath);
            int width  = model.Width == 0 ? 350 : model.Width;
            int height = model.Height == 0 ? 350 : model.Height;

            KrugerUtil.GenerateChart(f, outputPath, width, height, Kruger.eChartOutput.coGIF);

            return(success);
        }
Example #3
0
        public List <FanModel> Select([FromBody] SelectInfoModel model)
        {
            SelectInfo si = new SelectInfo();

            String path = String.Format("{0}\\{1}", System.AppDomain.CurrentDomain.BaseDirectory, "test\\Records\\");

            si.RecordDirectory = path;
            si.Volume          = model.Volume;
            si.Pressure        = model.Pressure;
            si.VolumeUnit      = (VolumeUnit)model.VolumeUnit;
            si.PressureUnit    = (PressureUnit)model.PressureUnit;
            si.PressureType    = (PressureType)model.PressureType;
            si.CallType        = model.CallType;
            si.Debug           = model.Debug;
            si.Hz                = model.Hz;
            si.Temperature       = model.Temperature;
            si.Altitude          = model.Altitude;
            si.ProductType       = (Product)model.ProductType;
            si.MinStyle          = model.MinStyle;
            si.MinClass          = (FanClass)model.MinClass;
            si.SoundCondition    = (SoundCondition)model.SoundCondition;
            si.FanCasing         = (FanCasing)model.FanCasing;
            si.FanWidth          = model.FanWidth;
            si.VelocityUnit      = (VelocityUnit)model.VelocityUnit;
            si.OutletType        = (OutletType)model.OutletType;
            si.ServiceFactor     = model.ServiceFactor;
            si.AltitudeUnit      = (AltitudeUnit)model.AltitudeUnit;
            si.SoundDistance     = model.SoundDistance;
            si.SoundDistanceUnit = (DistanceUnit)model.SoundDistanceUnit;
            si.TemperatureUnit   = (TemperatureUnit)model.TemperatureUnit;

            log.Debug(si);
            Fans fanList = KrugerUtil.Select(si);


            List <FanModel> modelList = new List <FanModel>();

            for (int i = 1; i < fanList.Count; i++)
            {
                Fan      f      = fanList.Item(i);
                FanModel fModel = createFanModel(f);
                modelList.Add(fModel);
            }

            return(modelList);
        }
Example #4
0
        public CurveModel CurvePoints([FromBody] FanModel model)
        {
            CurveModel outModel = new CurveModel();

            log.Debug(model.Speed);

            Fan f = createFan(model);

            f.SelectInfo = createSelectInfo();

            Curve cre = KrugerUtil.CurvePoints(f, model.Speed);

            outModel.VolumePoints   = cre.VolumePoints;
            outModel.PressurePoints = cre.PressurePoints;
            outModel.PowerPoints    = cre.PowerPoints;

            return(outModel);
        }