aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/Tango.UnitTesting/AdvancedInstaller/DemoProject/Files/File3.txt
blob: 7dd5c2097a134cb7402b3398dbba947ce351d98b (plain)
1
File3
hlight .mo { color: #0000DD; font-weight: bold } /* Literal.Number.Oct */ .highlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */ .highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */ .highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */ .highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */ .highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */ .highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
using System.Text;
using System.Linq;
using System.Drawing;
using System.Diagnostics;
using System.Windows.Forms;
using System.Threading;
using System.Threading.Tasks;
using System.Collections.Generic;
using Tango.PMR.Debugging;
using Tango.PMR.Stubs;
using Tango.PMR.Hardware;
using Tango.Stubs.UI;

public void OnExecute(StubManager stubManager)
{
/*    for (int i = 0; i < 10; i++)
    {
        var response = stubManager.Run<CalculateResponse>("calculate", 10, 5);
        
        if (response.Sum == 15)
        {
            stubManager.WriteLine("OK!");
        }
    }
    */
   
// Request ----
// Double : DryerZone1Temp
// Double : DryerZone2Temp
// RepeatedField`1 : HardwarePidControl
// RepeatedField`1 : ProcessParameters

// Response ----
// UInt32 : HeaterGroupId
// UInt32 : Zone1Temp
// UInt32 : Zone2Temp
// Boolean : Heater1Active
// Boolean : Heater2Active
// UInt32 : Heater1Percentage
// UInt32 : Heater2Percentage
  HardwarePidControl Pid1 = new HardwarePidControl();
  HardwarePidControl Pid2 = new HardwarePidControl();
//Pid1.has_hardwarepidcontroltype = true;
Pid1.HardwarePidControlType = (HardwarePidControlType)3;
  // Pid1.has_outputproportionalpowerlimit = true;
   Pid1.OutputProportionalPowerLimit = 50;
  // Pid1.has_outputproportionalband = true;
   Pid1.OutputProportionalBand = 3;
  // Pid1.has_kp = true;
  Pid1.SensorCorrectionAdjustment = 2.0;
  //Pid1.has_ki = true;
  Pid1.IntegralTime = 0.01;
  
  //Pid2.has_hardwarepidcontroltype = true;
Pid2.HardwarePidControlType = (HardwarePidControlType)4;
  // Pid2.has_outputproportionalpowerlimit = true;
   Pid2.OutputProportionalPowerLimit = 40;
  // Pid2.has_outputproportionalband = true;
   Pid2.OutputProportionalBand = 2;
  // Pid2.has_kp = true;
  Pid2.SensorCorrectionAdjustment = 0.5;
  //Pid2.has_ki = true;
  Pid2.IntegralTime = 0.1;

var response = stubManager.Run<StubHeatingTestResponse>("StubHeatingTestRequest" ,100.0, 100.0, Pid1, Pid2);	
Pid1.HardwarePidControlType = (HardwarePidControlType)5;
Pid2.HardwarePidControlType = (HardwarePidControlType)6;

 response = stubManager.Run<StubHeatingTestResponse>("StubHeatingTestRequest" ,100.0, 100.0, Pid1, Pid2);	

int i=0;
		// Request ----

// Response ----
// UInt32 : HeaterGroupId
// UInt32 : Zone1Temp
// UInt32 : Zone2Temp
// Boolean : Heater1Active
// Boolean : Heater2Active
// UInt32 : Heater1Percentage
// UInt32 : Heater2Percentage
//StubHeatingTestPollResponse response1;
stubManager.RunContinuous<StubHeatingTestPollResponse>("StubHeatingTestPollRequest",(response1) => 
                                                   {                                                   	
				stubManager.WriteLine (String.Format("Temperature, {0}, State {1}, Init {2}, Id {3}, Actual {4}, Alloc {5}, Err {6} {7}",++i,response1.Heater1Active,response1.Heater2Active,response1.Zone1Temp,response1.Zone2Temp,response1.Heater1Percentage,response1.Heater2Percentage, response1.InfoMessage));
                                                   	
                                                   },0);
/*stubManager.RunContinuous<DebugLogResponse>("DebugLogRequest",(response2) => 
                                                   {                                                   	
				stubManager.WriteLine (String.Format("Report, {0}, {1}, {2}",response2.FileName,response2.LineNumber,response2.Message));
                                                   	
                                                   },0);
                                                   
 */                                                  
		
		
}