Changeset 37 for trunk/XSUCLWF/Cxfel.cpp
- Timestamp:
- May 16, 2014, 6:30:01 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/XSUCLWF/Cxfel.cpp
r25 r37 17 17 18 18 using namespace System::Threading; 19 20 //using MySql.Data; 21 //using MySql::Data::MySqlClient; 22 #using <System.Data.dll> 23 #using <MySql.Data.dll> 24 using namespace System::Data; 25 using namespace MySql::Data::MySqlClient; 19 26 20 27 #undef MessageBox … … 177 184 } 178 185 186 void CGroupBox::SetValNumP(String* value) 187 { 188 valNumP->Text=value; 189 } 190 191 void CGroupBox::SetValNumC1(String* value) 192 { 193 valNumC1->Text=value; 194 } 195 196 void CGroupBox::SetValNumC2(String* value) 197 { 198 valNumC2->Text=value; 199 } 200 201 String* CGroupBox::GetValNumP() 202 { 203 return valNumP->Text; 204 } 205 206 String* CGroupBox::GetValNumC1() 207 { 208 return valNumC1->Text; 209 } 210 211 String* CGroupBox::GetValNumC2() 212 { 213 return valNumC2->Text; 214 } 215 179 216 void CGroupBox::AppliquerBtn_Clicked(Object* pSender, EventArgs* pArgs)//gestionnaire d'evenements associés au bouton Appliquer 180 217 { 181 218 String* str; 182 //lecture fichier ou BDDpour comparaison avec saisie219 //lecture fichier pour comparaison avec saisie 183 220 try 184 221 { 185 FileStream* fs = new FileStream("..\\test1_4xsuc.txt",FileMode::Open); 222 // FileStream* fs = new FileStream("..\\test1_4xsuc.txt",FileMode::Open); 223 FileStream* fs = new FileStream("..\\couplers.txt",FileMode::Open); 186 224 StreamReader* sr = new StreamReader(fs); 187 225 int count=0; … … 193 231 { 194 232 String* line = sr->ReadLine(); 195 if (count==0) 233 // if (count==0) 234 if (count==1)//commentaire en 1ere ligne du fichier généré par xfile 196 235 if(String::Compare(line,valNumP->Text)) 197 236 { … … 200 239 break; 201 240 } 202 if (count==1) 241 // if (count==1) 242 if (count==2)//commentaire en 1ere ligne du fichier généré par xfile 203 243 if(String::Compare(line,valNumC1->Text)) 204 244 { … … 207 247 break; 208 248 } 209 if (count==2) 249 // if (count==2) 250 if (count==3)//commentaire en 1ere ligne du fichier généré par xfile 210 251 if(String::Compare(line,valNumC2->Text)) 211 252 { … … 244 285 { 245 286 String* line = sr->ReadLine(); 246 if (count==3) 287 // if (count==3) 288 if (count==4)//commentaire en 1ere ligne du fichier généré par xfile 247 289 if(String::Compare(line,valNumP->Text)) 248 290 { … … 251 293 break; 252 294 } 253 if (count==4) 295 // if (count==4) 296 if (count==5)//commentaire en 1ere ligne du fichier généré par xfile 254 297 if(String::Compare(line,valNumC1->Text)) 255 298 { … … 258 301 break; 259 302 } 260 if (count==5) 303 // if (count==5) 304 if (count==6)//commentaire en 1ere ligne du fichier généré par xfile 261 305 if(String::Compare(line,valNumC2->Text)) 262 306 { … … 295 339 { 296 340 String* line = sr->ReadLine(); 297 if (count==6) 341 // if (count==6) 342 if (count==7)//commentaire en 1ere ligne du fichier généré par xfile 298 343 if(String::Compare(line,valNumP->Text)) 299 344 { … … 302 347 break; 303 348 } 304 if (count==7) 349 // if (count==7) 350 if (count==8)//commentaire en 1ere ligne du fichier généré par xfile 305 351 if(String::Compare(line,valNumC1->Text)) 306 352 { … … 309 355 break; 310 356 } 311 if (count==8) 357 // if (count==8) 358 if (count==9)//commentaire en 1ere ligne du fichier généré par xfile 312 359 if(String::Compare(line,valNumC2->Text)) 313 360 { … … 346 393 { 347 394 String* line = sr->ReadLine(); 348 if (count==9) 395 // if (count==9) 396 if (count==10)//commentaire en 1ere ligne du fichier généré par xfile 349 397 if(String::Compare(line,valNumP->Text)) 350 398 { … … 353 401 break; 354 402 } 355 if (count==10) 403 // if (count==10) 404 if (count==11)//commentaire en 1ere ligne du fichier généré par xfile 356 405 if(String::Compare(line,valNumC1->Text)) 357 406 { … … 360 409 break; 361 410 } 362 if (count==11) 411 // if (count==11) 412 if (count==12)//commentaire en 1ere ligne du fichier généré par xfile 363 413 if(String::Compare(line,valNumC2->Text)) 364 414 { … … 448 498 btnAppliquer = new Button(); 449 499 labTp_max->Location = Point(200,600); 450 labTp_max->Size = System::Drawing::Size(8 0,16);451 labTp_max->Text = "Tp_max( h):";500 labTp_max->Size = System::Drawing::Size(86,16); 501 labTp_max->Text = "Tp_max(min):"; 452 502 labTp_max->TextAlign = ContentAlignment::MiddleRight; 453 503 labTp_max->Font = new System::Drawing::Font(S"Arial", 9, FontStyle::Bold);; … … 486 536 Controls->Add(btnAppliquer); 487 537 538 // Creation du GroupBox 539 gboxAuto = new GroupBox(); 540 gboxAuto->Text = S"saisie auto"; 541 gboxAuto->Size = System::Drawing::Size(200, 200);//taille du groupbox en pixels 542 gboxAuto->Location = Point(600, 400); 543 // Creation des boutons radio. 544 rbAutoBdd = new RadioButton(); 545 rbAutoBdd->Text = S"Base de données"; 546 rbAutoBdd->Size = System::Drawing::Size(80,50); 547 rbAutoBdd->Font = new System::Drawing::Font(S"Arial", 9, FontStyle::Bold);; 548 rbAutoBdd->Location = Point(10,35); 549 rbAutoBdd->Checked = true;//c'est la valeur par defaut 550 rbAutoFichier = new RadioButton(); 551 rbAutoFichier->Text = S"Fichier"; 552 rbAutoFichier->Size = System::Drawing::Size(80,50); 553 rbAutoFichier->Font = new System::Drawing::Font(S"Arial", 9, FontStyle::Bold);; 554 rbAutoFichier->Location = Point(10,75); 555 // creation du bouton Appliquer 556 BtnAppliquerAuto = new Button(); 557 BtnAppliquerAuto->Location = Point(60, 140); 558 BtnAppliquerAuto->Name = "Bouton Appliquer"; 559 BtnAppliquerAuto->Text = "Appliquer"; 560 // ajout des controles dans le groupe 561 gboxAuto->Controls->Add(rbAutoBdd); 562 gboxAuto->Controls->Add(rbAutoFichier); 563 gboxAuto->Controls->Add(BtnAppliquerAuto); 564 // ajout du groupe dans le formulaire. 565 Controls->Add(gboxAuto); 566 // associe le gestionnaire au groupe d'options 567 rbAutoBdd->Click += new EventHandler(this, &CDialogConfig::Radio_Clicked); 568 rbAutoFichier->Click += new EventHandler(this, &CDialogConfig::Radio_Clicked); 569 BtnAppliquerAuto->Click += new EventHandler(this, &CDialogConfig::BtnAppliquerAuto_Clicked); 570 571 //N_cur 572 labN_cur4Reprise = new Label(); 573 valN_cur4Reprise = new TextBox(); 574 labN_cur4Reprise->Location = Point(200,500); 575 labN_cur4Reprise->Size = System::Drawing::Size(86,16); 576 labN_cur4Reprise->Text = "N_cur:"; 577 labN_cur4Reprise->TextAlign = ContentAlignment::MiddleRight; 578 labN_cur4Reprise->Font = new System::Drawing::Font(S"Arial", 9, FontStyle::Bold);; 579 Controls->Add(labN_cur4Reprise); 580 valN_cur4Reprise->Location = Point(290,500); 581 valN_cur4Reprise->Size = System::Drawing::Size(50,20); 582 valN_cur4Reprise->Text = ""; 583 valN_cur4Reprise->Font = new System::Drawing::Font(S"Arial", 9, FontStyle::Bold);; 584 valN_cur4Reprise->ForeColor = Color::Blue; 585 Controls->Add(valN_cur4Reprise); 586 btnN_curAppliquer = new Button(); 587 btnN_curAppliquer->Location = Point(350, 500); 588 btnN_curAppliquer->Name = "Bouton Appliquer"; 589 btnN_curAppliquer->Text = "Appliquer"; 590 btnN_curAppliquer->Click += new EventHandler(this, &CDialogConfig::btnN_curAppliquer_Clicked); 591 Controls->Add(btnN_curAppliquer); 592 488 593 //gestionnnaire associé au bouton OK 489 594 sortirBtn->Click += new EventHandler(this, &CDialogConfig::SortirBtn_Clicked); … … 565 670 { 566 671 int result = Convert::ToInt16(getTp_max()); 567 if ((result<=0)||(result>=15)) 568 { 569 MessageBox::Show(S"1 heure <= Tp_max <= 14 heures"); 672 if ((result<60)||(result>840))//compris entre 1 heure et 14 heures 673 { 674 // MessageBox::Show(S"1 heure <= Tp_max <= 14 heures"); 675 MessageBox::Show(S"60 minutes <= Tp_max <= 840 minutes"); 570 676 return; 571 677 } … … 577 683 size=1; 578 684 tab_rp_registers[0] = result; 579 rc=modbus_write_registers(ctx, 2106+(nCur-1),size, tab_rp_registers);// NumP685 rc=modbus_write_registers(ctx, 2106+(nCur-1),size, tab_rp_registers);//Tp_max 580 686 if (rc != size) 581 687 Console::WriteLine(S"CDialogConfig::BtnAppliquer_Clicked : write Tp_max failed..."); 688 } 689 } 690 691 void CDialogConfig::btnN_curAppliquer_Clicked(Object* pSender, EventArgs* pArgs)//gestionnaire d'evenement associé à la liste deroulante 692 { 693 int nCur; 694 695 if (getN_cur()!=NULL)//case non vide uniquement 696 { 697 int result = Convert::ToInt16(getN_cur()); 698 if ((result<0)||(result>8))//compris entre 1 et 8 699 { 700 MessageBox::Show(S"0 <= N_cur <= 8"); 701 return; 702 } 703 Console::WriteLine(S"ecriture N_cur"); 704 uint16_t tab_rp_registers[1]; 705 int rc; 706 int size; 707 Console::WriteLine(S"CDialogConfig::BtnAppliquer_Clicked : write N_cur..."); 708 size=1; 709 tab_rp_registers[0] = result; 710 rc=modbus_write_registers(ctx, 2027, size, tab_rp_registers);//N_cur 711 if (rc != size) 712 Console::WriteLine(S"CDialogConfig::BtnAppliquer_Clicked : write N_cur failed..."); 582 713 } 583 714 } … … 587 718 return valTp_max->Text; 588 719 } 720 721 String* CDialogConfig::getN_cur() 722 { 723 return valN_cur4Reprise->Text; 724 } 725 726 void CDialogConfig::BtnAppliquerAuto_Clicked(Object* pSender,EventArgs* pArgs)//gestionnaire d'evenement de la boite dialogue 727 { 728 729 /*\*/ 730 //.... 731 //....lire la bd OU le fichier selon le rb 732 //....msgbox en cas d'erreur 733 //....afficher ds les zones saisies 734 //....ecrire sur le modbus ts les perametres 735 736 737 if (lectBddFic==true)//lecture bdd selectionnée 738 { 739 /* 740 structure table stand_with_couplers dans la base de données : 741 +----------------+--------------------------------------+------+-----+---------+-------+ 742 | Field | Type | Null | Key | Default | Extra | 743 +----------------+--------------------------------------+------+-----+---------+-------+ 744 | idStand | char(1) | NO | | | | 745 | idPair | char(11) | YES | | NULL | | 746 | idCoupler1 | char(13) | NO | | | | 747 | idCoupler2 | char(13) | NO | | | | 748 | idConditioning | int(11) | YES | | NULL | | 749 | status | enum('to-dryheat','to-conditioning') | YES | | NULL | | 750 +----------------+--------------------------------------+------+-----+---------+-------+ 751 */ 752 // Console::WriteLine(S"CDialogConfig::BtnAppliquerAuto_Clicked : connexion bdd..."); 753 754 //lecture fichier qui contient le host et la base 755 String* sHost; 756 String* sName; 757 try 758 { 759 FileStream* fs = new FileStream("..\\condb.txt",FileMode::Open); 760 StreamReader* sr = new StreamReader(fs); 761 int count=0; 762 for (;;) 763 { 764 String* line = sr->ReadLine(); 765 //commentaire sur les 3éres lignes du fichier 766 if (count==3) 767 sHost=line; 768 if (count==4) 769 sName=line; 770 count++; 771 if (line==0)//fin du fichier 772 { 773 sr->Close(); 774 String* stra[] = {S"Host=",sHost,S" Name=",sName}; 775 String* str=String::Concat(stra); 776 Console::WriteLine(str); 777 break; 778 } 779 } 780 } 781 catch (System::Exception* pe) 782 { 783 Console::WriteLine(pe->ToString()); 784 } 785 786 // String* connStr = "server=lalsrv1.lal.in2p3.fr;User Id=xfel;Database=xfel_tst;port=3306;Password=pwd4xfel;"; 787 String* str[] = {S"server=",sHost,S";User Id=xfel;Database=",sName,S";port=3306;Password=pwd4xfel;"}; 788 String* connStr=String::Concat(str); 789 MySqlConnection* conn = new MySqlConnection(connStr); 790 try 791 { 792 conn->Open(); 793 } 794 catch (System::Exception* pe) 795 { 796 MessageBox::Show(pe->ToString()); 797 // Console::WriteLine(pe->ToString()); 798 } 799 800 // String* sql = "select idstand,idpair, idcoupler1,idcoupler2 from stand_with_couplers where status='to-conditioning'"; 801 String* sql = "select idstand,idpair, idcoupler1,idcoupler2,status from stand_with_couplers where status='to-conditioning' order by idStand"; 802 MySqlCommand* cmd = new MySqlCommand(sql, conn); 803 804 MySqlDataReader* myReader; 805 myReader = cmd->ExecuteReader(); 806 try 807 { 808 uint16_t tabNumP[4]={0,0,0,0}; 809 uint16_t tabNumC1C2[8]={0,0,0,0,0,0,0,0}; 810 int rc; 811 int size; 812 813 while(myReader->Read()) 814 { 815 String* str; 816 if(!String::Compare(myReader->GetString(0),"a"))//banc a 817 { 818 Console::WriteLine(myReader->GetString(1)); 819 CGroupBox* gboxPtr = (CGroupBox*)pal->get_Item(0); 820 str = (myReader->GetString(1))->Remove(0,8); 821 gboxPtr->SetValNumP(str); 822 tabNumP[0] = Convert::ToInt16(str); 823 str = (myReader->GetString(2))->Remove(0,8); 824 gboxPtr->SetValNumC1(str); 825 tabNumC1C2[0] = Convert::ToInt16(str); 826 str = (myReader->GetString(3))->Remove(0,8); 827 gboxPtr->SetValNumC2(str); 828 tabNumC1C2[1] = Convert::ToInt16(str); 829 } 830 if(!String::Compare(myReader->GetString(0),"b"))//banc b 831 { 832 Console::WriteLine(myReader->GetString(1)); 833 CGroupBox* gboxPtr = (CGroupBox*)pal->get_Item(1); 834 str = (myReader->GetString(1))->Remove(0,8); 835 gboxPtr->SetValNumP(str); 836 tabNumP[1] = Convert::ToInt16(str); 837 str = (myReader->GetString(2))->Remove(0,8); 838 gboxPtr->SetValNumC1(str); 839 tabNumC1C2[2] = Convert::ToInt16(str); 840 str = (myReader->GetString(3))->Remove(0,8); 841 gboxPtr->SetValNumC2(str); 842 tabNumC1C2[3] = Convert::ToInt16(str); 843 } 844 if(!String::Compare(myReader->GetString(0),"c"))//banc c 845 { 846 Console::WriteLine(myReader->GetString(1)); 847 CGroupBox* gboxPtr = (CGroupBox*)pal->get_Item(2); 848 str = (myReader->GetString(1))->Remove(0,8); 849 gboxPtr->SetValNumP(str); 850 tabNumP[2] = Convert::ToInt16(str); 851 str = (myReader->GetString(2))->Remove(0,8); 852 gboxPtr->SetValNumC1(str); 853 tabNumC1C2[4] = Convert::ToInt16(str); 854 str = (myReader->GetString(3))->Remove(0,8); 855 gboxPtr->SetValNumC2(str); 856 tabNumC1C2[5] = Convert::ToInt16(str); 857 } 858 if(!String::Compare(myReader->GetString(0),"d"))//banc d 859 { 860 Console::WriteLine(myReader->GetString(1)); 861 CGroupBox* gboxPtr = (CGroupBox*)pal->get_Item(3); 862 str = (myReader->GetString(1))->Remove(0,8); 863 gboxPtr->SetValNumP(str); 864 tabNumP[3] = Convert::ToInt16(str); 865 str = (myReader->GetString(2))->Remove(0,8); 866 gboxPtr->SetValNumC1(str); 867 tabNumC1C2[6] = Convert::ToInt16(str); 868 str = (myReader->GetString(3))->Remove(0,8); 869 gboxPtr->SetValNumC2(str); 870 tabNumC1C2[7] = Convert::ToInt16(str); 871 } 872 }//while 873 //fin du fichier : on ecrit sur le modbus 874 Console::WriteLine(S"CGroupBox::::AppliquerBtn_Clicked : write NumP NumC1 et NumC2..."); 875 size=4; 876 rc=modbus_write_registers(ctx, 2070,size, tabNumP);//NumP 877 if (rc != size) 878 Console::WriteLine(S"CGroupBox::::AppliquerBtn_Clicked : write holding failed..."); 879 size=8; 880 rc=modbus_write_registers(ctx, 2050,size, tabNumC1C2);//NumC1 et NumC2 881 if (rc != size) 882 Console::WriteLine(S"CGroupBox::::AppliquerBtn_Clicked : write holding failed..."); 883 } 884 catch (System::Exception* pe) 885 { 886 Console::WriteLine(pe->ToString()); 887 } 888 myReader->Close(); 889 conn->Close(); 890 }//fin lectBddFic true 891 else//lecture fichier selectionnée 892 { 893 /* 894 format fichier couplers.txt (13 lignes) : 895 #id conditionnement 896 NumP banc a 897 NumC1 banc a 898 NumC2 banc a 899 NumP banc b 900 NumC1 banc b 901 NumC2 banc b 902 NumP banc c 903 NumC1 banc c 904 NumC2 banc c 905 NumP banc d 906 NumC1 banc d 907 NumC2 banc d 908 */ 909 String* str; 910 try 911 { 912 FileStream* fs = new FileStream("..\\couplers.txt",FileMode::Open); 913 StreamReader* sr = new StreamReader(fs); 914 int count=0; 915 uint16_t tabNumP[4]={0,0,0,0}; 916 uint16_t tabNumC1C2[8]={0,0,0,0,0,0,0,0}; 917 int rc; 918 int size; 919 920 for (;;) 921 { 922 String* line = sr->ReadLine(); 923 CGroupBox* gboxPtr; 924 if (count) 925 { 926 switch (count) 927 { 928 case 1 : case 2 : case 3 : 929 {//banc a 930 Console::WriteLine(line); 931 CGroupBox* gboxPtr = (CGroupBox*)pal->get_Item(0); 932 if (count == 1) 933 { 934 gboxPtr->SetValNumP(line); 935 tabNumP[0] = Convert::ToInt16(line); 936 } 937 if (count == 2) 938 { 939 gboxPtr->SetValNumC1(line); 940 tabNumC1C2[0] = Convert::ToInt16(line); 941 } 942 if (count == 3) 943 { 944 gboxPtr->SetValNumC2(line); 945 tabNumC1C2[1] = Convert::ToInt16(line); 946 } 947 } 948 break; 949 case 4 : case 5 : case 6 : 950 {//banc b 951 Console::WriteLine(line); 952 CGroupBox* gboxPtr = (CGroupBox*)pal->get_Item(1); 953 if (count == 4) 954 { 955 gboxPtr->SetValNumP(line); 956 tabNumP[1] = Convert::ToInt16(line); 957 } 958 if (count == 5) 959 { 960 gboxPtr->SetValNumC1(line); 961 tabNumC1C2[2] = Convert::ToInt16(line); 962 } 963 if (count == 6) 964 { 965 gboxPtr->SetValNumC2(line); 966 tabNumC1C2[3] = Convert::ToInt16(line); 967 } 968 } 969 break; 970 case 7 : case 8 : case 9 : 971 {//banc c 972 Console::WriteLine(line); 973 gboxPtr = (CGroupBox*)pal->get_Item(2); 974 if (count == 7) 975 { 976 gboxPtr->SetValNumP(line); 977 tabNumP[2] = Convert::ToInt16(line); 978 } 979 if (count == 8) 980 { 981 gboxPtr->SetValNumC1(line); 982 tabNumC1C2[4] = Convert::ToInt16(line); 983 } 984 if (count == 9) 985 { 986 gboxPtr->SetValNumC2(line); 987 tabNumC1C2[5] = Convert::ToInt16(line); 988 } 989 } 990 break; 991 case 10 : case 11 : case 12 : 992 {//banc d 993 Console::WriteLine(line); 994 CGroupBox* gboxPtr = (CGroupBox*)pal->get_Item(3); 995 if (count == 10) 996 { 997 gboxPtr->SetValNumP(line); 998 tabNumP[3] = Convert::ToInt16(line); 999 } 1000 if (count == 11) 1001 { 1002 gboxPtr->SetValNumC1(line); 1003 tabNumC1C2[6] = Convert::ToInt16(line); 1004 } 1005 if (count == 12) 1006 { 1007 gboxPtr->SetValNumC2(line); 1008 tabNumC1C2[7] = Convert::ToInt16(line); 1009 } 1010 } 1011 break; 1012 } 1013 } 1014 count++; 1015 if (line==0)//fin du fichier : on ecrit sur le modbus 1016 { 1017 sr->Close(); 1018 Console::WriteLine(S"CGroupBox::::AppliquerBtn_Clicked : write NumP NumC1 et NumC2..."); 1019 size=4; 1020 rc=modbus_write_registers(ctx, 2070,size, tabNumP);//NumP 1021 if (rc != size) 1022 Console::WriteLine(S"CGroupBox::::AppliquerBtn_Clicked : write holding failed..."); 1023 size=8; 1024 rc=modbus_write_registers(ctx, 2050,size, tabNumC1C2);//NumC1 et NumC2 1025 if (rc != size) 1026 Console::WriteLine(S"CGroupBox::::AppliquerBtn_Clicked : write holding failed..."); 1027 break; 1028 } 1029 } 1030 } 1031 catch (System::Exception* pe) 1032 { 1033 Console::WriteLine(pe->ToString()); 1034 } 1035 1036 }//fin lectBddFic false 1037 } 1038 1039 void CDialogConfig::Radio_Clicked(Object* pSender, EventArgs* pArgs)//remplit automatiquement la zone de texte 1040 { 1041 for(int index=0;index<NB_BANCS;index++) 1042 {//zones de texte initialisée vide 1043 CGroupBox* gboxPtr = (CGroupBox*)pal->get_Item(index); 1044 gboxPtr->SetValNumP("xx"); 1045 gboxPtr->SetValNumC1("xx"); 1046 gboxPtr->SetValNumC2("xx"); 1047 } 1048 1049 if (pSender == rbAutoBdd) 1050 { 1051 Console::WriteLine(S"CDialogConfig::Radio_Clicked : lecture bdd activée..."); 1052 lectBddFic=true; 1053 } 1054 else if (pSender == rbAutoFichier) 1055 { 1056 Console::WriteLine(S"CDialogConfig::Radio_Clicked : lecture fichier activée..."); 1057 lectBddFic=false; 1058 } 1059 } 589 1060 590 1061 … … 698 1169 if (indexTextBox>=10) 699 1170 { 700 posX=8 00;1171 posX=810; 701 1172 j=indexTextBox-10; 702 1173 } … … 755 1226 Label* tp_max= new Label(); 756 1227 tp_max->Location = Point(1050, 300); 757 tp_max->Size = System::Drawing::Size(7 0,16);1228 tp_max->Size = System::Drawing::Size(75,16); 758 1229 tp_max->Text = nameLab_5[2];//zone de texte initialisée 759 1230 tp_max->TextAlign = ContentAlignment::MiddleCenter; … … 1028 1499 else 1029 1500 {//mode pulsing 1501 /* 1030 1502 switch (tab_rp_registers_low[28]){//RetMAPR 1031 1503 case 0://conditionnement arreté … … 1058 1530 Console::WriteLine(str); 1059 1531 } 1532 */ 1533 if ((tab_rp_registers_low[28] == 1)|| tab_rp_registers_low[29]) 1534 {//RetMAR conditionnement arreté ou defaut 1535 cltbPtr->SetVal("ARRET"); 1536 btnStart->Enabled=false;//bouton start 1537 btnStop->Enabled=true;//bouton stop 1538 btnReprise->Enabled=false;//bouton reprise 1539 } 1540 switch (tab_rp_registers_low[28]){//RetMAR 1541 case 0://conditionnement arreté 1542 cltbPtr->SetVal("ARRET"); 1543 btnStart->Enabled=true;//bouton start 1544 btnStop->Enabled=false;//bouton stop 1545 btnReprise->Enabled=true;//bouton reprise 1546 break; 1547 case 2: case 3://conditionnement démarré ou repris 1548 cltbPtr->SetVal("MARCHE"); 1549 btnStart->Enabled=false;//bouton start 1550 btnStop->Enabled=true;//bouton stop 1551 btnReprise->Enabled=false;//bouton reprise 1552 break; 1553 } 1554 if (tab_rp_registers_low[28] != tab_rp_registers_low[48])//message affiché 1555 { 1556 String* stra[] = {S"RetMAPR=",Convert::ToString(tab_rp_registers_low[28]), 1557 S" not equal to MAPR=",Convert::ToString(tab_rp_registers_low[48])}; 1558 String* str=String::Concat(stra); 1559 Console::WriteLine(str); 1560 } 1060 1561 }//fin mode pulsing 1061 1562 … … 1214 1715 switch (tab_rp_registers_low[29]){//Erreur 1215 1716 case 1: 1216 cltbPtr->SetVal(" erreur 1");1717 cltbPtr->SetVal("IL_HARD"); 1217 1718 cltbPtr->SetColor(1); 1218 1719 break; 1219 1720 case 2: 1220 cltbPtr->SetVal(" erreur 2");1721 cltbPtr->SetVal("Timer_m_ko"); 1221 1722 cltbPtr->SetColor(1); 1222 1723 break; 1223 1724 case 3: 1224 cltbPtr->SetVal(" erreur 3");1725 cltbPtr->SetVal("Nil_sup_max"); 1225 1726 cltbPtr->SetColor(1); 1226 1727 break; 1227 1728 case 4: 1228 cltbPtr->SetVal(" erreur 4");1729 cltbPtr->SetVal("Pcde_sup_max"); 1229 1730 cltbPtr->SetColor(1); 1230 1731 break; 1231 1732 case 5: 1232 cltbPtr->SetVal(" erreur 5");1733 cltbPtr->SetVal("Def_Vcur_Sweep"); 1233 1734 cltbPtr->SetColor(1); 1234 1735 break; 1235 1736 case 6: 1236 cltbPtr->SetVal(" erreur 6");1737 cltbPtr->SetVal("Vcur_sup_SVfin"); 1237 1738 cltbPtr->SetColor(1); 1238 1739 break; 1239 1740 case 7: 1240 cltbPtr->SetVal("erreur 7"); 1741 cltbPtr->SetVal("Pref_Coupleur"); 1742 cltbPtr->SetColor(1); 1743 break; 1744 case 8: 1745 cltbPtr->SetVal("Temp_Coupleur"); 1746 cltbPtr->SetColor(1); 1747 break; 1748 case 9: 1749 cltbPtr->SetVal("Arc Coupleur A1"); 1750 cltbPtr->SetColor(1); 1751 break; 1752 case 10: 1753 cltbPtr->SetVal("Arc Coupleur A2"); 1754 cltbPtr->SetColor(1); 1755 break; 1756 case 11: 1757 cltbPtr->SetVal("Arc Coupleur B1"); 1758 cltbPtr->SetColor(1); 1759 break; 1760 case 12: 1761 cltbPtr->SetVal("Arc Coupleur B2"); 1762 cltbPtr->SetColor(1); 1763 break; 1764 case 13: 1765 cltbPtr->SetVal("Arc Coupleur C1"); 1766 cltbPtr->SetColor(1); 1767 break; 1768 case 14: 1769 cltbPtr->SetVal("Arc Coupleur C2"); 1770 cltbPtr->SetColor(1); 1771 break; 1772 case 15: 1773 cltbPtr->SetVal("Arc Coupleur D1"); 1774 cltbPtr->SetColor(1); 1775 break; 1776 case 16: 1777 cltbPtr->SetVal("Arc Coupleur D2"); 1778 cltbPtr->SetColor(1); 1779 break; 1780 case 17: 1781 cltbPtr->SetVal("Arc Klystron"); 1241 1782 cltbPtr->SetColor(1); 1242 1783 break; … … 1283 1824 GroupBox* gboxC = new GroupBox(); 1284 1825 gboxC->Text = S"CONDITIONNEMENT"; 1285 gboxC->Size = System::Drawing::Size(800, 450);//taille du groupbox en pixels 1286 gboxC->Location = Point(40,300); 1826 // gboxC->Size = System::Drawing::Size(800, 450);//taille du groupbox en pixels 1827 gboxC->Size = System::Drawing::Size(810, 450);//taille du groupbox en pixels 1828 // gboxC->Location = Point(40,300); 1829 gboxC->Location = Point(30,300); 1287 1830 1288 1831 Setup_Buttons_Conditionning();//configure les boutons du formulaire … … 1413 1956 // Vides label tt seul 1414 1957 Label* vides = new Label(); 1415 vides->Location = Point(50, 590); 1416 vides->Size = System::Drawing::Size(60,32); 1417 vides->Text = "Vides (10-9mbar)";//zone de texte initialisée 1958 // vides->Location = Point(50, 590); 1959 vides->Location = Point(35, 590); 1960 // vides->Size = System::Drawing::Size(60,32); 1961 vides->Size = System::Drawing::Size(70,40); 1962 vides->Text = " Vides (10-10mbar)";//zone de texte initialisée 1418 1963 vides->TextAlign = ContentAlignment::MiddleRight; 1419 1964 Controls->Add(vides);
Note: See TracChangeset
for help on using the changeset viewer.