123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149 |
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Windows.Forms;
- using OTSINTERFACE;
- using OTSSysMgrTools;
- namespace OTSIncAReportGB
- {
- public partial class MainForm : Form
- {
- #region 全局变量
- public OTSINTERFACE.COTSReportProjFileMgrClr m_ReportProjFileMgr = new OTSINTERFACE.COTSReportProjFileMgrClr();
- string m_arg1 = "";
- string m_arg2 = "";
- #endregion
- public MainForm()
- {
- InitializeComponent();
- }
- public MainForm(string[] args)
- {
- InitializeComponent();
- if (args.Length == 0)
- {
- MessageBox.Show("请使用报告程序打开国标程序!");
- Application.Exit();
- return;
- }
- if (args.Length != 2)
- {
- string str = "";
- for (int i = 0; i < args.Length; i++)
- {
- str = str + "参数" + (i + 1).ToString() + ":" + args[i].ToString() + Environment.NewLine;
- }
- MessageBox.Show("传入的参数数量不正确,应为2个参数:" + Environment.NewLine + str);
- Application.Exit();
- return;
- }
- m_arg1 = args[0].Replace("^", " ");
- m_arg2 = args[1].Replace("^", " ");
- }
- private void Main_Load(object sender, EventArgs e)
- {
- //接收到测量结果路径,然后加载
- //测试相关代码
- bool bDebug = false;
- if (bDebug != false)
- {
- m_arg1 = "E:\\ResultFile\\test1\\Sample1\\Sample1.rst";
- m_arg2 = "DIN";
- }
- if (m_arg1 != "")
- {
- m_ReportProjFileMgr.AddASmplMsrResultMgr(m_arg1);
- m_ReportProjFileMgr.SetSelectedPicture(1);
- }
- if (m_arg2 == "GB1")
- {
- //国标一
- OTSINTERFACE.CPropParamClr clr_prop = m_ReportProjFileMgr.GetCurrentPropParam();
- clr_prop.SetDataSourceId(0);//
- clr_prop.SetType(1);//table
- clr_prop.SetCalTableType(6);//国标1
- List<OTSINTERFACE.CGridDataClr> listGriddataclr = m_ReportProjFileMgr.GridDataTransfer();
- ChineseStandardABCDDS m_ChineseStandardABCDDS = new ChineseStandardABCDDS(m_ReportProjFileMgr, listGriddataclr);
- this.panel1.Controls.Add(m_ChineseStandardABCDDS);
- this.Text = "国标一";
- }
- else if (m_arg2 == "GB2")
- {
- //国标二
- OTSINTERFACE.CPropParamClr clr_prop2 = m_ReportProjFileMgr.GetCurrentPropParam();
- clr_prop2.SetDataSourceId(0);//
- clr_prop2.SetType(1);//table
- clr_prop2.SetCalTableType(7);
- List<OTSINTERFACE.CGridDataClr> listGriddataclr2 = m_ReportProjFileMgr.GridDataTransfer();
- NationalStandardMethodTwo m_NationalStandardMethodTwo = new NationalStandardMethodTwo(m_ReportProjFileMgr, listGriddataclr2);
- this.panel1.Controls.Add(m_NationalStandardMethodTwo);
- this.Text = "国标二";
- }
- else if (m_arg2 == "ASTM")
- {
- //美标
- OTSINTERFACE.CPropParamClr clr_prop3 = m_ReportProjFileMgr.GetCurrentPropParam();
- clr_prop3.SetDataSourceId(0);//
- clr_prop3.SetType(1);//table
- clr_prop3.SetCalTableType(8);
- List<OTSINTERFACE.CGridDataClr> listGriddataclr3 = m_ReportProjFileMgr.GridDataTransfer();
- ASTMStandardABCDDS m_ASTMStandardABCDDS = new ASTMStandardABCDDS(m_ReportProjFileMgr, listGriddataclr3);
- this.panel1.Controls.Add(m_ASTMStandardABCDDS);
- this.Text = "美标";
- }
- else if (m_arg2 == "DIN")
- {
- //德标
- OTSINTERFACE.CPropParamClr clr_prop4 = m_ReportProjFileMgr.GetCurrentPropParam();
- clr_prop4.SetDataSourceId(0);//
- clr_prop4.SetType(1);//table
- clr_prop4.SetCalTableType(9);
- List<OTSINTERFACE.CGridDataClr> listGriddataclr4 = m_ReportProjFileMgr.GridDataTransfer();
- DINStandardABCDDS m_DINStandardABCDDS = new DINStandardABCDDS(m_ReportProjFileMgr, listGriddataclr4);
- this.panel1.Controls.Add(m_DINStandardABCDDS);
- this.Text = "德标";
- }
- }
- }
- }
|