public PageActions()
 {
     InitializeComponent();
     _baseLayer = new BaseLayer();
     _eventsDependingActionListViewModel = new EventsDependingActionListViewModel(_baseLayer);
     ErrorCount.Reset();
 }
Example #2
0
        /// <summary>
        /// Called on each bar update event (incoming tick)
        /// </summary>
        protected override void OnBarUpdate()
        {
            /// ensure bar has EmProps
            if (props is IEmProps)
            {
                /// get EmProps for the specified bar, matching on OHLCVT
                EmProps barProps = props.GetEmProps(Open[0], High[0], Low[0], Close[0], (long)Volume[0], Time[0]) as EmProps;

                /// ensure EmProps exist for given bar (note: some historical data may not be available)
                if (barProps == null)
                {
                    return;
                }

                /// update plots
                Surge.Set(barProps.Surge);
                Tide.Set(barProps.Tide);
                ErrorCount.Set(barProps.ErrorCount);
                ErrorVolume.Set(barProps.ErrorVolume);

                /// update average
                TideAvg.Set(EmMath.EMA((double)barProps.Tide, CurrentBar, smooth, CurrentBar == 0 ? Tide[0] : TideAvg[1]));
            }
            else
            {
                /// generate log message one time
                if (!invalid)
                {
                    Log(String.Format("{0} does not implement interface IEmProps", Bars.BarsType.ToString()), LogLevel.Warning);
                    invalid = true;
                }
            }
        }
 public PageActions(BaseLayer baseLayer)
 {
     InitializeComponent();
     _baseLayer = baseLayer;
     BindElements();
     ErrorCount.Reset();
 }
 public PageActions(BaseLayer baseLayer, EventsDependingActionListViewModel eventsDependingActionListViewModel)
 {
     InitializeComponent();
     _baseLayer = baseLayer;
     _eventsDependingActionListViewModel = eventsDependingActionListViewModel;
     BindElements();
     ErrorCount.Reset();
 }
Example #5
0
 /// <summary>
 /// Returns a hash code for this instance.
 /// </summary>
 /// <returns>A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table.</returns>
 public override int GetHashCode()
 {
     return
         (ErrorCount.GetHashCode()
          ^ WarningCount.GetHashCode()
          ^ InfoCount.GetHashCode()
         );
 }
 public PageActions(BaseLayer baseLayer, Preferences preferences, Model model)
 {
     InitializeComponent();
     _baseLayer = baseLayer;
     _preferences = preferences;
     _model = model;
     BindElements();
     ErrorCount.Reset();
 }
Example #7
0
 public PageEvents(BaseLayer baseLayer, Preferences preferences)
 {
     InitializeComponent();
     _baseLayer   = baseLayer;
     _preferences = preferences;
     _model       = new Model(_baseLayer, _preferences);
     BindElements();
     ErrorCount.Reset();
 }
Example #8
0
        public virtual string GetDataRow()
        {
            return(String.Join(",", new[]
            {
                FullTimeMode?Time.ToString() : Time.TotalSeconds.ToString(CultureInfo.InvariantCulture),
                    TRT.ToString(),
                    RPM.ToString(),
                    RPM40.ToString(),
                    RPM_GBC_RT.ToString(),
                    UFRXX.ToString(),
                    SSM.ToString(),
                    TWAT.ToString(),
                    TAIR.ToString(),
                    ALF.ToString("0.#", CultureInfo.InvariantCulture),
                    AFR.ToString("0.#", CultureInfo.InvariantCulture),
                    LC1_ALF.ToString("0.###", CultureInfo.InvariantCulture),
                    LC1_AFR.ToString("0.#", CultureInfo.InvariantCulture),
                    COEFF.ToString("0.###", CultureInfo.InvariantCulture),
                    DGTC_RICH.ToString("0.###", CultureInfo.InvariantCulture),
                    DGTC_LEAN.ToString("0.###", CultureInfo.InvariantCulture),
                    UOZ.ToString("0.#", CultureInfo.InvariantCulture),
                    KUOZ1.ToString("0.#", CultureInfo.InvariantCulture),
                    KUOZ2.ToString("0.#", CultureInfo.InvariantCulture),
                    KUOZ3.ToString("0.#", CultureInfo.InvariantCulture),
                    KUOZ4.ToString("0.#", CultureInfo.InvariantCulture),
                    Faza.ToString(),
                    INJ.ToString("0.###", CultureInfo.InvariantCulture),
                    FUSE.ToString("0.#", CultureInfo.InvariantCulture),
                    AIR.ToString("0.#", CultureInfo.InvariantCulture),
                    GBC.ToString("0.##", CultureInfo.InvariantCulture),
                    SPD.ToString(),
                    ADCKNOCK.ToString("0.###", CultureInfo.InvariantCulture),
                    ADCMAF.ToString("0.###", CultureInfo.InvariantCulture),
                    ADCTWAT.ToString("0.###", CultureInfo.InvariantCulture),
                    ADCTAIR.ToString("0.###", CultureInfo.InvariantCulture),
                    ADCTPS.ToString("0.###", CultureInfo.InvariantCulture),
                    ADCUBAT.ToString("0.###", CultureInfo.InvariantCulture),
                    ADCLAM.ToString("0.###", CultureInfo.InvariantCulture),
                    ErrorCount.ToString(),
                    fSTOP ? "1" : "0",
                    fXX ? "1" : "0",
                    fXXPrev ? "1" : "0",
                    fXXFix ? "1" : "0",
                    fPOW ? "1" : "0",
                    fFUELOFF ? "1" : "0",
                    fDETZONE ? "1" : "0",
                    fDET ? "1" : "0",
                    fADS ? "1" : "0",
                    fLAMREG ? "1" : "0",
                    fLAM ? "1" : "0",
                    fLEARN ? "1" : "0",
                    fLAMRDY ? "1" : "0",
                    fLAMHEAT ? "1" : "0"
            }

                               ));
        }
Example #9
0
 private string ErrorsDescription()
 {
     if (ErrorCount == 1)
     {
         return(ErrorCount.ToString() + " Error");
     }
     else if (ErrorCount == 0)
     {
         return("No Errors");
     }
     else
     {
         return(ErrorCount.ToString() + " Errors");
     }
 }
Example #10
0
 /// <summary>
 /// Update the database
 /// </summary>
 /// <param name="db"></param>
 public void FixData(DbHelper db)
 {
     if (ErrorCount.GetValueOrDefault() > 0)
     {
         try
         {
             db.ExecuteSQL(String.Format("update {0} set {1}=null where {1} is not null and {1} not in (select {2} from {3} where {2} is not null)",
                                         _parentTable, _parentField, _childField, _childTable));
         }
         catch (Exception x)
         {
             Error = x.Message;
         }
     }
     UpdateCount(db);
 }
Example #11
0
 public string[] ToJQueryDataTableResult()
 {
     return(new [] {
         CreatedOn.ToString("g"),
         CreatedBy,
         VehicleDescription,
         OriginalFileName,
         ImportStatus.Status,
         ImportQueueId.ToString(),
         HasErrors ? "YES" : "NO",
         ErrorCount.ToString(),
         GetErrorTypeAbbreviation(ErrorType),
         GetErrorTypeAbbreviation(ErrorSubType),
         Uploaded ? "YES" : "NO"
     });
 }
        private void UpdateStatus()
        {
            // Update the checks so far.
            hcc.Update();

            // Update the status labels to the right.
            txtConnectionAttempt.Text = String.Format("{0}/{1}", hcc.RequestsMade, hcc.MaxRequests);
            txtHeimdallsAcquired.Text = String.Format("{0}/{1}", hcc.HeimdallsScanned, hcc.HeimdallAmount);
            txtErrors.Text            = ErrorCount.ToString();

            // Update the list itself.
            HeimdallCheckController.HeimdallStatus heimStatus;
            for (int heim = 1; heim <= hcc.HeimdallAmount; heim++)
            {
                heimStatus = hcc.GetHeimdallStatus(heim);
                SetHeimdallStatus(heim, heimStatus);
            }
        }
Example #13
0
        /// <summary>
        /// Called on each bar update event (incoming tick)
        /// </summary>
        protected override void OnBarUpdate()
        {
            /// ensure bar has EmProps
            if (props is IEmProps)
            {
                /// get EmProps for the specified bar, matching on OHLCVT
                EmProps barProps = props.GetEmProps(Open[0], High[0], Low[0], Close[0], (long)Volume[0], Time[0]) as EmProps;

                /// ensure EmProps exist for given bar (note: some historical data may not be available)
                if (barProps == null)
                {
                    return;
                }

                /// update plots
                BearCount.Set(-barProps.BearCount);
                BearVolume.Set(-barProps.BearVolume);
                BullCount.Set(barProps.BullCount);
                BullVolume.Set(barProps.BullVolume);
                ErrorCount.Set(barProps.ErrorCount);
                ErrorVolume.Set(barProps.ErrorVolume);

                /// draw shading
                if (CurrentBar > 0)
                {
                    DrawRegion("EmVolume_Bull_" + CurrentBar.ToString(), 1, 0, BullVolume, BullCount, Color.Transparent, BullColor, BullOpacity);
                    DrawRegion("EmVolume_Bear_" + CurrentBar.ToString(), 1, 0, BearVolume, BearCount, Color.Transparent, BearColor, BearOpacity);
                    DrawRegion("EmVolume_Zero_" + CurrentBar.ToString(), 1, 0, BullCount, BearCount, Color.Transparent, ErrorColor, ErrorOpacity);
                }
            }
            else
            {
                /// generate log message one time
                if (!invalid)
                {
                    Log(String.Format("{0} does not implement interface IEmProps", Bars.BarsType.ToString()), LogLevel.Warning);
                    invalid = true;
                }
            }
        }
 private void EventsDependingActionControlValidationError(object sender, ValidationErrorEventArgs e)
 {
     ErrorCount.CheckEntityError(e);
 }
Example #15
0
 private void ActionValidationError(object sender, ValidationErrorEventArgs e)
 {
     ErrorCount.CheckEntityError(e);
 }
 public PageActions()
 {
     InitializeComponent();
     _baseLayer = new BaseLayer();
     ErrorCount.Reset();
 }
Example #17
0
 private void DataGridValidationError(object sender, ValidationErrorEventArgs e)
 {
     ErrorCount.CheckEntityListError(e);
 }
Example #18
0
 private void CombinationListValidationError(object sender, ValidationErrorEventArgs e)
 {
     ErrorCount.CheckEntityListError(e);
 }
Example #19
0
        public async Task RequestDeploymentGraphShouldReturnDeploymentGraph()
        {
            var diagnosticsListener = new MultipleMessageListener <PublishDiagnosticsParams>();
            var fileSystemDict      = new Dictionary <Uri, string>();

            var client = await IntegrationTestHelper.StartServerWithClientConnectionAsync(
                this.TestContext,
                options => options.OnPublishDiagnostics(diagnosticsParams => diagnosticsListener.AddMessage(diagnosticsParams)),
                BuiltInTestTypes.Create(),
                new InMemoryFileResolver(fileSystemDict));

            var mainUri = DocumentUri.FromFileSystemPath("/main.bicep");

            fileSystemDict[mainUri.ToUri()] = @"
resource res1 'Test.Rp/basicTests@2020-01-01' = {
  name: 'res1'
}

resource res2 'Test.Rp/readWriteTests@2020-01-01' = {
  name: 'res2'
  properites: {
    readwrite: mod1.outputs.output1
  }
}

resource unknownRes = {
}

module mod1 './modules/module1.bicep' = {
  name: 'mod1'
}

module mod2 './modules/module2.bicep' = {
  name: 'mod2'
}

module nonExistingMod './path/to/nonExistingModule.bicep' = {
}
";

            var module1Uri = DocumentUri.FromFileSystemPath("/modules/module1.bicep");

            fileSystemDict[module1Uri.ToUri()] = @"
resource res3 'Test.Rp/basicTests@2020-01-01' = {
  name: 'res3'
}

output output1 int = 123
";

            var module2Uri = DocumentUri.FromFileSystemPath("/modules/module2.bicep");

            fileSystemDict[module2Uri.ToUri()] = @"
resource res4 'Test.Rp/basicTests@2020-01-01' = {
  name: 'res4'
}

module nestedMod './nestedModules/nestedModule.bicep' = [for x in []: {
  name: 'nestedMod'
  dependsOn: [
    res4
  ]
}]
";

            var nestedModuleUri = DocumentUri.FromFileSystemPath("/modules/nestedModules/nestedModule.bicep");

            fileSystemDict[nestedModuleUri.ToUri()] = @"
resource res5 'Test.Rp/basicTests@2020-01-01' = {
  name: 'res5'
}
";

            client.TextDocument.DidOpenTextDocument(TextDocumentParamHelper.CreateDidOpenDocumentParams(mainUri, fileSystemDict[mainUri.ToUri()], 1));
            await diagnosticsListener.WaitNext();

            var deploymentGraph = await client.SendRequest(new BicepDeploymentGraphParams(new TextDocumentIdentifier(mainUri)), default);

            deploymentGraph.Should().NotBeNull();
            deploymentGraph !.Nodes.Should().Equal(
                new BicepDeploymentGraphNode("mod1", "<module>", false, CreateTextRange(15, 0, 17, 1), true, false, Path.GetFullPath(module1Uri.GetFileSystemPath())),
                new BicepDeploymentGraphNode("mod1::res3", "Test.Rp/basicTests", false, CreateTextRange(1, 0, 3, 1), false, false, Path.GetFullPath(module1Uri.GetFileSystemPath())),
                new BicepDeploymentGraphNode("mod2", "<module>", false, CreateTextRange(19, 0, 21, 1), true, false, Path.GetFullPath(module2Uri.GetFileSystemPath())),
                new BicepDeploymentGraphNode("mod2::nestedMod", "<module>", true, CreateTextRange(5, 0, 9, 1), true, false, Path.GetFullPath(nestedModuleUri.GetFileSystemPath())),
                new BicepDeploymentGraphNode("mod2::nestedMod::res5", "Test.Rp/basicTests", false, CreateTextRange(1, 0, 3, 1), false, false, Path.GetFullPath(nestedModuleUri.GetFileSystemPath())),
                new BicepDeploymentGraphNode("mod2::res4", "Test.Rp/basicTests", false, CreateTextRange(1, 0, 3, 1), false, false, Path.GetFullPath(module2Uri.GetFileSystemPath())),
                new BicepDeploymentGraphNode("nonExistingMod", "<module>", false, CreateTextRange(23, 0, 24, 1), false, true, Path.GetFullPath("/path/to/nonExistingModule.bicep")),
                new BicepDeploymentGraphNode("res1", "Test.Rp/basicTests", false, CreateTextRange(1, 0, 3, 1), false, false, Path.GetFullPath(mainUri.GetFileSystemPath())),
                new BicepDeploymentGraphNode("res2", "Test.Rp/readWriteTests", false, CreateTextRange(5, 0, 10, 1), false, true, Path.GetFullPath(mainUri.GetFileSystemPath())));
            deploymentGraph !.Edges.Should().Equal(
                new BicepDeploymentGraphEdge("mod2::nestedMod", "mod2::res4"),
                new BicepDeploymentGraphEdge("res2", "mod1"));
            deploymentGraph !.ErrorCount.Should().Be(7);
        }
Example #20
0
 public override int GetHashCode() => ErrorCount.GetHashCode();
 private void ActionListControlValidationError(object sender, ValidationErrorEventArgs e)
 {
     ErrorCount.CheckEntityListError(e);
 }
Example #22
0
        public static void Main()
        {
            var fens = Tuner.LoadFens("d:\\backup\\chess\\epds\\quiet-labeled.epd", true, false);

            Console.WriteLine(fens.Count + " fens found");

            var kpk   = new ErrorCount("KPK ");
            var kbnk  = new ErrorCount("KBNK");
            var kbpk  = new ErrorCount("KBPK");
            var krkp  = new ErrorCount("KRKP");
            var kqkp  = new ErrorCount("KQKP");
            var krkb  = new ErrorCount("KRKB");
            var krkn  = new ErrorCount("KRKN");
            var kbpkp = new ErrorCount("KBPKP");
            var krbkb = new ErrorCount("KRBKB");
            var krbkr = new ErrorCount("KRBKR");

            var cb         = ChessBoardInstances.Get(0);
            var threadData = ThreadData.GetInstance(0);

            foreach (var(key, value) in fens)
            {
                ChessBoardUtil.SetFen(key, cb);

                var error = Math.Pow(
                    value - ErrorCalculator.CalculateSigmoid(ChessConstants.ColorFactor[cb.ColorToMove] *
                                                             EvalUtil.CalculateScore(cb, threadData)),
                    2);
                if (MaterialUtil.IsKbnk(cb.MaterialKey))
                {
                    kbnk.AddError(error);
                }
                else if (MaterialUtil.IsKqkp(cb.MaterialKey))
                {
                    kqkp.AddError(error);
                }
                else if (MaterialUtil.IsKrkp(cb.MaterialKey))
                {
                    krkp.AddError(error);
                }
                else if (MaterialUtil.IsKrkb(cb.MaterialKey))
                {
                    krkb.AddError(error);
                }
                else if (MaterialUtil.IsKrkn(cb.MaterialKey))
                {
                    krkn.AddError(error);
                }
                else if (MaterialUtil.IsKpk(cb.MaterialKey))
                {
                    krkn.AddError(error);
                }
                else if (MaterialUtil.IsKbpk(cb.MaterialKey))
                {
                    kbpk.AddError(error);
                }
                else if (MaterialUtil.IsKbpkp(cb.MaterialKey))
                {
                    kbpkp.AddError(error);
                }
                else if (MaterialUtil.IsKrbkb(cb.MaterialKey))
                {
                    krbkb.AddError(error);
                }
                else if (MaterialUtil.IsKrbkr(cb.MaterialKey))
                {
                    krbkr.AddError(error);
                }
            }

            kpk.Print();
            kbnk.Print();
            krkp.Print();
            kqkp.Print();
            krkb.Print();
            krkn.Print();
            krbkb.Print();
            krbkr.Print();
            kbpk.Print();
            kbpkp.Print();
        }
Example #23
0
 private void ProbabilityValidationError(object sender, ValidationErrorEventArgs e)
 {
     ErrorCount.CheckEntityListError(e);
 }
Example #24
0
 public void ValidateEventList(object sender, ValidationErrorEventArgs e)
 {
     ErrorCount.CheckEntityListError(e);
 }