public void shoot(Load load)
 {
     Instantiate (load.projectile, shotSpawn.position + load.offset, shotSpawn.rotation * load.rotation);
     fireballSound.GetComponent<AudioSource> ().Play ();
     //anim.SetBool (0, true);
     //return load;
 }
Exemplo n.º 2
0
        static void Main(string[] args)
        {
            Database.SetInitializer(new MyInitializer());

            ApplicationDbContext db = new ApplicationDbContext();

            Load load = new Load();
            db.Loads.Add(load);

            //db.SaveChanges();
        }
Exemplo n.º 3
0
		public void TestUpdateUsingPartialAndBulk()
		{
			Load load = new Load
			{
				Id = 2,
				CustomerId = 3,
				CustomerName = "Other",
				Total = 1.00
			};

			this.Client.Index(load);

			dynamic partial_load = new ExpandoObject();
			partial_load.Id = load.Id;
			partial_load.CustomerId = 3;

			Assert.IsTrue(this.UpdateViaBulk(partial_load));
		}
    public static void Main()
    {
        modshogun.init_shogun_with_defaults();
        double width    = 2.1;
        double epsilon  = 1e-5;
        double C        = 1.0;
        int    mkl_norm = 2;

        double[,] traindata_real = Load.load_numbers("../data/fm_train_real.dat");
        double[,] testdata_real  = Load.load_numbers("../data/fm_test_real.dat");

        double[] trainlab = Load.load_labels("../data/label_train_multiclass.dat");

        CombinedKernel   kernel      = new CombinedKernel();
        CombinedFeatures feats_train = new CombinedFeatures();
        CombinedFeatures feats_test  = new CombinedFeatures();

        RealFeatures subkfeats1_train = new RealFeatures(traindata_real);
        RealFeatures subkfeats1_test  = new RealFeatures(testdata_real);

        GaussianKernel subkernel = new GaussianKernel(10, width);

        feats_train.append_feature_obj(subkfeats1_train);
        feats_test.append_feature_obj(subkfeats1_test);
        kernel.append_kernel(subkernel);

        RealFeatures subkfeats2_train = new RealFeatures(traindata_real);
        RealFeatures subkfeats2_test  = new RealFeatures(testdata_real);

        LinearKernel subkernel2 = new LinearKernel();

        feats_train.append_feature_obj(subkfeats2_train);
        feats_test.append_feature_obj(subkfeats2_test);
        kernel.append_kernel(subkernel2);

        RealFeatures subkfeats3_train = new RealFeatures(traindata_real);
        RealFeatures subkfeats3_test  = new RealFeatures(testdata_real);

        PolyKernel subkernel3 = new PolyKernel(10, 2);

        feats_train.append_feature_obj(subkfeats3_train);
        feats_test.append_feature_obj(subkfeats3_test);
        kernel.append_kernel(subkernel3);

        kernel.init(feats_train, feats_train);

        Labels labels = new Labels(trainlab);

        MKLMultiClass mkl = new MKLMultiClass(C, kernel, labels);

        mkl.set_epsilon(epsilon);
        mkl.set_mkl_epsilon(epsilon);
        mkl.set_mkl_norm(mkl_norm);

        mkl.train();

        kernel.init(feats_train, feats_test);
        double[] outMatrix = mkl.apply().get_labels();

        modshogun.exit_shogun();
    }
Exemplo n.º 5
0
        private void OpenFile(StorageFile file)
        {
            //Add a loading screen
            if (rawImage != null)
            {
                EmptyImage();
            }
            Load.Show();
            ImageSelected = true;
            isBindingEnabled = false;

            Task.Run(async () =>
            {
                try
                {
                    var watchTotal = Stopwatch.StartNew();
                    using (Stream stream = (await file.OpenReadAsync()).AsStreamForRead())
                    {
                        var watchdecode = Stopwatch.StartNew();
                        RawDecoder decoder = RawParser.GetDecoder(stream, file);
                        try
                        {
                            thumbnail = decoder.DecodeThumb();
                            Task.Run(() =>
                            {
                                var result = thumbnail?.GetBitmap();
                                DisplayImage(result, true);
                            });
                        }
                        //since thumbnail are optionnal, we ignore all errors           
                        catch (Exception ex) { }

                        decoder.DecodeRaw();
                        decoder.DecodeMetadata();
                        rawImage = decoder.rawImage;

                        watchdecode.Stop();
                        Debug.WriteLine("Decoding done in " + watchdecode.ElapsedMilliseconds + " ms");

                        var watchLook = Stopwatch.StartNew();
                        rawImage.ApplyTableLookUp();
                        watchLook.Stop();
                        Debug.WriteLine("Lookup done in " + watchLook.ElapsedMilliseconds + " ms");

                        var watchScale = Stopwatch.StartNew();
                        ImageHelper.ScaleValues(rawImage);
                        watchScale.Stop();
                        Debug.WriteLine("Scale done in " + watchScale.ElapsedMilliseconds + " ms");
                    }

                    rawImage.metadata.SetFileMetatdata(file);

                    if (rawImage.isCFA)
                    {
                        var watchDemos = Stopwatch.StartNew();
                        //get the algo from the settings
                        DemosaicAlgorithm algo;
                        try
                        {
                            algo = SettingStorage.DemosAlgo;
                        }
                        catch (Exception)
                        {
                            algo = DemosaicAlgorithm.FastAdams;
                        }
                        Demosaic.Demos(rawImage, algo);

                        watchDemos.Stop();
                        Debug.WriteLine("Demos done in " + watchDemos.ElapsedMilliseconds + " ms");
                    }

                    if (rawImage.convertionM != null)
                    {
                        var watchConvert = Stopwatch.StartNew();
                        rawImage.ConvertRGB();
                        watchConvert.Stop();
                        Debug.WriteLine("ConvertRGB done in " + watchConvert.ElapsedMilliseconds + " ms");
                    }

                    var watchPreview = Stopwatch.StartNew();
                    ImageHelper.CreatePreview(SettingStorage.PreviewFactor, ImageDisplay.ViewportHeight, ImageDisplay.ViewportWidth, rawImage);
                    watchPreview.Stop();
                    Debug.WriteLine("Preview done in " + watchPreview.ElapsedMilliseconds + " ms");

                    watchTotal.Stop();
                    rawImage.metadata.ParsingTime = watchTotal.ElapsedMilliseconds;
                    GC.Collect();
                    //check if enough memory
                    if (MemoryManager.AppMemoryUsageLimit - MemoryManager.AppMemoryUsage < ((ulong)rawImage.fullSize.green.Length * 6) || MemoryManager.AppMemoryUsageLevel == AppMemoryUsageLevel.High)
                    {
                        TextDisplay.DisplayWarning("The image is bigger than what your device support, this application may fail when saving. Only " + ((MemoryManager.AppMemoryUsageLimit - MemoryManager.AppMemoryUsage) / (1024 * 1024)) + "Mb left of memory for this app to use");
                    }
#if !DEBUG
                    //send an event with file extension, camera model and make
                    logger.Log("SuccessOpening " + rawImage?.metadata?.FileExtension.ToLower() + " " + rawImage?.metadata?.Make + " " + rawImage?.metadata?.Model);
#endif
                    DefaultValue.Rotation = rawImage.metadata.OriginalRotation;
                    DefaultValue.ReverseGamma = rawImage.IsGammaCorrected;
                    DefaultValue.RMul = rawImage?.metadata.WbCoeffs?.Red ?? 1;
                    DefaultValue.GMul = rawImage?.metadata.WbCoeffs?.Green ?? 1;
                    DefaultValue.BMul = rawImage?.metadata.WbCoeffs?.Blue ?? 1;
                    await CoreApplication.MainView.CoreWindow.Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
                    {
                        var exif = rawImage.ParseExif();
                        //Group the data
                        var groups = from x in exif group x by x.Group into grp orderby grp.Key select grp;
                        //Set the grouped data to CollectionViewSource
                        ExifSource.Source = groups;
                        ResetControls();
                        UpdatePreview(true);
                        ControlVisibilty.Value = true;
                        SetImageSizeText();
                    });
                    if (rawImage.errors.Count > 0)
                    {
                        var loader = new Windows.ApplicationModel.Resources.ResourceLoader();
                        TextDisplay.DisplayWarning(loader.GetString("ErrorOnLoadWarning"));
#if !DEBUG
                        //send an event with file extension and camera model and make if any                   
                        logger.Log("ErrorOnOpen " + file?.FileType.ToLower() + " " + rawImage?.metadata?.Make + " " + rawImage?.metadata?.Model + "" + rawImage.errors.Count);
#endif
                    }
                    isBindingEnabled = true;
                    thumbnail = null;
                }
                catch (Exception ex)
                {
#if !DEBUG
                    //send an event with file extension and camera model and make if any                   
                    logger.Log("FailOpening " + file?.FileType.ToLower() + " " + rawImage?.metadata?.Make + " " + rawImage?.metadata?.Model);
#endif

                    await CoreApplication.MainView.CoreWindow.Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
                    {
                        EmptyImage();
                    });
                    ImageSelected = false;
                    var loader = new Windows.ApplicationModel.Resources.ResourceLoader();
                    TextDisplay.DisplayError(loader.GetString("ExceptionText"));
                }

                CoreApplication.MainView.CoreWindow.Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
                {
                    // Blur(false);
                    Load.Hide();
                });
                ImageSelected = false;
            });
        }
 public ucCalLoadAtAnyPoint(ApplicationUser currentUser, Load load)
 {
     _Load       = load;
     CurrentUser = currentUser;
     InitializeComponent();
 }
Exemplo n.º 7
0
        private void CheckVideoDevices_Executed(object sender, ExecutedRoutedEventArgs e)
        {
            RecordPauseButton.IsEnabled = false;
            StopButton.IsEnabled = false;

            VideoDevicesComboBox.Items.Clear();

            //Check again for video devices.
            _loadDel = LoadVideoDevices;
            _loadDel.BeginInvoke(LoadCallBack, null);
        }
Exemplo n.º 8
0
            public static void ImportConnections()
            {
                try
                {
                    OpenFileDialog lD = Controls.ConnectionsLoadDialog();
                    lD.Multiselect = true;

                    if (lD.ShowDialog() == DialogResult.OK)
                    {
                        TreeNode nNode = null;

                        for (int i = 0; i <= lD.FileNames.Length - 1; i++)
                        {
                            nNode = Node.AddNode(Node.Type.Container, "Import #" + i.ToString());

                            Container.Info nContI = new Container.Info();
                            nContI.TreeNode = nNode;
                            nContI.ConnectionInfo = new Connection.Info(nContI);

                            if (Node.SelectedNode != null)
                            {
                                if (Node.GetNodeType(Node.SelectedNode) == Node.Type.Container)
                                {
                                    nContI.Parent = Node.SelectedNode.Tag;
                                }
                            }

                            nNode.Tag = nContI;
                            ContainerList.Add(nContI);

                            Load conL = new Load
                                            {
                                                ConnectionFileName = lD.FileNames[i],
                                                RootTreeNode = nNode,
                                                Import = true,
                                                ConnectionList = ConnectionList,
                                                ContainerList = ContainerList
                                            };

                            conL.LoadConnections();

                            Windows.treeForm.tvConnections.SelectedNode.Nodes.Add(nNode);
                        }
                    }
                }
                catch (Exception ex)
                {
                    MessageCollector.AddMessage(MessageClass.ErrorMsg,
                                                Language.strConnectionsFileCouldNotBeImported +
                                                Constants.vbNewLine + ex.Message);
                }
            }
Exemplo n.º 9
0
        protected override bool ParseCilInstructionInternal(Instruction instruction,
                                                            ProgramState state)
        {
            switch (instruction.OpCode.Code)
            {
            case Code.Ldind_I:
            case Code.Ldind_I1:
            case Code.Ldind_I2:
            case Code.Ldind_I4:
            case Code.Ldind_I8:
            case Code.Ldind_R4:
            case Code.Ldind_R8:
            case Code.Ldind_U1:
            case Code.Ldind_U2:
            case Code.Ldind_U4:
            case Code.Ldind_Ref:
                (var pointerExpression, var pointerType) = state.Pop();

                if (pointerType is Address address)
                {
                    if (address.AddressType == Address.ReferenceKind.Field)
                    {
                        (var loadFieldValue, var valueIdentifier) = address.LoadValue(state);
                        state.PushExpr(new VarExpression(valueIdentifier),
                                       pointerType.StripPointer());
                        state.PushInstruction(instruction.Next,
                                              AddMethodBodyInstructionsToCfg(state,
                                                                             loadFieldValue));
                    }
                    else if (address.AddressType == Address.ReferenceKind.Parameter)
                    {
                        var argumentIdentifier =
                            state.GetIdentifier(Identifier.IdentKind.Normal);
                        var loadArgument = new Load(argumentIdentifier,
                                                    pointerExpression,
                                                    pointerType.StripPointer(),
                                                    state.CurrentLocation);
                        var valueIdentifier = state.GetIdentifier(Identifier.IdentKind.Normal);
                        var loadValue       = new Load(valueIdentifier,
                                                       new VarExpression(argumentIdentifier),
                                                       pointerType.StripPointer().StripPointer(),
                                                       state.CurrentLocation);
                        state.PushExpr(new VarExpression(valueIdentifier),
                                       pointerType.StripPointer());
                        state.PushInstruction(instruction.Next,
                                              AddMethodBodyInstructionsToCfg(state,
                                                                             loadArgument,
                                                                             loadValue));
                    }
                }
                else
                {
                    Log.WriteError("Unexpected or unhandled pointer type " +
                                   $"{pointerType.GetType()} on stack.");
                    return(false);
                }

                state.AppendToPreviousNode = true;
                return(true);

            default:
                return(false);
            }
        }
Exemplo n.º 10
0
 public void LoadEventTrigger(object sender, EventArgs e)
 {
     Load.Invoke(sender, e);
 }
Exemplo n.º 11
0
 void Awake()
 {
     instance = this;
     Tick.pause = true;
 }
 public void shoot(Load load)
 {
     Instantiate (load.projectile, shotSpawn.position, shotSpawn.rotation * load.rotation);
     //return load;
     //Time.timeScale = .5f;
 }
Exemplo n.º 13
0
 void Start()
 {
     jsonString = Resources.Load<TextAsset>("Ending").text;
     EndingData = JsonMapper.ToObject<LitJson.JsonData>(jsonString);
     load = GetComponent<Load>();
     calcEnding = GetComponent<CalcEnding>();
     wonGame = false;
     testEndingPanel.SetActive(false);
 }
Exemplo n.º 14
0
 void Start()
 {
     jsonString = Resources.Load<TextAsset>("Names").text;
     NameData = JsonMapper.ToObject<LitJson.JsonData>(jsonString);
     load = GetComponent<Load>();
     NamePanel.SetActive(false);
     HelloPanel.SetActive(false);
 }
Exemplo n.º 15
0
 public TaskEventArgs(Task task, Load load)
 {
     _task = task;
     _load = load;
 }
Exemplo n.º 16
0
 public Displacement GetLoadDisplacementAt(Element targetElement, Load load, double[] isoLocation)
 {
     throw new NotImplementedException();
 }
Exemplo n.º 17
0
 private void Repair(Model model, Load.AnalysisCase value)
 {
     if (value.Properties is Load.StaticCaseProps)
     {
         IList<Load.StaticCaseFactor> list = ((Load.StaticCaseProps)value.Properties).Loads;
         foreach (Load.StaticCaseFactor factor in list)
             if (factor.AppliedLoad is Load.LoadCase)
             {
                 if (model.LoadCases.ContainsKey(((Load.LoadCase)factor.AppliedLoad).Name))
                     factor.AppliedLoad = model.LoadCases[((Load.LoadCase)factor.AppliedLoad).Name];
                 else
                     factor.AppliedLoad = model.ActiveLoadCase;
             }
     }
 }
Exemplo n.º 18
0
        private void CreateCommands()
        {
            Add = ReactiveCommand.Create(ExecuteAdd);

            //get existing jobs and tags/instruments
            Load = ReactiveCommand.CreateFromTask(async _ =>
            {
                var dataUpdateJobs        = _client.GetaDataUpdateJobs();
                var econReleaseUpdateJobs = _client.GetEconomicReleaseUpdateJobs();
                var tags               = _client.GetTags();
                var instruments        = _client.GetInstruments();
                var econReleaseSources = _client.GetEconomicReleaseDataSources();

                await Task.WhenAll(dataUpdateJobs, econReleaseUpdateJobs, tags, instruments, econReleaseSources).ConfigureAwait(false);

                var responses = new ApiResponse[] { dataUpdateJobs.Result, econReleaseUpdateJobs.Result, tags.Result, instruments.Result, econReleaseSources.Result };
                if (await responses.DisplayErrors(this, DialogCoordinator).ConfigureAwait(true))
                {
                    return(null);
                }

                Tags.AddRange(tags.Result.Result);
                Instruments.AddRange(instruments.Result.Result);
                EconomicReleaseDataSources.AddRange(econReleaseSources.Result.Result);

                var jobs = new List <IJobSettings>();
                jobs.AddRange(dataUpdateJobs.Result.Result);
                jobs.AddRange(econReleaseUpdateJobs.Result.Result);

                return(jobs);
            });
            Load.Subscribe(jobs =>
            {
                if (jobs == null)
                {
                    return;
                }

                foreach (var job in jobs)
                {
                    Jobs.Add(GetJobViewModel(job));
                }
            });

            //Delete job
            var deleteCanExecute = this
                                   .WhenAnyValue(x => x.SelectedJob)
                                   .Select(x => x != null && !string.IsNullOrEmpty(x.PreChangeName));

            Delete = ReactiveCommand.CreateFromTask(async _ =>
            {
                //Give a dialog to confirm the deletion
                MessageDialogResult dialogResult = await DialogCoordinator.ShowMessageAsync(this,
                                                                                            "Delete Job",
                                                                                            string.Format("Are you sure you want to delete {0}?", SelectedJob.Name),
                                                                                            MessageDialogStyle.AffirmativeAndNegative);

                if (dialogResult != MessageDialogResult.Affirmative)
                {
                    return;
                }

                //If the name has changed but hasn't been saved, we change it back to be in sync with the server
                SelectedJob.Name = SelectedJob.PreChangeName;

                //Request deletion
                var response = await _client.DeleteJob(SelectedJob.Job);
                if (await response.DisplayErrors(this, DialogCoordinator))
                {
                    return;
                }

                //if it was successful, remove the VM from the list
                Jobs.Remove(SelectedJob);
                SelectedJob = null;
            },
                                                    deleteCanExecute);
        }
Exemplo n.º 19
0
        private void Repair(Model model, Load.LoadCombination value)
        {
            IList<Load.AbstractCaseFactor> cases = value.Cases;
            Dictionary<string, int> ids = new Dictionary<string, int>();
            for (int i = 0; i < model.AbstractCases.Count; i++)
                if (model.AbstractCases[i] != null)
                    ids.Add(model.AbstractCases[i].Name, i);

            for (int i = 0; i < cases.Count; i++)
                cases[i] = new Canguro.Model.Load.AbstractCaseFactor(model.AbstractCases[ids[cases[i].Case.Name]], cases[i].Factor);
        }
Exemplo n.º 20
0
            public static void NewConnections(string filename)
            {
                try
                {
                    ConnectionList = new Connection.List();
                    ContainerList = new Container.List();

                    Load conL = new Load();

                    Settings.Default.LoadConsFromCustomLocation = false;

                    Directory.CreateDirectory(Path.GetDirectoryName(filename));
                    XmlTextWriter xW = new XmlTextWriter(filename, Encoding.UTF8);
                    xW.Formatting = Formatting.Indented;
                    xW.Indentation = 4;

                    xW.WriteStartDocument();
                    xW.WriteStartElement("Connections"); // Do not localize
                    xW.WriteAttributeString("Name", Language.strConnections);
                    xW.WriteAttributeString("Export", "", "False");
                    xW.WriteAttributeString("Protected", "",
                                            "GiUis20DIbnYzWPcdaQKfjE2H5jh//L5v4RGrJMGNXuIq2CttB/d/BxaBP2LwRhY");
                    xW.WriteAttributeString("ConfVersion", "", "2.4");

                    xW.WriteEndElement();
                    xW.WriteEndDocument();

                    xW.Close();

                    conL.ConnectionList = ConnectionList;
                    conL.ContainerList = ContainerList;
                    conL.Import = false;

                    Node.ResetTree();

                    conL.RootTreeNode = Windows.treeForm.tvConnections.Nodes[0];

                    // Load config
                    conL.ConnectionFileName = filename;
                    conL.LoadConnections();

                    Windows.treeForm.tvConnections.SelectedNode = conL.RootTreeNode;
                }
                catch (Exception ex)
                {
                    MessageCollector.AddMessage(MessageClass.ErrorMsg,
                                                Language.strCouldNotCreateNewConnectionsFile +
                                                Constants.vbNewLine + ex.Message);
                }
            }
Exemplo n.º 21
0
 public void Add(Load routine, string message)
 {
     m_routines.Add(routine);
         m_messages.Add(message);
 }
Exemplo n.º 22
0
 // Use this for initialization
 void Start()
 {
     nw = GetComponent<NetworkView>();
     _loader = Camera.main.GetComponent<Load>();
 }
Exemplo n.º 23
0
 static void LoadPrefab(string name)
 {
     Selection.activeTransform       = Load.GameObject("Prefabs/" + name, Selection.activeTransform).transform;
     Selection.activeGameObject.name = name;
 }
Exemplo n.º 24
0
    // Use this for initialization
    void Start()
    {
        nw = GetComponent<NetworkView>();
        LaunchServer();
        spawner = GameObject.Find("Spawner").GetComponent<Spawner>();
        _loader = Camera.main.GetComponent<Load>();
        //NetworkConnectionError ne = Network.Connect("10.0.27.129", 80);

        //Debug.Log(ne);
    }
Exemplo n.º 25
0
        private void list_ContainerContentChanging(ListViewBase sender, ContainerContentChangingEventArgs args)
        {
            GridView listview = sender as GridView;
            var      scroll   = Load.FindChildOfType <ScrollViewer>(listview);
            var      text     = Load.FindChildOfType <TextBlock>(listview);

            scroll.ViewChanged += async(s, a) =>
            {
                if ((scroll.VerticalOffset >= scroll.ScrollableHeight - 50 || scroll.ScrollableHeight == 0) && !isLoading)
                {
                    text.Visibility = Visibility.Visible;
                    int count0 = listview.Items.Count;
                    int page   = listview.Items.Count / 20 + 1;
                    isLoading = true;
                    switch (listview.Tag.ToString())
                    {
                    case "videos":
                    {
                        var temps = await ContentServ.GetSearchResultAsync(keyword, page);

                        if (temps.Count < 20)
                        {
                            text.Text = "装填完毕!";
                            return;
                        }
                        text.Visibility = Visibility.Collapsed;
                        foreach (var item in temps)
                        {
                            listview.Items.Add(item);
                        }
                        isLoading = false;
                    }
                    break;

                    case "bangumi":
                    {
                        var temps = await ContentServ.GetBangumisAsync(keyword, page);

                        if (temps.Count < 20)
                        {
                            text.Text = "装填完毕!";
                            return;
                        }
                        text.Visibility = Visibility.Collapsed;
                        foreach (var item in temps)
                        {
                            listview.Items.Add(item);
                        }
                        isLoading = false;
                        break;
                    }

                    case "up":
                    {
                        List <UpForSearch> uplist = await ContentServ.GetUpsAsync(keyword, page);

                        if (uplist.Count < 20)
                        {
                            text.Text = "装填完毕!";
                            return;
                        }
                        text.Visibility = Visibility.Collapsed;
                        foreach (var item in uplist)
                        {
                            listview.Items.Add(item);
                        }
                        isLoading = false;
                        break;
                    }
                    }
                }
            };
        }
Exemplo n.º 26
0
        internal override void OnMessage(string method, JsonElement?serverParams)
        {
            switch (method)
            {
            case "close":
                Closed?.Invoke(this, EventArgs.Empty);
                break;

            case "crash":
                Crashed?.Invoke(this, EventArgs.Empty);
                break;

            case "domcontentloaded":
                DOMContentLoaded?.Invoke(this, EventArgs.Empty);
                break;

            case "load":
                Load?.Invoke(this, EventArgs.Empty);
                break;

            case "bindingCall":
                BindingCall?.Invoke(
                    this,
                    new() { BindingCall = serverParams?.GetProperty("binding").ToObject <BindingCallChannel>(Connection.DefaultJsonSerializerOptions).Object });
                break;

            case "route":
                var route   = serverParams?.GetProperty("route").ToObject <RouteChannel>(Connection.DefaultJsonSerializerOptions).Object;
                var request = serverParams?.GetProperty("request").ToObject <RequestChannel>(Connection.DefaultJsonSerializerOptions).Object;
                Route?.Invoke(
                    this,
                    new() { Route = route, Request = request });
                break;

            case "popup":
                Popup?.Invoke(this, new() { Page = serverParams?.GetProperty("page").ToObject <PageChannel>(Connection.DefaultJsonSerializerOptions).Object });
                break;

            case "pageError":
                PageError?.Invoke(this, serverParams?.GetProperty("error").GetProperty("error").ToObject <SerializedError>(Connection.DefaultJsonSerializerOptions));
                break;

            case "fileChooser":
                FileChooser?.Invoke(this, serverParams?.ToObject <FileChooserChannelEventArgs>(Connection.DefaultJsonSerializerOptions));
                break;

            case "frameAttached":
                FrameAttached?.Invoke(this, serverParams?.GetProperty("frame").ToObject <FrameChannel>(Connection.DefaultJsonSerializerOptions).Object);
                break;

            case "frameDetached":
                FrameDetached?.Invoke(this, serverParams?.GetProperty("frame").ToObject <FrameChannel>(Connection.DefaultJsonSerializerOptions).Object);
                break;

            case "dialog":
                Dialog?.Invoke(this, serverParams?.GetProperty("dialog").ToObject <DialogChannel>(Connection.DefaultJsonSerializerOptions).Object);
                break;

            case "console":
                Console?.Invoke(this, serverParams?.GetProperty("message").ToObject <ConsoleMessage>(Connection.DefaultJsonSerializerOptions));
                break;

            case "webSocket":
                WebSocket?.Invoke(this, serverParams?.GetProperty("webSocket").ToObject <WebSocketChannel>(Connection.DefaultJsonSerializerOptions).Object);
                break;

            case "download":
                Download?.Invoke(this, serverParams?.ToObject <PageDownloadEvent>(Connection.DefaultJsonSerializerOptions));
                break;

            case "video":
                Video?.Invoke(this, new() { Artifact = serverParams?.GetProperty("artifact").ToObject <ArtifactChannel>(Connection.DefaultJsonSerializerOptions).Object });
                break;

            case "worker":
                Worker?.Invoke(
                    this,
                    new() { WorkerChannel = serverParams?.GetProperty("worker").ToObject <WorkerChannel>(Connection.DefaultJsonSerializerOptions) });
                break;
            }
        }
Exemplo n.º 27
0
 private void Liftload_OnPositionChanged(Load load, Vector3 position)
 {
     // Simple way to make the platform move as the 'liftload' moves (we use the liftload to move the platform)
     LiftConveyor.LocalPosition = new Vector3(0, load.Distance, 0);
 }
Exemplo n.º 28
0
        private async void SaveButtonClickAsync(object sender, RoutedEventArgs e)
        {
            if (rawImage?.fullSize != null)
            {
                try
                {
                    var savePicker = new FileSavePicker
                    {
                        SuggestedStartLocation = PickerLocationId.DocumentsLibrary,
                        SuggestedFileName = rawImage.metadata.FileName
                    };
                    foreach (KeyValuePair<string, List<string>> format in FormatHelper.SaveSupportedFormat)
                    {
                        savePicker.FileTypeChoices.Add(format.Key, format.Value);
                    }
                    StorageFile file = await savePicker.PickSaveFileAsync();
                    if (file == null) return;

                    Load.Show();

                    //TODO
                    //show an option Ui
                    //when user click ok save the properties to a bitmapProperies
                    //check isuser chose 16bits or not
                    //save
                    var task = Task.Run(() =>
                    {
                        try
                        {
                            var watchPreview = Stopwatch.StartNew();
                            var result = ApplyImageEffect8bitsNoHistoAsync(rawImage.fullSize, EditionValue);
                            watchPreview.Stop();
                            Debug.WriteLine("Apply done in " + watchPreview.ElapsedMilliseconds + " ms");

                            watchPreview = Stopwatch.StartNew();
                            //call GC here (GC does not empty automatically native object)
                            GC.Collect();
                            FormatHelper.SaveAsync(file, result);
                            watchPreview.Stop();
                            Debug.WriteLine("Save done in " + watchPreview.ElapsedMilliseconds + " ms");
                        }
                        catch (Exception ex)
                        {
#if DEBUG
                            TextDisplay.DisplayError(ex.Message);
#else
                            TextDisplay.DisplayError("An error occured while saving");
#endif
                        }

                        CoreApplication.MainView.CoreWindow.Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
                        {
                            //Blur(false);
                            Load.Hide();
                        });
                    });
                }
                catch (Exception ex)
                {
#if DEBUG
                    TextDisplay.DisplayError(ex.Message);
#else
                    TextDisplay.DisplayError("An error occured while saving");
#endif
                }
            }
        }
Exemplo n.º 29
0
 public IEnumerable <Tuple <DoF, double> > GetLoadInternalForceAt(Element targetElement, Load load,
                                                                  double[] isoLocation)
 {
     throw new NotImplementedException();
 }
Exemplo n.º 30
0
        internal override void OnMessage(string method, JsonElement?serverParams)
        {
            switch (method)
            {
            case "close":
                Closed?.Invoke(this, EventArgs.Empty);
                break;

            case "crash":
                Crashed?.Invoke(this, EventArgs.Empty);
                break;

            case "domcontentloaded":
                DOMContentLoaded?.Invoke(this, EventArgs.Empty);
                break;

            case "load":
                Load?.Invoke(this, EventArgs.Empty);
                break;

            case "bindingCall":
                BindingCall?.Invoke(
                    this,
                    new BindingCallEventArgs
                {
                    BidingCall = serverParams?.GetProperty("binding").ToObject <BindingCallChannel>(Connection.GetDefaultJsonSerializerOptions()).Object,
                });
                break;

            case "route":
                Route?.Invoke(
                    this,
                    new RouteEventArgs
                {
                    Route   = serverParams?.GetProperty("route").ToObject <RouteChannel>(Connection.GetDefaultJsonSerializerOptions()).Object,
                    Request = serverParams?.GetProperty("request").ToObject <RequestChannel>(Connection.GetDefaultJsonSerializerOptions()).Object,
                });
                break;

            case "popup":
                Popup?.Invoke(this, new PageChannelPopupEventArgs
                {
                    Page = serverParams?.GetProperty("page").ToObject <PageChannel>(Connection.GetDefaultJsonSerializerOptions()).Object,
                });
                break;

            case "pageError":
                PageError?.Invoke(this, serverParams?.GetProperty("error").GetProperty("error").ToObject <PageErrorEventArgs>(Connection.GetDefaultJsonSerializerOptions()));
                break;

            case "fileChooser":
                FileChooser?.Invoke(this, serverParams?.ToObject <FileChooserChannelEventArgs>(Connection.GetDefaultJsonSerializerOptions()));
                break;

            case "frameAttached":
                FrameAttached?.Invoke(this, new FrameEventArgs(serverParams?.GetProperty("frame").ToObject <FrameChannel>(Connection.GetDefaultJsonSerializerOptions()).Object));
                break;

            case "frameDetached":
                FrameDetached?.Invoke(this, new FrameEventArgs(serverParams?.GetProperty("frame").ToObject <FrameChannel>(Connection.GetDefaultJsonSerializerOptions()).Object));
                break;

            case "dialog":
                Dialog?.Invoke(this, new DialogEventArgs(serverParams?.GetProperty("dialog").ToObject <DialogChannel>(Connection.GetDefaultJsonSerializerOptions()).Object));
                break;

            case "console":
                Console?.Invoke(this, new ConsoleEventArgs(serverParams?.GetProperty("message").ToObject <ConsoleMessage>(Connection.GetDefaultJsonSerializerOptions())));
                break;

            case "request":
                Request?.Invoke(this, new RequestEventArgs {
                    Request = serverParams?.GetProperty("request").ToObject <RequestChannel>(Connection.GetDefaultJsonSerializerOptions()).Object
                });
                break;

            case "requestFinished":
                RequestFinished?.Invoke(this, serverParams?.ToObject <PageChannelRequestEventArgs>(Connection.GetDefaultJsonSerializerOptions()));
                break;

            case "requestFailed":
                RequestFailed?.Invoke(this, serverParams?.ToObject <PageChannelRequestEventArgs>(Connection.GetDefaultJsonSerializerOptions()));
                break;

            case "response":
                Response?.Invoke(this, new ResponseEventArgs {
                    Response = serverParams?.GetProperty("response").ToObject <ResponseChannel>(Connection.GetDefaultJsonSerializerOptions()).Object
                });
                break;

            case "webSocket":
                WebSocket?.Invoke(this, new WebSocketEventArgs {
                    WebSocket = serverParams?.GetProperty("webSocket").ToObject <WebSocketChannel>(Connection.GetDefaultJsonSerializerOptions()).Object
                });
                break;

            case "download":
                Download?.Invoke(this, new DownloadEventArgs()
                {
                    Download = serverParams?.GetProperty("download").ToObject <DownloadChannel>(Connection.GetDefaultJsonSerializerOptions()).Object
                });
                break;

            case "video":
                Video?.Invoke(this, new VideoEventArgs()
                {
                    RelativePath = serverParams?.GetProperty("relativePath").ToString()
                });
                break;

            case "worker":
                Worker?.Invoke(
                    this,
                    new WorkerChannelEventArgs
                {
                    WorkerChannel = serverParams?.GetProperty("worker").ToObject <WorkerChannel>(Connection.GetDefaultJsonSerializerOptions()),
                });
                break;
            }
        }
Exemplo n.º 31
0
 public Force[] GetLocalEquivalentNodalLoads(Element targetElement, Load load)
 {
     throw new NotImplementedException();
 }
Exemplo n.º 32
0
        public IEnumerable <Tuple <DoF, double> > GetLoadInternalForceAt(Element targetElement, Load load,
                                                                         double[] isoLocation)
        {
            if (load is UniformLoad || load is PartialNonUniformLoad)
            {
                return(new List <Tuple <DoF, double> >());
            }

            throw new NotImplementedException();
        }
Exemplo n.º 33
0
 protected virtual void OnLoad(EventArgs e)
 {
     Load?.Invoke(this, e);
     Refresh();
 }
Exemplo n.º 34
0
        private static void BuildCantileverModel(Model model, double load_value)
        {
            //xrhsimopoiithike to  Hexa8NonLinearCantileverDefGrad
            // allagh tou material


            IContinuumMaterial3DDefGrad material1 = new HyperElasticMaterial3DDefGrad()
            {
                C1 = 0.035, C2 = 0.057, k_cons = 1
            };

            double[,] nodeData = new double[, ] {
                { 1, -1, -1 },
                { 1, 1, -1 },
                { 1, -1, 1 },
                { 1, 1, 1 },
                { -1, -1, -1 },
                { -1, 1, -1 },
                { -1, -1, 1 },
                { -1, 1, 1 }
            };

            int[,] elementData = new int[, ] {
                { 1, 4, 8, 7, 3, 2, 6, 5, 1 },
                { 2, 12, 11, 9, 10, 8, 7, 5, 6 }
            };                       // the last line will not be used. We assign only one element

            // orismos shmeiwn
            for (int nNode = 0; nNode < nodeData.GetLength(0); nNode++)
            {
                model.NodesDictionary.Add(nNode + 1, new Node(id: nNode + 1, x: nodeData[nNode, 0], y: nodeData[nNode, 1], z: nodeData[nNode, 2]));
            }

            // orismos elements
            Element e1;
            int     subdomainID = 1;

            for (int nElement = 0; nElement < elementData.GetLength(0) - 1; nElement++)
            {
                e1 = new Element()
                {
                    ID          = nElement + 1,
                    ElementType = new Hexa8NonLinearDefGrad(material1, GaussLegendre3D.GetQuadratureWithOrder(3, 3, 3)) // dixws to e. exoume sfalma enw sto beambuilding oxi//edw kaleitai me ena orisma to Hexa8
                };
                for (int j = 0; j < 8; j++)
                {
                    e1.NodesDictionary.Add(elementData[nElement, j + 1], model.NodesDictionary[elementData[nElement, j + 1]]);
                }
                model.ElementsDictionary.Add(e1.ID, e1);
                model.SubdomainsDictionary[subdomainID].Elements.Add(e1);
            }

            // constraint to to deftero miso apo th list twn nodes
            foreach (int k in new int[] { 5, 6, 7, 8 })
            {
                model.NodesDictionary[k].Constraints.Add(new Constraint()
                {
                    Amount = 0,
                    DOF    = StructuralDof.TranslationX
                });
                model.NodesDictionary[k].Constraints.Add(new Constraint()
                {
                    Amount = 0,
                    DOF    = StructuralDof.TranslationY
                });
                model.NodesDictionary[k].Constraints.Add(new Constraint()
                {
                    Amount = 0,
                    DOF    = StructuralDof.TranslationZ
                });
            }

            // fortish korufhs
            Load load1;

            for (int k = 4; k < 5; k++)
            {
                load1 = new Load()
                {
                    Node   = model.NodesDictionary[k],
                    DOF    = StructuralDof.TranslationZ,
                    Amount = 1 * load_value
                };
                model.Loads.Add(load1);
            }
        }
Exemplo n.º 35
0
        protected override void Seed(FortuneDbContext context)
        {
            //Permissions
            Permission[] permissions = new Permission[] {
                new Permission {
                    Id   = Guid.NewGuid(),
                    Name = "EditUsers"
                },
                new Permission {
                    Id   = Guid.NewGuid(),
                    Name = "EditPermissions"
                },
                new Permission {
                    Id   = Guid.NewGuid(),
                    Name = "EditTrailers"
                },
                new Permission {
                    Id   = Guid.NewGuid(),
                    Name = "EditLocations"
                },
                new Permission {
                    Id   = Guid.NewGuid(),
                    Name = "EditLoads"
                },
                new Permission {
                    Id   = Guid.NewGuid(),
                    Name = "ViewLoads"
                }
            };
            context.Permissions.AddRange(permissions);

            //User Profiles
            UserProfile[] userProfiles = new UserProfile[] {
                new UserProfile {
                    Id          = Guid.NewGuid(),
                    FirstName   = "Ryan",
                    LastName    = "Helmoski",
                    Permissions = permissions.ToList()
                }
            };
            context.UserProfiles.AddRange(userProfiles);

            //Email Auths
            EmailAuth[] emailAuths = new EmailAuth[] {
                new EmailAuth {
                    Id             = Guid.NewGuid(),
                    UserId         = userProfiles[0].Id,
                    Email          = "*****@*****.**",
                    HashedPassword = "******"
                }
            };
            context.EmailAuths.AddRange(emailAuths);

            //Locations
            Location[] locations = new Location[] {
                new Location {
                    Id   = Guid.NewGuid(),
                    Name = "Test Location 1"
                },
                new Location {
                    Id   = Guid.NewGuid(),
                    Name = "Test Location 2"
                },
                new Location {
                    Id      = Guid.NewGuid(),
                    Name    = "Test Deleted Location",
                    Deleted = true
                }
            };
            context.Locations.AddRange(locations);

            //Trailers
            Trailer[] trailers = new Trailer[] {
                new Trailer {
                    Id         = 111111,
                    LocationId = locations[0].Id
                },
                new Trailer {
                    Id         = 222222,
                    LocationId = locations[0].Id
                },
                new Trailer {
                    Id         = 333333,
                    LocationId = locations[0].Id,
                    Deleted    = true
                }
            };
            context.Trailers.AddRange(trailers);

            //Loads
            Load[] loads = new Load[] {
                new Load {
                    Id            = Guid.NewGuid(),
                    Type          = LoadType.Inbound,
                    Status        = LoadStatus.InTransit,
                    TrailerId     = trailers[0].Id,
                    Appointment   = null,
                    DepartureTime = DateTime.UtcNow.AddDays(-3),
                    ArrivalTime   = DateTime.UtcNow,
                    OriginId      = locations[0].Id,
                    DestinationId = locations[1].Id,
                    CfNum         = 12345,
                    PuNum         = null
                },
                new Load {
                    Id            = Guid.NewGuid(),
                    Type          = LoadType.Outbound,
                    Status        = LoadStatus.Ready,
                    TrailerId     = trailers[1].Id,
                    Appointment   = DateTime.UtcNow.AddHours(1),
                    DepartureTime = null,
                    ArrivalTime   = DateTime.UtcNow,
                    OriginId      = locations[1].Id,
                    DestinationId = locations[0].Id,
                    CfNum         = 54321,
                    PuNum         = 51423
                },
                new Load {
                    Id            = Guid.NewGuid(),
                    Type          = LoadType.Intraplant,
                    Status        = LoadStatus.Complete,
                    TrailerId     = trailers[1].Id,
                    Appointment   = null,
                    DepartureTime = null,
                    ArrivalTime   = DateTime.UtcNow,
                    OriginId      = locations[1].Id,
                    DestinationId = locations[0].Id,
                    CfNum         = null,
                    PuNum         = null
                },
                new Load {
                    Id            = Guid.NewGuid(),
                    Type          = LoadType.LocalDelivery,
                    Status        = LoadStatus.InTransit,
                    TrailerId     = trailers[1].Id,
                    Appointment   = DateTime.UtcNow.AddMinutes(30),
                    DepartureTime = DateTime.UtcNow,
                    ArrivalTime   = null,
                    OriginId      = locations[1].Id,
                    DestinationId = locations[0].Id,
                    CfNum         = null,
                    PuNum         = null
                }
            };
            context.Loads.AddRange(loads);

            context.SaveChanges();
        }
Exemplo n.º 36
0
        private void openToolStripMenuItem_Click_1(object sender, EventArgs e)
        {
            if (openFileDialog1.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                listView3.Clear();
                IncludedFiles.Clear();
                MyGNIDA                = new GNIDA1(System.IO.Path.GetDirectoryName(Application.ExecutablePath) + "\\flirt.xml");
                MyGNIDA.OnLogEvent    += OnLogEvent1;
                MyGNIDA.OnAddFunc     += AddFuncEvent1;
                MyGNIDA.OnAddStr      += AddText;
                MyGNIDA.OnVarEvent    += AddVarEvent1;
                MyGNIDA.OnFuncChanged += OnFuncChanged1;


                Load     ldfrm = new Load();
                ListView lv    = ldfrm.ldrs();
                ListView da    = ldfrm.dsmrs();
                lv.Clear();
                da.Clear();
                foreach (string findPlg in System.IO.Directory.GetFiles(System.IO.Path.GetDirectoryName(Application.ExecutablePath) + "\\Loaders\\", "*.dll", System.IO.SearchOption.TopDirectoryOnly))
                {
                    Loaders(findPlg, lv);
                }
                foreach (string findPlg in System.IO.Directory.GetFiles(System.IO.Path.GetDirectoryName(Application.ExecutablePath) + "\\Dasmers\\", "*.dll", System.IO.SearchOption.TopDirectoryOnly))
                {
                    Dasmers(findPlg, da);
                }

                if (ldfrm.ShowDialog() == System.Windows.Forms.DialogResult.OK)
                {
                    MyGNIDA.assembly = lv.SelectedItems[0].Tag as ILoader;
                    MyGNIDA.MeDisasm = da.SelectedItems[0].Tag as IDasmer;
                    MyGNIDA.MeDisasm.Init(MyGNIDA.assembly);
                    ldfrm.Dispose();


                    MyGNIDA.LoadFile(openFileDialog1.FileName);

                    dynamicFileByteProvider = new DynamicFileByteProvider(openFileDialog1.FileName, true);
                    hexBox1.ByteProvider    = dynamicFileByteProvider;
                    hexBox1.LineInfoOffset  = (long)MyGNIDA.assembly.Entrypoint() + (long)MyGNIDA.assembly.ImageBase();

                    fastColoredTextBox1.Clear();
                    fastColoredTextBox1.Text = "//+---------------------------------------------------------------------+" +
                                               "\n//| Dis file has bin generated by GNU Interactive DissAssembler (GNIDA) |" +
                                               "\n//|       Copyleft (c) 2014 by me <*****@*****.**>              |" +
                                               "\n//|                          Free 4 use                                 |" +
                                               "\n//|                         Writed AS IS                                |" +
                                               "\n//+---------------------------------------------------------------------+\n";
                    //if( & DynamicLoadedLibraryFile)

                    if ((MyGNIDA.assembly.ExecutableFlags() & (ulong)ExecutableFlags.DynamicLoadedLibraryFile) != 0)
                    {
                        fastColoredTextBox1.Text += "#pragma option DLL\n";
                    }
                    else
                    {
                        switch (MyGNIDA.assembly.SubSystem())
                        {
                        case (ulong)SubSystem.WindowsGraphicalUI: fastColoredTextBox1.Text += "#pragma option W32\n"; break;

                        case (ulong)SubSystem.WindowsConsoleUI: fastColoredTextBox1.Text += "#pragma option W32C\n"; break;

                        default: fastColoredTextBox1.Text += "#pragma option W32;//TO-DO!!!\n"; break;
                        }
                    }
                    IncludedFiles.Add("Windows.h");
                    IncludedFiles.Add("msvcrt.h--");
                    fastColoredTextBox1.Text += "#jumptomain NONE\n";
                    foreach (string s in IncludedFiles)
                    {
                        fastColoredTextBox1.Text += "#include \"" + s + "\";\n";
                    }
                    VarLine = fastColoredTextBox1.LinesCount - 1;
                }
            }
        }
Exemplo n.º 37
0
 /// <summary>
 /// Gets the equivalent nodal loads due to specified <see cref="load"/>.
 /// </summary>
 /// <param name="load">The load.</param>
 /// <returns>Equivalent nodal loads in global coordinate system</returns>
 public abstract Force[] GetEquivalentNodalLoads(Load load);
Exemplo n.º 38
0
 ///<inheritdoc/>
 public override Force[] GetEquivalentNodalLoads(Load load)
 {
     throw new NotImplementedException();
 }
Exemplo n.º 39
0
 protected virtual void OnLoad(string url, Resource resource) => Load?.Invoke(this, new LoadResourceEventArgs(url, resource));
Exemplo n.º 40
0
 public static void CallLoad() => Load?.Invoke();
        /// <summary>
        ///
        /// </summary>
        /// <param name="tm">To map</param>
        public void LoadMap(int tm)
        {
            Load load = new Load(multiBoard, tabs, MakeRightClickHandler(), tm.ToString());

            LoadMap(load);
        }
Exemplo n.º 42
0
            public static void LoadConnections(bool WithDialog = false, bool Update = false)
            {
                Load conL = new Load();

                try
                {
                    bool tmrWasEnabled = false;
                    if (TimerSqlWatcher != null)
                    {
                        tmrWasEnabled = TimerSqlWatcher.Enabled;

                        if (TimerSqlWatcher.Enabled == true)
                        {
                            TimerSqlWatcher.Stop();
                        }
                    }

                    if (ConnectionList != null && ContainerList != null)
                    {
                        PreviousConnectionList = ConnectionList.Copy();
                        //PreviousContainerList = ContainerList.Copy;
                    }

                    ConnectionList = new Connection.List();
                    ContainerList = new Container.List();

                    if (Settings.Default.UseSQLServer == false)
                    {
                        if (WithDialog)
                        {
                            OpenFileDialog lD = Controls.ConnectionsLoadDialog();

                            if (lD.ShowDialog() == DialogResult.OK)
                            {
                                conL.ConnectionFileName = lD.FileName;
                            }
                            else
                            {
                                return;
                            }
                        }
                        else
                        {
                            conL.ConnectionFileName = GetStartupConnectionFileName();
                        }

                        if (File.Exists((string)conL.ConnectionFileName) == false)
                        {
                            if (WithDialog)
                            {
                                MessageCollector.AddMessage(MessageClass.WarningMsg,
                                                            string.Format(
                                                                Language.strConnectionsFileCouldNotBeLoaded,
                                                                conL.ConnectionFileName));
                            }
                            else
                            {
                                MessageCollector.AddMessage(MessageClass.InformationMsg,
                                                            string.Format(
                                                                Language.
                                                                    strConnectionsFileCouldNotBeLoadedNew,
                                                                conL.ConnectionFileName));
                                NewConnections(conL.ConnectionFileName);
                            }

                            return;
                        }

                        CreateBackupFile(conL.ConnectionFileName);
                    }

                    conL.ConnectionList = ConnectionList;
                    conL.ContainerList = ContainerList;

                    if (PreviousConnectionList != null && PreviousContainerList != null)
                    {
                        conL.PreviousConnectionList = PreviousConnectionList;
                        conL.PreviousContainerList = PreviousContainerList;
                    }

                    if (Update)
                    {
                        conL.PreviousSelected = LastSelected;
                    }

                    conL.Import = false;

                    Node.ResetTree();

                    conL.RootTreeNode = Windows.treeForm.tvConnections.Nodes[0];

                    conL.UseSQL = Settings.Default.UseSQLServer;
                    conL.SQLHost = Settings.Default.SQLHost;
                    conL.SQLDatabaseName = Settings.Default.SQLDatabaseName;
                    conL.SQLUsername = Settings.Default.SQLUser;
                    conL.SQLPassword = Crypt.Decrypt((string)Settings.Default.SQLPass,
                                                     (string)General.EncryptionKey);
                    conL.SQLUpdate = Update;

                    conL.LoadConnections();

                    if (Settings.Default.UseSQLServer == true)
                    {
                        LastSqlUpdate = DateTime.Now;
                    }
                    else
                    {
                        if (conL.ConnectionFileName ==
                            Connections.DefaultConnectionsPath + "\\" +
                            Connections.DefaultConnectionsFile)
                        {
                            Settings.Default.LoadConsFromCustomLocation = false;
                        }
                        else
                        {
                            Settings.Default.LoadConsFromCustomLocation = true;
                            Settings.Default.CustomConsPath = conL.ConnectionFileName;
                        }
                    }

                    if (tmrWasEnabled && TimerSqlWatcher != null)
                    {
                        TimerSqlWatcher.Start();
                    }
                }
                catch (Exception ex)
                {
                    MessageCollector.AddMessage(MessageClass.ErrorMsg,
                                                string.Format(
                                                    Language.strConnectionsFileCouldNotBeLoaded +
                                                    Constants.vbNewLine + ex.Message + ex.StackTrace,
                                                    conL.ConnectionFileName));
                    if (Settings.Default.UseSQLServer == false)
                    {
                        if (conL.ConnectionFileName != GetStartupConnectionFileName())
                        {
                            LoadConnections();
                            return;
                        }
                        else
                        {
                            Interaction.MsgBox(
                                string.Format(Language.strErrorStartupConnectionFileLoad, Constants.vbNewLine,
                                              Application.ProductName, GetStartupConnectionFileName(), ex.Message),
                                MsgBoxStyle.OkOnly, null);
                            Application.Exit();
                        }
                    }
                }
            }
Exemplo n.º 43
0
 public ConveyorEnterLoadEventArgs(Load load)
 {
     Load = load;
 }
Exemplo n.º 44
0
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            //TODO: What if users changes the screen? (That uses a different dpi)
            #region DPI

            var source = PresentationSource.FromVisual(Application.Current.MainWindow);

            if (source != null)
                if (source.CompositionTarget != null)
                    _dpi = source.CompositionTarget.TransformToDevice.M11;

            #endregion

            #region Window Offset

            //Gets the window chrome offset
            _offsetX = (int)Math.Round((ActualWidth - ((Grid)Content).ActualWidth) / 2);
            _offsetY = (int)Math.Round((ActualHeight - ((Grid)Content).ActualHeight) - _offsetX);

            #endregion

            _loadDel = LoadVideoDevices;
            _loadDel.BeginInvoke(LoadCallBack, null);
        }
Exemplo n.º 45
0
        public void sensor_OnEnter1(DematicSensor sender, Load load)
        {
            Core.Environment.Log.Write(load.ToString() + "sensor_OnEnter1");
            Case_Load caseload1 = load as Case_Load;

            if (caseload1 == null)
            {
                Core.Environment.Log.Write(Name + ": Error. Load is not a caseload " + load + " entering MS", Color.Red);
                Core.Environment.Scene.Pause();
                return;
            }

            if (string.IsNullOrWhiteSpace(caseload1.SSCCBarcode))
            {
                Core.Environment.Log.Write(Name + ": Error. Tote " + load + " entering MS has no SSCCBarcode!", Color.Red);
                Core.Environment.Scene.Pause();
            }

            if (MultiShuttle.caseloads.Contains(caseload1))
            {
                Core.Environment.Log.Write(Name + ": Error. Tote ULID: " + load + " enters MS, but ULID is already known by MS. Did MS recieve type 20?", Color.Red);
                return;

                Core.Environment.Scene.Pause();
            }
            else
            {
                MultiShuttle.caseloads.Add(caseload1);
            }

            load.UserDeletable = false;
            load.Deletable     = true;

            //InfeedPickStationConveyor ElevatorConveyor = sender.Parent.Parent.Parent as InfeedPickStationConveyor;
            Case_Load caseload2 = null;

            ActionPoint ap2 = location2;

            if (ap2 != null)
            {
                caseload2 = ap2.ActiveLoad as Case_Load;
            }

            //Reset wmswait in case BK10 forgot...
            caseload1.Case_Data.RoutingTableUpdateWait = false;
            caseload1.Case_Data.OriginalPosition       = "";
            caseload1.Case_Data.CurrentPosition        = "";
            caseload1.Case_Data.DestinationPosition    = "";
            caseload1.Case_Data.PLCName         = "";
            caseload1.Case_Data.MissionTelegram = null;

            caseload1.CurrentPosition = infeedInfo.location1Name; //Update current location

            if (caseload2 != null && caseload2.Waiting)           //A tote at location2 and waiting for this tote
            {
                load.Stop();
                caseload2.WaitingTime = 0;                        //Stop waiting. This triggers Tote_PickStation2TimeOut
                return;
            }

            if (Route.Loads.Count == 2 && caseload2 == null) //A caseload should arrive after this on location 2 or is being moved on to the elevator...
            {
                if (Route.Loads.Last.Value.Distance < MultiShuttle.PickStationNameToActionPoint[infeedInfo.location2Name].Distance)
                {
                    if (Route.Loads.Last.Value.UserData is MultishuttleElevatorJobData)//case is moving on to elevator. Let this one pass
                    {
                        return;
                    }

                    load.Stop();
                }
                return;
            }
            if (Route.Loads.Count > 2 && caseload2 == null)
            {
                load.Stop();
                return;
            }
            if (caseload2 != null && !caseload2.Waiting)                    //caseload2 has already sent 25 arrival telegram.
            {
                load.Stop();
            }
        }
Exemplo n.º 46
0
 public Task AddAsync(Load load)
 {
     return(Task.Run(() => Add(load)));
 }
Exemplo n.º 47
0
 public Task UpdateAsync(Load load)
 {
     return(null);
 }
Exemplo n.º 48
0
 private void Window_Loaded(object sender, RoutedEventArgs e)
 {
     _loadDel = LoadVideoDevices;
     _loadDel.BeginInvoke(LoadCallBack, null);
 }
Exemplo n.º 49
0
    protected float nextFire = 0.5F; //time until fire again

    #endregion Fields

    #region Methods

    public void shoot(Load load)
    {
        Instantiate (load.projectile, this.transform.position + load.offset, this.transform.rotation * load.rotation);
    }