Reading Weighing Scale Tru rs232

i been using this code from How to display weight from weighing scale into a textbox via serial port RS-232 or usb converter?but unfortunately i keep receiving this data Listening on COM6... 03301B+00003301B+000033+00003301B+00003301B+001B+00003301B+00003301B03301B+00003301B+000033+00003301B+00003301B+001B+00003301B+00003301B03301B+00003301B+000033+00003301B+00003301B+001B+00003301B+00003301B03301B+00003301B+000033+00003301B+00003301B+001B+00003301B+00003301B03301B+00003301B03301B+00003301B+000033+00003301B+00003301B+001B+00003301B+00003301B03301B+00003301B+000033+0000330...

VS 2015 ASP.NET Web API (EF6) & Xamarin Enable-Migrations fails

I'm developing a project that will use ASP.NET Web API as the data service, and a Xamarin portable app as client.I'm trying to enable migrations in the web app, but I get the following error:Enable-Migrations -enableautomaticmigrations -ContextTypeName MyProject.Models.ApplicationDbContext -ProjectName MyProject -StartupProjectName MyProject.App -VerboseUsing StartUp project 'MyProject.App'.Exception calling "SetData" with "2" argument(s): "Type 'Microsoft.VisualStudio.ProjectSystem.VS.Implementation.Package.Automation.OAProject' in assembly 'Microsoft.VisualStudio.ProjectS...

WinForm button keeps focus

I have a winform with several buttons, when I hit a button, it runs the Click Event Handler, and then the button keeps selected, so if then I hit the ENTER key in the keyboard, it will run the Click event handler for that button again. I guess this is the default behavior for a button (keeping it selected when its clicked) but I cant find a way to remove that behavior.I tried the methods Focus() and Select() for another control, but the button is still Selected/Focused/Activeany help? If you don´t want a user to hit enter and fire the event again while it is still runnin...

Make object visual size constant despite the distance

Visual aid herePlease see visual aid. Following the gif, there are two GUIs. The GUI on the left is scaling properly based on the cameras distance to the object. The GUI on the right is scaling, seen clearly in the 'Scene' view, but not even noticeable in game view. The application is for the Hololens as the users head controls the camera within the Unity scene.The problem lies in setting the objects scaling. Been racking my brain all day trying to replicate the type of scaling shown on the left GUI. Dividing the distance and using this as the factor to scale by is clearly...

How to read added record on list add on event

i have a list/Event by following code class MyList<T> : List<T> { public event EventHandler OnAdd; public void Add(T item) { if (null != OnAdd) { OnAdd(this, null); } base.Add(item); } } MyList<connectedUser> myListUsers = new MyList<connectedUser>(); myListUsers.OnAdd += new EventHandler (myListUsers_OnAdd ); private void myListUsers_OnAdd(object sender, EventArgs e) { }public class connectedUser{ public string userID { get; set; } ...

MVVMLight CanExecute not working until window click

Quick note so I do not waste anyone's time. When installing MVVMLight from nuget I eventually get an error null : The term 'null' is not recognized as the name of a cmdlet, function, script file, or operable program. MVVMLight seems to work fine despite this except the issue that will be described below, but I wanted to mention this just in case.The ProblemI am experiencing an issue with buttons not re-enabling after command execution completes. It seems they sometimes work if the execution is very fast, but any operation that takes a while seems to never work. This screams...

Xamarin MvvM contentview binding

I've developing an App with Xaramin.In my solution I've created a ContentView.xaml, as a custom GUI control.<?xml version="1.0" encoding="UTF-8"?><ContentView xmlns="http://xamarin.com/schemas/2014/forms" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" xmlns:local="clr-namespace:test2;assembly=test2" x:Class="test2.MyView"> <ContentView.BindingContext> <local:MyViewModel MyValue="1"/> </ContentView.BindingContext> <StackLayout> <Label HorizontalOptions="CenterAndExpand" VerticalOptions="CenterAndE...

Xamarin Forms UWP Push Notification Click

I have implemented a push notification feature for my Xamarin.Forms UWP app and i am able receive notifications and then pop up a toast. I am using the code below for this.//This method is triggered when a user taps/clicks the notificationprivate void Toast_Activated(ToastNotification sender, object args){ ToastActivatedEventArgs targs = (ToastActivatedEventArgs)args; var xml = sender.Content.GetXml(); XmlDocument xDoc = new XmlDocument(); xDoc.LoadXml(xml); XmlNodeList txts = xDoc.GetElementsByTagName("text"); var sitid = txts[0].InnerText; var id = si...

A hot observable that switches what it emits depending on system state (with code sample)

I'm just starting with Reactive programming (rx, C#). I'm trying to make a hot observable that switches its behavior depending on the current system state. Here are the textual description of what I'm trying to achieve, the state diagram to simplify understanding what it should do and the "close to working" code sample that can be run to interactively test the code.Any help or directions are highly appreciated, thank you!Textual descriptionMake a hot observable that:emits nothing in the initial statewhen RepeatingMessage is set, emits the message at specified periodswhen Re...

Authentication in local debug build of Azure App Service results in 401 Unauthorized

I'm trying to debug an Azure App Service .Net backend project that has authentication/authorization enabled for database API access. Attempting to use it results in 401 Unauthorized.I have set, as suggested elsewhere, the MobileServiceClient object's AlternateLoginHost to point to the remote Azure service so that it would be relied on. In the App Service project, I have copied SigningKey from the Kudu settings page (https://[servicename].scm.azurewebsites.net) and have set ValidAudience and ValidIssuer to the app service address (https://[servicename].azurewebsites.net/). C...

Window SizeToContent and ListBox sizing

I am trying to figure out how to use a WPF list box in conjunction with a window that has its SizeToContent property set to WidthAndHeight. The MainWindow has a grid with two rows and two columns. In the bottom right quadrant, I have a list box. I want the rest of the controls in the window to control the size of the window, and the list box to simply fill the available space. Currently, the list box is expanding to fit its contents, which causes the entire MainWindow to expand.Note: I attempted to create a simple example, but want to point out that in my real scenario ...

Dynamic table in universal app

I am developing universal app for windows phone 8.1/windows 8.1. I am using MVVM pattern. I have table with dynamic number of stackpanels that are bind to source in view model. One stackpanel is one row in the table. How can I make items in stack panels same width? I know about IsSharedSizeScope, but this is not available in grids in universal app.<ItemsControl Grid.Column="1" HorizontalAlignment="Stretch" ItemsSource="{Binding PowerMaxiTableSource0, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}"> <ItemsControl.ItemTemplate> <DataTem...

How can I set a PDF paragraph's font using iTextSharp?

Trying to follow the example here, I added the following code to create the title of a PDF doc:using (var doc = new Document(PageSize.A4, 50, 50, 25, 25)){ using (var writer = PdfWriter.GetInstance(doc, ms)) { doc.Open(); var docTitle = new Paragraph("UCSC Direct - Direct Payment Form"); var titleFont = FontFactory.GetFont("Lucida Sans", 18, Font.Bold); doc.Add(docTitle);However, the attempt to create titleFont wouldn't compile ("The best overloaded method match for 'iTextSharp.text.FontFactory.GetFont(string, float,...

C# loop through class list but only once for multiple names

This question already has an answer here: LINQ: Distinct values 6 answers Why not use a dictionary with key for the name and integer array or list:var allData = new Dictionary<string, List<int>>();allData["Bob"] = new List<int>() { 1 , 2 , 3 };var allInts = allData.Values.SelectMany(m => m); // IEnumerable<int>var intsByName = allData["nameToSelect"]; // List<int>var availableNames = allData.Keys;There is no harm in your proposed data structure either:va...

Downloading PDF from azure fails to load when reopening

I am trying to download a pdf file from azure's blob storage in a memory stream. However, when I try to open the file it does not load.Here is the code I am using.Download Code protected void blobDownload_Click(object sender, EventArgs e) { //Getting the blob storage container values DBAccess dbaCon = new DBAccess(); DataTable dt = dbaCon.GetTrainingRecord(TrainingTrainingRecordID.Value); string companyID = dt.Rows[0].Field<string>("fk_company_id"); string blobStorageName = dt.Rows[0].Field<string>("uploaded_file"); ...

c# inheritance of base class to template

I want to write a framework which needs to implement a few functions. Now I need to access the base class functions from the framework, which does not work.I need to inherit form a given class "Master"public class MyClass : Master{ protected override void Initialize() { FunctionInMaster(); VariableInMaster = true; }}Now I simply want to create a class that can be derived and implements Master functions.public class MyFrameworkClass{ // framework override public void whatever() { FunctionInMaster(); VariableInMaster = true; }}public class MyClass...

Page 1 of 2012  |  Show More Pages:  Top Prev Next Last