C++ :: Determine Health Of A Power Transformer - Graphic User Interface?
Nov 27, 2014
I have a program I want to write that determines the health of a power transformer. I know the syntax of all the other code I might have to use but I'm not too sure of how to make it fit into a graphic interface like you see in any other windows program.
is there a difference when creating a graphic user interface dragging and dropping controls in the form and coding on source code, difference in a sense that the code will appear differently if the control is dragged then the code appears automatically on the source code as compared to typing it on source code?
I am writing code for a program that will take user input selection of columns and determine an array based on that.The number of columns will be user selected.The number of rows equals 3^(columns) <--exponent not XOR
- This is because each column has the possibility of having the numbers 0,1,or 2
For example, if the user were to select "4" columns, then the array would have 4 columns and 3^4=81 rows. Then I would like to populate this with all of the possible combinations of 0,1,2
How to accumulate the reduction in health points in the loop. I have structured my program so it calls to 2 functions during the loop. These are the playerStrike() and computerStrike(). They seem to be looping well with the one exception that the counters reset back to 100 health points each time. I know it's reloading the original variable amount but how to prevent it from doing this.
I am drawing two circle (inner circle and outer circle) using DrawElipse method. I have created two pen object named OuterPen and InnerPen and creating Outer Circle using OuterPen and Inner Circle using InnerPen. Problem that I am facing is that when I increase the size of outer pen lets say 10px then it overlaps the inner circle and inner circle is hide. How can I increase the size of OuterPen outwards and not inwards so that it don't overlap the inner circle?
getrowsize() gives the size of a row in bytes (see VGA CRTC register). getVRAMMemAddrSize() gives the size of a pixel in memory (1=byte,2=word,4=dword) set/getBitPlaneBit(startaddr,plane,offset,bit[,on when writing]) sets/gets a bit on a specific bit plane offset (start addr is the start address register from VGA, plane is the plane to read/write, offset is the offset within the plane, bit is the bit to read/write (0-7), [on(when writing) is the value of the bit)]
Main is supposed to be sending values to the power function.Write a prototype and function for calculating powers of numbers.This version should have an integer return type and take two integer inputs, for the base and the exponent. It should do the following:
• handle negative bases • return an error on negative exponents (we’re not doing those yet) • handle zero exponents
Call your function from a nested loop in main(), which calls the function using every combination of negative, zero and positive numbers for both base and exponent. This will test your function without the user having to input all the data.Any code which calls the library pow() function will lose half of the assignment points.
#include <iostream> using namespace std; int power (int, int); int main() { int size = 10; int test[size]; int base;
I am trying to do a compute and output a power set program. The numbers will be input through a file. How to do a power set. Here is my code :
#include <iostream> #include <fstream> #include <string> #include <ostream> using namespace std; int main () { string array[21]; // creates array to hold names
I am trying to create a recursive function that i can call on in order to take a user inputed base and exponent and give final answer this is what i have but im completely lost after this i dont even know how to continue. What i have so far
#include <iostream> using namespace std; int Exp(int x,int y){ if(base <= 1 || exp == 0) return 1; if(exp == 1) return base; int main(){ int number, exp;
[Code] .....
After i set the base situations im not sure how to get the function to make the function take the base to the exponent recursively.
I did a function for lagrange interpolation formula. However i`m stuck on how do i substitute values into the power. Here is my code snippet :
for(int i=1;i<getSecretShare+1;i++) { //calculateValue=getSecret+(10*p)+(2 * pow(p,2)); int storeThreshold=getThreshold; calculateValue=getSecret+(10*i)+(2 * pow(i,2)); calculateFinalValue=calculateValue % 17 ; cout<<"the calculated value is "<<calculateFinalValue<<endl; }
The formula that i want to implement is that a + a1x^1 + a2x^2 + a(t-1) ^t-1
I have gotten the substitution of the x value out. However, i am stuck on how do i calculate the values according to the threshold which the user keys in. For example if the user keys in 3.
It will into account the no. of shares to generate which is for example 5 in this case, then it will then take into account the threshold keyed in , which is 3, i will then calculate using the formula using the no. of shares and also threshold. if the threshold is 3 and the number of shares to generate is 5. I should have the following:
the power depends on the threshold which is t-1, 3-1 =2
So I will have to generate two a values based on that and also calculate them according to the power that is dependent on the threshold the first value being to the power of 1 and the 2nd being to the power of 2 if the threshold is 4.
Then I will generate 3 a values and then calculate them :
I am using Windows 7 32bit OS and want to detect the CPU power button press event in my console application developing in C language.
I configured the power button setting to "Do Nothing" which is in "Choose what the power button does" options in Control Panel->Hardware and Sound->Power Options. So now i want to detect this power button press event and do some processing in my application then i will initate shut down from application itself. Looking for windows API details which will detect the power button press event.
I need an equation that determines the lowest possible cost for laying power line.
The variables are as follows:
1. The width of a river 2. The distance a factory is downstream from a station on the other side of the river. 3. The cost for laying line underwater. 4. The cost for laying line on land.
All these variables will be user input each use of program.
how to manually control the temperature of High Power Leds using PID controller. I have two GUIs,one reads the temperature from the Led while the second is used to ON/OFF the Leds and at the same time controls the Led brightness using slider control.The GUI that reads the temperature has a PID controller application on it.The output from this controller is what i want to use to increase or decrease the Led brightness which invariable changes the Led temperature.How to go about using this PID controller to control the Led brightness is what i have not been able to grasp well.The slider on the GUI is scaled from 0% to 100%.My thinking is that the output from the controller should be in percentage which will make me to adjust the slider accordingly.My question is that will this type of arrangment produce an output that will efficiently control the Led brightness. how to accomplish that. Attached to this post is a modified code of a tutorial on PID controller which i found on the net. a tutorial on how to develop a graph. i wish to display the Setpoint,Process value and the output value on a graph.
I have the following scenario: I plan to have an xml configuration file.I have a trader that lunch few strategies, each have different configurations. I plan to have all configuration reside in the same file as different nodes.
Now I want that each strategy will hard code the name of node it will loop up for its parameters. Since those paramters are requered for the init and I use DI (configuration are passed in the constructor) I want to make it static.
So this would be something like.
public class Strategy: Base_strategy{ public const string _conf_name = "XXX"; public static string get_conf_name(){
[Code]....
Since other people will code strategies, I want each strategy to implement this static function. I wanted to do this in an interface so that anyone coding new strategy,implementing the base strategy will have to code this static function as part of the contract.
I had a project to create an ATM with a database of 100 customers, i wasn't able to interface the real program with the database. I have submitted the project already. Here is the database and the ATM program
#include <stdio.h> int main(void) { int account, pin;
I am supposed to write a C program to send through USB interface to the analog device AD9914. Now I am doing the USB interface part where my computer has to detect the AD when it is plugged in and send the signals to it. I have to write the program to detect the device when it is plugged in. What kind of functions can I use? I know that the registry stores the device when it is plugged in. What functions are available to read?
I am not 100% confident that changing the existing interfaces will not be error-prone. Should I discard the new changes for ease of use or Adapt to new changes but having a higher risk of introducing new bugs?
old
Code: ///ContactResultCallback is used to report contact points structContactResultCallback { short intm_collisionFilterGroup; short intm_collisionFilterMask;
[Code] ....
New:
Code: ///ContactResultCallback is used to report contact points structContactResultCallback { short intm_collisionFilterGroup; short intm_collisionFilterMask;
I want to track the mouse movement. I know that GTk+ provides some powerful libraries for creating GUI, that will, among other things, enable me to write handlers for mouse movement events, but I'm looking for a simpler, more compact capabilities for now.
Is there a low level C library that will enable me to interface with the mouse?