private async Task <int> Run(Options options) { try { using (var ledDriver = LedDriver.Create()) { var displayDriver = new DisplayDriver(ledDriver); Task task; if (options.StringValue != null) { if (options.ForceScroll || DisplayFrame.GetDisplayedStringLength(options.StringValue) > 3) { task = displayDriver.ScrollString(options.StringValue, options.Duration); } else { displayDriver.WriteString(options.StringValue); task = Task.Delay(options.Duration); } } else if (options.DecimalValue != null) { displayDriver.WriteFrame(DisplayFrame.FromDecimal(options.DecimalValue.Value, StatusLed.Blue)); task = Task.Delay(options.Duration); } else if (options.BusyDelay != null) { task = displayDriver.BusyLoop(options.BusyDelay.Value, options.Duration); } else if (options.RawValue != null) { for (int i = 0; i < 32; i++) { bool bit = ((options.RawValue.Value << i) & 0x80000000u) != 0u; ledDriver.WriteBit(bit); } ledDriver.Latch(); task = Task.Delay(options.Duration); } else { Console.WriteLine("No option selected."); return(-1); } await task; displayDriver.Clear(); } return(0); } catch (Exception ex) { Console.WriteLine($"Error: {ex}"); return(-1); } }
protected override void BeforeRun() { DisplayDriver display = new DisplayDriver(); display.init(); Console.WriteLine("Welcome to the MEH OS 0.1, built on the COSMOS kernel"); Console.WriteLine("WARNING; This OS is PRE-ALPHA, and not a substitute for your main OS"); Console.WriteLine("We are not responsible if you lose your data"); }
public MainWindow() { InitializeComponent(); IDisplayDriver displayDriver = new DisplayDriver(this, myCanvas); IInputDriver inputDriver = new InputDriver(this); myGame = new DummyGame(displayDriver, inputDriver); }
protected override void BeforeRun() { //This function is called before COSMOS starts //Console.WriteLine("Cosmos booted sucessfully, now starting Kernel"); display = new BufferedDisplayDriver(); PrintDebug("After display create"); display.init(); PrintDebug("After display init"); mouse = new MouseDriver(display.getHeight(), display.getWidth()); mr = new MouseRenderer(mouse, display, 2); }
public WindowManager(DisplayDriver dd, Desktop desk, FontRenderer fr) { display = dd; desktop = desk; fontRenderer = fr; sX = 10; sY = 10; eX = display.getWidth() - 10; eY = display.getHeight() - 10; backGroundWindows = new Window[0]; }
public void mainrunbypass() { //////////////////////////////////////////////////////////////////////////////////////////////////////// Console.WriteLine("main os...... build 12.3"); display = new DisplayDriver(); display.init(); ////////////////////////////////////////////// //draw mouse display.draw_mouse(); /////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////////////// }
public FontRenderer(DisplayDriver dd, Font f, int sc = 2) { driver = dd; font = f; stdColor = sc; }
public IconRenderer(DisplayDriver dd, IconPack ip) { driver = dd; iconPack = ip; }
public MouseRenderer(MouseDriver m, DisplayDriver d, int c = 2) { mouse = m; display = d; color = c; }
public PictureManger(DisplayDriver dd, Picture f) { driver = dd; Picture = f; }
public Desktop(DisplayDriver d) { display = d; }