X-Git-Url: http://git.osdn.jp/view?a=blobdiff_plain;f=test4%2FPsychlopsMain.cs;h=d33eb149eaadea2591768e58401599d13073bbfe;hb=8d02b5d184f6209f65920c2e63bba907e2221f75;hp=adff3c46711f8c88be9a87eeda48913cef4e2158;hpb=bf316c025ef4a9eb346bcedbcf37dd18ed04c6f4;p=psychlops%2Fsilverlight.git diff --git a/test4/PsychlopsMain.cs b/test4/PsychlopsMain.cs index adff3c4..d33eb14 100644 --- a/test4/PsychlopsMain.cs +++ b/test4/PsychlopsMain.cs @@ -6,9 +6,8 @@ namespace PsychlopsSilverlight4test public class PsychlopsMain { - Canvas cnvs; + Psychlops.Canvas cnvs; int i; - object xxx; double x, y, z, t, p, temp, xx, yy; //Set Target Initial Value @@ -16,30 +15,11 @@ namespace PsychlopsSilverlight4test //Set Background Initial Value double DotNumber = 50, thetaSpeed = 3.0, Axis = 0.0, BGRadii = 150, BGSize = 5.0; - Psychlops.Widgets.Slider DotNumberS; public void psychlops_main() { - //DotNumberS = new Psychlops.Widgets.Slider("test", new Interval(10, 500)); - //Independent ind = new Independent(); - cnvs = new Canvas(500, 500); - Image img = new Image(100, 100); - img.field(delegate(int x, int y) { return new Color(0.5 + 0.5 * Math.sin(x + y)); }); - Image img2 = new Image(100, 100); - img2.field(delegate(int x, int y) { return new Color(0.5 + 0.5 * Math.sin(x + y)); }); - /* - for (int x = 0; x < 20; x++) - { - for (int y = 0; y < 20; y++) - { -// img.pix(x, y, new Color(Math.sin(x + y))); - } - } - * */ - - //Declare background dots and target Rectangle[] BGDot = new Rectangle[2048]; for(int i=0; i<2048; i++){ @@ -76,7 +56,7 @@ namespace PsychlopsSilverlight4test for(int i=0; i<10; i++)Target[i].set(TargetSize, TargetSize); double COS, SIN; - DotNumber = 100; + DotNumber = 200; //Main stimulus loop while(true){ //Clear the main window @@ -106,25 +86,21 @@ namespace PsychlopsSilverlight4test //Set Dotsize and Draw them BGDot[i].set(BGSize, BGSize); BGDot[i].centering().shift(xx,yy); - BGDot[i].draw( Color.blue); + BGDot[i].draw( Color.blue ); } //Calculate positions of targets and set them temp=Rotate*2*Math.PI/360.0; - cnvs.msg(TargetNumber.ToString(), 0, 30); for (int i = 0; i < 5; i++) { - cnvs.msg(i.ToString(), 50+50*i, 30); t = 2.0 * Math.PI/TargetNumber; - x = 10.0 * i;//TargetEcce*Math.cos(i*t+temp); - y = 10.0 * i;//TargetEcce*Math.sin(i*t+temp); + x = TargetEcce*Math.cos(i*t+temp); + y = TargetEcce*Math.sin(i*t+temp); Target[i].centering().shift(x,y); Target[i].fill = Color.yellow; Target[i].draw(); } - img.centering().draw(); - img2.centering().draw(); //Reflect drawing at the next frame; cnvs.flip(); } @@ -133,7 +109,6 @@ namespace PsychlopsSilverlight4test } - /* using Psychlops; @@ -183,9 +158,8 @@ namespace PsychlopsSilverlight4test */ -/* - +/* using Psychlops; namespace Psychlops @@ -262,7 +236,7 @@ namespace PsychlopsSilverlight4test //Figures.drawGabor(ref img, 20, 100, 1, 0, frames * 2.0 * Math.PI / tfreq / 60); //Figures.drawGaussian(ref img, 20, 1); - Figures.drawGrating(ref img, 30, 30, 20, 1, 2, frames * 2.0 * Math.PI / tfreq / 60); + Figures.drawGrating(ref img, 200, 200, 20, 1, 2, frames * 2.0 * Math.PI / tfreq / 60); img.centering(Mouse.position); img.draw(); @@ -270,7 +244,7 @@ namespace PsychlopsSilverlight4test shape.draw(); if (Keyboard.spc.pressed()) cnvs.var(Mouse.x, 100, 100); - cnvs.var(frames, 20, 20); + cnvs.var(frames, 0, 20); slider.value = frames / 100.0; fixation.shift(100, 100); @@ -288,7 +262,4 @@ namespace PsychlopsSilverlight4test } } - * - * */ - - +*/