From d7810b4e95f50d45ba50c5362863b667971c7803 Mon Sep 17 00:00:00 2001
From: Aaron Cuevas Lopez <aacuelo@teleco.upv.es>
Date: Sun, 22 Feb 2015 18:28:12 +0100
Subject: [PATCH] Fix wrong index generation on renamed saving

---
 Source/Processors/Channel/Channel.cpp                   | 2 +-
 Source/Processors/GenericProcessor/GenericProcessor.cpp | 3 +++
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/Source/Processors/Channel/Channel.cpp b/Source/Processors/Channel/Channel.cpp
index b66b9d32f..e3a20afb7 100644
--- a/Source/Processors/Channel/Channel.cpp
+++ b/Source/Processors/Channel/Channel.cpp
@@ -24,7 +24,7 @@
 #include "Channel.h"
 
 
-Channel::Channel(GenericProcessor* p, int n, ChannelType t) : index(n), processor(p), type(t), nodeIndex(0), mappedIndex(n)
+Channel::Channel(GenericProcessor* p, int n, ChannelType t) : index(n), processor(p), type(t), nodeIndex(0), mappedIndex(0)
 {
     reset();
 }
diff --git a/Source/Processors/GenericProcessor/GenericProcessor.cpp b/Source/Processors/GenericProcessor/GenericProcessor.cpp
index 08191048b..618d475b8 100755
--- a/Source/Processors/GenericProcessor/GenericProcessor.cpp
+++ b/Source/Processors/GenericProcessor/GenericProcessor.cpp
@@ -369,6 +369,7 @@ void GenericProcessor::update()
             ch->bitVolts = getBitVolts(ch);
             ch->sourceNodeId = nodeId;
             ch->nodeIndex = nidx;
+			ch->mappedIndex = nidx;
 
             if (i < recordStatus.size())
             {
@@ -392,6 +393,7 @@ void GenericProcessor::update()
             ch->bitVolts = getBitVolts(ch);
             ch->sourceNodeId = nodeId;
             ch->nodeIndex = nidx;
+			ch->mappedIndex = nidx;
 
             if (j < recordStatus.size())
             {
@@ -415,6 +417,7 @@ void GenericProcessor::update()
             ch->bitVolts = getBitVolts(ch);
             ch->sourceNodeId = nodeId;
             ch->nodeIndex = nidx;
+			ch->mappedIndex = nidx;
 
             if (k < recordStatus.size())
             {
-- 
GitLab