📄 lineform.ui.h
字号:
/****************************************************************************** ui.h extension file, included from the uic-generated form implementation.**** If you wish to add, delete or rename functions or slots use** Qt Designer which will update this file, preserving your code. Create an** init() function in place of a constructor, and a destroy() function in** place of a destructor.*****************************************************************************/int Llin;QString Line[40][18];void LineForm::init(){ int i, j, k; QString str; QDir::setCurrent("/root/FaultRecorder/"); QFile file( "line_ratedvalue.DAT" ); file.open( IO_ReadOnly ); QTextStream stream( &file ); for ( i = 0; i < 40; i++ ){ for ( j = 0; j < 18; j++){ stream>>Line[i][j]; if ( j==0 ){ Line_Table->setText(i, j, Line[i][j]); //显示线路名称; } if ( j==1 ){ if (Line[i][j] == "" || Line[i][j] == "0"){ str = ""; }else { k = atoi(Line[i][j]); str = ComboBox1->text(k); } Line_Table->setText(i, j, str); //显示线路电压等级; } if ( j==2 ){ if (Line[i][j] == "0" || Line[i][j] == ""){ str = ""; }else if (Line[i][j] == "1"){ str = CheckBox1->text(); } Line_Table->setText(i, j, str); //显示运行状态; } if ( j==3 ){ if (Line[i][j] != ""){ str = Line[i][j]+"kM"; }else { str = ""; } Line_Table->setText(i, j, str); //显示线路长度; } if ( j==5 ){ if ( Line[i][j] == "" || Line[i][j] == "0" ){ str = ""; }else if ( Line[i][j] == "1" ){ str = Line[i][j-1] + "A/5A"; }else if ( Line[i][j] == "2" ){ str = Line[i][j-1] + "A/1A"; } Line_Table->setText(i, 4, str); //显示线路TA电流变比; } if ( j==7 ){ if ( Line[i][j] == "" || Line[i][j-1] == ""){ str = ""; }else { str = Line[i][j-1] + "+j" + Line[i][j]; } Line_Table->setText(i, 5, str); //显示线路单位正序阻抗; } if ( j==9 ){ if ( Line[i][j] == "" || Line[i][j-1] == ""){ str = ""; }else { str = Line[i][j-1] + "+j" + Line[i][j]; } Line_Table->setText(i, 6, str); //显示线路单位零序阻抗; } if ( j==11 ){ if ( Line[i][j] == "" || Line[i][j-1] == ""){ str = ""; }else { str = Line[i][j-1] + "+j" + Line[i][j]; } Line_Table->setText(i, 7, str); //显示线路本侧正序阻抗; } if ( j==13 ){ if ( Line[i][j] == "" || Line[i][j-1] == ""){ str = ""; }else { str = Line[i][j-1] + "+j" + Line[i][j]; } Line_Table->setText(i, 8, str); //显示线路本侧零序阻抗; } if ( j==15 ){ if ( Line[i][j] == "" || Line[i][j-1] == ""){ str = ""; }else { str = Line[i][j-1] + "+j" + Line[i][j]; } Line_Table->setText(i, 9, str); //显示线路对侧正序阻抗; } if ( j==17 ){ if ( Line[i][j] == "" || Line[i][j-1] == ""){ str = ""; }else { str = Line[i][j-1] + "+j" + Line[i][j]; } Line_Table->setText(i, 10, str); //显示线路对侧零序阻抗; } str = ""; } } Line_Table->setColumnWidth(5,130); Line_Table->setColumnWidth(6,130); Line_Table->setColumnWidth(7,130); Line_Table->setColumnWidth(8,130); Line_Table->setColumnWidth(9,130); Line_Table->setColumnWidth(10,130); LineEdit0->setEnabled(FALSE); ComboBox1->setEnabled(FALSE); CheckBox1->setEnabled(FALSE); pushButton1->setEnabled(FALSE); LineEdit1->setEnabled(FALSE); pushButton2->setEnabled(FALSE); LineEdit2->setEnabled(FALSE); ComboBox2->setEnabled(FALSE); pushButton3->setEnabled(FALSE); pushButton4->setEnabled(FALSE); pushButton5->setEnabled(FALSE); pushButton6->setEnabled(FALSE); pushButton7->setEnabled(FALSE); pushButton8->setEnabled(FALSE); pushButton9->setEnabled(FALSE); pushButton10->setEnabled(FALSE); pushButton11->setEnabled(FALSE); pushButton12->setEnabled(FALSE); pushButton13->setEnabled(FALSE); pushButton14->setEnabled(FALSE); LineEdit3->setEnabled(FALSE); LineEdit4->setEnabled(FALSE); LineEdit5->setEnabled(FALSE); LineEdit6->setEnabled(FALSE); LineEdit7->setEnabled(FALSE); LineEdit8->setEnabled(FALSE); LineEdit9->setEnabled(FALSE); LineEdit10->setEnabled(FALSE); LineEdit11->setEnabled(FALSE); LineEdit12->setEnabled(FALSE); LineEdit13->setEnabled(FALSE); LineEdit14->setEnabled(FALSE); DelPushButton->setEnabled(FALSE); savePushButton->setEnabled(FALSE); file.close();}void LineForm::Table(){ int i; Llin = Line_Table->currentRow(); LineEdit0->setText(Line[Llin][0]); if ( Line[Llin][1] == "" ){ ComboBox1->setCurrentItem(0); }else { i = atoi ( Line[Llin][1] ); ComboBox1->setCurrentItem(i); } if ( Line[Llin][2] == "0" || Line[Llin][2] == "" ){ CheckBox1->setChecked(FALSE); }else if ( Line[Llin][2] == "1" ){ CheckBox1->setChecked(TRUE); } LineEdit1->setText(Line[Llin][3]); LineEdit2->setText(Line[Llin][4]); if ( Line[Llin][5] == "" ){ ComboBox2->setCurrentItem(0); }else { i = atoi ( Line[Llin][5] ); ComboBox2->setCurrentItem(i); } LineEdit3->setText(Line[Llin][6]); LineEdit4->setText(Line[Llin][7]); LineEdit5->setText(Line[Llin][8]); LineEdit6->setText(Line[Llin][9]); LineEdit7->setText(Line[Llin][10]); LineEdit8->setText(Line[Llin][11]); LineEdit9->setText(Line[Llin][12]); LineEdit10->setText(Line[Llin][13]); LineEdit11->setText(Line[Llin][14]); LineEdit12->setText(Line[Llin][15]); LineEdit13->setText(Line[Llin][16]); LineEdit14->setText(Line[Llin][17]);}//定值修改;void LineForm::edit(){ LineEdit0->setEnabled(TRUE); ComboBox1->setEnabled(TRUE); CheckBox1->setEnabled(TRUE); pushButton1->setEnabled(TRUE); LineEdit1->setEnabled(TRUE); pushButton2->setEnabled(TRUE); LineEdit2->setEnabled(TRUE); ComboBox2->setEnabled(TRUE); pushButton3->setEnabled(TRUE); pushButton4->setEnabled(TRUE); pushButton5->setEnabled(TRUE); pushButton6->setEnabled(TRUE); pushButton7->setEnabled(TRUE); pushButton8->setEnabled(TRUE); pushButton9->setEnabled(TRUE); pushButton10->setEnabled(TRUE); pushButton11->setEnabled(TRUE); pushButton12->setEnabled(TRUE); pushButton13->setEnabled(TRUE); pushButton14->setEnabled(TRUE); LineEdit3->setEnabled(TRUE); LineEdit4->setEnabled(TRUE); LineEdit5->setEnabled(TRUE); LineEdit6->setEnabled(TRUE); LineEdit7->setEnabled(TRUE); LineEdit8->setEnabled(TRUE); LineEdit9->setEnabled(TRUE); LineEdit10->setEnabled(TRUE); LineEdit11->setEnabled(TRUE); LineEdit12->setEnabled(TRUE); LineEdit13->setEnabled(TRUE); LineEdit14->setEnabled(TRUE); DelPushButton->setEnabled(TRUE); savePushButton->setEnabled(TRUE);}//用数字键盘输入定值;void LineForm::pushButton1_edit(){ QString str; DataKeyboard_Form*datakeyboard_Form = new DataKeyboard_Form(this,"数字键盘",FALSE); datakeyboard_Form->exec(); str = datakeyboard_Form->returnNumber(); LineEdit1->setText( str );}void LineForm::pushButton2_edit(){ QString str; DataKeyboard_Form*datakeyboard_Form = new DataKeyboard_Form(this,"数字键盘",FALSE); datakeyboard_Form->exec(); str = datakeyboard_Form->returnNumber(); LineEdit2->setText( str );}void LineForm::pushButton3_edit(){ QString str; DataKeyboard_Form*datakeyboard_Form = new DataKeyboard_Form(this,"数字键盘",FALSE); datakeyboard_Form->exec(); str = datakeyboard_Form->returnNumber(); LineEdit3->setText( str );}void LineForm::pushButton4_edit(){ QString str; DataKeyboard_Form*datakeyboard_Form = new DataKeyboard_Form(this,"数字键盘",FALSE); datakeyboard_Form->exec(); str = datakeyboard_Form->returnNumber(); LineEdit4->setText( str );}void LineForm::pushButton5_edit(){ QString str; DataKeyboard_Form*datakeyboard_Form = new DataKeyboard_Form(this,"数字键盘",FALSE); datakeyboard_Form->exec(); str = datakeyboard_Form->returnNumber(); LineEdit5->setText( str );}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -