private void tmrNet_Tick(object sender, EventArgs e) { // 定时向服务器发送望远镜状态信息 ascii_proto_telescope info = new ascii_proto_telescope(); info.state = Convert.ToInt32(nftele_.state); info.ec = nftele_.ec; info.ra = nftele_.ra; info.dc = nftele_.dc; info.azi = nftele_.azi; info.ele = nftele_.ele; AsyncSendString(ascproto_.CompactTelescope(info)); }
public string CompactTelescope(ascii_proto_telescope info) { string output = "telescope "; output += "state=" + Convert.ToString(info.state) + ","; output += "ec=" + Convert.ToString(info.ec) + ","; output += "ra=" + Convert.ToString(info.ra) + ","; output += "dec=" + Convert.ToString(info.dc) + ","; output += "azi=" + Convert.ToString(info.azi) + ","; output += "ele=" + Convert.ToString(info.ele); output += "\n"; return(output); }