C/C++ Code generation from xcos in scilab - c

I've developed a model in xcos in scilab and I'd like to generate the C/C++ code of this model so that I can deploy it in embedded system.
However the issue is that the Code generating item in Tools menu is disabled. I guess it means I don't have the tool which converts the graphical model into code. I'm running linux.
Could you please help me with finding the plugin to generate the code?

You might have already done it, but would be useful for others.
The answer is X2C software, can be downloaded from - http://www.mechatronic-simulation.org/download/
Download the zip file, unzip it and navigate to "X2Copen-v1028-2016-09-10\X2C\System\Scilab\Scripts" and run the file "setup.sce" from scilab console.
You can run this file just by drag and drop to scilab console.
Start XCOS from scilab and create your model, then press "Start communicator" and "Transform model and push to communicator". You will see a dialog box for connection configuration, choose appropriate and download.

Related

Hand coded GUI build failed in Codename One

In this project I started to create a form with the GUI Builder but I did not feel comfortable with this tool. Consequently I rather hand coded it based on a demo example https://github.com/codenameone/MaterialScreensUIKit/blob/master/src/com/codename1/uikit/materialscreens/LoginForm.java.
I should mention that I changed the name for the hand coded form from MainForm to MainForm2 and that I am using Netbeans with the latest availabel plugin of CN1 (updated November 7th 2016). Now for nearly each and every simulator run (when I click on the IDE play button) I get this error :
ant -f /home/blablah/CN1Project -Dnb.internal.action.name=run run
Processing GUI builder file: /home/blablah/CN1Project/src/myPackage/MainForm.java
/home/blablah/CN1Project/build.xml:469: Gui builder source file corrupt, the don't edit below/above this line comments seem to be missing or modified!
ErrCcode A: -1 ErrCode B: -1
BUILD FAILED (total time: 0 seconds)
Line 469 reads :  <generateGuiSources srcDir="src" encoding="UTF-8" guiDir="res/guibuilder" />
I understand the error message and I can confirm that the line comments is missing since I did create the form manually. Yet if I click a second time on the play button the simulator runs without error. Please note that the same behaviour also appears if I send build to CN1 server (two clicks needed).
What's the proper way of creating manually a Form (as shown in the demo codes), should I create it via new CN1/ GUI Builder Form or can I simply add the comments to make the compiling process happier ?
Any help appreciated,
In your project directory look under res/guibuilder and in that hierarchy you will find a .gui file matching your java source file. Delete that and the file will stop being a GUI builder file.

"Operation in progress..." Never Ends When Previewing Rows in Kettle Spoon via Salesforce

I am trying to pull data from a Salesforce API account using Pentaho/Kettle Spoon. I am able to establish a connection on Pentaho with this account. I am also able to get fields from specific modules. However, when I try and "Preview rows" (even with a small number of rows), the "Operation in Progress" window comes up and never completes the task. When I try and cancel the job, Pentaho hangs and I have to force quit it.
I am running Fedora 21. Any input is greatly appreciated.
Thanks!
This works for me:
Since upgrading to Fedora 22 Spoon (the client tool of PDI) was not working properly anymore. Although I could start Spoon properly and create transformations etc, once I wanted to execute a transformation or sometimes even when trying to open settings, nothing was working and the terminal window showed several (SWT:20352): GLib-CRITICAL error messages. In a nutshell, Spoon was rendered useless.
Here is how to solve this:
Go to the Eclipse Download Page and download the latest 64bit verion of Eclipse IDE for Java EE Developers. Note: There is a separate download area for SWT; however, for Linux there is no 64 bit version available. The only way to get one is to build it yourself. So I just went the easier way and downloaded Eclipse instead.
Unzip the file and search for swt. A search result will show a few files, but the ones interesting for us are (your version number might be different): org.eclipse.swt_3.103.2.v20150203-1313.jar and org.eclipse.swt.gtk.linux.x86_64_3.103.2.v20150203-1351.jar.
Copy the first one of these files into <PDI_HOME>/libswt/linux/x86 and the second into <PDI_HOME>/libswt/linux/x86_64.
oth folders still have the original jar files in them. Rename them to swt-jar-old (Note: no extension, so that they are not picked up).
Start Spoon. There will be a few error messages shown, but so far Spoon is working way better for me than before.
FONT: http://diethardsteiner.github.io/pdi/2015/06/07/Fixing-PDI-GLib-CRITICAL.html
i'm running Ubuntu 14.04, i5,6gb RAM, got same trouble..
when i check, the load in proccessor is 100%, evertime i try showing the content or other thing in pentaho, the Operation in progress is show up, and never end..
How to solve, check your access to file/connection in your database,unrecognize file,field,etc. after this resolve, my proccessor run normal, and i could run / execute the transformation.

"stack.cpp not found" prevents debug in VS 2013 express

I'm a rookie at C in general and VS 2013 also. I am trying to use some C code provided by a vendor in VS 2013 express. It compiles and runs without problem using the command line compiler but I would like to use the IDE.
I started a new project, C++ for console app, and I have pasted the code into the IDE and saved it as xyy.c so that it builds successfully. I thought it would be nice to have it in a GUI, so I duplicated the effort with a Win32 app project. It also builds.
The program's job is to connect to a PCI card that has Plx chip as an interface and program an FPGA. The Win32 program succeeds, even though I can't see any of the info printed by the program. The console program fails and I think it is because it fails to find the driver for the Plx chip. I thought I would get a clue by single stepping through the Win32 program to see which driver was supposed to be found.
However, after the first pass through a while loop, I get a pop up that says "Source Not Found" and "stack.cpp not found". Google wasn't any help to me.
I be grateful for any suggestions.
You might have "Enable .NET Framework source stepping" enabled (see http://msdn.microsoft.com/en-us/library/cc667410.aspx). So when you are at Stack... and trying to step into, it will actually try, but you don't have the sources for that. There is also a new experience for using the .NET framework reference source that was announced recently: http://blogs.msdn.com/b/dotnet/archive/2014/02/24/a-new-look-for-net-reference-source.aspx
I faced the same problem. I advise at the moment of receiving the information "stack.cpp not found" to look at the stack trace and check if there is something like this: "RTC".
If there is, you need to change the flag along the path (for example, set the Default or a more convenient configuration for you):
Project Properties -> C/C++ -> Code Generation -> Basic Runtime Checks
More details: https://learn.microsoft.com/en-us/cpp/build/reference/rtc-run-time-error-checks?view=msvc-160

Apple automator save as ### filename + extension selection

I'm trying to get some automator script going but I have no clue how to achieve it. It's like this:
in Processing I exported a batch of 1850 SVG's. These SVG's now have to be opened in an application called Cenon. This application can save SVG's as .hpgl files.
It's no problem to open a file in a specific application like Cenon when it's added to a folder. That works fine.
But how do I save this file in a specific extension like .hpgl and create a variable name? Because Cenon always opens a file with the name 'UNTITLED'.
So I need to do:
automatically open file one by one in Cenon
save file as .hpgl file
save file with variable name like (0001, 0002, 0003, 0004, 0005, etc.)
I hope someone can help me!!
Thanks in advance,
Fons.
First of all, let me make a distinction between two related technologies:
AppleEvents which are messages that can be used for different applications to communicate with each other, asking each other to do tasks.
AppleScript which is one kind of scripting language that can send and receive AppleEvents to and from Mac applications.
You can't use AppleEvents with Cenon but you still may be able to use AppleScript with Cenon. I know that you can't use AppleEvents with Cenon because I downloaded Cenon version 4.0.1 from the web and I tried to open up it's AppleEvent dictionary with the "AppleScript Editor.app" application that comes with OS X.
So, AppleEvents are out. This means the "tell" command in AppleScript can't tell the Cenon.app to do anything with AppleEvents, but you may still be able to use AppleScript.
AppleScript can be used by simulating user menu-selections and key strokes instead of using AppleEvents. Using AppleEvents would be better, but sometimes, using AppleScript, you have to go through the user interface.
An alternative to resorting to using AppleScript to simulate the user-interface (UI) would be to use a shell-command. It just seems to me that this would be a better solution, but you would have to find a Unix shell command that was compiled for Mac that would convert from .svg to .hpgl
If you really want to use AppleScript and Cenon.app, here is a link to study about using AppleScript going through the UI of an app:
http://www.macosxautomation.com/applescript/uiscripting/
AppleScript was originally designed to be a scripting language to take some of the functionality with application A, and then take some of the functionality of application B, etc, and glue it together with a little logic from AppleScript and empower the user to more easily automate their tasks.
AppleScript was designed to be an alternate user-interface, going through AppleEvents, but AppleEvents are not as widely supported as they could be by applications, so this kludgy solution of having AppleScript go through the GUI is commonly done.
Again, I think that a shell script would be a better solution for this problem and you could call is "solution.command" or you could embed the shell script into an Automator Workflow saved as an Application or embed the shell script within an AppleScript saved as an application. Either one work work.

Eclipse: choosing a default debugger for all new C projects

Whenever I start a new project, I have to go through setting up the debugger with Eclipse time and time again before I can use it. Isn't there a default setting for all new C projects I can change?
I'm not sure exactly what you mean by "setting up the debugger" (perhaps you can clarify), but under "Preferences -> Run/Debug -> Launching -> Default Launchers" you should be able to select your preferred launcher for different kind of launch modes. This can also be selected individually for each launch configuration.
Typically it is up to the toolchain and/or project to determine which debugger/launcher is suitable to use for that specific project, but I know there is a bug in CDT which prevents toolchains from properly specifying the default launcher to use.
I only use Eclipse for Java, so I can't give you an authoritative answer. But since no one else seems to be answering:
Java projects have a (more or less) hidden file in the project directory called .project and another one called .settings . I'm not sure if this would apply to the C environment as well, but it seems likely. You may want to look at the set of such "hidden" files for a well set up project and a virginal project side by side to find out which settings make the difference.
Given that information, you may be able to simply edit (perhaps with some assistance from a script you can write yourself) the file(s) in question to do the configuration textually without a lot of mouse clicking.

Resources