Open main menu

CDOT Wiki β

Changes

BTP300B A2 Team 1 Bugs Report

5,172 bytes added, 18:58, 4 December 2013
no edit summary
Oct 19, Worked on it today and got the draw function up and running as well as fixed setLine since it seems I did it incorrectly and finally got it compiling and running properly in VS. For some reason though, absrow and abscol is causing a crash in VS but otherwise works fine in Borland (haven't had a chance to test it out in g++). added some code to A2test for testing the stuff I've coded.
 
Oct 21, Got started on display method. The abscol and absrow crash seems to only occur on the default A2test code not on my own personal test code which only creates 1 frame. The default A2test code create a nested frame (a small frame inside a larger frame) so maybe the problem lies in how VS is handling those nested frames?
 
Oct 21, Got the display method up and running. I added in the helper method void move(iFrame&) which handles getting the user input and moving the frame based on that input (user presses up key, it calls the move(CDirection method) which moves the frame in the appropriate direction). I'm having a bit of trouble with it though, in a2test the parameter is passed a CFrame but the method itself (both the definition in iFrame and the CFrame helper method) are set to recieve iFrames. The method move(iFrame& x) should be able to recieve a CFrame since a CFrame is an iFrame and in a2test the calls to move method are all being passed CFrames. Figuring out how to fix this.
 
Oct 22, I've sent an email to Peter asking for help about the issue with the
 
error: invalid initialization of reference of type cio::iFrame& from expression of type cio::CFrame
 
when calling the helper method void move(iFrame &x) which handles getting user input on the direction the user wants the frame to move. Currently working on move(CDirection) method which handles moving the actual frame.
 
Just finished with the move(CDirection) and the frame now moves around inside either the console (I still need to test if it will do the same if it is a child frame inside a parent frame though it should.). I also added a new char* string called contentBuffer which will hold the information held in display and edit when the user moves the frame and it has to be redrawn.
 
Oct 23, Need to figure out what is causing the move(iFrame&) method to not accept the CFrame classes being passed to it since that will be handling getting the user input and calling the move(CDirection) method which will actually move the frame. It technically should be accepting receiving a CFrame object since a CFrame is an implementation of the iFrame interface. For instance in a2test.cpp, the method testFrame() creates a CFrame object then calls move(iFrame&) method but it results in the following error:
 
error: invalid initialization of reference of type cio::iFrame& from expression of type cio::CFrame
 
I haven't heard from Peter yet and I've been pretty stumped with it since yesterday.
 
If you could take a look at that in the assignment that would help alot. Right now move(iFrame&) is declared in CFrame.h and implemented in CFrame.cpp (although it is empty since no functionality is coded for it right now).
 
 
void testFrame() {
bool done = false;
CFrame frame;
CFrame outer(5, 10, 50, 15, true, "+-+|+-+|", &frame);
CFrame inner(5, 10, 20, 5, true, C_BORDER_CHARS, &outer);
 
outer.draw();
inner.draw();
console.setPosition(0, 0);
console << "Press any key...";
console.pause();
 
do {
int key;
console.setPosition(0, 0);
console << "ESC: exit, F6: Move Container, F7: Move Inner border";
console >> key;
switch(key) {
case ESCAPE:
done = true;
break;
case F(6):
move(outer); //<--------- this should be accepting the CFrame object but is not for some reason. Also note, I've got this commented out right now in
a2_v9.zip. Just uncomment it and try to compile the code.
inner.draw();
break;
case F(7):
// move(inner);
break;
}
} while(!done);
 
outer.hide();
inner.hide();
console.clear();
}
 
Oct 29, I don't think there's much that's left to do, just handle getting the user input to move the frame around and fix any bugs that causes it to fail any of the a2test tests.
 
Nov 1, goofed up. Realized I forgot to pass on the SVN accounts to the rest of the team. Team kept each other up to date with the latest developments via email chains so not using the SVN really did not impact progress of the project that much.
 
Nov 2, I'm still trying to figure out why the move method isn't working properly in the a2test. I used my own code that I added to the a2testfile and the move method works perfectly but for some reason in the actual a2test code it moves once and then just stops. I suspect that maybe we've commented out code that we should not have commented out. I think I've figured out the problem, the error occurs when the frame being moved has a parent frame, so we should probably take a look at how the parent frames are handled by the program and by the move method in particular.
 
works fine like this:
CFrame myFrameParent(2, 2, 40, 10, true, "$-%|*+@-", NULL);
 
but the bug arises when move is called on a frame with a parent frame.
 
CFrame myFrame();
CFrame myFrameParent(2, 2, 40, 10, true, "$-%|*+@-", &myFrame);
 
 
 
 
 
 
 
1
edit