aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Properties/Settings.settings
blob: 033d7a5e9e2266753180f4e3a9299f575046701e (plain)
1
2
3
4
5
6
7
<?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="uri:settings" CurrentProfile="(Default)">
  <Profiles>
    <Profile Name="(Default)" />
  </Profiles>
  <Settings />
</SettingsFile>
f0f0 } /* 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;
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.Stubs;
using Tango.Stubs;

public void OnExecute(StubManager stubManager)
{

//stubManager.Run("StubMotorStopRequest" ,22, 1); // 0 - SoftHiZ / 1 - HardHiZ  / 2 - SoftStop / 3 - HardStop
//Thread.Sleep(1000);

// Request ----
// UInt32 : MotorID
// UInt32 : MicroSteps
// Boolean : SetMicroSteps
// UInt32 : ACC
// Boolean : SetACC
// UInt32 : DEC
// Boolean : SetDec
// UInt32 : MaxSpeed
// Boolean : SetMaxSpeed

	//stubManager.Run<StubMotorInitResponse>("StubMotorInitRequest" ,22, 1, true, 0x0ff, true, 0x0ff, true, 0x3ff, true);	// 0x3ff for QSH2818-32-07-006 roker
	//stubManager.Run<StubMotorInitResponse>("StubMotorInitRequest" ,21, 0, true, 0x0ff, true, 0x0ff, true, 50000, true);	// fidder
	//stubManager.Run<StubMotorInitResponse>("StubMotorInitRequest" ,0, 0, true, 0, true, 0, true, 0, true);
	
	// Request ----
// UInt32 : MotorID
// UInt32 : MicroSteps
// Boolean : SetMicroSteps
// UInt32 : ACC
// Boolean : SetACC
// UInt32 : DEC
// Boolean : SetDec
// UInt32 : MaxSpeed
// Boolean : SetMaxSpeed
// UInt32 : MinSpeedLSPDOPT
// Boolean : SetMinSpeedLSPDOPT
// UInt32 : Config
// UInt32 : KVALHOLD
// UInt32 : KVALRUN
// UInt32 : KVALACC
// UInt32 : KVALDEC
// UInt32 : STSLP
// UInt32 : INTSPD
// UInt32 : FNSLPACC
// UInt32 : FNSLPDEC

// Response ----
// UInt32 : MotorID
// UInt32 : Status

	
	//stubManager.Run<StubMotorInitResponse>("StubMotorInitRequest" ,18, 0, true, 0x0ff, true, 0x0ff, true, 50000, true, 0, true, 1, 1, 1, 1, 1, 1, 1, 1, 1);
	
	//stubManager.Run("StubMotorStopRequest" ,18, 1); // 0 - SoftHiZ / 1 - HardHiZ  / 2 - SoftStop / 3 - HardStop
	
	//Thread.Sleep(1000);
	
	for (int i= 0 ;i<10;i++)
		{
	stubManager.Run("StubMotorRunRequest" ,14, false, 8000 ); //5000 fidder (18 TESTED)
	Thread.Sleep(590);
	var response = stubManager.Run<StubMotorSpeedResponse>("StubMotorSpeedRequest" ,14);
	stubManager.Write(response.Speed);
		stubManager.Write("\n\n");

	Thread.Sleep(10);
	
	stubManager.Run("StubMotorRunRequest" ,14, true, 8000 ); //5000 fidder (18 TESTED)
	Thread.Sleep(600);
	}
	//stubManager.Run<StubMotorStatusResponse>("StubMotorStatusRequest" ,15, true);
	
	//Thread.Sleep(1000);
	// Request ----
// UInt32 : MotorID

// Response ----
// UInt32 : MotorID
// Double : Speed
	//stubManager.Run<StubMotorSpeedResponse>("StubMotorSpeedRequest" ,15);
	
stubManager.Run("StubMotorStopRequest" ,14, 2); // 3 - SoftHiZ / 2 - HardHiZ  / 1 - SoftStop / 0 - HardStop
}