Exemplo n.º 1
0
 /// <summary>
 /// 将tdsInTbl与对话框同步
 /// </summary>
 /// <param name="tdsInTbl">程序中的tdsInTbl列表</param>
 /// <param name="idsInTbl">所选的钢束线的ObjectId所组成的List</param>
 public static void SyncTdsToDlg(ref ObservableCollection <Tendon> tdsInTbl, TendonInfo dlg)
 {
     for (int i = 0; i < tdsInTbl.Count; i++)//遍历各行并依次设置属性
     {
         //钢束名称
         tdsInTbl[i].TdName = (dlg.dataGridTdInfo.Columns[0].GetCellContent(dlg.dataGridTdInfo.Items[i]) as TextBlock).Text;
         //钢束规格
         tdsInTbl[i].TdStyle = (dlg.dataGridTdInfo.GetControl(i, 1, "comboBoxTdStyles") as ComboBox).Text;
         //钢束数量
         tdsInTbl[i].TdNum = int.Parse((dlg.dataGridTdInfo.Columns[2].GetCellContent(dlg.dataGridTdInfo.Items[i]) as TextBlock).Text);
         //管道直径
         tdsInTbl[i].TdPipeDia = double.Parse((dlg.dataGridTdInfo.Columns[3].GetCellContent(dlg.dataGridTdInfo.Items[i]) as TextBlock).Text);
         //张拉方式
         bool leftDraw  = (bool)(dlg.dataGridTdInfo.GetControl(i, 4, "checkBoxLeftDraw") as CheckBox).IsChecked;
         bool rightDraw = (bool)(dlg.dataGridTdInfo.GetControl(i, 5, "checkBoxRightDraw") as CheckBox).IsChecked;
         if (leftDraw && !rightDraw)
         {
             tdsInTbl[i].TdDrawStyle = TendonDrawStyle.Left;
         }
         else if (!leftDraw && rightDraw)
         {
             tdsInTbl[i].TdDrawStyle = TendonDrawStyle.Right;
         }
         else
         {
             tdsInTbl[i].TdDrawStyle = TendonDrawStyle.Both;
         }
     }
 }
Exemplo n.º 2
0
        public void TendonTable()
        {
            //创建钢束信息界面
            TendonInfo tdInfo = new TendonInfo();

            //显示钢束信息界面
            Application.ShowModalWindow(tdInfo);
        }
Exemplo n.º 3
0
        /// <summary>
        /// 将tdGenParas与对话框中的内容同步
        /// </summary>
        /// <param name="tdGenParas">程序中的tdGenParas类</param>
        /// <param name="tdInfo">对话框</param>
        public static void SyncTdGenParasToDlg(TendonInfo tdInfo)
        {
            double kii, miu, Ep, ctrlStress, workLen;

            //1.1管道偏差系数
            if (!double.TryParse(tdInfo.textBoxKii.Text, out kii))
            {
                MessageBox.Show("管道偏差系数输入有误!");
                tdInfo.Show();
                return;
            }
            //1.2摩阻系数
            if (!double.TryParse(tdInfo.textBoxMiu.Text, out miu))
            {
                MessageBox.Show("摩阻系数输入有误!");
                tdInfo.Show();
                return;
            }
            //1.3钢束弹模
            if (!double.TryParse(tdInfo.textBoxEp.Text, out Ep))
            {
                MessageBox.Show("钢束弹模输入有误!");
                tdInfo.Show();
                return;
            }
            //1.4张拉控制应力
            if (!double.TryParse(tdInfo.textBoxCtrlStress.Text, out ctrlStress))
            {
                MessageBox.Show("张拉控制应力输入有误!");
                tdInfo.Show();
                return;
            }
            //1.5工作长度
            if (!double.TryParse(tdInfo.textBoxWorkLen.Text, out workLen))
            {
                MessageBox.Show("工作长度输入有误!");
                tdInfo.Show();
                return;
            }
            TendonGeneralParameters.Kii        = kii;
            TendonGeneralParameters.Miu        = miu;
            TendonGeneralParameters.Ep         = Ep;
            TendonGeneralParameters.CtrlStress = ctrlStress;
            TendonGeneralParameters.WorkLen    = workLen;
        }