848bef6a5564d4ed273a8308fe475d4208af3480.svn-base 90 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539
  1. BemsWebApplication.EnthalpyControl = function (params, viewInfo) {
  2. "use strict";
  3. //전역 변수 선언
  4. var endpointSelector = "";
  5. var currentTabIndex = ko.observable(0);
  6. if (BemsWebApplication.config.mode == "production") {
  7. endpointSelector = new DevExpress.EndpointSelector(BemsWebApplication.config.endpoints).config.db.production;
  8. } else {
  9. endpointSelector = new DevExpress.EndpointSelector(BemsWebApplication.config.endpoints).config.db.local;
  10. }
  11. var initialized = false, inoutdoorinitialized = false, Etcinitialized = false;
  12. var SiteId = BWA.UserInfo.SiteId();
  13. var today = new Date();
  14. var searchday = new Date();
  15. var eq = BWA.DataUtil.constructEqualFilter;
  16. var AIR_HANDLING = $Code.FacilityType.AIR_HANDLING;
  17. var OUTDOOR = $Code.FacilityType.OUTDOOR;
  18. var temp_facility_DataSource = [{
  19. Name: "",
  20. Nickname: "",
  21. FacilityUsage: "",
  22. FacilityCode: 0
  23. }];
  24. var ONOFF = $Code.Formula[AIR_HANDLING].ONOFF; //onoff
  25. var facilityname = "", facilitynickname = "", facilityusage = "", facilitycode = 0;
  26. var formulaGet = new BWA.Chart.FormulaGet(SiteId);
  27. var CO2 = $Code.Formula[AIR_HANDLING].CO2;
  28. var ENTHALPY_ONOFF = $Code.Formula[AIR_HANDLING].ENTHALPY_ONOFF;
  29. var CO = $Code.Formula[AIR_HANDLING].CO;
  30. var DUST = $Code.Formula[AIR_HANDLING].DUST;
  31. var OZONE = $Code.Formula[AIR_HANDLING].OZONE;
  32. var S_VOLUME = $Code.Formula[AIR_HANDLING].S_VOLUME;
  33. var F_TEMP = $Code.Formula[AIR_HANDLING].F_TEMP; //환기
  34. var F_HUMY = $Code.Formula[AIR_HANDLING].F_HUMY;
  35. var S_TEMP = $Code.Formula[AIR_HANDLING].S_TEMP; //급기
  36. var S_HUMY = $Code.Formula[AIR_HANDLING].S_HUMY;
  37. var M_TEMP = $Code.Formula[AIR_HANDLING].M_TEMP; //혼합
  38. var timeIntervalType = $Code.TimeIntervalType.QUARTERMIN;
  39. var M_OPENING_RATE = $Code.Formula[AIR_HANDLING].M_OPENING_RATE //혼합 댐퍼 개도율
  40. var OUT_TEMPERATURE = $Code.Formula[OUTDOOR].TEMPERATURE;
  41. var OUT_HUMIDITY = $Code.Formula[OUTDOOR].HUMIDITY;
  42. var chartEnthalpy = BWA.Chart.Instance('chartEnthalpyES', 'dxChart');
  43. var chartCoilLoad = BWA.Chart.Instance('chartCoilLoad', 'dxChart');
  44. var chartInOut = BWA.Chart.Instance('chartInOutdoor', 'dxChart');
  45. var chartEtc = BWA.Chart.Instance('chartEtc', 'dxChart');
  46. var InOutSupplyEnthalpySource = [], MixEnthalpySource = [];
  47. var chartLayout = new BWA.ChartLayout({
  48. divs: [
  49. {
  50. id: 'Enthalpy',
  51. chartId: 'chartEnthalpyES'
  52. },
  53. {
  54. id: 'InOutDoor',
  55. chartId: 'chartInOutdoor'
  56. },
  57. ,
  58. {
  59. id: 'CoilLoad',
  60. chartId: 'chartCoilLoad'
  61. }
  62. ],
  63. multiViewOptions: {
  64. viewIndex: currentTabIndex,
  65. viewCount: 1
  66. }
  67. });
  68. var humydataArray = [], IndoorOn = false, OutdoorOn = false;;
  69. var IndoorhumyOn = false, OutdoorhumyOn = false;
  70. var OutdataArray = [], CoilSource = [];
  71. var SupplyVolumedataArray = [];
  72. var MixtempdataArray = [], MixdataArray = [], MixhumydataArray = [];
  73. var SupplytempdataArray = [], SupplyhumydataArray = [], SupplydataArray = [];
  74. var Supplyhumy = false, Supplytemp = false, Supplyenthalpy = false;
  75. var IndoordataArray = [], IndoorhumydataArray = [], IndoortempdataArray = [], Indoortemp = false, Indoorhumy = false;
  76. var CodataArray = [], Co2dataArray = [], DustdataArray = [], OzonedataArray = [], EtcdataArray = [];
  77. var Codata = false, Co2data = false, Dustdata = false, Ozonedata = false;
  78. var outdoordataArray = [], outdoorhumydataArray = [], outdoortempdataArray = [], outdoortemp = false, outdoorhumy = false;
  79. var outdoorenthalpy = false, Indoorenthalpy = false, Mixenthalpy = false;
  80. var QUARTERMIN = $Code.TimeType.QUARTERMIN;
  81. var Altitude = 50; //대구은행 고도 50
  82. var InOutdoorDataGridPopup_Visible = ko.observable(false), EtcDataGridPopup_Visible = ko.observable(false);
  83. function facilitydataSourceAdd(cnt) { // 설비 개수만큼 추가
  84. for (var i = 0; i < cnt ; i++) {
  85. temp_facility_DataSource.push({
  86. Name: "",
  87. Nickname: "",
  88. FacilityUsage: "",
  89. FacilityCode: 0
  90. });
  91. }
  92. }
  93. //엔탈피 공식
  94. // 대기압 Function
  95. function AmbientPress(Altitude) {
  96. return 101325 * Math.pow((1 - 2.25577 * Math.pow(10, -5) * Altitude), 5.2559);
  97. }
  98. // B Function
  99. function B_Function(T) {
  100. return Math.exp(-5800.2206 / (T + 273.15) + 1.3914993 - 0.048640239 * (T + 273.15) + (0.0000417648) * Math.pow(T + 273.15, 2) + Math.pow(T + 273.15, 3) * (-0.0000000144521) + 6.5459673 * Math.log(T + 273.15));
  101. }
  102. // A Function
  103. function A_Function(T, H, Altitude) {
  104. return 0.62198 * (H / 100) * B_Function(T) / (AmbientPress(Altitude) - (H / 100) * B_Function(T));
  105. }
  106. // 엔탈피 Function
  107. function Enthalphy_Function(T, H, Altitude) {
  108. return 1.006 * T + (2501 + (1.86 * T)) * A_Function(T, H, Altitude);
  109. }
  110. // 절대습도 얻기(상대습도 이용) Function
  111. function AbsH_Function(T, H, Altitude) {
  112. return A_Function(T, 100, 50) * H / 100;
  113. }
  114. // 상대습도 얻기(절대습도 이용) Function
  115. function RelH_Function(T, Abs_H, Altitude) {
  116. return 100 * Abs_H / A_Function(T, 100, 50);
  117. }
  118. function GetDataSource(FacilityCode, FormulaId) { // 설비 개수만큼 추가
  119. var BemsTempFormulaDataSource = new DevExpress.data.DataSource({ // 실내온도 가져오기
  120. store: {
  121. type: "odata",
  122. url: endpointSelector + "/BemsFormulaParameter"
  123. },
  124. requireTotalCount: true,
  125. pageSize: 5
  126. });
  127. BemsTempFormulaDataSource.filter([
  128. eq('SiteId', SiteId),
  129. 'and',
  130. eq('FacilityCode', FacilityCode),
  131. 'and',
  132. eq('FormulaId', FormulaId)
  133. ]);
  134. BemsTempFormulaDataSource.load()
  135. .done(function (BemsFormula) {
  136. if (BemsFormula.length != 0) {
  137. if (BemsFormula.length == 1) {
  138. var ParameterFacilityCode = BemsFormula[0].ParameterFacilityCode;
  139. var parameterpropertyId = BemsFormula[0].ParameterPropertyId;
  140. var BemsTempDataSource = new DevExpress.data.DataSource({
  141. store: {
  142. type: "odata",
  143. url: endpointSelector + "/BemsMonitoringPointHistory15min"
  144. },
  145. requireTotalCount: true,
  146. pageSize: 1440
  147. });
  148. BemsTempDataSource.filter([
  149. ['CreatedDateTime', ">=", new Date(searchday.getFullYear(), searchday.getMonth(), searchday.getDate(), 0, 0, 0)],
  150. 'and',
  151. ['CreatedDateTime', "<", new Date(searchday.getFullYear(), searchday.getMonth(), searchday.getDate() + 1, 0, 0, 0)],
  152. 'and',
  153. ['SiteId', "=", SiteId],
  154. 'and',
  155. ['FacilityCode', "=", ParameterFacilityCode],
  156. 'and',
  157. ['PropertyId', "=", parameterpropertyId]
  158. ]);
  159. BemsTempDataSource.sort({ getter: "CreatedDateTime", desc: true });
  160. BemsTempDataSource.load()
  161. .done(function (BemsTemp) {
  162. if (BemsTemp.length != 0) {
  163. var Temp = BemsTemp[0].CurrentValue;
  164. if (FormulaId == CO2) {
  165. Co2dataArray = [];
  166. var state;
  167. if (Temp <= 1000) {
  168. state = "(적정)";
  169. }
  170. else {
  171. state = "(부적정)";
  172. }
  173. $("#co2").dxTextBox("instance").option('value', Temp.toFixed(2) + "ppm" + state);
  174. for (var i = 0; i < BemsTemp.length; i++) {
  175. Co2dataArray.push({
  176. DateTime: BemsTemp[i].CreatedDateTime,
  177. Co2: BemsTemp[i].CurrentValue
  178. });
  179. }
  180. Co2data = true;
  181. }
  182. else if (FormulaId == CO) {
  183. CodataArray = [];
  184. var state;
  185. if (Temp <= 2) {
  186. state = "(좋음)";
  187. }
  188. else if ((2 < Temp) && (Temp <= 9)) {
  189. state = "(보통)";
  190. }
  191. else if ((9 < Temp) && (Temp <= 15)) {
  192. state = "(나쁨)";
  193. }
  194. else {
  195. state = "(매우나쁨)";
  196. }
  197. $("#co").dxTextBox("instance").option('value', Temp.toFixed(2) + "ppm" + state);
  198. for (var i = 0; i < BemsTemp.length; i++) {
  199. CodataArray.push({
  200. DateTime: BemsTemp[i].CreatedDateTime,
  201. Co: BemsTemp[i].CurrentValue
  202. });
  203. }
  204. Codata = true;
  205. }
  206. else if (FormulaId == DUST) {
  207. DustdataArray = [];
  208. var state;
  209. if (Temp <= 30) {
  210. state = "(좋음)";
  211. }
  212. else if ((30 < Temp) && (Temp <= 80)) {
  213. state = "(보통)";
  214. }
  215. else if ((80 < Temp) && (Temp <= 150)) {
  216. state = "(나쁨)";
  217. }
  218. else {
  219. state = "(매우나쁨)";
  220. }
  221. $("#dust").dxTextBox("instance").option('value', Temp.toFixed(2) + "㎍/㎥" + state);
  222. for (var i = 0; i < BemsTemp.length; i++) {
  223. DustdataArray.push({
  224. DateTime: BemsTemp[i].CreatedDateTime,
  225. Dust: BemsTemp[i].CurrentValue
  226. });
  227. }
  228. Dustdata = true;
  229. }
  230. else if (FormulaId == OZONE) {
  231. OzonedataArray = [];
  232. var state;
  233. if (Temp <= 0.03) {
  234. state = "(좋음)";
  235. }
  236. else if ((0.03 < Temp) && (Temp <= 0.09)) {
  237. state = "(보통)";
  238. }
  239. else if ((0.09 < Temp) && (Temp <= 0.150)) {
  240. state = "(나쁨)";
  241. }
  242. else {
  243. state = "(매우나쁨)";
  244. }
  245. $("#ozone").dxTextBox("instance").option('value', Temp.toFixed(2) + "ppm" + state);
  246. for (var i = 0; i < BemsTemp.length; i++) {
  247. OzonedataArray.push({
  248. DateTime: BemsTemp[i].CreatedDateTime,
  249. Ozone: BemsTemp[i].CurrentValue
  250. });
  251. }
  252. Ozonedata = true;
  253. }
  254. }
  255. else {
  256. utils.toast.show("[BemsMonitoringPointHistory15min] 정보가 없습니다.");
  257. }
  258. });
  259. }
  260. }
  261. else {
  262. utils.toast.show("[BemsFormulaParameter] 실내외 정보가 없습니다.");
  263. }
  264. });
  265. }
  266. function GetMixEnthalpyDataSource(FacilityCode) { // 온도, 습도
  267. humydataArray = [];
  268. var array_length_size = Math.max(IndoordataArray.length, outdoordataArray.length);
  269. if (IndoordataArray.length == outdoordataArray.length) {
  270. for (var i = 0; i < array_length_size; i++) {
  271. humydataArray.push(
  272. {
  273. DateTime: IndoordataArray[i].DateTime,
  274. IndoorAbsoluteHumy: AbsH_Function(IndoordataArray[i].IndoorTemp, IndoordataArray[i].IndoorHumy, Altitude),
  275. OutdoorAbsoluteHumy: AbsH_Function(outdoordataArray[i].outdoorTemp, outdoordataArray[i].outdoorHumy),
  276. });
  277. }
  278. IndoorOn = false, OutdoorOn = false;
  279. }
  280. var BemsTempFormulaDataSource = new DevExpress.data.DataSource({ // 실내온도 가져오기
  281. store: {
  282. type: "odata",
  283. url: endpointSelector + "/BemsFormulaParameter"
  284. },
  285. requireTotalCount: true,
  286. pageSize: 5
  287. });
  288. BemsTempFormulaDataSource.filter([
  289. eq('SiteId', SiteId),
  290. 'and',
  291. eq('FacilityCode', FacilityCode),
  292. 'and',
  293. eq('FormulaId', M_OPENING_RATE)
  294. ]);
  295. BemsTempFormulaDataSource.load()
  296. .done(function (BemsFormula) {
  297. if (BemsFormula.length != 0) {
  298. if (BemsFormula.length == 1) {
  299. var ParameterFacilityCode = BemsFormula[0].ParameterFacilityCode;
  300. var parameterpropertyId = BemsFormula[0].ParameterPropertyId;
  301. var BemsTempDataSource = new DevExpress.data.DataSource({
  302. store: {
  303. type: "odata",
  304. url: endpointSelector + "/BemsMonitoringPointHistory15min"
  305. },
  306. requireTotalCount: true,
  307. pageSize: 1440
  308. });
  309. BemsTempDataSource.filter([
  310. ['CreatedDateTime', ">=", new Date(searchday.getFullYear(), searchday.getMonth(), searchday.getDate(), 0, 0, 0)],
  311. 'and',
  312. ['CreatedDateTime', "<", new Date(searchday.getFullYear(), searchday.getMonth(), searchday.getDate() + 1, 0, 0, 0)],
  313. 'and',
  314. ['SiteId', "=", SiteId],
  315. 'and',
  316. ['FacilityCode', "=", ParameterFacilityCode],
  317. 'and',
  318. ['PropertyId', "=", parameterpropertyId]
  319. ]);
  320. BemsTempDataSource.sort({ getter: "CreatedDateTime", desc: true });
  321. BemsTempDataSource.load()
  322. .done(function (BemsTemp) {
  323. if (BemsTemp.length != 0) {
  324. var OpeningRatedataArray = [];
  325. for (var i = 0; i < BemsTemp.length; i++) {
  326. OpeningRatedataArray.push({
  327. DateTime: BemsTemp[i].CreatedDateTime,
  328. M_OPENING_RATE: BemsTemp[i].CurrentValue
  329. });
  330. }
  331. var humytempdataArray = [];
  332. var array_length_size = Math.max(humydataArray.length, OpeningRatedataArray.length);
  333. if (humydataArray.length == OpeningRatedataArray.length) {
  334. for (var i = 0; i < array_length_size; i++) {
  335. humytempdataArray.push(
  336. {
  337. DateTime: humydataArray[i].DateTime,
  338. M_AbsoluteHumy: humydataArray[i].IndoorAbsoluteHumy * (OpeningRatedataArray[i].M_OPENING_RATE / 100) + humydataArray[i].OutdoorAbsoluteHumy * ((100 - OpeningRatedataArray[i].M_OPENING_RATE) / 100)
  339. });
  340. }
  341. }
  342. var BemsTempFormulaDataSource = new DevExpress.data.DataSource({ // 실내온도 가져오기
  343. store: {
  344. type: "odata",
  345. url: endpointSelector + "/BemsFormulaParameter"
  346. },
  347. requireTotalCount: true,
  348. pageSize: 5
  349. });
  350. BemsTempFormulaDataSource.filter([
  351. eq('SiteId', SiteId),
  352. 'and',
  353. eq('FacilityCode', FacilityCode),
  354. 'and',
  355. eq('FormulaId', M_TEMP)
  356. ]);
  357. BemsTempFormulaDataSource.load()
  358. .done(function (BemsFormula) {
  359. if (BemsFormula.length != 0) {
  360. if (BemsFormula.length == 1) {
  361. var ParameterFacilityCode = BemsFormula[0].ParameterFacilityCode;
  362. var parameterpropertyId = BemsFormula[0].ParameterPropertyId;
  363. var BemsTempDataSource = new DevExpress.data.DataSource({
  364. store: {
  365. type: "odata",
  366. url: endpointSelector + "/BemsMonitoringPointHistory15min"
  367. },
  368. requireTotalCount: true,
  369. pageSize: 1440
  370. });
  371. BemsTempDataSource.filter([
  372. ['CreatedDateTime', ">=", new Date(searchday.getFullYear(), searchday.getMonth(), searchday.getDate(), 0, 0, 0)],
  373. 'and',
  374. ['CreatedDateTime', "<", new Date(searchday.getFullYear(), searchday.getMonth(), searchday.getDate() + 1, 0, 0, 0)],
  375. 'and',
  376. ['SiteId', "=", SiteId],
  377. 'and',
  378. ['FacilityCode', "=", ParameterFacilityCode],
  379. 'and',
  380. ['PropertyId', "=", parameterpropertyId]
  381. ]);
  382. BemsTempDataSource.sort({ getter: "CreatedDateTime", desc: true });
  383. BemsTempDataSource.load()
  384. .done(function (BemsTemp) {
  385. if (BemsTemp.length != 0) {
  386. var MixtempdataArray = [], MixdataArray = [], MixdataArray = [], MixEnthalpySource = [];
  387. for (var i = 0; i < BemsTemp.length; i++) {
  388. MixtempdataArray.push({
  389. DateTime: BemsTemp[i].CreatedDateTime,
  390. MixTemp: BemsTemp[i].CurrentValue
  391. });
  392. }
  393. var array_length_size = Math.max(humytempdataArray.length, MixtempdataArray.length);
  394. if (humytempdataArray.length == MixtempdataArray.length) {
  395. for (var i = 0; i < array_length_size; i++) {
  396. MixdataArray.push(
  397. {
  398. DateTime: humytempdataArray[i].DateTime,
  399. MixTemp: MixtempdataArray[i].MixTemp,
  400. MixHumy: RelH_Function(MixtempdataArray[i].MixTemp, humytempdataArray[i].M_AbsoluteHumy, Altitude),
  401. });
  402. }
  403. for (var i = 0; i < array_length_size; i++) {
  404. MixEnthalpySource.push(
  405. {
  406. DateTime: MixdataArray[i].DateTime,
  407. MixEnthalphy: Enthalphy_Function(MixdataArray[i].MixTemp, MixdataArray[i].MixHumy, Altitude)
  408. });
  409. Mixenthalpy = true;
  410. }
  411. if (Indoorenthalpy && outdoorenthalpy && Supplyenthalpy && Mixenthalpy) {
  412. InOutSupplyEnthalpySource = [];
  413. var enthalpy_length_size = Math.max(IndoordataArray.length, outdoordataArray.length, SupplydataArray.length, MixEnthalpySource.length);
  414. if (IndoordataArray.length == outdoordataArray.length && outdoordataArray.length == SupplydataArray.length && SupplydataArray.length == MixEnthalpySource.length) {
  415. for (var i = 0; i < enthalpy_length_size; i++) {
  416. InOutSupplyEnthalpySource.push(
  417. {
  418. DateTime: MixEnthalpySource[i].DateTime,
  419. IndoorEnthalpy: IndoordataArray[i].IndoorEnthalpy,
  420. outdoorEnthalpy: outdoordataArray[i].outdoorEnthalpy,
  421. SupplyEnthalpy: SupplydataArray[i].SupplyEnthalpy,
  422. MixEnthalphy: MixEnthalpySource[i].MixEnthalphy
  423. });
  424. }
  425. }
  426. GetVolumeDataSource(facilitycode, S_VOLUME);
  427. var options = BWA.ChartOptions.EnthalpyControl.getChartControlEnthalpyOptions(QUARTERMIN);
  428. options.dataSource = InOutSupplyEnthalpySource;
  429. chartEnthalpy().option(options);
  430. Indoorenthalpy = false, outdoorenthalpy = false, Supplyenthalpy = false, Mixenthalpy = false;
  431. }
  432. }
  433. }
  434. });
  435. }
  436. }
  437. });
  438. }
  439. else {
  440. utils.toast.show("[BemsMonitoringPointHistory15min] 정보가 없습니다.");
  441. }
  442. });
  443. }
  444. }
  445. else {
  446. utils.toast.show("[BemsFormulaParameter] 실내외 정보가 없습니다.");
  447. }
  448. });
  449. }
  450. function GetEnthalpyDataSource(FacilityCode, FormulaId, FormulaId2) { // 온도, 습도
  451. var BemsTempFormulaDataSource = new DevExpress.data.DataSource({ // 실내온도 가져오기
  452. store: {
  453. type: "odata",
  454. url: endpointSelector + "/BemsFormulaParameter"
  455. },
  456. requireTotalCount: true,
  457. pageSize: 5
  458. });
  459. BemsTempFormulaDataSource.filter([
  460. eq('SiteId', SiteId),
  461. 'and',
  462. eq('FacilityCode', FacilityCode),
  463. 'and',
  464. eq('FormulaId', FormulaId)
  465. ]);
  466. BemsTempFormulaDataSource.load()
  467. .done(function (BemsFormula) {
  468. if (BemsFormula.length != 0) {
  469. if (BemsFormula.length == 1) {
  470. var ParameterFacilityCode = BemsFormula[0].ParameterFacilityCode;
  471. var parameterpropertyId = BemsFormula[0].ParameterPropertyId;
  472. var BemsTempDataSource = new DevExpress.data.DataSource({
  473. store: {
  474. type: "odata",
  475. url: endpointSelector + "/BemsMonitoringPointHistory15min"
  476. },
  477. requireTotalCount: true,
  478. pageSize: 1440
  479. });
  480. BemsTempDataSource.filter([
  481. ['CreatedDateTime', ">=", new Date(searchday.getFullYear(), searchday.getMonth(), searchday.getDate(), 0, 0, 0)],
  482. 'and',
  483. ['CreatedDateTime', "<", new Date(searchday.getFullYear(), searchday.getMonth(), searchday.getDate() + 1, 0, 0, 0)],
  484. 'and',
  485. ['SiteId', "=", SiteId],
  486. 'and',
  487. ['FacilityCode', "=", ParameterFacilityCode],
  488. 'and',
  489. ['PropertyId', "=", parameterpropertyId]
  490. ]);
  491. BemsTempDataSource.sort({ getter: "CreatedDateTime", desc: true });
  492. BemsTempDataSource.load()
  493. .done(function (BemsTemp) {
  494. if (BemsTemp.length != 0) {
  495. var Temp = BemsTemp[0].CurrentValue;
  496. if (FormulaId == F_TEMP) { // 환기 엔탈피
  497. IndoortempdataArray = [], IndoorhumydataArray = [], IndoordataArray = [];
  498. $("#indoor_temp").dxTextBox("instance").option('value', Temp.toFixed(2) + "℃");
  499. for (var i = 0; i < BemsTemp.length; i++) {
  500. IndoortempdataArray.push({
  501. DateTime: BemsTemp[i].CreatedDateTime,
  502. IndoorTemp: BemsTemp[i].CurrentValue
  503. });
  504. }
  505. var BemsTempFormulaDataSource = new DevExpress.data.DataSource({ // 실내온도 가져오기
  506. store: {
  507. type: "odata",
  508. url: endpointSelector + "/BemsFormulaParameter"
  509. },
  510. requireTotalCount: true,
  511. pageSize: 5
  512. });
  513. BemsTempFormulaDataSource.filter([
  514. eq('SiteId', SiteId),
  515. 'and',
  516. eq('FacilityCode', FacilityCode),
  517. 'and',
  518. eq('FormulaId', FormulaId2)
  519. ]);
  520. BemsTempFormulaDataSource.load()
  521. .done(function (BemsFormula) {
  522. if (BemsFormula.length != 0) {
  523. if (BemsFormula.length == 1) {
  524. var ParameterFacilityCode = BemsFormula[0].ParameterFacilityCode;
  525. var parameterpropertyId = BemsFormula[0].ParameterPropertyId;
  526. var BemsTempDataSource = new DevExpress.data.DataSource({
  527. store: {
  528. type: "odata",
  529. url: endpointSelector + "/BemsMonitoringPointHistory15min"
  530. },
  531. requireTotalCount: true,
  532. pageSize: 1440
  533. });
  534. BemsTempDataSource.filter([
  535. ['CreatedDateTime', ">=", new Date(searchday.getFullYear(), searchday.getMonth(), searchday.getDate(), 0, 0, 0)],
  536. 'and',
  537. ['CreatedDateTime', "<", new Date(searchday.getFullYear(), searchday.getMonth(), searchday.getDate() + 1, 0, 0, 0)],
  538. 'and',
  539. ['SiteId', "=", SiteId],
  540. 'and',
  541. ['FacilityCode', "=", ParameterFacilityCode],
  542. 'and',
  543. ['PropertyId', "=", parameterpropertyId]
  544. ]);
  545. BemsTempDataSource.sort({ getter: "CreatedDateTime", desc: true });
  546. BemsTempDataSource.load()
  547. .done(function (BemsTemp) {
  548. if (BemsTemp.length != 0) {
  549. var Temp = BemsTemp[0].CurrentValue;
  550. $("#indoor_humy").dxTextBox("instance").option('value', Temp.toFixed(2) + "%");
  551. for (var i = 0; i < BemsTemp.length; i++) {
  552. IndoorhumydataArray.push({
  553. DateTime: BemsTemp[i].CreatedDateTime,
  554. IndoorHumy: BemsTemp[i].CurrentValue
  555. });
  556. }
  557. var array_length_size = Math.max(IndoortempdataArray.length, IndoorhumydataArray.length);
  558. if (IndoortempdataArray.length == IndoorhumydataArray.length) {
  559. for (var i = 0; i < array_length_size; i++) {
  560. IndoordataArray.push(
  561. {
  562. DateTime: IndoortempdataArray[i].DateTime,
  563. IndoorTemp: IndoortempdataArray[i].IndoorTemp,
  564. IndoorHumy: IndoorhumydataArray[i].IndoorHumy,
  565. IndoorEnthalpy: Enthalphy_Function(IndoortempdataArray[i].IndoorTemp, IndoorhumydataArray[i].IndoorHumy, Altitude)
  566. });
  567. }
  568. Indoorenthalpy = true;
  569. IndoorOn = true;
  570. if (IndoorOn && OutdoorOn) {
  571. GetMixEnthalpyDataSource(facilitycode);
  572. }
  573. }
  574. if (Indoorenthalpy && outdoorenthalpy && Supplyenthalpy && Mixenthalpy) {
  575. InOutSupplyEnthalpySource = [];
  576. var enthalpy_length_size = Math.max(IndoordataArray.length, outdoordataArray.length, SupplydataArray.length, MixEnthalpySource.length);
  577. if (IndoordataArray.length == outdoordataArray.length && outdoordataArray.length == SupplydataArray.length && SupplydataArray.length == MixEnthalpySource.length) {
  578. for (var i = 0; i < enthalpy_length_size; i++) {
  579. InOutSupplyEnthalpySource.push(
  580. {
  581. DateTime: MixEnthalpySource[i].DateTime,
  582. IndoorEnthalpy: IndoordataArray[i].IndoorEnthalpy,
  583. outdoorEnthalpy: outdoordataArray[i].outdoorEnthalpy,
  584. SupplyEnthalpy: SupplydataArray[i].SupplyEnthalpy,
  585. MixEnthalphy: MixEnthalpySource[i].MixEnthalphy
  586. });
  587. }
  588. }
  589. GetVolumeDataSource(facilitycode, S_VOLUME);
  590. var options = BWA.ChartOptions.EnthalpyControl.getChartControlEnthalpyOptions(QUARTERMIN);
  591. options.dataSource = InOutSupplyEnthalpySource;
  592. chartEnthalpy().option(options);
  593. Indoorenthalpy = false, outdoorenthalpy = false, Supplyenthalpy = false, Mixenthalpy = false;
  594. }
  595. }
  596. });
  597. }
  598. }
  599. });
  600. }
  601. else if (FormulaId == S_TEMP) { //급기 엔탈피
  602. SupplytempdataArray = [], SupplydataArray = [], SupplyhumydataArray = [];
  603. for (var i = 0; i < BemsTemp.length; i++) {
  604. SupplytempdataArray.push({
  605. DateTime: BemsTemp[i].CreatedDateTime,
  606. SupplyTemp: BemsTemp[i].CurrentValue
  607. });
  608. }
  609. var BemsTempFormulaDataSource = new DevExpress.data.DataSource({ // 실내온도 가져오기
  610. store: {
  611. type: "odata",
  612. url: endpointSelector + "/BemsFormulaParameter"
  613. },
  614. requireTotalCount: true,
  615. pageSize: 5
  616. });
  617. BemsTempFormulaDataSource.filter([
  618. eq('SiteId', SiteId),
  619. 'and',
  620. eq('FacilityCode', FacilityCode),
  621. 'and',
  622. eq('FormulaId', FormulaId2)
  623. ]);
  624. BemsTempFormulaDataSource.load()
  625. .done(function (BemsFormula) {
  626. if (BemsFormula.length != 0) {
  627. if (BemsFormula.length == 1) {
  628. var ParameterFacilityCode = BemsFormula[0].ParameterFacilityCode;
  629. var parameterpropertyId = BemsFormula[0].ParameterPropertyId;
  630. var BemsTempDataSource = new DevExpress.data.DataSource({
  631. store: {
  632. type: "odata",
  633. url: endpointSelector + "/BemsMonitoringPointHistory15min"
  634. },
  635. requireTotalCount: true,
  636. pageSize: 1440
  637. });
  638. BemsTempDataSource.filter([
  639. ['CreatedDateTime', ">=", new Date(searchday.getFullYear(), searchday.getMonth(), searchday.getDate(), 0, 0, 0)],
  640. 'and',
  641. ['CreatedDateTime', "<", new Date(searchday.getFullYear(), searchday.getMonth(), searchday.getDate() + 1, 0, 0, 0)],
  642. 'and',
  643. ['SiteId', "=", SiteId],
  644. 'and',
  645. ['FacilityCode', "=", ParameterFacilityCode],
  646. 'and',
  647. ['PropertyId', "=", parameterpropertyId]
  648. ]);
  649. BemsTempDataSource.sort({ getter: "CreatedDateTime", desc: true });
  650. BemsTempDataSource.load()
  651. .done(function (BemsTemp) {
  652. if (BemsTemp.length != 0) {
  653. for (var i = 0; i < BemsTemp.length; i++) {
  654. SupplyhumydataArray.push({
  655. DateTime: BemsTemp[i].CreatedDateTime,
  656. SupplyHumy: BemsTemp[i].CurrentValue
  657. });
  658. }
  659. var array_length_size = Math.max(SupplytempdataArray.length, SupplyhumydataArray.length);
  660. if (SupplytempdataArray.length == SupplyhumydataArray.length) {
  661. for (var i = 0; i < array_length_size; i++) {
  662. SupplydataArray.push(
  663. {
  664. DateTime: SupplytempdataArray[i].DateTime,
  665. SupplyTemp: SupplytempdataArray[i].SupplyTemp,
  666. SupplyHumy: SupplyhumydataArray[i].SupplyHumy,
  667. SupplyEnthalpy: Enthalphy_Function(SupplytempdataArray[i].SupplyTemp, SupplyhumydataArray[i].SupplyHumy, Altitude)
  668. });
  669. }
  670. Supplyenthalpy = true;
  671. }
  672. if (Indoorenthalpy && outdoorenthalpy && Supplyenthalpy && Mixenthalpy) {
  673. InOutSupplyEnthalpySource = [];
  674. var enthalpy_length_size = Math.max(IndoordataArray.length, outdoordataArray.length, SupplydataArray.length, MixEnthalpySource.length);
  675. if (IndoordataArray.length == outdoordataArray.length && outdoordataArray.length == SupplydataArray.length && SupplydataArray.length == MixEnthalpySource.length) {
  676. for (var i = 0; i < enthalpy_length_size; i++) {
  677. InOutSupplyEnthalpySource.push(
  678. {
  679. DateTime: Mixenthalpy[i].DateTime,
  680. IndoorEnthalpy: IndoordataArray[i].IndoorEnthalpy,
  681. outdoorEnthalpy: outdoordataArray[i].outdoorEnthalpy,
  682. SupplyEnthalpy: SupplydataArray[i].SupplyEnthalpy,
  683. MixEnthalphy: MixEnthalpySource[i].MixEnthalphy
  684. });
  685. }
  686. }
  687. GetVolumeDataSource(facilitycode, S_VOLUME);
  688. var options = BWA.ChartOptions.EnthalpyControl.getChartControlEnthalpyOptions(QUARTERMIN);
  689. options.dataSource = InOutSupplyEnthalpySource;
  690. chartEnthalpy().option(options);
  691. Indoorenthalpy = false, outdoorenthalpy = false, Supplyenthalpy = false, Mixenthalpy = false;
  692. }
  693. }
  694. });
  695. }
  696. }
  697. });
  698. }
  699. }
  700. else {
  701. utils.toast.show("[BemsMonitoringPointHistory15min] 정보가 없습니다.");
  702. }
  703. });
  704. }
  705. }
  706. else {
  707. utils.toast.show("[BemsFormulaParameter] 실내외 정보가 없습니다.");
  708. }
  709. });
  710. }
  711. function GetVolumeDataSource(FacilityCode, FormulaId) { // 설비 개수만큼 추가
  712. var BemsTempFormulaDataSource = new DevExpress.data.DataSource({ // 실내온도 가져오기
  713. store: {
  714. type: "odata",
  715. url: endpointSelector + "/BemsFormula"
  716. },
  717. requireTotalCount: true,
  718. pageSize: 5
  719. });
  720. BemsTempFormulaDataSource.filter([
  721. eq('SiteId', SiteId),
  722. 'and',
  723. eq('FacilityCode', FacilityCode),
  724. 'and',
  725. eq('FormulaId', FormulaId)
  726. ]);
  727. BemsTempFormulaDataSource.load()
  728. .done(function (BemsFormula) {
  729. if (BemsFormula.length != 0) {
  730. if (BemsFormula[0].Formula.length == 1) {
  731. var BemsTempFormulaDataSource = new DevExpress.data.DataSource({ // 실내온도 가져오기
  732. store: {
  733. type: "odata",
  734. url: endpointSelector + "/BemsFormulaParameter"
  735. },
  736. requireTotalCount: true,
  737. pageSize: 5
  738. });
  739. BemsTempFormulaDataSource.filter([
  740. eq('SiteId', SiteId),
  741. 'and',
  742. eq('FacilityCode', FacilityCode),
  743. 'and',
  744. eq('FormulaId', FormulaId)
  745. ]);
  746. BemsTempFormulaDataSource.load()
  747. .done(function (BemsFormula) {
  748. if (BemsFormula.length != 0) {
  749. if (BemsFormula.length == 1) {
  750. var ParameterFacilityCode = BemsFormula[0].ParameterFacilityCode;
  751. var parameterpropertyId = BemsFormula[0].ParameterPropertyId;
  752. var BemsTempDataSource = new DevExpress.data.DataSource({
  753. store: {
  754. type: "odata",
  755. url: endpointSelector + "/BemsMonitoringPointHistory15min"
  756. },
  757. requireTotalCount: true,
  758. pageSize: 1440
  759. });
  760. BemsTempDataSource.filter([
  761. ['CreatedDateTime', ">=", new Date(searchday.getFullYear(), searchday.getMonth(), searchday.getDate(), 0, 0, 0)],
  762. 'and',
  763. ['CreatedDateTime', "<", new Date(searchday.getFullYear(), searchday.getMonth(), searchday.getDate() + 1, 0, 0, 0)],
  764. 'and',
  765. ['SiteId', "=", SiteId],
  766. 'and',
  767. ['FacilityCode', "=", ParameterFacilityCode],
  768. 'and',
  769. ['PropertyId', "=", parameterpropertyId]
  770. ]);
  771. BemsTempDataSource.sort({ getter: "CreatedDateTime", desc: true });
  772. BemsTempDataSource.load()
  773. .done(function (BemsTemp) {
  774. if (BemsTemp.length != 0) {
  775. if (FormulaId == S_VOLUME) {
  776. SupplyVolumedataArray = [], CoilSource = [];
  777. for (var i = 0; i < BemsTemp.length; i++) {
  778. SupplyVolumedataArray.push({
  779. DateTime: BemsTemp[i].CreatedDateTime,
  780. S_VOLUME: BemsTemp[i].CurrentValue
  781. });
  782. }
  783. var enthalpy_length_size = Math.max(SupplyVolumedataArray.length, InOutSupplyEnthalpySource.length);
  784. if (SupplyVolumedataArray.length == InOutSupplyEnthalpySource.length) {
  785. for (var i = 0; i < enthalpy_length_size; i++) {
  786. CoilSource.push(
  787. {
  788. DateTime: SupplyVolumedataArray[i].DateTime,
  789. OutCoil: ((InOutSupplyEnthalpySource[i].outdoorEnthalpy - InOutSupplyEnthalpySource[i].SupplyEnthalpy) / 4.2) * SupplyVolumedataArray[i].S_VOLUME * 1.2,
  790. InCoil: ((InOutSupplyEnthalpySource[i].IndoorEnthalpy - InOutSupplyEnthalpySource[i].SupplyEnthalpy) / 4.2) * SupplyVolumedataArray[i].S_VOLUME * 1.2,
  791. Coil: ((InOutSupplyEnthalpySource[i].MixEnthalphy - InOutSupplyEnthalpySource[i].SupplyEnthalpy) / 4.2) * SupplyVolumedataArray[i].S_VOLUME * 1.2
  792. });
  793. }
  794. }
  795. var formula = $Code.Formula[$Code.FacilityType.AIR_HANDLING];
  796. var formulaIds = _.values(formula);
  797. var promises = [];
  798. _.each(formulaIds, function () {
  799. var p = formulaGet.apiGet({
  800. SiteId: SiteId,
  801. FacilityTypeId: AIR_HANDLING,
  802. FacilityCode: facilitycode,
  803. FormulaId: ONOFF,
  804. TimeIntervalType: timeIntervalType,
  805. StartDate: new Date(searchday.getFullYear(), searchday.getMonth(), searchday.getDate(), 0, 0, 0),
  806. EndDate: new Date(searchday.getFullYear(), searchday.getMonth(), searchday.getDate(), 23, 59, 59)
  807. });
  808. promises.push(p);
  809. });
  810. $.when.apply(this, promises)
  811. .done(function (ONOFF) {
  812. ONOFF = ONOFF[0];//가동시간
  813. var dataArray_Temp = [];
  814. var dataArray_temp1 = [];
  815. var dataArray_Temp2 = [];
  816. var dataArray_Final = [];
  817. _.each(ONOFF, function (x) {
  818. dataArray_Temp.push({
  819. DateTime: new Date(x.DateTime),// BWA.Chart.getCustermTimeArgumentAxisString(QUARTERMIN, moment(x.DateTime).toDate())
  820. ONOFF: x.Value
  821. });
  822. });
  823. for (var i = 0; i < dataArray_Temp.length; i++) {
  824. if (dataArray_Temp[i].DateTime <= new Date()) {
  825. dataArray_Temp2.push({
  826. DateTime: dataArray_Temp[i].DateTime,
  827. ONOFF: dataArray_Temp[i].ONOFF
  828. });
  829. }
  830. }
  831. var array_length_size = Math.max(dataArray_Temp2.length, CoilSource.length);
  832. if (dataArray_Temp2.length == CoilSource.length) {
  833. for (var i = 0; i < array_length_size; i++) {
  834. dataArray_temp1.push(
  835. {
  836. DateTime: CoilSource[i].DateTime,
  837. OutCoil: CoilSource[i].OutCoil,
  838. InCoil: CoilSource[i].InCoil,
  839. Coil: CoilSource[i].Coil,
  840. ONOFF: dataArray_Temp2[i].ONOFF
  841. });
  842. }
  843. for (var i = 0; i < dataArray_temp1.length; i++) {
  844. if (dataArray_temp1[i].ONOFF) {
  845. var tempoutcoil = 0;
  846. var tempincoil = 0;
  847. var tempcoil = 0;
  848. if (dataArray_temp1[i].OutCoil > 0) {
  849. tempoutcoil = dataArray_temp1[i].OutCoil / 2300;
  850. }
  851. else {
  852. tempoutcoil = 0;
  853. }
  854. if (dataArray_temp1[i].InCoil > 0) {
  855. tempincoil = dataArray_temp1[i].InCoil / 2300;
  856. }
  857. else {
  858. tempincoil = 0;
  859. }
  860. if (dataArray_temp1[i].Coil > 0) {
  861. tempcoil = dataArray_temp1[i].Coil / 2300
  862. }
  863. else {
  864. tempcoil = 0;
  865. }
  866. dataArray_Final.push(
  867. {
  868. DateTime: dataArray_temp1[i].DateTime,
  869. OutCoil: tempoutcoil,
  870. InCoil: tempincoil,
  871. Coil: tempcoil,
  872. });
  873. }
  874. else {
  875. dataArray_Final.push(
  876. {
  877. DateTime: dataArray_temp1[i].DateTime,
  878. OutCoil: 0,
  879. InCoil: 0,
  880. Coil: 0,
  881. });
  882. }
  883. }
  884. }
  885. var options = BWA.ChartOptions.EnthalpyControl.getChartCoilLoadOptions(QUARTERMIN);
  886. options.dataSource = dataArray_Final;
  887. chartCoilLoad().option(options);
  888. var coilreduction = 0, coilfuture = 0, coilnow = 0;
  889. for (var i = 0; i < dataArray_Final.length; i++) {
  890. if (dataArray_Final[i].OutCoil >= dataArray_Final[i].InCoil) {
  891. coilfuture += dataArray_Final[i].OutCoil;
  892. }
  893. else {
  894. coilfuture += dataArray_Final[i].InCoil;
  895. }
  896. coilnow += dataArray_Final[i].Coil;
  897. }
  898. if (coilfuture == 0) {
  899. coilreduction = 0;
  900. }
  901. else {
  902. coilreduction = 100 - ((coilnow / coilfuture) * 100);
  903. }
  904. $("#coilfuture").dxTextBox("instance").option('value', coilfuture.toFixed(2) + "Kwh");
  905. $("#coilnow").dxTextBox("instance").option('value', coilnow.toFixed(2) + "Kwh");
  906. $("#coilreduction").dxTextBox("instance").option('value', coilreduction.toFixed(2) + "%");
  907. })
  908. .fail(function (error) {
  909. utils.toast.show("[BemsMonitoringPointHistory15min] 데이터조회를 실패하였습니다.");
  910. });
  911. }
  912. }
  913. else {
  914. utils.toast.show("[BemsMonitoringPointHistory15min] 정보가 없습니다.");
  915. }
  916. });
  917. }
  918. }
  919. else {
  920. utils.toast.show("[BemsFormulaParameter] 실내외 정보가 없습니다.");
  921. }
  922. });
  923. }
  924. else {
  925. var num = parseFloat(BemsFormula[0].Formula.replace(/[a-z,*, ]/gi, ""));
  926. var formula = BemsFormula[0].Formula.replace(/[0-9,*, ]/gi, "");
  927. var BemsTempFormulaDataSource = new DevExpress.data.DataSource({ // 실내온도 가져오기
  928. store: {
  929. type: "odata",
  930. url: endpointSelector + "/BemsFormulaParameter"
  931. },
  932. requireTotalCount: true,
  933. pageSize: 5
  934. });
  935. BemsTempFormulaDataSource.filter([
  936. eq('SiteId', SiteId),
  937. 'and',
  938. eq('FacilityCode', FacilityCode),
  939. 'and',
  940. eq('ParameterId', formula),
  941. 'and',
  942. eq('FormulaId', FormulaId)
  943. ]);
  944. BemsTempFormulaDataSource.load()
  945. .done(function (BemsFormula) {
  946. if (BemsFormula.length != 0) {
  947. if (BemsFormula.length == 1) {
  948. var ParameterFacilityCode = BemsFormula[0].ParameterFacilityCode;
  949. var parameterpropertyId = BemsFormula[0].ParameterPropertyId;
  950. var BemsTempDataSource = new DevExpress.data.DataSource({
  951. store: {
  952. type: "odata",
  953. url: endpointSelector + "/BemsMonitoringPointHistory15min"
  954. },
  955. requireTotalCount: true,
  956. pageSize: 1440
  957. });
  958. BemsTempDataSource.filter([
  959. ['CreatedDateTime', ">=", new Date(searchday.getFullYear(), searchday.getMonth(), searchday.getDate(), 0, 0, 0)],
  960. 'and',
  961. ['CreatedDateTime', "<", new Date(searchday.getFullYear(), searchday.getMonth(), searchday.getDate() + 1, 0, 0, 0)],
  962. 'and',
  963. ['SiteId', "=", SiteId],
  964. 'and',
  965. ['FacilityCode', "=", ParameterFacilityCode],
  966. 'and',
  967. ['PropertyId', "=", parameterpropertyId]
  968. ]);
  969. BemsTempDataSource.sort({ getter: "CreatedDateTime", desc: true });
  970. BemsTempDataSource.load()
  971. .done(function (BemsTemp) {
  972. if (BemsTemp.length != 0) {
  973. if (FormulaId == S_VOLUME) {
  974. SupplyVolumedataArray = [], CoilSource = [];
  975. var dataArray_Final = [];
  976. for (var i = 0; i < BemsTemp.length; i++) {
  977. SupplyVolumedataArray.push({
  978. DateTime: BemsTemp[i].CreatedDateTime,
  979. S_VOLUME: BemsTemp[i].CurrentValue * num
  980. });
  981. }
  982. var enthalpy_length_size = Math.max(SupplyVolumedataArray.length, InOutSupplyEnthalpySource.length);
  983. if (SupplyVolumedataArray.length == InOutSupplyEnthalpySource.length) {
  984. for (var i = 0; i < enthalpy_length_size; i++) {
  985. CoilSource.push(
  986. {
  987. DateTime: SupplyVolumedataArray[i].DateTime,
  988. OutCoil: (((InOutSupplyEnthalpySource[i].outdoorEnthalpy - InOutSupplyEnthalpySource[i].SupplyEnthalpy) / 4.2) * SupplyVolumedataArray[i].S_VOLUME * 1.2) / 2300,
  989. InCoil: (((InOutSupplyEnthalpySource[i].IndoorEnthalpy - InOutSupplyEnthalpySource[i].SupplyEnthalpy) / 4.2) * SupplyVolumedataArray[i].S_VOLUME * 1.2) / 2300,
  990. Coil: (((InOutSupplyEnthalpySource[i].MixEnthalphy - InOutSupplyEnthalpySource[i].SupplyEnthalpy) / 4.2) * SupplyVolumedataArray[i].S_VOLUME * 1.2) / 2300
  991. });
  992. }
  993. for (var i = 0; i < CoilSource.length; i++) {
  994. var tempoutcoil = 0;
  995. var tempincoil = 0;
  996. var tempcoil = 0;
  997. if (CoilSource[i].OutCoil > 0) {
  998. tempoutcoil = CoilSource[i].OutCoil / 2300;
  999. }
  1000. else {
  1001. tempoutcoil = 0;
  1002. }
  1003. if (CoilSource[i].InCoil > 0) {
  1004. tempincoil = CoilSource[i].InCoil / 2300;
  1005. }
  1006. else {
  1007. tempincoil = 0;
  1008. }
  1009. if (CoilSource[i].Coil > 0) {
  1010. tempcoil = CoilSource[i].Coil / 2300
  1011. }
  1012. else {
  1013. tempcoil = 0;
  1014. }
  1015. dataArray_Final.push(
  1016. {
  1017. DateTime: CoilSource[i].DateTime,
  1018. OutCoil: tempoutcoil,
  1019. InCoil: tempincoil,
  1020. Coil: tempcoil,
  1021. });
  1022. }
  1023. var options = BWA.ChartOptions.EnthalpyControl.getChartCoilLoadOptions(QUARTERMIN);
  1024. options.dataSource = dataArray_Final;
  1025. chartCoilLoad().option(options);
  1026. var coilreduction = 0, coilfuture = 0, coilnow = 0;
  1027. for (var i = 0; i < dataArray_Final.length; i++) {
  1028. if (dataArray_Final[i].OutCoil >= dataArray_Final[i].InCoil) {
  1029. coilfuture += dataArray_Final[i].OutCoil;
  1030. }
  1031. else {
  1032. coilfuture += dataArray_Final[i].InCoil;
  1033. }
  1034. coilnow += dataArray_Final[i].Coil;
  1035. }
  1036. if (coilfuture == 0) {
  1037. coilreduction = 0;
  1038. }
  1039. else {
  1040. coilreduction = 100 - ((coilnow / coilfuture) * 100);
  1041. }
  1042. $("#coilfuture").dxTextBox("instance").option('value', coilfuture.toFixed(2) + "Kwh");
  1043. $("#coilnow").dxTextBox("instance").option('value', coilnow.toFixed(2) + "Kwh");
  1044. $("#coilreduction").dxTextBox("instance").option('value', coilreduction.toFixed(2) + "%");
  1045. }
  1046. }
  1047. }
  1048. else {
  1049. utils.toast.show("[BemsMonitoringPointHistory15min] 정보가 없습니다.");
  1050. }
  1051. });
  1052. }
  1053. }
  1054. else {
  1055. utils.toast.show("[BemsFormulaParameter] 실내외 정보가 없습니다.");
  1056. }
  1057. });
  1058. }
  1059. }
  1060. else {
  1061. utils.toast.show("[BemsFormulaParameter] 실내외 정보가 없습니다.");
  1062. }
  1063. });
  1064. }
  1065. function GetOutDataSource() { // 온도, 습도
  1066. var BemsTempFormulaDataSource = new DevExpress.data.DataSource({ // 실내온도 가져오기
  1067. store: {
  1068. type: "odata",
  1069. url: endpointSelector + "/BemsFormulaParameter"
  1070. },
  1071. requireTotalCount: true,
  1072. pageSize: 5
  1073. });
  1074. BemsTempFormulaDataSource.filter([
  1075. eq('SiteId', SiteId),
  1076. 'and',
  1077. eq('FacilityTypeId', OUTDOOR),
  1078. 'and',
  1079. eq('FormulaId', OUT_TEMPERATURE)
  1080. ]);
  1081. BemsTempFormulaDataSource.load()
  1082. .done(function (BemsFormula) {
  1083. if (BemsFormula.length != 0) {
  1084. if (BemsFormula.length == 1) {
  1085. var parameterpropertyId = BemsFormula[0].ParameterPropertyId;
  1086. var FacilityCode = BemsFormula[0].ParameterFacilityCode;
  1087. var BemsTempDataSource = new DevExpress.data.DataSource({
  1088. store: {
  1089. type: "odata",
  1090. url: endpointSelector + "/BemsMonitoringPointHistory15min"
  1091. },
  1092. requireTotalCount: true,
  1093. pageSize: 1440
  1094. });
  1095. BemsTempDataSource.filter([
  1096. ['CreatedDateTime', ">=", new Date(searchday.getFullYear(), searchday.getMonth(), searchday.getDate(), 0, 0, 0)],
  1097. 'and',
  1098. ['CreatedDateTime', "<", new Date(searchday.getFullYear(), searchday.getMonth(), searchday.getDate() + 1, 0, 0, 0)],
  1099. 'and',
  1100. ['SiteId', "=", SiteId],
  1101. 'and',
  1102. ['FacilityCode', "=", FacilityCode],
  1103. 'and',
  1104. ['PropertyId', "=", parameterpropertyId]
  1105. ]);
  1106. BemsTempDataSource.sort({ getter: "CreatedDateTime", desc: true });
  1107. BemsTempDataSource.load()
  1108. .done(function (BemsTemp) {
  1109. if (BemsTemp.length != 0) {
  1110. var Temp = BemsTemp[0].CurrentValue;
  1111. outdoortempdataArray = [], outdoorhumydataArray = [], outdoordataArray = [];;
  1112. outdoortemp = true;
  1113. $("#outdoor_temp").dxTextBox("instance").option('value', Temp.toFixed(2) + "℃");
  1114. for (var i = 0; i < BemsTemp.length; i++) {
  1115. outdoortempdataArray.push({
  1116. DateTime: BemsTemp[i].CreatedDateTime,
  1117. outdoorTemp: BemsTemp[i].CurrentValue
  1118. });
  1119. }
  1120. var BemsTempFormulaDataSource = new DevExpress.data.DataSource({ // 실내온도 가져오기
  1121. store: {
  1122. type: "odata",
  1123. url: endpointSelector + "/BemsFormulaParameter"
  1124. },
  1125. requireTotalCount: true,
  1126. pageSize: 5
  1127. });
  1128. BemsTempFormulaDataSource.filter([
  1129. eq('SiteId', SiteId),
  1130. 'and',
  1131. eq('FacilityTypeId', OUTDOOR),
  1132. 'and',
  1133. eq('FormulaId', OUT_HUMIDITY)
  1134. ]);
  1135. BemsTempFormulaDataSource.load()
  1136. .done(function (BemsFormula) {
  1137. if (BemsFormula.length != 0) {
  1138. if (BemsFormula.length == 1) {
  1139. var parameterpropertyId = BemsFormula[0].ParameterPropertyId;
  1140. var FacilityCode = BemsFormula[0].ParameterFacilityCode;
  1141. var BemsTempDataSource = new DevExpress.data.DataSource({
  1142. store: {
  1143. type: "odata",
  1144. url: endpointSelector + "/BemsMonitoringPointHistory15min"
  1145. },
  1146. requireTotalCount: true,
  1147. pageSize: 1440
  1148. });
  1149. BemsTempDataSource.filter([
  1150. ['CreatedDateTime', ">=", new Date(searchday.getFullYear(), searchday.getMonth(), searchday.getDate(), 0, 0, 0)],
  1151. 'and',
  1152. ['CreatedDateTime', "<", new Date(searchday.getFullYear(), searchday.getMonth(), searchday.getDate() + 1, 0, 0, 0)],
  1153. 'and',
  1154. ['SiteId', "=", SiteId],
  1155. 'and',
  1156. ['FacilityCode', "=", FacilityCode],
  1157. 'and',
  1158. ['PropertyId', "=", parameterpropertyId]
  1159. ]);
  1160. BemsTempDataSource.sort({ getter: "CreatedDateTime", desc: true });
  1161. BemsTempDataSource.load()
  1162. .done(function (BemsTemp) {
  1163. if (BemsTemp.length != 0) {
  1164. var Temp = BemsTemp[0].CurrentValue;
  1165. $("#outdoor_humy").dxTextBox("instance").option('value', Temp.toFixed(2) + "%");
  1166. for (var i = 0; i < BemsTemp.length; i++) {
  1167. outdoorhumydataArray.push({
  1168. DateTime: BemsTemp[i].CreatedDateTime,
  1169. outdoorHumy: BemsTemp[i].CurrentValue
  1170. });
  1171. }
  1172. var array_length_size = Math.max(outdoortempdataArray.length, outdoorhumydataArray.length);
  1173. if (outdoortempdataArray.length == outdoorhumydataArray.length) {
  1174. for (var i = 0; i < array_length_size; i++) {
  1175. outdoordataArray.push(
  1176. {
  1177. DateTime: outdoortempdataArray[i].DateTime,
  1178. outdoorTemp: outdoortempdataArray[i].outdoorTemp,
  1179. outdoorHumy: outdoorhumydataArray[i].outdoorHumy,
  1180. outdoorEnthalpy: Enthalphy_Function(outdoortempdataArray[i].outdoorTemp, outdoorhumydataArray[i].outdoorHumy, Altitude)
  1181. });
  1182. }
  1183. outdoorenthalpy = true;
  1184. OutdoorOn = true;
  1185. if (IndoorOn && OutdoorOn) {
  1186. GetMixEnthalpyDataSource(facilitycode);
  1187. }
  1188. }
  1189. if (Indoorenthalpy && outdoorenthalpy && Supplyenthalpy && Mixenthalpy) {
  1190. InOutSupplyEnthalpySource = [];
  1191. var enthalpy_length_size = Math.max(IndoordataArray.length, outdoordataArray.length, SupplydataArray.length, MixEnthalpySource.length);
  1192. if (IndoordataArray.length == outdoordataArray.length && outdoordataArray.length == SupplydataArray.length && SupplydataArray.length == MixEnthalpySource.length) {
  1193. for (var i = 0; i < enthalpy_length_size; i++) {
  1194. InOutSupplyEnthalpySource.push(
  1195. {
  1196. DateTime: MixEnthalpySource[i].DateTime,
  1197. IndoorEnthalpy: IndoordataArray[i].IndoorEnthalpy,
  1198. outdoorEnthalpy: outdoordataArray[i].outdoorEnthalpy,
  1199. SupplyEnthalpy: SupplydataArray[i].SupplyEnthalpy,
  1200. MixEnthalphy: MixEnthalpySource[i].MixEnthalphy
  1201. });
  1202. }
  1203. }
  1204. GetVolumeDataSource(facilitycode, S_VOLUME);
  1205. var options = BWA.ChartOptions.EnthalpyControl.getChartControlEnthalpyOptions(QUARTERMIN);
  1206. options.dataSource = InOutSupplyEnthalpySource;
  1207. chartEnthalpy().option(options);
  1208. Indoorenthalpy = false, outdoorenthalpy = false, Supplyenthalpy = false, Mixenthalpy = false;
  1209. }
  1210. }
  1211. });
  1212. }
  1213. }
  1214. });
  1215. }
  1216. else {
  1217. utils.toast.show("[BemsMonitoringPointHistory15min] 정보가 없습니다.");
  1218. }
  1219. });
  1220. }
  1221. }
  1222. else {
  1223. utils.toast.show("[BemsFormulaParameter] 실내외 정보가 없습니다.");
  1224. }
  1225. });
  1226. }
  1227. function handleViewShown() {
  1228. if (initialized === false) {
  1229. var chartOption = BWA.ChartOptions.EnthalpyControl;
  1230. chartEnthalpy = chartEnthalpy(chartOption.getChartControlEnthalpyOptions(QUARTERMIN));
  1231. chartCoilLoad = chartCoilLoad(chartOption.getChartCoilLoadOptions(QUARTERMIN));
  1232. initialized = true;
  1233. }
  1234. $("#Enthalpy_onoff").dxSwitch({
  1235. value: false,
  1236. onText: 'On',
  1237. offText: 'Off'
  1238. });
  1239. $("#Enthalpy_control").dxButton({
  1240. text: "제어",
  1241. onClick: function () {
  1242. var Enthalpyonoff = $("#Enthalpy_onoff").dxSwitch("instance").option('value');
  1243. if (Enthalpyonoff)
  1244. Enthalpyonoff = 1;
  1245. else
  1246. Enthalpyonoff = 0;
  1247. var FacilityTypeId = $("#Airconfitioner_select").dxSelectBox("instance").option('value').FacilityTypeId();
  1248. var FacilityCode = $("#Airconfitioner_select").dxSelectBox("instance").option('value').FacilityCode();
  1249. var param = {
  1250. SiteId: SiteId,
  1251. FacilityTypeId: FacilityTypeId,
  1252. FacilityCode: FacilityCode,
  1253. FormulaId: ENTHALPY_ONOFF,
  1254. ControlValue: Enthalpyonoff,
  1255. };
  1256. BWA.api.post('BemsFormula/ControlPoint', null, param).done(function () {
  1257. utils.toast.show('엔탈피제어 완료');
  1258. }).fail(function (error) {
  1259. utils.toast.show('엔탈피 제어를 실패하였습니다.');
  1260. });
  1261. }
  1262. });
  1263. $("#inoutdoor_inform").dxButton({
  1264. text: "차트",
  1265. onClick: function () {
  1266. InOutdoorDataGridPopup_Visible(true);
  1267. }
  1268. });
  1269. $("#etc_inform").dxButton({
  1270. text: "차트",
  1271. onClick: function () {
  1272. EtcDataGridPopup_Visible(true);
  1273. }
  1274. });
  1275. $("#Airconfitioner_date").dxDateBox({
  1276. displayFormat: "yyyy-MM-dd",
  1277. value: today,
  1278. max: today,
  1279. onValueChanged: function (e) {
  1280. if (e.value != null) {
  1281. searchday = e.value;
  1282. facilityname = $("#Airconfitioner_select").dxSelectBox("instance").option('value').Name();
  1283. facilitynickname = $("#Airconfitioner_select").dxSelectBox("instance").option('value').Nickname();
  1284. facilityusage = $("#Airconfitioner_select").dxSelectBox("instance").option('value').FacilityUsage();
  1285. facilitycode = $("#Airconfitioner_select").dxSelectBox("instance").option('value').FacilityCode();
  1286. $("#facilityname").dxTextBox("instance").option('value', facilityname);
  1287. $("#facilitynickname").dxTextBox("instance").option('value', facilitynickname);
  1288. $("#facilityusage").dxTextBox("instance").option('value', facilityusage);
  1289. GetEnthalpyDataSource(facilitycode, F_TEMP, F_HUMY);
  1290. GetEnthalpyDataSource(facilitycode, S_TEMP, S_HUMY);
  1291. GetOutDataSource();
  1292. GetDataSource(facilitycode, CO2);
  1293. GetDataSource(facilitycode, CO);
  1294. GetDataSource(facilitycode, DUST);
  1295. GetDataSource(facilitycode, OZONE);
  1296. }
  1297. }
  1298. });
  1299. $("#Airconfitioner_select").dxSelectBox({
  1300. dataSource: temp_facility_DataSource,
  1301. displayExpr: "Nickname",
  1302. onValueChanged: function (e) {
  1303. if (e.value != null) {
  1304. facilityname = e.value.Name();
  1305. facilitynickname = e.value.Nickname();
  1306. facilityusage = e.value.FacilityUsage();
  1307. facilitycode = e.value.FacilityCode();
  1308. $("#facilityname").dxTextBox("instance").option('value', facilityname);
  1309. $("#facilitynickname").dxTextBox("instance").option('value', facilitynickname);
  1310. $("#facilityusage").dxTextBox("instance").option('value', facilityusage);
  1311. GetEnthalpyDataSource(facilitycode, F_TEMP, F_HUMY);
  1312. GetEnthalpyDataSource(facilitycode, S_TEMP, S_HUMY);
  1313. GetOutDataSource();
  1314. GetDataSource(facilitycode, CO2);
  1315. GetDataSource(facilitycode, CO);
  1316. GetDataSource(facilitycode, DUST);
  1317. GetDataSource(facilitycode, OZONE);
  1318. }
  1319. }
  1320. });
  1321. $("#co").dxTextBox({
  1322. readOnly: true
  1323. });
  1324. $("#co2").dxTextBox({
  1325. readOnly: true
  1326. });
  1327. $("#dust").dxTextBox({
  1328. readOnly: true
  1329. });
  1330. $("#ozone").dxTextBox({
  1331. readOnly: true
  1332. });
  1333. $("#coilfuture").dxTextBox({
  1334. readOnly: true
  1335. });
  1336. $("#coilnow").dxTextBox({
  1337. readOnly: true
  1338. });
  1339. $("#coilreduction").dxTextBox({
  1340. readOnly: true
  1341. });
  1342. $("#outdoor_humy").dxTextBox({
  1343. readOnly: true
  1344. });
  1345. $("#outdoor_temp").dxTextBox({
  1346. readOnly: true
  1347. });
  1348. $("#indoor_humy").dxTextBox({
  1349. readOnly: true
  1350. });
  1351. $("#indoor_temp").dxTextBox({
  1352. readOnly: true
  1353. });
  1354. $("#enthalpy_content").dxTextBox({
  1355. readOnly: true
  1356. });
  1357. $("#facilityname").dxTextBox({
  1358. readOnly: true,
  1359. });
  1360. $("#facilitynickname").dxTextBox({
  1361. readOnly: true,
  1362. });
  1363. $("#facilityusage").dxTextBox({
  1364. readOnly: true,
  1365. });
  1366. }
  1367. function handleViewHidden() {
  1368. var paging = BWA.ChartLayout.Paging;
  1369. paging.sideOverlayVisible(false);
  1370. }
  1371. function handleViewShowing() {
  1372. var facilityDataSource = BWA.db.createDataSource('CmFacility');
  1373. facilityDataSource.filter([
  1374. eq('SiteId', SiteId),
  1375. 'and',
  1376. eq('FacilityTypeId', AIR_HANDLING)
  1377. ]);
  1378. facilityDataSource.load().done(function (facilities) {
  1379. var cnt = 0, k = 0;
  1380. if (facilities.length != 0) {
  1381. for (var i = 0; i < facilities.length; i++) {
  1382. if ((facilities[i].Nickname().substring(0, 3) != "OHU") && (facilities[i].Nickname().substring(0, 3) != "OAU")) {
  1383. cnt++;
  1384. }
  1385. }
  1386. var tempfacilities = new Array(cnt);
  1387. for (var i = 0; i < facilities.length; i++) {
  1388. if ((facilities[i].Nickname().substring(0, 3) != "OHU") && (facilities[i].Nickname().substring(0, 3) != "OAU")) {
  1389. tempfacilities[k] = facilities[i];
  1390. k++;
  1391. }
  1392. }
  1393. if (tempfacilities.length > 1) {
  1394. facilitydataSourceAdd(tempfacilities.length - 1);
  1395. }
  1396. temp_facility_DataSource = tempfacilities;
  1397. $("#Airconfitioner_select").dxSelectBox({
  1398. dataSource: temp_facility_DataSource,
  1399. displayExpr: "Nickname",
  1400. });
  1401. $("#Airconfitioner_select").dxSelectBox("instance").option('value', temp_facility_DataSource[0]);
  1402. }
  1403. else {
  1404. utils.toast.show("[CmFacility] 공조기 정보가 없습니다.");
  1405. }
  1406. });
  1407. }
  1408. function InoutDoorhandlePopupShown() {
  1409. if (inoutdoorinitialized === false) {
  1410. var chartOption = BWA.ChartOptions.EnthalpyControl;
  1411. chartInOut = chartInOut(chartOption.getChartInOutDoorOptions(QUARTERMIN));
  1412. inoutdoorinitialized = true;
  1413. }
  1414. var Array = [];
  1415. var enthalpy_length_size = Math.max(IndoordataArray.length, outdoordataArray.length);
  1416. if (IndoordataArray.length == outdoordataArray.length) {
  1417. for (var i = 0; i < enthalpy_length_size; i++) {
  1418. Array.push(
  1419. {
  1420. DateTime: IndoordataArray[i].DateTime,
  1421. IndoorTemp: IndoortempdataArray[i].IndoorTemp,
  1422. IndoorHumy: IndoorhumydataArray[i].IndoorHumy,
  1423. outdoorTemp: outdoordataArray[i].outdoorTemp,
  1424. outdoorHumy: outdoordataArray[i].outdoorHumy
  1425. });
  1426. }
  1427. var options = BWA.ChartOptions.EnthalpyControl.getChartInOutDoorOptions(QUARTERMIN);
  1428. options.dataSource = Array;
  1429. chartInOut().option(options);
  1430. }
  1431. }
  1432. function EtchandlePopupShown() {
  1433. if (Etcinitialized === false) {
  1434. var chartOption = BWA.ChartOptions.EnthalpyControl;
  1435. chartEtc = chartEtc(chartOption.getChartEtcOptions(QUARTERMIN));
  1436. Etcinitialized = true;
  1437. }
  1438. if (Ozonedata && Dustdata && Codata && Co2data) {
  1439. EtcdataArray = [];
  1440. var array_length_size = Math.max(OzonedataArray.length, DustdataArray.length, CodataArray.length, Co2dataArray.length);
  1441. if (OzonedataArray.length == DustdataArray.length && CodataArray.length == Co2dataArray.length && DustdataArray.length == CodataArray.length) {
  1442. for (var i = 0; i < array_length_size; i++) {
  1443. EtcdataArray.push(
  1444. {
  1445. DateTime: OzonedataArray[i].DateTime,
  1446. Ozone: OzonedataArray[i].Ozone,
  1447. Dust: DustdataArray[i].Dust,
  1448. Co: CodataArray[i].Co,
  1449. Co2: Co2dataArray[i].Co2
  1450. });
  1451. }
  1452. }
  1453. Ozonedata = false, Dustdata = false, Codata = false, Co2data = false;
  1454. var options = BWA.ChartOptions.EnthalpyControl.getChartEtcOptions(QUARTERMIN);
  1455. options.dataSource = EtcdataArray;
  1456. chartEtc().option(options);
  1457. }
  1458. }
  1459. function handleSearchInSearchView(filter, searchViewItems) {
  1460. }
  1461. var searchViewOptions = {
  1462. }
  1463. var viewModel = $.extend(BWA.CommonView.create(params, viewInfo, searchViewOptions, ko.observable(null), handleViewShown, null, handleSearchInSearchView, undefined, chartLayout), {
  1464. viewHidden: handleViewHidden,
  1465. viewShowing: handleViewShowing,
  1466. onHidden: function () {
  1467. },
  1468. });
  1469. viewModel.InoutDoorDataGridPopupOptions = {
  1470. width: '1000px',
  1471. height: '550px',
  1472. contentTemplate: "content",
  1473. showTitle: true,
  1474. title: "차트",
  1475. visible: InOutdoorDataGridPopup_Visible,
  1476. dragEnabled: true,
  1477. closeOnOutsideClick: true,
  1478. shownAction: InoutDoorhandlePopupShown,
  1479. animation: window.utils.popup.createAnimation()
  1480. };
  1481. viewModel.EtcDataGridPopupOptions = {
  1482. width: '1000px',
  1483. height: '550px',
  1484. contentTemplate: "content",
  1485. showTitle: true,
  1486. title: "차트",
  1487. visible: EtcDataGridPopup_Visible,
  1488. dragEnabled: true,
  1489. closeOnOutsideClick: true,
  1490. shownAction: EtchandlePopupShown,
  1491. animation: window.utils.popup.createAnimation()
  1492. };
  1493. viewModel.currentTabIndex = currentTabIndex;
  1494. return viewModel;
  1495. };