Writing to SD Card from Class with State Machine

I made a program that activates solenoids which turn on a heated device, a thermocouple checks to see if the heat was detected, and it keeps track of the cycles. I had this working perfectly in a traditional loop setup, but I decided for flexibility with the number and type of devices, I would rewrite the program with a class so I would only have to add 2 lines of code to add another device.

The problem:
Before, everything was logged to the SD/RTC shield I had, and it worked great. When I try using the sd card now though, it seems like it doesn’t like to work with the class. I need the logger to log either each device in it’s own column, or create a separate file for each device, but I am not sure how to go about it. I am including code of the current project which works, lights a light after 1000 cycles is reached, lights a different light when the device stops heating, etc, but nothing included about the SD card or RTC, since I don’t have anything remotely close to working.

Thanks

#include <SPI.h>
#include <Wire.h>




double readCelsius(uint8_t cs) {
  uint16_t v;
  digitalWrite(cs, LOW);
  v = SPI.transfer(0x00);
  v <<= 8;
  v |= SPI.transfer(0x00);
  digitalWrite(cs, HIGH);
  if (v & 0x4) {
    // uh oh, no thermocouple attached!
    return NAN;
  }
  v >>= 3;
  return v * 0.25;
}

class Cycle
{
  private:
    byte pinSol;
    byte pinTherm;
    byte resetPin;
    byte donePin;
    byte fillPin;

    boolean solState = HIGH;
    boolean thermState = LOW;
    boolean resetState = LOW;

    unsigned long onTime;
    unsigned long offTime;
    unsigned long firstReading = 0;
    unsigned long secondReading = 0;
    unsigned long tmpReading;
    unsigned long nextChangeTime = 0;
    unsigned long count = 0;
    unsigned long fail = 0;
    unsigned long nextReading = 0;

  public:
    Cycle(byte pinSol, byte pinTherm, byte resetPin, byte fillPin, byte donePin, unsigned long onTime, unsigned long offTime) {
      this->pinSol = pinSol;
      this->onTime = onTime;
      this->offTime = offTime;
      this->resetPin = resetPin;
      this->pinTherm = pinTherm;
      this->donePin = donePin;
      this->fillPin = fillPin;

      pinMode(pinSol, OUTPUT);
      pinMode(resetPin, INPUT);
      pinMode(pinTherm, OUTPUT);
      pinMode(donePin, OUTPUT);
      pinMode(fillPin, OUTPUT);

    }
    void Activate()
    {
      unsigned long currentTime = millis();
      if(count>=999){
        digitalWrite(donePin, HIGH);
      }
      resetState = 0;
      resetState = digitalRead(resetPin);
      if (resetState == 1) {
        fail = 0;
        digitalWrite(fillPin, LOW);
      }
      if (currentTime - nextReading >= 200) {
        nextReading = millis();
        if (solState == LOW) {
          tmpReading = (readCelsius(pinTherm));
          if (tmpReading > firstReading) {
            firstReading = tmpReading;
          }
        }
        if (solState == HIGH) {
          tmpReading = (readCelsius(pinTherm));
          if (tmpReading > secondReading) {
            secondReading = tmpReading;
          }
        }
      }
      if ((fail < 4) && (count<=999)) {
        if (currentTime >= nextChangeTime) {
          Serial.print(firstReading);
          Serial.print(" ");
          Serial.print(secondReading);
          Serial.print(" ");
          Serial.print(count);
          Serial.print(" ");
          Serial.println(fail);
          if (solState == HIGH) {
            solState = LOW;
            nextChangeTime = currentTime + onTime;
            if (secondReading >= (firstReading + 5)) {
              secondReading = 0;
              firstReading = 0;
              count++;
              fail = 0;
            } else {
              fail++;
              secondReading = 0;
              firstReading = 0;
            }
          } else {
            solState = HIGH;
            nextChangeTime = currentTime + offTime;
          }
        }
      } else {
        solState = HIGH;
        digitalWrite(fillPin,HIGH);
      }
      digitalWrite(pinSol, solState);  
    }
};

//              (solenoid pin, thermocouple pin, reset button pin, fill pin, finished pin, on time, off time)
Cycle sample1 = Cycle(2, 22, 11, 5, 30, 3000, 20000);
Cycle sample2 = Cycle(3, 24, 12, 6, 32, 3000, 20000);
Cycle sample3 = Cycle(4, 26, 13, 7, 34, 3000, 20000);

void setup() {
  SPI.begin();
  Serial.begin(9600);
}

void loop() {
  sample1.Activate();
  sample2.Activate();
  sample3.Activate();
}

I'm missing a state variable that could be used to track the machine state.

For debugging I'd use a single object only and add output whenever the state changes. Then you can see in which state the machine is hanging.