//--------------------------------------------------------------------------- #include #pragma hdrstop #include "HiddenPrintData_F.h" #include "PrintingForm.h" #include "MetaData_F.h" #include "Simulation_F.h" #include "GuideBar.h" #include "YarnCompositionData.h" #include "Main_F.h" #include "Design.h" #include "Cost.h" #include "Editor.h" //for EL mode #include "PrintDefine.h" #include "Environment_F.h" //--------------------------------------------------------------------------- #define IDS_SimpleTitle StringTable[0] #define IDS_IDX StringTable[1] #define IDS_SPEC StringTable[2] #define IDS_PERCENT StringTable[3] #define IDS_TOTAL StringTable[4] #define IDS_mmPerRACK StringTable[5] #define IDS_USE StringTable[6] #define IDS_BEAM StringTable[7] #define IDS_WPI StringTable[8] #define IDS_CPC StringTable[9] #define IDS_WIDTH StringTable[10] #define IDS_WEIGHT StringTable[11] #define IDS_WeightPerWidth StringTable[12] #define IDS_RAW StringTable[13] #define IDS_SIMULATED StringTable[14] #define IDS_QUOTAperDAY StringTable[15] #define IDS_MACHINNAME StringTable[16] #define IDS_ARRAY StringTable[17] #define IDS_ORGANIZE StringTable[18] #define IDS_ZOOM StringTable[19] #define IDS_NOTE StringTable[20] #define IDS_MAKER StringTable[21] #define IDS_CODE StringTable[22] #define IDS_FABRIC StringTable[23] #define IDS_NAME StringTable[24] #define IDS_CODE_COLON StringTable[25] #define IDS_DATE StringTable[26] #define IDS_BAR StringTable[27] #define IDS_FULL_START StringTable[28] //--------------------------------------------------------------------------- #pragma package(smart_init) #pragma link "TPRuler2D" #pragma resource "*.dfm" THiddenPrintDataForm *HiddenPrintDataForm; //--------------------------------------------------------------------------- __fastcall THiddenPrintDataForm::THiddenPrintDataForm(TComponent* Owner) : TForm(Owner) { StringTable.Create(BaseDir, Language, "HiddenPrintData"); LandscapePrintTable.Create(BaseDir, Language, "Print_landscape"); CostPrintTable.Create(BaseDir, Language, "Print_cost"); if(Language == "English"){ QRLabel_divi->Alignment = taLeftJustify; QRLabel9->Alignment = taLeftJustify; QRLabel10->Alignment = taLeftJustify; QRLabel11->Alignment = taLeftJustify; QRLabel13->Alignment = taLeftJustify; QRLabel14->Alignment = taLeftJustify; QRLabel12->Alignment = taLeftJustify; QRLabel15->Alignment = taLeftJustify; QRLabel19->Alignment = taLeftJustify; QRLabel16->Alignment = taLeftJustify; QRLabel20->Alignment = taLeftJustify; QRLabel22->Alignment = taLeftJustify; QRLabel21->Alignment = taLeftJustify; QRLabel23->Alignment = taLeftJustify; QRLabel24->Alignment = taLeftJustify; QRLabel25->Alignment = taLeftJustify; QRLabel26->Alignment = taLeftJustify; QRLabel27->Alignment = taLeftJustify; QRLabel28->Alignment = taLeftJustify; QRLabel33->Alignment = taLeftJustify; QRLabel34->Alignment = taLeftJustify; QRLabel35->Alignment = taLeftJustify; QRLabel36->Alignment = taLeftJustify; QRLabel37->Alignment = taLeftJustify; QRLabel38->Alignment = taLeftJustify; QRLabel39->Alignment = taLeftJustify; QRLabel44->Alignment = taLeftJustify; QRLabel45->Alignment = taLeftJustify; QRLabel46->Alignment = taLeftJustify; QRLabel47->Alignment = taLeftJustify; QRLabel48->Alignment = taLeftJustify; QRLabel49->Alignment = taLeftJustify; QRLabel50->Alignment = taLeftJustify; QRLabel52->Alignment = taLeftJustify; QRLabel53->Alignment = taLeftJustify; QRLabel54->Alignment = taLeftJustify; QRLabel55->Alignment = taLeftJustify; QRLabel56->Alignment = taLeftJustify; QRLabel57->Alignment = taLeftJustify; QRLabel17->Alignment = taLeftJustify; QRLabel34->ParentFont = false; QRLabel34->Font = SmallFont; QRLabel34->Font->Size = 9; QRLabel34->Left = 339; QRLabel34->Top = 281; } AnsiString bgFilePath = BaseDir + "\\bgImage.bmp"; bgImage->Picture->LoadFromFile(bgFilePath); ListOfQRLabel=NULL; ListOfQRShape=NULL; ListOfQRImage=NULL; //by siuaa ListOfRulerLabel = NULL; QuickRepList = NULL; ListOfQRRichText = NULL; printer_qrSimple = Printer()->Printers->Strings[Printer()->PrinterIndex]; printer_qrSimpleLandscape = Printer()->Printers->Strings[Printer()->PrinterIndex]; printer_qrStandardSimulation = Printer()->Printers->Strings[Printer()->PrinterIndex]; printer_qrStandardDesign = Printer()->Printers->Strings[Printer()->PrinterIndex]; printer_qrStandardDesignImage = Printer()->Printers->Strings[Printer()->PrinterIndex]; printer_qrStandardYarn = Printer()->Printers->Strings[Printer()->PrinterIndex]; printer_qrStandardYarnVivien = Printer()->Printers->Strings[Printer()->PrinterIndex]; printer_qrTotalCost = Printer()->Printers->Strings[Printer()->PrinterIndex]; } //--------------------------------------------------------------------------- void __fastcall THiddenPrintDataForm::FormCreate(TObject *Sender) { SetFont(); CaptionInitialize(); } //--------------------------------------------------------------------------- void __fastcall THiddenPrintDataForm::SetFont(){ SetSmallFont(Font); //Landscape qrSimpleLandscape->Font->Size = 10; // Àӽÿë Ç¥ Å׵θ® Áö¿öÁü ¶§¹®¿¡ ¸¸µç°Í. NDJ 150306 SetSmallFont(qrSimpleLandscape->Font); //SetSmallFont(QRLabel4->Font); //ǰ¸íÀÌ ºüÁ®¼­ »©¹ö¸² SetSmallFont(qrl_0_1->Font); SetSmallFont(QRLabel3->Font); SetSmallFont(QRLabel142->Font); //Simple SetSmallFont(qrSimple->Font); SetSmallFont(qrlTitle->Font); SetSmallFont(QRLabel141->Font); //TotalCost qrTotalCost->Font->Size = 10; // Àӽÿë Ç¥ Å׵θ® Áö¿öÁü ¶§¹®¿¡ ¸¸µç°Í. NDJ 150306 SetSmallFont(qrTotalCost->Font); SetSmallFont(qrlTC_Title->Font); SetSmallFont(QRLabel147->Font); //SS SetSmallFont(qrStandardSimulation->Font); SetSmallFont(QRLabel18->Font); SetSmallFont(QRLabel143->Font); //SD SetSmallFont(qrStandardDesign->Font); SetSmallFont(QRLabel59->Font); SetSmallFont(QRLabel144->Font); //SY SetSmallFont(qrStandardYarn->Font); SetSmallFont(QRLabel61->Font); SetSmallFont(QRLabel148->Font); //SYV SetSmallFont(qrStandardYarnVivien->Font); SetSmallFont(QRLabel63->Font); SetSmallFont(QRLabel81->Font); SetSmallFont(QRLabel146->Font); //QRRichTextµî°ú °°´Â °ÍÀº Áö¿øÇÏ´Â Font°¡ ºÎÁ·ÇÏ¿© Àû¿ëÀÌ ¾ÈµÉ ¶§µµ ÀÖ´Ù //QRRichText1 ºÎÅÍ QRRichText(n) ±îÁö Àϰý º¯°æÇÑ´Ù SetSmallFont(QRRichText1->Font); SetSmallFont(QRRichText2->Font); SetSmallFont(QRRichText3->Font); SetSmallFont(QRRichText4->Font); SetSmallFont(QRRichText5->Font); SetSmallFont(QRRichText6->Font); SetSmallFont(QRRichText7->Font); SetSmallFont(QRRichText8->Font); SetSmallFont(QRRichText9->Font); SetSmallFont(QRRichText10->Font); SetSmallFont(QRRichText11->Font); SetSmallFont(QRRichText12->Font); SetSmallFont(QRRichText13->Font); SetSmallFont(QRRichText14->Font); SetSmallFont(QRRichText15->Font); SetSmallFont(QRRichText16->Font); SetSmallFont(QRRichText17->Font); SetSmallFont(QRRichText18->Font); SetSmallFont(QRRichText19->Font); SetSmallFont(QRRichText20->Font); //todo:2007.01.10 diekun Pitch¸¦ Á¶ÀýÇØºÃÁö¸¸ º° È¿°ú ¾ø¾úÀ½. //QRRichText20->Font->Pitch = fpFixed; SetSmallFont(QRRichText21->Font); SetSmallFont(QRRichText22->Font); SetSmallFont(QRRichText23->Font); SetSmallFont(QRRichText24->Font); SetSmallFont(QRRichText25->Font); SetSmallFont(QRRichText26->Font); SetSmallFont(QRRichText27->Font); SetSmallFont(QRRichText28->Font); SetSmallFont(QRRichText29->Font); SetSmallFont(QRRichText30->Font); SetSmallFont(QRRichText31->Font); SetSmallFont(QRRichText32->Font); SetSmallFont(QRRichText33->Font); SetSmallFont(QRRichText34->Font); SetSmallFont(QRRichText35->Font); SetSmallFont(QRRichText36->Font); SetSmallFont(QRRichText37->Font); SetSmallFont(QRRichText38->Font); SetSmallFont(QRRichText39->Font); SetSmallFont(QRRichText40->Font); SetSmallFont(QRRichText41->Font); SetSmallFont(QRRichText42->Font); SetSmallFont(QRRichText43->Font); SetSmallFont(QRRichText44->Font); SetSmallFont(QRRichText45->Font); SetSmallFont(QRRichText46->Font); SetSmallFont(QRRichText47->Font); SetSmallFont(QRRichText48->Font); SetSmallFont(QRRichText49->Font); SetSmallFont(QRRichText50->Font); SetSmallFont(QRRichText51->Font); SetSmallFont(QRRichText52->Font); SetSmallFont(QRRichText53->Font); SetSmallFont(QRRichText54->Font); SetSmallFont(QRRichText55->Font); SetSmallFont(QRRichText56->Font); SetSmallFont(QRRichText57->Font); SetSmallFont(QRRichText58->Font); //SetSmallFont(QRRichText59->Font); //SetSmallFont(QRRichText60->Font); SetSmallFont(QRRichText60->Font); SetSmallFont(QRRichText61->Font); SetSmallFont(QRRichText62->Font); SetSmallFont(QRRichText63->Font); SetSmallFont(QRRichText64->Font); SetSmallFont(QRRichText65->Font); // (06.11.08) SetSmallFont(QRLabel145->Font); SetSmallFont(AnyQRImage->Canvas->Font);//090617 } //--------------------------------------------------------------------------- void __fastcall THiddenPrintDataForm::Endqr(){ if(ListOfQRLabel){ TQRLabel *qrl; for (int i = 0; i < ListOfQRLabel->Count; i++) { qrl = (TQRLabel *)ListOfQRLabel->Items[i]; delete qrl; } ListOfQRLabel->Clear(); delete ListOfQRLabel; ListOfQRLabel=NULL; } if(ListOfQRShape){ TQRShape *qrs; for (int i = 0; i< ListOfQRShape->Count; i++) { qrs = (TQRShape *)ListOfQRShape->Items[i]; delete qrs; } ListOfQRShape->Clear(); delete ListOfQRShape; ListOfQRShape=NULL; } if(ListOfQRImage){ TQRImage *qri; for (int i = 0; i< ListOfQRImage->Count; i++) { qri = (TQRImage *)ListOfQRImage->Items[i]; delete qri; } ListOfQRImage->Clear(); delete ListOfQRImage; ListOfQRImage=NULL; } //by siuaa if(ListOfRulerLabel){ TQRLabel *label; for (int i = 0; i < ListOfRulerLabel->Count; i++) { label =(TQRLabel *)ListOfRulerLabel->Items[i]; delete label; } ListOfRulerLabel->Clear(); delete ListOfRulerLabel; ListOfRulerLabel = NULL; } if(ListOfQRRichText){ TQRRichText *qrr; for (int i = 0; i< ListOfQRRichText->Count; i++) { qrr = (TQRRichText *)ListOfQRRichText->Items[i]; delete qrr; } ListOfQRRichText->Clear(); delete ListOfQRRichText; ListOfQRRichText=NULL; } if(QuickRepList) { for (int i = 0; i < QuickRepList->Count; i++) { TQuickRep *aRep = (TQuickRep *)QuickRepList->Items[i]; delete aRep; } QuickRepList->Clear(); delete QuickRepList; QuickRepList = NULL; } } //--------------------------------------------------------------------------- void __fastcall THiddenPrintDataForm::SetqrSimpleLandscape() { //////////////////////////////////////////////////////////////////////////////// Main->SetAll(); //////////////////////////////////////////////////////////////////////////////// int YU[MAX_LAYER_COUNT]={0,0,0,0,0,0,0}; AnsiString Spec[MAX_LAYER_COUNT]; for(int l=0;lmaindata.bar;l++){ for(int m=0;mtexlayer->YarnUseList->Count;m++){ YarnUse *yu = (YarnUse *)Main->texlayer->YarnUseList->Items[m]; if(yu->layer_num==l){ AnsiString str; Yarn *yarn=(Yarn *)Main->texlayer->YarnList->Items[yu->yarnIndex]; YarnCompositionData_F->AddYMToStr(str,yarn->ym,yarn->ymDirect); str+=IntToStr((int)yarn->denier); str+="/"; str+=IntToStr(yarn->filament); str+=" "; YarnCompositionData_F->AddYPToStr(str,yarn->yp,yarn->ypDirect); Spec[l]=str; YU[l]=m; break; } } } //////////////////////////////////////////////////////////////////////////////// AnsiString InOut[MAX_LAYER_COUNT]={"FULL","FULL","FULL","FULL","FULL","FULL","FULL"}; for(int l=0;lmaindata.bar;l++){ if(GuideBar_F->gd.iodescription[l]!=""){ InOut[l]=GuideBar_F->gd.iodescription[l]; continue; } AnsiString str; Tex *tex = ((Tex *)Main->texlayer->TexList->Items[l]); for(int i=0;iWales->Count;i++){ WaleState *ws = (WaleState *)tex->Wales->Items[i]; if(ws->in){ str+=IntToStr(ws->cnt)+"o "; } else { str+=IntToStr(ws->cnt)+"x "; } } if(tex->Wales->Count==1)str="FULL"; if(str!="")InOut[l]=str; } //////////////////////////////////////////////////////////////////////////////// AnsiString Chain[MAX_LAYER_COUNT]; for(int l=0;lmaindata.bar;l++){ AnsiString str; Tex *tex = ((Tex *)Main->texlayer->TexList->Items[l]); if(tex->Curve->Count%2||tex->Curve->Count<3){ //Ȧ¼öÀ̸é ÀüºÎ Ç¥Çö for(int i=0;iCurve->Count;i++){ KO *ko = (KO *)tex->Curve->Items[i]; if(PrintForm->rgChain->ItemIndex==0){ str+=IntToStr(ko->in)+IntToStr(ko->via)+" "; } else { str+=IntToStr(ko->in)+IntToStr(ko->via)+IntToStr(ko->out)+" "; } if(i==5&&tex->Curve->Count>6){ //³ÑÄ¡¸é Ç¥Çö ¾ÈÇÔ str+="..."; break; } } } else { // ¦¼öÀ̸é Áߺ¹ üũ // bool repeat=true; KO *ko01 = (KO *)tex->Curve->Items[0]; KO *ko02 = (KO *)tex->Curve->Items[1]; for(int i=0;iCurve->Count/2;i++){ KO *ko1 = (KO *)tex->Curve->Items[2*i]; KO *ko2 = (KO *)tex->Curve->Items[2*i+1]; if(ko01->in!=ko1->in||ko01->via!=ko1->via|| ko02->in!=ko2->in||ko02->via!=ko2->via) { repeat=false; break; } } if(repeat){ KO *ko1 = (KO *)tex->Curve->Items[0]; KO *ko2 = (KO *)tex->Curve->Items[1]; if(PrintForm->rgChain->ItemIndex==0){ str+=IntToStr(ko1->in)+IntToStr(ko1->via)+" "+IntToStr(ko2->in)+IntToStr(ko2->via)+" "; } else { str+=IntToStr(ko1->in)+IntToStr(ko1->via)+IntToStr(ko1->out)+" "+ IntToStr(ko2->in)+IntToStr(ko2->via)+IntToStr(ko2->out)+" "; } } else { for(int i=0;iCurve->Count;i++){ KO *ko = (KO *)tex->Curve->Items[i]; if(PrintForm->rgChain->ItemIndex==0){ str+=IntToStr(ko->in)+IntToStr(ko->via)+" "; } else { str+=IntToStr(ko->in)+IntToStr(ko->via)+IntToStr(ko->out)+" "; } if(i==5&&tex->Curve->Count>6){ //³ÑÄ¡¸é Ç¥Çö ¾ÈÇÔ str+="..."; break; } } } } Chain[l]=str; } //////////////////////////////////////////////////////////////////////////////// char buf[256]; Extended value; //////////////////////////////////////////////////////////////////////////////// AnsiString s1=ExtractFileName(Main->maindata.FileName); s1=s1.SubString(1,s1.Length()-4); s1=s1.UpperCase(); AnsiString fileName = "< "; fileName += s1; fileName += " >"; qrl_0_1->Caption=fileName; qrl_1_1->Caption=MyFloatToStr(MetaDataForm->md.testw*MetaDataForm->md.testh,2)+"cm*cm"; qrl_1_2->Caption=MyFloatToStr(MetaDataForm->md.testweight,2)+"g"; qrl_1_3->Caption=MyFloatToStr(SimulationForm->sd.width,2)+"\""; qrl_1_4->Caption=MyFloatToStr(SimulationForm->sd.gauge,2)+"w/inch"; memset(buf,0,256); double weight1=value=SimulationForm->sd.width* 2.54*91.44*MetaDataForm->md.testweight/(MetaDataForm->md.testw*MetaDataForm->md.testh); FloatToText(buf, &value, fvExtended, ffNumber, 8, 1); qrl_1_5->Caption=AnsiString(buf)+"g"; qrl_1_6->Caption=MyFloatToStr(SimulationForm->sd.cpc,2)+"c/cm"; memset(buf,0,256); value=-(SimulationForm->sd.cpc-Main->maindata.cpc)/SimulationForm->sd.cpc*100; FloatToText(buf, &value, fvExtended, ffNumber, 8, 1); qrl_1_7->Caption=AnsiString(buf)+"%"; qrl_2_1->Caption=MyFloatToStr(Main->maindata.width,2)+"\""; qrl_2_2->Caption=IntToStr(Main->maindata.gauge)+"w/inch"; memset(buf,0,256); double weight2=value=weight1/SimulationForm->sd.cpc*Main->maindata.cpc; FloatToText(buf, &value, fvExtended, ffNumber, 8, 1); qrl_2_3->Caption=AnsiString(buf)+"g"; qrl_2_4->Caption=MyFloatToStr(Main->maindata.cpc,2)+"c/cm"; qrl_3_1->Caption=MetaDataForm->md.machineName; qrl_3_2->Caption=MyFloatToStr(Main->maindata.width,2)+"\""; qrl_3_3->Caption=IntToStr(MetaDataForm->md.rpm); qrl_3_4->Caption=MyFloatToStr(Main->maindata.cpc,2)+"c/cm"; memset(buf,0,256); value=weight2; FloatToText(buf, &value, fvExtended, ffNumber, 8, 1); qrl_3_5->Caption=AnsiString(buf)+"g"; qrl_3_6->Caption=IntToStr(MetaDataForm->md.cutyard); memset(buf,0,256); value=weight2*MetaDataForm->md.cutyard/1000; FloatToText(buf, &value, fvExtended, ffNumber, 8, 3); qrl_3_7->Caption=AnsiString(buf)+"kg"; qrl_3_8->Caption=MetaDataForm->md.Time; QRLabel29->Caption = ""; QRLabel30->Caption = ""; QRLabel31->Caption = ""; QRLabel32->Caption = ""; QRLabel139->Caption = ""; QRLabel149->Caption = ""; QRLabel_7_9->Caption = ""; QRLabel_7_10->Caption = ""; QRLabel_7_11->Caption = ""; QRLabel_7_12->Caption = ""; QRLabel_7_13->Caption = ""; QRLabel_7_14->Caption = ""; QRLabel_7_15->Caption = ""; qrl_4_1->Caption= ""; qrl_4_2->Caption= ""; qrl_4_3->Caption= ""; qrl_4_4->Caption= ""; qrl_4_5->Caption= ""; qrl_4_6->Caption= ""; qrl_5_1->Caption= ""; qrl_5_2->Caption= ""; qrl_5_3->Caption= ""; qrl_5_4->Caption= ""; qrl_5_5->Caption= ""; qrl_5_6->Caption= ""; qrl_6_1->Caption= ""; qrl_6_2->Caption= ""; qrl_6_3->Caption= ""; qrl_6_4->Caption= ""; qrl_6_5->Caption= ""; qrl_6_6->Caption= ""; qrl_7_1->Caption= ""; qrl_7_2->Caption= ""; qrl_7_3->Caption= ""; qrl_7_4->Caption= ""; qrl_7_5->Caption= ""; qrl_7_6->Caption= ""; qrl_15_1->Caption= ""; qrl_15_2->Caption= ""; qrl_15_3->Caption= ""; qrl_15_4->Caption= ""; qrl_15_5->Caption= ""; qrl_15_6->Caption= ""; qrl_17_1->Caption= ""; qrl_17_2->Caption= ""; qrl_17_3->Caption= ""; qrl_17_4->Caption= ""; qrl_17_5->Caption= ""; qrl_17_6->Caption= ""; if(Main->maindata.bar>0){ if (Main->LayerMode) QRLabel29->Caption = "GB" + IntToStr(Main->maindata.bar); else QRLabel29->Caption = "L1"; YarnUse *yu = (YarnUse *)Main->texlayer->YarnUseList->Items[YU[0]]; Yarn *yarn = (Yarn *)Main->texlayer->YarnList->Items[yu->yarnIndex]; qrl_4_1->Caption=Spec[0]; qrl_4_2->Caption=IntToStr(yu->use); qrl_4_3->Caption=IntToStr(yu->beam); qrl_4_4->Caption=AnsiString(yarn->lot); qrl_4_5->Caption=InOut[0]; qrl_4_6->Caption=Chain[0]; } if(Main->maindata.bar>1){ if (Main->LayerMode) QRLabel30->Caption = "GB" + IntToStr(Main->maindata.bar - 1); else QRLabel30->Caption = "L2"; YarnUse *yu = (YarnUse *)Main->texlayer->YarnUseList->Items[YU[1]]; Yarn *yarn = (Yarn *)Main->texlayer->YarnList->Items[yu->yarnIndex]; qrl_5_1->Caption=Spec[1]; qrl_5_2->Caption=IntToStr(yu->use); qrl_5_3->Caption=IntToStr(yu->beam); qrl_5_4->Caption=AnsiString(yarn->lot); qrl_5_5->Caption=InOut[1]; qrl_5_6->Caption=Chain[1]; } if(Main->maindata.bar>2){ if (Main->LayerMode) QRLabel31->Caption = "GB" + IntToStr(Main->maindata.bar - 2); else QRLabel31->Caption = "L3"; YarnUse *yu = (YarnUse *)Main->texlayer->YarnUseList->Items[YU[2]]; Yarn *yarn = (Yarn *)Main->texlayer->YarnList->Items[yu->yarnIndex]; qrl_6_1->Caption=Spec[2]; qrl_6_2->Caption=IntToStr(yu->use); qrl_6_3->Caption=IntToStr(yu->beam); qrl_6_4->Caption=AnsiString(yarn->lot); qrl_6_5->Caption=InOut[2]; qrl_6_6->Caption=Chain[2]; } if(Main->maindata.bar>3){ if (Main->LayerMode) QRLabel32->Caption = "GB" + IntToStr(Main->maindata.bar - 3); else QRLabel32->Caption = "L4"; YarnUse *yu = (YarnUse *)Main->texlayer->YarnUseList->Items[YU[3]]; Yarn *yarn = (Yarn *)Main->texlayer->YarnList->Items[yu->yarnIndex]; qrl_7_1->Caption=Spec[3]; qrl_7_2->Caption=IntToStr(yu->use); qrl_7_3->Caption=IntToStr(yu->beam); qrl_7_4->Caption=AnsiString(yarn->lot); qrl_7_5->Caption=InOut[3]; qrl_7_6->Caption=Chain[3]; } if(Main->maindata.bar>4){ if (Main->LayerMode) QRLabel139->Caption = "GB" + IntToStr(Main->maindata.bar - 4); else QRLabel139->Caption = "L5"; YarnUse *yu = (YarnUse *)Main->texlayer->YarnUseList->Items[YU[4]]; Yarn *yarn = (Yarn *)Main->texlayer->YarnList->Items[yu->yarnIndex]; qrl_15_1->Caption=Spec[4]; qrl_15_2->Caption=IntToStr(yu->use); qrl_15_3->Caption=IntToStr(yu->beam); qrl_15_4->Caption=AnsiString(yarn->lot); qrl_15_5->Caption=InOut[4]; qrl_15_6->Caption=Chain[4]; } if(Main->maindata.bar>5){ if (Main->LayerMode) QRLabel149->Caption = "GB" + IntToStr(Main->maindata.bar - 5); else QRLabel149->Caption = "L6"; YarnUse *yu = (YarnUse *)Main->texlayer->YarnUseList->Items[YU[5]]; Yarn *yarn = (Yarn *)Main->texlayer->YarnList->Items[yu->yarnIndex]; qrl_17_1->Caption=Spec[5]; qrl_17_2->Caption=IntToStr(yu->use); qrl_17_3->Caption=IntToStr(yu->beam); qrl_17_4->Caption=AnsiString(yarn->lot); qrl_17_5->Caption=InOut[5]; qrl_17_6->Caption=Chain[5]; } if(Main->maindata.bar>6){ if (Main->LayerMode) QRLabel_7_9->Caption = "GB" + IntToStr(Main->maindata.bar - 6); else QRLabel_7_9->Caption = "L7"; YarnUse *yu = (YarnUse *)Main->texlayer->YarnUseList->Items[YU[6]]; Yarn *yarn = (Yarn *)Main->texlayer->YarnList->Items[yu->yarnIndex]; QRLabel_7_10->Caption=Spec[6]; QRLabel_7_11->Caption=IntToStr(yu->use); QRLabel_7_12->Caption=IntToStr(yu->beam); QRLabel_7_13->Caption=AnsiString(yarn->lot); QRLabel_7_14->Caption=InOut[6]; QRLabel_7_15->Caption=Chain[6]; } QRLabel40->Caption = ""; QRLabel41->Caption = ""; QRLabel42->Caption = ""; QRLabel43->Caption = ""; QRLabel140->Caption = ""; QRLabel163->Caption = ""; QRLabel_7_1->Caption = ""; QRLabel_7_2->Caption = ""; QRLabel_7_3->Caption = ""; QRLabel_7_4->Caption = ""; QRLabel_7_5->Caption = ""; QRLabel_7_6->Caption = ""; QRLabel_7_7->Caption = ""; QRLabel_7_8->Caption = ""; qrl_9_1->Caption= ""; qrl_9_2->Caption= ""; qrl_9_3->Caption= ""; qrl_9_4->Caption= ""; qrl_9_5->Caption= ""; qrl_9_6->Caption= ""; qrl_9_7->Caption= ""; qrl_10_1->Caption= ""; qrl_10_2->Caption= ""; qrl_10_3->Caption= ""; qrl_10_4->Caption= ""; qrl_10_5->Caption= ""; qrl_10_6->Caption= ""; qrl_10_7->Caption= ""; qrl_11_1->Caption= ""; qrl_11_2->Caption= ""; qrl_11_3->Caption= ""; qrl_11_4->Caption= ""; qrl_11_5->Caption= ""; qrl_11_6->Caption= ""; qrl_11_7->Caption= ""; qrl_12_1->Caption= ""; qrl_12_2->Caption= ""; qrl_12_3->Caption= ""; qrl_12_4->Caption= ""; qrl_12_5->Caption= ""; qrl_12_6->Caption= ""; qrl_12_7->Caption= ""; qrl_16_1->Caption= ""; qrl_16_2->Caption= ""; qrl_16_3->Caption= ""; qrl_16_4->Caption= ""; qrl_16_5->Caption= ""; qrl_16_6->Caption= ""; qrl_16_7->Caption= ""; qrl_18_1->Caption= ""; qrl_18_2->Caption= ""; qrl_18_3->Caption= ""; qrl_18_4->Caption= ""; qrl_18_5->Caption= ""; qrl_18_6->Caption= ""; qrl_18_7->Caption= ""; if(Main->maindata.bar>0){ if (Main->LayerMode) QRLabel40->Caption = "GB" + IntToStr(Main->maindata.bar); else QRLabel40->Caption = "L1"; YarnUse *yu = (YarnUse *)Main->texlayer->YarnUseList->Items[YU[0]]; Yarn *yarn = (Yarn *)Main->texlayer->YarnList->Items[yu->yarnIndex]; qrl_9_1->Caption=MyFloatToStr(Main->maindata.cpc,2)+"c/cm"; qrl_9_2->Caption=IntToStr(yu->mmPerRACK); qrl_9_3->Caption=IntToStr(yu->total_use); qrl_9_4->Caption=IntToStr((int)yarn->denier); memset(buf,0,256); value=yu->GPY; FloatToText(buf, &value, fvExtended, ffNumber, 8, 3); qrl_9_5->Caption=AnsiString(buf)+"g"; memset(buf,0,256); value=yu->percent; FloatToText(buf, &value, fvExtended, ffNumber, 8, 3); qrl_9_6->Caption=AnsiString(buf)+"%"; qrl_9_7->Caption=IntToStr((int)(yu->MPY*1000+0.5))+"mm"; } if(Main->maindata.bar>1){ if (Main->LayerMode) QRLabel41->Caption = "GB" + IntToStr(Main->maindata.bar - 1); else QRLabel41->Caption = "L2"; YarnUse *yu = (YarnUse *)Main->texlayer->YarnUseList->Items[YU[1]]; Yarn *yarn = (Yarn *)Main->texlayer->YarnList->Items[yu->yarnIndex]; qrl_10_1->Caption=MyFloatToStr(Main->maindata.cpc,2)+"c/cm"; qrl_10_2->Caption=IntToStr(yu->mmPerRACK); qrl_10_3->Caption=IntToStr(yu->total_use); qrl_10_4->Caption=IntToStr((int)yarn->denier); memset(buf,0,256); value=yu->GPY; FloatToText(buf, &value, fvExtended, ffNumber, 8, 3); qrl_10_5->Caption=AnsiString(buf)+"g"; memset(buf,0,256); value=yu->percent; FloatToText(buf, &value, fvExtended, ffNumber, 8, 3); qrl_10_6->Caption=AnsiString(buf)+"%"; qrl_10_7->Caption=IntToStr((int)(yu->MPY*1000+0.5))+"mm"; } if(Main->maindata.bar>2){ if (Main->LayerMode) QRLabel42->Caption = "GB" + IntToStr(Main->maindata.bar - 2); else QRLabel42->Caption = "L3"; YarnUse *yu = (YarnUse *)Main->texlayer->YarnUseList->Items[YU[2]]; Yarn *yarn = (Yarn *)Main->texlayer->YarnList->Items[yu->yarnIndex]; qrl_11_1->Caption=MyFloatToStr(Main->maindata.cpc,2)+"c/cm"; qrl_11_2->Caption=IntToStr(yu->mmPerRACK); qrl_11_3->Caption=IntToStr(yu->total_use); qrl_11_4->Caption=IntToStr((int)yarn->denier); memset(buf,0,256); value=yu->GPY; FloatToText(buf, &value, fvExtended, ffNumber, 8, 3); qrl_11_5->Caption=AnsiString(buf)+"g"; memset(buf,0,256); value=yu->percent; FloatToText(buf, &value, fvExtended, ffNumber, 8, 3); qrl_11_6->Caption=AnsiString(buf)+"%"; qrl_11_7->Caption=IntToStr((int)(yu->MPY*1000+0.5))+"mm"; } if(Main->maindata.bar>3){ if (Main->LayerMode) QRLabel43->Caption = "GB" + IntToStr(Main->maindata.bar - 3); else QRLabel43->Caption = "L4"; YarnUse *yu = (YarnUse *)Main->texlayer->YarnUseList->Items[YU[3]]; Yarn *yarn = (Yarn *)Main->texlayer->YarnList->Items[yu->yarnIndex]; qrl_12_1->Caption=MyFloatToStr(Main->maindata.cpc,2)+"c/cm"; qrl_12_2->Caption=IntToStr(yu->mmPerRACK); qrl_12_3->Caption=IntToStr(yu->total_use); qrl_12_4->Caption=IntToStr((int)yarn->denier); memset(buf,0,256); value=yu->GPY; FloatToText(buf, &value, fvExtended, ffNumber, 8, 3); qrl_12_5->Caption=AnsiString(buf)+"g"; memset(buf,0,256); value=yu->percent; FloatToText(buf, &value, fvExtended, ffNumber, 8, 3); qrl_12_6->Caption=AnsiString(buf)+"%"; qrl_12_7->Caption=IntToStr((int)(yu->MPY*1000+0.5))+"mm"; } if(Main->maindata.bar>4){ if (Main->LayerMode) QRLabel140->Caption = "GB" + IntToStr(Main->maindata.bar - 4); else QRLabel140->Caption = "L5"; YarnUse *yu = (YarnUse *)Main->texlayer->YarnUseList->Items[YU[4]]; Yarn *yarn = (Yarn *)Main->texlayer->YarnList->Items[yu->yarnIndex]; qrl_16_1->Caption=MyFloatToStr(Main->maindata.cpc,2)+"c/cm"; qrl_16_2->Caption=IntToStr(yu->mmPerRACK); qrl_16_3->Caption=IntToStr(yu->total_use); qrl_16_4->Caption=IntToStr((int)yarn->denier); memset(buf,0,256); value=yu->GPY; FloatToText(buf, &value, fvExtended, ffNumber, 8, 3); qrl_16_5->Caption=AnsiString(buf)+"g"; memset(buf,0,256); value=yu->percent; FloatToText(buf, &value, fvExtended, ffNumber, 8, 3); qrl_16_6->Caption=AnsiString(buf)+"%"; qrl_16_7->Caption=IntToStr((int)(yu->MPY*1000+0.5))+"mm"; } if(Main->maindata.bar>5){ if (Main->LayerMode) QRLabel163->Caption = "GB" + IntToStr(Main->maindata.bar - 5); else QRLabel163->Caption = "L6"; YarnUse *yu = (YarnUse *)Main->texlayer->YarnUseList->Items[YU[5]]; Yarn *yarn = (Yarn *)Main->texlayer->YarnList->Items[yu->yarnIndex]; qrl_18_1->Caption=MyFloatToStr(Main->maindata.cpc,2)+"c/cm"; qrl_18_2->Caption=IntToStr(yu->mmPerRACK); qrl_18_3->Caption=IntToStr(yu->total_use); qrl_18_4->Caption=IntToStr((int)yarn->denier); memset(buf,0,256); value=yu->GPY; FloatToText(buf, &value, fvExtended, ffNumber, 8, 3); qrl_18_5->Caption=AnsiString(buf)+"g"; memset(buf,0,256); value=yu->percent; FloatToText(buf, &value, fvExtended, ffNumber, 8, 3); qrl_18_6->Caption=AnsiString(buf)+"%"; qrl_18_7->Caption=IntToStr((int)(yu->MPY*1000+0.5))+"mm"; } if(Main->maindata.bar>6){ if (Main->LayerMode) QRLabel_7_1->Caption = "GB" + IntToStr(Main->maindata.bar - 6); else QRLabel_7_1->Caption = "L7"; YarnUse *yu = (YarnUse *)Main->texlayer->YarnUseList->Items[YU[6]]; Yarn *yarn = (Yarn *)Main->texlayer->YarnList->Items[yu->yarnIndex]; QRLabel_7_2->Caption=MyFloatToStr(Main->maindata.cpc,2)+"c/cm"; QRLabel_7_3->Caption=IntToStr(yu->mmPerRACK); QRLabel_7_4->Caption=IntToStr(yu->total_use); QRLabel_7_5->Caption=IntToStr((int)yarn->denier); memset(buf,0,256); value=yu->GPY; FloatToText(buf, &value, fvExtended, ffNumber, 8, 3); QRLabel_7_6->Caption=AnsiString(buf)+"g"; memset(buf,0,256); value=yu->percent; FloatToText(buf, &value, fvExtended, ffNumber, 8, 3); QRLabel_7_7->Caption=AnsiString(buf)+"%"; QRLabel_7_8->Caption=IntToStr((int)(yu->MPY*1000+0.5))+"mm"; } double total_weight=0; int total_length=0; for(int i=0;imaindata.bar;i++){ YarnUse *yu = (YarnUse *)Main->texlayer->YarnUseList->Items[YU[i]]; total_weight+=yu->GPY; total_length+=(int)(yu->MPY*1000+0.5); } memset(buf,0,256); value=total_weight; FloatToText(buf, &value, fvExtended, ffNumber, 8, 3); qrl_13_1->Caption=AnsiString(buf)+"g"; qrl_13_2->Caption="100.000%"; qrl_13_3->Caption=IntToStr(total_length)+"mm"; qrl_14_1->Caption=IntToStr(MetaDataForm->md.rpm); qrl_14_2->Caption=MyFloatToStr(Main->maindata.cpc,2)+"c/cm"; qrl_14_3->Caption=MyFloatToStr(MetaDataForm->md.hours,2); qrl_14_4->Caption=IntToStr(MetaDataForm->md.efficiency)+"%"; qrl_14_5->Caption=IntToStr(MetaDataForm->md.count_of_w); qrl_14_6->Caption=IntToStr(MetaDataForm->md.yield_per_day)+"Y"; QRLabel142->Caption=MetaDataForm->md.ResponsiblePart;//by maxleo21c (06.11.08) } //--------------------------------------------------------------------------- void __fastcall THiddenPrintDataForm::SetqrSimple(){ ListOfQRLabel = new TList(); ListOfQRRichText = new TList(); ListOfQRImage = new TList(); QuickRepList = new TList(); TQuickRep *currentRep = new TQuickRep(this); currentRep->OnNeedData = RepNeedData; QuickRepList->Add(currentRep); const int initTop = 45; const int bottomMargin = 45; const int lineHeight = 17; int currentY = initTop; //////////////////////////////////////////////////////////////////////////////// char buf[256]; Extended value; int barCount = Main->maindata.bar; //////////////////////////////////////////////////////////////////////////////// Main->SetAll(); //////////////////////////////////////////////////////////////////////////////// qrlTitle->Caption = IDS_SimpleTitle; AnsiString InOut[MAX_LAYER_COUNT]={"FULL","FULL","FULL","FULL","FULL","FULL","FULL"}; for(int l=0;lmaindata.bar;l++){ if(GuideBar_F->gd.iodescription[l]!=""){ InOut[l]=GuideBar_F->gd.iodescription[l]; continue; } AnsiString str; Tex *tex = ((Tex *)Main->texlayer->TexList->Items[l]); for(int i=0;iWales->Count;i++){ WaleState *ws = (WaleState *)tex->Wales->Items[i]; if(ws->in){ str+=IntToStr(ws->cnt)+AnsiString((char)('A'+ws->yarnIndex))+" "; } else { str+=IntToStr(ws->cnt)+"X "; } } if(tex->Wales->Count==1)str="FULL"; if(str!="")InOut[l]=str; } //////////////////////////////////////////////////////////////////////////////// AnsiString Chain[MAX_LAYER_COUNT]; for(int l=0;lmaindata.bar;l++){ AnsiString str; Tex *tex = ((Tex *)Main->texlayer->TexList->Items[l]); if(tex->Curve->Count%2||tex->Curve->Count<3){ //Ȧ¼öÀ̸é ÀüºÎ Ç¥Çö for(int i=0;iCurve->Count;i++){ KO *ko = (KO *)tex->Curve->Items[i]; if(PrintForm->rgChain->ItemIndex==0){ str+=IntToStr(ko->in)+IntToStr(ko->via)+" "; } else { str+=IntToStr(ko->in)+IntToStr(ko->via)+IntToStr(ko->out)+" "; } } } else { // ¦¼öÀ̸é Áߺ¹ üũ // bool repeat=true; KO *ko01 = (KO *)tex->Curve->Items[0]; KO *ko02 = (KO *)tex->Curve->Items[1]; for(int i=0;iCurve->Count/2;i++){ KO *ko1 = (KO *)tex->Curve->Items[2*i]; KO *ko2 = (KO *)tex->Curve->Items[2*i+1]; if(ko01->in!=ko1->in||ko01->via!=ko1->via|| ko02->in!=ko2->in||ko02->via!=ko2->via) { repeat=false; break; } } if(repeat){ KO *ko1 = (KO *)tex->Curve->Items[0]; KO *ko2 = (KO *)tex->Curve->Items[1]; if(PrintForm->rgChain->ItemIndex==0){ str+=IntToStr(ko1->in)+IntToStr(ko1->via)+" "+IntToStr(ko2->in)+IntToStr(ko2->via)+" "; } else { str+=IntToStr(ko1->in)+IntToStr(ko1->via)+IntToStr(ko1->out)+" "+ IntToStr(ko2->in)+IntToStr(ko2->via)+IntToStr(ko2->out)+" "; } } else { for(int i=0;iCurve->Count;i++){ KO *ko = (KO *)tex->Curve->Items[i]; if(PrintForm->rgChain->ItemIndex==0){ str+=IntToStr(ko->in)+IntToStr(ko->via)+" "; } else { str+=IntToStr(ko->in)+IntToStr(ko->via)+IntToStr(ko->out)+" "; } } } } Chain[l]=str; } //////////////////////////////////////////////////////////////////////////////// AnsiString s1 = ExtractFileName(Main->maindata.FileName); s1= s1.SubString(1, s1.Length() - 4); s1= s1.UpperCase(); TQRLabel *titleLabel = CreateQRLabel(qrlTitle); titleLabel->Parent = currentRep; titleLabel->Top = currentY; ListOfQRLabel->Add(titleLabel); currentY += (titleLabel->Height + 20); TQRLabel *nameLabel = CreateQRLabel(QRLabel2); nameLabel->Parent = currentRep; nameLabel->Top = currentY; //nameLabel->Caption = "NAME : " + s1; SetSmallFont(nameLabel->Font); nameLabel->Caption = IDS_NAME + " " + s1; // Chinese TDW NDJ ListOfQRLabel->Add(nameLabel); currentY += nameLabel->Height; TQRLabel *codeLabel = CreateQRLabel(QRLabel60); codeLabel->Parent = currentRep; codeLabel->Top = currentY; //codeLabel->Caption= "CODE : " + Main->maindata.ProductCode; SetSmallFont(codeLabel->Font); codeLabel->Caption= IDS_CODE_COLON + " " + Main->maindata.ProductCode; // Chinese TDW NDJ ListOfQRLabel->Add(codeLabel); TQRLabel *dateLabel = CreateQRLabel(QRLabel58); dateLabel->Parent = currentRep; dateLabel->Top = currentY; //dateLabel->Caption= "DATE : " + MetaDataForm->md.Time; SetSmallFont(dateLabel->Font); dateLabel->Caption= IDS_DATE + " " + MetaDataForm->md.Time; // Chinese TDW NDJ ListOfQRLabel->Add(dateLabel); currentY += (dateLabel->Height + 10); TQRLabel *partLabel = CreateQRLabel(QRLabel141); partLabel->Parent = currentRep; partLabel->Caption = MetaDataForm->md.ResponsiblePart;//by maxleo21c (06.11.08) ListOfQRLabel->Add(partLabel); //·Î°íÀ̹ÌÁö Ç¥½Ã 2006.11.08. diekun TQRImage *logoImg = CreateQRImage(QRImgLogo); logoImg->Parent = currentRep; if(!MetaDataForm->md.bmpLogo->Empty) logoImg->Picture->Assign(MetaDataForm->md.bmpLogo); else{ logoImg->Picture->Bitmap->Height = 0; logoImg->Picture->Bitmap->Width=QRImgLogo->Width; logoImg->Picture->Bitmap->Height=QRImgLogo->Height; } if(logoImg->Height > 41){ int resizeHeight = 41; int resizeWidth = logoImg->Width*41/logoImg->Height; logoImg->Height = resizeHeight; logoImg->Width = resizeWidth; } logoImg->Left = partLabel->Left + partLabel->Width - partLabel->Width; ListOfQRImage->Add(logoImg); //////////////////////////////////////////////////////////////////////////////// TQRRichText *barColumnRichText = CreateQRRichText(QRRichText12); //barColumnRichText->Lines->Add("BAR"); SetSmallFont(barColumnRichText->Font); barColumnRichText->Lines->Add(IDS_BAR);// Chinese TDW NDJ barColumnRichText->Height = barColumnRichText->Lines->Count * lineHeight; if(currentY + barColumnRichText->Height > currentRep->Height - bottomMargin) { currentY = initTop; currentRep = new TQuickRep(this); currentRep->OnNeedData = RepNeedData; QuickRepList->Add(currentRep); } barColumnRichText->Parent = currentRep; barColumnRichText->Top = currentY; ListOfQRRichText->Add(barColumnRichText); TQRRichText *yarnColumnRichText = CreateQRRichText(QRRichText13); SetSmallFont(yarnColumnRichText->Font); yarnColumnRichText->Lines->Add(IDS_IDX); yarnColumnRichText->Height = yarnColumnRichText->Lines->Count * lineHeight; yarnColumnRichText->Parent = currentRep; yarnColumnRichText->Top = currentY; ListOfQRRichText->Add(yarnColumnRichText); TQRRichText *makerColumnRichText = CreateQRRichText(QRRichText2); SetSmallFont(makerColumnRichText->Font); makerColumnRichText->Lines->Add(IDS_MAKER); makerColumnRichText->Height = makerColumnRichText->Lines->Count * lineHeight; makerColumnRichText->Parent = currentRep; makerColumnRichText->Top = currentY; ListOfQRRichText->Add(makerColumnRichText); TQRRichText *specColumnRichText = CreateQRRichText(QRRichText5); SetSmallFont(specColumnRichText->Font); specColumnRichText->Lines->Add(IDS_SPEC); specColumnRichText->Height = specColumnRichText->Lines->Count * lineHeight; specColumnRichText->Parent = currentRep; specColumnRichText->Top = currentY; ListOfQRRichText->Add(specColumnRichText); TQRRichText *codeColumnRichText = CreateQRRichText(QRRichText6); SetSmallFont(codeColumnRichText->Font); codeColumnRichText->Lines->Add(IDS_CODE); codeColumnRichText->Height = codeColumnRichText->Lines->Count * lineHeight; codeColumnRichText->Parent = currentRep; codeColumnRichText->Top = currentY; ListOfQRRichText->Add(codeColumnRichText); TQRRichText *percentColumnRichText = CreateQRRichText(QRRichText7); SetSmallFont(percentColumnRichText->Font); percentColumnRichText->Lines->Add(IDS_PERCENT); percentColumnRichText->Height = percentColumnRichText->Lines->Count * lineHeight; percentColumnRichText->Parent = currentRep; percentColumnRichText->Top = currentY; ListOfQRRichText->Add(percentColumnRichText); TQRRichText *mmPerRackColumnRichText = CreateQRRichText(QRRichText8); SetSmallFont(mmPerRackColumnRichText->Font); mmPerRackColumnRichText->Lines->Add(IDS_mmPerRACK); mmPerRackColumnRichText->Height = mmPerRackColumnRichText->Lines->Count * lineHeight; mmPerRackColumnRichText->Parent = currentRep; mmPerRackColumnRichText->Top = currentY; ListOfQRRichText->Add(mmPerRackColumnRichText); TQRRichText *useColumnRichText = CreateQRRichText(QRRichText9); SetSmallFont(useColumnRichText->Font); useColumnRichText->Lines->Add(IDS_USE); useColumnRichText->Height = useColumnRichText->Lines->Count * lineHeight; useColumnRichText->Parent = currentRep; useColumnRichText->Top = currentY; ListOfQRRichText->Add(useColumnRichText); TQRRichText *beamColumnRichText = CreateQRRichText(QRRichText10); SetSmallFont(beamColumnRichText->Font); beamColumnRichText->Lines->Add(IDS_BEAM); beamColumnRichText->Height = beamColumnRichText->Lines->Count * lineHeight; beamColumnRichText->Parent = currentRep; beamColumnRichText->Top = currentY; ListOfQRRichText->Add(beamColumnRichText); TQRRichText *totalColumnRichText = CreateQRRichText(QRRichText11); SetSmallFont(totalColumnRichText->Font); totalColumnRichText->Lines->Add(IDS_TOTAL); totalColumnRichText->Height = totalColumnRichText->Lines->Count * lineHeight; totalColumnRichText->Parent = currentRep; totalColumnRichText->Top = currentY; ListOfQRRichText->Add(totalColumnRichText); currentY += barColumnRichText->Height; for(int i=0;itexlayer->YarnUseList->Count;i++){ TQRRichText *barItemRichText = CreateQRRichText(barColumnRichText); TQRRichText *yarnItemRichText = CreateQRRichText(yarnColumnRichText); TQRRichText *makerItemRichText = CreateQRRichText(makerColumnRichText); TQRRichText *specItemRichText = CreateQRRichText(specColumnRichText); TQRRichText *codeItemRichText = CreateQRRichText(codeColumnRichText); TQRRichText *percentItemRichText = CreateQRRichText(percentColumnRichText); TQRRichText *mmPerRackItemRichText = CreateQRRichText(mmPerRackColumnRichText); TQRRichText *useItemRichText = CreateQRRichText(useColumnRichText); TQRRichText *beamItemRichText = CreateQRRichText(beamColumnRichText); TQRRichText *totalItemRichText = CreateQRRichText(totalColumnRichText); ListOfQRRichText->Add(barItemRichText); ListOfQRRichText->Add(yarnItemRichText); ListOfQRRichText->Add(makerItemRichText); ListOfQRRichText->Add(specItemRichText); ListOfQRRichText->Add(codeItemRichText); ListOfQRRichText->Add(percentItemRichText); ListOfQRRichText->Add(mmPerRackItemRichText); ListOfQRRichText->Add(useItemRichText); ListOfQRRichText->Add(beamItemRichText); ListOfQRRichText->Add(totalItemRichText); if(currentY + barItemRichText->Height > currentRep->Height - bottomMargin) { currentY = initTop; currentRep = new TQuickRep(this); currentRep->OnNeedData = RepNeedData; QuickRepList->Add(currentRep); } barItemRichText->Parent = currentRep; yarnItemRichText->Parent = currentRep; makerItemRichText->Parent = currentRep; specItemRichText->Parent = currentRep; codeItemRichText->Parent = currentRep; percentItemRichText->Parent = currentRep; mmPerRackItemRichText->Parent = currentRep; useItemRichText->Parent = currentRep; beamItemRichText->Parent = currentRep; totalItemRichText->Parent = currentRep; barItemRichText->Top = currentY; yarnItemRichText->Top = currentY; makerItemRichText->Top = currentY; specItemRichText->Top = currentY; codeItemRichText->Top = currentY; percentItemRichText->Top = currentY; mmPerRackItemRichText->Top = currentY; useItemRichText->Top = currentY; beamItemRichText->Top = currentY; totalItemRichText->Top = currentY; YarnUse *yu=(YarnUse *)Main->texlayer->YarnUseList->Items[i]; Yarn *yarn=(Yarn *)Main->texlayer->YarnList->Items[yu->yarnIndex]; AnsiString str; if (Main->LayerMode) { //Layer:0, Bar: 1 by david 090430 if (barCount - i > 0) str = "GB" + IntToStr(barCount - i); } else { str = "L"+IntToStr(yu->layer_num+1); } barItemRichText->Lines->Add(str); str=AnsiString((char)('A'+yu->yarnIndex)); yarnItemRichText->Lines->Add(str); str=yarn->lot; makerItemRichText->Lines->Add(str); if(yarn->name[0] == NULL) { YarnCompositionData_F->AddYMToStr(str,yarn->ym,yarn->ymDirect); str+=IntToStr((int)yarn->denier); str+="/"; str+=IntToStr(yarn->filament); str+=" "; YarnCompositionData_F->AddYPToStr(str,yarn->yp,yarn->ypDirect); } else{ str = yarn->name; } specItemRichText->Lines->Add(str); str=yarn->code; codeItemRichText->Lines->Add(str); str=MyFloatToStr(yu->percent,2)+"%"; percentItemRichText->Lines->Add(str); str=IntToStr(yu->mmPerRACK); mmPerRackItemRichText->Lines->Add(str); str=IntToStr(yu->use); useItemRichText->Lines->Add(str); str=IntToStr(yu->beam); beamItemRichText->Lines->Add(str); str=IntToStr(yu->total_use); totalItemRichText->Lines->Add(str); currentY += barItemRichText->Height; } currentY += 10; //////////////////////////////////////////////////////////////////////////////// TQRRichText *fabricRichText = CreateQRRichText(QRRichText1); fabricRichText->Lines->Add(IDS_FABRIC); fabricRichText->Lines->Add(IDS_RAW); fabricRichText->Lines->Add(IDS_SIMULATED); fabricRichText->Height = (fabricRichText->Lines->Count+1) * lineHeight; if(currentY + fabricRichText->Height > currentRep->Height - bottomMargin) { currentY = initTop; currentRep = new TQuickRep(this); currentRep->OnNeedData = RepNeedData; QuickRepList->Add(currentRep); } fabricRichText->Parent = currentRep; fabricRichText->Top = currentY; ListOfQRRichText->Add(fabricRichText); TQRRichText *wpiRichText = CreateQRRichText(QRRichText14); wpiRichText->Lines->Add(IDS_WPI); wpiRichText->Lines->Add(IntToStr(Main->maindata.gauge)+" w/inch"); wpiRichText->Lines->Add(MyFloatToStr(SimulationForm->sd.gauge,2)+" w/inch"); wpiRichText->Height = fabricRichText->Height; wpiRichText->Parent = currentRep; wpiRichText->Top = currentY; ListOfQRRichText->Add(wpiRichText); TQRRichText *cpcRichText = CreateQRRichText(QRRichText15); cpcRichText->Lines->Add(IDS_CPC); cpcRichText->Lines->Add(MyFloatToStr(Main->maindata.cpc,2)+" c/cm"); cpcRichText->Lines->Add(MyFloatToStr(SimulationForm->sd.cpc,2)+" c/cm"); cpcRichText->Height = fabricRichText->Height; cpcRichText->Parent = currentRep; cpcRichText->Top = currentY; ListOfQRRichText->Add(cpcRichText); TQRRichText *widthRichText = CreateQRRichText(QRRichText16); widthRichText->Lines->Add(IDS_WIDTH); widthRichText->Lines->Add(MyFloatToStr(Main->maindata.width,2)+" inch"); widthRichText->Lines->Add(MyFloatToStr(SimulationForm->sd.width,2)+" inch"); widthRichText->Height = fabricRichText->Height; widthRichText->Parent = currentRep; widthRichText->Top = currentY; ListOfQRRichText->Add(widthRichText); TQRRichText *weightRichText = CreateQRRichText(QRRichText17); weightRichText->Lines->Add(IDS_WEIGHT); weightRichText->Height = fabricRichText->Height; weightRichText->Parent = currentRep; weightRichText->Top = currentY; ListOfQRRichText->Add(weightRichText); TQRRichText *weightPerWidthRichText = CreateQRRichText(QRRichText17); weightPerWidthRichText->Lines->Add(IDS_WeightPerWidth); weightPerWidthRichText->Height = fabricRichText->Height; weightPerWidthRichText->Parent = currentRep; weightPerWidthRichText->Top = currentY; ListOfQRRichText->Add(weightPerWidthRichText); //ÇöÀç Weight´Â Àüü ºöÅ©±â(21inch(ºöÇϳªÀÇÅ©±â) X 10(ºöÀÇ °³¼ö) = 210inch)¿¡ µû¸¥ Áß·®ÀÌ´Ù. //°øÀå¿¡¼­´Â ºö¿¡ Àüü(21inch)¸¦ »ç¿ëÇÏÁö ¾Ê´Â °æ¿ìµµ ÀÖ°í, 210inch°¡ ÀÌ´Ñ 60inchµî ´Ù¾çÇÑ //Å©±â·Î ´ÏÆÃÀ» Çϱ⠶§¹®¿¡ Æø¿¡ µû¸¥ °è»ê¹ýÀ¸·Î ó¸® Çϴµ¥.... Á¤È®ÇÏ°Ô ÆøÀ¸·Î ³ª´«°ªÀÌ //Áß·®Àº ¾Æ´ÏÁö¸¸ ÇöÀç Áß·® °è»ê¹ýµµ ½Ç¿¡ µû¶ó Á¤È®¼ºÀÌ ¶³¾îÁö±â ¶§¹®¿¡ ÆøÀ¸·Î ³ª´« °ªÀ¸·Î //°£´ÜÇÏ°Ô Ã³¸®Çß´Ù. ÀÌ ºÎºÐÀº "ÀÓ¿µºó" »ó¹®´Ô°ú À̾߱âÇÑ ³»¿ëÀ» ±âÃÊ·Î ÇÑ °ÍÀÌ´Ù. double gpy=0; for(int i=0;itexlayer->YarnUseList->Count;i++){ YarnUse *yu=(YarnUse *)Main->texlayer->YarnUseList->Items[i]; gpy+=yu->GPY; } memset(buf,0,256); value=gpy; FloatToText(buf, &value, fvExtended, ffNumber, 8, 1); weightRichText->Lines->Add(AnsiString(buf)+" g/y"); memset(buf,0,256); value/=MetaDataForm->md.count_of_w; FloatToText(buf, &value, fvExtended, ffNumber, 8, 1); // by maxleo21c (06.11.08) weightPerWidthRichText->Lines->Add(AnsiString(buf)+" g/y"); memset(buf,0,256); value=gpy/Main->maindata.cpc*SimulationForm->sd.cpc; FloatToText(buf, &value, fvExtended, ffNumber, 8, 1); weightRichText->Lines->Add(AnsiString(buf)+" g/y"); memset(buf,0,256); value/=MetaDataForm->md.count_of_w; FloatToText(buf, &value, fvExtended, ffNumber, 8, 1); // by maxleo21c (06.11.08) weightPerWidthRichText->Lines->Add(AnsiString(buf)+" g/y"); currentY += fabricRichText->Height; //////////////////////////////////////////////////////////////////////////////// TQRRichText *quotaPerDayRichText = CreateQRRichText(QRRichText18); AnsiString str=IDS_QUOTAperDAY + " : "+IntToStr(MetaDataForm->md.rpm)+" X "+ MyFloatToStr(MetaDataForm->md.hours,2)+"h X 60 X " +MyFloatToStr(MetaDataForm->md.efficiency/100.0,2)+" / "+ MyFloatToStr(Main->maindata.cpc,2)+" / 91.44 X "+IntToStr(MetaDataForm->md.count_of_w)+" = "+ MyFloatToStr(MetaDataForm->md.rpm*MetaDataForm->md.hours*60.0*(MetaDataForm->md.efficiency/100.0)/ Main->maindata.cpc/91.44*MetaDataForm->md.count_of_w,2); quotaPerDayRichText->Lines->Add(str); quotaPerDayRichText->Height = quotaPerDayRichText->Lines->Count * lineHeight; if(currentY + quotaPerDayRichText->Height > currentRep->Height - bottomMargin) { currentY = initTop; currentRep = new TQuickRep(this); currentRep->OnNeedData = RepNeedData; QuickRepList->Add(currentRep); } quotaPerDayRichText->Parent = currentRep; quotaPerDayRichText->Top = currentY; ListOfQRRichText->Add(quotaPerDayRichText); currentY += quotaPerDayRichText->Height + 10; //////////////////////////////////////////////////////////////////////////////// TQRRichText *machineNameRichText = CreateQRRichText(QRRichText19); machineNameRichText->Lines->Add(IDS_MACHINNAME + " : "+MetaDataForm->md.machineName); machineNameRichText->Height = machineNameRichText->Lines->Count * lineHeight; if(currentY + machineNameRichText->Height > currentRep->Height - bottomMargin) { currentY = initTop; currentRep = new TQuickRep(this); currentRep->OnNeedData = RepNeedData; QuickRepList->Add(currentRep); } machineNameRichText->Parent = currentRep; machineNameRichText->Top = currentY; ListOfQRRichText->Add(machineNameRichText); currentY += machineNameRichText->Height + 10; //////////////////////////////////////////////////////////////////////////////// if(DesignForm->ELmode) {//gabriel Chain[0] = EditorForm->ELMemo1->Text; Chain[1] = EditorForm->ELMemo2->Text; Chain[2] = EditorForm->ELMemo3->Text; Chain[3] = EditorForm->ELMemo4->Text; Chain[4] = EditorForm->ELMemo5->Text; Chain[5] = EditorForm->ELMemo6->Text; Chain[MAX_LAYER_COUNT-1] = EditorForm->ELMemo7->Text; } for(int i=0;imaindata.bar;i++){ TQRRichText *barRichText = CreateQRRichText(QRRichText21); TQRRichText *elMemoRichText = CreateQRRichText(QRRichText20); ListOfQRRichText->Add(barRichText); ListOfQRRichText->Add(elMemoRichText); if (Main->LayerMode) { //Layer:0, Bar: 1 by david 090430 if (barCount - i > 0) barRichText->Lines->Add("GB" + IntToStr(barCount - i)); } else { barRichText->Lines->Add("L"+IntToStr(i+1)); } elMemoRichText->Lines->Add(Chain[i]+" = "+IntToStr(Main->maindata.course)+" COS"); elMemoRichText->Height = (elMemoRichText->Lines->Count+2) * lineHeight; barRichText->Height = elMemoRichText->Height; if(currentY + barRichText->Height > currentRep->Height - bottomMargin) { currentY = initTop; currentRep = new TQuickRep(this); currentRep->OnNeedData = RepNeedData; QuickRepList->Add(currentRep); } barRichText->Parent = currentRep; elMemoRichText->Parent = currentRep; barRichText->Top = currentY; elMemoRichText->Top = currentY; currentY += barRichText->Height; } //currentY += 10; //////////////////////////////////////////////////////////////////////////////// TQRRichText *arrayRichText = CreateQRRichText(QRRichText67); arrayRichText->Lines->Add(IDS_ARRAY); arrayRichText->Height = arrayRichText->Lines->Count * lineHeight; if(currentY + arrayRichText->Height > currentRep->Height - bottomMargin) { currentY = initTop; currentRep = new TQuickRep(this); currentRep->OnNeedData = RepNeedData; QuickRepList->Add(currentRep); } arrayRichText->Parent = currentRep; arrayRichText->Top = currentY; ListOfQRRichText->Add(arrayRichText); currentY += arrayRichText->Height; for(int i=0;imaindata.bar;i++){ Tex *tex=(Tex *)Main->texlayer->TexList->Items[i]; TQRRichText *barRichText = CreateQRRichText(QRRichText22); TQRRichText *leftShiftRichText = CreateQRRichText(QRRichText23); ListOfQRRichText->Add(barRichText); ListOfQRRichText->Add(leftShiftRichText); if (Main->LayerMode) { //Layer:0, Bar: 1 by david 090430 if (barCount - i > 0) barRichText->Lines->Add("GB" + IntToStr(barCount - i)); } else { barRichText->Lines->Add("L"+IntToStr(i+1)); } leftShiftRichText->Lines->Add(InOut[i]+" START="+IntToStr(tex->leftShift)); // 2017.01.04 µÇµ¹·Á³õÀ½ //leftShiftRichText->Lines->Add(IDS_FULL_START + "=" + IntToStr(tex->leftShift)); // Chinese TDW NDJ leftShiftRichText->Height = (leftShiftRichText->Lines->Count+1) * lineHeight; barRichText->Height = leftShiftRichText->Height; if(currentY + barRichText->Height > currentRep->Height - bottomMargin) { currentY = initTop; currentRep = new TQuickRep(this); currentRep->OnNeedData = RepNeedData; QuickRepList->Add(currentRep); } barRichText->Parent = currentRep; leftShiftRichText->Parent = currentRep; barRichText->Top = currentY; leftShiftRichText->Top = currentY; currentY += barRichText->Height; } currentY += 10; //////////////////////////////////////////////////////////////////////////////// TQRRichText *noteRichText = CreateQRRichText(QRRichText68); noteRichText->Lines->Add(IDS_NOTE); noteRichText->Height = noteRichText->Lines->Count * lineHeight; if(currentY + noteRichText->Height > currentRep->Height - bottomMargin) { currentY = initTop; currentRep = new TQuickRep(this); currentRep->OnNeedData = RepNeedData; QuickRepList->Add(currentRep); } noteRichText->Parent = currentRep; noteRichText->Top = currentY; ListOfQRRichText->Add(noteRichText); currentY += noteRichText->Height; TQRRichText *mmDetailRichText = CreateQRRichText(QRRichText24); mmDetailRichText->Lines->Clear(); //2007.01.10. diekun ÁٳѱèÀ§Ä¡°¡ Á¦´ë·Î ³Ñ¾î°¥ ¼ö ÀÖµµ·Ï Åëä·Î º¹»çÇÏ°Ô º¯°æ //MetaDataForm->mmDetail->SelectAll(); //mmDetailRichText->Lines->Add(MetaDataForm->mmDetail->SelText); //MetaDataForm->mmDetail->SelLength = 0; mmDetailRichText->Lines->Add(MetaDataForm->mmDetail->Text); mmDetailRichText->Height = mmDetailRichText->Lines->Count * lineHeight; if(currentY + mmDetailRichText->Height > currentRep->Height - bottomMargin) { currentY = initTop; currentRep = new TQuickRep(this); currentRep->OnNeedData = RepNeedData; QuickRepList->Add(currentRep); } mmDetailRichText->Parent = currentRep; mmDetailRichText->Top = currentY; ListOfQRRichText->Add(mmDetailRichText); currentY += (mmDetailRichText->Height + 10); //////////////////////////////////////////////////////////////////////////////// TQRRichText *zoomRichText = CreateQRRichText(QRRichText59); zoomRichText->Lines->Add(IDS_ZOOM + " : X" + IntToStr(SimulationForm->sd.zoom) + "." + IntToStr(SimulationForm->sd.sub_zoom)); //ÀåÁø¸¸: ÇÁ¸°Æ® ½Ã¿¡ zoom ¹èÀ² Ç¥±â zoomRichText->Height = mmDetailRichText->Lines->Count * lineHeight; if(currentY + zoomRichText->Height > currentRep->Height - bottomMargin) { currentY = initTop; currentRep = new TQuickRep(this); currentRep->OnNeedData = RepNeedData; QuickRepList->Add(currentRep); } zoomRichText->Parent = currentRep; zoomRichText->Top = currentY; ListOfQRRichText->Add(zoomRichText); TQRRichText *organizeRichText = CreateQRRichText(QRRichText66); organizeRichText->Lines->Add(IDS_ORGANIZE); organizeRichText->Height = organizeRichText->Lines->Count * lineHeight; organizeRichText->Parent = currentRep; organizeRichText->Top = currentY; ListOfQRRichText->Add(organizeRichText); currentY += organizeRichText->Height; //////////////////////////////////////////////////////////////////////////////// HDC dc=NULL; int dx=0,dy=0,sx=0,sy=0; //////////////////////////////////////////////////////////////////////////////// TQRImage *designImg = CreateQRImage(QRImgDesign); ListOfQRImage->Add(designImg); designImg->Picture->Bitmap->Height=0;//Àü¿¡°ÍÀ» Áö¿ì°í.. designImg->Picture->Bitmap->Width=designImg->Width; designImg->Picture->Bitmap->Height=designImg->Height; dc=DesignForm->smallchart->CreateDC(); dx=0,dy=0,sx=0,sy=0; if(DesignForm->smallchart->Width>designImg->Width) { sx = DesignForm->smallchart->Width-designImg->Width; dx = 0; } else { sx = 0; dx = 0; } if(DesignForm->smallchart->Height>designImg->Height) { sy = DesignForm->smallchart->Height-designImg->Height; dy = 0; } else { sy = 0; dy = 0; } BitBlt(designImg->Picture->Bitmap->Canvas->Handle, dx, dy, designImg->Width, designImg->Height, dc, sx, sy, SRCCOPY); DesignForm->smallchart->DeleteDC(dc); if(currentY + designImg->Height > currentRep->Height - bottomMargin) { currentY = initTop; currentRep = new TQuickRep(this); currentRep->OnNeedData = RepNeedData; QuickRepList->Add(currentRep); } designImg->Parent = currentRep; designImg->Top = currentY; //////////////////////////////////////////////////////////////////////////////// TQRImage *simulationImg = CreateQRImage(QRImgSimulation); ListOfQRImage->Add(simulationImg); //SimulationForm->MakeImage(); simulationImg->Picture->Bitmap->Height=0;//Àü¿¡°ÍÀ» Áö¿ì°í.. simulationImg->Picture->Bitmap->Width=simulationImg->Width; simulationImg->Picture->Bitmap->Height=simulationImg->Height; dc=SimulationForm->image->CreateDC(); dx=0,dy=0,sx=0,sy=0; if(SimulationForm->image->Width>simulationImg->Width) { sx = SimulationForm->image->Width-simulationImg->Width; dx = 0; } else { sx = 0; dx = 0; } if(SimulationForm->image->Height>simulationImg->Height) { sy = SimulationForm->image->Height-simulationImg->Height; dy = 0; } else { sy = 0; dy = 0; } BitBlt(simulationImg->Picture->Bitmap->Canvas->Handle, dx, dy, simulationImg->Width, simulationImg->Height, dc, sx, sy, SRCCOPY); SimulationForm->image->DeleteDC(dc); simulationImg->Parent = currentRep; simulationImg->Top = currentY; //////////////////////////////////////////////////////////////////////////////// } //--------------------------------------------------------------------------- /* void __fastcall THiddenPrintDataForm::SetqrSimple(){ //////////////////////////////////////////////////////////////////////////////// char buf[256]; Extended value; int barCount = Main->maindata.bar; //////////////////////////////////////////////////////////////////////////////// Main->SetAll(); //////////////////////////////////////////////////////////////////////////////// qrlTitle->Caption = IDS_SimpleTitle; AnsiString InOut[MAX_LAYER_COUNT]={"FULL","FULL","FULL","FULL","FULL","FULL"}; for(int l=0;lmaindata.bar;l++){ if(GuideBar_F->gd.iodescription[l]!=""){ InOut[l]=GuideBar_F->gd.iodescription[l]; continue; } AnsiString str; Tex *tex = ((Tex *)Main->texlayer->TexList->Items[l]); for(int i=0;iWales->Count;i++){ WaleState *ws = (WaleState *)tex->Wales->Items[i]; if(ws->in){ str+=IntToStr(ws->cnt)+AnsiString((char)('A'+ws->yarnIndex))+" "; } else { str+=IntToStr(ws->cnt)+"X "; } } if(tex->Wales->Count==1)str="FULL"; if(str!="")InOut[l]=str; } //////////////////////////////////////////////////////////////////////////////// AnsiString Chain[MAX_LAYER_COUNT]; for(int l=0;lmaindata.bar;l++){ AnsiString str; Tex *tex = ((Tex *)Main->texlayer->TexList->Items[l]); if(tex->Curve->Count%2||tex->Curve->Count<3){ //Ȧ¼öÀ̸é ÀüºÎ Ç¥Çö for(int i=0;iCurve->Count;i++){ KO *ko = (KO *)tex->Curve->Items[i]; if(PrintForm->rgChain->ItemIndex==0){ str+=IntToStr(ko->in)+IntToStr(ko->via)+" "; } else { str+=IntToStr(ko->in)+IntToStr(ko->via)+IntToStr(ko->out)+" "; } } } else { // ¦¼öÀ̸é Áߺ¹ üũ // bool repeat=true; KO *ko01 = (KO *)tex->Curve->Items[0]; KO *ko02 = (KO *)tex->Curve->Items[1]; for(int i=0;iCurve->Count/2;i++){ KO *ko1 = (KO *)tex->Curve->Items[2*i]; KO *ko2 = (KO *)tex->Curve->Items[2*i+1]; if(ko01->in!=ko1->in||ko01->via!=ko1->via|| ko02->in!=ko2->in||ko02->via!=ko2->via) { repeat=false; break; } } if(repeat){ KO *ko1 = (KO *)tex->Curve->Items[0]; KO *ko2 = (KO *)tex->Curve->Items[1]; if(PrintForm->rgChain->ItemIndex==0){ str+=IntToStr(ko1->in)+IntToStr(ko1->via)+" "+IntToStr(ko2->in)+IntToStr(ko2->via)+" "; } else { str+=IntToStr(ko1->in)+IntToStr(ko1->via)+IntToStr(ko1->out)+" "+ IntToStr(ko2->in)+IntToStr(ko2->via)+IntToStr(ko2->out)+" "; } } else { for(int i=0;iCurve->Count;i++){ KO *ko = (KO *)tex->Curve->Items[i]; if(PrintForm->rgChain->ItemIndex==0){ str+=IntToStr(ko->in)+IntToStr(ko->via)+" "; } else { str+=IntToStr(ko->in)+IntToStr(ko->via)+IntToStr(ko->out)+" "; } } } } Chain[l]=str; } //////////////////////////////////////////////////////////////////////////////// AnsiString s1=ExtractFileName(Main->maindata.FileName); s1=s1.SubString(1,s1.Length()-4); s1=s1.UpperCase(); QRLabel2->Caption ="NAME : "+s1; QRLabel60->Caption="CODE : "+Main->maindata.ProductCode; QRLabel58->Caption="DATE : "+MetaDataForm->md.Time; QRLabel141->Caption=MetaDataForm->md.ResponsiblePart;//by maxleo21c (06.11.08) //////////////////////////////////////////////////////////////////////////////// QRRichText12->Lines->Clear(); QRRichText12->Lines->Add("BAR"); for(int i=0;itexlayer->YarnUseList->Count;i++){ YarnUse *yu=(YarnUse *)Main->texlayer->YarnUseList->Items[i]; Yarn *yarn=(Yarn *)Main->texlayer->YarnList->Items[yu->yarnIndex]; AnsiString str; if (Main->LayerMode) { //Layer:0, Bar: 1 by david 090430 if (barCount - i > 0) str = "GB" + IntToStr(barCount - i); } else { str = "L"+IntToStr(yu->layer_num+1); } QRRichText12->Lines->Add(str); } QRRichText13->Lines->Clear(); QRRichText13->Lines->Add(IDS_IDX); for(int i=0;itexlayer->YarnUseList->Count;i++){ YarnUse *yu=(YarnUse *)Main->texlayer->YarnUseList->Items[i]; AnsiString str=AnsiString((char)('A'+yu->yarnIndex)); QRRichText13->Lines->Add(str); } QRRichText2->Lines->Clear(); QRRichText2->Lines->Add(IDS_MAKER); for(int i=0;itexlayer->YarnUseList->Count;i++){ YarnUse *yu=(YarnUse *)Main->texlayer->YarnUseList->Items[i]; Yarn *yarn=(Yarn *)Main->texlayer->YarnList->Items[yu->yarnIndex]; AnsiString str=yarn->lot; QRRichText2->Lines->Add(str); } QRRichText5->Lines->Clear(); QRRichText5->Lines->Add(IDS_SPEC); for(int i=0;itexlayer->YarnUseList->Count;i++){ AnsiString spec; YarnUse *yu=(YarnUse *)Main->texlayer->YarnUseList->Items[i]; Yarn *yarn=(Yarn *)Main->texlayer->YarnList->Items[yu->yarnIndex]; if(yarn->name[0] == NULL) { YarnCompositionData_F->AddYMToStr(spec,yarn->ym,yarn->ymDirect); spec+=IntToStr((int)yarn->denier); spec+="/"; spec+=IntToStr(yarn->filament); spec+=" "; YarnCompositionData_F->AddYPToStr(spec,yarn->yp,yarn->ypDirect); } else{ spec = yarn->name; } QRRichText5->Lines->Add(spec); } QRRichText6->Lines->Clear(); QRRichText6->Lines->Add(IDS_CODE); for(int i=0;itexlayer->YarnUseList->Count;i++){ YarnUse *yu=(YarnUse *)Main->texlayer->YarnUseList->Items[i]; Yarn *yarn=(Yarn *)Main->texlayer->YarnList->Items[yu->yarnIndex]; AnsiString str=yarn->code; QRRichText6->Lines->Add(str); } QRRichText7->Lines->Clear(); QRRichText7->Lines->Add(IDS_PERCENT); for(int i=0;itexlayer->YarnUseList->Count;i++){ YarnUse *yu=(YarnUse *)Main->texlayer->YarnUseList->Items[i]; Yarn *yarn=(Yarn *)Main->texlayer->YarnList->Items[yu->yarnIndex]; AnsiString str=MyFloatToStr(yu->percent,2)+"%"; QRRichText7->Lines->Add(str); } QRRichText8->Lines->Clear(); QRRichText8->Lines->Add(IDS_mmPerRACK); for(int i=0;itexlayer->YarnUseList->Count;i++){ YarnUse *yu=(YarnUse *)Main->texlayer->YarnUseList->Items[i]; Yarn *yarn=(Yarn *)Main->texlayer->YarnList->Items[yu->yarnIndex]; AnsiString str=IntToStr(yu->mmPerRACK); QRRichText8->Lines->Add(str); } QRRichText9->Lines->Clear(); QRRichText9->Lines->Add(IDS_USE); for(int i=0;itexlayer->YarnUseList->Count;i++){ YarnUse *yu=(YarnUse *)Main->texlayer->YarnUseList->Items[i]; Yarn *yarn=(Yarn *)Main->texlayer->YarnList->Items[yu->yarnIndex]; AnsiString str=IntToStr(yu->use); QRRichText9->Lines->Add(str); } QRRichText10->Lines->Clear(); QRRichText10->Lines->Add(IDS_BEAM); for(int i=0;itexlayer->YarnUseList->Count;i++){ YarnUse *yu=(YarnUse *)Main->texlayer->YarnUseList->Items[i]; Yarn *yarn=(Yarn *)Main->texlayer->YarnList->Items[yu->yarnIndex]; AnsiString str=IntToStr(yu->beam); QRRichText10->Lines->Add(str); } QRRichText11->Lines->Clear(); QRRichText11->Lines->Add(IDS_TOTAL); for(int i=0;itexlayer->YarnUseList->Count;i++){ YarnUse *yu=(YarnUse *)Main->texlayer->YarnUseList->Items[i]; Yarn *yarn=(Yarn *)Main->texlayer->YarnList->Items[yu->yarnIndex]; AnsiString str=IntToStr(yu->total_use); QRRichText11->Lines->Add(str); } //////////////////////////////////////////////////////////////////////////////// QRRichText1->Lines->Clear(); QRRichText1->Lines->Add(IDS_FABRIC); QRRichText1->Lines->Add(IDS_RAW); QRRichText1->Lines->Add(IDS_SIMULATED); QRRichText14->Lines->Clear(); QRRichText14->Lines->Add(IDS_WPI); QRRichText14->Lines->Add(IntToStr(Main->maindata.gauge)+" w/inch"); QRRichText14->Lines->Add(MyFloatToStr(SimulationForm->sd.gauge,2)+" w/inch"); QRRichText15->Lines->Clear(); QRRichText15->Lines->Add(IDS_CPC); QRRichText15->Lines->Add(MyFloatToStr(Main->maindata.cpc,2)+" c/cm"); QRRichText15->Lines->Add(MyFloatToStr(SimulationForm->sd.cpc,2)+" c/cm"); QRRichText16->Lines->Clear(); QRRichText16->Lines->Add(IDS_WIDTH); QRRichText16->Lines->Add(MyFloatToStr(Main->maindata.width,2)+" inch"); QRRichText16->Lines->Add(MyFloatToStr(SimulationForm->sd.width,2)+" inch"); QRRichText17->Lines->Clear(); QRRichText17->Lines->Add(IDS_WEIGHT); QRRichText65->Lines->Clear(); // QRRichText65->Lines->Add("Weight/"+MetaDataForm->edCountOfW->Text);// by maxleo21c (06.11.08) QRRichText65->Lines->Add(IDS_WeightPerWidth/*+MetaDataForm->edCountOfW->Text* /);// by maxleo21c (06.11.08) //ÇöÀç Weight´Â Àüü ºöÅ©±â(21inch(ºöÇϳªÀÇÅ©±â) X 10(ºöÀÇ °³¼ö) = 210inch)¿¡ µû¸¥ Áß·®ÀÌ´Ù. //°øÀå¿¡¼­´Â ºö¿¡ Àüü(21inch)¸¦ »ç¿ëÇÏÁö ¾Ê´Â °æ¿ìµµ ÀÖ°í, 210inch°¡ ÀÌ´Ñ 60inchµî ´Ù¾çÇÑ //Å©±â·Î ´ÏÆÃÀ» Çϱ⠶§¹®¿¡ Æø¿¡ µû¸¥ °è»ê¹ýÀ¸·Î ó¸® Çϴµ¥.... Á¤È®ÇÏ°Ô ÆøÀ¸·Î ³ª´«°ªÀÌ //Áß·®Àº ¾Æ´ÏÁö¸¸ ÇöÀç Áß·® °è»ê¹ýµµ ½Ç¿¡ µû¶ó Á¤È®¼ºÀÌ ¶³¾îÁö±â ¶§¹®¿¡ ÆøÀ¸·Î ³ª´« °ªÀ¸·Î //°£´ÜÇÏ°Ô Ã³¸®Çß´Ù. ÀÌ ºÎºÐÀº "ÀÓ¿µºó" »ó¹®´Ô°ú À̾߱âÇÑ ³»¿ëÀ» ±âÃÊ·Î ÇÑ °ÍÀÌ´Ù. double gpy=0; for(int i=0;itexlayer->YarnUseList->Count;i++){ YarnUse *yu=(YarnUse *)Main->texlayer->YarnUseList->Items[i]; gpy+=yu->GPY; } memset(buf,0,256); value=gpy; FloatToText(buf, &value, fvExtended, ffNumber, 8, 1); QRRichText17->Lines->Add(AnsiString(buf)+" g/y"); memset(buf,0,256); value/=MetaDataForm->md.count_of_w; FloatToText(buf, &value, fvExtended, ffNumber, 8, 1); // by maxleo21c (06.11.08) QRRichText65->Lines->Add(AnsiString(buf)+" g/y"); memset(buf,0,256); value=gpy/Main->maindata.cpc*SimulationForm->sd.cpc; FloatToText(buf, &value, fvExtended, ffNumber, 8, 1); QRRichText17->Lines->Add(AnsiString(buf)+" g/y"); memset(buf,0,256); value/=MetaDataForm->md.count_of_w; FloatToText(buf, &value, fvExtended, ffNumber, 8, 1); // by maxleo21c (06.11.08) QRRichText65->Lines->Add(AnsiString(buf)+" g/y"); //////////////////////////////////////////////////////////////////////////////// QRRichText18->Lines->Clear(); AnsiString str=IDS_QUOTAperDAY + " : "+IntToStr(MetaDataForm->md.rpm)+" X "+ MyFloatToStr(MetaDataForm->md.hours,2)+"h X 60 X " +MyFloatToStr(MetaDataForm->md.efficiency/100.0,2)+" / "+ MyFloatToStr(Main->maindata.cpc,2)+" / 91.44 X "+IntToStr(MetaDataForm->md.count_of_w)+" = "+ MyFloatToStr(MetaDataForm->md.rpm*MetaDataForm->md.hours*60.0*(MetaDataForm->md.efficiency/100.0)/ Main->maindata.cpc/91.44*MetaDataForm->md.count_of_w,2); QRRichText18->Lines->Add(str); //////////////////////////////////////////////////////////////////////////////// QRRichText19->Lines->Clear(); QRRichText19->Lines->Add(IDS_MACHINNAME + " : "+MetaDataForm->md.machineName); //////////////////////////////////////////////////////////////////////////////// QRRichText20->Lines->Clear(); QRRichText21->Lines->Clear(); if(DesignForm->ELmode) {//gabriel Chain[0] = EditorForm->ELMemo1->Text; Chain[1] = EditorForm->ELMemo2->Text; Chain[2] = EditorForm->ELMemo3->Text; Chain[3] = EditorForm->ELMemo4->Text; Chain[4] = EditorForm->ELMemo5->Text; Chain[MAX_LAYER_COUNT-1] = EditorForm->ELMemo6->Text; } for(int i=0;imaindata.bar;i++){ Tex *tex=(Tex *)Main->texlayer->TexList->Items[i]; while(QRRichText20->Lines->Count>QRRichText21->Lines->Count){ QRRichText21->Lines->Add(""); } if (Main->LayerMode) { //Layer:0, Bar: 1 by david 090430 if (barCount - i > 0) QRRichText21->Lines->Add("GB" + IntToStr(barCount - i)); } else { QRRichText21->Lines->Add("L"+IntToStr(i+1)); } QRRichText20->Lines->Add(Chain[i]+" = "+IntToStr(Main->maindata.course)+" COS"); //2007.01.10. diekun ÁÙ ¾È ¸Â´Â ¿¡·¯ ¼öÁ¤À» À§ÇØ. -> Àӻ󹫴԰ú ÅäÀÇ ÈÄ ±âÁ¸ °ÍÀ¸·Î µ¹¸². 2007.01.11. diekun //QRRichText20->Lines->Add("L"+IntToStr(i+1)+" : "+Chain[i]+" = "+IntToStr(Main->maindata.course)+" COS"); ////////////~~~~~~~~~~~~~~~~~~~~~~~` TColor or_cb = QRRichText20->Color; TColor or_c = QRRichText20->Font->Color; QRRichText20->Color = clRed; QRRichText20->Font->Color = clBlue; //QRRichText20->Lines->Add("gdgdgd"); //06.11.24 Àӻ󹫴ÔÀÇ ¿äûÀ¸·Î ÁÖ¼®Ã³¸®...¿Ö ÀÌ·±°Ô ÀÖ¾ú´ÂÁö ¸ð¸£°ÚÀ½ by maxleo21c QRRichText20->Color = or_cb; QRRichText20->Font->Color = or_c; // QRRichText20->Sel //TRichEdit *RE=new TRichEdit; ;;//SelAttributes /* RichEdit1->Clear(); //RichEdit1->Lines->Add(Chain[i]); RichEdit1->Text = Chain[i]; //RichEdit1->BorderStyle = bsSingle;// bsSingle or bsNone RichEdit1->Color = clMenu; RichEdit1->Color = or_cb; * / /* RxRichEdit1->SelAttributes->BackColor = clMenu RxRichEdit1->SelAttributes->Color = clBlack; RxRichEdit1->SelText = "["; RxRichEdit1->SelAttributes->Color = clOlive; RxRichEdit1->SelText = "001"; RxRichEdit1->SelAttributes->Color = clBlack; RxRichEdit1->SelText = "]\n"; QRRichText20->ParentRichEdit = RxRichEdit1; * / //////////~~~~~~~~~~~~~~~~~~~~~~ } //////////////////////////////////////////////////////////////////////////////// QRRichText22->Lines->Clear(); QRRichText23->Lines->Clear(); for(int i=0;imaindata.bar;i++){ Tex *tex=(Tex *)Main->texlayer->TexList->Items[i]; while(QRRichText23->Lines->Count>QRRichText22->Lines->Count){ QRRichText22->Lines->Add(""); } if (Main->LayerMode) { //Layer:0, Bar: 1 by david 090430 if (barCount - i > 0) QRRichText22->Lines->Add("GB" + IntToStr(barCount - i)); } else { QRRichText22->Lines->Add("L"+IntToStr(i+1)); } QRRichText23->Lines->Add(InOut[i]+" START="+IntToStr(tex->leftShift)); } //////////////////////////////////////////////////////////////////////////////// QRRichText68->Lines->Clear(); QRRichText68->Lines->Add(IDS_NOTE); //ºñ°í QRRichText24->Lines->Clear(); /*for(int i=0;immDetail->Lines->Count;i++){ QRRichText24->Lines->Add(MetaDataForm->mmDetail->Lines->Strings[i]); }* / //2007.01.10. diekun ÁٳѱèÀ§Ä¡°¡ Á¦´ë·Î ³Ñ¾î°¥ ¼ö ÀÖµµ·Ï Åëä·Î º¹»çÇÏ°Ô º¯°æ MetaDataForm->mmDetail->SelectAll(); QRRichText24->Lines->Add(MetaDataForm->mmDetail->SelText); MetaDataForm->mmDetail->SelLength = 0; QRRichText59->Lines->Clear(); QRRichText59->Lines->Add(IDS_ZOOM + " : X" + IntToStr(SimulationForm->sd.zoom) + "." + IntToStr(SimulationForm->sd.sub_zoom)); //ÀåÁø¸¸: ÇÁ¸°Æ® ½Ã¿¡ zoom ¹èÀ² Ç¥±â QRRichText66->Lines->Clear(); QRRichText66->Lines->Add(IDS_ORGANIZE); QRRichText67->Lines->Clear(); QRRichText67->Lines->Add(IDS_ARRAY); //////////////////////////////////////////////////////////////////////////////// HDC dc=NULL; int dx=0,dy=0,sx=0,sy=0; //////////////////////////////////////////////////////////////////////////////// QRImgDesign->Picture->Bitmap->Height=0;//Àü¿¡°ÍÀ» Áö¿ì°í.. QRImgDesign->Picture->Bitmap->Width=QRImgDesign->Width; QRImgDesign->Picture->Bitmap->Height=QRImgDesign->Height; dc=DesignForm->smallchart->CreateDC(); dx=0,dy=0,sx=0,sy=0; if(DesignForm->smallchart->Width>QRImgDesign->Width) { sx = DesignForm->smallchart->Width-QRImgDesign->Width; dx = 0; } else { sx = 0; dx = 0; } if(DesignForm->smallchart->Height>QRImgDesign->Height) { sy = DesignForm->smallchart->Height-QRImgDesign->Height; dy = 0; } else { sy = 0; dy = 0; } BitBlt(QRImgDesign->Picture->Bitmap->Canvas->Handle, dx, dy, QRImgDesign->Width, QRImgDesign->Height, dc, sx, sy, SRCCOPY); DesignForm->smallchart->DeleteDC(dc); //////////////////////////////////////////////////////////////////////////////// //·Î°íÀ̹ÌÁö Ç¥½Ã 2006.11.08. diekun if(!MetaDataForm->md.bmpLogo->Empty) QRImgLogo->Picture->Assign(MetaDataForm->md.bmpLogo); else{ QRImgLogo->Picture->Bitmap->Height = 0; QRImgLogo->Picture->Bitmap->Width=QRImgLogo->Width; QRImgLogo->Picture->Bitmap->Height=QRImgLogo->Height; } if(QRImgLogo->Height > 41){ int resizeHeight = 41; int resizeWidth = QRImgLogo->Width*41/QRImgLogo->Height; QRImgLogo->Height = resizeHeight; QRImgLogo->Width = resizeWidth; } QRImgLogo->Left = QRLabel141->Left + QRLabel141->Width - QRImgLogo->Width; //QRImgLogo->Stretch = true; /*QRImgLogo->Picture->Bitmap->Height=0;//Àü¿¡°ÍÀ» Áö¿ì°í.. QRImgLogo->Picture->Bitmap->Width=QRImgLogo->Width; QRImgLogo->Picture->Bitmap->Height=QRImgLogo->Height; HDC dstDC = QRImgLogo->Picture->Bitmap->Canvas->Handle; int oldMode = SetStretchBltMode(dstDC,COLORONCOLOR); StretchBlt(dstDC, 0, 0, QRImgLogo->Width, QRImgLogo->Height, MetaDataForm->imgLogoImage->Canvas->Handle, 0, 0, MetaDataForm->imgLogoImage->Width, MetaDataForm->imgLogoImage->Height, SRCCOPY); //* / //SimulationForm->MakeImage(); QRImgSimulation->Picture->Bitmap->Height=0;//Àü¿¡°ÍÀ» Áö¿ì°í.. QRImgSimulation->Picture->Bitmap->Width=QRImgSimulation->Width; QRImgSimulation->Picture->Bitmap->Height=QRImgSimulation->Height; dc=SimulationForm->image->CreateDC(); dx=0,dy=0,sx=0,sy=0; if(SimulationForm->image->Width>QRImgSimulation->Width) { sx = SimulationForm->image->Width-QRImgSimulation->Width; dx = 0; } else { sx = 0; dx = 0; } if(SimulationForm->image->Height>QRImgSimulation->Height) { sy = SimulationForm->image->Height-QRImgSimulation->Height; dy = 0; } else { sy = 0; dy = 0; } BitBlt(QRImgSimulation->Picture->Bitmap->Canvas->Handle, dx, dy, QRImgSimulation->Width, QRImgSimulation->Height, dc, sx, sy, SRCCOPY); SimulationForm->image->DeleteDC(dc); //////////////////////////////////////////////////////////////////////////////// TQRLabel *temp = new TQRLabel(this); temp->Parent = qrSimple; temp->Caption = "adfadsf"; temp->Top = 1500; ListOfQRLabel = new TList(); ListOfQRLabel->Add(temp); } //--------------------------------------------------------------------------- */ void __fastcall THiddenPrintDataForm::SetqrStandardSimulation(){ //////////////////////////////////////////////////////////////////////////////// ListOfQRImage=new TList; //////////////////////////////////////////////////////////////////////////////// Main->SetAll(); //////////////////////////////////////////////////////////////////////////////// AnsiString s1=ExtractFileName(Main->maindata.FileName); s1=s1.SubString(1,s1.Length()-4); s1=s1.UpperCase(); //QRLabel125->Caption="NAME : "+s1; //QRLabel126->Caption="CODE : "+Main->maindata.ProductCode; //QRLabel127->Caption="DATE : "+MetaDataForm->md.Time; SetSmallFont(QRLabel125->Font); SetSmallFont(QRLabel126->Font); SetSmallFont(QRLabel127->Font); QRLabel125->Caption=IDS_NAME + " " + s1; QRLabel126->Caption=IDS_CODE_COLON + " " + Main->maindata.ProductCode; QRLabel127->Caption=IDS_DATE + " " +MetaDataForm->md.Time; QRLabel143->Caption=MetaDataForm->md.ResponsiblePart;//by maxleo21c (06.11.08) //////////////////////////////////////////////////////////////////////////////// QRRichText3->Lines->Clear(); QRRichText3->Lines->Add(""); QRRichText3->Lines->Add("RAW"); QRRichText3->Lines->Add("SIMULATED"); QRRichText4->Lines->Clear(); QRRichText4->Lines->Add("WPI"); QRRichText4->Lines->Add(IntToStr(Main->maindata.gauge)); QRRichText4->Lines->Add(MyFloatToStr(SimulationForm->sd.gauge,2)); QRRichText25->Lines->Clear(); QRRichText25->Lines->Add("CPC"); QRRichText25->Lines->Add(MyFloatToStr(Main->maindata.cpc,2)); QRRichText25->Lines->Add(MyFloatToStr(SimulationForm->sd.cpc,2)); QRRichText26->Lines->Clear(); QRRichText26->Lines->Add("Width"); QRRichText26->Lines->Add(MyFloatToStr(Main->maindata.width,2)+" inch"); QRRichText26->Lines->Add(MyFloatToStr(SimulationForm->sd.width,2)+" inch"); //////////////////////////////////////////////////////////////////////////////// QRRichText27->Lines->Clear(); QRRichText27->Lines->Add("FUZZ : "+IntToStr(SimulationForm->sd.fuzz)); AnsiString str; if(SimulationForm->sd.back){ str="BACK"; } else { str="FRONT"; } QRRichText27->Lines->Add("FACE : "+str); QRRichText27->Lines->Add("VERTICAL REPEAT : "+IntToStr(SimulationForm->sd.rH)); QRRichText27->Lines->Add("HORIZONTAL REPEAT : "+IntToStr(SimulationForm->sd.rW)); QRRichText27->Lines->Add("ZOOM : X" + IntToStr(SimulationForm->sd.zoom) + "." + IntToStr(SimulationForm->sd.sub_zoom)); //ÀåÁø¸¸: ÇÁ¸°Æ® ½Ã¿¡ zoom ¹èÀ² Ç¥±â //////////////////////////////////////////////////////////////////////////////// int dx=0,dy=0,sx=0,sy=0; //////////////////////////////////////////////////////////////////////////////// //SimulationForm->MakeImage(); TTexpiaBitmap *image=SimulationForm->image; int cntx=(image->Width-1)/360+1; int cnty=(image->Height-1)/260+1; if(cntx>2)cntx=2; if(cnty>3)cnty=3; for(int i=0;iParent=qrStandardSimulation; qri->Width=360; qri->Height=260; qri->Picture->Bitmap->Width=qri->Width; qri->Picture->Bitmap->Height=qri->Height; qri->Left=38+i*qri->Width; qri->Top=305+j*qri->Height; HDC dc=image->CreateDC(); dx=0,dy=0; sx = i*qri->Width; sy = j*qri->Height; BitBlt(qri->Picture->Bitmap->Canvas->Handle, dx, dy, qri->Width, qri->Height, dc, sx, sy, SRCCOPY); image->DeleteDC(dc); ListOfQRImage->Add(qri); } } //////////////////////////////////////////////////////////////////////////////// } //--------------------------------------------------------------------------- void __fastcall THiddenPrintDataForm::SetqrStandardDesign(){ //////////////////////////////////////////////////////////////////////////////// ListOfQRLabel = new TList(); ListOfQRRichText = new TList(); ListOfQRImage = new TList(); QuickRepList = new TList(); TQuickRep *currentRep = new TQuickRep(this); currentRep->OnNeedData = RepNeedData; QuickRepList->Add(currentRep); const int initTop = 45; const int bottomMargin = 45; const int lineHeight = 17; int currentY = initTop; char buf[256]; Extended value; //////////////////////////////////////////////////////////////////////////////// Main->SetAll(); int barCount = Main->maindata.bar; //////////////////////////////////////////////////////////////////////////////// AnsiString InOut[MAX_LAYER_COUNT]={"FULL","FULL","FULL","FULL","FULL","FULL","FULL"}; for(int l=0;lmaindata.bar;l++){ if(GuideBar_F->gd.iodescription[l]!=""){ InOut[l]=GuideBar_F->gd.iodescription[l]; continue; } AnsiString str; Tex *tex = ((Tex *)Main->texlayer->TexList->Items[l]); for(int i=0;iWales->Count;i++){ WaleState *ws = (WaleState *)tex->Wales->Items[i]; if(ws->in){ str+=IntToStr(ws->cnt)+AnsiString((char)('A'+ws->yarnIndex))+" "; } else { str+=IntToStr(ws->cnt)+"X "; } } if(tex->Wales->Count==1)str="FULL"; if(str!="")InOut[l]=str; } //////////////////////////////////////////////////////////////////////////////// AnsiString Chain[MAX_LAYER_COUNT]; for(int l=0;lmaindata.bar;l++){ AnsiString str; Tex *tex = ((Tex *)Main->texlayer->TexList->Items[l]); if(tex->Curve->Count%2||tex->Curve->Count<3){ //Ȧ¼öÀ̸é ÀüºÎ Ç¥Çö for(int i=0;iCurve->Count;i++){ KO *ko = (KO *)tex->Curve->Items[i]; if(PrintForm->rgChain->ItemIndex==0){ str+=IntToStr(ko->in)+IntToStr(ko->via)+" "; } else { str+=IntToStr(ko->in)+IntToStr(ko->via)+IntToStr(ko->out)+" "; } } } else { // ¦¼öÀ̸é Áߺ¹ üũ // bool repeat=true; KO *ko01 = (KO *)tex->Curve->Items[0]; KO *ko02 = (KO *)tex->Curve->Items[1]; for(int i=0;iCurve->Count/2;i++){ KO *ko1 = (KO *)tex->Curve->Items[2*i]; KO *ko2 = (KO *)tex->Curve->Items[2*i+1]; if(ko01->in!=ko1->in||ko01->via!=ko1->via|| ko02->in!=ko2->in||ko02->via!=ko2->via) { repeat=false; break; } } if(repeat){ KO *ko1 = (KO *)tex->Curve->Items[0]; KO *ko2 = (KO *)tex->Curve->Items[1]; if(PrintForm->rgChain->ItemIndex==0){ str+=IntToStr(ko1->in)+IntToStr(ko1->via)+" "+IntToStr(ko2->in)+IntToStr(ko2->via)+" "; } else { str+=IntToStr(ko1->in)+IntToStr(ko1->via)+IntToStr(ko1->out)+" "+ IntToStr(ko2->in)+IntToStr(ko2->via)+IntToStr(ko2->out)+" "; } } else { for(int i=0;iCurve->Count;i++){ KO *ko = (KO *)tex->Curve->Items[i]; if(PrintForm->rgChain->ItemIndex==0){ str+=IntToStr(ko->in)+IntToStr(ko->via)+" "; } else { str+=IntToStr(ko->in)+IntToStr(ko->via)+IntToStr(ko->out)+" "; } } } } Chain[l]=str; } //////////////////////////////////////////////////////////////////////////////// AnsiString s1=ExtractFileName(Main->maindata.FileName); s1=s1.SubString(1,s1.Length()-4); s1=s1.UpperCase(); TQRLabel *titleLabel = CreateQRLabel(QRLabel59); titleLabel->Parent = currentRep; titleLabel->Top = currentY; ListOfQRLabel->Add(titleLabel); currentY += (titleLabel->Height + 20); TQRLabel *nameLabel = CreateQRLabel(QRLabel128); nameLabel->Parent = currentRep; nameLabel->Top = currentY; //nameLabel->Caption = "NAME : " + s1; SetSmallFont(nameLabel->Font); nameLabel->Caption = IDS_NAME + " " + s1; ListOfQRLabel->Add(nameLabel); currentY += nameLabel->Height; TQRLabel *codeLabel = CreateQRLabel(QRLabel129); codeLabel->Parent = currentRep; codeLabel->Top = currentY; //codeLabel->Caption= "CODE : " + Main->maindata.ProductCode; SetSmallFont(codeLabel->Font); codeLabel->Caption= IDS_CODE + " " + Main->maindata.ProductCode; ListOfQRLabel->Add(codeLabel); TQRLabel *dateLabel = CreateQRLabel(QRLabel130); dateLabel->Parent = currentRep; dateLabel->Top = currentY; //dateLabel->Caption= "DATE : " + MetaDataForm->md.Time; dateLabel->Caption = IDS_DATE + " " + MetaDataForm->md.Time; SetSmallFont(dateLabel->Font); ListOfQRLabel->Add(dateLabel); currentY += (dateLabel->Height + 10); TQRLabel *partLabel = CreateQRLabel(QRLabel141); partLabel->Parent = currentRep; partLabel->Caption = MetaDataForm->md.ResponsiblePart;//by maxleo21c (06.11.08) ListOfQRLabel->Add(partLabel); //////////////////////////////////////////////////////////////////////////////// TQRRichText *fabricRichText = CreateQRRichText(QRRichText28); fabricRichText->Lines->Add(""); fabricRichText->Lines->Add(IDS_RAW); fabricRichText->Lines->Add(IDS_SIMULATED); fabricRichText->Height = fabricRichText->Lines->Count * lineHeight; if(currentY + fabricRichText->Height > currentRep->Height - bottomMargin) { currentY = initTop; currentRep = new TQuickRep(this); currentRep->OnNeedData = RepNeedData; QuickRepList->Add(currentRep); } fabricRichText->Parent = currentRep; fabricRichText->Top = currentY; ListOfQRRichText->Add(fabricRichText); TQRRichText *wpiRichText = CreateQRRichText(QRRichText29); wpiRichText->Lines->Add(IDS_WPI); wpiRichText->Lines->Add(IntToStr(Main->maindata.gauge)); wpiRichText->Lines->Add(MyFloatToStr(SimulationForm->sd.gauge,2)); wpiRichText->Height = fabricRichText->Height; wpiRichText->Parent = currentRep; wpiRichText->Top = currentY; ListOfQRRichText->Add(wpiRichText); TQRRichText *cpcRichText = CreateQRRichText(QRRichText30); cpcRichText->Lines->Add(IDS_CPC); cpcRichText->Lines->Add(MyFloatToStr(Main->maindata.cpc,2)); cpcRichText->Lines->Add(MyFloatToStr(SimulationForm->sd.cpc,2)); cpcRichText->Height = fabricRichText->Height; cpcRichText->Parent = currentRep; cpcRichText->Top = currentY; ListOfQRRichText->Add(cpcRichText); TQRRichText *widthRichText = CreateQRRichText(QRRichText31); widthRichText->Lines->Add(IDS_WIDTH); widthRichText->Lines->Add(MyFloatToStr(Main->maindata.width,2)+" inch"); widthRichText->Lines->Add(MyFloatToStr(SimulationForm->sd.width,2)+" inch"); widthRichText->Height = fabricRichText->Height; widthRichText->Parent = currentRep; widthRichText->Top = currentY; ListOfQRRichText->Add(widthRichText); TQRRichText *weightRichText = CreateQRRichText(QRRichText32); weightRichText->Lines->Add(IDS_WEIGHT); weightRichText->Height = fabricRichText->Height; weightRichText->Parent = currentRep; weightRichText->Top = currentY; ListOfQRRichText->Add(weightRichText); double gpy=0; for(int i=0;itexlayer->YarnUseList->Count;i++){ YarnUse *yu=(YarnUse *)Main->texlayer->YarnUseList->Items[i]; gpy+=yu->GPY; } memset(buf,0,256); value=gpy; FloatToText(buf, &value, fvExtended, ffNumber, 8, 1); weightRichText->Lines->Add(AnsiString(buf)+" g/y"); memset(buf,0,256); value=gpy/Main->maindata.cpc*SimulationForm->sd.cpc; FloatToText(buf, &value, fvExtended, ffNumber, 8, 1); weightRichText->Lines->Add(AnsiString(buf)+" g/y"); currentY += fabricRichText->Height + 10; //////////////////////////////////////////////////////////////////////////////// TQRRichText *quotaPerDayRichText = CreateQRRichText(QRRichText33); AnsiString str="QUOTA/DAY : "+IntToStr(MetaDataForm->md.rpm)+" X "+ MyFloatToStr(MetaDataForm->md.hours,2)+"h X 60 X " +MyFloatToStr(MetaDataForm->md.efficiency/100.0,2)+" / "+ MyFloatToStr(Main->maindata.cpc,2)+" / 91.44 X "+IntToStr(MetaDataForm->md.count_of_w)+" = "+ MyFloatToStr(MetaDataForm->md.rpm*MetaDataForm->md.hours*60.0*(MetaDataForm->md.efficiency/100.0)/ Main->maindata.cpc/91.44*MetaDataForm->md.count_of_w,2); quotaPerDayRichText->Lines->Add(str); quotaPerDayRichText->Height = quotaPerDayRichText->Lines->Count * lineHeight; if(currentY + quotaPerDayRichText->Height > currentRep->Height - bottomMargin) { currentY = initTop; currentRep = new TQuickRep(this); currentRep->OnNeedData = RepNeedData; QuickRepList->Add(currentRep); } quotaPerDayRichText->Parent = currentRep; quotaPerDayRichText->Top = currentY; ListOfQRRichText->Add(quotaPerDayRichText); currentY += quotaPerDayRichText->Height + 10; //////////////////////////////////////////////////////////////////////////////// TQRRichText *machineNameRichText = CreateQRRichText(QRRichText34); machineNameRichText->Lines->Add("MACHINE NAME : "+MetaDataForm->md.machineName); machineNameRichText->Height = machineNameRichText->Lines->Count * lineHeight; if(currentY + machineNameRichText->Height > currentRep->Height - bottomMargin) { currentY = initTop; currentRep = new TQuickRep(this); currentRep->OnNeedData = RepNeedData; QuickRepList->Add(currentRep); } machineNameRichText->Parent = currentRep; machineNameRichText->Top = currentY; ListOfQRRichText->Add(machineNameRichText); currentY += machineNameRichText->Height + 10; //////////////////////////////////////////////////////////////////////////////// if(DesignForm->ELmode) {//gabriel Chain[0] = EditorForm->ELMemo1->Text; Chain[1] = EditorForm->ELMemo2->Text; Chain[2] = EditorForm->ELMemo3->Text; Chain[3] = EditorForm->ELMemo4->Text; Chain[4] = EditorForm->ELMemo5->Text; Chain[5] = EditorForm->ELMemo6->Text; Chain[MAX_LAYER_COUNT-1] = EditorForm->ELMemo7->Text; } for(int i=0;imaindata.bar;i++){ TQRRichText *barRichText = CreateQRRichText(QRRichText36); TQRRichText *elMemoRichText = CreateQRRichText(QRRichText35); ListOfQRRichText->Add(barRichText); ListOfQRRichText->Add(elMemoRichText); if (Main->LayerMode) { //Layer:0, Bar: 1 by david 090430 if (barCount - i > 0) barRichText->Lines->Add("GB" + IntToStr(barCount - i)); } else { barRichText->Lines->Add("L"+IntToStr(i+1)); } elMemoRichText->Lines->Add(Chain[i]+" = "+IntToStr(Main->maindata.course)+" COS"); elMemoRichText->Height = elMemoRichText->Lines->Count * lineHeight; barRichText->Height = elMemoRichText->Height; if(currentY + barRichText->Height > currentRep->Height - bottomMargin) { currentY = initTop; currentRep = new TQuickRep(this); currentRep->OnNeedData = RepNeedData; QuickRepList->Add(currentRep); } barRichText->Parent = currentRep; elMemoRichText->Parent = currentRep; barRichText->Top = currentY; elMemoRichText->Top = currentY; currentY += barRichText->Height; } currentY += 10; //////////////////////////////////////////////////////////////////////////////// for(int i=0;imaindata.bar;i++){ Tex *tex=(Tex *)Main->texlayer->TexList->Items[i]; TQRRichText *barRichText = CreateQRRichText(QRRichText37); TQRRichText *leftShiftRichText = CreateQRRichText(QRRichText38); ListOfQRRichText->Add(barRichText); ListOfQRRichText->Add(leftShiftRichText); if (Main->LayerMode) { //Layer:0, Bar: 1 by david 090430 if (barCount - i > 0) barRichText->Lines->Add("GB" + IntToStr(barCount - i)); } else { barRichText->Lines->Add("L"+IntToStr(i+1)); } leftShiftRichText->Lines->Add(InOut[i]+" START="+IntToStr(tex->leftShift)); leftShiftRichText->Height = leftShiftRichText->Lines->Count * lineHeight; barRichText->Height = leftShiftRichText->Height; if(currentY + barRichText->Height > currentRep->Height - bottomMargin) { currentY = initTop; currentRep = new TQuickRep(this); currentRep->OnNeedData = RepNeedData; QuickRepList->Add(currentRep); } barRichText->Parent = currentRep; leftShiftRichText->Parent = currentRep; barRichText->Top = currentY; leftShiftRichText->Top = currentY; currentY += barRichText->Height; } currentY += 10; //////////////////////////////////////////////////////////////////////////////// TQRRichText *mmDetailRichText = CreateQRRichText(QRRichText39); //2007.01.10. diekun ÁٳѱèÀ§Ä¡°¡ Á¦´ë·Î ³Ñ¾î°¥ ¼ö ÀÖµµ·Ï Åëä·Î º¹»çÇÏ°Ô º¯°æ //MetaDataForm->mmDetail->SelectAll(); //mmDetailRichText->Lines->Add(MetaDataForm->mmDetail->SelText); //MetaDataForm->mmDetail->SelLength = 0; mmDetailRichText->Lines->Add(MetaDataForm->mmDetail->Text); mmDetailRichText->Height = mmDetailRichText->Lines->Count * lineHeight; if(currentY + mmDetailRichText->Height > currentRep->Height - bottomMargin) { currentY = initTop; currentRep = new TQuickRep(this); currentRep->OnNeedData = RepNeedData; QuickRepList->Add(currentRep); } mmDetailRichText->Parent = currentRep; mmDetailRichText->Top = currentY; ListOfQRRichText->Add(mmDetailRichText); currentY += (mmDetailRichText->Height + 10); //////////////////////////////////////////////////////////////////////////////// int dx=0,dy=0,sx=0,sy=0; //////////////////////////////////////////////////////////////////////////////// TTexpiaBitmap *image=DesignForm->smallchart; if(image){ int cntx=(image->Width-1)/360+1; int cnty=(image->Height-1)/200+1; if(cntx>2)cntx=2; if(cnty>2)cnty=2; for(int j=0;jWidth=360; qri->Height=200; qri->Picture->Bitmap->Width=qri->Width; qri->Picture->Bitmap->Height=qri->Height; if(currentY + qri->Height > currentRep->Height - bottomMargin) { currentY = initTop; currentRep = new TQuickRep(this); currentRep->OnNeedData = RepNeedData; QuickRepList->Add(currentRep); } qri->Parent= currentRep; qri->Left=38+(cntx-i-1)*qri->Width; qri->Top=currentY+(cnty-j-1)*qri->Height; HDC dc=image->CreateDC(); dx=0,dy=0; if(image->Width>qri->Width) { sx = image->Width-(i+1)*qri->Width; dx = 0; } else { sx = 0; dx = 0; } if(image->Height>qri->Height) { sy = (cnty-j-1)*qri->Height; dy = 0; } else { sy = 0; dy = 0; } BitBlt(qri->Picture->Bitmap->Canvas->Handle, dx, dy, qri->Width, qri->Height, dc, sx, sy, SRCCOPY); image->DeleteDC(dc); ListOfQRImage->Add(qri); } } } //////////////////////////////////////////////////////////////////////////////// } //--------------------------------------------------------------------------- /* void __fastcall THiddenPrintDataForm::SetqrStandardDesign(){ //////////////////////////////////////////////////////////////////////////////// ListOfQRImage=new TList; char buf[256]; Extended value; //////////////////////////////////////////////////////////////////////////////// Main->SetAll(); int barCount = Main->maindata.bar; //////////////////////////////////////////////////////////////////////////////// AnsiString InOut[MAX_LAYER_COUNT]={"FULL","FULL","FULL","FULL","FULL","FULL"}; for(int l=0;lmaindata.bar;l++){ if(GuideBar_F->gd.iodescription[l]!=""){ InOut[l]=GuideBar_F->gd.iodescription[l]; continue; } AnsiString str; Tex *tex = ((Tex *)Main->texlayer->TexList->Items[l]); for(int i=0;iWales->Count;i++){ WaleState *ws = (WaleState *)tex->Wales->Items[i]; if(ws->in){ str+=IntToStr(ws->cnt)+AnsiString((char)('A'+ws->yarnIndex))+" "; } else { str+=IntToStr(ws->cnt)+"X "; } } if(tex->Wales->Count==1)str="FULL"; if(str!="")InOut[l]=str; } //////////////////////////////////////////////////////////////////////////////// AnsiString Chain[MAX_LAYER_COUNT]; for(int l=0;lmaindata.bar;l++){ AnsiString str; Tex *tex = ((Tex *)Main->texlayer->TexList->Items[l]); if(tex->Curve->Count%2||tex->Curve->Count<3){ //Ȧ¼öÀ̸é ÀüºÎ Ç¥Çö for(int i=0;iCurve->Count;i++){ KO *ko = (KO *)tex->Curve->Items[i]; if(PrintForm->rgChain->ItemIndex==0){ str+=IntToStr(ko->in)+IntToStr(ko->via)+" "; } else { str+=IntToStr(ko->in)+IntToStr(ko->via)+IntToStr(ko->out)+" "; } } } else { // ¦¼öÀ̸é Áߺ¹ üũ // bool repeat=true; KO *ko01 = (KO *)tex->Curve->Items[0]; KO *ko02 = (KO *)tex->Curve->Items[1]; for(int i=0;iCurve->Count/2;i++){ KO *ko1 = (KO *)tex->Curve->Items[2*i]; KO *ko2 = (KO *)tex->Curve->Items[2*i+1]; if(ko01->in!=ko1->in||ko01->via!=ko1->via|| ko02->in!=ko2->in||ko02->via!=ko2->via) { repeat=false; break; } } if(repeat){ KO *ko1 = (KO *)tex->Curve->Items[0]; KO *ko2 = (KO *)tex->Curve->Items[1]; if(PrintForm->rgChain->ItemIndex==0){ str+=IntToStr(ko1->in)+IntToStr(ko1->via)+" "+IntToStr(ko2->in)+IntToStr(ko2->via)+" "; } else { str+=IntToStr(ko1->in)+IntToStr(ko1->via)+IntToStr(ko1->out)+" "+ IntToStr(ko2->in)+IntToStr(ko2->via)+IntToStr(ko2->out)+" "; } } else { for(int i=0;iCurve->Count;i++){ KO *ko = (KO *)tex->Curve->Items[i]; if(PrintForm->rgChain->ItemIndex==0){ str+=IntToStr(ko->in)+IntToStr(ko->via)+" "; } else { str+=IntToStr(ko->in)+IntToStr(ko->via)+IntToStr(ko->out)+" "; } } } } Chain[l]=str; } //////////////////////////////////////////////////////////////////////////////// AnsiString s1=ExtractFileName(Main->maindata.FileName); s1=s1.SubString(1,s1.Length()-4); s1=s1.UpperCase(); QRLabel128->Caption="NAME : "+s1; QRLabel129->Caption="CODE : "+Main->maindata.ProductCode; QRLabel130->Caption="DATE : "+MetaDataForm->md.Time; QRLabel144->Caption=MetaDataForm->md.ResponsiblePart;//by maxleo21c (06.11.08) //////////////////////////////////////////////////////////////////////////////// QRRichText28->Lines->Clear(); QRRichText28->Lines->Add(""); QRRichText28->Lines->Add("RAW"); QRRichText28->Lines->Add("SIMULATED"); QRRichText29->Lines->Clear(); QRRichText29->Lines->Add("WPI"); QRRichText29->Lines->Add(IntToStr(Main->maindata.gauge)); QRRichText29->Lines->Add(MyFloatToStr(SimulationForm->sd.gauge,2)); QRRichText30->Lines->Clear(); QRRichText30->Lines->Add("CPC"); QRRichText30->Lines->Add(MyFloatToStr(Main->maindata.cpc,2)); QRRichText30->Lines->Add(MyFloatToStr(SimulationForm->sd.cpc,2)); QRRichText31->Lines->Clear(); QRRichText31->Lines->Add("Width"); QRRichText31->Lines->Add(MyFloatToStr(Main->maindata.width,2)+" inch"); QRRichText31->Lines->Add(MyFloatToStr(SimulationForm->sd.width,2)+" inch"); QRRichText32->Lines->Clear(); QRRichText32->Lines->Add("Weight"); double gpy=0; for(int i=0;itexlayer->YarnUseList->Count;i++){ YarnUse *yu=(YarnUse *)Main->texlayer->YarnUseList->Items[i]; gpy+=yu->GPY; } memset(buf,0,256); value=gpy; FloatToText(buf, &value, fvExtended, ffNumber, 8, 1); QRRichText32->Lines->Add(AnsiString(buf)+" g/y"); memset(buf,0,256); value=gpy/Main->maindata.cpc*SimulationForm->sd.cpc; FloatToText(buf, &value, fvExtended, ffNumber, 8, 1); QRRichText32->Lines->Add(AnsiString(buf)+" g/y"); //////////////////////////////////////////////////////////////////////////////// QRRichText33->Lines->Clear(); AnsiString str="QUOTA/DAY : "+IntToStr(MetaDataForm->md.rpm)+" X "+ MyFloatToStr(MetaDataForm->md.hours,2)+"h X 60 X " +MyFloatToStr(MetaDataForm->md.efficiency/100.0,2)+" / "+ MyFloatToStr(Main->maindata.cpc,2)+" / 91.44 X "+IntToStr(MetaDataForm->md.count_of_w)+" = "+ MyFloatToStr(MetaDataForm->md.rpm*MetaDataForm->md.hours*60.0*(MetaDataForm->md.efficiency/100.0)/ Main->maindata.cpc/91.44*MetaDataForm->md.count_of_w,2); QRRichText33->Lines->Add(str); //////////////////////////////////////////////////////////////////////////////// QRRichText34->Lines->Clear(); QRRichText34->Lines->Add("MACHINE NAME : "+MetaDataForm->md.machineName); //////////////////////////////////////////////////////////////////////////////// QRRichText35->Lines->Clear(); QRRichText36->Lines->Clear(); if(DesignForm->ELmode) {//gabriel Chain[0] = EditorForm->ELMemo1->Text; Chain[1] = EditorForm->ELMemo2->Text; Chain[2] = EditorForm->ELMemo3->Text; Chain[3] = EditorForm->ELMemo4->Text; Chain[4] = EditorForm->ELMemo5->Text; Chain[MAX_LAYER_COUNT-1] = EditorForm->ELMemo6->Text; } for(int i=0;imaindata.bar;i++){ Tex *tex=(Tex *)Main->texlayer->TexList->Items[i]; while(QRRichText35->Lines->Count>QRRichText36->Lines->Count){ QRRichText36->Lines->Add(""); } if (Main->LayerMode) { //Layer:0, Bar: 1 by david 090430 if (barCount - i > 0) QRRichText36->Lines->Add("GB" + IntToStr(barCount - i)); } else { QRRichText36->Lines->Add("L"+IntToStr(i+1)); } QRRichText35->Lines->Add(Chain[i]+" = "+IntToStr(Main->maindata.course)+" COS"); } //////////////////////////////////////////////////////////////////////////////// QRRichText37->Lines->Clear(); QRRichText38->Lines->Clear(); for(int i=0;imaindata.bar;i++){ Tex *tex=(Tex *)Main->texlayer->TexList->Items[i]; while(QRRichText38->Lines->Count>QRRichText37->Lines->Count){ QRRichText37->Lines->Add(""); } if (Main->LayerMode) { //Layer:0, Bar: 1 by david 090430 if (barCount - i > 0) QRRichText37->Lines->Add("GB" + IntToStr(barCount - i)); } else { QRRichText37->Lines->Add("L"+IntToStr(i+1)); } QRRichText38->Lines->Add(InOut[i]+" START="+IntToStr(tex->leftShift)); } //////////////////////////////////////////////////////////////////////////////// QRRichText39->Lines->Clear(); /*for(int i=0;immDetail->Lines->Count;i++){ QRRichText39->Lines->Add(MetaDataForm->mmDetail->Lines->Strings[i]); }* / //2007.01.10. diekun ÁٳѱèÀ§Ä¡°¡ Á¦´ë·Î ³Ñ¾î°¥ ¼ö ÀÖµµ·Ï Åëä·Î º¹»çÇÏ°Ô º¯°æ MetaDataForm->mmDetail->SelectAll(); QRRichText39->Lines->Add(MetaDataForm->mmDetail->SelText); MetaDataForm->mmDetail->SelLength = 0; //////////////////////////////////////////////////////////////////////////////// int dx=0,dy=0,sx=0,sy=0; //////////////////////////////////////////////////////////////////////////////// TTexpiaBitmap *image=DesignForm->smallchart; if(image){ int cntx=(image->Width-1)/360+1; int cnty=(image->Height-1)/200+1; if(cntx>2)cntx=2; if(cnty>2)cnty=2; for(int i=0;iParent=qrStandardDesign; qri->Width=360; qri->Height=200; qri->Picture->Bitmap->Width=qri->Width; qri->Picture->Bitmap->Height=qri->Height; qri->Left=38+(cntx-i-1)*qri->Width; qri->Top=680+(cnty-j-1)*qri->Height; HDC dc=image->CreateDC(); dx=0,dy=0; if(image->Width>qri->Width) { sx = image->Width-(i+1)*qri->Width; dx = 0; } else { sx = 0; dx = 0; } if(image->Height>qri->Height) { sy = (cnty-j-1)*qri->Height; dy = 0; } else { sy = 0; dy = 0; } BitBlt(qri->Picture->Bitmap->Canvas->Handle, dx, dy, qri->Width, qri->Height, dc, sx, sy, SRCCOPY); image->DeleteDC(dc); ListOfQRImage->Add(qri); } } } //////////////////////////////////////////////////////////////////////////////// } //--------------------------------------------------------------------------- */ void __fastcall THiddenPrintDataForm::SetqrStandardDesignImage(int layer){// ÀåÁø¸¸ //////////////////////////////////////////////////////////////////////////////// if(ListOfQRImage){ TQRImage *qri; for (int i = 0; i< ListOfQRImage->Count; i++) { qri = (TQRImage *)ListOfQRImage->Items[i]; delete qri; } ListOfQRImage->Clear(); delete ListOfQRImage; ListOfQRImage=NULL; } ListOfQRImage = new TList; char buf[256]; Extended value; //////////////////////////////////////////////////////////////////////////////// Main->SetAll(); //////////////////////////////////////////////////////////////////////////////// AnsiString s1=ExtractFileName(Main->maindata.FileName); s1=s1.SubString(1,s1.Length()-4); s1=s1.UpperCase(); //QRLabel135->Caption="NAME : "+s1; //QRLabel136->Caption="CODE : "+Main->maindata.ProductCode; //QRLabel137->Caption="DATE : "+MetaDataForm->md.Time; SetSmallFont(QRLabel135->Font); SetSmallFont(QRLabel136->Font); SetSmallFont(QRLabel137->Font); QRLabel135->Caption=IDS_NAME + " " +s1; QRLabel136->Caption=IDS_CODE_COLON + " " + Main->maindata.ProductCode; QRLabel137->Caption=IDS_DATE + " " + MetaDataForm->md.Time; QRLabel145->Caption=MetaDataForm->md.ResponsiblePart;//by maxleo21c (06.11.08) //////////////////////////////////////////////////////////////////////////////// int dx=0,dy=0,sx=0,sy=0; //////////////////////////////////////////////////////////////////////////////// int look[MAX_LAYER_COUNT];//, repeat[5]; if (Main->LayerMode) { //Bar look[0] = DesignForm->cbBar1->Checked; look[1] = DesignForm->cbBar2->Checked; look[2] = DesignForm->cbBar3->Checked; look[3] = DesignForm->cbBar4->Checked; look[4] = DesignForm->cbBar5->Checked; look[5] = DesignForm->cbBar6->Checked; look[6] = DesignForm->cbBar7->Checked; } else { look[0] = DesignForm->cbLayer1->Checked; look[1] = DesignForm->cbLayer2->Checked; look[2] = DesignForm->cbLayer3->Checked; look[3] = DesignForm->cbLayer4->Checked; look[4] = DesignForm->cbLayer5->Checked; look[5] = DesignForm->cbLayer6->Checked; look[6] = DesignForm->cbLayer7->Checked; } // repeat[0] = DesignForm->cbRepeatLayer1->Checked; // repeat[1] = DesignForm->cbRepeatLayer2->Checked; // repeat[2] = DesignForm->cbRepeatLayer3->Checked; // repeat[3] = DesignForm->cbRepeatLayer4->Checked; if(layer){ if (Main->LayerMode) { //Bar QRLabel138->Caption="GB : "+IntToStr(layer); if(layer != 1) DesignForm->cbBar1->Checked = false; else DesignForm->cbBar1->Checked = true; if(layer != 2) DesignForm->cbBar2->Checked = false; else DesignForm->cbBar2->Checked = true; if(layer != 3) DesignForm->cbBar3->Checked = false; else DesignForm->cbBar3->Checked = true; if(layer != 4) DesignForm->cbBar4->Checked = false; else DesignForm->cbBar4->Checked = true; if(layer != 5) DesignForm->cbBar5->Checked = false; else DesignForm->cbBar5->Checked = true; if(layer != 6) DesignForm->cbBar6->Checked = false; else DesignForm->cbBar6->Checked = true; if(layer != MAX_LAYER_COUNT) DesignForm->cbBar7->Checked = false; else DesignForm->cbBar7->Checked = true; } else { QRLabel138->Caption="LAYER : "+IntToStr(layer); if(layer != 1) DesignForm->cbLayer1->Checked = false; else DesignForm->cbLayer1->Checked = true; if(layer != 2) DesignForm->cbLayer2->Checked = false; else DesignForm->cbLayer2->Checked = true; if(layer != 3) DesignForm->cbLayer3->Checked = false; else DesignForm->cbLayer3->Checked = true; if(layer != 4) DesignForm->cbLayer4->Checked = false; else DesignForm->cbLayer4->Checked = true; if(layer != 5) DesignForm->cbLayer5->Checked = false; else DesignForm->cbLayer5->Checked = true; if(layer != 6) DesignForm->cbLayer6->Checked = false; else DesignForm->cbLayer6->Checked = true; if(layer != MAX_LAYER_COUNT) DesignForm->cbLayer7->Checked = false; else DesignForm->cbLayer7->Checked = true; } // DesignForm->cbRepeatLayer1->Checked = false; // DesignForm->cbRepeatLayer2->Checked = false; // DesignForm->cbRepeatLayer3->Checked = false; // DesignForm->cbRepeatLayer4->Checked = false; } else{ QRLabel138->Caption=""; } ///by siuaa 080402 ¼±ÅÃµÈ layer¸¦ üũÇÑ ÈÄ bitmapÀ» ¸¸µé¾î¿À´Â °ÍÀ¸·Î ¼öÁ¤ //by siuaa 080328 DesignForm->SetupForPrint(); TTexpiaBitmap *image = DesignForm->ChartForPrint; if(image){ int cntx=(image->Width-1)/360+1; int cnty=(image->Height-1)/190+1; if(cntx > 2) cntx = 2; if(cnty > 5) cnty = 5; int top = image->Height; int bottom = 0; int left = image->Width; int right = 0; TQRImage *qri; for(int i=0;iParent=qrStandardDesignImage; // ²À ºÎ¸ð¸¦ Á¤ÇØÁà¾ßÇÑ´Ù qri->Width=360; // Å©±â¸¦ Àß°Ô(360) ÀÚ¸£´Â ÀÌÀ¯´Â...Äü¸®Æ÷Æ®ÀÇ ¹ö±×·Î ´Ù¿îµÇ´Â Çö»óÀ» ¸·±â À§Çؼ­ÀÌ´Ù-_-;; qri->Height=190; qri->Picture->Bitmap->Width=qri->Width; qri->Picture->Bitmap->Height=qri->Height; qri->Left=38+(cntx-i-1)*qri->Width; qri->Top=130+(cnty-j-1)*qri->Height; HDC dc=image->CreateDC(); dx=0,dy=0; if(image->Width>qri->Width) { sx = image->Width-(i+1)*qri->Width; dx = 0; } else { sx = 0; dx = 0; } if(image->Height>qri->Height) { sy = image->Height - (j + 1) * qri->Height; if(sy < 0) { qri->Picture->Bitmap->Height += sy; qri->Top -= sy; sy = 0; } dy = 0; } else { sy = 0; dy = 0; } if(bottom < qri->Top + qri->Height) bottom = qri->Top + qri->Height; if(top > qri->Top) top = qri->Top; if(left > qri->Left) left = qri->Left; if(right < qri->Left + qri->Width) right = qri->Left + qri->Width; BitBlt(qri->Picture->Bitmap->Canvas->Handle, dx, dy, qri->Width, qri->Height, dc, sx, sy, SRCCOPY); image->DeleteDC(dc); ListOfQRImage->Add(qri); } } //by siuaa 080331 //zoomÀÌ 1/2 À϶§±îÁö¸¸ image ¿·¿¡ ruler Ç¥½Ã. ±× ÀÌÇÏ´Â ³Ê¹« À۾Ƽ­ Ç¥½ÃÇØµµ Àǹ̰¡ ¾øÀ½ if(DesignForm->Zoom >= 2) { if(ListOfRulerLabel){ TQRLabel *label; for (int i = 0; i < ListOfRulerLabel->Count; i++) { label =(TQRLabel *)ListOfRulerLabel->Items[i]; delete label; } ListOfRulerLabel->Clear(); delete ListOfRulerLabel; ListOfRulerLabel = NULL; } ListOfRulerLabel = new TList; int rulerThick = DesignForm->DistY * 3 / 2; int XRulerLength = right - left - rulerThick; int XRulerTop = bottom - rulerThick; int XRulerLeft = left; int YRulerLength = bottom - top - rulerThick; int YRulerTop = top; int YRulerLeft = right - rulerThick; AnsiString index; int countX = (XRulerLength - DesignForm->DistX / 2) / DesignForm->DistX + 1; int countY = YRulerLength / DesignForm->DistY; TQRLabel *qrRulerLabelX, *qrRulerLabelY; for(int i = 0; i < countX; i++) { qrRulerLabelX = new TQRLabel((TComponent *)NULL); qrRulerLabelX->Alignment = taCenter; qrRulerLabelX->Parent = qrStandardDesignImage; qrRulerLabelX->AutoSize = false; qrRulerLabelX->Width = DesignForm->DistX; qrRulerLabelX->Height = DesignForm->DistY; qrRulerLabelX->Font->Height = DesignForm->DistY * 2 / 3; qrRulerLabelX->Visible = true; int x = XRulerLeft + XRulerLength - DesignForm->DistX / 2 - DesignForm->DistX * (i); int y = XRulerTop + 2 + DesignForm->DistY / 6; qrRulerLabelX->Left = x; qrRulerLabelX->Top = y; index = IntToStr(i); qrRulerLabelX->Caption = index; ListOfRulerLabel->Add(qrRulerLabelX); } for(int i = 0; i < countY; i++) { qrRulerLabelY = new TQRLabel((TComponent *)NULL); qrRulerLabelY->Alignment = taCenter; qrRulerLabelY->Parent = qrStandardDesignImage; qrRulerLabelY->AutoSize = false; qrRulerLabelY->Width = DesignForm->DistX; qrRulerLabelY->Height = DesignForm->DistY; qrRulerLabelY->Font->Height = DesignForm->DistY * 2 / 3; qrRulerLabelY->Visible = true; int x = YRulerLeft + 2; int y = YRulerTop + YRulerLength - DesignForm->DistY * (i + 1) + DesignForm->DistY / 6; qrRulerLabelY->Left = x; qrRulerLabelY->Top = y; index = IntToStr(i + 1); qrRulerLabelY->Caption = index; ListOfRulerLabel->Add(qrRulerLabelY); } } //////////// } if(layer){ if (Main->LayerMode) { //Bar DesignForm->cbBar1->Checked = look[0]; DesignForm->cbBar2->Checked = look[1]; DesignForm->cbBar3->Checked = look[2]; DesignForm->cbBar4->Checked = look[3]; DesignForm->cbBar5->Checked = look[4]; DesignForm->cbBar6->Checked = look[5]; DesignForm->cbBar7->Checked = look[6]; } else { //Layer DesignForm->cbLayer1->Checked = look[0]; DesignForm->cbLayer2->Checked = look[1]; DesignForm->cbLayer3->Checked = look[2]; DesignForm->cbLayer4->Checked = look[3]; DesignForm->cbLayer5->Checked = look[4]; DesignForm->cbLayer6->Checked = look[5]; DesignForm->cbLayer7->Checked = look[6]; } // DesignForm->cbRepeatLayer1->Checked = repeat[0]; // DesignForm->cbRepeatLayer2->Checked = repeat[1]; // DesignForm->cbRepeatLayer3->Checked = repeat[2]; // DesignForm->cbRepeatLayer4->Checked = repeat[3]; } //by siuaa 080328 DesignForm->EndSetupForPrint(); //////////////////////////////////////////////////////////////////////////////// } //--------------------------------------------------------------------------- void __fastcall THiddenPrintDataForm::SetqrStandardYarn(){ //////////////////////////////////////////////////////////////////////////////// Main->SetAll(); //////////////////////////////////////////////////////////////////////////////// ListOfQRLabel = new TList(); ListOfQRShape = new TList(); ListOfQRRichText = new TList(); QuickRepList = new TList(); TQuickRep *currentRep = new TQuickRep(this); currentRep->OnNeedData = RepNeedData; QuickRepList->Add(currentRep); const int initTop = 45; const int bottomMargin = 45; const int lineHeight = 17; int currentY = initTop; char buf[256]; Extended value; int barCount = Main->maindata.bar; AnsiString t_text; //////////////////////////////////////////////////////////////////////////////// AnsiString s1=ExtractFileName(Main->maindata.FileName); s1=s1.SubString(1,s1.Length()-4); s1=s1.UpperCase(); TQRLabel *titleLabel = CreateQRLabel(QRLabel61); titleLabel->Parent = currentRep; titleLabel->Top = currentY; ListOfQRLabel->Add(titleLabel); currentY += (titleLabel->Height + 20); TQRLabel *nameLabel = CreateQRLabel(QRLabel131); nameLabel->Parent = currentRep; nameLabel->Top = currentY; //nameLabel->Caption = "NAME : " + s1; nameLabel->Caption = IDS_NAME + " " + s1; // Chinese TDW NDJ ListOfQRLabel->Add(nameLabel); currentY += nameLabel->Height; TQRLabel *codeLabel = CreateQRLabel(QRLabel132); codeLabel->Parent = currentRep; codeLabel->Top = currentY; //codeLabel->Caption= "CODE : " + Main->maindata.ProductCode; codeLabel->Caption= IDS_CODE_COLON + " " + Main->maindata.ProductCode; // Chinese TDW NDJ ListOfQRLabel->Add(codeLabel); TQRLabel *dateLabel = CreateQRLabel(QRLabel133); dateLabel->Parent = currentRep; dateLabel->Top = currentY; //dateLabel->Caption= "DATE : " + MetaDataForm->md.Time; dateLabel->Caption= IDS_DATE + " " + MetaDataForm->md.Time; // Chinese TDW NDJ ListOfQRLabel->Add(dateLabel); currentY += (dateLabel->Height + 10); TQRLabel *partLabel = CreateQRLabel(QRLabel148); partLabel->Parent = currentRep; partLabel->Caption = MetaDataForm->md.ResponsiblePart;//by maxleo21c (06.11.08) ListOfQRLabel->Add(partLabel); //////////////////////////////////////////////////////////////////////////////// TQRLabel *idxColumnLabel = new TQRLabel(this); idxColumnLabel->Caption="IDX"; idxColumnLabel->Left=40; idxColumnLabel->Height = lineHeight; if(currentY + idxColumnLabel->Height > currentRep->Height - bottomMargin) { currentY = initTop; currentRep = new TQuickRep(this); currentRep->OnNeedData = RepNeedData; QuickRepList->Add(currentRep); } idxColumnLabel->Parent = currentRep; idxColumnLabel->Top = currentY; ListOfQRLabel->Add(idxColumnLabel); TQRLabel *nameColumnLabel = new TQRLabel(this); nameColumnLabel->Caption="NAME"; nameColumnLabel->Left=70; nameColumnLabel->Height = lineHeight; nameColumnLabel->Parent = currentRep; nameColumnLabel->Top = currentY; ListOfQRLabel->Add(nameColumnLabel); TQRLabel *codeColumnLabel = new TQRLabel(this); codeColumnLabel->Caption="CODE"; codeColumnLabel->Left = 210; codeColumnLabel->Height = lineHeight; codeColumnLabel->Parent = currentRep; codeColumnLabel->Top = currentY; ListOfQRLabel->Add(codeColumnLabel); TQRLabel *makerColumnLabel = new TQRLabel(this); makerColumnLabel->Caption="MAKER"; makerColumnLabel->Left = 275; makerColumnLabel->Height = lineHeight; makerColumnLabel->Parent = currentRep; makerColumnLabel->Top = currentY; ListOfQRLabel->Add(makerColumnLabel); TQRLabel *specColumnLabel = new TQRLabel(this); specColumnLabel->Caption="SPEC."; specColumnLabel->Left = 330; specColumnLabel->Height = lineHeight; specColumnLabel->Parent = currentRep; specColumnLabel->Top = currentY; ListOfQRLabel->Add(specColumnLabel); TQRLabel *colColumnLabel = new TQRLabel(this); colColumnLabel->Caption="COL."; colColumnLabel->Left = 450; colColumnLabel->Height = lineHeight; colColumnLabel->Parent = currentRep; colColumnLabel->Top = currentY; ListOfQRLabel->Add(colColumnLabel); TQRLabel *contColumnLabel = new TQRLabel(this); contColumnLabel->Caption="CONT."; contColumnLabel->Left = 485; contColumnLabel->Height = lineHeight; contColumnLabel->Parent = currentRep; contColumnLabel->Top = currentY; ListOfQRLabel->Add(contColumnLabel); TQRLabel *reflColumnLabel = new TQRLabel(this); reflColumnLabel->Caption="REFL."; reflColumnLabel->Left = 535; reflColumnLabel->Height = lineHeight; reflColumnLabel->Parent = currentRep; reflColumnLabel->Top = currentY; ListOfQRLabel->Add(reflColumnLabel); TQRLabel *transColumnLabel = new TQRLabel(this); transColumnLabel->Caption="TRANS."; transColumnLabel->Left = 575; transColumnLabel->Height = lineHeight; transColumnLabel->Parent = currentRep; transColumnLabel->Top = currentY; ListOfQRLabel->Add(transColumnLabel); TQRLabel *costColumnLabel = new TQRLabel(this); costColumnLabel->Caption="COST/Kg"; costColumnLabel->Left = 630; costColumnLabel->Height = lineHeight; costColumnLabel->Parent = currentRep; costColumnLabel->Top = currentY; ListOfQRLabel->Add(costColumnLabel); TQRLabel *dateColumnLabel = new TQRLabel(this); dateColumnLabel->Caption="DATE"; dateColumnLabel->Left = 695; dateColumnLabel->Height = lineHeight; dateColumnLabel->Parent = currentRep; dateColumnLabel->Top = currentY; ListOfQRLabel->Add(dateColumnLabel); currentY += idxColumnLabel->Height; for(int i=0;itexlayer->YarnList->Count;i++){ Yarn *yarn=(Yarn *)Main->texlayer->YarnList->Items[i]; TQRLabel *idxItemLabel = CreateQRLabel(idxColumnLabel); idxItemLabel->Caption=AnsiString((char)('A'+i)); if(currentY + idxItemLabel->Height > currentRep->Height - bottomMargin) { currentY = initTop; currentRep = new TQuickRep(this); currentRep->OnNeedData = RepNeedData; QuickRepList->Add(currentRep); } idxItemLabel->Parent = currentRep; idxItemLabel->Top = currentY; ListOfQRLabel->Add(idxItemLabel); TQRLabel *nameItemLabel = CreateQRLabel(nameColumnLabel); nameItemLabel->Caption = yarn->name; nameItemLabel->Parent = currentRep; nameItemLabel->Top = currentY; ListOfQRLabel->Add(nameItemLabel); TQRLabel *codeItemLabel = CreateQRLabel(codeColumnLabel); codeItemLabel->Caption = yarn->code; codeItemLabel->Parent = currentRep; codeItemLabel->Top = currentY; ListOfQRLabel->Add(codeItemLabel); TQRLabel *makerItemLabel = CreateQRLabel(makerColumnLabel); makerItemLabel->Caption = yarn->lot; makerItemLabel->Parent = currentRep; makerItemLabel->Top = currentY; ListOfQRLabel->Add(makerItemLabel); AnsiString spec; YarnCompositionData_F->AddYMToStr(spec,yarn->ym,yarn->ymDirect); spec+=IntToStr((int)yarn->denier); spec+="/"; spec+=IntToStr(yarn->filament); spec+=" "; YarnCompositionData_F->AddYPToStr(spec,yarn->yp,yarn->ypDirect); TQRLabel *specItemLabel = CreateQRLabel(specColumnLabel); specItemLabel->Caption = spec; specItemLabel->Parent = currentRep; specItemLabel->Top = currentY; ListOfQRLabel->Add(specItemLabel); TQRShape *colItemShape = new TQRShape(this); colItemShape->Brush->Color=yarn->color; colItemShape->Left = 450; colItemShape->Height = 11; colItemShape->Width = 20; colItemShape->Parent = currentRep; colItemShape->Top = currentY + 4; ListOfQRShape->Add(colItemShape); double v=yarn->contraction; v+=1; if(v<0.01)v=0.01; TQRLabel *contItemLabel = CreateQRLabel(contColumnLabel); contItemLabel->Caption = MyFloatToStr(100.0/v,2)+"%"; contItemLabel->Parent = currentRep; contItemLabel->Top = currentY; ListOfQRLabel->Add(contItemLabel); TQRLabel *reflItemLabel = CreateQRLabel(reflColumnLabel); reflItemLabel->Caption = MyFloatToStr(yarn->reflection,2); reflItemLabel->Parent = currentRep; reflItemLabel->Top = currentY; ListOfQRLabel->Add(reflItemLabel); TQRLabel *transItemLabel = CreateQRLabel(transColumnLabel); transItemLabel->Caption = MyFloatToStr(yarn->transparency,2); transItemLabel->Parent = currentRep; transItemLabel->Top = currentY; ListOfQRLabel->Add(transItemLabel); TQRLabel *costItemLabel = CreateQRLabel(costColumnLabel); costItemLabel->Caption = MyFloatToStr(yarn->cost,2); costItemLabel->Parent = currentRep; costItemLabel->Top = currentY; ListOfQRLabel->Add(costItemLabel); TQRLabel *dateItemLabel = CreateQRLabel(dateColumnLabel); dateItemLabel->Caption = yarn->detail; dateItemLabel->Parent = currentRep; dateItemLabel->Top = currentY; ListOfQRLabel->Add(dateItemLabel); currentY += idxItemLabel->Height; } currentY += 20; //////////////////////////////////////////////////////////////////////////////// TQRRichText *barColumnRichText = CreateQRRichText(QRRichText40); //barColumnRichText->Lines->Add("BAR"); barColumnRichText->Lines->Add(IDS_BAR);// Chinese TDW NDJ barColumnRichText->Height = barColumnRichText->Lines->Count * lineHeight; if(currentY + barColumnRichText->Height > currentRep->Height - bottomMargin) { currentY = initTop; currentRep = new TQuickRep(this); currentRep->OnNeedData = RepNeedData; QuickRepList->Add(currentRep); } barColumnRichText->Parent = currentRep; barColumnRichText->Top = currentY; ListOfQRRichText->Add(barColumnRichText); TQRRichText *idxColumnRichText = CreateQRRichText(QRRichText41); idxColumnRichText->Lines->Add("IDX"); idxColumnRichText->Height = idxColumnRichText->Lines->Count * lineHeight; idxColumnRichText->Parent = currentRep; idxColumnRichText->Top = currentY; ListOfQRRichText->Add(idxColumnRichText); TQRRichText *specColumnRichText = CreateQRRichText(QRRichText43); specColumnRichText->Lines->Add("SPEC."); specColumnRichText->Height = specColumnRichText->Lines->Count * lineHeight; specColumnRichText->Parent = currentRep; specColumnRichText->Top = currentY; ListOfQRRichText->Add(specColumnRichText); TQRRichText *mPYColumnRichText = CreateQRRichText(QRRichText42); mPYColumnRichText->Lines->Add("m/y"); mPYColumnRichText->Height = mPYColumnRichText->Lines->Count * lineHeight; mPYColumnRichText->Parent = currentRep; mPYColumnRichText->Top = currentY; ListOfQRRichText->Add(mPYColumnRichText); TQRRichText *gPYColumnRichText = CreateQRRichText(QRRichText44); gPYColumnRichText->Lines->Add("m/y"); gPYColumnRichText->Height = gPYColumnRichText->Lines->Count * lineHeight; gPYColumnRichText->Parent = currentRep; gPYColumnRichText->Top = currentY; ListOfQRRichText->Add(gPYColumnRichText); TQRRichText *percentColumnRichText = CreateQRRichText(QRRichText45); percentColumnRichText->Lines->Add("%"); percentColumnRichText->Height = percentColumnRichText->Lines->Count * lineHeight; percentColumnRichText->Parent = currentRep; percentColumnRichText->Top = currentY; ListOfQRRichText->Add(percentColumnRichText); TQRRichText *mmPerRackColumnRichText = CreateQRRichText(QRRichText46); mmPerRackColumnRichText->Lines->Add("mm/RACK"); mmPerRackColumnRichText->Height = mmPerRackColumnRichText->Lines->Count * lineHeight; mmPerRackColumnRichText->Parent = currentRep; mmPerRackColumnRichText->Top = currentY; ListOfQRRichText->Add(mmPerRackColumnRichText); TQRRichText *useColumnRichText = CreateQRRichText(QRRichText47); useColumnRichText->Lines->Add("USE"); useColumnRichText->Height = useColumnRichText->Lines->Count * lineHeight; useColumnRichText->Parent = currentRep; useColumnRichText->Top = currentY; ListOfQRRichText->Add(useColumnRichText); TQRRichText *beamColumnRichText = CreateQRRichText(QRRichText48); beamColumnRichText->Lines->Add("BEAM"); beamColumnRichText->Height = beamColumnRichText->Lines->Count * lineHeight; beamColumnRichText->Parent = currentRep; beamColumnRichText->Top = currentY; ListOfQRRichText->Add(beamColumnRichText); TQRRichText *totalColumnRichText = CreateQRRichText(QRRichText49); totalColumnRichText->Lines->Add("TOTAL"); totalColumnRichText->Height = totalColumnRichText->Lines->Count * lineHeight; totalColumnRichText->Parent = currentRep; totalColumnRichText->Top = currentY; ListOfQRRichText->Add(totalColumnRichText); TQRRichText *costColumnRichText = CreateQRRichText(QRRichText58); costColumnRichText->Lines->Add("COST/Y"); costColumnRichText->Height = costColumnRichText->Lines->Count * lineHeight; costColumnRichText->Parent = currentRep; costColumnRichText->Top = currentY; ListOfQRRichText->Add(costColumnRichText); currentY += barColumnRichText->Height; double total_cost = 0; for(int i=0;itexlayer->YarnUseList->Count;i++){ TQRRichText *barItemRichText = CreateQRRichText(barColumnRichText); TQRRichText *idxItemRichText = CreateQRRichText(idxColumnRichText); TQRRichText *specItemRichText = CreateQRRichText(specColumnRichText); TQRRichText *mPYItemRichText = CreateQRRichText(mPYColumnRichText); TQRRichText *gPYItemRichText = CreateQRRichText(gPYColumnRichText); TQRRichText *percentItemRichText = CreateQRRichText(percentColumnRichText); TQRRichText *mmPerRackItemRichText = CreateQRRichText(mmPerRackColumnRichText); TQRRichText *useItemRichText = CreateQRRichText(useColumnRichText); TQRRichText *beamItemRichText = CreateQRRichText(beamColumnRichText); TQRRichText *totalItemRichText = CreateQRRichText(totalColumnRichText); TQRRichText *costItemRichText = CreateQRRichText(costColumnRichText); ListOfQRRichText->Add(barItemRichText); ListOfQRRichText->Add(idxItemRichText); ListOfQRRichText->Add(specItemRichText); ListOfQRRichText->Add(mPYItemRichText); ListOfQRRichText->Add(gPYItemRichText); ListOfQRRichText->Add(percentItemRichText); ListOfQRRichText->Add(mmPerRackItemRichText); ListOfQRRichText->Add(useItemRichText); ListOfQRRichText->Add(beamItemRichText); ListOfQRRichText->Add(totalItemRichText); ListOfQRRichText->Add(costItemRichText); if(currentY + barItemRichText->Height > currentRep->Height - bottomMargin) { currentY = initTop; currentRep = new TQuickRep(this); currentRep->OnNeedData = RepNeedData; QuickRepList->Add(currentRep); } barItemRichText->Parent = currentRep; idxItemRichText->Parent = currentRep; specItemRichText->Parent = currentRep; mPYItemRichText->Parent = currentRep; gPYItemRichText->Parent = currentRep; percentItemRichText->Parent = currentRep; mmPerRackItemRichText->Parent = currentRep; useItemRichText->Parent = currentRep; beamItemRichText->Parent = currentRep; totalItemRichText->Parent = currentRep; costItemRichText->Parent = currentRep; barItemRichText->Top = currentY; idxItemRichText->Top = currentY; specItemRichText->Top = currentY; mPYItemRichText->Top = currentY; gPYItemRichText->Top = currentY; percentItemRichText->Top = currentY; mmPerRackItemRichText->Top = currentY; useItemRichText->Top = currentY; beamItemRichText->Top = currentY; totalItemRichText->Top = currentY; costItemRichText->Top = currentY; YarnUse *yu=(YarnUse *)Main->texlayer->YarnUseList->Items[i]; Yarn *yarn=(Yarn *)Main->texlayer->YarnList->Items[yu->yarnIndex]; AnsiString str; if (Main->LayerMode) { //Layer:0, Bar: 1 by david 090430 if (barCount - i > 0) str = "GB" + IntToStr(barCount - i); } else { str = "L"+IntToStr(yu->layer_num+1); } barItemRichText->Lines->Add(str); str=AnsiString((char)('A'+yu->yarnIndex)); idxItemRichText->Lines->Add(str); YarnCompositionData_F->AddYMToStr(str,yarn->ym,yarn->ymDirect); str+=IntToStr((int)yarn->denier); str+="/"; str+=IntToStr(yarn->filament); str+=" "; YarnCompositionData_F->AddYPToStr(str,yarn->yp,yarn->ypDirect); specItemRichText->Lines->Add(str); mPYItemRichText->Lines->Add(MyFloatToStr(yu->MPY,3)); gPYItemRichText->Lines->Add(MyFloatToStr(yu->GPY,2)); str=MyFloatToStr(yu->percent,2)+"%"; percentItemRichText->Lines->Add(str); str=IntToStr(yu->mmPerRACK); mmPerRackItemRichText->Lines->Add(str); str=IntToStr(yu->beam); useItemRichText->Lines->Add(str); str=IntToStr(yu->beam); beamItemRichText->Lines->Add(str); str=IntToStr(yu->total_use); totalItemRichText->Lines->Add(str); str = MyFloatToStr(yarn->cost*yu->GPY/1000.0,2); costItemRichText->Lines->Add(str); total_cost += yarn->cost*yu->GPY/1000.0; currentY += barItemRichText->Height; } TQRRichText *totalCostRichText = CreateQRRichText(costColumnRichText); totalCostRichText->Lines->Add(MyFloatToStr(total_cost,2)); if(currentY + totalCostRichText->Height > currentRep->Height - bottomMargin) { currentY = initTop; currentRep = new TQuickRep(this); currentRep->OnNeedData = RepNeedData; QuickRepList->Add(currentRep); } totalCostRichText->Parent = currentRep; totalCostRichText->Top = currentY; ListOfQRRichText->Add(totalCostRichText); currentY += 20; //////////////////////////////////////////////////////////////////////////////// TQRRichText *fabricRichText = CreateQRRichText(QRRichText50); fabricRichText->Lines->Add(""); fabricRichText->Lines->Add(IDS_RAW); fabricRichText->Lines->Add(IDS_SIMULATED); fabricRichText->Height = fabricRichText->Lines->Count * lineHeight; if(currentY + fabricRichText->Height > currentRep->Height - bottomMargin) { currentY = initTop; currentRep = new TQuickRep(this); currentRep->OnNeedData = RepNeedData; QuickRepList->Add(currentRep); } fabricRichText->Parent = currentRep; fabricRichText->Top = currentY; ListOfQRRichText->Add(fabricRichText); TQRRichText *wpiRichText = CreateQRRichText(QRRichText51); wpiRichText->Lines->Add(IDS_WPI); wpiRichText->Lines->Add(IntToStr(Main->maindata.gauge)); wpiRichText->Lines->Add(MyFloatToStr(SimulationForm->sd.gauge,2)); wpiRichText->Height = fabricRichText->Height; wpiRichText->Parent = currentRep; wpiRichText->Top = currentY; ListOfQRRichText->Add(wpiRichText); TQRRichText *cpcRichText = CreateQRRichText(QRRichText52); cpcRichText->Lines->Add(IDS_CPC); cpcRichText->Lines->Add(MyFloatToStr(Main->maindata.cpc,2)); cpcRichText->Lines->Add(MyFloatToStr(SimulationForm->sd.cpc,2)); cpcRichText->Height = fabricRichText->Height; cpcRichText->Parent = currentRep; cpcRichText->Top = currentY; ListOfQRRichText->Add(cpcRichText); TQRRichText *widthRichText = CreateQRRichText(QRRichText53); widthRichText->Lines->Add(IDS_WIDTH); widthRichText->Lines->Add(MyFloatToStr(Main->maindata.width,2)+" inch"); widthRichText->Lines->Add(MyFloatToStr(SimulationForm->sd.width,2)+" inch"); widthRichText->Height = fabricRichText->Height; widthRichText->Parent = currentRep; widthRichText->Top = currentY; ListOfQRRichText->Add(widthRichText); TQRRichText *weightRichText = CreateQRRichText(QRRichText54); weightRichText->Lines->Add(IDS_WEIGHT); weightRichText->Height = fabricRichText->Height; weightRichText->Parent = currentRep; weightRichText->Top = currentY; ListOfQRRichText->Add(weightRichText); double gpy=0; for(int i=0;itexlayer->YarnUseList->Count;i++){ YarnUse *yu=(YarnUse *)Main->texlayer->YarnUseList->Items[i]; gpy+=yu->GPY; } memset(buf,0,256); value=gpy; FloatToText(buf, &value, fvExtended, ffNumber, 8, 1); weightRichText->Lines->Add(AnsiString(buf)+" g/y"); memset(buf,0,256); value=gpy/Main->maindata.cpc*SimulationForm->sd.cpc; FloatToText(buf, &value, fvExtended, ffNumber, 8, 1); weightRichText->Lines->Add(AnsiString(buf)+" g/y"); currentY += fabricRichText->Height + 10; //////////////////////////////////////////////////////////////////////////////// TQRRichText *quotaPerDayRichText = CreateQRRichText(QRRichText55); AnsiString str="QUOTA/DAY : "+IntToStr(MetaDataForm->md.rpm)+" X "+ MyFloatToStr(MetaDataForm->md.hours,2)+"h X 60 X " +MyFloatToStr(MetaDataForm->md.efficiency/100.0,2)+" / "+ MyFloatToStr(Main->maindata.cpc,2)+" / 91.44 X "+IntToStr(MetaDataForm->md.count_of_w)+" = "+ MyFloatToStr(MetaDataForm->md.rpm*MetaDataForm->md.hours*60.0*(MetaDataForm->md.efficiency/100.0)/ Main->maindata.cpc/91.44*MetaDataForm->md.count_of_w,2); quotaPerDayRichText->Lines->Add(str); quotaPerDayRichText->Height = quotaPerDayRichText->Lines->Count * lineHeight; if(currentY + quotaPerDayRichText->Height > currentRep->Height - bottomMargin) { currentY = initTop; currentRep = new TQuickRep(this); currentRep->OnNeedData = RepNeedData; QuickRepList->Add(currentRep); } quotaPerDayRichText->Parent = currentRep; quotaPerDayRichText->Top = currentY; ListOfQRRichText->Add(quotaPerDayRichText); currentY += quotaPerDayRichText->Height + 10; //////////////////////////////////////////////////////////////////////////////// TQRRichText *machineNameRichText = CreateQRRichText(QRRichText56); machineNameRichText->Lines->Add("MACHINE NAME : "+MetaDataForm->md.machineName); machineNameRichText->Height = machineNameRichText->Lines->Count * lineHeight; if(currentY + machineNameRichText->Height > currentRep->Height - bottomMargin) { currentY = initTop; currentRep = new TQuickRep(this); currentRep->OnNeedData = RepNeedData; QuickRepList->Add(currentRep); } machineNameRichText->Parent = currentRep; machineNameRichText->Top = currentY; ListOfQRRichText->Add(machineNameRichText); currentY += machineNameRichText->Height + 10; //////////////////////////////////////////////////////////////////////////////// /*QRRichText57->Lines->Clear(); for(int i=0;immDetail->Lines->Count;i++){ QRRichText57->Lines->Add(MetaDataForm->mmDetail->Lines->Strings[i]); }*/ TQRRichText *mmDetailRichText = CreateQRRichText(QRRichText57); //2007.01.10. diekun ÁٳѱèÀ§Ä¡°¡ Á¦´ë·Î ³Ñ¾î°¥ ¼ö ÀÖµµ·Ï Åëä·Î º¹»çÇÏ°Ô º¯°æ //MetaDataForm->mmDetail->SelectAll(); //mmDetailRichText->Lines->Add(MetaDataForm->mmDetail->SelText); //MetaDataForm->mmDetail->SelLength = 0; mmDetailRichText->Lines->Add(MetaDataForm->mmDetail->Text); mmDetailRichText->Height = mmDetailRichText->Lines->Count * lineHeight; if(currentY + mmDetailRichText->Height > currentRep->Height - bottomMargin) { currentY = initTop; currentRep = new TQuickRep(this); currentRep->OnNeedData = RepNeedData; QuickRepList->Add(currentRep); } mmDetailRichText->Parent = currentRep; mmDetailRichText->Top = currentY; ListOfQRRichText->Add(mmDetailRichText); currentY += (mmDetailRichText->Height + 10); //////////////////////////////////////////////////////////////////////////////// if (DesignForm->ELmode) {//gabriel TQRRichText *mmPerRackRichText; TList **mmPerRackList = new TList*[barCount]; mmPerRackRichText = CreateQRRichText(QRRichText60); mmPerRackRichText->Parent = currentRep; ListOfQRRichText->Add(mmPerRackRichText); int columnIdx = 0; mmPerRackRichText->Left = 40; mmPerRackRichText->Top = currentY; for(int i = 0; i < barCount; i++) { mmPerRackList[i] = new TList(); Print_mmRack_per_Layer(mmPerRackList[i], i + 1); if (Main->LayerMode) { //Layer:0, Bar: 1 by david 090430 t_text = "GB"; t_text += IntToStr(barCount - i); mmPerRackRichText->Lines->Add(t_text);//Bar ó¸® ³»¿ë } else mmPerRackRichText->Lines->Add("L" + IntToStr(i + 1)); mmPerRackRichText->Lines->Add("mm/RACK"); for(int j = 0; j < mmPerRackList[i]->Count; j++) { int tempHeight = (mmPerRackRichText->Lines->Count + 1) * lineHeight; if(currentY + tempHeight > currentRep->Height - bottomMargin) { if(columnIdx < 3) { columnIdx++; mmPerRackRichText = CreateQRRichText(QRRichText60); mmPerRackRichText->Left = 40 + columnIdx * mmPerRackRichText->Width + 40; mmPerRackRichText->Top = currentY; mmPerRackRichText->Parent = currentRep; ListOfQRRichText->Add(mmPerRackRichText); }else { currentY = initTop; currentRep = new TQuickRep(this); currentRep->OnNeedData = RepNeedData; QuickRepList->Add(currentRep); columnIdx = 0; mmPerRackRichText = CreateQRRichText(QRRichText60); mmPerRackRichText->Left = 40; mmPerRackRichText->Top = currentY; mmPerRackRichText->Parent = currentRep; ListOfQRRichText->Add(mmPerRackRichText); } } AnsiString str = *((AnsiString *)mmPerRackList[i]->Items[j]); mmPerRackRichText->Lines->Add(str); mmPerRackRichText->Height = mmPerRackRichText->Lines->Count * lineHeight; } mmPerRackRichText->Lines->Add("================"); mmPerRackRichText->Lines->Add(" "); } for(int i = 0; i < barCount; i++) { AnsiString *str; for(int j = 0; j < mmPerRackList[i]->Count; j++) { str = (AnsiString *)mmPerRackList[i]->Items[j]; delete str; } mmPerRackList[i]->Clear(); delete mmPerRackList[i]; } delete[] mmPerRackList; } } //--------------------------------------------------------------------------- /* void __fastcall THiddenPrintDataForm::SetqrStandardYarn(){ //////////////////////////////////////////////////////////////////////////////// Main->SetAll(); //////////////////////////////////////////////////////////////////////////////// ListOfQRLabel=new TList; ListOfQRShape=new TList; TQRLabel *qrl=NULL; TQRShape *qrs=NULL; char buf[256]; Extended value; int barCount = Main->maindata.bar; AnsiString t_text; //////////////////////////////////////////////////////////////////////////////// AnsiString s1=ExtractFileName(Main->maindata.FileName); s1=s1.SubString(1,s1.Length()-4); s1=s1.UpperCase(); QRLabel131->Caption="NAME : "+s1; QRLabel132->Caption="CODE : "+Main->maindata.ProductCode; QRLabel133->Caption="DATE : "+MetaDataForm->md.Time; QRLabel148->Caption=MetaDataForm->md.ResponsiblePart;//by maxleo21c (06.11.08) //////////////////////////////////////////////////////////////////////////////// qrl=new TQRLabel(this); qrl->Parent=qrStandardYarn; qrl->Left=40; qrl->Top=139; qrl->Caption="IDX"; ListOfQRLabel->Add(qrl); qrl=new TQRLabel(this); qrl->Parent=qrStandardYarn; qrl->Left=70; qrl->Top=139; qrl->Caption="NAME"; ListOfQRLabel->Add(qrl); qrl=new TQRLabel(this); qrl->Parent=qrStandardYarn; qrl->Left=210; qrl->Top=139; qrl->Caption="CODE"; ListOfQRLabel->Add(qrl); qrl=new TQRLabel(this); qrl->Parent=qrStandardYarn; qrl->Left=275; qrl->Top=139; qrl->Caption="MAKER"; ListOfQRLabel->Add(qrl); qrl=new TQRLabel(this); qrl->Parent=qrStandardYarn; qrl->Left=330; qrl->Top=139; qrl->Caption="SPEC."; ListOfQRLabel->Add(qrl); qrl=new TQRLabel(this); qrl->Parent=qrStandardYarn; qrl->Left=450; qrl->Top=139; qrl->Caption="COL."; ListOfQRLabel->Add(qrl); qrl=new TQRLabel(this); qrl->Parent=qrStandardYarn; qrl->Left=485; qrl->Top=139; qrl->Caption="CONT."; ListOfQRLabel->Add(qrl); qrl=new TQRLabel(this); qrl->Parent=qrStandardYarn; qrl->Left=535; qrl->Top=139; qrl->Caption="REFL."; ListOfQRLabel->Add(qrl); qrl=new TQRLabel(this); qrl->Parent=qrStandardYarn; qrl->Left=575; qrl->Top=139; qrl->Caption="TRANS."; ListOfQRLabel->Add(qrl); qrl=new TQRLabel(this); qrl->Parent=qrStandardYarn; qrl->Left=630; qrl->Top=139; qrl->Caption="COST/Kg"; ListOfQRLabel->Add(qrl); qrl=new TQRLabel(this); qrl->Parent=qrStandardYarn; qrl->Left=695; qrl->Top=139; qrl->Caption="DATE"; ListOfQRLabel->Add(qrl); for(int i=0;itexlayer->YarnList->Count;i++){ Yarn *yarn=(Yarn *)Main->texlayer->YarnList->Items[i]; qrl=new TQRLabel(this); qrl->Parent=qrStandardYarn; qrl->Left=40; qrl->Top=139+(i+1)*13; qrl->Caption=AnsiString((char)('A'+i)); ListOfQRLabel->Add(qrl); qrl=new TQRLabel(this); qrl->Parent=qrStandardYarn; qrl->Left=70; qrl->Top=139+(i+1)*13; qrl->Caption=yarn->name; ListOfQRLabel->Add(qrl); qrl=new TQRLabel(this); qrl->Parent=qrStandardYarn; qrl->Left=210; qrl->Top=139+(i+1)*13; qrl->Caption=yarn->code; ListOfQRLabel->Add(qrl); qrl=new TQRLabel(this); qrl->Parent=qrStandardYarn; qrl->Left=275; qrl->Top=139+(i+1)*13; qrl->Caption=yarn->lot; ListOfQRLabel->Add(qrl); AnsiString spec; YarnCompositionData_F->AddYMToStr(spec,yarn->ym,yarn->ymDirect); spec+=IntToStr((int)yarn->denier); spec+="/"; spec+=IntToStr(yarn->filament); spec+=" "; YarnCompositionData_F->AddYPToStr(spec,yarn->yp,yarn->ypDirect); qrl=new TQRLabel(this); qrl->Parent=qrStandardYarn; qrl->Left=330; qrl->Top=139+(i+1)*13; qrl->Caption=spec; ListOfQRLabel->Add(qrl); qrs=new TQRShape(this); qrs->Parent=qrStandardYarn; qrs->Left=450; qrs->Top=143+(i+1)*13; qrs->Height=11; qrs->Width=20; qrs->Brush->Color=yarn->color; ListOfQRShape->Add(qrs); qrl=new TQRLabel(this); qrl->Parent=qrStandardYarn; qrl->Left=485; qrl->Top=139+(i+1)*13; double v=yarn->contraction; v+=1; if(v<0.01)v=0.01; qrl->Caption=MyFloatToStr(100.0/v,2)+"%"; ListOfQRLabel->Add(qrl); qrl=new TQRLabel(this); qrl->Parent=qrStandardYarn; qrl->Left=535; qrl->Top=139+(i+1)*13; qrl->Caption=MyFloatToStr(yarn->reflection,2); ListOfQRLabel->Add(qrl); qrl=new TQRLabel(this); qrl->Parent=qrStandardYarn; qrl->Left=575; qrl->Top=139+(i+1)*13; qrl->Caption=MyFloatToStr(yarn->transparency,2); ListOfQRLabel->Add(qrl); qrl=new TQRLabel(this); qrl->Parent=qrStandardYarn; qrl->Left=630; qrl->Top=139+(i+1)*13; qrl->Caption=MyFloatToStr(yarn->cost,2); ListOfQRLabel->Add(qrl); qrl=new TQRLabel(this); qrl->Parent=qrStandardYarn; qrl->Left=695; qrl->Top=139+(i+1)*13; qrl->Caption=yarn->detail; ListOfQRLabel->Add(qrl); } //////////////////////////////////////////////////////////////////////////////// QRRichText40->Lines->Clear(); QRRichText40->Lines->Add("BAR"); for(int i=0;itexlayer->YarnUseList->Count;i++){ YarnUse *yu=(YarnUse *)Main->texlayer->YarnUseList->Items[i]; Yarn *yarn=(Yarn *)Main->texlayer->YarnList->Items[yu->yarnIndex]; AnsiString str; if (Main->LayerMode) { //Layer:0, Bar: 1 by david 090430 if (barCount - i > 0) str = "GB" + IntToStr(barCount - i); } else { str = "L"+IntToStr(yu->layer_num+1); } QRRichText40->Lines->Add(str); } QRRichText41->Lines->Clear(); QRRichText41->Lines->Add("IDX"); for(int i=0;itexlayer->YarnUseList->Count;i++){ YarnUse *yu=(YarnUse *)Main->texlayer->YarnUseList->Items[i]; AnsiString str=AnsiString((char)('A'+yu->yarnIndex)); QRRichText41->Lines->Add(str); } QRRichText43->Lines->Clear(); QRRichText43->Lines->Add("SPEC."); for(int i=0;itexlayer->YarnUseList->Count;i++){ YarnUse *yu=(YarnUse *)Main->texlayer->YarnUseList->Items[i]; Yarn *yarn=(Yarn *)Main->texlayer->YarnList->Items[yu->yarnIndex]; AnsiString spec; YarnCompositionData_F->AddYMToStr(spec,yarn->ym,yarn->ymDirect); spec+=IntToStr((int)yarn->denier); spec+="/"; spec+=IntToStr(yarn->filament); spec+=" "; YarnCompositionData_F->AddYPToStr(spec,yarn->yp,yarn->ypDirect); AnsiString str=spec; QRRichText43->Lines->Add(str); } QRRichText42->Lines->Clear(); QRRichText42->Lines->Add("m/y"); for(int i=0;itexlayer->YarnUseList->Count;i++){ YarnUse *yu=(YarnUse *)Main->texlayer->YarnUseList->Items[i]; QRRichText42->Lines->Add(MyFloatToStr(yu->MPY,3)); } QRRichText44->Lines->Clear(); QRRichText44->Lines->Add("g/y"); for(int i=0;itexlayer->YarnUseList->Count;i++){ YarnUse *yu=(YarnUse *)Main->texlayer->YarnUseList->Items[i]; QRRichText44->Lines->Add(MyFloatToStr(yu->GPY,2)); } QRRichText45->Lines->Clear(); QRRichText45->Lines->Add("%"); for(int i=0;itexlayer->YarnUseList->Count;i++){ YarnUse *yu=(YarnUse *)Main->texlayer->YarnUseList->Items[i]; Yarn *yarn=(Yarn *)Main->texlayer->YarnList->Items[yu->yarnIndex]; AnsiString str=MyFloatToStr(yu->percent,2)+"%"; QRRichText45->Lines->Add(str); } QRRichText46->Lines->Clear(); QRRichText46->Lines->Add("mm/RACK"); for(int i=0;itexlayer->YarnUseList->Count;i++){ YarnUse *yu=(YarnUse *)Main->texlayer->YarnUseList->Items[i]; Yarn *yarn=(Yarn *)Main->texlayer->YarnList->Items[yu->yarnIndex]; AnsiString str=IntToStr(yu->mmPerRACK); QRRichText46->Lines->Add(str); } QRRichText47->Lines->Clear(); QRRichText47->Lines->Add("USE"); for(int i=0;itexlayer->YarnUseList->Count;i++){ YarnUse *yu=(YarnUse *)Main->texlayer->YarnUseList->Items[i]; Yarn *yarn=(Yarn *)Main->texlayer->YarnList->Items[yu->yarnIndex]; AnsiString str=IntToStr(yu->use); QRRichText47->Lines->Add(str); } QRRichText48->Lines->Clear(); QRRichText48->Lines->Add("BEAM"); for(int i=0;itexlayer->YarnUseList->Count;i++){ YarnUse *yu=(YarnUse *)Main->texlayer->YarnUseList->Items[i]; Yarn *yarn=(Yarn *)Main->texlayer->YarnList->Items[yu->yarnIndex]; AnsiString str=IntToStr(yu->beam); QRRichText48->Lines->Add(str); } QRRichText49->Lines->Clear(); QRRichText49->Lines->Add("TOTAL"); for(int i=0;itexlayer->YarnUseList->Count;i++){ YarnUse *yu=(YarnUse *)Main->texlayer->YarnUseList->Items[i]; Yarn *yarn=(Yarn *)Main->texlayer->YarnList->Items[yu->yarnIndex]; AnsiString str=IntToStr(yu->total_use); QRRichText49->Lines->Add(str); } QRRichText58->Lines->Clear(); QRRichText58->Lines->Add("COST/Y"); double total_cost=0; for(int i=0;itexlayer->YarnUseList->Count;i++){ YarnUse *yu=(YarnUse *)Main->texlayer->YarnUseList->Items[i]; Yarn *yarn=(Yarn *)Main->texlayer->YarnList->Items[yu->yarnIndex]; total_cost+=yarn->cost*yu->GPY/1000.0; AnsiString str=MyFloatToStr(yarn->cost*yu->GPY/1000.0,2); QRRichText58->Lines->Add(str); } QRRichText58->Lines->Add(MyFloatToStr(total_cost,2)); //////////////////////////////////////////////////////////////////////////////// QRRichText50->Lines->Clear(); QRRichText50->Lines->Add(""); QRRichText50->Lines->Add("RAW"); QRRichText50->Lines->Add("SIMULATED"); QRRichText51->Lines->Clear(); QRRichText51->Lines->Add("WPI"); QRRichText51->Lines->Add(IntToStr(Main->maindata.gauge)); QRRichText51->Lines->Add(MyFloatToStr(SimulationForm->sd.gauge,2)); QRRichText52->Lines->Clear(); QRRichText52->Lines->Add("CPC"); QRRichText52->Lines->Add(MyFloatToStr(Main->maindata.cpc,2)); QRRichText52->Lines->Add(MyFloatToStr(SimulationForm->sd.cpc,2)); QRRichText53->Lines->Clear(); QRRichText53->Lines->Add("Width"); QRRichText53->Lines->Add(MyFloatToStr(Main->maindata.width,2)+" inch"); QRRichText53->Lines->Add(MyFloatToStr(SimulationForm->sd.width,2)+" inch"); QRRichText54->Lines->Clear(); QRRichText54->Lines->Add("Weight"); double gpy=0; for(int i=0;itexlayer->YarnUseList->Count;i++){ YarnUse *yu=(YarnUse *)Main->texlayer->YarnUseList->Items[i]; gpy+=yu->GPY; } memset(buf,0,256); value=gpy; FloatToText(buf, &value, fvExtended, ffNumber, 8, 1); QRRichText54->Lines->Add(AnsiString(buf)+" g/y"); memset(buf,0,256); value=gpy/Main->maindata.cpc*SimulationForm->sd.cpc; FloatToText(buf, &value, fvExtended, ffNumber, 8, 1); QRRichText54->Lines->Add(AnsiString(buf)+" g/y"); //////////////////////////////////////////////////////////////////////////////// QRRichText55->Lines->Clear(); AnsiString str="QUOTA/DAY : "+IntToStr(MetaDataForm->md.rpm)+" X "+ MyFloatToStr(MetaDataForm->md.hours,2)+"h X 60 X " +MyFloatToStr(MetaDataForm->md.efficiency/100.0,2)+" / "+ MyFloatToStr(Main->maindata.cpc,2)+" / 91.44 X "+IntToStr(MetaDataForm->md.count_of_w)+" = "+ MyFloatToStr(MetaDataForm->md.rpm*MetaDataForm->md.hours*60.0*(MetaDataForm->md.efficiency/100.0)/ Main->maindata.cpc/91.44*MetaDataForm->md.count_of_w,2); QRRichText55->Lines->Add(str); //////////////////////////////////////////////////////////////////////////////// QRRichText56->Lines->Clear(); QRRichText56->Lines->Add("MACHINE NAME : "+MetaDataForm->md.machineName); //////////////////////////////////////////////////////////////////////////////// /*QRRichText57->Lines->Clear(); for(int i=0;immDetail->Lines->Count;i++){ QRRichText57->Lines->Add(MetaDataForm->mmDetail->Lines->Strings[i]); }* / //2007.01.10. diekun ÁٳѱèÀ§Ä¡°¡ Á¦´ë·Î ³Ñ¾î°¥ ¼ö ÀÖµµ·Ï Åëä·Î º¹»çÇÏ°Ô º¯°æ MetaDataForm->mmDetail->SelectAll(); QRRichText57->Lines->Add(MetaDataForm->mmDetail->SelText); MetaDataForm->mmDetail->SelLength = 0; //////////////////////////////////////////////////////////////////////////////// QRRichText60->Lines->Clear(); QRRichText61->Lines->Clear(); QRRichText62->Lines->Clear(); QRRichText63->Lines->Clear(); QRRichText64->Lines->Clear(); if (DesignForm->ELmode) {//gabriel if (Main->LayerMode) { //Layer:0, Bar: 1 by david 090430 t_text = "GB"; t_text += IntToStr(barCount); QRRichText60->Lines->Add(t_text);//Bar ó¸® ³»¿ë } else QRRichText60->Lines->Add("L1"); QRRichText60->Lines->Add("mm/RACK"); Print_mmRack_per_Layer(QRRichText60,1); if(barCount > 1) { if (Main->LayerMode) { t_text = "GB"; t_text += IntToStr(barCount - 1); QRRichText60->Lines->Add(t_text);//Bar ó¸® ³»¿ë } else QRRichText61->Lines->Add("L2"); QRRichText61->Lines->Add("mm/RACK"); Print_mmRack_per_Layer(QRRichText61,2); } if(barCount > 2) { if (Main->LayerMode) { t_text = "GB"; t_text += IntToStr(barCount - 2); QRRichText60->Lines->Add(t_text);//Bar ó¸® ³»¿ë } else QRRichText62->Lines->Add("L3"); QRRichText62->Lines->Add("mm/RACK"); Print_mmRack_per_Layer(QRRichText62,3); } if(barCount > 3) { if (Main->LayerMode) { t_text = "GB"; t_text += IntToStr(barCount - 3); QRRichText60->Lines->Add(t_text);//Bar ó¸® ³»¿ë } else QRRichText63->Lines->Add("L4"); QRRichText63->Lines->Add("mm/RACK"); Print_mmRack_per_Layer(QRRichText63,4); } if(barCount > 4) { if (Main->LayerMode) { t_text = "GB"; t_text += IntToStr(barCount - 4); QRRichText60->Lines->Add(t_text);//Bar ó¸® ³»¿ë } else QRRichText64->Lines->Add("L5"); QRRichText64->Lines->Add("mm/RACK"); Print_mmRack_per_Layer(QRRichText64,MAX_LAYER_COUNT); } } } //--------------------------------------------------------------------------- */ bool __fastcall THiddenPrintDataForm::Print_mmRack_per_Layer(TQRRichText *QRRichText_in, int layer) {//gabriel int mmRack_previousCourse=0; int mmRack_currentCourse=0; int StartingIndex=1; int LastIndex=1; AnsiString mmRack; Tex *tex = ((Tex *)Main->texlayer->TexList->Items[layer-1]); for(int i=0;iCurve->Count;i++){ mmRack_currentCourse = ((CourseState2 *)tex->Courses->Items[i])->emit; if(i==0) mmRack_previousCourse = mmRack_currentCourse; //´Ù¸£¸é updateÇϰí Ãâ·ÂÇÏ¸é µÈ´Ù.(³¡ÀÌ¸é ¹Ù·Î Ãâ·Â) if (mmRack_previousCourse != mmRack_currentCourse) { LastIndex = i; mmRack = AnsiString(StartingIndex) + " ~ " + AnsiString(LastIndex) + " : " + AnsiString(mmRack_previousCourse); QRRichText_in->Lines->Add(mmRack); StartingIndex = i+1; } if (i==tex->Curve->Count-1) { LastIndex = i + 1; mmRack = AnsiString(StartingIndex) + " ~ " + AnsiString(LastIndex) + " : " + AnsiString(mmRack_currentCourse); QRRichText_in->Lines->Add(mmRack); } mmRack_previousCourse = mmRack_currentCourse; } } //--------------------------------------------------------------------------- bool __fastcall THiddenPrintDataForm::Print_mmRack_per_Layer(TList *TList_in, int layer) {//gabriel int mmRack_previousCourse=0; int mmRack_currentCourse=0; int StartingIndex=1; int LastIndex=1; AnsiString mmRack; char temp[10], startIdx[10], lastIdx[10]; Tex *tex = ((Tex *)Main->texlayer->TexList->Items[layer-1]); for(int i=0;iCurve->Count;i++){ mmRack_currentCourse = ((CourseState2 *)tex->Courses->Items[i])->emit; if(i==0) mmRack_previousCourse = mmRack_currentCourse; //´Ù¸£¸é updateÇϰí Ãâ·ÂÇÏ¸é µÈ´Ù.(³¡ÀÌ¸é ¹Ù·Î Ãâ·Â) if (mmRack_previousCourse != mmRack_currentCourse) { LastIndex = i; sprintf(startIdx, "%5d", StartingIndex); sprintf(lastIdx, "%5d", LastIndex); sprintf(temp, "%5d", mmRack_previousCourse); mmRack = AnsiString(startIdx) +" ~ " + AnsiString(lastIdx) + " : " + AnsiString(temp); AnsiString *temp_mmRack = new AnsiString(mmRack); TList_in->Add(temp_mmRack); StartingIndex = i+1; } if (i==tex->Curve->Count-1) { LastIndex = i + 1; sprintf(startIdx, "%5d", StartingIndex); sprintf(lastIdx, "%5d", LastIndex); sprintf(temp, "%5d", mmRack_currentCourse); mmRack = AnsiString(startIdx) +" ~ " + AnsiString(lastIdx) + " : " + AnsiString(temp); AnsiString *temp_mmRack = new AnsiString(mmRack); TList_in->Add(temp_mmRack); } mmRack_previousCourse = mmRack_currentCourse; } } //--------------------------------------------------------------------------- void __fastcall THiddenPrintDataForm::SetqrStandardYarnVivien(){ //////////////////////////////////////////////////////////////////////////////// Main->SetAll(); //////////////////////////////////////////////////////////////////////////////// ListOfQRLabel=new TList; TQRLabel *qrl=NULL; char buf[256]; Extended value; //////////////////////////////////////////////////////////////////////////////// AnsiString s1=ExtractFileName(Main->maindata.FileName); s1=s1.SubString(1,s1.Length()-4); s1=s1.UpperCase(); QRLabel113->Caption=s1; QRLabel114->Caption=MetaDataForm->md.machineName; QRMemo9->Lines->Clear(); QRMemo9->Lines->Add(IntToStr(Main->maindata.gauge)); QRMemo9->Lines->Add(IntToStr(Main->maindata.bar)); QRMemo10->Lines->Clear(); QRMemo10->Lines->Add(IntToStr(MetaDataForm->md.count_of_w)); QRLabel116->Caption=MyFloatToStr(Main->maindata.width*2.54,2)+"cm"; QRLabel117->Caption=MyFloatToStr(SimulationForm->sd.width*2.54,2)+"cm"; QRLabel146->Caption=MetaDataForm->md.ResponsiblePart;//by maxleo21c (06.11.08) double gpy=0; for(int i=0;itexlayer->YarnUseList->Count;i++){ YarnUse *yu=(YarnUse *)Main->texlayer->YarnUseList->Items[i]; gpy+=yu->GPY; } memset(buf,0,256); value=gpy/91.44*100.0; FloatToText(buf, &value, fvExtended, ffNumber, 8, 1); QRLabel119->Caption=AnsiString(buf)+"g/m"; memset(buf,0,256); value=gpy/91.44*100.0/Main->maindata.cpc*SimulationForm->sd.cpc; FloatToText(buf, &value, fvExtended, ffNumber, 8, 1); QRLabel118->Caption=AnsiString(buf)+"g/m"; QRLabel120->Caption=MyFloatToStr(Main->maindata.cpc,2); QRLabel121->Caption=MyFloatToStr(Main->maindata.gauge/2.54,2); QRLabel122->Caption=MyFloatToStr(SimulationForm->sd.gauge/2.54,2); QRLabel123->Caption=MyFloatToStr(SimulationForm->sd.cpc,2); memset(buf,0,256); value=(Main->maindata.cpc-SimulationForm->sd.cpc)/SimulationForm->sd.cpc*100; value+=100; FloatToText(buf, &value, fvExtended, ffNumber, 8, 1); QRLabel124->Caption=AnsiString(buf)+"%"; //////////////////////////////////////////////////////////////////////////////// TList *list=new TList; for(int j=0;jtexlayer->YarnList->Count;j++){ YarnUse *yu=NULL; for(int i=0;itexlayer->YarnUseList->Count;i++){ YarnUse *yu2=(YarnUse *)Main->texlayer->YarnUseList->Items[i]; if(yu2->yarnIndex==j){ if(yu==NULL){ yu=new YarnUse; list->Add(yu); } yu->yarnIndex=j; yu->percent+=yu2->percent; } } } int cnt=list->Count; while(list->Count){ double v=0; int index=0; for(int k=0;kCount;k++){ YarnUse *yu2=(YarnUse *)list->Items[k]; if(yu2->percent>=v){ v=yu2->percent; index=k; } } YarnUse *yu=(YarnUse *)list->Items[index]; Yarn *yarn=(Yarn *)Main->texlayer->YarnList->Items[yu->yarnIndex]; for(int l=0;l<10;l++){ if(yarn->code[l]=='\0')break; qrl=new TQRLabel(this); qrl->Parent=qrStandardYarnVivien; qrl->Left=101+27*l; qrl->Top=444+(cnt-list->Count)*31.18; qrl->Caption=yarn->code[l]; ListOfQRLabel->Add(qrl); } if(yarn->name[0]!='\0'){ qrl=new TQRLabel(this); qrl->Parent=qrStandardYarnVivien; qrl->Alignment=taCenter; qrl->Left=444; qrl->Top=444+(cnt-list->Count)*31.18; qrl->Caption=yarn->name; ListOfQRLabel->Add(qrl); } qrl=new TQRLabel(this); qrl->Parent=qrStandardYarnVivien; qrl->Alignment=taCenter; qrl->Left=562; qrl->Top=444+(cnt-list->Count)*31.18; qrl->Caption=MyFloatToStr(yu->percent,2)+"%"; ListOfQRLabel->Add(qrl); delete yu; list->Remove(yu); } delete list; //////////////////////////////////////////////////////////////////////////////// if(Main->maindata.ProductCode!=""){ char *code=Main->maindata.ProductCode.c_str(); for(int l=0;l<10;l++){ if(code[l]=='\0')break; qrl=new TQRLabel(this); qrl->Parent=qrStandardYarnVivien; qrl->Left=52+27*l; qrl->Top=927; qrl->Caption=code[l]; ListOfQRLabel->Add(qrl); } } //////////////////////////////////////////////////////////////////////////////// } //--------------------------------------------------------------------------- void __fastcall THiddenPrintDataForm::SetqrTotalCost(){ //////////////////////////////////////////////////////////////////////////////// Main->SetAll(); //////////////////////////////////////////////////////////////////////////////// ListOfQRLabel=new TList; TQRLabel *qrl=NULL; char buf[256]; Extended value; //////////////////////////////////////////////////////////////////////////////// if(MetaDataForm->md.Time!="") qrlTC_Time->Caption="("+MetaDataForm->md.Time+")"; else qrlTC_Time->Caption=""; //qrlTC_ExchangeRate->Caption = "Àû¿ëȯÀ² U$ : \\ "+FloatToStr(Cost_F->exchange_rate); qrlTC_ExchangeRate->Caption = qrlTC_ExchangeRate->Caption + " " + FloatToStr(Cost_F->exchange_rate); //qrlTC_UsePart->Caption="»ç¿ë ºÎ¼­ : "+MetaDataForm->md.ResponsiblePart; qrlTC_UsePart->Caption = qrlTC_UsePart->Caption + " " + MetaDataForm->md.ResponsiblePart; //qrlTC_Code->Caption="ÀÚÀç ÄÚµå : "+Main->maindata.ProductCode; qrlTC_Code->Caption = qrlTC_Code->Caption + " " +Main->maindata.ProductCode; AnsiString s1=ExtractFileName(Main->maindata.FileName); s1=s1.SubString(1,s1.Length()-4); s1=s1.UpperCase(); //qrlTC_Name->Caption="ÀÚÀç ¸í : " + s1; qrlTC_Name->Caption = qrlTC_Name->Caption + " " + s1; TDateTime dt = Date(); String dtstr; DateTimeToString(dtstr,"yyyy.mm.dd",dt.CurrentDateTime()); qrlTC_Date->Caption = "Date : "+dtstr; QRLabel147->Caption=MetaDataForm->md.ResponsiblePart;//by maxleo21c (06.11.08) double gpy=0; for(int i=0;itexlayer->YarnUseList->Count;i++){ YarnUse *yu=(YarnUse *)Main->texlayer->YarnUseList->Items[i]; gpy+=yu->GPY; } memset(buf,0,256); value=100.0/91.44*gpy/Main->maindata.cpc*SimulationForm->sd.cpc; FloatToText(buf, &value, fvExtended, ffNumber, 8, 2); qrlTC_TreatWeight2->Caption=AnsiString(buf)+" g/m"; memset(buf,0,256); value=(Main->maindata.cpc/SimulationForm->sd.cpc)*100.0; FloatToText(buf, &value, fvExtended, ffNumber, 8, 1); qrlTC_Ratio2->Caption=AnsiString(buf)+" %"; memset(buf,0,256); value=100.0/91.44*gpy; FloatToText(buf, &value, fvExtended, ffNumber, 8, 2); qrlTC_RawWeight2->Caption=AnsiString(buf)+" g/m"; qrlTC_RawWidth2->Caption=MyFloatToStr(Main->maindata.width,2)+"\""; qrlTC_TreatWidth2->Caption=MyFloatToStr(SimulationForm->sd.width,2)+"\""; qrlTC_RawGauge2->Caption=MyFloatToStr(Main->maindata.gauge/2.54,2)+" W/cm"; qrlTC_TreatGauge2->Caption=MyFloatToStr(SimulationForm->sd.gauge/2.54,2)+" W/cm"; qrlTC_RawCourse2->Caption=MyFloatToStr(Main->maindata.cpc,2)+" C/cm"; qrlTC_TreatCourse2->Caption=MyFloatToStr(SimulationForm->sd.cpc,2)+" C/cm"; //////////////////////////////////////////////////////////////////////////////// TList *list=new TList; for(int j=0;jtexlayer->YarnList->Count;j++){ YarnUse *yu=NULL; for(int i=0;itexlayer->YarnUseList->Count;i++){ YarnUse *yu2=(YarnUse *)Main->texlayer->YarnUseList->Items[i]; if(yu2->yarnIndex==j){ if(yu==NULL){ yu=new YarnUse; list->Add(yu); } yu->yarnIndex=j; yu->percent+=yu2->percent; yu->GPY+=yu2->GPY; } } } double yarn_total_cost=0; int cnt=list->Count; while(list->Count){ double v=0; int index=0; for(int k=0;kCount;k++){ YarnUse *yu2=(YarnUse *)list->Items[k]; if(yu2->percent>=v){ v=yu2->percent; index=k; } } YarnUse *yu=(YarnUse *)list->Items[index]; Yarn *yarn=(Yarn *)Main->texlayer->YarnList->Items[yu->yarnIndex]; if(yarn->name[0]!='\0'){ qrl=new TQRLabel(this); qrl->Parent=qrTotalCost; qrl->Alignment=taLeftJustify; qrl->Left=60; qrl->Top=213+(cnt-list->Count)*20; qrl->Caption=yarn->name; ListOfQRLabel->Add(qrl); } qrl=new TQRLabel(this); qrl->Parent=qrTotalCost; qrl->Alignment=taRightJustify; qrl->Left=370; qrl->Top=213+(cnt-list->Count)*20; memset(buf,0,256); value=yu->percent; FloatToText(buf, &value, fvExtended, ffNumber, 8, 2); qrl->Caption=AnsiString(buf); ListOfQRLabel->Add(qrl); qrl=new TQRLabel(this); qrl->Parent=qrTotalCost; qrl->Alignment=taRightJustify; qrl->Left=475; qrl->Top=213+(cnt-list->Count)*20; memset(buf,0,256); value=yu->percent/100.0*(100.0/91.44*gpy/Main->maindata.cpc*SimulationForm->sd.cpc);//°ýÈ£¾ÈÀº °¡°øÁß·® FloatToText(buf, &value, fvExtended, ffNumber, 8, 2); qrl->Caption=AnsiString(buf); ListOfQRLabel->Add(qrl); qrl=new TQRLabel(this); qrl->Parent=qrTotalCost; qrl->Alignment=taRightJustify; qrl->Left=560; qrl->Top=213+(cnt-list->Count)*20; double loss=0; if(yarn->ym==ymPO) loss=Cost_F->PolyLoss; else if(yarn->ym==ymSPANDEX) loss=Cost_F->SpanLoss; else loss=Cost_F->NylonLoss;//ymNY...//ymCOTTON....//ymNONE qrl->Caption=FloatToStr(loss); ListOfQRLabel->Add(qrl); qrl=new TQRLabel(this); qrl->Parent=qrTotalCost; qrl->Alignment=taRightJustify; qrl->Left=665; qrl->Top=213+(cnt-list->Count)*20; double treatloss=0; if(yarn->ym==ymPO) treatloss=Cost_F->PolyTreatLoss; else if(yarn->ym==ymSPANDEX) treatloss=Cost_F->SpanTreatLoss; else treatloss=Cost_F->NylonTreatLoss;//ymNY...//ymCOTTON....//ymNONE qrl->Caption=FloatToStr(treatloss); ListOfQRLabel->Add(qrl); qrl=new TQRLabel(this); qrl->Parent=qrTotalCost; qrl->Alignment=taRightJustify; qrl->Left=810; qrl->Top=213+(cnt-list->Count)*20; memset(buf,0,256); value=yarn->cost; FloatToText(buf, &value, fvExtended, ffNumber, 8, 2); qrl->Caption=AnsiString(buf); ListOfQRLabel->Add(qrl); qrl=new TQRLabel(this); qrl->Parent=qrTotalCost; qrl->Alignment=taRightJustify; qrl->Left=915; qrl->Top=213+(cnt-list->Count)*20; memset(buf,0,256); double yarncost=value=yarn->cost*(100.0/91.44*yu->GPY/Main->maindata.cpc*SimulationForm->sd.cpc)/1000.0*(1.0+loss/100.0)*(1.0+treatloss/100.0); yarn_total_cost+=yarncost; FloatToText(buf, &value, fvExtended, ffNumber, 8, 3); qrl->Caption=AnsiString(buf); ListOfQRLabel->Add(qrl); qrl=new TQRLabel(this); qrl->Parent=qrTotalCost; qrl->Alignment=taRightJustify; qrl->Left=1000; qrl->Top=213+(cnt-list->Count)*20; memset(buf,0,256); value=yarncost/Cost_F->exchange_rate; FloatToText(buf, &value, fvExtended, ffNumber, 8, 4); qrl->Caption=AnsiString(buf); ListOfQRLabel->Add(qrl); delete yu; list->Remove(yu); } delete list; //////////////////////////////////////////////////////////////////////////////// memset(buf,0,256); value=yarn_total_cost; FloatToText(buf, &value, fvExtended, ffNumber, 10, 3); qrlTC_TotalYarnCost2->Caption=AnsiString(buf); memset(buf,0,256); value=yarn_total_cost/Cost_F->exchange_rate; FloatToText(buf, &value, fvExtended, ffNumber, 8, 4); qrlTC_TotalYarnCost2US->Caption=AnsiString(buf); qrlTC_CAPA->Caption="( "+FloatToStr(Cost_F->CAPA)+" CAPA )"; //qrlTC_MachineCount->Caption="Àû¿ë´ë¼ö : "+FloatToStr(Cost_F->MachineCount); qrlTC_MachineCount->Caption = qrlTC_MachineCount->Caption + " " + FloatToStr(Cost_F->MachineCount); memset(buf,0,256); value=Cost_F->CMT_Machine; FloatToText(buf, &value, fvExtended, ffNumber, 10, 0); //qrlTC_CMT_Machine->Caption="ÀÏ´ë´ç CMT : "+AnsiString(buf); qrlTC_CMT_Machine->Caption = qrlTC_CMT_Machine->Caption + " " +AnsiString(buf); qrlTC_data1->Caption="(1) "+AnsiString(Cost_F->data1); qrlTC_data2->Caption="(2) "+AnsiString(Cost_F->data2); qrlTC_data3->Caption="(3) "+AnsiString(Cost_F->data3); qrlTC_data4->Caption="(4) "+AnsiString(Cost_F->data4); qrlTC_data5->Caption="(5) "+AnsiString(Cost_F->data5); qrlTC_data6->Caption="(6) "+AnsiString(Cost_F->data6); qrlTC_data7->Caption="(7) "+AnsiString(Cost_F->data7); memset(buf,0,256); value=Cost_F->val1; FloatToText(buf, &value, fvExtended, ffNumber, 10, 0); qrlTC_value1->Caption=AnsiString(buf); memset(buf,0,256); value=Cost_F->val2; FloatToText(buf, &value, fvExtended, ffNumber, 10, 0); qrlTC_value2->Caption=AnsiString(buf); memset(buf,0,256); value=Cost_F->val3; FloatToText(buf, &value, fvExtended, ffNumber, 10, 0); qrlTC_value3->Caption=AnsiString(buf); memset(buf,0,256); value=Cost_F->val4; FloatToText(buf, &value, fvExtended, ffNumber, 10, 0); qrlTC_value4->Caption=AnsiString(buf); memset(buf,0,256); value=Cost_F->val5; FloatToText(buf, &value, fvExtended, ffNumber, 10, 0); qrlTC_value5->Caption=AnsiString(buf); memset(buf,0,256); value=Cost_F->val6; FloatToText(buf, &value, fvExtended, ffNumber, 10, 0); qrlTC_value6->Caption=AnsiString(buf); memset(buf,0,256); value=Cost_F->val7; FloatToText(buf, &value, fvExtended, ffNumber, 10, 0); qrlTC_value7->Caption=AnsiString(buf); memset(buf,0,256); value=Cost_F->val1/Cost_F->CAPA/Cost_F->work_day_month/Cost_F->MachineCount; FloatToText(buf, &value, fvExtended, ffNumber, 10, 3); qrlTC_value1KR->Caption=AnsiString(buf); memset(buf,0,256); value=Cost_F->val2/Cost_F->CAPA/Cost_F->work_day_month/Cost_F->MachineCount; FloatToText(buf, &value, fvExtended, ffNumber, 10, 3); qrlTC_value2KR->Caption=AnsiString(buf); memset(buf,0,256); value=Cost_F->val3/Cost_F->CAPA/Cost_F->work_day_month/Cost_F->MachineCount; FloatToText(buf, &value, fvExtended, ffNumber, 10, 3); qrlTC_value3KR->Caption=AnsiString(buf); memset(buf,0,256); value=Cost_F->val4/Cost_F->CAPA/Cost_F->work_day_month/Cost_F->MachineCount; FloatToText(buf, &value, fvExtended, ffNumber, 10, 3); qrlTC_value4KR->Caption=AnsiString(buf); memset(buf,0,256); value=Cost_F->val5/Cost_F->CAPA/Cost_F->work_day_month/Cost_F->MachineCount; FloatToText(buf, &value, fvExtended, ffNumber, 10, 3); qrlTC_value5KR->Caption=AnsiString(buf); memset(buf,0,256); value=Cost_F->val6/Cost_F->CAPA/Cost_F->work_day_month/Cost_F->MachineCount; FloatToText(buf, &value, fvExtended, ffNumber, 10, 3); qrlTC_value6KR->Caption=AnsiString(buf); memset(buf,0,256); value=Cost_F->val7/Cost_F->CAPA/Cost_F->work_day_month/Cost_F->MachineCount; FloatToText(buf, &value, fvExtended, ffNumber, 10, 3); qrlTC_value7KR->Caption=AnsiString(buf); memset(buf,0,256); value=Cost_F->val1/Cost_F->CAPA/Cost_F->work_day_month/Cost_F->MachineCount/Cost_F->exchange_rate; FloatToText(buf, &value, fvExtended, ffNumber, 8, 4); qrlTC_value1US->Caption=AnsiString(buf); memset(buf,0,256); value=Cost_F->val2/Cost_F->CAPA/Cost_F->work_day_month/Cost_F->MachineCount/Cost_F->exchange_rate; FloatToText(buf, &value, fvExtended, ffNumber, 8, 4); qrlTC_value2US->Caption=AnsiString(buf); memset(buf,0,256); value=Cost_F->val3/Cost_F->CAPA/Cost_F->work_day_month/Cost_F->MachineCount/Cost_F->exchange_rate; FloatToText(buf, &value, fvExtended, ffNumber, 8, 4); qrlTC_value3US->Caption=AnsiString(buf); memset(buf,0,256); value=Cost_F->val4/Cost_F->CAPA/Cost_F->work_day_month/Cost_F->MachineCount/Cost_F->exchange_rate; FloatToText(buf, &value, fvExtended, ffNumber, 8, 4); qrlTC_value4US->Caption=AnsiString(buf); memset(buf,0,256); value=Cost_F->val5/Cost_F->CAPA/Cost_F->work_day_month/Cost_F->MachineCount/Cost_F->exchange_rate; FloatToText(buf, &value, fvExtended, ffNumber, 8, 4); qrlTC_value5US->Caption=AnsiString(buf); memset(buf,0,256); value=Cost_F->val6/Cost_F->CAPA/Cost_F->work_day_month/Cost_F->MachineCount/Cost_F->exchange_rate; FloatToText(buf, &value, fvExtended, ffNumber, 8, 4); qrlTC_value6US->Caption=AnsiString(buf); memset(buf,0,256); value=Cost_F->val7/Cost_F->CAPA/Cost_F->work_day_month/Cost_F->MachineCount/Cost_F->exchange_rate; FloatToText(buf, &value, fvExtended, ffNumber, 8, 4); qrlTC_value7US->Caption=AnsiString(buf); memset(buf,0,256); double production_cost=value= (Cost_F->val1+Cost_F->val2+Cost_F->val3+Cost_F->val4+Cost_F->val5+Cost_F->val6+Cost_F->val7) /Cost_F->CAPA/Cost_F->work_day_month/Cost_F->MachineCount; FloatToText(buf, &value, fvExtended, ffNumber, 10, 3); qrlTC_ProductionCost2->Caption=AnsiString(buf); memset(buf,0,256); value=production_cost/Cost_F->exchange_rate; FloatToText(buf, &value, fvExtended, ffNumber, 8, 4); qrlTC_ProductionCost2US->Caption=AnsiString(buf); //qrlTC_RawLoss1->Caption="´Ù) ÆíÁ÷ LOSS (°¡+³ª) x "+FloatToStr(Cost_F->RawLoss)+"%"; qrlTC_RawLoss1->Caption = qrlTC_RawLoss1->Caption + " " + FloatToStr(Cost_F->RawLoss)+"%"; memset(buf,0,256); value=(production_cost+yarn_total_cost)*Cost_F->RawLoss/100.0; FloatToText(buf, &value, fvExtended, ffNumber, 10, 3); qrlTC_RawLoss2->Caption=AnsiString(buf); memset(buf,0,256); value=(production_cost+yarn_total_cost)*Cost_F->RawLoss/100.0/Cost_F->exchange_rate; FloatToText(buf, &value, fvExtended, ffNumber, 8, 4); qrlTC_RawLoss2US->Caption=AnsiString(buf); //////////////////////////////////////////////////////////////////////////////// memset(buf,0,256); value=(production_cost+yarn_total_cost)*(1.0+Cost_F->RawLoss/100.0); FloatToText(buf, &value, fvExtended, ffNumber, 10, 3); qrlTC_RawCost2->Caption=AnsiString(buf); memset(buf,0,256); value=(production_cost+yarn_total_cost)*(1.0+Cost_F->RawLoss/100.0)/Cost_F->exchange_rate; FloatToText(buf, &value, fvExtended, ffNumber, 8, 4); qrlTC_RawCost2US->Caption=AnsiString(buf); qrlTC_RawMargin1->Caption="MARGIN "+FloatToStr(Cost_F->RawMargin)+"%"; memset(buf,0,256); value=(production_cost+yarn_total_cost)*(1.0+Cost_F->RawLoss/100.0)*(Cost_F->RawMargin/100.0); FloatToText(buf, &value, fvExtended, ffNumber, 10, 3); qrlTC_RawMargin2->Caption=AnsiString(buf); memset(buf,0,256); value=(production_cost+yarn_total_cost)*(1.0+Cost_F->RawLoss/100.0)*(Cost_F->RawMargin/100.0)/Cost_F->exchange_rate; FloatToText(buf, &value, fvExtended, ffNumber, 8, 4); qrlTC_RawMargin2US->Caption=AnsiString(buf); memset(buf,0,256); double raw_price=value=(production_cost+yarn_total_cost)*(1.0+Cost_F->RawLoss/100.0)*(1.0+Cost_F->RawMargin/100.0); FloatToText(buf, &value, fvExtended, ffNumber, 10, 3); qrlTC_RawPrice2->Caption=AnsiString(buf); memset(buf,0,256); value=raw_price/Cost_F->exchange_rate; FloatToText(buf, &value, fvExtended, ffNumber, 8, 4); qrlTC_RawPrice2US->Caption=AnsiString(buf); //////////////////////////////////////////////////////////////////////////////// memset(buf,0,256); value=Cost_F->TreatCost; FloatToText(buf, &value, fvExtended, ffNumber, 10, 3); qrlTC_TreatFee2->Caption=AnsiString(buf);//°¡°ø·á memset(buf,0,256); value=Cost_F->TreatCost/Cost_F->exchange_rate; FloatToText(buf, &value, fvExtended, ffNumber, 8, 4); qrlTC_TreatFee2US->Caption=AnsiString(buf);//°¡°ø·á //qrlTC_TreatLoss1->Caption="¸¶) °¡°ø LOSS (»ýÁöÆÇ¸Å°¡°Ý+°¡°ø·á) x "+FloatToStr(Cost_F->TreatLoss)+"%"; qrlTC_TreatLoss1->Caption = qrlTC_TreatLoss1->Caption + " " +FloatToStr(Cost_F->TreatLoss) + "%"; memset(buf,0,256); value=(raw_price+Cost_F->TreatCost)*(Cost_F->TreatLoss/100.0); FloatToText(buf, &value, fvExtended, ffNumber, 10, 3); qrlTC_TreatLoss2->Caption=AnsiString(buf); memset(buf,0,256); value=(raw_price+Cost_F->TreatCost)*(Cost_F->TreatLoss/100.0)/Cost_F->exchange_rate; FloatToText(buf, &value, fvExtended, ffNumber, 8, 4); qrlTC_TreatLoss2US->Caption=AnsiString(buf); memset(buf,0,256); value=Cost_F->TreatCost+(raw_price+Cost_F->TreatCost)*(Cost_F->TreatLoss/100.0); FloatToText(buf, &value, fvExtended, ffNumber, 10, 3); qrlTC_TreatCost2->Caption=AnsiString(buf); memset(buf,0,256); value=(Cost_F->TreatCost+(raw_price+Cost_F->TreatCost)*(Cost_F->TreatLoss/100.0))/Cost_F->exchange_rate; FloatToText(buf, &value, fvExtended, ffNumber, 8, 4); qrlTC_TreatCost2US->Caption=AnsiString(buf); //////////////////////////////////////////////////////////////////////////////// memset(buf,0,256); value=(raw_price+Cost_F->TreatCost)*(1.0+Cost_F->TreatLoss/100.0); FloatToText(buf, &value, fvExtended, ffNumber, 10, 3); qrlTC_TotalTreatCost2->Caption=AnsiString(buf); memset(buf,0,256); value=(raw_price+Cost_F->TreatCost)*(1.0+Cost_F->TreatLoss/100.0)/Cost_F->exchange_rate; FloatToText(buf, &value, fvExtended, ffNumber, 8, 4); qrlTC_TotalTreatCost2US->Caption=AnsiString(buf); qrlTC_TreatMargin1->Caption="MARGIN "+FloatToStr(Cost_F->TreatMargin)+"%"; memset(buf,0,256); value=(raw_price+Cost_F->TreatCost)*(1.0+Cost_F->TreatLoss/100.0)*(Cost_F->TreatMargin/100.0); FloatToText(buf, &value, fvExtended, ffNumber, 10, 3); qrlTC_TreatMargin2->Caption=AnsiString(buf); memset(buf,0,256); value=(raw_price+Cost_F->TreatCost)*(1.0+Cost_F->TreatLoss/100.0)*(Cost_F->TreatMargin/100.0)/Cost_F->exchange_rate; FloatToText(buf, &value, fvExtended, ffNumber, 8, 4); qrlTC_TreatMargin2US->Caption=AnsiString(buf); memset(buf,0,256); double treat_price=value=(raw_price+Cost_F->TreatCost)*(1.0+Cost_F->TreatLoss/100.0)*(1.0+Cost_F->TreatMargin/100.0); FloatToText(buf, &value, fvExtended, ffNumber, 10, 3); qrlTC_TreatPrice2->Caption=AnsiString(buf); memset(buf,0,256); value=treat_price/Cost_F->exchange_rate; FloatToText(buf, &value, fvExtended, ffNumber, 8, 4); qrlTC_TreatPrice2US->Caption=AnsiString(buf); //////////////////////////////////////////////////////////////////////////////// if(treat_price<=0) treat_price=1;//division by zero qrlTC_TotalYarnCostRatio->Caption=MyFloatToStr(100.0/treat_price*yarn_total_cost,0)+"%"; qrlTC_data1Ratio->Caption=MyFloatToStr(100.0/treat_price*Cost_F->val1/Cost_F->CAPA/Cost_F->work_day_month/Cost_F->MachineCount,0)+"%"; qrlTC_data2Ratio->Caption=MyFloatToStr(100.0/treat_price*Cost_F->val2/Cost_F->CAPA/Cost_F->work_day_month/Cost_F->MachineCount,0)+"%"; qrlTC_data3Ratio->Caption=MyFloatToStr(100.0/treat_price*Cost_F->val3/Cost_F->CAPA/Cost_F->work_day_month/Cost_F->MachineCount,0)+"%"; qrlTC_data4Ratio->Caption=MyFloatToStr(100.0/treat_price*Cost_F->val4/Cost_F->CAPA/Cost_F->work_day_month/Cost_F->MachineCount,0)+"%"; qrlTC_data5Ratio->Caption=MyFloatToStr(100.0/treat_price*Cost_F->val5/Cost_F->CAPA/Cost_F->work_day_month/Cost_F->MachineCount,0)+"%"; qrlTC_data6Ratio->Caption=MyFloatToStr(100.0/treat_price*Cost_F->val6/Cost_F->CAPA/Cost_F->work_day_month/Cost_F->MachineCount,0)+"%"; qrlTC_data7Ratio->Caption=MyFloatToStr(100.0/treat_price*Cost_F->val7/Cost_F->CAPA/Cost_F->work_day_month/Cost_F->MachineCount,0)+"%"; qrlTC_ProductionCostRatio->Caption=MyFloatToStr(100.0/treat_price*production_cost,0)+"%"; qrlTC_RawLossRatio->Caption=MyFloatToStr(100.0/treat_price*(production_cost+yarn_total_cost)*Cost_F->RawLoss/100.0,0)+"%"; qrlTC_RawCostRatio->Caption=MyFloatToStr(100.0/treat_price*(production_cost+yarn_total_cost)*(1.0+Cost_F->RawLoss/100.0),0)+"%"; qrlTC_RawMarginRatio->Caption=MyFloatToStr(100.0/treat_price*(production_cost+yarn_total_cost)*(1.0+Cost_F->RawLoss/100.0)*(Cost_F->RawMargin/100.0),0)+"%"; qrlTC_RawPriceRatio->Caption=MyFloatToStr(100.0/treat_price*(production_cost+yarn_total_cost)*(1.0+Cost_F->RawLoss/100.0)*(1.0+Cost_F->RawMargin/100.0),0)+"%"; qrlTC_TreatFeeRatio->Caption=MyFloatToStr(100.0/treat_price*Cost_F->TreatCost,0)+"%"; qrlTC_TreatLossRatio->Caption=MyFloatToStr(100.0/treat_price*(raw_price+Cost_F->TreatCost)*(Cost_F->TreatLoss/100.0),0)+"%"; qrlTC_TreatCostRatio->Caption=MyFloatToStr(100.0/treat_price*(Cost_F->TreatCost+(raw_price+Cost_F->TreatCost)*(Cost_F->TreatLoss/100.0)),0)+"%"; qrlTC_TotalTreatCostRatio->Caption=MyFloatToStr(100.0/treat_price*(raw_price+Cost_F->TreatCost)*(1.0+Cost_F->TreatLoss/100.0),0)+"%"; qrlTC_TreatMarginRatio->Caption=MyFloatToStr(100.0/treat_price*(raw_price+Cost_F->TreatCost)*(1.0+Cost_F->TreatLoss/100.0)*(Cost_F->TreatMargin/100.0),0)+"%"; qrlTC_TreatPriceRatio->Caption=MyFloatToStr(100.0/treat_price*(raw_price+Cost_F->TreatCost)*(1.0+Cost_F->TreatLoss/100.0)*(1.0+Cost_F->TreatMargin/100.0),0)+"%"; } //--------------------------------------------------------------------------- void __fastcall THiddenPrintDataForm::PrintCourseData() { if(DesignForm->ELmode) { //PrintCourseData_EL(0); HiddenPrintDataForm->SetAnyQuickRep(0); try { HiddenPrintDataForm->QRCompositeRep->Print(); }catch(...) { } HiddenPrintDataForm->Endqr(); } else { Application->MessageBox("Set EL mode to print.", "Notice", MB_OK); } } //--------------------------------------------------------------------------- void __fastcall THiddenPrintDataForm::PrintCourseData_EL(int kind) { const int startLine = 1; int trim_i=startLine; TPrinter *p=Printer(); TCanvas *canvas = NULL; //Graphics::TBitmap* bitmap = new Graphics::TBitmap; //int WW = GetDeviceCaps(p->Handle, HORZRES); //int HH = GetDeviceCaps(p->Handle, VERTRES); //bitmap->Width = WW; //bitmap->Height = HH; //bitmap->Canvas->Font->Size = 10; TQuickRep* currentRep; TQRImage* currentImg; if (kind == 0) { p->BeginDoc(); canvas = p->Canvas; } else { QuickRepList = new TList(); currentRep = new TQuickRep(this); currentRep->OnNeedData = RepNeedData; QuickRepList->Add(currentRep); ListOfQRImage = new TList(); currentImg = CreateQRImage(AnyQRImage); currentImg->Parent = currentRep; ListOfQRImage->Add(currentImg); canvas = currentImg->Canvas; //canvas = AnyQRImage->Canvas; //bitmap->Width = 2339;//1247; //dot (160dpi / A4) //bitmap->Height = 3300;//1760; //dot //canvas = bitmap->Canvas; //canvas->Font = p->Canvas->Font; } if (canvas == NULL) return; AnsiString ss; AnsiString s_unit("A"),s_blank(""); int h=canvas->TextHeight(s_unit); int w=canvas->TextWidth(s_unit); int barCount = Main->maindata.bar; //get original color COLORREF oldBk = GetBkColor(canvas->Handle); COLORREF oldColor = GetTextColor(canvas->Handle); TQRLabel *lbl_title = new TQRLabel(this); lbl_title->Parent = currentRep; lbl_title->Width = 379; lbl_title->Height = 28; lbl_title->Top = 60; lbl_title->Left = currentRep->Width/2 - lbl_title->Width/2; lbl_title->Alignment=taCenter; lbl_title->Caption = "Course Data"; lbl_title->Font->Size = 20; TQRRichText *lbl_Layer1 = new TQRRichText(this); TQRRichText *lbl_Layer2 = new TQRRichText(this); TQRRichText *lbl_Layer3 = new TQRRichText(this); TQRRichText *lbl_Layer4 = new TQRRichText(this); TQRRichText *lbl_Layer5 = new TQRRichText(this); TQRRichText *lbl_Layer6 = new TQRRichText(this); TQRRichText *lbl_Layer7 = new TQRRichText(this); TQRRichText *lbl_Data1 = new TQRRichText(this); TQRRichText *lbl_Data2 = new TQRRichText(this); TQRRichText *lbl_Data3 = new TQRRichText(this); TQRRichText *lbl_Data4 = new TQRRichText(this); TQRRichText *lbl_Data5 = new TQRRichText(this); TQRRichText *lbl_Data6 = new TQRRichText(this); TQRRichText *lbl_Data7 = new TQRRichText(this); lbl_Layer1->Parent = currentRep; lbl_Layer2->Parent = currentRep; lbl_Layer3->Parent = currentRep; lbl_Layer4->Parent = currentRep; lbl_Layer5->Parent = currentRep; lbl_Layer6->Parent = currentRep; lbl_Layer7->Parent = currentRep; lbl_Data1->Parent = currentRep; lbl_Data2->Parent = currentRep; lbl_Data3->Parent = currentRep; lbl_Data4->Parent = currentRep; lbl_Data5->Parent = currentRep; lbl_Data6->Parent = currentRep; lbl_Data7->Parent = currentRep; lbl_Data1->Width = 500; lbl_Data2->Width = 500; lbl_Data3->Width = 500; lbl_Data4->Width = 500; lbl_Data5->Width = 500; lbl_Data6->Width = 500; lbl_Data7->Width = 500; lbl_Layer1->Lines->Add("Layer 1"); lbl_Layer2->Lines->Add("Layer 2"); lbl_Layer3->Lines->Add("Layer 3"); lbl_Layer4->Lines->Add("Layer 4"); lbl_Layer5->Lines->Add("Layer 5"); lbl_Layer6->Lines->Add("Layer 6"); lbl_Layer7->Lines->Add("Layer 7"); lbl_Data1->Lines->Add(EditorForm->ELMemo1->Text); lbl_Data2->Lines->Add(EditorForm->ELMemo2->Text); lbl_Data3->Lines->Add(EditorForm->ELMemo3->Text); lbl_Data4->Lines->Add(EditorForm->ELMemo4->Text); lbl_Data5->Lines->Add(EditorForm->ELMemo5->Text); lbl_Data6->Lines->Add(EditorForm->ELMemo6->Text); lbl_Data7->Lines->Add(EditorForm->ELMemo7->Text); lbl_Data1->Height = lbl_Data1->Lines->Count * 20; lbl_Data2->Height = lbl_Data2->Lines->Count * 20; lbl_Data3->Height = lbl_Data3->Lines->Count * 20; lbl_Data4->Height = lbl_Data4->Lines->Count * 20; lbl_Data5->Height = lbl_Data5->Lines->Count * 20; lbl_Data6->Height = lbl_Data6->Lines->Count * 20; lbl_Data7->Height = lbl_Data7->Lines->Count * 20; lbl_Layer1->Left = 100; lbl_Layer2->Left = lbl_Layer1->Left; lbl_Layer3->Left = lbl_Layer1->Left; lbl_Layer4->Left = lbl_Layer1->Left; lbl_Layer5->Left = lbl_Layer1->Left; lbl_Layer6->Left = lbl_Layer1->Left; lbl_Layer7->Left = lbl_Layer1->Left; lbl_Data1->Left = lbl_Layer1->Width + 100; lbl_Data2->Left = lbl_Data1->Left; lbl_Data3->Left = lbl_Data1->Left; lbl_Data4->Left = lbl_Data1->Left; lbl_Data5->Left = lbl_Data1->Left; lbl_Data6->Left = lbl_Data1->Left; lbl_Data7->Left = lbl_Data1->Left; lbl_Layer1->Top = 150; lbl_Layer2->Top = lbl_Layer1->Top + lbl_Data1->Height + 10; lbl_Layer3->Top = lbl_Layer2->Top + lbl_Data2->Height + 10; lbl_Layer4->Top = lbl_Layer3->Top + lbl_Data3->Height + 10; lbl_Layer5->Top = lbl_Layer4->Top + lbl_Data4->Height + 10; lbl_Layer6->Top = lbl_Layer5->Top + lbl_Data5->Height + 10; lbl_Layer7->Top = lbl_Layer6->Top + lbl_Data6->Height + 10; lbl_Data1->Top = lbl_Layer1->Top; lbl_Data2->Top = lbl_Layer2->Top; lbl_Data3->Top = lbl_Layer3->Top; lbl_Data4->Top = lbl_Layer4->Top; lbl_Data5->Top = lbl_Layer5->Top; lbl_Data6->Top = lbl_Layer6->Top; lbl_Data7->Top = lbl_Layer7->Top; if (kind == 0) p->EndDoc(); //else // AnyQRImage->Picture->Assign(bitmap); //AnyQRImage->Picture->Assign(bitmap); //if (bitmap) delete bitmap; } //--------------------------------------------------------------------------- void __fastcall THiddenPrintDataForm::PrintCourseData_ELOutline(TCanvas *canvas, int w, int h, int trim_i, AnsiString ss) { AnsiString temps=ss; static bool open = false;//open = true --> we passed "(" static bool pair = false; static bool number=false; static bool number_space=false; //int print_pos=1; int posX = 10; SIZE size; LPCTSTR lpString; //GetTextExtentPoint32(canvas->Handle, lpString, 1, &size); //w=size.cx; //get original color static COLORREF oldBk = GetBkColor(canvas->Handle); static COLORREF oldColor = GetTextColor(canvas->Handle); while(ss.Length()>0) { AnsiString c; if(IsDBCSLeadByte(ss.c_str()[0]) == true) { c = ss.SubString(1,2); lpString = c.c_str(); GetTextExtentPoint32(canvas->Handle, lpString, 2, &size); w = size.cx; }else { c = ss.SubString(1,1); lpString = c.c_str(); GetTextExtentPoint32(canvas->Handle, lpString, 1, &size); w = size.cx; } if (!open) { if(c=="(") { open = true; number = false; } //set original color if(PrintForm->rbCoursePrint2->Checked) { SetBkColor(canvas->Handle,oldBk); SetTextColor(canvas->Handle,oldColor); } //canvas->TextOut(print_pos*w,h*trim_i,c); canvas->TextOut(posX,h*trim_i,c); } else{ if((c>="0" && c<="9") ||c==",") { if(number_space) { number_space=false; //red color , gray background : / if(PrintForm->rbCoursePrint2->Checked) { SetBkColor(canvas->Handle,RGB(0xC0,0xC0,0xC0)); SetTextColor(canvas->Handle,RGB(0xff,0x0,0x0)); } if (pair) {// pair = false; //canvas->TextOut((print_pos-1)*w,h*trim_i,"/ "); canvas->TextOut(posX - w,h*trim_i,"/ "); } } number=true; //black color , gray background : numbers , if(PrintForm->rbCoursePrint2->Checked) { SetBkColor(canvas->Handle,RGB(0xC0,0xC0,0xC0)); SetTextColor(canvas->Handle,oldColor); } //canvas->TextOut(print_pos*w,h*trim_i,c); canvas->TextOut(posX,h*trim_i,c); } else if (c==" ") { if(number) { pair = !pair; number_space = true; } number = false; //set original color if(PrintForm->rbCoursePrint2->Checked) { SetBkColor(canvas->Handle,oldBk); SetTextColor(canvas->Handle,oldColor); } //canvas->TextOut(print_pos*w,h*trim_i,c); canvas->TextOut(posX,h*trim_i,c); } else { if(c==")") { open=false; pair=false; number=false; number_space=false; } //set original color if(PrintForm->rbCoursePrint2->Checked) { SetBkColor(canvas->Handle,oldBk); SetTextColor(canvas->Handle,oldColor); } //canvas->TextOut(print_pos*w,h*trim_i,c); canvas->TextOut(posX,h*trim_i,c); } } if(IsDBCSLeadByte(ss.c_str()[0]) == true) ss=ss.SubString(3,ss.Length()-1); else ss=ss.SubString(2,ss.Length()-1); //print_pos++; posX += w; } //set original color if(PrintForm->rbCoursePrint2->Checked) { SetBkColor(canvas->Handle,oldBk); SetTextColor(canvas->Handle,oldColor); } } //--------------------------------------------------------------------------- void __fastcall THiddenPrintDataForm::PrintmmRackData(int kind) { TList* mmRackList[MAX_LAYER_COUNT]; for(int i=0;imaindata.bar>i) { Print_mmRack_per_Layer( mmRackList[i],i+1);//Add mmRack into List } } int i,x_offset; const int MAX_OFFSET = 4; const int startLine = 1; int trim_i=startLine; TPrinter *p=Printer(); TCanvas *canvas = NULL; TQuickRep* currentRep; TQRImage* currentImg; if (kind == 0) { p->BeginDoc(); canvas = p->Canvas; } else { QuickRepList = new TList(); currentRep = new TQuickRep(this); currentRep->OnNeedData = RepNeedData; QuickRepList->Add(currentRep); ListOfQRImage = new TList(); currentImg = CreateQRImage(AnyQRImage); currentImg->Parent = currentRep; ListOfQRImage->Add(currentImg); canvas = currentImg->Canvas; //canvas = AnyQRImage->Canvas; } AnsiString ss; AnsiString s_unit("A"),s_blank(""); int h=canvas->TextHeight(s_unit); int w=canvas->TextWidth(s_unit); i=0; x_offset=0; int barCount = Main->maindata.bar; while(barCount > i) { if (Main->LayerMode) { //Layer:0, Bar: 1 by david 090430 canvas->TextOut(20*w*x_offset+1*w,h*trim_i,AnsiString("< GB "+AnsiString(barCount - i))+" >"); } else { canvas->TextOut(20*w*x_offset+1*w,h*trim_i,AnsiString("< Layer "+AnsiString(i+1))+" >"); } trim_i++; for(int j=0;jCount;j++) { if( trim_i >82) { if (x_offset >=MAX_OFFSET) {//NEW PAGE if(kind == 0) { p->NewPage(); }else { currentRep = new TQuickRep(this); currentRep->OnNeedData = RepNeedData; QuickRepList->Add(currentRep); currentImg = CreateQRImage(AnyQRImage); currentImg->Parent = currentRep; ListOfQRImage->Add(currentImg); canvas = currentImg->Canvas; } x_offset = 0; } else { x_offset++; canvas->Pen->Style = psDashDot; canvas->MoveTo(20 * w * x_offset - 15, h); canvas->LineTo(20 * w * x_offset - 15, h * trim_i); } trim_i=startLine; } ss = *((AnsiString *) (mmRackList[i]->Items[j])); canvas->TextOut(20*w*x_offset+1*w,h*trim_i,ss); trim_i++; } canvas->TextOut(120*w*x_offset+1*w,h*trim_i,s_blank); trim_i++; i++; } if (kind == 0) p->EndDoc(); for(int i=0;iCount; j++) { str = (AnsiString *)mmRackList[i]->Items[j]; delete str; } mmRackList[i]->Clear(); delete mmRackList[i]; } } //--------------------------------------------------------------------------- void __fastcall THiddenPrintDataForm::SetAnyQuickRep(int kind) { Main->SetAll(); //AnyQRImage->Canvas->Font->Charset = DEFAULT_CHARSET; //AnyQRImage->Canvas->Font->Name = "±¼¸²"; //AnyQRImage->Canvas->Font->Size = 8; AnyQRImage->Canvas->Brush->Color = clWhite; AnyQRImage->Canvas->FillRect(TRect(0,0,AnyQRImage->Width, AnyQRImage->Height)); if (kind == 0) { PrintCourseData_EL(1); } else if (kind == 1) { PrintmmRackData(1); } } //--------------------------------------------------------------------------- void __fastcall THiddenPrintDataForm::SetTestRep() { SetqrSimple(); } void __fastcall THiddenPrintDataForm::EndTestRep() { if(QuickRepList) { for (int i = 0; i < QuickRepList->Count; i++) { TQuickRep *aRep = (TQuickRep *)QuickRepList->Items[i]; delete aRep; } QuickRepList->Clear(); delete QuickRepList; } } void __fastcall THiddenPrintDataForm::QRCompositeRepAddReports( TObject *Sender) { for(int i = 0; i < QuickRepList->Count; i++) { TQuickRep *aRep = (TQuickRep*)QuickRepList->Items[i]; QRCompositeRep->Reports->Add(aRep); } } //--------------------------------------------------------------------------- void __fastcall THiddenPrintDataForm::RepNeedData(TObject *Sender, bool &MoreData) { static bool bStartPage = true; TQuickRep *sender = dynamic_cast(Sender); if(bStartPage) { if(sender == QuickRepList->Items[0]) sender->NewPage(); }else { if(sender != QuickRepList->Items[QuickRepList->Count - 1]) sender->NewPage(); } bStartPage = !bStartPage; } //--------------------------------------------------------------------------- void __fastcall THiddenPrintDataForm::CaptionInitialize() { int width; //--------------Landscape Part--------------------------- width = QRLabel3->Width; QRLabel3->Caption = IDS_PRINT_QR3; //WidthArrangement(width,QRLabel3); //width = QRLabel4->Width; //QRLabel4->Caption = IDS_PRINT_QR4; //WidthArrangement(width,QRLabel4); width = QRLabel5->Width; QRLabel5->Caption = IDS_PRINT_QR5;; //WidthArrangement(width,QRLabel5); width = QRLabel9->Width; QRLabel9->Caption = IDS_PRINT_QR9; WidthArrangement(width,QRLabel9); width = QRLabel10->Width; QRLabel10->Caption = IDS_PRINT_QR10; WidthArrangement(width,QRLabel10); width = QRLabel14->Width; QRLabel14->Caption = IDS_PRINT_QR14; WidthArrangement(width,QRLabel14); width = QRLabel_divi->Width; QRLabel_divi->Caption = IDS_PRINT_QR_divi; WidthArrangement(width,QRLabel_divi); width = QRLabel12->Width; QRLabel12->Caption = IDS_PRINT_QR12; WidthArrangement(width,QRLabel12); width = QRLabel15->Width; QRLabel15->Caption = IDS_PRINT_QR15; WidthArrangement(width,QRLabel15); width = QRLabel19->Width; QRLabel19->Caption = IDS_PRINT_QR19; WidthArrangement(width,QRLabel19); width = QRLabel16->Width; QRLabel16->Caption = IDS_PRINT_QR16; WidthArrangement(width,QRLabel16); width = QRLabel11->Width; QRLabel11->Caption = IDS_PRINT_QR11; WidthArrangement(width,QRLabel11); width = QRLabel13->Width; QRLabel13->Caption = IDS_PRINT_QR13; WidthArrangement(width,QRLabel13); width = QRLabel6->Width; QRLabel6->Caption = IDS_PRINT_QR6; //WidthArrangement(width,QRLabel6); width = QRLabel20->Width; QRLabel20->Caption = IDS_PRINT_QR20; WidthArrangement(width,QRLabel20); width = QRLabel22->Width; QRLabel22->Caption = IDS_PRINT_QR22; WidthArrangement(width,QRLabel22); width = QRLabel21->Width; QRLabel21->Caption = IDS_PRINT_QR21; WidthArrangement(width,QRLabel21); width = QRLabel23->Width; QRLabel23->Caption = IDS_PRINT_QR23; WidthArrangement(width,QRLabel23); width = QRLabel24->Width; QRLabel24->Caption = IDS_PRINT_QR24; WidthArrangement(width,QRLabel24); width = QRLabel25->Width; QRLabel25->Caption = IDS_PRINT_QR25; WidthArrangement(width,QRLabel25); width = QRLabel26->Width; QRLabel26->Caption = IDS_PRINT_QR26; WidthArrangement(width,QRLabel26); width = QRLabel27->Width; QRLabel27->Caption = IDS_PRINT_QR27; WidthArrangement(width,QRLabel27); width = QRLabel28->Width; QRLabel28->Caption = IDS_PRINT_QR28; WidthArrangement(width,QRLabel28); width = QRLabel33->Width; QRLabel33->Caption = IDS_PRINT_QR33; WidthArrangement(width,QRLabel33); width = QRLabel34->Width; QRLabel34->Caption = IDS_PRINT_QR34; WidthArrangement(width,QRLabel34); width = QRLabel35->Width; QRLabel35->Caption = IDS_PRINT_QR35; WidthArrangement(width,QRLabel35); width = QRLabel37->Width; QRLabel37->Caption = IDS_PRINT_QR37; WidthArrangement(width,QRLabel37); width = QRLabel36->Width; QRLabel36->Caption = IDS_PRINT_QR36; WidthArrangement(width,QRLabel36); width = QRLabel38->Width; QRLabel38->Caption = IDS_PRINT_QR38; WidthArrangement(width,QRLabel38); width = QRLabel17->Width; QRLabel17->Caption = IDS_PRINT_QR17; WidthArrangement(width,QRLabel17); width = QRLabel7->Width; QRLabel7->Caption = IDS_PRINT_QR7; //WidthArrangement(width,QRLabel7); width = QRLabel39->Width; QRLabel39->Caption = IDS_PRINT_QR39; WidthArrangement(width,QRLabel39); width = QRLabel44->Width; QRLabel44->Caption = IDS_PRINT_QR44; WidthArrangement(width,QRLabel44); width = QRLabel45->Width; QRLabel45->Caption = IDS_PRINT_QR45; WidthArrangement(width,QRLabel45); width = QRLabel46->Width; QRLabel46->Caption = IDS_PRINT_QR46; WidthArrangement(width,QRLabel46); width = QRLabel47->Width; QRLabel47->Caption = IDS_PRINT_QR47; WidthArrangement(width,QRLabel47); width = QRLabel48->Width; QRLabel48->Caption = IDS_PRINT_QR48; WidthArrangement(width,QRLabel48); width = QRLabel49->Width; QRLabel49->Caption = IDS_PRINT_QR49; WidthArrangement(width,QRLabel49); width = QRLabel50->Width; QRLabel50->Caption = IDS_PRINT_QR50; WidthArrangement(width,QRLabel50); width = QRLabel8->Width; QRLabel8->Caption = IDS_PRINT_QR8; //WidthArrangement(width,QRLabel8); width = QRLabel52->Width; QRLabel52->Caption = IDS_PRINT_QR52; WidthArrangement(width,QRLabel52); width = QRLabel53->Width; QRLabel53->Caption = IDS_PRINT_QR53; WidthArrangement(width,QRLabel53); width = QRLabel54->Width; QRLabel54->Caption = IDS_PRINT_QR54; WidthArrangement(width,QRLabel54); width = QRLabel55->Width; QRLabel55->Caption = IDS_PRINT_QR55; WidthArrangement(width,QRLabel55); width = QRLabel56->Width; QRLabel56->Caption = IDS_PRINT_QR56; WidthArrangement(width,QRLabel56); width = QRLabel57->Width; QRLabel57->Caption = IDS_PRINT_QR57; WidthArrangement(width,QRLabel57); width = QRLabel142->Width; QRLabel142->Caption = IDS_PRINT_QR142; WidthArrangement(width,QRLabel142); width = qrl_0_1->Width; qrl_0_1->Caption = IDS_PRINT_QR_0_1; WidthArrangement(width,qrl_0_1); //--------------Total Cost Part--------------------------- qrlTC_Title->Caption = IDS_PRINT_TITLE; qrlTC_ExchangeRate->Caption = IDS_PRINT_EXCHANGERATE; qrlTC_UsePart->Caption = IDS_PRINT_USEPART; qrlTC_Date->Caption = IDS_PRINT_DATE; qrlTC_Code->Caption = IDS_PRINT_CODE; qrlTC_Name->Caption = IDS_PRINT_NAME; qrlTC_TreatWeight1->Caption = IDS_PRINT_TREATWEIGHT; qrlTC_Ratio1->Caption = IDS_PRINT_RAWRATIO; qrlTC_RawWeight1->Caption = IDS_PRINT_RAWWEIGHT; qrlTC_RawWidth1->Caption = IDS_PRINT_RAWWIDTH; qrlTC_TreatWidth1->Caption = IDS_PRINT_TREATWIDTH; qrlTC_RawGauge1->Caption = IDS_PRINT_RAWGAUGE; qrlTC_TreatGauge1->Caption = IDS_PRINT_TREATGAUGE; qrlTC_RawCourse1->Caption = IDS_PRINT_RAWCOURSE; qrlTreatCourse1->Caption = IDS_PRINT_TREATCOURSE; qrlTC_YarnName->Caption = IDS_PRINT_YARNNAME; qrlTC_Composition->Caption = IDS_PRINT_COMPOSITION; qrlTC_NetWeight->Caption = IDS_PRINT_NETWEIGHT; qrlTC_Loss->Caption = IDS_PRINT_LOSS; qrlTC_TreatLoss->Caption = IDS_PRINT_TREATLOSS; qrlTC_YarnCostPerKG->Caption = IDS_PRINT_YARNCOSTPERKG; qrlTC_YarnCost->Caption = IDS_PRINT_YARNCOST; qrlTC_YarnCostUS->Caption = IDS_PRINT_YARNCOSTUS; qrlTC_TotalYarnCost1->Caption = IDS_PRINT_TOTALYARNCOST; qrlTC_ProductionCost1->Caption = IDS_PRINT_PRODUCTIONCOST; qrlTC_MachineCount->Caption = IDS_PRINT_MACHINECOUNT; qrlTC_CMT_Machine->Caption = IDS_PRINT_CMTMACHINE; qrlTC_data1->Caption = IDS_PRINT_DATA1; qrlTC_data2->Caption = IDS_PRINT_DATA2; qrlTC_data3->Caption = IDS_PRINT_DATA3; qrlTC_data4->Caption = IDS_PRINT_DATA4; qrlTC_data5->Caption = IDS_PRINT_DATA5; qrlTC_data6->Caption = IDS_PRINT_DATA6; qrlTC_data7->Caption = IDS_PRINT_DATA7; qrlTC_RawLoss1->Caption = IDS_PRINT_RAWLOSS; qrlTC_RawCost1->Caption = IDS_PRINT_RAWCOST; qrlTC_RawMargin1->Caption = IDS_PRINT_RAWMARGIN; qrlTC_RawPrice1->Caption = IDS_PRINT_RAWPRICE; qrlTC_TreatFee1->Caption = IDS_PRINT_TREATFEE; qrlTC_TreatLoss1->Caption = IDS_PRINT_TREATLOSS1; qrlTC_TreatCost1->Caption = IDS_PRINT_TREATCOST; qrlTC_TotalTreatCost1->Caption = IDS_PRINT_TOTALTREATCOST; qrlTC_TreatMargin1->Caption = IDS_PRINT_TREATMARGIN; qrlTC_TreatPrice1->Caption = IDS_PRINT_TREATPRICE; qrlTC_Ratio_Title->Caption = IDS_PRINT_RATIO; qrlTC_TotalYarnCostRatio->Caption = IDS_PRINT_RATIO; qrlTC_ProductionCostRatio->Caption = IDS_PRINT_RATIO; qrlTC_data1Ratio->Caption = IDS_PRINT_RATIO; qrlTC_data2Ratio->Caption = IDS_PRINT_RATIO; qrlTC_data3Ratio->Caption = IDS_PRINT_RATIO; qrlTC_data4Ratio->Caption = IDS_PRINT_RATIO; qrlTC_data5Ratio->Caption = IDS_PRINT_RATIO; qrlTC_data6Ratio->Caption = IDS_PRINT_RATIO; qrlTC_data7Ratio->Caption = IDS_PRINT_RATIO; qrlTC_RawLossRatio->Caption = IDS_PRINT_RATIO; qrlTC_RawCostRatio->Caption = IDS_PRINT_RATIO; qrlTC_RawMarginRatio->Caption = IDS_PRINT_RATIO; qrlTC_RawPriceRatio->Caption = IDS_PRINT_RATIO; qrlTC_TreatFeeRatio->Caption = IDS_PRINT_RATIO; qrlTC_TreatLossRatio->Caption = IDS_PRINT_RATIO; qrlTC_TreatCostRatio->Caption = IDS_PRINT_RATIO; qrlTC_TotalTreatCostRatio->Caption = IDS_PRINT_RATIO; qrlTC_TreatMarginRatio->Caption = IDS_PRINT_RATIO; qrlTC_TreatPriceRatio->Caption = IDS_PRINT_RATIO; //Simple Text Form } //--------------------------------------------------------------------------- void __fastcall THiddenPrintDataForm::WidthArrangement(int pastwidth,TQRLabel *label) { int amount = (label->Width - pastwidth) / 2.5; label->Left = label->Left - amount; } //--------------------------------------------------------------------------- void __fastcall THiddenPrintDataForm::SetChineseFont(TFont *Font) { Font->Charset = GB2312_CHARSET; Font->Name = "SimSun"; } //---------------------------------------------------------------------------