liuhuan@MIT/Build-It-Yourself

Code Block

* generating manifest: D:\0907biy\vpltest\cs_sev_2\cs_sev_2.manifest.xml
* Loading Program: file:///C:/Microsoft Robotics Studio (1.5)/f2c74c43-c6b1-483b-8fbe-b516fcecd236/cs_sev_2.program.xml
* Starting internal DSS Node on ports 50000 and 50001...
* Finding Proxy assemblies for partners...
* http://schemas.microsoft.com/robotics/2006/08/timer.html
* Utility.Y2006.M08.Proxy, Version=1.5.507.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
* http://schemas.microsoft.com/robotics/2006/08/dialog.html
* Utility.Y2006.M08.Proxy, Version=1.5.507.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
* http://schemas.microsoft.com/robotics/2006/01/rcx20AnalogSensor.html
* Rcx20.Y2006.M01.Proxy, Version=1.5.507.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
* Processing Activities...
* Activity: program.activity
* A user defined activity.
* Processing Handlers...
* Handler: program.activity.Start.__use__2.subscribe
* Handler: program.activity.Start+start
* Handler: program.activity.Action
* Creating file: D:\0907biy\vpltest\cs_sev_2\DiagramTypes.cs
* Creating file: D:\0907biy\vpltest\cs_sev_2\DiagramService.cs
* Compiling Assembly...
* Compiling...
*** C:\Microsoft Robotics Studio (1.5)> "C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\csc.exe" /t:library /utf8output /R:"System.dll" /R:"System.Xml.dll" /R:"System.Drawing.dll" /R:"C:\Microsoft Robotics Studio (1.5)\bin\ccr.core.dll" /R:"C:\Microsoft Robotics Studio (1.5)\bin\dssbase.dll" /R:"C:\Microsoft Robotics Studio (1.5)\bin\dssruntime.dll" /R:"C:/Microsoft Robotics Studio (1.5)/bin/Rcx20.Y2006.M01.Proxy.DLL" /R:"C:/Microsoft Robotics Studio (1.5)/bin/Utility.Y2006.M08.Proxy.DLL" /out:"D:\0907biy\vpltest\cs_sev_2\bin\cs_sev_2.Y2007.M10.dll" /D:DEBUG /debug+ /optimize- /warnaserror /w:4 /keyfile:"C:/Microsoft Robotics Studio (1.5)/samples/mrisamples.snk" "D:\0907biy\vpltest\cs_sev_2\DiagramService.cs" "D:\0907biy\vpltest\cs_sev_2\DiagramTypes.cs"
***
***
*** Microsoft (R) Visual C# 2005 Compiler version 8.00.50727.42
* Creating project file...
*** for Microsoft (R) Windows (R) 2005 Framework version 2.0.50727
*** Copyright (C) Microsoft Corporation 2001-2005. All rights reserved.
***
*** d:\0907biy\vpltest\cs_sev_2\DiagramService.cs(310,21): error CS0019: Operator '==' cannot be applied to operands of type 'Robotics.cs_sev_2.Diagram.DiagramState' and 'int'
*** d:\0907biy\vpltest\cs_sev_2\DiagramService.cs(316,26): error CS0019: Operator '==' cannot be applied to operands of type 'Robotics.cs_sev_2.Diagram.DiagramState' and 'int'
*** Compilation Failed!
*** Failed!


I got this error when I was trying to compile a diagram. Where can I find the DiagramState type variable There's no place in my program using '==' either.

update:
1. The diagram runs without any problem.
2. There's a switch in the diagram, if I delete it, the diagram compiles.



Re: Microsoft Robotics - Visual Programming Language VPL compile error CS0019

liuhuan@MIT/Build-It-Yourself

Problem solved!
http://web.mit.edu/liuhuan/Public/BIY/msrs/rcx-coinsensor-servicetest/cs_sev_1_0.jpg
Code Block

public IEnumerator<ccr.ITask> RunHandler()
{
Increment();



base.StateChanged = true;

DiagramState a = new DiagramState();
State.sport = 0;
a.sport = State.sport;

if (a == 1)
{
rcx20AnalogSensor.InitRequest request = new rcx20AnalogSensor.InitRequest();
request.s2 = (rcx20AnalogSensor.Rcx20SensorType)rcx20AnalogSensor.Rcx20SensorType.Light;
RCXAnalogSensorPort.SensorInit(request);
}
else if (a == 2)
{
rcx20AnalogSensor.InitRequest requestA = new rcx20AnalogSensor.InitRequest();
requestA.s3 = (rcx20AnalogSensor.Rcx20SensorType)rcx20AnalogSensor.Rcx20SensorType.Light;
RCXAnalogSensorPort.SensorInit(requestA);
}
else
{
rcx20AnalogSensor.InitRequest requestB = new rcx20AnalogSensor.InitRequest();
requestB.s1 = (rcx20AnalogSensor.Rcx20SensorType)rcx20AnalogSensor.Rcx20SensorType.Light;
RCXAnalogSensorPort.SensorInit(requestB);
}

Decrement();

yield return WaitUntilComplete();
}
}


http://web.mit.edu/liuhuan/Public/BIY/msrs/rcx-coinsensor-servicetest/cs_sev_1_1.jpg
Code Block

public IEnumerator<ccr.ITask> RunHandler()
{
Increment();



base.StateChanged = true;

DiagramState a = new DiagramState();
State.sport = 0;
a.sport = State.sport;

if (a.sport == 1)
{
rcx20AnalogSensor.InitRequest request = new rcx20AnalogSensor.InitRequest();
request.s2 = (rcx20AnalogSensor.Rcx20SensorType)rcx20AnalogSensor.Rcx20SensorType.Light;
RCXAnalogSensorPort.SensorInit(request);
}
else if (a.sport == 2)
{
rcx20AnalogSensor.InitRequest requestA = new rcx20AnalogSensor.InitRequest();
requestA.s3 = (rcx20AnalogSensor.Rcx20SensorType)rcx20AnalogSensor.Rcx20SensorType.Light;
RCXAnalogSensorPort.SensorInit(requestA);
}
else
{
rcx20AnalogSensor.InitRequest requestB = new rcx20AnalogSensor.InitRequest();
requestB.s1 = (rcx20AnalogSensor.Rcx20SensorType)rcx20AnalogSensor.Rcx20SensorType.Light;
RCXAnalogSensorPort.SensorInit(requestB);
}

Decrement();

yield return WaitUntilComplete();
}
}