| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102 | 
							- BemsWebApplication.PowerSavingCycle = function (params, viewInfo) {
 
-     "use strict";
 
-     //전역 변수 선언
 
-     var endpointSelector = "";
 
-     var currentTabIndex = ko.observable(0);
 
-     if (BemsWebApplication.config.mode == "production") {
 
-         endpointSelector = new DevExpress.EndpointSelector(BemsWebApplication.config.endpoints).config.db.production;
 
-     } else {
 
-         endpointSelector = new DevExpress.EndpointSelector(BemsWebApplication.config.endpoints).config.db.local;
 
-     }
 
-     var initialized = false, inoutdoorinitialized = false, Etcinitialized = false;
 
-     var SiteId = BWA.UserInfo.SiteId();
 
-     var today = new Date();
 
-     var searchday = new Date();
 
-     var eq = BWA.DataUtil.constructEqualFilter;
 
-     var AIR_HANDLING = $Code.FacilityType.AIR_HANDLING;
 
-     var timeIntervalType = $Code.TimeIntervalType.QUARTERMIN;
 
-     var OUTDOOR = $Code.FacilityType.OUTDOOR;
 
-     var temp_facility_DataSource = [{
 
-         Name: "",
 
-         Nickname: "",
 
-         FacilityUsage: "",
 
-         FacilityCode: 0
 
-     }];
 
-     var facilityname = "", facilitynickname = "", facilityusage = "", facilitycode = 0;
 
-     var ENTHALPY_CHECK = $Code.Formula[AIR_HANDLING].ENTHALPY_CHECK;
 
-     var CO2 = $Code.Formula[AIR_HANDLING].CO2;
 
-     var CO = $Code.Formula[AIR_HANDLING].CO;
 
-     var DUST = $Code.Formula[AIR_HANDLING].DUST;
 
-     var OZONE = $Code.Formula[AIR_HANDLING].OZONE;
 
-     var S_VOLUME = $Code.Formula[AIR_HANDLING].S_VOLUME;
 
-     var F_TEMP = $Code.Formula[AIR_HANDLING].F_TEMP; //환기
 
-     var F_HUMY = $Code.Formula[AIR_HANDLING].F_HUMY;
 
-     var formulaGet = new BWA.Chart.FormulaGet(SiteId);
 
-     var DUTYCYCLE_ONOFF = $Code.Formula[AIR_HANDLING].DUTYCYCLE_ONOFF;
 
-     var ONOFF = $Code.Formula[AIR_HANDLING].ONOFF; //onoff
 
-     var OUT_TEMPERATURE = $Code.Formula[OUTDOOR].TEMPERATURE;
 
-     var OUT_HUMIDITY = $Code.Formula[OUTDOOR].HUMIDITY;
 
-     var chartTempOnOFF = BWA.Chart.Instance('chartTempOnOFF', 'dxChart');
 
-     var chartFanLoad = BWA.Chart.Instance('chartFanLoad', 'dxChart');
 
-     var chartInOut = BWA.Chart.Instance('chartInOutdoor', 'dxChart');
 
-     var chartEtc = BWA.Chart.Instance('chartEtc', 'dxChart');
 
-     var chartLayout = new BWA.ChartLayout({
 
-         divs: [
 
-             {
 
-                 id: 'TempOnOFF',
 
-                 chartId: 'chartTempOnOFF'
 
-             },
 
-             {
 
-                 id: 'InOutDoor',
 
-                 chartId: 'chartInOutdoor'
 
-             },
 
-             ,
 
-             {
 
-                 id: 'FanLoad',
 
-                 chartId: 'chartFanLoad'
 
-             }
 
-         ],
 
-         multiViewOptions: {
 
-             viewIndex: currentTabIndex,
 
-             viewCount: 1
 
-         }
 
-     });
 
-     var IndoordataArray = [], IndoortemponoffdataArray = [], IndoorhumydataArray = [], IndooronoffdataArray = [], IndoorstempdataArray = [], IndoortempdataArray = [], finalIndoortemponoffdataArray = [], Indoortemp = false, Indoorhumy = false;
 
-     var CodataArray = [], Co2dataArray = [], DustdataArray = [], OzonedataArray = [], EtcdataArray = [];
 
-     var Codata = false, Co2data = false, Dustdata = false, Ozonedata = false;
 
-     var outdoordataArray = [], outdoorhumydataArray = [], outdoortempdataArray = [], outdoortemp = false, outdoorhumy = false;
 
-     var outdoorenthalpy = false, Indoorenthalpy = false;
 
-     var QUARTERMIN = $Code.TimeType.QUARTERMIN;
 
-     var visiblePopup = ko.observable(false);
 
-     var InOutdoorDataGridPopup_Visible = ko.observable(false), EtcDataGridPopup_Visible = ko.observable(false);
 
-     function facilitydataSourceAdd(cnt) { // 설비 개수만큼 추가 
 
-         for (var i = 0; i < cnt ; i++) {
 
-             temp_facility_DataSource.push({
 
-                 Name: "",
 
-                 Nickname: "",
 
-                 FacilityUsage: "",
 
-                 FacilityCode: 0
 
-             });
 
-         }
 
-     }
 
-     function GetDataSource(FacilityCode, FormulaId) { // 설비 개수만큼 추가 
 
-         var BemsTempFormulaDataSource = new DevExpress.data.DataSource({ // 실내온도 가져오기
 
-             store: {
 
-                 type: "odata",
 
-                 url: endpointSelector + "/BemsFormulaParameter"
 
-             },
 
-             requireTotalCount: true,
 
-             pageSize: 5
 
-         });
 
-         BemsTempFormulaDataSource.filter([
 
-             eq('SiteId', SiteId),
 
-             'and',
 
-             eq('FacilityCode', FacilityCode),
 
-             'and',
 
-             eq('FormulaId', FormulaId)
 
-         ]);
 
-         BemsTempFormulaDataSource.load()
 
-         .done(function (BemsFormula) {
 
-             if (BemsFormula.length != 0) {
 
-                 if (BemsFormula.length == 1) {
 
-                     var ParameterFacilityCode = BemsFormula[0].ParameterFacilityCode;
 
-                     var parameterpropertyId = BemsFormula[0].ParameterPropertyId;
 
-                     var BemsTempDataSource = new DevExpress.data.DataSource({
 
-                         store: {
 
-                             type: "odata",
 
-                             url: endpointSelector + "/BemsMonitoringPointHistory15min"
 
-                         },
 
-                         requireTotalCount: true,
 
-                         pageSize: 1440
 
-                     });
 
-                     BemsTempDataSource.filter([
 
-                         ['CreatedDateTime', ">=", new Date(searchday.getFullYear(), searchday.getMonth(), searchday.getDate(), 0, 0, 0)],
 
-                         'and',
 
-                         ['CreatedDateTime', "<", new Date(searchday.getFullYear(), searchday.getMonth(), searchday.getDate() + 1, 0, 0, 0)],
 
-                         'and',
 
-                         ['SiteId', "=", SiteId],
 
-                          'and',
 
-                         ['FacilityCode', "=", ParameterFacilityCode],
 
-                         'and',
 
-                         ['PropertyId', "=", parameterpropertyId]
 
-                     ]);
 
-                     BemsTempDataSource.sort({ getter: "CreatedDateTime", desc: true });
 
-                     BemsTempDataSource.load()
 
-                     .done(function (BemsTemp) {
 
-                         if (BemsTemp.length != 0) {
 
-                             var Temp = BemsTemp[0].CurrentValue;
 
-                             if (FormulaId == CO2) {
 
-                                 Co2dataArray = [];
 
-                                 var state;
 
-                                 if (Temp <= 1000) {
 
-                                     state = "(적정)";
 
-                                 }
 
-                                 else {
 
-                                     state = "(부적정)";
 
-                                 }
 
-                                 $("#co2").dxTextBox("instance").option('value', Temp.toFixed(2) + "ppm" + state);
 
-                                 for (var i = 0; i < BemsTemp.length; i++) {
 
-                                     Co2dataArray.push({
 
-                                         DateTime: BemsTemp[i].CreatedDateTime,
 
-                                         Co2: BemsTemp[i].CurrentValue
 
-                                     });
 
-                                 }
 
-                                 Co2data = true;
 
-                             }
 
-                             else if (FormulaId == CO) {
 
-                                 CodataArray = [];
 
-                                 var state;
 
-                                 if (Temp <= 2) {
 
-                                     state = "(좋음)";
 
-                                 }
 
-                                 else if ((2 < Temp) && (Temp <= 9)) {
 
-                                     state = "(보통)";
 
-                                 }
 
-                                 else if ((9 < Temp) && (Temp <= 15)) {
 
-                                     state = "(나쁨)";
 
-                                 }
 
-                                 else {
 
-                                     state = "(매우나쁨)";
 
-                                 }
 
-                                 $("#co").dxTextBox("instance").option('value', Temp.toFixed(2) + "ppm" + state);
 
-                                 for (var i = 0; i < BemsTemp.length; i++) {
 
-                                     CodataArray.push({
 
-                                         DateTime: BemsTemp[i].CreatedDateTime,
 
-                                         Co: BemsTemp[i].CurrentValue
 
-                                     });
 
-                                 }
 
-                                 Codata = true;
 
-                             }
 
-                             else if (FormulaId == DUST) {
 
-                                 DustdataArray = [];
 
-                                 var state;
 
-                                 if (Temp <= 30) {
 
-                                     state = "(좋음)";
 
-                                 }
 
-                                 else if ((30 < Temp) && (Temp <= 80)) {
 
-                                     state = "(보통)";
 
-                                 }
 
-                                 else if ((80 < Temp) && (Temp <= 150)) {
 
-                                     state = "(나쁨)";
 
-                                 }
 
-                                 else {
 
-                                     state = "(매우나쁨)";
 
-                                 }
 
-                                 $("#dust").dxTextBox("instance").option('value', Temp.toFixed(2) + "㎍/㎥" + state);
 
-                                 for (var i = 0; i < BemsTemp.length; i++) {
 
-                                     DustdataArray.push({
 
-                                         DateTime: BemsTemp[i].CreatedDateTime,
 
-                                         Dust: BemsTemp[i].CurrentValue
 
-                                     });
 
-                                 }
 
-                                 Dustdata = true;
 
-                             }
 
-                             else if (FormulaId == OZONE) {
 
-                                 OzonedataArray = [];
 
-                                 var state;
 
-                                 if (Temp <= 0.03) {
 
-                                     state = "(좋음)";
 
-                                 }
 
-                                 else if ((0.03 < Temp) && (Temp <= 0.09)) {
 
-                                     state = "(보통)";
 
-                                 }
 
-                                 else if ((0.09 < Temp) && (Temp <= 0.150)) {
 
-                                     state = "(나쁨)";
 
-                                 }
 
-                                 else {
 
-                                     state = "(매우나쁨)";
 
-                                 }
 
-                                 $("#ozone").dxTextBox("instance").option('value', Temp.toFixed(2) + "ppm" + state);
 
-                                 for (var i = 0; i < BemsTemp.length; i++) {
 
-                                     OzonedataArray.push({
 
-                                         DateTime: BemsTemp[i].CreatedDateTime,
 
-                                         Ozone: BemsTemp[i].CurrentValue
 
-                                     });
 
-                                 }
 
-                                 Ozonedata = true;
 
-                             }
 
-                         }
 
-                         else {
 
-                             utils.toast.show("[BemsMonitoringPointHistory15min] 정보가 없습니다.");
 
-                         }
 
-                     });
 
-                 }
 
-             }
 
-             else {
 
-                 utils.toast.show("[BemsFormulaParameter] 실내외 정보가 없습니다.");
 
-             }
 
-         });
 
-     }
 
-     function GetEnthalpyDataSource(FacilityCode, FormulaId, FormulaId2) { // 온도, 습도
 
-         var BemsTempFormulaDataSource = new DevExpress.data.DataSource({ // 실내온도 가져오기
 
-             store: {
 
-                 type: "odata",
 
-                 url: endpointSelector + "/BemsFormulaParameter"
 
-             },
 
-             requireTotalCount: true,
 
-             pageSize: 5
 
-         });
 
-         BemsTempFormulaDataSource.filter([
 
-             eq('SiteId', SiteId),
 
-             'and',
 
-             eq('FacilityCode', FacilityCode),
 
-             'and',
 
-             eq('FormulaId', FormulaId)
 
-         ]);
 
-         BemsTempFormulaDataSource.load()
 
-         .done(function (BemsFormula) {
 
-             if (BemsFormula.length != 0) {
 
-                 if (BemsFormula.length == 1) {
 
-                     var ParameterFacilityCode = BemsFormula[0].ParameterFacilityCode;
 
-                     var parameterpropertyId = BemsFormula[0].ParameterPropertyId;
 
-                     var BemsTempDataSource = new DevExpress.data.DataSource({
 
-                         store: {
 
-                             type: "odata",
 
-                             url: endpointSelector + "/BemsMonitoringPointHistory15min"
 
-                         },
 
-                         requireTotalCount: true,
 
-                         pageSize: 1440
 
-                     });
 
-                     BemsTempDataSource.filter([
 
-                         ['CreatedDateTime', ">=", new Date(searchday.getFullYear(), searchday.getMonth(), searchday.getDate(), 0, 0, 0)],
 
-                         'and',
 
-                         ['CreatedDateTime', "<", new Date(searchday.getFullYear(), searchday.getMonth(), searchday.getDate() + 1, 0, 0, 0)],
 
-                         'and',
 
-                         ['SiteId', "=", SiteId],
 
-                          'and',
 
-                         ['FacilityCode', "=", ParameterFacilityCode],
 
-                         'and',
 
-                         ['PropertyId', "=", parameterpropertyId]
 
-                     ]);
 
-                     BemsTempDataSource.sort({ getter: "CreatedDateTime", desc: true });
 
-                     BemsTempDataSource.load()
 
-                     .done(function (BemsTemp) {
 
-                         if (BemsTemp.length != 0) {
 
-                             var Temp = BemsTemp[0].CurrentValue;
 
-                             if (FormulaId == F_TEMP) { // 환기 온도
 
-                                 IndoortempdataArray = [], IndoorhumydataArray = [], IndoortemponoffdataArray = [], IndoordataArray = [], IndoorstempdataArray = [], IndooronoffdataArray = [], finalIndoortemponoffdataArray = [];
 
-                                 $("#indoor_temp").dxTextBox("instance").option('value', Temp.toFixed(2) + "℃");
 
-                                 for (var i = 0; i < BemsTemp.length; i++) {
 
-                                     IndoortempdataArray.push({
 
-                                         DateTime: BemsTemp[i].CreatedDateTime,
 
-                                         IndoorTemp: BemsTemp[i].CurrentValue
 
-                                     });
 
-                                 }
 
-                                 var BemsTempFormulaDataSource = new DevExpress.data.DataSource({ // 실내온도 가져오기
 
-                                     store: {
 
-                                         type: "odata",
 
-                                         url: endpointSelector + "/BemsFormulaParameter"
 
-                                     },
 
-                                     requireTotalCount: true,
 
-                                     pageSize: 5
 
-                                 });
 
-                                 BemsTempFormulaDataSource.filter([
 
-                                     eq('SiteId', SiteId),
 
-                                     'and',
 
-                                     eq('FacilityCode', FacilityCode),
 
-                                     'and',
 
-                                     eq('FormulaId', FormulaId2)
 
-                                 ]);
 
-                                 BemsTempFormulaDataSource.load()
 
-                                 .done(function (BemsFormula) {
 
-                                     if (BemsFormula.length != 0) {
 
-                                         if (BemsFormula.length == 1) {
 
-                                             var ParameterFacilityCode = BemsFormula[0].ParameterFacilityCode;
 
-                                             var parameterpropertyId = BemsFormula[0].ParameterPropertyId;
 
-                                             var BemsTempDataSource = new DevExpress.data.DataSource({
 
-                                                 store: {
 
-                                                     type: "odata",
 
-                                                     url: endpointSelector + "/BemsMonitoringPointHistory15min"
 
-                                                 },
 
-                                                 requireTotalCount: true,
 
-                                                 pageSize: 1440
 
-                                             });
 
-                                             BemsTempDataSource.filter([
 
-                                                 ['CreatedDateTime', ">=", new Date(searchday.getFullYear(), searchday.getMonth(), searchday.getDate(), 0, 0, 0)],
 
-                                                 'and',
 
-                                                 ['CreatedDateTime', "<", new Date(searchday.getFullYear(), searchday.getMonth(), searchday.getDate() + 1, 0, 0, 0)],
 
-                                                 'and',
 
-                                                 ['SiteId', "=", SiteId],
 
-                                                  'and',
 
-                                                 ['FacilityCode', "=", ParameterFacilityCode],
 
-                                                 'and',
 
-                                                 ['PropertyId', "=", parameterpropertyId]
 
-                                             ]);
 
-                                             BemsTempDataSource.sort({ getter: "CreatedDateTime", desc: true });
 
-                                             BemsTempDataSource.load()
 
-                                             .done(function (BemsTemp) {
 
-                                                 if (BemsTemp.length != 0) {
 
-                                                     if (FormulaId2 == F_HUMY) {
 
-                                                         var Temp = BemsTemp[0].CurrentValue;
 
-                                                         $("#indoor_humy").dxTextBox("instance").option('value', Temp.toFixed(2) + "%"); //환기 습도
 
-                                                         for (var i = 0; i < BemsTemp.length; i++) {
 
-                                                             IndoorhumydataArray.push({
 
-                                                                 DateTime: BemsTemp[i].CreatedDateTime,
 
-                                                                 IndoorHumy: BemsTemp[i].CurrentValue
 
-                                                             });
 
-                                                         }
 
-                                                         var array_length_size = Math.max(IndoortempdataArray.length, IndoorhumydataArray.length);
 
-                                                         if (IndoortempdataArray.length == IndoorhumydataArray.length) {
 
-                                                             for (var i = 0; i < array_length_size; i++) {
 
-                                                                 IndoordataArray.push(
 
-                                                                     {
 
-                                                                         DateTime: IndoortempdataArray[i].DateTime,
 
-                                                                         IndoorTemp: IndoortempdataArray[i].IndoorTemp,
 
-                                                                         IndoorHumy: IndoorhumydataArray[i].IndoorHumy
 
-                                                                     });
 
-                                                             }
 
-                                                         }
 
-                                                     }
 
-                                                     else if (FormulaId2 == ONOFF) {
 
-                                                         for (var i = 0; i < BemsTemp.length; i++) {
 
-                                                             var temp;
 
-                                                             if (BemsTemp[i].CurrentValue == true) {
 
-                                                                 temp = 1;
 
-                                                             }
 
-                                                             else {
 
-                                                                 temp = 0;
 
-                                                             }
 
-                                                             IndooronoffdataArray.push({
 
-                                                                 DateTime: BemsTemp[i].CreatedDateTime,
 
-                                                                 Indooronoff: temp
 
-                                                             });
 
-                                                         }
 
-                                                         var array_length_size = Math.max(IndoortempdataArray.length, IndooronoffdataArray.length);
 
-                                                         if (IndoortempdataArray.length == IndooronoffdataArray.length) {
 
-                                                             for (var i = 0; i < array_length_size; i++) {
 
-                                                                 IndoortemponoffdataArray.push(
 
-                                                                     {
 
-                                                                         DateTime: IndoortempdataArray[i].DateTime,
 
-                                                                         IndoorTemp: IndoortempdataArray[i].IndoorTemp,
 
-                                                                         Indooronoff: IndooronoffdataArray[i].Indooronoff
 
-                                                                     });
 
-                                                             }
 
-                                                             var BemsSTempDataSource = new DevExpress.data.DataSource({
 
-                                                                 store: {
 
-                                                                     type: "odata",
 
-                                                                     url: endpointSelector + "/BemsControlAHUTempConfig"
 
-                                                                 },
 
-                                                                 requireTotalCount: true,
 
-                                                                 pageSize: 1
 
-                                                             });
 
-                                                             BemsSTempDataSource.filter([
 
-                                                                 ['SiteId', "=", SiteId],
 
-                                                                  'and',
 
-                                                                 ['FacilityCode', "=", ParameterFacilityCode]
 
-                                                             ]);
 
-                                                             BemsSTempDataSource.load()
 
-                                                             .done(function (STemp) {
 
-                                                                 var Maxtemp, Mintemp;
 
-                                                                 if (STemp.length == 0) {
 
-                                                                     //utils.toast.show("공조기 기준온도가 없습니다.");
 
-                                                                     finalIndoortemponoffdataArray = IndoortemponoffdataArray;
 
-                                                                 }
 
-                                                                 else {
 
-                                                                     Maxtemp = STemp[0].MaxTemperature;
 
-                                                                     Mintemp = STemp[0].MinTemperature;
 
-                                                                     for (var i = 0; i < IndoortemponoffdataArray.length; i++) {
 
-                                                                         finalIndoortemponoffdataArray.push(
 
-                                                                             {
 
-                                                                                 DateTime: IndoortempdataArray[i].DateTime,
 
-                                                                                 IndoorTemp: IndoortempdataArray[i].IndoorTemp,
 
-                                                                                 Indooronoff: IndooronoffdataArray[i].Indooronoff,
 
-                                                                                 Maxtemp: Maxtemp,
 
-                                                                                 Mintemp: Mintemp
 
-                                                                             });
 
-                                                                     }
 
-                                                                 }
 
-                                                                 var options = BWA.ChartOptions.PowerSavingCycle.getChartTempOnOFFOptions(QUARTERMIN);
 
-                                                                 options.dataSource = finalIndoortemponoffdataArray;
 
-                                                                 chartTempOnOFF().option(options);
 
-                                                             });
 
-                                                         }
 
-                                                     }
 
-                                                 }
 
-                                             });
 
-                                         }
 
-                                     }
 
-                                 });
 
-                             }
 
-                         }
 
-                         else {
 
-                             utils.toast.show("[BemsMonitoringPointHistory15min] 정보가 없습니다.");
 
-                         }
 
-                     });
 
-                 }
 
-             }
 
-             else {
 
-                 utils.toast.show("[BemsFormulaParameter] 실내외 정보가 없습니다.");
 
-             }
 
-         });
 
-     }
 
-     function GetLoadDataSource() { //팬부하 가져오기 함수
 
-         var facilitycode = $("#Airconfitioner_select").dxSelectBox("instance").option('value').FacilityCode();
 
-         var formula = $Code.Formula[$Code.FacilityType.AIR_HANDLING];
 
-         var formulaIds = _.values(formula);
 
-         var promises = [];
 
-         _.each(formulaIds, function (formulaId) {
 
-             var p = formulaGet.apiGet({
 
-                 SiteId: SiteId,
 
-                 FacilityTypeId: AIR_HANDLING,
 
-                 FacilityCode: facilitycode,
 
-                 FormulaId: formulaId,
 
-                 TimeIntervalType: timeIntervalType,
 
-                 StartDate: new Date(searchday.getFullYear(), searchday.getMonth(), searchday.getDate(), 0, 0, 0),
 
-                 EndDate: new Date(searchday.getFullYear(), searchday.getMonth(), searchday.getDate() + 1, 0, 0, 0)
 
-             });
 
-             promises.push(p);
 
-         });
 
-         $.when.apply(this, promises)
 
-         .done(function (A23, A24, DUTYCYCLE_CHECK) {
 
-             A23 = A23[0];//급기팬 소비전력
 
-             A24 = A24[0];//환기팬 소비전력
 
-             DUTYCYCLE_CHECK = DUTYCYCLE_CHECK[0];//절전사이클 확인
 
-             var dataArray_Temp = [];
 
-             var dataArray_Temp1 = [];
 
-             var dataArray_Temp2 = [];
 
-             var dataArray_Temp3 = [];
 
-             var dataArray_Temp4 = [];
 
-             var dataArray_Temp5 = [];
 
-             _.each(A23, function (x) {
 
-                 dataArray_Temp.push({
 
-                     DateTime: BWA.Chart.getCustermTimeArgumentAxisString(QUARTERMIN, moment(x.DateTime).toDate()),
 
-                     A23: x.Value
 
-                 });
 
-             });
 
-             _.each(A24, function (x) {
 
-                 dataArray_Temp1.push({
 
-                     DateTime: BWA.Chart.getCustermTimeArgumentAxisString(QUARTERMIN, moment(x.DateTime).toDate()),
 
-                     A24: x.Value
 
-                 });
 
-             });
 
-             _.each(DUTYCYCLE_CHECK, function (x) {
 
-                 var temp;
 
-                 if (x.Value > 0) {
 
-                     temp = 1;
 
-                 }
 
-                 else {
 
-                     temp = 0
 
-                 }
 
-                 dataArray_Temp2.push({
 
-                     DateTime: BWA.Chart.getCustermTimeArgumentAxisString(QUARTERMIN, moment(x.DateTime).toDate()),
 
-                     DUTYCYCLE_CHECK: temp
 
-                 });
 
-             });
 
-             var array_length_size = Math.max(dataArray_Temp.length, dataArray_Temp1.length, dataArray_Temp2.length);
 
-             if (dataArray_Temp.length == dataArray_Temp1.length && dataArray_Temp1.length == dataArray_Temp2.length) {
 
-                 var tempFANLoad = 0, tempSave = 0, count = 0, tempfanload = 0, save = 0;
 
-                 for (var i = 0; i < array_length_size; i++) {
 
-                     dataArray_Temp3.push(
 
-                         {
 
-                             DateTime: dataArray_Temp[i].DateTime,
 
-                             FANLoad: dataArray_Temp[i].A23 + dataArray_Temp1[i].A24,
 
-                             DUTYCYCLE_CHECK: dataArray_Temp2[i].DUTYCYCLE_CHECK
 
-                         });
 
-                 }
 
-                 for (var i = 0; i < array_length_size; i++) {
 
-                     if (dataArray_Temp3[i].DUTYCYCLE_CHECK == 1) {
 
-                         if (count == 0) {
 
-                             tempFANLoad = 0;
 
-                             tempSave = dataArray_Temp4[i - 1].FANLoad;
 
-                         }
 
-                         else {
 
-                             tempFANLoad = 0;
 
-                             tempSave = dataArray_Temp4[i - 1].Save;
 
-                         }
 
-                         count++
 
-                     }
 
-                     else {
 
-                         tempFANLoad = dataArray_Temp3[i].FANLoad;
 
-                         tempSave = 0;
 
-                         count = 0;
 
-                     }
 
-                     dataArray_Temp4.push(
 
-                      {
 
-                          DateTime: dataArray_Temp3[i].DateTime,
 
-                          FANLoad: tempFANLoad,
 
-                          Save: tempSave
 
-                      });
 
-                     tempfanload += dataArray_Temp4[i].FANLoad;
 
-                     save += dataArray_Temp4[i].Save
 
-                 }
 
-                 $("#predfanload").dxTextBox("instance").option('value', parseFloat((tempfanload + save).toFixed(2)) + "Kwh");
 
-                 $("#nowfanload").dxTextBox("instance").option('value', parseFloat(tempfanload.toFixed(2)) + "Kwh");
 
-                 $("#totlareduction").dxTextBox("instance").option('value', parseFloat(save.toFixed(2)) + "Kwh");
 
-             }
 
-             var dataArrayresult = dataArray_Temp4;
 
-             var options = BWA.ChartOptions.PowerSavingCycle.getChartFanLoadOptions(QUARTERMIN);
 
-             options.dataSource = dataArrayresult;
 
-             chartFanLoad().option(options);
 
-         })
 
-         .fail(function (error) {
 
-         });
 
-     }
 
-     function GetOutDataSource() { // 온도, 습도
 
-         var BemsTempFormulaDataSource = new DevExpress.data.DataSource({ // 실내온도 가져오기
 
-             store: {
 
-                 type: "odata",
 
-                 url: endpointSelector + "/BemsFormulaParameter"
 
-             },
 
-             requireTotalCount: true,
 
-             pageSize: 5
 
-         });
 
-         BemsTempFormulaDataSource.filter([
 
-             eq('SiteId', SiteId),
 
-             'and',
 
-             eq('FacilityTypeId', OUTDOOR),
 
-             'and',
 
-             eq('FormulaId', OUT_TEMPERATURE)
 
-         ]);
 
-         BemsTempFormulaDataSource.load()
 
-         .done(function (BemsFormula) {
 
-             if (BemsFormula.length != 0) {
 
-                 if (BemsFormula.length == 1) {
 
-                     var parameterpropertyId = BemsFormula[0].ParameterPropertyId;
 
-                     var FacilityCode = BemsFormula[0].ParameterFacilityCode;
 
-                     var BemsTempDataSource = new DevExpress.data.DataSource({
 
-                         store: {
 
-                             type: "odata",
 
-                             url: endpointSelector + "/BemsMonitoringPointHistory15min"
 
-                         },
 
-                         requireTotalCount: true,
 
-                         pageSize: 1440
 
-                     });
 
-                     BemsTempDataSource.filter([
 
-                         ['CreatedDateTime', ">=", new Date(searchday.getFullYear(), searchday.getMonth(), searchday.getDate(), 0, 0, 0)],
 
-                         'and',
 
-                         ['CreatedDateTime', "<", new Date(searchday.getFullYear(), searchday.getMonth(), searchday.getDate() + 1, 0, 0, 0)],
 
-                         'and',
 
-                         ['SiteId', "=", SiteId],
 
-                         'and',
 
-                         ['FacilityCode', "=", FacilityCode],
 
-                         'and',
 
-                         ['PropertyId', "=", parameterpropertyId]
 
-                     ]);
 
-                     BemsTempDataSource.sort({ getter: "CreatedDateTime", desc: true });
 
-                     BemsTempDataSource.load()
 
-                     .done(function (BemsTemp) {
 
-                         if (BemsTemp.length != 0) {
 
-                             var Temp = BemsTemp[0].CurrentValue;
 
-                             outdoortempdataArray = [], outdoorhumydataArray = [], outdoordataArray = [];;
 
-                             outdoortemp = true;
 
-                             $("#outdoor_temp").dxTextBox("instance").option('value', Temp.toFixed(2) + "℃");
 
-                             for (var i = 0; i < BemsTemp.length; i++) {
 
-                                 outdoortempdataArray.push({
 
-                                     DateTime: BemsTemp[i].CreatedDateTime,
 
-                                     outdoorTemp: BemsTemp[i].CurrentValue
 
-                                 });
 
-                             }
 
-                             var BemsTempFormulaDataSource = new DevExpress.data.DataSource({ // 실내온도 가져오기
 
-                                 store: {
 
-                                     type: "odata",
 
-                                     url: endpointSelector + "/BemsFormulaParameter"
 
-                                 },
 
-                                 requireTotalCount: true,
 
-                                 pageSize: 5
 
-                             });
 
-                             BemsTempFormulaDataSource.filter([
 
-                                 eq('SiteId', SiteId),
 
-                                 'and',
 
-                                 eq('FacilityTypeId', OUTDOOR),
 
-                                 'and',
 
-                                 eq('FormulaId', OUT_HUMIDITY)
 
-                             ]);
 
-                             BemsTempFormulaDataSource.load()
 
-                             .done(function (BemsFormula) {
 
-                                 if (BemsFormula.length != 0) {
 
-                                     if (BemsFormula.length == 1) {
 
-                                         var parameterpropertyId = BemsFormula[0].ParameterPropertyId;
 
-                                         var FacilityCode = BemsFormula[0].ParameterFacilityCode;
 
-                                         var BemsTempDataSource = new DevExpress.data.DataSource({
 
-                                             store: {
 
-                                                 type: "odata",
 
-                                                 url: endpointSelector + "/BemsMonitoringPointHistory15min"
 
-                                             },
 
-                                             requireTotalCount: true,
 
-                                             pageSize: 1440
 
-                                         });
 
-                                         BemsTempDataSource.filter([
 
-                                             ['CreatedDateTime', ">=", new Date(searchday.getFullYear(), searchday.getMonth(), searchday.getDate(), 0, 0, 0)],
 
-                                             'and',
 
-                                             ['CreatedDateTime', "<", new Date(searchday.getFullYear(), searchday.getMonth(), searchday.getDate() + 1, 0, 0, 0)],
 
-                                             'and',
 
-                                             ['SiteId', "=", SiteId],
 
-                                             'and',
 
-                                             ['FacilityCode', "=", FacilityCode],
 
-                                             'and',
 
-                                             ['PropertyId', "=", parameterpropertyId]
 
-                                         ]);
 
-                                         BemsTempDataSource.sort({ getter: "CreatedDateTime", desc: true });
 
-                                         BemsTempDataSource.load()
 
-                                         .done(function (BemsTemp) {
 
-                                             if (BemsTemp.length != 0) {
 
-                                                 var Temp = BemsTemp[0].CurrentValue;
 
-                                                 $("#outdoor_humy").dxTextBox("instance").option('value', Temp.toFixed(2) + "%");
 
-                                                 for (var i = 0; i < BemsTemp.length; i++) {
 
-                                                     outdoorhumydataArray.push({
 
-                                                         DateTime: BemsTemp[i].CreatedDateTime,
 
-                                                         outdoorHumy: BemsTemp[i].CurrentValue
 
-                                                     });
 
-                                                 }
 
-                                                 var array_length_size = Math.max(outdoortempdataArray.length, outdoorhumydataArray.length);
 
-                                                 if (outdoortempdataArray.length == outdoorhumydataArray.length) {
 
-                                                     for (var i = 0; i < array_length_size; i++) {
 
-                                                         outdoordataArray.push(
 
-                                                             {
 
-                                                                 DateTime: outdoortempdataArray[i].DateTime,
 
-                                                                 outdoorTemp: outdoortempdataArray[i].outdoorTemp,
 
-                                                                 outdoorHumy: outdoorhumydataArray[i].outdoorHumy
 
-                                                             });
 
-                                                     }
 
-                                                 }
 
-                                             }
 
-                                         });
 
-                                     }
 
-                                 }
 
-                             });
 
-                         }
 
-                         else {
 
-                             utils.toast.show("[BemsMonitoringPointHistory15min] 정보가 없습니다.");
 
-                         }
 
-                     });
 
-                 }
 
-             }
 
-             else {
 
-                 utils.toast.show("[BemsFormulaParameter] 실내외 정보가 없습니다.");
 
-             }
 
-         });
 
-     }
 
-     function handleViewShown() {
 
-         if (initialized === false) {
 
-             var chartOption = BWA.ChartOptions.PowerSavingCycle;
 
-             chartTempOnOFF = chartTempOnOFF(chartOption.getChartTempOnOFFOptions(QUARTERMIN));
 
-             chartFanLoad = chartFanLoad(chartOption.getChartFanLoadOptions(QUARTERMIN));
 
-             initialized = true;
 
-         }
 
-         $("#PowerSaving_onoff").dxSwitch({
 
-             value: false,
 
-             onText: 'On',
 
-             offText: 'Off'
 
-         });
 
-         $("#PowerSaving_control").dxButton({
 
-             text: "제어",
 
-             onClick: function () {
 
-                 var PowerSavingonoff = $("#PowerSaving_onoff").dxSwitch("instance").option('value');
 
-                 if (PowerSavingonoff)
 
-                     PowerSavingonoff = 1;
 
-                 else
 
-                     PowerSavingonoff = 0;
 
-                 var FacilityTypeId = $("#Airconfitioner_select").dxSelectBox("instance").option('value').FacilityTypeId();
 
-                 var FacilityCode = $("#Airconfitioner_select").dxSelectBox("instance").option('value').FacilityCode();
 
-                 var param = {
 
-                     SiteId: SiteId,
 
-                     FacilityTypeId: FacilityTypeId,
 
-                     FacilityCode: FacilityCode,
 
-                     FormulaId: DUTYCYCLE_ONOFF,
 
-                     ControlValue: PowerSavingonoff,
 
-                 };
 
-                 BWA.api.post('BemsFormula/ControlPoint', null, param).done(function () {
 
-                     utils.toast.show('절전 사이클 제어 완료');
 
-                 })
 
-                 .fail(function (error) {
 
-                     utils.toast.show('절전 사이클 제어를 실패하였습니다.');
 
-                 });
 
-             }
 
-         });
 
-         $("#S_Temp_Btn").dxButton({
 
-             text: "기준온도 설정",
 
-             onClick: function () {
 
-                 if ($("#Set_Max_Temp").dxTextBox("instance") != null)
 
-                     $("#Set_Max_Temp").dxTextBox("instance").option('value', null);
 
-                 if ($("#Set_Min_Temp").dxTextBox("instance") != null)
 
-                     $("#Set_Min_Temp").dxTextBox("instance").option('value', null);
 
-                 visiblePopup(true);
 
-             }
 
-         });
 
-         $("#inoutdoor_inform").dxButton({
 
-             text: "차트",
 
-             onClick: function () {
 
-                 InOutdoorDataGridPopup_Visible(true);
 
-             }
 
-         });
 
-         $("#etc_inform").dxButton({
 
-             text: "차트",
 
-             onClick: function () {
 
-                 EtcDataGridPopup_Visible(true);
 
-             }
 
-         });
 
-         $("#Airconfitioner_date").dxDateBox({
 
-             displayFormat: "yyyy-MM-dd",
 
-             value: today,
 
-             max: today,
 
-             onValueChanged: function (e) {
 
-                 if (e.value != null) {
 
-                     searchday = e.value;
 
-                     facilityname = $("#Airconfitioner_select").dxSelectBox("instance").option('value').Name();
 
-                     facilitynickname = $("#Airconfitioner_select").dxSelectBox("instance").option('value').Nickname();
 
-                     facilityusage = $("#Airconfitioner_select").dxSelectBox("instance").option('value').FacilityUsage();
 
-                     facilitycode = $("#Airconfitioner_select").dxSelectBox("instance").option('value').FacilityCode();
 
-                     $("#facilityname").dxTextBox("instance").option('value', facilityname);
 
-                     $("#facilitynickname").dxTextBox("instance").option('value', facilitynickname);
 
-                     $("#facilityusage").dxTextBox("instance").option('value', facilityusage);
 
-                     GetEnthalpyDataSource(facilitycode, F_TEMP, F_HUMY);
 
-                     GetEnthalpyDataSource(facilitycode, F_TEMP, ONOFF);
 
-                     GetOutDataSource();
 
-                     GetLoadDataSource();
 
-                     GetDataSource(facilitycode, CO2);
 
-                     GetDataSource(facilitycode, CO);
 
-                     GetDataSource(facilitycode, DUST);
 
-                     GetDataSource(facilitycode, OZONE);
 
-                 }
 
-             }
 
-         });
 
-         $("#Airconfitioner_select").dxSelectBox({
 
-             dataSource: temp_facility_DataSource,
 
-             displayExpr: "Nickname",
 
-             onValueChanged: function (e) {
 
-                 if (e.value != null) {
 
-                     facilityname = e.value.Name();
 
-                     facilitynickname = e.value.Nickname();
 
-                     facilityusage = e.value.FacilityUsage();
 
-                     facilitycode = e.value.FacilityCode();
 
-                     $("#facilityname").dxTextBox("instance").option('value', facilityname);
 
-                     $("#facilitynickname").dxTextBox("instance").option('value', facilitynickname);
 
-                     $("#facilityusage").dxTextBox("instance").option('value', facilityusage);
 
-                     GetEnthalpyDataSource(facilitycode, F_TEMP, F_HUMY);
 
-                     GetEnthalpyDataSource(facilitycode, F_TEMP, ONOFF);
 
-                     GetOutDataSource();
 
-                     GetLoadDataSource();
 
-                     GetDataSource(facilitycode, CO2);
 
-                     GetDataSource(facilitycode, CO);
 
-                     GetDataSource(facilitycode, DUST);
 
-                     GetDataSource(facilitycode, OZONE);
 
-                 }
 
-             }
 
-         });
 
-         $("#co").dxTextBox({
 
-             readOnly: true
 
-         });
 
-         $("#co2").dxTextBox({
 
-             readOnly: true
 
-         });
 
-         $("#dust").dxTextBox({
 
-             readOnly: true
 
-         });
 
-         $("#ozone").dxTextBox({
 
-             readOnly: true
 
-         });
 
-         $("#predfanload").dxTextBox({
 
-             readOnly: true
 
-         });
 
-         $("#nowfanload").dxTextBox({
 
-             readOnly: true
 
-         });
 
-         $("#totlareduction").dxTextBox({
 
-             readOnly: true
 
-         });
 
-         $("#outdoor_humy").dxTextBox({
 
-             readOnly: true
 
-         });
 
-         $("#outdoor_temp").dxTextBox({
 
-             readOnly: true
 
-         });
 
-         $("#indoor_humy").dxTextBox({
 
-             readOnly: true
 
-         });
 
-         $("#indoor_temp").dxTextBox({
 
-             readOnly: true
 
-         });
 
-         $("#enthalpy_content").dxTextBox({
 
-             readOnly: true
 
-         });
 
-         $("#facilityname").dxTextBox({
 
-             readOnly: true,
 
-         });
 
-         $("#facilitynickname").dxTextBox({
 
-             readOnly: true,
 
-         });
 
-         $("#facilityusage").dxTextBox({
 
-             readOnly: true,
 
-         });
 
-     }
 
-     function handleViewHidden() {
 
-         var paging = BWA.ChartLayout.Paging;
 
-         paging.sideOverlayVisible(false);
 
-     }
 
-     function handleViewShowing() {
 
-         var facilityDataSource = BWA.db.createDataSource('CmFacility');
 
-         facilityDataSource.filter([
 
-             eq('SiteId', SiteId),
 
-             'and',
 
-             eq('FacilityTypeId', AIR_HANDLING)
 
-         ]);
 
-         facilityDataSource.load().done(function (facilities) {
 
-             var cnt = 0, k = 0;
 
-             if (facilities.length != 0) {
 
-                 for (var i = 0; i < facilities.length; i++) {
 
-                     if ((facilities[i].Nickname().substring(0, 3) != "OHU") && (facilities[i].Nickname().substring(0, 3) != "OAU")) {
 
-                         cnt++;
 
-                     }
 
-                 }
 
-                 var tempfacilities = new Array(cnt);
 
-                 for (var i = 0; i < facilities.length; i++) {
 
-                     if ((facilities[i].Nickname().substring(0, 3) != "OHU") && (facilities[i].Nickname().substring(0, 3) != "OAU")) {
 
-                         tempfacilities[k] = facilities[i];
 
-                         k++;
 
-                     }
 
-                 }
 
-                 if (tempfacilities.length > 1) {
 
-                     facilitydataSourceAdd(tempfacilities.length - 1);
 
-                 }
 
-                 temp_facility_DataSource = tempfacilities;
 
-                 $("#Airconfitioner_select").dxSelectBox({
 
-                     dataSource: temp_facility_DataSource,
 
-                     displayExpr: "Nickname",
 
-                 });
 
-                 $("#Airconfitioner_select").dxSelectBox("instance").option('value', temp_facility_DataSource[0]);
 
-             }
 
-             else {
 
-                 utils.toast.show("[CmFacility] 공조기 정보가 없습니다.");
 
-             }
 
-         });
 
-     }
 
-     function InoutDoorhandlePopupShown() {
 
-         if (inoutdoorinitialized === false) {
 
-             var chartOption = BWA.ChartOptions.EnthalpyControl;
 
-             chartInOut = chartInOut(chartOption.getChartInOutDoorOptions(QUARTERMIN));
 
-             inoutdoorinitialized = true;
 
-         }
 
-         var Array = [];
 
-         var enthalpy_length_size = Math.max(IndoordataArray.length, outdoordataArray.length);
 
-         if (IndoordataArray.length == outdoordataArray.length) {
 
-             for (var i = 0; i < enthalpy_length_size; i++) {
 
-                 Array.push(
 
-                     {
 
-                         DateTime: IndoordataArray[i].DateTime,
 
-                         IndoorTemp: IndoortempdataArray[i].IndoorTemp,
 
-                         IndoorHumy: IndoorhumydataArray[i].IndoorHumy,
 
-                         outdoorTemp: outdoordataArray[i].outdoorTemp,
 
-                         outdoorHumy: outdoordataArray[i].outdoorHumy
 
-                     });
 
-             }
 
-             var options = BWA.ChartOptions.EnthalpyControl.getChartInOutDoorOptions(QUARTERMIN);
 
-             options.dataSource = Array;
 
-             chartInOut().option(options);
 
-         }
 
-     }
 
-     function isNumber(s) {
 
-         s += ''; // 문자열로 변환
 
-         s = s.replace(/^\s*|\s*$/g, ''); // 좌우 공백 제거
 
-         if (s == '' || isNaN(s)) return false;
 
-         return true;
 
-     }
 
-     function EtchandlePopupShown() {
 
-         if (Etcinitialized === false) {
 
-             var chartOption = BWA.ChartOptions.EnthalpyControl;
 
-             chartEtc = chartEtc(chartOption.getChartEtcOptions(QUARTERMIN));
 
-             Etcinitialized = true;
 
-         }
 
-         if (Ozonedata && Dustdata && Codata && Co2data) {
 
-             EtcdataArray = [];
 
-             var array_length_size = Math.max(OzonedataArray.length, DustdataArray.length, CodataArray.length, Co2dataArray.length);
 
-             if (OzonedataArray.length == DustdataArray.length && CodataArray.length == Co2dataArray.length && DustdataArray.length == CodataArray.length) {
 
-                 for (var i = 0; i < array_length_size; i++) {
 
-                     EtcdataArray.push(
 
-                         {
 
-                             DateTime: OzonedataArray[i].DateTime,
 
-                             Ozone: OzonedataArray[i].Ozone,
 
-                             Dust: DustdataArray[i].Dust,
 
-                             Co: CodataArray[i].Co,
 
-                             Co2: Co2dataArray[i].Co2
 
-                         });
 
-                 }
 
-             }
 
-             Ozonedata = false, Dustdata = false, Codata = false, Co2data = false;
 
-             var options = BWA.ChartOptions.EnthalpyControl.getChartEtcOptions(QUARTERMIN);
 
-             options.dataSource = EtcdataArray;
 
-             chartEtc().option(options);
 
-         }
 
-     }
 
-     function handleSearchInSearchView(filter, searchViewItems) {
 
-     }
 
-     var searchViewOptions = {
 
-     }
 
-     var viewModel = $.extend(BWA.CommonView.create(params, viewInfo, searchViewOptions, ko.observable(null), handleViewShown, null, handleSearchInSearchView, undefined, chartLayout), {
 
-         viewHidden: handleViewHidden,
 
-         viewShowing: handleViewShowing,
 
-         onHidden: function () {
 
-         },
 
-     });
 
-     viewModel.InoutDoorDataGridPopupOptions = {
 
-         width: '1000px',
 
-         height: '550px',
 
-         contentTemplate: "content",
 
-         showTitle: true,
 
-         title: "차트",
 
-         visible: InOutdoorDataGridPopup_Visible,
 
-         dragEnabled: true,
 
-         closeOnOutsideClick: true,
 
-         shownAction: InoutDoorhandlePopupShown,
 
-         animation: window.utils.popup.createAnimation()
 
-     };
 
-     viewModel.EtcDataGridPopupOptions = {
 
-         width: '1000px',
 
-         height: '550px',
 
-         contentTemplate: "content",
 
-         showTitle: true,
 
-         title: "차트",
 
-         visible: EtcDataGridPopup_Visible,
 
-         dragEnabled: true,
 
-         closeOnOutsideClick: true,
 
-         shownAction: EtchandlePopupShown,
 
-         animation: window.utils.popup.createAnimation()
 
-     };
 
-     viewModel.popupOptions = {
 
-         width: 330,
 
-         height: 200,
 
-         visible: visiblePopup,
 
-         dragEnabled: true,
 
-         shading: true,
 
-         closeOnOutsideClick: true,
 
-         shadingColor: 'transparent',
 
-         showTitle: true,
 
-         title: "기준온도 설정",
 
-         showCloseButton: true,
 
-         onShowing: function () {
 
-         },
 
-         onShown: function (t, tt) {
 
-             $("#Save_Btn").dxButton({
 
-                 text: "저장",
 
-                 onClick: function () {
 
-                     var tempfacilitycode = $("#Airconfitioner_select").dxSelectBox("instance").option('value').FacilityCode();
 
-                     var tempMaxvalue = $("#Set_Max_Temp").dxTextBox("instance").option('value');
 
-                     var tempMinvalue = $("#Set_Min_Temp").dxTextBox("instance").option('value');
 
-                     if (!isNumber(tempMaxvalue) || !isNumber(tempMinvalue)) {
 
-                         utils.toast.show("숫자를 입력해주십시요.");
 
-                     }
 
-                     if (!(tempMaxvalue) >= tempMinvalue) {
 
-                         utils.toast.show("기준온도 최대값 , 최소값이 잘못 입력되었습니다.");
 
-                         return;
 
-                     }
 
-                     else {
 
-                         tempMaxvalue = parseFloat(parseFloat(tempMaxvalue).toFixed(2));
 
-                         tempMinvalue = parseFloat(parseFloat(tempMinvalue).toFixed(2));
 
-                         $("#Set_Max_Temp").dxTextBox("instance").option('value', tempMaxvalue);
 
-                         $("#Set_Min_Temp").dxTextBox("instance").option('value', tempMinvalue);
 
-                         var BemsSTempDataSource = new DevExpress.data.DataSource({
 
-                             store: {
 
-                                 type: "odata",
 
-                                 url: endpointSelector + "/BemsControlAHUTempConfig"
 
-                             },
 
-                             requireTotalCount: true,
 
-                             pageSize: 1
 
-                         });
 
-                         BemsSTempDataSource.filter([
 
-                             ['SiteId', "=", SiteId],
 
-                              'and',
 
-                             ['FacilityCode', "=", tempfacilitycode]
 
-                         ]);
 
-                         BemsSTempDataSource.load()
 
-                         .done(function (STemp) {
 
-                             if (STemp.length == 0) {
 
-                                 BWA.api.post('BemsControlAHUTempConfig/Insert', {
 
-                                     SiteId: SiteId,
 
-                                     FacilityTypeId: AIR_HANDLING,
 
-                                     FacilityCode: tempfacilitycode,
 
-                                     MaxTemperature: tempMaxvalue,
 
-                                     MinTemperature: tempMinvalue
 
-                                 }).done(function () {
 
-                                     var facilitycode = $("#Airconfitioner_select").dxSelectBox("instance").option('value').FacilityCode();
 
-                                     GetEnthalpyDataSource(facilitycode, F_TEMP, F_HUMY);
 
-                                     GetEnthalpyDataSource(facilitycode, F_TEMP, ONOFF);
 
-                                     utils.toast.show("공조기 기준온도를 설정하였습니다.");
 
-                                     visiblePopup(false);
 
-                                 }).fail(function (error) {
 
-                                     utils.toast.show("공조기 기준온도 설정를 실패하였습니다.");
 
-                                 });
 
-                             }
 
-                             else {
 
-                                 BWA.api.post('BemsControlAHUTempConfig/Update', {
 
-                                     SiteId: SiteId,
 
-                                     FacilityTypeId: AIR_HANDLING,
 
-                                     FacilityCode: tempfacilitycode,
 
-                                     MaxTemperature: tempMaxvalue,
 
-                                     MinTemperature: tempMinvalue
 
-                                 }).done(function () {
 
-                                     var facilitycode = $("#Airconfitioner_select").dxSelectBox("instance").option('value').FacilityCode();
 
-                                     GetEnthalpyDataSource(facilitycode, F_TEMP, F_HUMY);
 
-                                     GetEnthalpyDataSource(facilitycode, F_TEMP, ONOFF);
 
-                                     utils.toast.show("공조기 기준온도를 설정하였습니다.");
 
-                                     visiblePopup(false);
 
-                                 }).fail(function (error) {
 
-                                     utils.toast.show("공조기 기준온도 설정를 실패하였습니다.");
 
-                                 });
 
-                             }
 
-                         });
 
-                     }
 
-                 }
 
-             });
 
-             $("#Set_Max_Temp").dxTextBox({
 
-                 placeholder: "기준온도 최대값 설정"
 
-             });
 
-             $("#Set_Min_Temp").dxTextBox({
 
-                 placeholder: "기준온도 최소값 설정"
 
-             });
 
-         },
 
-         onHidden: function () {
 
-         }
 
-     };
 
-     viewModel.currentTabIndex = currentTabIndex;
 
-     return viewModel;
 
- };
 
 
  |