Exemplo n.º 1
0
 public GlideGauge()
     : base(Constants.WINDOW_ID_GAUGE_GLIDE, SKIN, SCALE)
 {
     this.DmeDisplay           = new DigitalDisplay(this);
     this.yellowNeedle         = new Needle(this, NEEDLE_YELLOW);
     this.yellowNeedle.enabled = true;
 }
Exemplo n.º 2
0
 public ThrottleGauge(EngineInspecteur inspector)
     : base(Constants.WINDOW_ID_GAUGE_THROTTLE, SKIN, SCALE, true, 0.001f)
 {
     this.inspector           = inspector;
     this.throttleDisplay     = new DigitalDisplay(this, 3, false);
     this.innerposition.x     = 0;
     this.innerposition.width = 1.0f;
 }
Exemplo n.º 3
0
 public DskyGauge(VesselInspecteur vesselInspecteur, ResourceInspecteur resourceInspecteur)
     : base(Constants.WINDOW_ID_GAUGE_DSKY)
 {
     this.vesselInspecteur   = vesselInspecteur;
     this.resourceInspecteur = resourceInspecteur;
     this.digital1           = new DigitalDisplay(this, DIGITS);
     this.digital2           = new DigitalDisplay(this, DIGITS);
     this.digital3           = new DigitalDisplay(this, DIGITS);
     CreateButtons();
 }
            public HorizontalDigitalGauge(int id, Texture2D skin, Texture2D back = null)
                : base(id)
            {
                this.skin = skin;
                this.back = back == null?Utils.GetTexture("Nereid/NanoGauges/Resource/DIGIT-background") : back;

                this.skinBounds = new Rect(0, 0, GetWidth(), GetHeight());
                this.display    = new DigitalDisplay(this, MAX_DIGITS, true);
                double scale       = NanoGauges.configuration.gaugeScaling;
                float  margin_vert = (float)(MARGIN_VERTICAL * scale);
                float  margin_hori = (float)(MARGIN_HORIZONTAL * scale);

                this.textBounds = new Rect(margin_hori, margin_vert, GetWidth() - 2 * margin_hori, GetHeight() - margin_vert);
                //
                if (back == null)
                {
                    Log.Error("no background for gauge " + id + " defined");
                }
                if (skin == null)
                {
                    Log.Error("no skin for gauge " + id + " defined");
                }
            }
Exemplo n.º 5
0
 private static Boolean KawigiEdit_RunTest(int testNum, string p0, Boolean hasAnswer, int p1)
 {
     Console.Write("Test " + testNum + ": [" + "\"" + p0 + "\"");
     Console.WriteLine("]");
     DigitalDisplay obj;
     int answer;
     obj = new DigitalDisplay();
     DateTime startTime = DateTime.Now;
     answer = obj.waysToInterpret(p0);
     DateTime endTime = DateTime.Now;
     Boolean res;
     res = true;
     Console.WriteLine("Time: " + (endTime - startTime).TotalSeconds + " seconds");
     if (hasAnswer) {
         Console.WriteLine("Desired answer:");
         Console.WriteLine("\t" + p1);
     }
     Console.WriteLine("Your answer:");
     Console.WriteLine("\t" + answer);
     if (hasAnswer) {
         res = answer == p1;
     }
     if (!res) {
         Console.WriteLine("DOESN'T MATCH!!!!");
     } else if ((endTime - startTime).TotalSeconds >= 2) {
         Console.WriteLine("FAIL the timeout");
         res = false;
     } else if (hasAnswer) {
         Console.WriteLine("Match :-)");
     } else {
         Console.WriteLine("OK, but is it right?");
     }
     Console.WriteLine("");
     return res;
 }