private void button1_Click(object sender, EventArgs e) { robj = (RemoteInterface.HC.I_HC_Comm)RemoteInterface.RemoteBuilder.GetRemoteObj(typeof(RemoteInterface.HC.I_HC_Comm), RemoteInterface.RemoteBuilder.getRemoteUri(txtHostIp.Text.Trim(), (int)RemotingPortEnum.HOST, "Comm")); if (this.radioButton1.Checked) { try { MessageBox.Show(robj.getTCCommStatusStr(this.cbDevName.Text.Trim())); } catch (Exception ex) { MessageBox.Show(ex.Message); } } else if (this.radioButton2.Checked) { try { robj.ResetComm(this.cbDevName.Text.Trim()); } catch (Exception ex) { MessageBox.Show(ex.Message); } } }
public FrmMain() { if(Environment.GetCommandLineArgs().Length==1) rhost=(RemoteInterface.HC.I_HC_Comm)RemoteInterface.RemoteBuilder.GetRemoteObj(typeof(RemoteInterface.HC.I_HC_Comm),RemoteInterface.RemoteBuilder.getRemoteUri("10.21.50.4",(int)RemoteInterface.RemotingPortEnum.HOST,"Comm")); else rhost = (RemoteInterface.HC.I_HC_Comm)RemoteInterface.RemoteBuilder.GetRemoteObj(typeof(RemoteInterface.HC.I_HC_Comm), RemoteInterface.RemoteBuilder.getRemoteUri(Environment.GetCommandLineArgs()[1], (int)RemoteInterface.RemotingPortEnum.HOST_FIWS, "Comm")); InitializeComponent(); }
static void HostExecuteSQLCmd(string sql) { try { if (rhost == null) { rhost = (RemoteInterface.HC.I_HC_Comm)RemoteInterface.RemoteBuilder.GetRemoteObj( typeof(RemoteInterface.HC.I_HC_Comm), RemoteInterface.RemoteBuilder.getRemoteUri(RemoteInterface.RemoteBuilder.getHostIP(), (int)RemotingPortEnum.HOST, "Comm")); } rhost.dbExecute(sql); } catch (Exception ex) { ; } }
void sendHostEvent(string devName,object eventdata) { if (rhost == null) { rhost = (RemoteInterface.HC.I_HC_Comm)RemoteInterface.RemoteBuilder.GetRemoteObj(typeof(RemoteInterface.HC.I_HC_Comm), RemoteInterface.RemoteBuilder.getRemoteUri(RemoteInterface.RemoteBuilder.getHostIP(), (int)RemoteInterface.RemotingPortEnum.HOST, "Comm")); } rhost.setTemEvent(devName, eventdata); }
private void button3_Click(object sender, EventArgs e) { robj = (RemoteInterface.HC.I_HC_Comm)RemoteInterface.RemoteBuilder.GetRemoteObj(typeof(RemoteInterface.HC.I_HC_Comm), RemoteInterface.RemoteBuilder.getRemoteUri(txtHostIp.Text.Trim(), (int)RemotingPortEnum.HOST, "Comm")); this.cbDevName.DataSource= robj.getDeviceNames(txtDevType.Text); }