How to enter the correct format to view vehicle emissions? - sumo

I want to see the emissions data of the vehicle during the simulation after the simulation ends, but it may be that the format I imported is wrong, and the simulation cannot run. If you can, can you give me a screenshot of the actual example, which is convenient for me to compare. Thank you!
enter image description here

The problem shown in the image is a much more basic one. The variable exp you use is not known. You may want to read some introductory lessons on python before diving into sumo.

Related

Resistive current measurement by novizon

can anyone provide vi file of resistive current measurement as following block diagram?
It is impossible translate this image into code since it is not a LabView code snippet but just a plain image and you are missing the code for the sub-VI and the express VIs.
My suggestion would be to contact Novizon or any of the co-authors of the paper where this image is coming from on ResearchGate and hope they are willing to supply you with the VIs.

How to find the size of a reg in verilog?

I was wondering if there were a way to compute the size of a reg in Verilog. I researched it quite a bit, and found $size(a), but it's only in SystemVerilog, and it won't work in my verilog program.
Does anyone know an alternative for this??
I also wanted to ask as a side note; I'm having some trouble with my test bench in the sense that when I update a value in the file, that change is not taken in consideration when I simulate. I've been told I might have been using an old test bench but the one I am continuously simulating is the only one available in this project.
EDIT:
To give you an idea of what's the problem: in my code there is a "start" signal and when it is set to 1, the operation starts. Otherwise, it stays idle. I began writing the test bench with start=0, tested it and simulated it, then edited the test bench by setting start to 1. But when I simulate it, the start signal remains 0 in the waveform. I tried to check whether I was using another test bench, but it is the only test bench I am using in this project.
Given that I was on a deadline, I worked on the code so that it would adapt to the "frozen" test bench. I am getting now all the results I want, but I wanted to test some other features of my code, so I created a new project and copy pasted the code in new files (including the same test bench). But when I ran a simulation, the waveform displayed wrong results (even though I was using the exact same code in all modules and test bench). Any idea why?
Any help would be appreciated :)
There is a standardised way to do this, but it requires you to use the VPI, which I don't think you get on Modelsim's student edition. In short, you have to write C code, and dynamically link it to the simulator. In the C code, you can get object properties using routines such as vpi_get. Useful properites might be vpiSize, which is what you want, vpiLeftRange, vpiRightRange, and so on.
Having said all that, Verilog is essentially a static language, and objects have to be declared with a static width using constant expressions. Having a run-time method to determine an object's size is therefore of pretty limited value (since you should already know it), and may not solve whatever problem you actually have. Your question would make more sense for VHDL (and SystemVerilog?), which are much more dynamic.
Note on Icarus: the developers have pushed lots of SystemVerilog stuff back into the main language. If you take advantge of this you may find that your code is not portable.
Second part of your question: you need to be specific on what your problem actually is.

Writing an app that previews the result of a small part of code

This may seem strange, so I will try to explain it as best I can:
I want to write an application for OS X that will accept some code as an input and will produce a visual output. The input will be in Objective C and the output will be the output that this code describes.
The output may be text or graphics based, it doesn't matter. What matters is that I don't know how can I make this input be handled as Objective C code and be executed by the system as such. I have a big experience with Objective C, but I hadn't had the chance to get involved with something like this.
Can anyone point me in the right direction?
So if I understand correctly, you want to:
Take Objective-C input
Parse it
And show its structure to the user in a visually digestible form.
Now the hard part is parsing it - for that you'll need a compiler front-end, possibly LLVM-clang. When you have an abstract syntax tree of the code, you can walk that tree and easily construct some graphics or structured, human-readable text to describe what the code does.
Edit: so you want to actually compile and execute that code. Then you have to go one step further and compile the code then run it.

How to implement an NSTextView that performs on-the-fly markup to RTF conversions

I'm trying to build an NSTextView that can take "marked up" input that is automatically translated into beautiful RTF-style text while the user types.
The idea is to let the user enter text in "plain text" format, but to "beautify" it on the spot, e.g.
H1 A quick list:
* first item
* second item
would be translated into a first line with a header font, followed by a bulleted list.
I have found plenty of potential ways of doing this, but the Text System is incredibly complicated (with reason) and I don't want to start "cooking my own" if there is already something suitable built-in. BTW I would be happy with a Snow Leopard only API.
The first thing I thought of was "data detectors", but I can't find a public API for doing this.
Having reached the end of the road with that, I turned to the new "Text Input Sources API". This does all kinds of things, but the "data-driven input methods" section of the WWDC 2006 presentation "Take Charge of the Text Input" seems interesting in my context. Beyond that single presentation slide however nothing seems to exist anywhere, so it's a bit of a dead end again.
Finally, I had a look at the NSSpellChecker class which is also supposed to offer completion features and automatic corrections.. but I'm not sure how this could be re-purposed for my requirements either.
At the moment, I'm tempted to just re-parse the entire NSTextStorage manually and make the changes myself when the user stops typing.. but I'm sure there are cleverer heads around this forum..
Any advice or pointers in the right direction would be greatly appreciated.
Neither data detectors nor the spell checker are appropriate for this task. Assuming you're just looking for a way to pass the input to a parser/formatter you already have, interfacing with the text system isn't too difficult. You're on the right track with handling the editing to NSTextStorage.
Along those lines, there's no need to re-parse the entire thing when the user stops. The text system sends you the modified range and gives you the opportunity to act on those changes (and even reject them out of hand). Since all changes funnel through this (typing, pasting, dropping...), this is the point where you want to intercede.
Because you're dealing with headings and bulleted lists, I'd get the enclosing paragraph of the modified range. This gives you a nice, round unit of work that is easily discovered and perfectly fits what you're trying to accomplish.
Good luck!

Hexadecimal numpad

The project I am currently working on requires a lot of hexadecimal numbers to be entered into the code.
I once saw a pic of an old keyboard with a hexadecimal numpad (has A-F letters on it also) replacing the normal numpad. Anyone know where I can get one of these?
IPv6 Buddy -keypad should work well for hexadecimal input.
http://www.ipv6buddy.com/
If you can get your hands on one of the retired space shuttles, they have one!
I have an old Heathkit learning toy with a hex numpad because the only way to program it was to assemble code by hand (it came with a 6800 manual and some notepads) into the online monitor. This was actually fun!
Mine is missing the 'D' button however.
Great idea with the programmable keypad. I think i am going to pick up one of these: DX1 input system. Works for any reconfiguring I might want to do.
Is this the one you're talking about?
funky http://www.cpmuseum.com/Exhibits/Apple%20Lane/7603/7603-0005/images/000%20Front%20View.jpg
While this has a lot of "gee whiz" appeal, I have to say:
You have two hands. Use them. A-F are all reachable with the left hand on a standard keyboard while your right hand is on the num-pad. Instead of putting muscle-memory time into some arcane Hex-pad, you'll be learning to touch-type with your left hand, which has application outside your current project.
Better yet, come up with a smarter way of getting the hex codes into your code. Write a script that extracts them from your data-source and into your code as symbolic variables... or whatever.
EDIT
Ok, I'll give you the benefit of the doubt. Lets assume you're working on a hardware project and need to provide a specialized interface for your user. Maybe a programmable keypad would fit the bill?
Not sure of the specifics right now, but I'm pretty sure you can easily write a keyboard remapper. You could remap the QWASDF keys to ABCDEF in order to type them more quickly. That way you could use 2 hands to type. Or if you are in control of the program they are being typed into, you could just translate the keys in code on the fly. You also might want to try out the Microsoft Keyboard Layout Creator