Changeset 11834 for trunk/FACT++/src/fscctrl.cc
- Timestamp:
- 08/07/11 17:47:34 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/src/fscctrl.cc
r11673 r11834 84 84 double GetTempPT1000(double R) const 85 85 { 86 const double R0 = 1000; // 1 KOhm86 const double R0 = 1000; // 1kOhm 87 87 88 88 const double a = 3.85e-3; … … 242 242 } 243 243 244 int mapv[] = 245 { 246 0, 24, 16, 8, 247 1, 25, 17, 9, 248 2, 26, 18, 10, 249 // 250 3, 27, 19, 11, 251 4, 28, 20, 12, 252 5, 29, 21, 13, 253 // 254 32, 36, 33, 34, 37, 38, 255 // 256 -1 257 }; 258 259 260 int mapc[] = 261 { 262 40, 64, 56, 48, 263 41, 65, 57, 49, 264 42, 66, 58, 50, 265 // 266 43, 67, 59, 51, 267 44, 68, 60, 52, 268 45, 69, 61, 53, 269 // 270 72, 76, 73, 74, 77, 78, 271 // 272 -1 273 }; 274 275 276 int maprh[] = 277 { 278 80, 81, 82, 83, -1 279 }; 280 281 int offrh[] = 282 { 283 821, 822, 816, 822, 284 }; 285 286 int mapt[] = 287 { 288 0, 1, 2, 3, 4, 5, 6, 56, 57, 58, 59, 60, 289 61, 62, 32, 33, 34, 35, 36, 63, 37, 38, 39, 24, 290 25, 26, 27, 28, 29, 30, 31, 291 // 292 8, 9, 48, 49, 40, 41, 16, 17, 293 // 294 10, 11, 50, 51, 42, 43, 18, 19, 12, 52, 20, 44, 295 // 296 13, 21, 45, 53, 297 // 298 14, 15, 46, 47, 299 // 300 -1 301 }; 302 303 vector<float> voltages; 304 vector<float> currents; 305 vector<float> humidities; 306 vector<float> temperatures; 307 308 for (int *pv=mapv; *pv>0; pv++) 309 voltages.push_back(volt[*pv]); 310 311 for (int *pc=mapc; *pc>0; pc++) 312 currents.push_back(volt[*pc]*5); 313 314 for (int idx=0; idx<4; idx++) 315 { 316 voltages[idx +8] *= -1; 317 voltages[idx+20] *= -1; 318 currents[idx +8] *= -1; 319 currents[idx+20] *= -1; 320 } 321 voltages[27] *= -1; 322 voltages[29] *= -1; 323 currents[27] *= -1; 324 currents[29] *= -1; 325 326 int idx=0; 327 for (int *ph=maprh; *ph>0; ph++, idx++) 328 humidities.push_back((volt[*ph]-offrh[idx])*0.0313); 329 330 for (int *pt=mapt; *pt>0; pt++) 331 temperatures.push_back(resist[*pt]>800&&resist[*pt]<2000 ? GetTempPT1000(resist[*pt]) : 0); 332 333 // 0 = 3-(3+0)%4 334 // 3 = 3-(3+1)%4 335 // 2 = 3-(3+2)%4 336 // 1 = 3-(3+3)%4 337 338 /* 339 index unit offset scale crate for board: 340 0 mV 0 1 0 FAD 341 24 mV 0 1 1 FAD 342 16 mV 0 1 2 FAD 343 8 mV 0 1 3 FAD 344 345 1 mV 0 1 0 FAD 346 25 mV 0 1 1 FAD 347 17 mV 0 1 2 FAD 348 9 mV 0 1 3 FAD 349 350 2 mV 0 -1 0 FAD 351 26 mV 0 -1 1 FAD 352 18 mV 0 -1 2 FAD 353 10 mV 0 -1 3 FAD 354 355 -- 356 357 3 mV 0 1 0 FPA 358 27 mV 0 1 1 FPA 359 19 mV 0 1 2 FPA 360 11 mV 0 1 3 FPA 361 362 4 mV 0 1 0 FPA 363 28 mV 0 1 1 FPA 364 20 mV 0 1 2 FPA 365 12 mV 0 1 3 FPA 366 367 5 mV 0 -1 0 FPA 368 29 mV 0 -1 1 FPA 369 21 mV 0 -1 2 FPA 370 13 mV 0 -1 3 FPA 371 372 -- 373 374 32 mV 0 1 bottom ETH 375 36 mV 0 1 top ETH 376 377 33 mV 0 1 bottom FTM 378 34 mV 0 -1 bottom FTM 379 380 37 mV 0 1 top FFC 381 38 mV 0 -1 top FLP 382 383 ----- 384 385 40 mA 0 5 0 FAD 386 64 mA 0 5 1 FAD 387 56 mA 0 5 2 FAD 388 48 mA 0 5 3 FAD 389 390 41 mA 0 5 0 FAD 391 65 mA 0 5 1 FAD 392 57 mA 0 5 2 FAD 393 49 mA 0 5 3 FAD 394 395 42 mA 0 -5 0 FAD 396 66 mA 0 -5 1 FAD 397 58 mA 0 -5 2 FAD 398 50 mA 0 -5 3 FAD 399 400 -- 401 402 43 mA 0 5 0 FPA 403 67 mA 0 5 1 FPA 404 59 mA 0 5 2 FPA 405 51 mA 0 5 3 FPA 406 407 44 mA 0 5 0 FPA 408 68 mA 0 5 1 FPA 409 60 mA 0 5 2 FPA 410 52 mA 0 5 3 FPA 411 412 45 mA 0 -5 0 FPA 413 69 mA 0 -5 1 FPA 414 61 mA 0 -5 2 FPA 415 53 mA 0 -5 3 FPA 416 417 --- 418 419 72 mA 0 5 bottom ETH 420 76 mA 0 5 top ETH 421 422 73 mA 0 5 bottom FTM 423 74 mA 0 -5 bottom FTM 424 425 77 mA 0 5 top FFC 426 78 mA 0 -5 top FLP 427 428 ---- 429 430 80 % RH -821 0.0313 FSP000 431 81 % RH -822 0.0313 FSP221 432 82 % RH -816 0.0313 Sector0 433 83 % RH -822 0.0313 Sector2 434 */ 435 436 // TEMPERATURES 437 // 31 x Sensor plate 438 // 8 x Crate 439 // 12 x PS 440 // 4 x Backpanel 441 // 4 x Switchbox 442 443 444 445 /* 446 0 ohms FSP 000 447 1 ohms FSP 010 448 2 ohms FSP 023 449 3 ohms FSP 043 450 4 ohms FSP 072 451 5 ohms FSP 080 452 6 ohms FSP 092 453 56 ohms FSP 103 454 57 ohms FSP 111 455 58 ohms FSP 121 456 59 ohms FSP 152 457 60 ohms FSP 163 458 61 ohms FSP 171 459 62 ohms FSP 192 460 32 ohms FSP 200 461 33 ohms FSP 210 462 34 ohms FSP 223 463 35 ohms FSP 233 464 36 ohms FSP 243 465 63 ohms FSP 252 466 37 ohms FSP 280 467 38 ohms FSP 283 468 39 ohms FSP 293 469 24 ohms FSP 311 470 25 ohms FSP 321 471 26 ohms FSP 343 472 27 ohms FSP 352 473 28 ohms FSP 363 474 29 ohms FSP 371 475 30 ohms FSP 381 476 31 ohms FSP 392 477 8 ohms Crate0 ? 478 9 ohms Crate0 ? 479 48 ohms Crate1 ? 480 49 ohms Crate1 ? 481 40 ohms Crate2 ? 482 41 ohms Crate2 ? 483 16 ohms Crate3 ? 484 17 ohms Crate3 ? 485 10 ohms PS Crate 0 486 11 ohms PS Crate 0 487 50 ohms PS Crate 1 488 51 ohms PS Crate 1 489 42 ohms PS Crate 2 490 43 ohms PS Crate 2 491 18 ohms PS Crate 3 492 19 ohms PS Crate 3 493 12 ohms PS Aux0 494 52 ohms PS Aux0 495 20 ohms PS Aux1 496 44 ohms PS Aux1 497 13 ohms Backpanel ? 498 21 ohms Backpanel ? 499 45 ohms Backpanel ? 500 53 ohms Backpanel ? 501 14 ohms Switchbox0 ? 502 15 ohms Switchbox0 ? 503 46 ohms Switchbox1 ? 504 47 ohms Switchbox1 ? 505 7 ohms nc nc 506 22 ohms nc nc 507 23 ohms nc nc 508 54 ohms nc nc 509 55 ohms nc nc 510 */ 511 244 512 for (size_t i=0; i<resist.size(); i++) 245 513 if (resist[i]>800 && resist[i]<2000) … … 247 515 else 248 516 cout << setw(2) << i << " - " << setw(4) << (int)resist[i] << ": " << "----" << endl; 517 518 UpdateTemp(time, temperatures); 519 UpdateVolt(time, voltages); 520 UpdateCur( time, currents); 521 UpdateHum( time, humidities); 249 522 250 523 StartRead(); … … 340 613 { 341 614 data.insert(data.begin(), time); 342 svc.setData(data.data(), data.size()*sizeof(float)); 343 svc.updateService(); 615 svc.Update(data); 344 616 } 345 617 … … 367 639 ConnectionDimFSC(ba::io_service& ioservice, MessageImp &imp) : 368 640 ConnectionFSC(ioservice, imp), 369 fDimTemp ("FSC_CONTROL/TEMPERATURE", "F:1;F: 64", ""),370 fDimHum ("FSC_CONTROL/HUMIDITY", "F:1;F: 40", ""),371 fDimVolt ("FSC_CONTROL/VOLTAGE", "F:1;F:4 0", ""),372 fDimCurrent("FSC_CONTROL/CURRENT", "F:1;F:4 ","")641 fDimTemp ("FSC_CONTROL/TEMPERATURE", "F:1;F:31;F:8;F:12;F:4;F4", ""), 642 fDimHum ("FSC_CONTROL/HUMIDITY", "F:1;F:1;F:1;F:1;F:1", ""), 643 fDimVolt ("FSC_CONTROL/VOLTAGE", "F:1;F:4;F:4;F:4;F:4;F:4;F:4;F:2;F:2;F:1;F:1", ""), 644 fDimCurrent("FSC_CONTROL/CURRENT", "F:1;F:4;F:4;F:4;F:4;F:4;F:4;F:2;F:2;F:1;F:1", "") 373 645 { 374 646 }
Note:
See TracChangeset
for help on using the changeset viewer.