private void sendCommandButton_Click(object sender, EventArgs e) { string command = this.inputTxtBox.Text; if (!string.IsNullOrEmpty(command)) { command = command.Trim(); string reponse = C50Communication.SendRequestAndWaitReply(command); this.outputTxtBox.Text = reponse; } }
public static string SetAnyProperty(string prop, string value, int theUnitID) { if ((value.Contains("UNKNOWN")) || (value == "0")) { //we shouldn't try and set this value... return(""); } string command = SETANYPROPERTY.Replace("PSCUNIT", theUnitID.ToString()); string toSet = prop + "=\"" + value + "\""; command = command.Replace("PSCTOSET", toSet); return(C50Communication.SendRequestAndWaitReply(command)); }
private void UnitUpdateProcessor(Object myObject, EventArgs myEventArgs) { this.theUpdateTimer.Stop(); //update the next item if (this.IndexOfUnitToUpdate > this.AllUnits.Count - 1) { this.IndexOfUnitToUpdate = 0; } if (this.AllUnits[this.IndexOfUnitToUpdate] != null) { string xmlUpdate = C50Communication.GetAllStatus(this.AllUnits[this.IndexOfUnitToUpdate].UnitID); this.AllUnits[this.IndexOfUnitToUpdate].ProcessXMLUpdate(xmlUpdate); this.IndexOfUnitToUpdate++; } this.lastUpdateLbl.Text = "Last Update: Unit " + this.IndexOfUnitToUpdate.ToString() + " at " + DateTime.Now.ToShortTimeString(); this.theUpdateTimer.Enabled = true; }
public static string GetAllStatus(int unitID) { string command = GETALLSTATUS.Replace("PSCUNIT", unitID.ToString()); return(C50Communication.SendRequestAndWaitReply(command)); }