/// <summary> /// execute the get der status SOAP call /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void getButton_Click(object sender, EventArgs e) { DERMSInterface.CIM cs = new DERMSInterface.CIM(_cim); try { // call SOAP function DERMSInterface.CIMData.DERStatus reply = cs.getDERGroupStatus(_group.Mrid, _q); // load screen with return values from call this.minValueText.Text = reply.PresentMinCapability.ToString(); this.currentValueText.Text = reply.PresentValue.ToString(); this.maxValueText.Text = reply.PresentMaxCapability.ToString(); this.MRIDReturnText.Text = reply.Mrid; this.quantityText.Text = _q.ToString(); logControl1.addEntry(LogControl.entryType.OK, "Message Sent...", cs.LastMessageSent); logControl1.addEntry(LogControl.entryType.OK, "Message Received...", cs.LastMessageReceived); } catch (Exception ex) { if (cs.LastMessageSent.Length > 0) { logControl1.addEntry(LogControl.entryType.OK, "Message Sent...", cs.LastMessageSent); } logControl1.addEntry(LogControl.entryType.FAIL, "Exception...", ex.ToString()); } }
/// <summary> /// call SOAP function get DER /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void getButton_Click(object sender, EventArgs e) { DERMSInterface.CIM cs = new DERMSInterface.CIM(_cim); try { // call SOAP Get DER string[] results = cs.requestDERGroupMembers(_group.Mrid); // takes list of DER members, add new lines and display to our result text box System.Text.StringBuilder buffer = new StringBuilder(); if (results != null) { foreach (string s in results) { buffer.Append(s + Environment.NewLine); } } this.resultText.Text = buffer.ToString(); logControl1.addEntry(LogControl.entryType.OK, "Message Sent...", cs.LastMessageSent); logControl1.addEntry(LogControl.entryType.OK, "Message Received...", cs.LastMessageReceived); } catch (Exception ex) { if (cs.LastMessageSent.Length > 0) { logControl1.addEntry(LogControl.entryType.OK, "Message Sent...", cs.LastMessageSent); } logControl1.addEntry(LogControl.entryType.FAIL, "Exception...", ex.ToString()); } }
public void TestMethod3() { DERMSInterface.CIM c = DERMSInterface.CIM.loadConfigFile("testConfig.xml"); DERMSInterface.CIMData.DERStatus status = c.getDERGroupStatus("1234-5678", DERMSInterface.quantity.RealPower); Console.WriteLine("xml : " + c.LastMessageSent + c.LastMessageReceived); Assert.IsTrue(c.LastMessageSent.Length > 100); Assert.IsTrue(c.LastMessageReceived.Length > 100); Assert.AreEqual(status.PresentValue, (float)11.1); }
public void TestMethod1() { DERMSInterface.CIM c = DERMSInterface.CIM.loadConfigFile("testConfig.xml"); int rc = c.createDERGroup("dergroup1", null); Console.WriteLine("xml : " + c.LastMessageSent + c.LastMessageReceived); Assert.IsTrue(c.LastMessageSent.Length > 100); Assert.IsTrue(c.LastMessageReceived.Length > 100); Assert.AreEqual(rc, 0); }
public void TestMethod2() { DERMSInterface.CIM c = DERMSInterface.CIM.loadConfigFile("testConfig.xml"); int rc = c.DispatchDERGroup("dergroup1", DERMSInterface.quantity.RealPower); Console.WriteLine("xml : " + c.LastMessageSent + c.LastMessageReceived); Assert.IsTrue(c.LastMessageSent.Length > 100); Assert.IsTrue(c.LastMessageReceived.Length > 100); Assert.AreEqual(rc, 0); }
public void TestMethod4() { DERMSInterface.CIM c = DERMSInterface.CIM.loadConfigFile("testConfig.xml"); String[] derms = c.requestDERGroupMembers("1234-5678"); Console.WriteLine("xml : " + c.LastMessageSent + c.LastMessageReceived); Assert.IsTrue(c.LastMessageSent.Length > 100); Assert.IsTrue(c.LastMessageReceived.Length > 100); Assert.IsNotNull(derms); Assert.AreEqual(derms.Length, 1); Assert.IsTrue(derms[0].Equals("name1")); }
public void TestMethod8() { String message = ""; DERMSInterface.CIM c = DERMSInterface.CIM.loadConfigFile("testConfig.xml"); String[] derms = DERMSInterface.CIM.requestDERGroupMembers("testConfig.xml", "1234-5678", ref message); Console.WriteLine("xml : " + message); Assert.IsTrue(message.Length > 100); Assert.IsNotNull(derms); Assert.AreEqual(derms.Length, 1); Assert.IsTrue(derms[0].Equals("name1")); }
/// <summary> /// call the SOAP dispatch method /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void dispatchButton_Click(object sender, EventArgs e) { DERMSInterface.CIM cs = new DERMSInterface.CIM(_cim); int rc = 1; try { // because we allow user to edit real/reactive values, we always force send it rc = cs.DispatchDERGroup(_group.Mrid, _q, true, dispatchValue); logControl1.addEntry(LogControl.entryType.OK, "Message Sent...", cs.LastMessageSent); logControl1.addEntry(LogControl.entryType.OK, "Message Received...", cs.LastMessageReceived); } catch (Exception ex) { if (cs.LastMessageSent.Length > 0) { logControl1.addEntry(LogControl.entryType.OK, "Message Sent...", cs.LastMessageSent); } logControl1.addEntry(LogControl.entryType.FAIL, "Exception...", ex.ToString()); } }
/// <summary> /// call the Create DER SOAP function /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void createButton_Click(object sender, EventArgs e) { DERMSInterface.CIM cs = new DERMSInterface.CIM(_cim); int rc = 1; DateTime now = DateTime.Now; try { // call the create DER SOAP method rc = cs.createDERGroup(_group.GroupName, null); logControl1.addEntry(now, LogControl.entryType.OK, "Message Sent...", cs.LastMessageSent); logControl1.addEntry(LogControl.entryType.OK, "Message Received...", cs.LastMessageReceived); } catch (Exception ex) { if (cs.LastMessageSent.Length > 0) { logControl1.addEntry(now, LogControl.entryType.OK, "Message Sent...", cs.LastMessageSent); } logControl1.addEntry(LogControl.entryType.FAIL, "Exception...", ex.ToString()); } }
/// <summary> /// call the Create DER SOAP function /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void createButton_Click(object sender, EventArgs e) { DERMSInterface.CIM cs = new DERMSInterface.CIM(_cim); int rc = 1; DateTime now = DateTime.Now; try { // call the create DER SOAP method rc = cs.createDERGroup(_group.GroupName, null); logControl1.addEntry(now, LogControl.entryType.OK, "Message Sent...", cs.LastMessageSent); logControl1.addEntry(LogControl.entryType.OK, "Message Received...", cs.LastMessageReceived); } catch (Exception ex) { if (cs.LastMessageSent.Length > 0) logControl1.addEntry(now, LogControl.entryType.OK, "Message Sent...", cs.LastMessageSent); logControl1.addEntry(LogControl.entryType.FAIL, "Exception...", ex.ToString()); } }
/// <summary> /// call SOAP function get DER /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void getButton_Click(object sender, EventArgs e) { DERMSInterface.CIM cs = new DERMSInterface.CIM(_cim); try { // call SOAP Get DER string[] results = cs.requestDERGroupMembers(_group.Mrid); // takes list of DER members, add new lines and display to our result text box System.Text.StringBuilder buffer = new StringBuilder(); if (results != null) { foreach (string s in results) buffer.Append(s + Environment.NewLine); } this.resultText.Text = buffer.ToString(); logControl1.addEntry(LogControl.entryType.OK, "Message Sent...", cs.LastMessageSent); logControl1.addEntry(LogControl.entryType.OK, "Message Received...", cs.LastMessageReceived); } catch (Exception ex) { if (cs.LastMessageSent.Length > 0) logControl1.addEntry(LogControl.entryType.OK, "Message Sent...", cs.LastMessageSent); logControl1.addEntry(LogControl.entryType.FAIL, "Exception...", ex.ToString()); } }
/// <summary> /// call the SOAP dispatch method /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void dispatchButton_Click(object sender, EventArgs e) { DERMSInterface.CIM cs = new DERMSInterface.CIM(_cim); int rc = 1; try { // because we allow user to edit real/reactive values, we always force send it rc = cs.DispatchDERGroup(_group.Mrid, _q, true, dispatchValue); logControl1.addEntry(LogControl.entryType.OK, "Message Sent...", cs.LastMessageSent); logControl1.addEntry(LogControl.entryType.OK, "Message Received...", cs.LastMessageReceived); } catch (Exception ex) { if (cs.LastMessageSent.Length > 0) logControl1.addEntry(LogControl.entryType.OK, "Message Sent...", cs.LastMessageSent); logControl1.addEntry(LogControl.entryType.FAIL, "Exception...", ex.ToString()); } }
/// <summary> /// execute the get der status SOAP call /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void getButton_Click(object sender, EventArgs e) { DERMSInterface.CIM cs = new DERMSInterface.CIM(_cim); try { // call SOAP function DERMSInterface.CIMData.DERStatus reply = cs.getDERGroupStatus(_group.Mrid, _q); // load screen with return values from call this.minValueText.Text = reply.PresentMinCapability.ToString(); this.currentValueText.Text = reply.PresentValue.ToString(); this.maxValueText.Text = reply.PresentMaxCapability.ToString(); this.MRIDReturnText.Text = reply.Mrid; this.quantityText.Text = _q.ToString(); logControl1.addEntry(LogControl.entryType.OK, "Message Sent...", cs.LastMessageSent); logControl1.addEntry(LogControl.entryType.OK, "Message Received...", cs.LastMessageReceived); } catch (Exception ex) { if (cs.LastMessageSent.Length > 0) logControl1.addEntry(LogControl.entryType.OK, "Message Sent...", cs.LastMessageSent); logControl1.addEntry(LogControl.entryType.FAIL, "Exception...", ex.ToString()); } }