unit U_MachineArea;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, Buttons, DB, ADODB, StdCtrls, cxControls, cxPC, ComCtrls,
  ToolWin, ExtCtrls, jpeg, DBClient;

type
  TfrmMachineArea = class(TForm)
    ToolBar1: TToolBar;
    TBRafresh: TToolButton;
    TBClose: TToolButton;
    cxPageControl1: TcxPageControl;
    cxTabSheet1: TcxTabSheet;
    cxTabSheet2: TcxTabSheet;
    ScrollBox1: TScrollBox;
    Panel8: TPanel;
    Label2: TLabel;
    Panel9: TPanel;
    Panel16: TPanel;
    Panel17: TPanel;
    Panel1: TPanel;
    Label1: TLabel;
    Panel2: TPanel;
    Panel5: TPanel;
    Panel6: TPanel;
    Panel7: TPanel;
    Label3: TLabel;
    Panel10: TPanel;
    Panel12: TPanel;
    Panel13: TPanel;
    Panel18: TPanel;
    Panel19: TPanel;
    Label4: TLabel;
    Panel20: TPanel;
    Panel23: TPanel;
    Panel24: TPanel;
    Panel25: TPanel;
    Label5: TLabel;
    Panel26: TPanel;
    Panel29: TPanel;
    Panel30: TPanel;
    Panel31: TPanel;
    Label6: TLabel;
    Panel32: TPanel;
    Panel35: TPanel;
    Panel36: TPanel;
    Panel37: TPanel;
    Label7: TLabel;
    Panel38: TPanel;
    Panel40: TPanel;
    Panel41: TPanel;
    Panel42: TPanel;
    Panel43: TPanel;
    Label8: TLabel;
    Panel44: TPanel;
    Panel47: TPanel;
    Panel48: TPanel;
    Panel49: TPanel;
    Label9: TLabel;
    Panel50: TPanel;
    Panel53: TPanel;
    Panel54: TPanel;
    Panel55: TPanel;
    Label10: TLabel;
    Panel56: TPanel;
    Panel59: TPanel;
    Panel60: TPanel;
    Panel61: TPanel;
    Label11: TLabel;
    Panel62: TPanel;
    Panel65: TPanel;
    Panel66: TPanel;
    Panel67: TPanel;
    Label12: TLabel;
    Panel68: TPanel;
    Panel71: TPanel;
    Panel72: TPanel;
    Panel73: TPanel;
    Label13: TLabel;
    Panel74: TPanel;
    Panel77: TPanel;
    Panel78: TPanel;
    Panel79: TPanel;
    Label14: TLabel;
    Panel80: TPanel;
    Panel83: TPanel;
    Panel84: TPanel;
    Panel85: TPanel;
    Label15: TLabel;
    Panel86: TPanel;
    Panel89: TPanel;
    Panel90: TPanel;
    Panel91: TPanel;
    Label16: TLabel;
    Panel92: TPanel;
    Panel95: TPanel;
    Panel96: TPanel;
    Panel97: TPanel;
    Label17: TLabel;
    Panel98: TPanel;
    Panel101: TPanel;
    Panel102: TPanel;
    Panel14: TPanel;
    Panel15: TPanel;
    Panel21: TPanel;
    Panel22: TPanel;
    Panel27: TPanel;
    Panel3: TPanel;
    Panel4: TPanel;
    Panel28: TPanel;
    Panel33: TPanel;
    Panel34: TPanel;
    Panel39: TPanel;
    Panel45: TPanel;
    Panel46: TPanel;
    Panel51: TPanel;
    Panel52: TPanel;
    Panel11: TPanel;
    Label18: TLabel;
    Panel57: TPanel;
    Panel58: TPanel;
    Panel63: TPanel;
    Panel64: TPanel;
    Panel69: TPanel;
    Label19: TLabel;
    Panel70: TPanel;
    Panel75: TPanel;
    Panel76: TPanel;
    Panel81: TPanel;
    Panel82: TPanel;
    Label20: TLabel;
    Panel87: TPanel;
    Panel88: TPanel;
    Panel93: TPanel;
    Panel94: TPanel;
    Panel99: TPanel;
    Label21: TLabel;
    Panel100: TPanel;
    Panel103: TPanel;
    Panel104: TPanel;
    Panel105: TPanel;
    Panel106: TPanel;
    Label22: TLabel;
    Panel107: TPanel;
    Panel108: TPanel;
    Panel109: TPanel;
    Panel110: TPanel;
    Panel111: TPanel;
    Label23: TLabel;
    Panel112: TPanel;
    Panel113: TPanel;
    Panel114: TPanel;
    Panel115: TPanel;
    Panel116: TPanel;
    Label24: TLabel;
    Panel117: TPanel;
    Panel118: TPanel;
    Panel119: TPanel;
    Panel120: TPanel;
    Panel121: TPanel;
    Label25: TLabel;
    Panel122: TPanel;
    Panel123: TPanel;
    Panel124: TPanel;
    Panel125: TPanel;
    Panel126: TPanel;
    Label26: TLabel;
    Panel127: TPanel;
    Panel128: TPanel;
    Panel129: TPanel;
    Panel130: TPanel;
    Panel131: TPanel;
    Label27: TLabel;
    Panel132: TPanel;
    Panel133: TPanel;
    Panel134: TPanel;
    Panel135: TPanel;
    Panel136: TPanel;
    Label28: TLabel;
    Panel137: TPanel;
    Panel138: TPanel;
    Panel139: TPanel;
    Panel140: TPanel;
    Panel141: TPanel;
    Label29: TLabel;
    Panel142: TPanel;
    Panel143: TPanel;
    Panel144: TPanel;
    Panel145: TPanel;
    Panel146: TPanel;
    Label30: TLabel;
    Panel147: TPanel;
    Panel148: TPanel;
    Panel149: TPanel;
    Panel150: TPanel;
    Panel151: TPanel;
    Label31: TLabel;
    Panel152: TPanel;
    Panel153: TPanel;
    Panel154: TPanel;
    Panel155: TPanel;
    Panel156: TPanel;
    Label32: TLabel;
    Panel157: TPanel;
    Panel158: TPanel;
    Panel159: TPanel;
    Panel160: TPanel;
    Panel161: TPanel;
    Label33: TLabel;
    Panel162: TPanel;
    Panel163: TPanel;
    Panel164: TPanel;
    Panel165: TPanel;
    Panel166: TPanel;
    Label34: TLabel;
    Panel167: TPanel;
    Panel168: TPanel;
    Panel169: TPanel;
    Panel170: TPanel;
    Panel171: TPanel;
    Label35: TLabel;
    Panel172: TPanel;
    Panel173: TPanel;
    Panel174: TPanel;
    Panel175: TPanel;
    Panel176: TPanel;
    Label36: TLabel;
    Panel177: TPanel;
    Panel178: TPanel;
    Panel179: TPanel;
    Panel180: TPanel;
    Panel181: TPanel;
    Label37: TLabel;
    Panel182: TPanel;
    Panel183: TPanel;
    Panel184: TPanel;
    Panel185: TPanel;
    Panel186: TPanel;
    Label38: TLabel;
    Panel187: TPanel;
    Panel188: TPanel;
    Panel189: TPanel;
    Panel190: TPanel;
    ScrollBox2: TScrollBox;
    pnl001: TPanel;
    Label46: TLabel;
    Panel227: TPanel;
    Panel228: TPanel;
    Panel229: TPanel;
    Panel230: TPanel;
    pnl002: TPanel;
    Label47: TLabel;
    Panel232: TPanel;
    Panel233: TPanel;
    Panel234: TPanel;
    Panel235: TPanel;
    Panel196: TPanel;
    Label40: TLabel;
    Panel197: TPanel;
    Panel198: TPanel;
    Panel199: TPanel;
    Panel200: TPanel;
    Panel201: TPanel;
    Label41: TLabel;
    Panel202: TPanel;
    Panel203: TPanel;
    Panel204: TPanel;
    Panel205: TPanel;
    Panel206: TPanel;
    Label42: TLabel;
    Panel207: TPanel;
    Panel208: TPanel;
    Panel209: TPanel;
    Panel210: TPanel;
    cxTabSheet3: TcxTabSheet;
    cxTabSheet4: TcxTabSheet;
    cxTabSheet5: TcxTabSheet;
    cxTabSheet6: TcxTabSheet;
    ScrollBox3: TScrollBox;
    Panel191: TPanel;
    Label39: TLabel;
    Panel192: TPanel;
    Panel193: TPanel;
    Panel194: TPanel;
    Panel195: TPanel;
    Panel211: TPanel;
    Label43: TLabel;
    Panel212: TPanel;
    Panel213: TPanel;
    Panel214: TPanel;
    Panel215: TPanel;
    ScrollBox4: TScrollBox;
    ScrollBox5: TScrollBox;
    Panel254: TPanel;
    Label52: TLabel;
    Panel255: TPanel;
    Panel256: TPanel;
    Panel257: TPanel;
    Panel258: TPanel;
    Panel259: TPanel;
    Label53: TLabel;
    Panel260: TPanel;
    Panel261: TPanel;
    Panel262: TPanel;
    Panel263: TPanel;
    Panel264: TPanel;
    Label54: TLabel;
    Panel265: TPanel;
    Panel266: TPanel;
    Panel267: TPanel;
    Panel268: TPanel;
    Panel269: TPanel;
    Label55: TLabel;
    Panel270: TPanel;
    Panel271: TPanel;
    Panel272: TPanel;
    Panel273: TPanel;
    Panel274: TPanel;
    Label56: TLabel;
    Panel275: TPanel;
    Panel276: TPanel;
    Panel277: TPanel;
    Panel278: TPanel;
    Panel279: TPanel;
    Label57: TLabel;
    Panel280: TPanel;
    Panel281: TPanel;
    Panel282: TPanel;
    Panel283: TPanel;
    Panel284: TPanel;
    Label58: TLabel;
    Panel285: TPanel;
    Panel286: TPanel;
    Panel287: TPanel;
    Panel288: TPanel;
    Panel289: TPanel;
    Label59: TLabel;
    Panel290: TPanel;
    Panel291: TPanel;
    Panel292: TPanel;
    Panel293: TPanel;
    Panel294: TPanel;
    Label60: TLabel;
    Panel295: TPanel;
    Panel296: TPanel;
    Panel297: TPanel;
    Panel298: TPanel;
    Panel299: TPanel;
    Label61: TLabel;
    Panel300: TPanel;
    Panel301: TPanel;
    Panel302: TPanel;
    Panel303: TPanel;
    Panel304: TPanel;
    Label62: TLabel;
    Panel305: TPanel;
    Panel306: TPanel;
    Panel307: TPanel;
    Panel308: TPanel;
    Panel309: TPanel;
    Label63: TLabel;
    Panel310: TPanel;
    Panel311: TPanel;
    Panel312: TPanel;
    Panel313: TPanel;
    Panel314: TPanel;
    Label64: TLabel;
    Panel315: TPanel;
    Panel316: TPanel;
    Panel317: TPanel;
    Panel318: TPanel;
    Panel319: TPanel;
    Label65: TLabel;
    Panel320: TPanel;
    Panel321: TPanel;
    Panel322: TPanel;
    Panel323: TPanel;
    Panel324: TPanel;
    Label66: TLabel;
    Panel325: TPanel;
    Panel326: TPanel;
    Panel327: TPanel;
    Panel328: TPanel;
    Panel329: TPanel;
    Label67: TLabel;
    Panel330: TPanel;
    Panel331: TPanel;
    Panel332: TPanel;
    Panel333: TPanel;
    Panel334: TPanel;
    Label68: TLabel;
    Panel335: TPanel;
    Panel336: TPanel;
    Panel337: TPanel;
    Panel338: TPanel;
    Panel339: TPanel;
    Label69: TLabel;
    Panel340: TPanel;
    Panel341: TPanel;
    Panel342: TPanel;
    Panel343: TPanel;
    Panel216: TPanel;
    Label44: TLabel;
    Panel217: TPanel;
    Panel218: TPanel;
    Panel219: TPanel;
    Panel220: TPanel;
    Panel221: TPanel;
    Label45: TLabel;
    Panel222: TPanel;
    Panel223: TPanel;
    Panel224: TPanel;
    Panel225: TPanel;
    Panel344: TPanel;
    Label70: TLabel;
    Panel345: TPanel;
    Panel346: TPanel;
    Panel347: TPanel;
    Panel348: TPanel;
    Panel349: TPanel;
    Label71: TLabel;
    Panel350: TPanel;
    Panel351: TPanel;
    Panel352: TPanel;
    Panel353: TPanel;
    Panel354: TPanel;
    Label72: TLabel;
    Panel355: TPanel;
    Panel356: TPanel;
    Panel357: TPanel;
    Panel358: TPanel;
    Panel359: TPanel;
    Label73: TLabel;
    Panel360: TPanel;
    Panel361: TPanel;
    Panel362: TPanel;
    Panel363: TPanel;
    Panel364: TPanel;
    Label74: TLabel;
    Panel365: TPanel;
    Panel366: TPanel;
    Panel367: TPanel;
    Panel368: TPanel;
    Panel369: TPanel;
    Label75: TLabel;
    Panel370: TPanel;
    Panel371: TPanel;
    Panel372: TPanel;
    Panel373: TPanel;
    Panel374: TPanel;
    Label76: TLabel;
    Panel375: TPanel;
    Panel376: TPanel;
    Panel377: TPanel;
    Panel378: TPanel;
    Panel379: TPanel;
    Label77: TLabel;
    Panel380: TPanel;
    Panel381: TPanel;
    Panel382: TPanel;
    Panel383: TPanel;
    Panel384: TPanel;
    Label78: TLabel;
    Panel385: TPanel;
    Panel386: TPanel;
    Panel387: TPanel;
    Panel388: TPanel;
    Panel389: TPanel;
    Label79: TLabel;
    Panel390: TPanel;
    Panel391: TPanel;
    Panel392: TPanel;
    Panel393: TPanel;
    Panel394: TPanel;
    Label80: TLabel;
    Panel395: TPanel;
    Panel396: TPanel;
    Panel397: TPanel;
    Panel398: TPanel;
    Panel399: TPanel;
    Label81: TLabel;
    Panel400: TPanel;
    Panel401: TPanel;
    Panel402: TPanel;
    Panel403: TPanel;
    Panel404: TPanel;
    Label82: TLabel;
    Panel405: TPanel;
    Panel406: TPanel;
    Panel407: TPanel;
    Panel408: TPanel;
    Panel409: TPanel;
    Label83: TLabel;
    Panel410: TPanel;
    Panel411: TPanel;
    Panel412: TPanel;
    Panel413: TPanel;
    Panel414: TPanel;
    Label84: TLabel;
    Panel415: TPanel;
    Panel416: TPanel;
    Panel417: TPanel;
    Panel418: TPanel;
    Panel419: TPanel;
    Label85: TLabel;
    Panel420: TPanel;
    Panel421: TPanel;
    Panel422: TPanel;
    Panel423: TPanel;
    Panel424: TPanel;
    Label86: TLabel;
    Panel425: TPanel;
    Panel426: TPanel;
    Panel427: TPanel;
    Panel428: TPanel;
    Panel429: TPanel;
    Label87: TLabel;
    Panel430: TPanel;
    Panel431: TPanel;
    Panel432: TPanel;
    Panel433: TPanel;
    Panel434: TPanel;
    Label88: TLabel;
    Panel435: TPanel;
    Panel436: TPanel;
    Panel437: TPanel;
    Panel438: TPanel;
    Panel439: TPanel;
    Label89: TLabel;
    Panel440: TPanel;
    Panel441: TPanel;
    Panel442: TPanel;
    Panel443: TPanel;
    Panel444: TPanel;
    Label90: TLabel;
    Panel445: TPanel;
    Panel446: TPanel;
    Panel447: TPanel;
    Panel448: TPanel;
    Panel449: TPanel;
    Label91: TLabel;
    Panel450: TPanel;
    Panel451: TPanel;
    Panel452: TPanel;
    Panel453: TPanel;
    Panel454: TPanel;
    Label92: TLabel;
    Panel455: TPanel;
    Panel456: TPanel;
    Panel457: TPanel;
    Panel458: TPanel;
    Panel459: TPanel;
    Label93: TLabel;
    Panel460: TPanel;
    Panel461: TPanel;
    Panel462: TPanel;
    Panel463: TPanel;
    Panel464: TPanel;
    Label94: TLabel;
    Panel465: TPanel;
    Panel466: TPanel;
    Panel467: TPanel;
    Panel468: TPanel;
    Panel469: TPanel;
    Label95: TLabel;
    Panel470: TPanel;
    Panel471: TPanel;
    Panel472: TPanel;
    Panel473: TPanel;
    Panel474: TPanel;
    Label96: TLabel;
    Panel475: TPanel;
    Panel476: TPanel;
    Panel477: TPanel;
    Panel478: TPanel;
    Panel479: TPanel;
    Label97: TLabel;
    Panel480: TPanel;
    Panel481: TPanel;
    Panel482: TPanel;
    Panel483: TPanel;
    Panel484: TPanel;
    Label98: TLabel;
    Panel485: TPanel;
    Panel486: TPanel;
    Panel487: TPanel;
    Panel488: TPanel;
    Panel489: TPanel;
    Label99: TLabel;
    Panel490: TPanel;
    Panel491: TPanel;
    Panel492: TPanel;
    Panel493: TPanel;
    Panel494: TPanel;
    Label100: TLabel;
    Panel495: TPanel;
    Panel496: TPanel;
    Panel497: TPanel;
    Panel498: TPanel;
    Panel499: TPanel;
    Label101: TLabel;
    Panel500: TPanel;
    Panel501: TPanel;
    Panel502: TPanel;
    Panel503: TPanel;
    Panel504: TPanel;
    Label102: TLabel;
    Panel505: TPanel;
    Panel506: TPanel;
    Panel507: TPanel;
    Panel508: TPanel;
    Panel226: TPanel;
    Label48: TLabel;
    Panel231: TPanel;
    Panel236: TPanel;
    Panel237: TPanel;
    Panel238: TPanel;
    Panel239: TPanel;
    Label49: TLabel;
    Panel240: TPanel;
    Panel241: TPanel;
    Panel242: TPanel;
    Panel243: TPanel;
    Panel509: TPanel;
    Label103: TLabel;
    Panel510: TPanel;
    Panel511: TPanel;
    Panel512: TPanel;
    Panel513: TPanel;
    Panel514: TPanel;
    Label104: TLabel;
    Panel515: TPanel;
    Panel516: TPanel;
    Panel517: TPanel;
    Panel518: TPanel;
    Panel519: TPanel;
    Label105: TLabel;
    Panel520: TPanel;
    Panel521: TPanel;
    Panel522: TPanel;
    Panel523: TPanel;
    Panel524: TPanel;
    Label106: TLabel;
    Panel525: TPanel;
    Panel526: TPanel;
    Panel527: TPanel;
    Panel528: TPanel;
    Panel529: TPanel;
    Label107: TLabel;
    Panel530: TPanel;
    Panel531: TPanel;
    Panel532: TPanel;
    Panel533: TPanel;
    Panel534: TPanel;
    Label108: TLabel;
    Panel535: TPanel;
    Panel536: TPanel;
    Panel537: TPanel;
    Panel538: TPanel;
    Panel539: TPanel;
    Label109: TLabel;
    Panel540: TPanel;
    Panel541: TPanel;
    Panel542: TPanel;
    Panel543: TPanel;
    Panel544: TPanel;
    Label110: TLabel;
    Panel545: TPanel;
    Panel546: TPanel;
    Panel547: TPanel;
    Panel548: TPanel;
    Panel549: TPanel;
    Label111: TLabel;
    Panel550: TPanel;
    Panel551: TPanel;
    Panel552: TPanel;
    Panel553: TPanel;
    Panel554: TPanel;
    Label112: TLabel;
    Panel555: TPanel;
    Panel556: TPanel;
    Panel557: TPanel;
    Panel558: TPanel;
    Panel559: TPanel;
    Label113: TLabel;
    Panel560: TPanel;
    Panel561: TPanel;
    Panel562: TPanel;
    Panel563: TPanel;
    Panel564: TPanel;
    Label114: TLabel;
    Panel565: TPanel;
    Panel566: TPanel;
    Panel567: TPanel;
    Panel568: TPanel;
    Panel569: TPanel;
    Label115: TLabel;
    Panel570: TPanel;
    Panel571: TPanel;
    Panel572: TPanel;
    Panel573: TPanel;
    Panel574: TPanel;
    Label116: TLabel;
    Panel575: TPanel;
    Panel576: TPanel;
    Panel577: TPanel;
    Panel578: TPanel;
    Panel579: TPanel;
    Label117: TLabel;
    Panel580: TPanel;
    Panel581: TPanel;
    Panel582: TPanel;
    Panel583: TPanel;
    Panel584: TPanel;
    Label118: TLabel;
    Panel585: TPanel;
    Panel586: TPanel;
    Panel587: TPanel;
    Panel588: TPanel;
    Panel589: TPanel;
    Label119: TLabel;
    Panel590: TPanel;
    Panel591: TPanel;
    Panel592: TPanel;
    Panel593: TPanel;
    Panel594: TPanel;
    Label120: TLabel;
    Panel595: TPanel;
    Panel596: TPanel;
    Panel597: TPanel;
    Panel598: TPanel;
    Panel599: TPanel;
    Label121: TLabel;
    Panel600: TPanel;
    Panel601: TPanel;
    Panel602: TPanel;
    Panel603: TPanel;
    Panel604: TPanel;
    Label122: TLabel;
    Panel605: TPanel;
    Panel606: TPanel;
    Panel607: TPanel;
    Panel608: TPanel;
    Panel609: TPanel;
    Label123: TLabel;
    Panel610: TPanel;
    Panel611: TPanel;
    Panel612: TPanel;
    Panel613: TPanel;
    Panel614: TPanel;
    Label124: TLabel;
    Panel615: TPanel;
    Panel616: TPanel;
    Panel617: TPanel;
    Panel618: TPanel;
    Panel619: TPanel;
    Label125: TLabel;
    Panel620: TPanel;
    Panel621: TPanel;
    Panel622: TPanel;
    Panel623: TPanel;
    Panel624: TPanel;
    Label126: TLabel;
    Panel625: TPanel;
    Panel626: TPanel;
    Panel627: TPanel;
    Panel628: TPanel;
    ScrollBox6: TScrollBox;
    Panel249: TPanel;
    Label51: TLabel;
    Panel250: TPanel;
    Panel251: TPanel;
    Panel252: TPanel;
    Panel253: TPanel;
    Panel629: TPanel;
    Label127: TLabel;
    Panel630: TPanel;
    Panel631: TPanel;
    Panel632: TPanel;
    Panel633: TPanel;
    Panel634: TPanel;
    Label128: TLabel;
    Panel635: TPanel;
    Panel636: TPanel;
    Panel637: TPanel;
    Panel638: TPanel;
    Panel639: TPanel;
    Label129: TLabel;
    Panel640: TPanel;
    Panel641: TPanel;
    Panel642: TPanel;
    Panel643: TPanel;
    Panel644: TPanel;
    Label130: TLabel;
    Panel645: TPanel;
    Panel646: TPanel;
    Panel647: TPanel;
    Panel648: TPanel;
    Panel649: TPanel;
    Label131: TLabel;
    Panel650: TPanel;
    Panel651: TPanel;
    Panel652: TPanel;
    Panel653: TPanel;
    Panel654: TPanel;
    Label132: TLabel;
    Panel655: TPanel;
    Panel656: TPanel;
    Panel657: TPanel;
    Panel658: TPanel;
    Panel669: TPanel;
    Label135: TLabel;
    Panel670: TPanel;
    Panel671: TPanel;
    Panel672: TPanel;
    Panel673: TPanel;
    Panel674: TPanel;
    Label136: TLabel;
    Panel675: TPanel;
    Panel676: TPanel;
    Panel677: TPanel;
    Panel678: TPanel;
    Panel679: TPanel;
    Label137: TLabel;
    Panel680: TPanel;
    Panel681: TPanel;
    Panel682: TPanel;
    Panel683: TPanel;
    Panel684: TPanel;
    Label138: TLabel;
    Panel685: TPanel;
    Panel686: TPanel;
    Panel687: TPanel;
    Panel688: TPanel;
    Panel689: TPanel;
    Label139: TLabel;
    Panel690: TPanel;
    Panel691: TPanel;
    Panel692: TPanel;
    Panel693: TPanel;
    Panel694: TPanel;
    Label140: TLabel;
    Panel695: TPanel;
    Panel696: TPanel;
    Panel697: TPanel;
    Panel698: TPanel;
    Panel699: TPanel;
    Label141: TLabel;
    Panel700: TPanel;
    Panel701: TPanel;
    Panel702: TPanel;
    Panel703: TPanel;
    Panel704: TPanel;
    Label142: TLabel;
    Panel705: TPanel;
    Panel706: TPanel;
    Panel707: TPanel;
    Panel708: TPanel;
    Panel709: TPanel;
    Label143: TLabel;
    Panel710: TPanel;
    Panel711: TPanel;
    Panel712: TPanel;
    Panel713: TPanel;
    Panel714: TPanel;
    Label144: TLabel;
    Panel715: TPanel;
    Panel716: TPanel;
    Panel717: TPanel;
    Panel718: TPanel;
    Panel719: TPanel;
    Label145: TLabel;
    Panel720: TPanel;
    Panel721: TPanel;
    Panel722: TPanel;
    Panel723: TPanel;
    Panel724: TPanel;
    Label146: TLabel;
    Panel725: TPanel;
    Panel726: TPanel;
    Panel727: TPanel;
    Panel728: TPanel;
    Panel729: TPanel;
    Label147: TLabel;
    Panel730: TPanel;
    Panel731: TPanel;
    Panel732: TPanel;
    Panel733: TPanel;
    Panel734: TPanel;
    Label148: TLabel;
    Panel735: TPanel;
    Panel736: TPanel;
    Panel737: TPanel;
    Panel738: TPanel;
    Panel739: TPanel;
    Label149: TLabel;
    Panel740: TPanel;
    Panel741: TPanel;
    Panel742: TPanel;
    Panel743: TPanel;
    Panel244: TPanel;
    Label50: TLabel;
    Panel245: TPanel;
    Panel246: TPanel;
    Panel247: TPanel;
    Panel248: TPanel;
    Panel659: TPanel;
    Label133: TLabel;
    Panel660: TPanel;
    Panel661: TPanel;
    Panel662: TPanel;
    Panel663: TPanel;
    Panel664: TPanel;
    Label134: TLabel;
    Panel665: TPanel;
    Panel666: TPanel;
    Panel667: TPanel;
    Panel668: TPanel;
    ADOTmp: TADOQuery;
    CDS_MC: TClientDataSet;
    Panel744: TPanel;
    Panel745: TPanel;
    Panel746: TPanel;
    Panel747: TPanel;
    Panel748: TPanel;
    Panel749: TPanel;
    Panel750: TPanel;
    Panel751: TPanel;
    Panel752: TPanel;
    Panel753: TPanel;
    Panel754: TPanel;
    Panel755: TPanel;
    Panel756: TPanel;
    Panel757: TPanel;
    Panel758: TPanel;
    Panel759: TPanel;
    Panel760: TPanel;
    Panel761: TPanel;
    Panel762: TPanel;
    Panel763: TPanel;
    Panel764: TPanel;
    Panel765: TPanel;
    Panel766: TPanel;
    Panel767: TPanel;
    Panel768: TPanel;
    Panel769: TPanel;
    Panel770: TPanel;
    Panel771: TPanel;
    Panel772: TPanel;
    Panel773: TPanel;
    Panel774: TPanel;
    Panel775: TPanel;
    Panel776: TPanel;
    Panel778: TPanel;
    Panel779: TPanel;
    Panel780: TPanel;
    Panel781: TPanel;
    Panel782: TPanel;
    Panel783: TPanel;
    Panel784: TPanel;
    Panel785: TPanel;
    Panel786: TPanel;
    Panel787: TPanel;
    Panel777: TPanel;
    Panel788: TPanel;
    Panel789: TPanel;
    Panel790: TPanel;
    Panel791: TPanel;
    Panel792: TPanel;
    Panel793: TPanel;
    Panel794: TPanel;
    Panel795: TPanel;
    Panel796: TPanel;
    Panel797: TPanel;
    Panel798: TPanel;
    Panel799: TPanel;
    Panel800: TPanel;
    Panel801: TPanel;
    Panel803: TPanel;
    Panel802: TPanel;
    Label151: TLabel;
    Label152: TLabel;
    Label150: TLabel;
    Panel804: TPanel;
    Label153: TLabel;
    Panel805: TPanel;
    Label154: TLabel;
    Panel806: TPanel;
    Label155: TLabel;
    Panel807: TPanel;
    Label156: TLabel;
    Panel808: TPanel;
    Label157: TLabel;
    Panel809: TPanel;
    Label158: TLabel;
    Panel810: TPanel;
    Label159: TLabel;
    Panel811: TPanel;
    Label160: TLabel;
    Panel812: TPanel;
    Label161: TLabel;
    Panel813: TPanel;
    Label162: TLabel;
    Panel814: TPanel;
    Label163: TLabel;
    Panel815: TPanel;
    Label164: TLabel;
    Panel816: TPanel;
    Label165: TLabel;
    Panel817: TPanel;
    Label166: TLabel;
    procedure FormDestroy(Sender: TObject);
    procedure FormClose(Sender: TObject; var Action: TCloseAction);
    procedure TBRafreshClick(Sender: TObject);
    procedure cxTabControl1Change(Sender: TObject);
    procedure FormShow(Sender: TObject);
    procedure TBCloseClick(Sender: TObject);
    procedure FormCreate(Sender: TObject);
    procedure cxPageControl1Change(Sender: TObject);
  private
     procedure InitCarNo();
     procedure InitMachine(ScrollBox:TScrollBox;MCData:TClientDataSet);
    { Private declarations }
  public
    FlagStr:String;
    canshu1:String;
    { Public declarations }
  end;

var
  frmMachineArea: TfrmMachineArea;

implementation
uses
  U_DataLink,U_RTFun;

{$R *.dfm}

procedure TfrmMachineArea.FormDestroy(Sender: TObject);
begin
  frmMachineArea:=nil;
end;
procedure TfrmMachineArea.InitCarNo();
begin
  with ADOTmp do
  begin
    Close;
    sql.Clear;
    SQL.Add('exec P_View_MachineStatus');
    Open;
  end;
  SCreateCDS20(ADOTmp,CDS_MC);
  SInitCDSData20(ADOTmp,CDS_MC);
  case cxPageControl1.ActivePageIndex of
    0:begin
        InitMachine(ScrollBox1,CDS_MC);
      end;
    1:begin
        InitMachine(ScrollBox2,CDS_MC);
      end;
    2:begin
        InitMachine(ScrollBox3,CDS_MC);
      end;
    3:begin
        InitMachine(ScrollBox4,CDS_MC);
      end;
    4:begin
        InitMachine(ScrollBox5,CDS_MC);
      end;
    5:begin
        InitMachine(ScrollBox6,CDS_MC);
      end;
  end;
end;
procedure TfrmMachineArea.InitMachine(ScrollBox:TScrollBox;MCData:TClientDataSet);
var
  i,j,k:Integer;
   mHint:string;
begin
    //最外层
  with ScrollBox do
  begin
    //寻找独立 一级TPanel
    for i:=0 to ControlCount-1 do
    begin
      if Controls[i] is TLabel then Continue;
      if Controls[i] is TPanel then
      begin
        mHint:=trim(TPanel(Controls[i]).Hint);
        if MCData.Locate('MCNO',trim(TPanel(Controls[i]).Hint),[])=false then Continue;
        with  TPanel(Controls[i]) do
        begin

          //寻找 二级TPanel  和   二级TLabel
          for j:=0 to ControlCount-1 do
          begin
            //   为 二级TLabel 添加型号   启用状态
            if Controls[j] is TLabel then
            begin
              if trim(MCData.FieldByName('Status').AsString)='启用' then
              begin
                TLabel(Controls[j]).Caption:=trim(MCData.FieldByName('C_CodeName').AsString);
                TLabel(Controls[j]).hint:=trim(MCData.FieldByName('C_CodeName').AsString)
                +#13+trim(MCData.FieldByName('MF').AsString)
                +#13+trim(MCData.FieldByName('KZ').AsString)
                +#13+trim(MCData.FieldByName('dcg').AsString)
                +#13+trim(MCData.FieldByName('ywy').AsString);
                TLabel(Controls[j]).Color:=$008000;
              end
              else
              if trim(MCData.FieldByName('Status').AsString)='机修' then
              begin
                TLabel(Controls[j]).Caption:='维修';
                TLabel(Controls[j]).Color:=$F0CAA6;
              end
              else
              begin
                TLabel(Controls[j]).Caption:='停机';
                TLabel(Controls[j]).Color:=$0000FF;
              end;
            end;
           //  找到 二级TPanel
            if Controls[j] is TPanel then
            begin

              with  TPanel(Controls[j]) do
              begin
                //  循环 三级TPanel
                for k:=0 to ControlCount-1 do
                begin
                  if Controls[k] is TPanel then
                  begin
                    TPanel(Controls[k]).Hint:='1.机器购买时间：'+#13+trim(MCData.FieldByName('GMDate').AsString)
                                               +#13+ '2.是否更换针筒：'+#13+trim(MCData.FieldByName('ISGHZT').AsString)
                                               +#13+ '更换时间：'+#13+trim(MCData.FieldByName('ZTDate').AsString)
                                               +#13+ '3.是否更换选针器：'+#13+trim(MCData.FieldByName('ISGHXZQ').AsString)
                                               +#13+ '更换时间：'+#13+trim(MCData.FieldByName('XZQDate').AsString)
                                               ;


                    case TPanel(Controls[k]).Tag of
                    0:begin
                        TPanel(Controls[k]).Caption:=trim(MCData.FieldByName('MCPP').AsString)+trim(MCData.FieldByName('MCNO').AsString);
                      end;
                    1:begin
                        TPanel(Controls[k]).Caption:=trim(MCData.FieldByName('MCType').AsString);
                      end;
                    2:begin
                        TPanel(Controls[k]).Caption:=trim(MCData.FieldByName('MCZX').AsString)+trim(MCData.FieldByName('MCLS').AsString);
                      end;
                    end;
                  end;
                end;
              end;
            end;
          end;
        end;
      end;
    end;
  end;
end;
procedure TfrmMachineArea.FormClose(Sender: TObject;
  var Action: TCloseAction);
begin
  Action:=cafree;
end;

procedure TfrmMachineArea.TBRafreshClick(Sender: TObject);
begin
  InitCarNo();
end;

procedure TfrmMachineArea.cxTabControl1Change(Sender: TObject);
begin
  InitCarNo();
end;

procedure TfrmMachineArea.FormShow(Sender: TObject);
begin
  InitCarNo();
end;

procedure TfrmMachineArea.TBCloseClick(Sender: TObject);
begin
  close;
end;

procedure TfrmMachineArea.FormCreate(Sender: TObject);
begin
  canshu1:=Trim(DParameters1);
end;

procedure TfrmMachineArea.cxPageControl1Change(Sender: TObject);
begin
  case cxPageControl1.ActivePageIndex of
    0:begin
        InitMachine(ScrollBox1,CDS_MC);
      end;
    1:begin
        InitMachine(ScrollBox2,CDS_MC);
      end;
    2:begin
        InitMachine(ScrollBox3,CDS_MC);
      end;
    3:begin
        InitMachine(ScrollBox4,CDS_MC);
      end;
    4:begin
        InitMachine(ScrollBox5,CDS_MC);
      end;
    5:begin
        InitMachine(ScrollBox6,CDS_MC);
      end;
  end;
end;

end.
